init-code-repo
Scaffold a new code repo with SSOT doc structure + R&D process + quality gates.
Skill by chenzhongsong93
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/chenzhongsong93-init-code-repo
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, frontend, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Node.js package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/init-code-repo
What's inside
- Skill name
init-code-repo- Description
- Scaffold a new code repo with SSOT doc structure + R&D process + quality gates. Use when creating a new project/repository, starting a fresh codebase, or initializing repo structure. Assembles templates with variable substitution and conditional component inclusion, then guides fill-in. Runtime-neutral — works in Claude Code, codex, opencode, kimicode, zcode.
- License
- Apache-2.0
- Instructions
- 213 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (82)
- README.md
- SKILL.md
- assemble.mjs
- conditional.mjs
- naming.mjs
- substitute.mjs
- .gitkeep · templates/central-docs/docs/adr/
- architecture-overview.md.tmpl · templates/central-docs/docs/
- registry.yaml.tmpl · templates/central-docs/docs/components/
- deployment-overview.md.tmpl · templates/central-docs/docs/
- aggregate.mjs.tmpl · templates/central-docs/scripts/
- install-skills.sh.tmpl · templates/central-docs/scripts/
- .gitignore.tmpl · templates/core/
- AGENTS.config.json.tmpl · templates/core/
- AGENTS.config.local.json.example.tmpl · templates/core/
- AGENTS.md.tmpl · templates/core/
- CLAUDE.md.tmpl · templates/core/
- ERROR_LOG.md.tmpl · templates/core/
- Makefile.tmpl · templates/core/
- NOTICE.tmpl · templates/core/
- README.md.tmpl · templates/core/
- UPSTREAM-SYNC.md.tmpl · templates/core/
- component.yaml.tmpl · templates/core/doc/
- config.ts.tmpl · templates/core/docs/.vitepress/
- README.md.tmpl · templates/core/docs/00-charter/
- concept.md.tmpl · templates/core/docs/00-charter/
- guardrails.md.tmpl · templates/core/docs/00-charter/
- vision-strategy.md.tmpl · templates/core/docs/00-charter/
- README.md.tmpl · templates/core/docs/01-product/
- compatibility-matrix.md.tmpl · templates/core/docs/02-design/agent-governance/
- policy.md.tmpl · templates/core/docs/02-design/agent-governance/
- risk-levels.md.tmpl · templates/core/docs/02-design/agent-governance/
- validation-cases.md.tmpl · templates/core/docs/02-design/agent-governance/
- api-reference.md.tmpl · templates/core/docs/02-design/api/
- doc-governance.md.tmpl · templates/core/docs/02-design/
- entity-model.md.tmpl · templates/core/docs/02-design/
- north-star.md.tmpl · templates/core/docs/02-design/
- system-architecture.md.tmpl · templates/core/docs/02-design/
- README.md.tmpl · templates/core/docs/02-design/test-spec/
- README.md.tmpl · templates/core/docs/02-design/ui-design/
- README.md.tmpl · templates/core/docs/02-design/views/
- HANDOVER.md.tmpl · templates/core/docs/
- ROADMAP.md.tmpl · templates/core/docs/
- .gitkeep · templates/core/docs/ledger/archive/
- bugs.md.tmpl · templates/core/docs/ledger/
- debt.md.tmpl · templates/core/docs/ledger/
- version-log.md.tmpl · templates/core/docs/ledger/
- agent-conduct-rules.md.tmpl · templates/core/docs/rules/
- clean-code-rules.md.tmpl · templates/core/docs/rules/
- commit-rules.md.tmpl · templates/core/docs/rules/
- design-completeness-rules.md.tmpl · templates/core/docs/rules/
- dev-workflow-rules.md.tmpl · templates/core/docs/rules/
- doc-ssot-rules.md.tmpl · templates/core/docs/rules/
- testing-rules.md.tmpl · templates/core/docs/rules/
- SKILL.md.tmpl · templates/core/docs/skills/design-review/
- SKILL.md.tmpl · templates/core/docs/skills/dev-flow/
- SKILL.md.tmpl · templates/core/docs/skills/test-spec/
- .gitkeep · templates/core/docs/superpowers/specs/
- .env.example.tmpl · templates/core/infra/docker/
- Dockerfile.tmpl · templates/core/infra/docker/
- …and 22 more
SKILL.md (first lines)
# init-code-repo — 通用代码仓模板
在新仓初始化 SSOT 文档结构 + 研发流程 + 质量门禁,并引导逐步建仓。运行时中立,零外部依赖(agent 自己装配,不需要 Node.js/Python/任何运行时)。
## 5 阶段向导流
按顺序执行:**问 → 等用户答 → 写文件 → 校验 → 下一阶段**。
### 阶段 0 · 前置检查
- 确认当前目录是空仓或仅含 `.git`/`README`/`LICENSE`。含冲突文件(已有 `AGENTS.md`/`CLAUDE.md` 等)→ 停下询问,不静默改。
- 未 `git init` → 提示用户初始化,不替用户 init(除非用户同意)。
### 阶段 1 · 录取
向用户收集(多选题优先):
| 项 | 选项 | 用途 |
|---|---|---|
| 项目名 | 自由文本 | 填入 {{PROJECT_NAME}} |
| 一句话定位 | 自由文本 | 填入 {{ONE_LINE}} |
| 主栈 | 无 / rust / node-frontend / node-backend / python / go / java / 多栈 | 决定叠加哪些 stacks/;node 拆前端/后端子栈。**注意:node-frontend 与 node-backend 互斥**——两者同选时 package.json/tsconfig.json 会同名覆盖(writeTree 写根路径,后写覆盖先写,EL-004 同类残留;Makefile 已合并到 shared 不受影响)。前后端共存的 monorepo 需单独立 spec 设计 per-stack 命名空间。 |
| 仓形态 | 单 app / monorepo | 决定布局 |
| 仓角色 | 单仓 / 组件仓 / 中央 docs 仓 | 决定多仓模式:单仓=自包含;组件仓=带 component.yaml + 跨仓引用;中央 docs 仓=聚合脚本 + 跨仓视图 |
| 目标 runtime | claude-code / codex / opencode / kimicode / zcode / 多端 | 决定叠加哪些 runtime-adapters/ |
| 远端托管 | gitcode / github / gitlab / 无 | remote=none 时无 remote-hook;否则有 |
| Commit 门禁档 | 默认正则 / 自定义正则 / 不要求 | 决定 commit-msg 段 |
| 分支模型 | 默认(dev/main/fix/release/v) / 自定义 | agent-policy 激活时填入 {{DEV_BRANCH}}/{{MAIN_BRANCH}}/{{FIX_BRANCH}}/{{RELEASE_PREFIX}} |
| Policy 标记 | 默认 `{{PROJECT_NAME}}-Agent-Policy: 1.0` / 自定义 | agent-policy 激活时填入 {{POLICY_ID}} |
| PI 命名格式 | 默认 `YYYY-PI<N>` / 自定义 | pi-cadence 激活时填入 {{PI_FORMAT}} |
| 上游来源 | 上游仓名 / 基线 commit / 许可证(默认 TODO 占位) | has-upstream 激活时填入 {{UPSTREAM_REPO}}/{{UPSTREAM_BASELINE}}/{{UPSTREAM_LICENSE}} |
| 文档命名 | 英文 / 中文 / 自定义 | 决定文档文件名风格(工具契约文件 AGENTS.md/CLAUDE.md/README.md/lefthook.yml 等恒英文;docs/ 下文档与 ROADMAP/HANDOVER 等可中文/自定义)|
| 可选组件 | 多选(见下表) | 决定装配范围与版本派生 |
校验:必答项齐全;主栈与仓形态自洽。
选组件仓时追问中央 docs 仓 URL;选中央 docs 仓时追问初始组件仓列表(写入 registry.yaml)。
### 阶段 2 · 骨架写入
按"手动装配规则"(见下)从 `templates/core/` 写入所有必带文件,按已选组件条件装配。
### 阶段 3 · 栈与门禁叠加
- 按 `config.stacks` 从 `templates/stacks/<栈>/` 写入胶水文件。
- 从 `templates/gates/` 写入门禁文件(按 require 标记条件包含)。
- 按目标 runtime 从 `templates/runtime-adapters/<runtime>/` 写入适配片段。
### 阶段 4 · 留 TODO 骨架
本 skill 只定骨架+规范,**不起草设计内容**(设计填充交给 dev-conductor→superpowers)。阶段 4 仅做:
1. 变量替换已由装配完成({{PROJECT_NAME}} 等)。
2. 各设计文档保留 `(TODO: ...)` 占位,标明"填什么"。
3. `AGENTS.md` 仓库布局段:填所选栈形态的目录树占位(实际产物由 dev-conductor 落地后回刷)。
4. `HANDOVER.md` 首条交接:本轮首做 + 当前阶段门标注(P0)。
校验:占位符 `{{...}}` 残留扫描(应无);骨架文件齐全。
> 设计文档填充与代码落地不在此 skill 范围——由 dev-conductor 驱动 superpowers 完成。
### 阶段 5 · 验收
- SSOT 一致性:`AGENTS.md` 索引的文件全部存在;三类文档分类在 `doc-governance.md` 已写明;死链扫描(所有 markdown 链接指向实际存在文件)。
- 打印完成清单:已写文件树、未填占位列表、下一步建议。
- 不自动 commit/push(除非用户显式要求)。
**设计完整性门控**:读 HANDOVER.md 顶部"当前阶段门" → 按 [design-completeness-rules.md](docs/rules/design-completeness-rules.md) 的阶段门→必填文档映射 → 扫描必填文档的 `(TODO: ...)` 残留与空节 → 列未填项。有残留=阻断发布门控(除非用户显式跳过并记入 HANDOVER 待办)。
**末尾引导 dev-conductor**:骨架+规范就位后,引导用户调用 `dev-conductor` skill——它按完整性门控逐项驱动 superpowers(brainstorming 填设计文档、writing-plans/executing-plans/TDD 落地代码)。本 skill 只定骨架+规范,设计→落地交 dev-conductor→superpowers。
---
## 手动装配规则(agent 离线装配,输出须与 assemble.mjs 一致)
agent 读 `templates/` 下的 `.tmpl` 文件,按以下规则处理后写入目标仓(`.tmpl` 后缀去掉)。
### 1. 变量替换
替换 `{{VAR}}` 为 ctx 值:
| 占位符 | ctx 字段 | 来源 |
|--------|---------|------|
| `{{PROJECT_NAME}}` | projectName | 阶段 1 项目名 |
| `{{ONE_LINE}}` | oneLine | 阶段 1 一句话定位 |
| `{{YEAR}}` | year | 当前年份(4 位) |
| `{{COMMIT_REGEX}}` | commitRegex | commit 档为 custom 时的用户正则;否则不出现 |
| `{{DEV_BRANCH}}` | devBranch | 阶段1录取(分支模型,默认 dev) |
| `{{MAIN_BRANCH}}` | mainBranch | 阶段1录取(默认 main) |
| `{{FIX_BRANCH}}` | fixBranch | 阶段1录取(默认 fix) |
| `{{RELEASE_PREFIX}}` | releasePrefix | 阶段1录取(默认 release/v) |
| `{{POLICY_ID}}` | policyId | 阶段1录取(默认 {{PROJECT_NAME}}-Agent-Policy: 1.0) |
| `{{PI_FORMAT}}` | piFormat | 阶段1录取(默认 YYYY-PI<N>) |
| `{{PI_FIRST}}` | piFirst | 派生(PI_FORMAT 的 YYYY→YEAR、<N>→1) |
| `{{VERIFY_FAST_CMD}}` | verifyFastCmd | 派生(node-frontend 或 node-backend 单栈→npm run verify:fast,否则 make verify-fast) |
| `{{UPSTREAM_REPO}}` | upstreamRepo | 阶段1录取(上游仓名,默认 TODO 占位) |
| `{{UPSTREAM_BASELINE}}` | upstreamBaseline | 阶段1录取(上游基线 commit,默认 TODO) |
| `{{UPSTREAM_LICENSE}}` | upstreamLicense | 阶段1录取(上游许可证,默认 TODO) |
未知占位符保持不变。
### 1.5 文件名映射(命名风格)
按 `naming`(en/zh/custom)映射文档文件名。工具契约文件(AGENTS.md/CLAUDE.md/README.md/lefthook.yml/package.json/Makefile 等)恒不映射。
- 模板内 markdown 链接 `{{FILE:path}}`:按映射替换为目标文件名,并相对当前文件目录相对化(用于链接)。
- 模板内绝对路径 `{{FPATH:path}}`:按映射替换,不相对化(用于脚本 MAPPING 与 inline code 路径)。
- 输出文件名:模板文件名按映射重命名(如 `dev-workflow-rules.md` → `研发流程规则.md`)。
zh 映射表见 `naming.mjs`。custom = 用户提供 namingCustom(英文路径 → 自定义文件名)覆盖 zh/en 基线。
### 2. 条件块剥离(`<!--IF:cond-->`)
模板内的条件块按 cond 是否在"激活集"中保留或剥离:
- `<!--IF:cond-->...<!--/IF:cond-->`:cond 激活 → 保留内容;否则整段移除。
- `<!--IF:cond-->A<!--ELSE-->B<!--/IF:cond-->`:cond 激活 → 保留 A;否则保留 B。
- 嵌套:外层保留后,内层标记继续按规则处理(循环至稳定)。From chenzhongsong93/VibeCodingRepoTemplate, Apache-2.0.
More from chenzhongsong93/VibeCodingRepoTemplate
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jul 31, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from chenzhongsong93
Cite this page
init-code-repo skill. Agent Mart. https://agentmart.dev/skills/chenzhongsong93-init-code-repo (last updated 2026-10-24)