init-cc-structure

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Init 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.md
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.md

Lite Mode

精简模式

project-root/
├── CLAUDE.md
├── README.md
├── docs/
│   ├── architecture.md
│   ├── decisions/
│   │   └── 000-template.md
│   └── runbooks/
└── .claude/
    └── settings.json
project-root/
├── CLAUDE.md
├── README.md
├── docs/
│   ├── architecture.md
│   ├── decisions/
│   │   └── 000-template.md
│   └── runbooks/
└── .claude/
    └── settings.json

Workflow

工作流程

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.
QuestionDefault
Structure mode (
full
or
lite
)
full
Project nameCurrent directory name
Project description
A project powered by Claude Code
Tech stack(leave blank)
Source modules needing local CLAUDE.md (comma-separated)
api, persistence
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.
向用户询问以下内容。告知用户可以输入“跳过”或“使用默认值”来接受所有默认设置并立即继续。
问题默认值
结构模式(
full
lite
full
项目名称当前目录名称
项目描述
A project powered by Claude Code
技术栈(留空)
需要本地CLAUDE.md的源模块(逗号分隔)
api, persistence
如果用户选择精简模式,跳过“源模块”问题——该问题不适用。
对于常见配置,可查看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
{PROJECT_NAME}
,
{PROJECT_DESCRIPTION}
,
{TECH_STACK}
, and
{MODULE}
with values from Step 1. If a value is blank, remove the placeholder line entirely rather than leaving an empty line.
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
    src/
    and
    tools/
读取references/templates.md获取文件内容模板。将模板中的
{PROJECT_NAME}
{PROJECT_DESCRIPTION}
{TECH_STACK}
{MODULE}
替换为步骤1中获取的值。如果值为空,则完全删除占位符行,而非保留空行。
精简模式调整: 在精简模式下创建文件时,从模板中删除所有仅涉及完整模式目录的行:
  • 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
.gitkeep
):
  • docs/runbooks/
Files to create (from templates):
  • CLAUDE.md
    — project memory and navigation
  • README.md
    — project overview
  • docs/architecture.md
    — system architecture placeholder
  • docs/decisions/000-template.md
    — ADR template
  • .claude/settings.json
    — empty config
需要创建的目录(包含
.gitkeep
):
  • docs/runbooks/
需要创建的文件(来自模板):
  • CLAUDE.md
    — 项目记忆与导航
  • README.md
    — 项目概述
  • docs/architecture.md
    — 系统架构占位文件
  • docs/decisions/000-template.md
    — ADR模板
  • .claude/settings.json
    — 空配置文件

Full mode only

仅完整模式包含

Additional directories to create (with
.gitkeep
):
  • .claude/hooks/
  • tools/scripts/
Additional files to create (from templates):
  • tools/prompts/example-prompt.md
    — sample prompt template
  • .claude/skills/code-review/SKILL.md
    — code review skill
  • .claude/skills/refactor/SKILL.md
    — refactor skill
  • .claude/skills/release/SKILL.md
    — release skill
  • src/{module}/CLAUDE.md
    — one per module from Step 1. If a module path already contains a top-level directory (e.g.
    apps/web
    ), use it directly instead of nesting under
    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
    — 发布技能
  • src/{module}/CLAUDE.md
    — 为步骤1中的每个模块创建一个。如果模块路径已包含顶级目录(如
    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等)