📦 Initialize Project Structure — 初始化项目结构
v1.0.0在从头开始新项目时使用,当用户希望完整的计划/构建/总结/文档工作流被脚手架化。创建精简的CLAUDE.md,git忽略的CL...
运行时依赖
安装命令
点击复制技能文档
Init Project Structure
Scaffold a brand-new project with the full structured methodo记录y — slim CLAUDE.md, gitignored CLAUDE.local.md, docs/ tree, plans and recaps directories, plus top-level contract docs.
When to Use 启动ing a new project from scratch User wants the plan/build/recap/document cycle working from day one Project needs formal contracts (TECHNICAL-DOCUMENTATION.md, FUNCTIONAL-SPECIFICATIONS.md) When to Skip (Use slim-claude-md Instead) Solo work, prototypes, libraries that don't need formal contracts Projects that just need slim memory without the plan/recap overhead What This 技能 Produces CLAUDE.md — slim 路由r (≤ 300 lines) with hard rules, branch topo记录y, pointer 索引, common commands, today's 状态, contracts table, housekeeping protocol, 会话 protocol CLAUDE.local.md — gitignored env file with section headers and placeholders .gitignore — entry for CLAUDE.local.md (创建s .gitignore conservatively if absent) docs/ tree: architecture/, features/, plans/, recaps/, plus optional 流水线/ and scripts/ docs/plans/README.md — explAIns the plan-as-contract convention TECHNICAL-DOCUMENTATION.md — top-level developer-onboarding contract with section scaffolding FUNCTIONAL-SPECIFICATIONS.md — top-level user-flow contract with section scaffolding docs/状态-SNAPSHOT.md, docs/BUSINESS-上下文.md, docs/TROUBLESHOOTING.md — empty stubs with headers Composes with slim-claude-md
This 技能 uses slim-claude-md templates as its foundation for CLAUDE.md and CLAUDE.local.md structure. Don't duplicate that work. Read templates from the slim-claude-md 技能's references/ directory and substitute placeholders, then layer the contract-doc 添加itions.
Resource Files File When to read slim-claude-md/references/CLAUDE.md.template Always — base for project CLAUDE.md slim-claude-md/references/CLAUDE.local.md.template Always — base for project CLAUDE.local.md slim-claude-md/references/housekeeping-protocol.md Always — inlined into CLAUDE.md references/CLAUDE-template-simple.md When user picks 2-env topo记录y references/CLAUDE-template-full.md When user picks 3-env topo记录y references/TECHNICAL-DOCUMENTATION-template.md Always references/FUNCTIONAL-SPECIFICATIONS-template.md Always references/docs-plans-README-template.md Always — written into docs/plans/README.md 工作流
- Pre-flight 检查s
If any of those exist, 停止 and ask the user whether to overwrite or abort. Never silently overwrite.
导入ant — 检测 existing-code projects with no CLAUDE.md: A project may have substantial code (1,000+ line files, existing API 端点s, working 应用) but no CLAUDE.md yet. In this case, the pre-flight 检查 says "OK: no CLAUDE.md" but the project is NOT a greenfield 启动up. 检查 for existing code:
# 检测 if project has substantial existing code find . -name ".py" -o -name ".js" -o -name ".ts" -o -name ".tsx" | head -5 | wc -l # If >0, this is an EXISTING codebase that needs structure, not a new project
If existing code is 检测ed, ask the user: "This project already has code. Do you want to (a) scaffold the methodo记录y around the existing codebase, or (b) treat this as a fresh 启动 and 归档 the old code?" Default to (a) — the methodo记录y should organize what exists, not replace it.
If .git is missing, ask whether to git init first or abort.
- Gather project facts (one batched question)
Ask:
Project name (for H1 of CLAUDE.md and TECHNICAL-DOCUMENTATION.md title) One-line description (for subtitle and FUNCTIONAL-SPECIFICATIONS.md intro) Production URL (if any — leave blank if pre-launch) Repo URL (GitHub/GitLab/etc.) Topo记录y — pick one of: simple — 2 环境s (develop local → staging → mAIn production) full — 3 环境s (develop → staging → canary → mAIn) single-branch — solo project with just mAIn (no separate env) Hosting 平台 (RAIlway / Vercel / Fly / AWS / self-hosted / other) Stack (e.g. "Next.js + Postgres + Redis" or "Python FastAPI + Postgres") Does this project have a data 流水线 or many scripts? (yes/no) Does this project have a data 流水线 or many scripts? (yes/no) Does this project depend on data from another project? (yes/no) — If yes, specify the source project path and 访问 pattern (e.g., "read-only Postgres 角色 on same instance as ~/Projects/other-repo"). The CLAUDE.md will 获取 a "Data source" section and a hard rule about read-only 访问.
If the user wants defaults: simple topo记录y, RAIlway hosting, generic Postgres stack, no 流水线, no scripts directory, no cross-repo dependency.
- 创建 directory structure