This archives your locked-in technical decisions so they don't evaporate. When you've chosen Vite over Webpack, decided on a frontend-backend split, or agreed components must be PascalCase, it writes a permanent record with context, alternatives you rejected, and why. Separates four types: tech-stack, architecture, constraint, and convention. The workflow asks pointed questions to extract what future you (or your team) will actually need, supersedes old decisions instead of deleting them, and keeps discussion-phase ideas out so nobody mistakes them for done deals. Files land in `.codestable/compound/` with full frontmatter. It won't auto-edit your ARCHITECTURE.md or attention.md, but it will remind you when those should probably link to what you just archived.
npx -y skills add liuzhengdongfortest/codestable --skill cs-decide --agent claude-codeInstalls into .claude/skills of the current project.
开始任何判断或动作前,先读取 .codestable/attention.md;缺失则视为骨架不完整,提示先补齐或运行 cs-onboard,不要回退到外部 AI 入口文件。
项目里"有意做出的选择"——技术选型 / 架构决定 / 长期约束 / 编码规约——特别容易丢失。它不会触发报错、没人会注意到它消失,但消失代价很具体:
本工作流让每一条重要的"已经决定了"都有完整存档:是什么、为什么、考虑过什么替代方案、后果是什么。
共享路径与命名约定看
.codestable/reference/shared-conventions.md。产物写入.codestable/compound/,命名YYYY-MM-DD-decision-{slug}.md,frontmatter 带doc_type: decision。
每条归属四类之一(frontmatter 的 category 字段标注):
| 类型 | 适用情境 | 示例 |
|---|---|---|
tech-stack | 技术 / 库 / 框架的选型 | "用 Vite 而非 Webpack"、"状态管理用 Pinia" |
architecture | 系统结构、模块划分、数据流方向 | "前后端完全分离"、"事件总线只在顶层使用" |
constraint | 硬约束——某些事情不允许做 | "不引入 jQuery"、"所有 API 调用必须通过统一的 http 模块" |
convention | 软规约——某些事情统一这样做 | "组件命名用 PascalCase"、"副作用集中在 composables/" |
查询时各有用途:查"用什么工具"→ tech-stack;"系统怎么组织"→ architecture;"这里为什么不能改"→ constraint;"统一做法是什么"→ convention。
frontmatter / 正文模板 / 示例见同目录 reference.md。本技能流程约束:
category 只允许 tech-stack / architecture / constraint / conventionstatus 只允许 active / superseded / deprecated用一个问题确认关键信息不要给用户大表格:
category按 shared-conventions.md §6 第 5/6 条执行:
update vs supersede:结论变了 → supersede;结论没变只补充 → update。拿不准问用户。
用户可随时说"没什么"跳过:
AI 根据对话起草完整文档(YAML frontmatter + 所有正文节)。一次性展示给用户 review,别逐节展示逐节问——拿到完整版才能判断节之间逻辑是否自洽。
.codestable/compound/YYYY-MM-DD-decision-{slug}.md,frontmatter 顶部带 doc_type: decisionupdated: YYYY-MM-DDshared-conventions.md §6 第 5 条处理;旧文档 status: superseded + superseded-by写完检查两项有则提示用户(不自作主张改文件):
architecture/ARCHITECTURE.md 的"关键架构决定"节是否应引用——architecture 或 tech-stack 通常应该.codestable/attention.md 是否应追加一句启动必读摘要——constraint 或 convention 通常应该完整语法见
.codestable/reference/tools.md。
# 列出所有当前有效的决策
python .codestable/tools/search-yaml.py --dir .codestable/compound --filter doc_type=decision --filter status=active
# 按类型 + 状态组合
python .codestable/tools/search-yaml.py --dir .codestable/compound --filter doc_type=decision --filter category=constraint --filter status=active
# 归档后查重叠
python .codestable/tools/search-yaml.py --dir .codestable/compound --filter doc_type=decision --query "{关键词}" --json
归档类工作流共享守护规则(只增不删 / 宁缺毋滥 / 不替用户写 / 可发现性 / 归档后查重叠)见
shared-conventions.md第 6 节。本技能特有:
superseded-by + 正文顶部 **[已取代]** 见 {新文档 slug}cs-notedoc_type: decisionjuliusbrussee/caveman
mattpocock/skills
shadcn/improve
obra/superpowers
forrestchang/andrej-karpathy-skills
vercel-labs/skills