init-cc-structure
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseInit Claude Code Project Structure
初始化Claude Code项目结构
Scaffold an AI-native repository so Claude Code operates like an engineer, not a chatbot.
搭建AI原生仓库,让Claude Code像工程师一样工作,而非聊天机器人。
Structure Modes
结构模式
Full Mode (default)
完整模式(默认)
project-root/
├── CLAUDE.md
├── README.md
├── docs/
│ ├── architecture.md
│ ├── decisions/
│ │ └── 000-template.md
│ └── runbooks/
├── .claude/
│ ├── settings.json
│ ├── hooks/
│ └── skills/
│ ├── code-review/
│ │ └── SKILL.md
│ ├── refactor/
│ │ └── SKILL.md
│ └── release/
│ └── SKILL.md
├── tools/
│ ├── scripts/
│ └── prompts/
│ └── example-prompt.md
└── src/
├── {module}/
│ └── CLAUDE.md
└── {module}/
└── CLAUDE.mdproject-root/
├── CLAUDE.md
├── README.md
├── docs/
│ ├── architecture.md
│ ├── decisions/
│ │ └── 000-template.md
│ └── runbooks/
├── .claude/
│ ├── settings.json
│ ├── hooks/
│ └── skills/
│ ├── code-review/
│ │ └── SKILL.md
│ ├── refactor/
│ │ └── SKILL.md
│ └── release/
│ └── SKILL.md
├── tools/
│ ├── scripts/
│ └── prompts/
│ └── example-prompt.md
└── src/
├── {module}/
│ └── CLAUDE.md
└── {module}/
└── CLAUDE.mdLite Mode
精简模式
project-root/
├── CLAUDE.md
├── README.md
├── docs/
│ ├── architecture.md
│ ├── decisions/
│ │ └── 000-template.md
│ └── runbooks/
└── .claude/
└── settings.jsonproject-root/
├── CLAUDE.md
├── README.md
├── docs/
│ ├── architecture.md
│ ├── decisions/
│ │ └── 000-template.md
│ └── runbooks/
└── .claude/
└── settings.jsonWorkflow
工作流程
Step 1: Gather Project Info
步骤1:收集项目信息
Ask the user for the following. Tell the user they can say "skip" or "use defaults"
to accept all defaults and proceed immediately.
| Question | Default |
|---|---|
Structure mode ( | |
| Project name | Current directory name |
| Project description | |
| Tech stack | (leave blank) |
| Source modules needing local CLAUDE.md (comma-separated) | |
If the user chose lite mode, skip the "Source modules" question — it does not apply.
For common configurations, see examples.md to suggest sensible defaults
based on the user's tech stack.
向用户询问以下内容。告知用户可以输入“跳过”或“使用默认值”来接受所有默认设置并立即继续。
| 问题 | 默认值 |
|---|---|
结构模式( | |
| 项目名称 | 当前目录名称 |
| 项目描述 | |
| 技术栈 | (留空) |
| 需要本地CLAUDE.md的源模块(逗号分隔) | |
如果用户选择精简模式,跳过“源模块”问题——该问题不适用。
对于常见配置,可查看examples.md,根据用户的技术栈推荐合理的默认值。
Step 2: Check Existing Files
步骤2:检查现有文件
Check every target file and directory before creating. Skip anything that already exists.
Collect skipped items for the summary in Step 4.
在创建前检查所有目标文件和目录。跳过已存在的内容。收集跳过的项目,用于步骤4的总结。
Step 3: Create Files
步骤3:创建文件
Read references/templates.md to get the file content templates.
Substitute , , , and with
values from Step 1. If a value is blank, remove the placeholder line entirely rather than
leaving an empty line.
{PROJECT_NAME}{PROJECT_DESCRIPTION}{TECH_STACK}{MODULE}Lite mode adjustment: When creating files in lite mode, remove all lines that
reference full-mode-only directories from the templates:
- In CLAUDE.md Repo Structure: remove lines for ,
src/,.claude/skills/,.claude/hooks/tools/ - In CLAUDE.md Allowed: remove
Refactor any file in src/ - In README.md Project Structure: remove lines for and
src/tools/
读取references/templates.md获取文件内容模板。将模板中的、、和替换为步骤1中获取的值。如果值为空,则完全删除占位符行,而非保留空行。
{PROJECT_NAME}{PROJECT_DESCRIPTION}{TECH_STACK}{MODULE}精简模式调整: 在精简模式下创建文件时,从模板中删除所有仅涉及完整模式目录的行:
- 在CLAUDE.md的仓库结构部分:删除、
src/、.claude/skills/、.claude/hooks/对应的行tools/ - 在CLAUDE.md的允许操作部分:删除
Refactor any file in src/ - 在README.md的项目结构部分:删除和
src/对应的行tools/
Common (both modes)
通用内容(两种模式均包含)
Directories to create (with ):
.gitkeepdocs/runbooks/
Files to create (from templates):
- — project memory and navigation
CLAUDE.md - — project overview
README.md - — system architecture placeholder
docs/architecture.md - — ADR template
docs/decisions/000-template.md - — empty config
.claude/settings.json
需要创建的目录(包含):
.gitkeepdocs/runbooks/
需要创建的文件(来自模板):
- — 项目记忆与导航
CLAUDE.md - — 项目概述
README.md - — 系统架构占位文件
docs/architecture.md - — ADR模板
docs/decisions/000-template.md - — 空配置文件
.claude/settings.json
Full mode only
仅完整模式包含
Additional directories to create (with ):
.gitkeep.claude/hooks/tools/scripts/
Additional files to create (from templates):
- — sample prompt template
tools/prompts/example-prompt.md - — code review skill
.claude/skills/code-review/SKILL.md - — refactor skill
.claude/skills/refactor/SKILL.md - — release skill
.claude/skills/release/SKILL.md - — one per module from Step 1. If a module path already contains a top-level directory (e.g.
src/{module}/CLAUDE.md), use it directly instead of nesting underapps/web.src/
额外需要创建的目录(包含):
.gitkeep.claude/hooks/tools/scripts/
额外需要创建的文件(来自模板):
- — 示例提示模板
tools/prompts/example-prompt.md - — 代码审查技能
.claude/skills/code-review/SKILL.md - — 重构技能
.claude/skills/refactor/SKILL.md - — 发布技能
.claude/skills/release/SKILL.md - — 为步骤1中的每个模块创建一个。如果模块路径已包含顶级目录(如
src/{module}/CLAUDE.md),则直接使用该路径,无需嵌套在apps/web下。src/
Step 4: Output Summary
步骤4:输出总结
Print results in this format:
Claude Code project structure initialized! (mode: {full|lite})
Created:
- CLAUDE.md — Project memory & navigation
- README.md — Project overview
- docs/architecture.md — System architecture placeholder
- docs/decisions/000-template.md — ADR template (ready to use)
- .claude/settings.json — Claude Code configuration
[full mode only:]
- tools/ — Scripts and prompt templates
- .claude/skills/ — 3 built-in skills (code-review, refactor, release)
- .claude/hooks/ — Automation hooks directory
- src/{modules} — Module-level context files
Skipped (already exist):
- {list or "None"}
Next steps:
1. Fill in the TODO placeholders in CLAUDE.md
2. Document your architecture in docs/architecture.md
[full mode only:]
3. Customize the skills in .claude/skills/
4. Add module-specific context in src/*/CLAUDE.md按以下格式打印结果:
Claude Code项目结构已初始化!(模式:{full|lite})
已创建:
- CLAUDE.md — 项目记忆与导航
- README.md — 项目概述
- docs/architecture.md — 系统架构占位文件
- docs/decisions/000-template.md — ADR模板(可直接使用)
- .claude/settings.json — Claude Code配置文件
[仅完整模式包含:]
- tools/ — 脚本与提示模板
- .claude/skills/ — 3个内置技能(code-review、refactor、release)
- .claude/hooks/ — 自动化钩子目录
- src/{modules} — 模块级上下文文件
已跳过(已存在):
- {列表或“无”}
后续步骤:
1. 填写CLAUDE.md中的TODO占位符
2. 在docs/architecture.md中记录系统架构
[仅完整模式包含:]
3. 自定义.claude/skills/中的技能
4. 在src/*/CLAUDE.md中添加模块特定上下文Reference Files
参考文件
- references/templates.md — file content templates for all generated files
- examples.md — common project configurations (Vue, React, Next.js, FastAPI, etc.)
- references/templates.md — 所有生成文件的内容模板
- examples.md — 常见项目配置(Vue、React、Next.js、FastAPI等)