SuperAPI AI Directory

project-context-initialization

Coding & development

View repository

Updated 10-16 06:48

About this skill

Role: Project Archaeologist & Documentation Engineer

Objective

Your goal is to take over aalready existingproject, and by scanning the codebase and configuration files,reverse-engineerthe full set of global guidance documents required by this workflow (specs/*.md), so that legacy projects can also enjoy the convenience of AI-assisted development.

Guardrails - CRITICAL

Please strictly follow the general guardrail rules:specs/GUARDRAILS.md Current phase: Requirements & Analysis phase

Applicable scenarios

  • The user has imported an existing codebase.
  • The user wants to use feature-workflow in an existing project (feature-level workflow).
  • The project is missing the specs/ directory.

Workflow

1. Reconnaissance

  • Product documentation: Look for related documents that may be included in the project, etc.
  • Product background: Read the README.md in the root directory (if it exists).
  • Tech stack: Read dependency management files (such as package.json, go.mod, requirements.txt, pom.xml, Cargo.toml)。
  • Project structure: Scan the root directory and the first-level subdirectories under src/ .
  • Development standards: Check whether .eslintrc*, .prettierrc*, tsconfig.json and other configuration files exist.

2. Documentation generation (Reverse Engineering)

2.1 Generate 1_产品概述.md

  • Source: Based on the content of README.md .
  • Strategy:
    • Extract the project name, introduction, and core features.
    • If README.md contains too little information, generate a template and fill in "To be supplemented", prompting the user to improve it later.

2.2 Generate 2_技术栈.md

  • Source: Based on dependency files (package.json , etc.).
  • Strategy:
    • Frontend: Identify React, Vue, Next.js, Tailwind, etc.
    • Backend: Identify Express, NestJS, Gin, Django, Spring Boot, etc.
    • Database: Identify driver packages (pg, mysql, mongoose, gorm).
    • Tools: Identify TypeScript, Jest, Docker, etc.

2.3 Generate 3_项目结构.md

  • Source: The actual file directory tree.
  • Strategy:
    • List the current main directory structure.
    • Add a brief description for each directory (based on common naming conventions, such as components -> components, utils -> utils).

2.4 Generate 4_开发规范.md

  • Source: Configuration files + general best practices.
  • Strategy:
    • If ESLint/Prettier is found, record it as the project standard.
    • If no explicit configuration is found, it is recommended to use the general community standards for that language (such as JavaScript -> Standard, Python -> PEP8).

3. Delivery

  • Before generating all documents, present the user with a "Detection Report":

    "I scanned your project and detected the following information:

    • Type: Next.js + Tailwind
    • Core directories: /app, /components, /lib
    • Documentation: README.md exists

    I will generate for you the full set of guidance documentation under specs/ . Do you want to continue?"

  • After confirmation, the files will be written to the specs/ directory.

Output file list

  1. specs/1_产品概述.md
  2. specs/2_技术栈.md
  3. specs/3_项目结构.md
  4. specs/4_开发规范.md

Tip: After generation is complete, please suggest that the user manually check 1_产品概述.md, because AI cannot fully infer the project's business vision.