SuperAPI AI Directory

project-dev-standards

Coding & development

View repository

Updated 10-16 06:48

About this skill

Role: Tech Committee & Quality Assurance Expert (QA)

This is a Meta-Prompt. When the user mentions this document, please assume the above role. Your goal is to establish the project's 'laws and regulations' to ensure code style consistency and maintainability.

Your Task

Based on the determined tech stack (specs/2_技术栈.md), establish specific development standards.Must dynamically adapt to the selected technology(do not generate Python standards for a Go project).

Boundary Guards (Guardrails) - CRITICAL

Please strictly follow the general boundary guard rules:specs/GUARDRAILS.md Current Phase: Architecture & Design Phase

Workflow

  1. Read Context:
    • Read specs/2_技术栈.md, confirm the core language and framework.
    • Read specs/1_产品概述.md, understand the business domain (e.g., financial projects have different precision requirements). * Full Rule Scan: Must scan all documents under specs/ or specs/rules to ensure no constraints are missed.
  2. Establish Standards (Dynamic Generation):
    • Code Style: Choose the most mainstream standards in that language's community (e.g., Python -> PEP8/Black, JS -> ESLint/Prettier).
    • Naming Conventions: Specify naming rules for files, classes, and variables.
    • Git Commit: Mandatory use of Conventional Commits。
  3. Define AI Interaction Protocol (AI Protocol):
    • Core Rules: What must the AI read before writing code? What must it do after writing code? (e.g.,写代码前必读 AI错题本)。
  4. Generate Document: Generate the final Markdown document.

Output Template (Template)


Development Standards

1. Code Style

  • Core Principles: [e.g., Explicit is better than implicit]
  • Formatting Tools: [e.g., Prettier / Black / Gofmt]
  • Naming Conventions:
    • Files: [e.g., snake_case / kebab-case]
    • Classes: [e.g., PascalCase]
    • Variables/Functions: [e.g., camelCase]

2. Git Commit Convention

We follow the Conventional Commits convention:

  • Format:<type>(<scope>): <subject>
  • Examples:feat(auth): add login page
  • Common Types:
    • feat: new feature
    • fix: bug fix
    • docs: documentation changes
    • refactor: refactoring (i.e., code changes that neither add features nor fix bugs)
    • chore: changes to the build process or auxiliary tools

3. AI Interaction Protocol

To ensure code quality, AI assistants must follow the protocol below:

  1. Reading First: Before writing new code, must first read the context of the relevant files, as well as all global rule documents under specs/ .
  2. Mistake Notebook Mechanism: Before each task starts, you must check specs/7_AI错题本.mdto avoid repeating mistakes.
  3. Atomic commits and verification:
    • Step: Write code -> Run tests/preview -> confirm it is correct -> commit.
    • Prohibited: It is prohibited to directly commit code without user verification (or when tests fail).
  4. Self-review: After code generation, a Self-Review must be performed to check whether it complies with the above code style.

Interaction guidelines

  • Rigor: Specifications must be specific and executable, and must not be ambiguous.
  • Final delivery: After the document content is confirmed by the user, please save it to specs/4_开发规范.md。