1---2name: spec-writing3description: Write, rewrite, review, or validate Kent product specifications under docs/dev/specs. Must use before any task that changes or evaluates those specifications.4---56## Authority7- `docs/dev/specs/` is authoritative for locked product and product-architecture decisions.8- Specs encode explicit user decisions. Do not invent, remove, weaken, or change a decision without prior user approval.9- Implementation can drift from a spec. Do not change a spec only to match code, tests, review comments, or implementation convenience.10- When the user explicitly changes product behavior or architecture, update the owning spec.11- An explicit superseding decision overrides the decision that it replaces.1213## Content boundary14- Include user-visible behavior, operator-visible requirements, public compatibility contracts, domain ownership, and product invariants.15- Express product architecture through observable ownership, ordering, concurrency, failure, recovery, limits, and compatibility.16- Include an implementation detail only when that detail is itself a public contract.17- Exclude package and file ownership, code symbols, tests, storage schemas, serialization, request handlers, internal schedulers, transaction layout, and framework choices.18- Exclude implementation plans, worklogs, audits, migration or rollout history, code-drift notes, and temporary checklists.19- Track unimplemented product work in GitHub issues. Track implementation cleanup in `docs/dev/techdebt/techdebt.md`.2021## Language22- Use common English and the domain terms in `docs/dev/specs/terminology.md`.23- Use one term for one meaning. Add a reusable Kent-specific term to `terminology.md` before using it across specs.24- Use short, direct sentences with an explicit subject and active voice.25- Put conditions before outcomes.26- State one requirement per sentence.27- Keep each prose paragraph or list item on one physical line. Do not hard-wrap prose to a column width or insert line breaks between sentences. Use line breaks only for Markdown structure such as separate paragraphs, list items, tables, block quotes, and code blocks.28- Use `must` for normative requirements.29- Write timelessly. Do not use changelog, rollout, or work-in-progress language.30- Preserve literal product copy exactly when the wording is part of the contract.3132## Ownership33- Put each decision in one owning spec.34- Keep another spec's reference short and contextual. Do not duplicate its full contract.35- A page must explain its own subject without depending on implementation knowledge.36- Use the area index in `docs/dev/specs/README.md` to select the owning spec.3738## Rewriting391. Read `docs/dev/specs/terminology.md`, the owning spec, and adjacent specs that define shared behavior.402. Inventory each existing product behavior before editing:41 - success and no-op behavior;42 - failure and recovery behavior;43 - ordering and concurrency;44 - defaults, limits, and time bounds;45 - retry, interruption, and idempotency;46 - public commands, configuration, output, copy, and compatibility.473. For each implementation detail, identify the product behavior or invariant that it protects.484. Reframe that behavior in domain language. Remove only the incidental mechanism.495. If a detail can reasonably be either a public contract or an incidental mechanism, ask the user before removing it.506. Compare the completed rewrite with the prior text. Restore any behavior, failure, ordering, limit, or compatibility rule that was lost.5152## Review and verification53- Treat approved spec changes as authoritative during code review. Do not request a revert because the implementation differs.54- Validate implementation and QA results against the applicable specs.55- Check that each requirement is testable or observable at a product boundary.56- Check that the final text has no implementation topology, temporary history, duplicated decisions, or undefined code-internal terms.57- Check that rewrites preserve every success, failure, ordering, concurrency, limit, and compatibility contract.58- Run `git diff --check`.59- Documentation-only changes do not require product builds or tests unless another repository rule or the task requires them.