cs-decide
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecs-decide
cs-decide
项目里"有意做出的选择"——技术选型、架构决定、长期约束、编码规约——特别容易丢失。它不会触发报错、没人会注意到它消失了,但消失的代价很具体:
- 新人(或六个月后的自己)不知道约束的来龙去脉,在"已经决定过的问题"上重复耗时讨论
- AI 在没有决策上下文的情况下给出"合理但与项目规约冲突"的方案
- 当约束需要修改时找不到当初的理由,无法评估修改的影响范围
本工作流的职责就是让每一条重要的"已经决定了"都有完整存档:是什么、为什么、考虑过什么替代方案、后果是什么。
共享路径与命名约定看。本技能的产物写入codestable/reference/shared-conventions.md,文件命名codestable/compound/,frontmatter 带YYYY-MM-DD-decision-{slug}.md。doc_type: decision
The "intentional choices" made in a project — tech stack selections, architecture decisions, long-term constraints, and coding conventions — are particularly prone to being lost. They won't trigger errors, and no one will notice when they disappear, but the cost of their disappearance is tangible:
- New team members (or yourself six months later) don't know the context of constraints, and waste time re-discussing issues that have already been decided
- AI provides "reasonable but conflicting with project conventions" solutions without decision context
- When constraints need to be modified, the original reasons cannot be found, making it impossible to assess the scope of impact of the modification
The responsibility of this workflow is to ensure that every important "finalized decision" has a complete archive: what it is, why it was made, what alternative solutions were considered, and what the consequences are.
Seefor shared paths and naming conventions. The output of this skill is written tocodestable/reference/shared-conventions.md, with the file namedcodestable/compound/, and the frontmatter includesYYYY-MM-DD-decision-{slug}.md.doc_type: decision
四种决策类型
Four Decision Categories
每条决策文档归属下面四类之一,在 frontmatter 的 字段标注:
category| 类型 | 适用情境 | 示例 |
|---|---|---|
| 技术 / 库 / 框架的选型 | "使用 Vite 而非 Webpack"、"状态管理用 Pinia" |
| 系统结构、模块划分、数据流方向 | "前后端完全分离"、"事件总线只在顶层使用" |
| 硬约束——某些事情不允许做 | "不引入 jQuery"、"所有 API 调用必须通过统一的 http 模块" |
| 软规约——某些事情统一这样做 | "组件命名用 PascalCase"、"副作用集中在 composables/" |
类型在实际查询时各有用途:
- 查"我们用什么工具"→
tech-stack - 查"系统是怎么组织的"→
architecture - 查"这里为什么不能改"→
constraint - 查"统一的做法是什么"→
convention
Each decision document belongs to one of the following four categories, marked in the field of the frontmatter:
category| Category | Applicable Scenarios | Examples |
|---|---|---|
| Selection of technologies/libraries/frameworks | "Use Vite instead of Webpack", "Use Pinia for state management" |
| System structure, module division, data flow direction | "Complete separation of front-end and back-end", "Event bus only used at the top level" |
| Hard constraints — things that are not allowed | "Do not introduce jQuery", "All API calls must go through the unified http module" |
| Soft conventions — things done uniformly | "Component naming uses PascalCase", "Side effects are concentrated in composables/" |
Each category serves a different purpose in actual queries:
- To check "what tools do we use" →
tech-stack - To check "how the system is organized" →
architecture - To check "why can't this be changed" →
constraint - To check "what is the uniform practice" →
convention
文档格式
Document Format
决策文档的 frontmatter、正文模板和示例已拆到同目录 。本技能只保留流程约束:
reference.md- 只允许
category/tech-stack/architecture/constraintconvention - 只允许
status/active/supersededdeprecated - 与
考虑过的替代方案是可选节,用户说"没什么"就省略相关文档
The frontmatter, body template, and examples of decision documents have been split into in the same directory. This skill only retains process constraints:
reference.md- only allows
category/tech-stack/architecture/constraintconvention - only allows
status/active/supersededdeprecated - The "Alternative Solutions Considered" and "Related Documents" sections are optional; omit them if the user says "nothing"
工作流阶段
Workflow Phases
Phase 1:识别决策(和用户对话)
Phase 1: Identify the Decision (Dialogue with User)
用一个问题确认关键信息,不要给用户一张大表格:
- "这个决定是关于什么的?(技术选型 / 架构结构 / 约束 / 规约)" → 确定
category - "这个决定是已经拍板了,还是还在讨论中?" → 本工作流只归档已拍板的决定,讨论中的不归档(建议用户讨论完再来)。理由是讨论中的方案如果归档,下次有人查到会以为已经定了,反而误导
- 如果用户描述不够清楚,问"当时为什么选这个而不选别的?"
Confirm key information with one question at a time; do not present the user with a large form:
- "What is this decision about? (Tech stack selection / Architecture structure / Constraint / Convention)" → Determine the
category - "Has this decision been finalized, or is it still under discussion?" → This workflow only archives finalized decisions; do not archive those under discussion (advise the user to come back after the discussion is complete). The reason is that if a proposed solution under discussion is archived, someone who finds it later will think it has been finalized, which will be misleading.
- If the user's description is not clear enough, ask "Why was this chosen instead of other options at that time?"
Phase 1.5:查重叠与意图分流(必做)
Phase 1.5: Check for Duplicates and Intent Diversion (Mandatory)
按 §6 第 5 / 6 条执行:
codestable/reference/shared-conventions.md- 用户话里含"改 / 更新 / 推翻 / 某条决策 / 某个选型"或明确指向某份旧决策 → 直接走更新或 supersede 路径。决策文档的特性是:结论本身变更几乎总要 supersede(旧结论要留痕,不能原地覆盖);只是补背景 / 替代方案 / 影响描述时才走"更新已有条目"
- 否则用下面"搜索工具"按 + 关键词查一遍,命中相近旧决策时把候选列给用户,让用户选:更新 / supersede / 确实不同主题
category
判断 update vs supersede 的简单规则:结论变了 → supersede;结论没变只补充 → update。拿不准就问用户。
Execute according to Sections 5/6 of §6 in :
codestable/reference/shared-conventions.md- If the user's words include "modify / update / overturn / a certain decision / a certain selection" or clearly refer to an old decision → Directly follow the update or supersede path. A characteristic of decision documents is: Almost any change to the conclusion itself requires superseding (the old conclusion must be retained and cannot be overwritten in place); only follow the "update existing entry" path when supplementing background / alternative solutions / impact descriptions.
- Otherwise, use the "Search Tool" below to search by + keywords. When a similar old decision is found, present the candidates to the user and let them choose: update / supersede / truly different topic
category
Simple Rule for Judging Update vs Supersede: If the conclusion changes → supersede; if the conclusion remains unchanged and only supplements are added → update. Ask the user if unsure.
Phase 2:提炼要点(一次一个问题)
Phase 2: Extract Key Points (One Question at a Time)
按下面顺序问,用户可以随时说"没什么"跳过:
- "当时面对的背景或问题是什么?"
- "决定的结论是什么?"(用户已经说清楚就跳过)
- "为什么选这个?最重要的理由是什么?"
- "有没有考虑过其他方案?为什么没选?"(鼓励写,哪怕只是直觉——后人最想知道的就是"为什么不选 X")
- "这个决定对后续工作有什么影响或约束?"
Ask in the following order; the user can say "nothing" at any time to skip:
- "What was the background or problem faced at that time?"
- "What is the conclusion of the decision?" (Skip if the user has already made it clear)
- "Why was this chosen? What is the most important reason?"
- "Were there any other solutions considered? Why weren't they chosen?" (Encourage writing this down, even if it's just intuition — what future team members most want to know is "why X wasn't chosen")
- "What impact or constraints does this decision impose on subsequent work?"
Phase 3:确认内容(AI 起草,用户 review)
Phase 3: Confirm Content (AI Drafts, User Reviews)
- AI 根据对话起草完整文档(含 YAML frontmatter + 所有正文节)
- 一次性展示给用户 review,别逐节展示逐节问——用户拿到完整版才能判断节之间的逻辑是否自洽
- 用户确认后写入文件;有修改就按用户意见调整再写
- AI drafts a complete document based on the dialogue (including YAML frontmatter + all body sections)
- Present the complete version to the user for review at once; do not show section by section and ask questions section by section — the user can only judge whether the logic between sections is consistent when they have the full version.
- Write to the file after user confirmation; adjust according to the user's comments and rewrite if there are modifications.
Phase 4:归档
Phase 4: Archive
- 新建路径:文件写入 ,命名
codestable/compound/,frontmatter 顶部带YYYY-MM-DD-decision-{slug}.md(见doc_type: decision)reference.md - 更新路径:写回 Phase 1.5 定位到的原文件,frontmatter 补
updated: YYYY-MM-DD - supersede 路径:按 §6 第 5 条处理;旧文档
shared-conventions.md并加status=superseded(和本技能守护规则 #2 一致)superseded-by - 写完后报告完整文件路径
- New path: Write the file to , named
codestable/compound/, withYYYY-MM-DD-decision-{slug}.mdat the top of the frontmatter (seedoc_type: decision)reference.md - Update path: Write back to the original file located in Phase 1.5, add to the frontmatter
updated: YYYY-MM-DD - Supersede path: Process according to Section 5 of §6 in ; set
shared-conventions.mdfor the old document and add thestatus=supersededfield (consistent with Guard Rule #2 of this skill)superseded-by - Report the complete file path after writing
Phase 5:相关工作流更新提示
Phase 5: Prompt for Related Workflow Updates
写完后检查这两项,有则提示用户(不自作主张改文件——这两个文件都是高影响入口):
- 的"关键架构决定"节是否应该引用这条决策——
codestable/architecture/DESIGN.md或architecture类型通常应该tech-stack - 的"禁止事项"或"代码规范"节是否应该追加这条约束——
AGENTS.md或constraint类型通常应该convention
Check these two items after writing; prompt the user if applicable (do not modify the files without permission — both files are high-impact entry points):
- Whether the "Key Architecture Decisions" section of should reference this decision — usually applicable for
codestable/architecture/DESIGN.mdorarchitecturecategoriestech-stack - Whether this constraint should be added to the "Prohibited Items" or "Code Specifications" section of — usually applicable for
AGENTS.mdorconstraintcategoriesconvention
搜索工具
Search Tool
完整语法和示例见。本节只列 decisions 特有的典型查询。codestable/reference/tools.md
bash
undefinedSeefor complete syntax and examples. This section only lists typical queries specific to decisions.codestable/reference/tools.md
bash
undefined列出所有当前有效的决策
列出所有当前有效的决策
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 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 --filter category=constraint --filter status=active
归档后查重叠
归档后查重叠
python codestable/tools/search-yaml.py --dir codestable/compound --filter doc_type=decision --query "{关键词}" --json
---python codestable/tools/search-yaml.py --dir codestable/compound --filter doc_type=decision --query "{关键词}" --json
---和项目架构文档的关系
Relationship with Project Architecture Documentation
architecture/DESIGN.mdarchitecture/DESIGN.md守护规则
Guard Rules
归档类工作流共享守护规则(只增不删、宁缺毋滥、不替用户写、可发现性、归档后查重叠)见第 6 节。本技能特有或细化的规则:codestable/reference/shared-conventions.md
- 只归档已拍板的决定——讨论中的方案不归档;"也许我们应该用 X"不归档
- status=superseded 不等于删除——被取代的决策保留原文,加 字段,正文顶部加一行"[已取代] 见 {新文档 slug}"
superseded-by - 不替用户写理由——用户说不出理由的写"未做系统评估",不要 AI 编造看起来合理的理由(编造的理由会变成历史"事实"误导后人)
- 不主动修改 AGENTS.md 和 DESIGN.md——Phase 5 只提示,由用户决定是否追加。这两个文件的内容必须项目 owner 拍板
- 跨技能一致性——某条 decision 文档和 AGENTS.md 的禁止事项描述不同时,以 decision 文档为详细版,AGENTS.md 为摘要版,两者应链接,不应矛盾
- 只认自己的 doc_type——只读写 的文档,不感知
doc_type: decision目录里其他compound/的文档doc_type
See Section 6 offor shared guard rules for archiving workflows (add only, do not delete; quality over quantity; do not write on behalf of users; discoverability; check for duplicates after archiving). Rules specific to or refined for this skill:codestable/reference/shared-conventions.md
- Only archive finalized decisions — do not archive proposed solutions under discussion; do not archive "maybe we should use X"
- status=superseded does not mean deletion — retain the original text of the superseded decision, add the field, and add a line at the top of the body: "[Superseded] See {new document slug}"
superseded-by - Do not write reasons on behalf of the user — if the user cannot provide a reason, write "No systematic evaluation was conducted"; do not let AI fabricate seemingly reasonable reasons (fabricated reasons will become historical "facts" that mislead future team members)
- Do not actively modify AGENTS.md and DESIGN.md — only prompt in Phase 5; let the user decide whether to add content. The content of these two files must be finalized by the project owner.
- Cross-skill consistency — if the description of a prohibited item differs between a decision document and AGENTS.md, the decision document shall be the detailed version, and AGENTS.md shall be the summary version; the two should be linked and not contradictory.
- Only recognize its own doc_type — only read and write documents with ; do not perceive other documents with different
doc_type: decisionin thedoc_typedirectory.compound/