
Cs Feat Design
Draft a feature design doc and YAML checklist in CodeStable so implementation and acceptance share one approved spec.
Overview
cs-feat-design is an agent skill most often used in Validate (also Build, Ship) that drafts {slug}-design.md and {slug}-checklist.yaml as the sole input for CodeStable implement and acceptance phases.
Install
npx skills add https://github.com/liuzhengdongfortest/codestable --skill cs-feat-designWhat is this skill?
- Produces {slug}-design.md plus {slug}-checklist.yaml as the single source of truth for implement and acceptance
- Three entry paths: full design drafting, init mode (directory + empty intent skeleton), and roadmap item kickoff with it
- Requires reading .codestable/attention.md first; missing skeleton blocks work and points to cs-onboard
- Roadmap flow links frontmatter roadmap / roadmap_item fields and sets in-progress status on the matching items.yaml entr
- Shared naming and paths follow .codestable/reference/shared-conventions.md
- 3 workflow entry modes (formal draft, init mode, roadmap item)
- 2 primary deliverables ({slug}-design.md and {slug}-checklist.yaml)
Adoption & trust: 964 installs on skills.sh; 902 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You know what you want to build but lack a repo-local design doc and checklist that implementation and acceptance can follow without re-deriving scope in chat.
Who is it for?
Solo builders using CodeStable who already have intent (or a roadmap item) and need a formal design pass before coding.
Skip if: Teams skipping CodeStable onboarding when attention.md or the skeleton is missing, or anyone who already has a signed-off design and only needs implementation without re-drafting.
When should I use this skill?
User says 开始设计方案, write design doc, or 准备实现 XX with known what/for-whom/success; or wants a new feature draft folder; or starts a roadmap item for implementation.
What do I get? / Deliverables
You get an approved-feature design file and extracted checklist in .codestable/features so the implement and acceptance stages can execute and verify against the same spec.
- {slug}-design.md feature design document
- {slug}-checklist.yaml action checklist for implement and acceptance
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Validate because this skill formalizes scope—what to build, for whom, and success criteria—before full implementation, once intent is already clear. Subphase scope fits a {slug}-design.md that locks requirements and spawns a checklist downstream; it is specification work, not coding or shipping.
Where it fits
Turn a filled {slug}-intent.md into {slug}-design.md after the user says they are ready to design before coding.
Spin up YYYY-MM-DD-{slug} with an empty intent skeleton when the builder wants to author scope manually first.
Link a roadmap child feature by slug, read items.yaml dependencies, and stamp design frontmatter with roadmap metadata.
Ensure checklist items extracted from the design align with what acceptance will verify later.
How it compares
Use instead of unstructured “write a design doc in chat” when you need versioned artifacts wired into a multi-stage agent workflow.
Common Questions / FAQ
Who is cs-feat-design for?
It is for solo and indie developers who run the CodeStable feature flow and want Claude Code, Cursor, Codex, or similar agents to produce standardized design and checklist files inside the repo.
When should I use cs-feat-design?
Use it in Validate when scoping a feature (“开始设计方案”, “写 design doc”, “准备实现 XX”), in Build when turning PM intent into an implementable spec, or when starting a roadmap item; use init mode when you only need the feature folder and empty intent skeleton first.
Is cs-feat-design safe to install?
It is a procedural skill that writes under .codestable/features; review the Security Audits panel on this Prism page and your agent’s filesystem permissions before granting repo write access.
SKILL.md
READMESKILL.md - Cs Feat Design
# cs-feat-design ## 启动必读 开始任何判断或动作前,先读取 `.codestable/attention.md`;缺失则视为骨架不完整,提示先补齐或运行 `cs-onboard`,不要回退到外部 AI 入口文件。 这一阶段的产出是一份方案文件 `{slug}-design.md`,加上从中抽出的行动清单 `{slug}-checklist.yaml`。这两份东西后面会被两个阶段消费——implement 照着推进、acceptance 照着核对,所以这里写错或写漏,下游就跟着错。 > 共享路径和命名约定看 `.codestable/reference/shared-conventions.md`。本阶段一般 feature 目录已经由 brainstorm 创建好了;没有的话在这一步建。 本阶段有三个入口: - **正式起草**:用户已经能讲清楚需求(或已经填好 `{slug}-intent.md`),直接进"流程"一节走完整起草。 - **初始化模式**:用户说"开一个新需求 / 起个草稿 / 新建一个 feature",但想自己先写半成品方案而不是口述。走下一节"初始化模式",建好目录和空 `{slug}-intent.md` 就结束本轮,等用户填完再回来。 - **从 roadmap 条目起头**:用户说"开始做 roadmap 里的 {子 feature slug}"或"推进 {roadmap} 的下一条"。slug 从 roadmap items.yaml 取,不另起;动笔前要读 roadmap 主文档和 items.yaml 了解上下文和依赖状态;落盘时 frontmatter 要带 `roadmap` / `roadmap_item` 两个字段,同时回写 items.yaml 把对应条目 `status` 改为 `in-progress`、`feature` 填为 feature 目录名。详见下文"从 roadmap 条目起头"。 --- ## 初始化模式:帮用户建目录和 intent 草稿 触发:用户想自己写一份半成品方案(`{slug}-intent.md`)作为后续 design 的输入,但不想手动建目录。 动作: 1. **和用户快速对齐两件事**——一句话需求概要 + 敲定 slug(小写字母、数字、连字符;`user-auth`、`export-csv` 这种)。日期取当天(frontmatter 用 `currentDate` 即可)。feature 目录命名是 `YYYY-MM-DD-{slug}`。 2. **创建 `.codestable/features/{YYYY-MM-DD}-{slug}/` 目录**。 3. **写一份空的 `{slug}-intent.md`** 作为草稿骨架,内容就是下面这段: ```markdown --- doc_type: feature-intent feature: {YYYY-MM-DD}-{slug} status: draft summary: {一句话需求,AI 按和用户对齐的结果填} --- # {slug} intent ## 背景 / 为什么做 (一句话就够) ## 大致怎么做 (100 字左右描述想法,含关键步骤 / 数据流) ## 相关数据结构 / 类型 (贴相关 types、接口签名、或指向代码位置) ## 已知不做 / 待定 (可选:明确的边界或自己也没想清楚的地方) ``` 4. **告知用户"骨架已建好,填完后再来找我,我基于 intent 写正式 design"**,然后**本轮结束,不继续推进 design 流程**。 为什么在这里停?intent 的价值就是让用户离线思考、把脑子里的东西落到纸面。AI 继续问会把 intent 模式退化成 brainstorm,失去意义。 --- ## 从 roadmap 条目起头 触发:用户说"开始做 roadmap 里的 {子 feature}"或指向 items.yaml 里某条 `planned` 条目。 1. **读 roadmap 上下文**——打开 `{roadmap-slug}-roadmap.md` 和 `{roadmap-slug}-items.yaml`: - 目标条目必须 `status: planned` + `depends_on` 前置全 `done`,否则停下来报告 - **必读主文档第 3 节"模块拆分"和第 4 节"接口契约 / 共享协议"**——这是本 feature 的硬约束输入。契约不合理 / 漏了 → 停下来建议回 `cs-roadmap update` 改,**不要在 design 里偷偷绕开** 2. **slug 从 roadmap 取**,feature 目录 `YYYY-MM-DD-{roadmap 条目 slug}`,不另起 3. **走"流程"一节**,frontmatter 加 `roadmap` / `roadmap_item` 两字段 4. **落盘 `status: approved` 同时回写 items.yaml**:对应条目 `status: in-progress` + `feature: YYYY-MM-DD-{slug}`,用 `validate-yaml.py` 校验 完整衔接协议看 `.codestable/reference/shared-conventions.md` 第 2.5 节。 --- ## design 写什么、不写什么 design 只管"编排-计算分离"里的编排那一侧:**这次 feature 在名词层和编排层的现状与变化**。计算层细节(具体怎么写、改哪些函数、测试怎么搭)归 implement。 写三类东西,名词层和编排层都用"**现状 → 变化**"两段式: 1. **名词层**——值对象 / 实体 / 数据结构 / 对外契约 / 类型定义 2. **编排层**——主流程 / workflow / 关键编排函数 / 控制流拓扑(线性 / 分支 / 并行 DAG / 状态机)。开头一张主流程图建 mental model 3. **流程级约束**——错误语义、幂等性、并发 / 顺序、扩展点位置、可观测点。挂载点清单也归这类 外加一个**固定结构健康度环节**(第 2.5 节):评估即将被改动的文件是否偏胖 / 职责混杂、以及新文件要落进的目录是否摊平,决定是否在实现前先做"只搬不改行为"的微重构(拆文件 / 重组目录)。即使结论是"不做"也要在 design 里显式写出来——否则 AI 默认会持续往胖文件里塞代码、往拥挤目录里加文件。这一节随整稿一起进整体 review,不单独走确认。 **判据**:换一种写法名词层或编排层会变得不同 → design 的事;换一种写法只是"代码不那么好看 / 函数拆法不同 / 测试用了别的 framework" → implement 的事。 不写改动文件清单、函数级落点、测试代码、库选型细节——design 阶段还没读完相关代码,预测多半会回头改。implement 拿到 design 后才扫现状决定。 --- ## 方案文件是给人概览的,不是给人仔细阅读的 读者打开 `{slug}-design.md` 是想 5 分钟内抓到要点,不是逐字精读。具体做法: 1. **每节超过 1 屏就砍或拆**——一屏装不下读者会失去定位 2. **术语先锁死**——动笔前 grep 代码 / 架构 / 历史 feature 防冲突,事后理顺成本远高于预防 3. **示例优先于定义**——接口行为先给"输入→输出"示例,复杂时再补正式类型 4. **同一条信息只在最自然的位置出现一次**——重复表述比缺一条还烦 5. **新逻辑默认放新文件**(写在改动计划里)——文件越大越难分清职责 --- ## 起草时的三条纪律 ### 1. 别替用户做决定 碰到"用户没说清的角落"默认停下来问,不自己挑一个填上去。具体: - **声明假设**:非用户原话的判断写成"假设:……",让用户能精确反驳 - **给选项不自选**:2-3 种合理做法都摆出来再讲倾向 - **看不懂就停**:硬猜着写下去到了 acceptance 阶段对不上验收点 ### 2. 目标和约束都写成可验证的 - 不写"让它能跑"、"用户体验顺畅"这种弱标准——改写成"输入 A 时返回 B" - "明确不做"具体到能被 grep 或测试反向核对,不写"不过度设计"这种空话 ### 3. 每个 feature 都要能被卸载 回答:"如果想把它拔掉,要拔哪些地方?" 答不出说明边界没想清楚,feature 一上线就变成拆不动的既成事实。 落到挂载点清单(第 2.3 节)。**判据**:删掉这一项,feature 在用户/系统视角是不是就消失了?是→列,否→不列。详