spec 规范文档编写
write-spec
为已接受的 intent.md 编写 spec.md(AI 原生软件开发生命周期的设计阶段):涵盖该代码库的需求与设计、与现有决策的冲突、术语表条目以及 ADR(架构决策记录)。当某个 intent 被接受,或负责人针对某个 intent 文件夹说“写规格说明”或“/write-spec”时使用。
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- write-spec
- description
- Write spec.md for an accepted intent.md (Design stage of the AI-native SDLC): requirements and design for this codebase, conflicts with existing decisions, glossary terms and ADRs. Use when an intent is accepted, or the owner says "write the spec" or "/write-spec" for an intent folder.
03 SKILL.md 正文
Write spec
The spec answers the intent: what exactly will be built in this codebase and why that way. It is committed next to its intent, and the pair is frozen once the spec is accepted. It records what was asked for and what was decided.
Before writing
- Read
docs/SDLC.mdif it exists; it overrides these defaults. - Read the intent. Its Status must include
Accepted; if not, ask the owner to accept or edit it first (in an agent team, the coordinator accepts it unless it sets money rules or prices;team.md, Owner pauses). - Read
CONTEXT.md, the ADRs that touch the area, the area's living design notes (docs/<AREA>/_INDEX.md) and the code paths involved. Find facts yourself. - Use the
grill-with-docsskill for unresolved decisions and domain records: read~/.agents/skills/grill-with-docs/SKILL.mdand follow it.
spec.md template
# <Intent title>: spec
Status: Proposed <YYYY-MM-DD>
Intent: [intent](intent.md)
## Summary
Two or three sentences: what changes for whom.
Deleted: the flag, step, layer or requirement this removes, or "nothing, because ...".
## Requirements
Numbered, testable statements in glossary terms. Each one says who can do what, what happens on failure, and who asked for it and why (a person, never "the ticket", "the reviewer", "the linter" or "the old code").
## User-facing copy
Every new or changed string a store, customer or staff member will read, as a table: i18n key, `tw`, `en`, `jp`, exact final wording (`en` and `jp` written natively, never translated from `tw`). In an agent team the copy is reviewed with the spec and the owner sees it in the look before production (`team.md`, Owner pauses); nobody asks him again at merge (owner rule 2026-10-23). Write "none" when the spec changes no user-facing text.
## Design
When the spec touches a shared module (wallet or ledger, notifications, auth or permissions, any lib others call), open with the caller's usage, then types and signatures, then the module map. Settle any open question that running code can answer with a throwaway spike in a scratch dir and paste the result here; only product trade-offs go to the owner.
How it fits the current code: data model changes, where the logic lives, screens and routes, jobs, integrations, permissions. Name real files and modules.
## Decisions and conflicts
Which ADRs this relies on, amends or supersedes (link new ADRs). Any place where two policies cannot both be satisfied, and who must decide.
## Out of scope
What this spec deliberately leaves out.
## Risk checklist
One line each: tenancy, money, auth, data deletion. Security and cross-family review run on the first built slice, not on this spec.
## Test plan
The Functional tests that prove each requirement (owner rule 2026-10-21): numbered test cases, each naming the requirement it proves, the test file or command, and the observable result (command output, screenshot, DB row), never only "tests pass". Every requirement maps to at least one case. Each ticket later lists the cases it owns; passing them is the ticket's definition of done. Do not list Regression (the full suite) here: it runs only in the development pass before staging, or for a very large update with owner approval (in an agent team, the coordinator's approval recorded on the issue).
## Rollout
Migrations, backfills, flags, environments, anything the deploy needs.
After writing
Show the draft, apply corrections, and when the owner accepts it (in an agent team, the coordinator, unless it sets money rules or prices) set Status: Proposed ... · Accepted <date> in both files' history as appropriate, then commit (docs: spec <slug>). Next: break it into issues (to-tickets); each ticket copies the Test plan cases and the User-facing copy rows it owns. If the plan changes during Build, record the change in the PR or a new ADR; do not edit the frozen pair.
Writing rules
English, glossary terms from CONTEXT.md, no em dashes or spaced hyphens as punctuation.
04 同仓库更多 Skills
tune-agent-docs
Cut words from agent guide files (role files, team docs, AGENTS.md) without changing any rule. Use when asked to tune, trim or shrink agent docs.
workflow-from-chats
Extract durable working preferences from recent Cursor chats and convert them into skills, rules, or workflow docs. Use when asked to learn preferences, mine feedback, personalize workflows, or generate team/person-specific agent guidance.
why
Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.
what-did-i-get-done
Summarize authored commits over a user-specified time period into a concise update
weekly-review
Produce a weekly synthesis of authored commits with highlights by bugfix, tech debt, and net-new work
verify-this
Verify a claim with fresh local evidence: restate it falsifiably, capture baseline and treatment, compare artifacts, and return VERIFIED, NOT VERIFIED, or INCONCLUSIVE.