Enterprise Front-end Development Specification
Paste the following prompt into your AI chat to install this skill:
Please refer to https://skillhub.cn/install/skillhub.md to install @user_27ccabd4/frontend-spec.
About this skill
Why Does a Unified Front-end Development Specification Matter?
In collaborative front-end projects, a common and thorny issue is the lack of coding standardization. This manifests as inconsistent directory structures, varied naming conventions, arbitrary CSS class naming, and divergent JavaScript writing styles. This disorder directly reduces code readability, hinders component reuse, slows down onboarding for new developers, and introduces numerous potential bugs during later maintenance. A clear, unified development specification is fundamental to maintaining the health of large-scale front-end projects.
Core Capabilities and How This Skill Works
This skill (@user_27ccabd4/frontend-spec) is not a code generator or dependency, but rather a comprehensive, actionable set of enterprise-level front-end development conventions. It provides clear coding guidelines for teams through detailed descriptions and examples. Its core capabilities and key steps are as follows:
- Establishes a Clear Project Skeleton: It first defines a standardized
src/directory structure. For instance, usingapi/for interface requests,components/for shared components, andstore/for state management code. This fundamentally resolves issues of chaotic project organization. - Unifies Coding Detail Conventions: It specifies detailed naming standards for files, variables, components, and even comments (e.g., components in PascalCase
UserList.vue, constants inUPPER_SNAKE_CASEMAX_COUNT), eliminating differences caused by individual habits. - Standardizes Language and Framework Practices: It provides concrete best practice guidelines for
HTML(semantic tags),CSS/SCSS(BEM naming, prohibiting deep nesting),JavaScript/TypeScript(banningvar, preferringasync/await), and major frameworks likeVueorReact. - Integrates Engineering Workflows: It incorporates engineering processes like
Gitcommit messages (e.g.,feat(scope): content) andESLint/Prettierformatting rules (e.g., 2-space indentation, single quotes) into the specification, ensuring consistency from writing to submission. - Covers Quality and Security Baselines: The specification finally emphasizes non-negotiable bottom-line rules for performance optimization (e.g., image lazy loading, virtual scrolling) and security hardening (e.g., preventing
XSS, prohibiting plaintext storage of keys/tokens in the front end).
Applicability and Considerations
This specification is primarily designed for mid-to-backoffice applications, mobile web apps, or standard web projects using Vue or React tech stacks. Please note, this is a recommended set of conventions. Teams need to discuss and reach a consensus before adopting it, incorporating it as part of the project's CONTRIBUTING.md or Wiki. For legacy projects or special scenarios, teams may selectively adopt certain clauses for a smooth transition. The vitality of a specification lies in its continuous adherence and appropriate evolution, not in a one-time, forceful imposition.
Use Cases
- Starting a brand new front-end project and needing to plan a clear directory structure to facilitate subsequent component reuse and modular management.
- In team collaborative development, needing to unify the Git commit message format and code style for all members to ensure a clear and traceable commit history.
- Configuring ESLint and Prettier rules for a project or module, requiring a clear agreement covering details like indentation, quotes, and semicolons.
- Conducting performance optimization on an existing project, needing to identify improvement points based on specifications for image loading, component rendering, and list scrolling.
Best For
- Technical leads or architects responsible for technology selection and architecture design of new projects, who need to establish unified development standards for the team.
- Front-end engineers writing and reviewing code in multi-person projects, who need to quickly consult and comply with the team's established conventions.
- Full-stack engineers who need to handle both front-end and back-end code and wish to have a clear front-end coding convention to reduce context-switching costs.
- New members who have just joined an existing front-end project and need to quickly understand and integrate into its codebase standards and collaboration workflow.
Related Skills
A systematic code error fixing skill that follows a five-step workflow: Reproduce, Isolate, Understand, Fix, Verify, to help developers resolve code errors.
Supports inline SVG/HTML rendering and Mermaid code output, covering common technical diagram creation like architecture and flow diagrams.
A comprehensive browser automation guide covering navigation, interaction, multi-tab management, and data collection, tailored for domestic web ecosystems and tools like Playwright/Selenium.
This skill provides end-to-end automation for WeChat Mini Program development, covering building, debugging, previewing, testing, and publishing, with integrated code quality analysis and dependency management.