Automates the onboarding of repositories into the CodeStable workflow system, whether you're starting from scratch or have scattered docs lying around. It scans your repo, picks one of two paths (build a fresh skeleton for empty repos, or audit and migrate existing docs with your approval), then drops in the full directory structure: `.codestable/` with subdirectories for requirements, features, issues, architecture, and shared tooling. The migration path is careful about asking before moving anything, and it force-updates `tools/` and `reference/` from the skill pack so you're always on the latest conventions. Handles legacy `easysdd` and `codestable` directories too. Once the skeleton is up, other CodeStable skills can run without setup friction.
npx -y skills add liuzhengdongfortest/codestable --skill cs-onboard --agent claude-codeInstalls into .claude/skills of the current project.
把仓库接入 CodeStable 工作流体系——白纸或已有零散文档的都行。本技能只做两件事:搭骨架、归旧档。骨架搭好后子工作流(feature / issue / compound 等)即可直接运行。
| 路径 | 适用 | 产出 |
|---|---|---|
| 空仓库 | 仓库内无 spec 类文档,也没有 .codestable/ | 完整骨架 + 必要骨架文件 |
| 迁移 | 仓库内有零散文档 / docs/ / 部分 .codestable/ 结构 | 审计报告 + 迁移映射方案(用户逐条确认)+ 落盘 |
启动后先扫一次自动判断,不要让用户选——TA 大概率不知道项目里现有哪些文档。扫描结果模糊(如只有 README)就明说判断依据并问用户。
共享路径与命名约定的权威版本是项目里的
.codestable/reference/shared-conventions.md——本技能从技能包复制过去。下面只列 onboard 创建 / 检查的骨架文件。
.codestable/
├── attention.md CodeStable 技能启动必读的项目注意事项
├── requirements/ 需求聚合根(空目录 .gitkeep)
├── architecture/
│ └── ARCHITECTURE.md 架构总入口(首次创建为占位模板)
├── roadmap/ 规划层聚合根
├── features/ feature 聚合根
├── issues/ issue 聚合根
├── compound/ 沉淀类统一目录(learning / trick / decision / explore)
├── tools/ 跨工作流共享脚本(onboard 释放)
│ ├── search-yaml.py
│ └── validate-yaml.py
└── reference/ 跨子技能共享参考(onboard 释放)
├── shared-conventions.md
├── tools.md
└── maintainer-notes.md
先检查一次现状:
检查 .codestable/:不存在 → 空仓库候选;存在但不完整 → 迁移(部分补齐)
旧 CodeStable兼容 CodeStable 经过多次改名,从 easysdd 到 codestable 再到 .codestable,如果遇到旧版的codestable目录,提示用户:
检测到旧版codestable。建议直接
git mv easysdd .codestable,结构 / frontmatter 完全兼容,rename 后即用。要我执行吗?
同意 → git mv easysdd .codestable,按迁移路径走(这时只需补齐可能缺失的 attention.md、tools/ 和 reference/)。想保留旧目录 → 告诉他子技能只读 .codestable/,旧目录不会被读;按空仓库路径走新骨架
Glob 全仓库 .md(排除 node_modules/ .git/):根目录 DESIGN.md / ARCHITECTURE.md / SPEC.md / README.md;docs/ doc/ design/ spec/ wiki/;现有 .codestable/ 下文件
检查 .codestable/attention.md:缺失则列为骨架待补齐项
汇报扫描结论:找到的相关文档(列路径)+ 走哪条路径 + 判断依据 + 不确定项
步骤 1:和用户确认范围
ARCHITECTURE.md 占位)步骤 2:创建目录骨架
按下面顺序执行,不等用户逐步确认——骨架是整体一次性的:
.codestable/{requirements,roadmap,features,issues,compound}/.gitkeep.codestable/attention.md(最小骨架模板见同目录 reference.md).codestable/architecture/ARCHITECTURE.md(占位模板见同目录 reference.md).codestable/tools/(用 cp -rf / Copy-Item -Recurse -Force 整目录拷贝技能包 cs-onboard/tools/,不要 Read 再 Write).codestable/reference/(同上)落盘用 shell 整目录覆盖,不要 Read 再 Write——这两个目录是机器共享资产,Read+Write 会截断大文件、改缩进、吃空行,还慢费 token。具体命令见迁移路径步骤 4。
步骤 3:attention.md 提醒
attention.md 已创建但默认只有空骨架。汇报时提醒用户:有编译前置、测试命令、目录禁区、凭证规则这类"每次 CodeStable 技能启动都必须知道"的信息,后续用 cs-note 一条条追加。
步骤 4:验收汇报
列建了哪些文件:
CodeStable 骨架已就绪。现在可以:开始新功能
cs-feat/ 报告问题cs-issue/ 沉淀知识cs-learn
步骤 1:生成审计报告
| 现有文件 | 推测内容类型 | 建议归入 CodeStable | 置信度 |
|---|---|---|---|
docs/DESIGN.md | 项目架构 | .codestable/architecture/ARCHITECTURE.md | 高 |
docs/feature-auth.md | 功能设计稿 | .codestable/features/YYYY-MM-DD-auth/auth-design.md | 中 |
SPEC.md | 功能需求? | 需用户确认 | 低 |
置信度:高 = 语义明确匹配;中 = 可推断有歧义;低 = 不明确或映射多个位置都合理。
步骤 2:逐条对齐
中 / 低置信度的用 AskUserQuestion 问:
高置信度不逐条问但要在汇报里列,给用户复审机会——逐条问会让节奏失控。
步骤 3:处理已部分存在的 .codestable/
YYYY-MM-DD-{slug} 格式)但有内容 → 提示用户问是否重命名.gitkeep / 空 .md)→ 直接补齐不问步骤 4:补齐缺失骨架
对照标准骨架补齐用户确认后仍缺失的目录 / 文件。已有内容不覆盖。
.codestable/tools/ 和 .codestable/reference/ 一律用技能包新版本覆盖——这两个目录是技能包维护的共享资产,权威源在 cs-onboard/tools/ 和 cs-onboard/reference/,项目里的只是落盘副本。技能包升级后再跑 onboard 的目的之一就是刷新副本,留旧版本会让子技能按过时口径工作。
覆盖前在汇报列出被覆盖文件让用户知道;用户明确说"我改过 tools/xxx.py 请保留"才例外保留并标红。这是迁移路径唯一强制覆盖的动作,其他已有文件遵守"不经确认不动"。
落盘命令:
# macOS / Linux
cp -rf <技能包路径>/cs-onboard/tools/. .codestable/tools/
cp -rf <技能包路径>/cs-onboard/reference/. .codestable/reference/
# Windows PowerShell
Copy-Item -Recurse -Force <技能包路径>\cs-onboard\tools\* .codestable\tools\
Copy-Item -Recurse -Force <技能包路径>\cs-onboard\reference\* .codestable\reference\
不要:Read+Write 手工搬(截断 / 改缩进)、一个个 cp(多步骤多出错)、先比 diff(规则就是无条件覆盖)。
技能包路径一般是 skill 安装目录(~/.claude/skills/cs-onboard/ 或插件目录)。不确定先 ls 定位。拷完 ls .codestable/tools/ .codestable/reference/ 验证。
步骤 5:处理不迁移的文件
用户选"跳过"的文件:不移动 / 不删除 / 不重命名,汇报标"保留原位(未纳入 CodeStable)"。绝不允许未经确认就动——onboard 只允许 AI 整理不允许替用户做删除决定。
步骤 6:attention.md 提醒(同空仓库路径步骤 3)
步骤 7:验收汇报
列:迁移文件清单(from → to)、新建骨架、未迁移文件(保留原位)、下一步建议。
ARCHITECTURE.md 占位模板和 attention.md 最小模板见同目录 reference.md。
.codestable/ 八个子目录都存在.codestable/attention.md 已建.codestable/tools/ 和 .codestable/reference/ 已从技能包复制.codestable/architecture/ARCHITECTURE.md 已建AGENTS.md / CLAUDE.md 兼容路径——CodeStable 的启动注意事项入口固定为 .codestable/attention.md.codestable/tools/ 和 .codestable/reference/ 走"不覆盖"保守策略——这两个必须用技能包新版本覆盖,否则升级后用户停留在过时口径cp -rf / Copy-Item -Recurse -Force 整目录覆盖node_modules/ .git/——会让扫描结果充斥噪声.codestable/reference/system-overview.md — CodeStable 体系总览.codestable/reference/shared-conventions.md — 目录结构和共享口径的权威版本.codestable/attention.md — CodeStable 技能启动必读的项目注意事项.codestable/architecture/ARCHITECTURE.md — 架构总入口骨架juliusbrussee/caveman
mattpocock/skills
shadcn/improve
obra/superpowers
forrestchang/andrej-karpathy-skills
vercel-labs/skills