Analyze a codebase and generate a mirrored Specs folder skeleton. Produces layered specification documents from macro to micro, with top-level files filled in and inner files as skeleton placeholders.
Analyze a codebase and generate a mirrored Specs folder with layered specification documents.
| Parameter | Required | Default | Description |
|---|---|---|---|
project_path | Yes | — | Absolute path to the project root directory |
output_path | No | specs-for-{project-name}/ | Where to write the generated Specs |
lang |
| No |
en |
Language for generated Specs (en or zh) |
You are about to analyze a codebase and generate a complete Specs folder. Follow these steps precisely.
README.md, README.rst, readme.txt). If none exists, note this.main.*, index.*, app.*, server.*, cli.*, __main__.py, cmd/, src/main.* or equivalent entry points.package.json, Cargo.toml, pyproject.toml, go.mod, pom.xml, build.gradle, Makefile, Dockerfile, tsconfig.json, etc.src/, lib/, pkg/, internal/)Create the output directory and mirror the source structure:
{output_path}/
├── 00_overview.md
├── 01_architecture.md
├── 02_data_flow.md
├── _mapping.md
├── _glossary.md
│
├── {source-dir}/ ← mirrors the project's source directory
│ ├── _index.md
│ ├── {subdir-1}/
│ │ ├── _index.md
│ │ └── {file}.md ← skeleton spec for key source files
│ ├── {subdir-2}/
│ │ ├── _index.md
│ │ └── ...
│ └── ...
│
└── _cross-cutting/ ← only if cross-cutting concerns are identified
├── error_handling.md
├── logging.md
└── ...
Rules:
tests/, docs/, node_modules/, vendor/, .git/, build output, etc.)_index.md{filename}.md spectemplates/ as the base format for each file typeThese files should be filled in with real content (not skeleton):
00_overview.mdUse the template from templates/overview.md. Fill in:
01_architecture.mdUse the template from templates/architecture.md. Fill in:
02_data_flow.mdUse the template from templates/data_flow.md. Fill in:
_index.md for Every DirectoryUse the template from templates/_index.md. For each directory:
Use the template from templates/spec_file.md. For each key source file:
status: skeleton in frontmattermaps_to: to the relative source file path# Module Name heading and ## One-line SummaryWhat counts as a "key source file":
_mapping.mdUse the template from templates/_mapping.md:
_glossary.mdUse the template from templates/_glossary.md:
Before finishing:
_index.md files have been createdstatus: skeletonAfter completion, report:
✅ Specs generated at: {output_path}/
- Top-level files: 5 (overview, architecture, data_flow, mapping, glossary)
- Directory index files: {N}
- Skeleton specs: {N}
- Total files: {N}
- Tech stack: {languages}, {frameworks}
- Core modules identified: {list}
If lang: zh, use Chinese for all generated content:
## 一句话描述, ## 职责, ## 输入/输出, ## 关键约束, ## 与其他模块的关系, ## 实现笔记_glossary.md should include both Chinese and English for each termIf lang: en (default), use English for all content.