spec · diff

git:20260810.4e6ccee to git:20261007.1185463

52 added, 68 removed. Audit A to A.

---
name: spec
- description: >-
- Creates an approval-gated spec for non-trivial feature work from an issue URL
- or requirements text. Use when the user asks for a spec/PRD, pastes a Linear,
- GitHub issue, or Jira URL, or requests implementation where scope is ambiguous
- enough to need acceptance criteria before coding.
+ description: Builds reviewed requirements, technical design, and an executable implementation plan from an issue URL or requirements text, then stops at approval.
disable-model-invocation: true
- argument-hint: "[linear-url, github-issue-url, or description]"
+ argument-hint: "[issue-url or requirements]"
---
# Spec
- ## Approval-Gated Flow: Spec → Approve → Implement
-
- The point of this skill is the pause. Generating a spec and waiting for
- approval before implementing ensures you and the user are aligned on scope
- before writing code. Do not skip to implementation.
+ Turn the supplied source into approved planning artifacts. This skill owns discovery and planning only; after approval, report the artifact directory and stop.
- ## Step 1 — Detect Source and Fetch Context
+ ## Artifact contract
- **Linear URL** (`https://*.linear.app/*/issue/*`):
- ```
- mcp__plugin_linear_linear__get_issue
- ```
+ Every completed run writes:
- **GitHub issue URL** (`https://github.com/*/issues/*`):
- ```bash
- gh issue view <number> --json title,body,labels,assignees
+ ```text
+ docs/specs/<slug>/
+ ├── spec.md
+ ├── plan.md
+ └── approval.md
```
- **Jira URL** (`https://*.atlassian.net/browse/*`):
- Use WebFetch to retrieve the page content.
-
- **Plain text**: treat the input as the raw requirement and proceed.
-
- Display a brief summary (2–3 sentences) of what you fetched so the user can
- confirm you're working from the right source.
-
- If the source cannot be fetched or key scope details are missing, stop with the
- missing facts and proposed assumptions; do not invent acceptance criteria.
-
- ## Step 2 — Generate the Spec
+ Choose a stable, kebab-case slug from the accepted problem. Add supporting Markdown only when the work needs it, such as `research.md`, `decisions.md`, `data-model.md`, `migration.md`, or files under `contracts/`.
- ```markdown
- # Spec: [Title]
+ `spec.md` is authoritative for requirements and technical design. `plan.md` is authoritative for execution. `approval.md` certifies the exact approved versions of both. HTML may supplement review when visualization materially helps, but it never replaces the Markdown.
- ## Problem
- What user pain or business need does this address? Why does it matter now?
+ Use stable identifiers throughout:
- ## Solution
- What are we building? Describe the approach, not the implementation details.
+ - `R1` — observable requirement
+ - `D1` — technical design decision
+ - `T1` — implementation task
+ - `V1` — expected or captured verification evidence
- ## Acceptance Criteria
- - [ ] Specific, testable condition 1
- - [ ] Specific, testable condition 2
- - [ ] Edge cases and error states are handled
+ ## Lifecycle
- ## Out of Scope
- Explicit list of what this does NOT include. This prevents scope creep.
+ Run these stages in order. Load a stage reference only when that stage begins.
- ## Technical Notes
- Dependencies, migration needs, API contracts, performance constraints.
- Leave empty if there's nothing notable.
- ```
+ 1. **Discover.** Read `references/source-and-discovery.md`. Retrieve the source, inspect the repository, classify unknowns, and resolve decisions that block requirements.
+ 2. **Requirements.** Read `references/requirements-stage.md`. Write only the Requirements layer of `spec.md`, then run its review gate.
+ 3. **Design.** Read `references/design-stage.md`. Add the Technical Design layer without rewriting approved requirements, then run its review gate. A material requirements change returns to stage 2.
+ 4. **Plan.** Read `references/planning-stage.md`. Derive `plan.md` from the approved `spec.md`, then run its review gate. A behavior or design change returns to the owning upstream stage.
+ 5. **Approve and stop.** Read `references/approval-stage.md`. Verify the current approvals, hash `spec.md` and `plan.md`, write `approval.md`, report the paths, and stop.
- Done only when the spec includes problem, solution, testable acceptance
- criteria, out-of-scope boundaries, and technical notes or an explicit "none".
+ At every gate, Plannotator is the default. Explicit approval of the current artifact in chat is the fallback when Plannotator is unavailable or the user chooses chat. Revisions require another review of the current file; use Plan Diff in Plannotator to make the change visible.
- ## Step 3 — Wait for Approval
+ ## Stage routing
- Present the spec and ask: "Does this capture what you need? Any changes before I implement?"
+ | Priority | Load when | Reference |
+ |---|---|---|
+ | 1 — Required | Starting source retrieval and repository discovery | `references/source-and-discovery.md` |
+ | 1 — Required | Writing or revising observable behavior and scope | `references/requirements-stage.md` |
+ | 1 — Required | Writing or revising internal system decisions | `references/design-stage.md` |
+ | 1 — Required | Converting approved design into executable tasks | `references/planning-stage.md` |
+ | 1 — Required | Opening any review gate or writing final approval state | `references/approval-stage.md` |
- Only offer to implement after the user explicitly approves. If they request changes, revise and re-present before offering to implement.
+ ## Domain skill routing
- ## Missing Context Stop Criteria
+ After repository discovery, invoke only installed, model-invocable skills whose evidence condition matches. Use the host's skill mechanism by skill name; never depend on an installation path or host-specific command.
- Stop and ask for clarification when:
+ | Repository or spec evidence | Invoke | Contribution |
+ |---|---|---|
+ | Browser-facing UI, interaction, accessibility, responsive behavior, or browser trust boundary | `frontend` | Frontend requirements, design constraints, and browser evidence |
+ | React components, hooks, state ownership, Effects, Suspense, or rendering behavior | `react` | React-specific technical design and validation |
+ | Next.js App Router, Server Components, route caching, streaming, or Suspense architecture | `nextjs-app-architecture` | Next.js-specific technical design |
+ | Consequential service, module, data, protocol, persistence, rendering, or deployment boundary | `architect` | Decision analysis, trade-offs, and reversal path |
+ | Version-sensitive framework, library, SDK, provider, or API claim | `research` | Version-matched primary evidence |
+ | Verification layer or test strategy cannot be derived from repository conventions | `test` | Behavioral validation strategy and commands |
- - the issue/source cannot be fetched
- - the user pain or success condition is unclear
- - acceptance criteria would require inventing product behavior
- - out-of-scope boundaries are material but unknown
- - dependencies, migrations, or API contracts are likely but unspecified
+ A routed skill advises the current planning stage; `/spec` remains responsible for artifact structure, traceability, and approval. Record accepted conclusions in `spec.md` or `plan.md` rather than copying another skill's workflow. Do not implement while consulting a domain skill.
- ## Tips for Good Acceptance Criteria
+ If a matching skill is unavailable or user-only, continue from repository evidence when that is sufficient. Record a blocker only when the missing guidance prevents a safe, falsifiable artifact. Never load every skill preemptively.
- Acceptance criteria should be testable by a QA engineer who wasn't in the room:
- - Bad: "The form works correctly"
- - Good: "Submitting with an empty email field shows an inline error message"
+ ## Planning boundary
- Each criterion should be falsifiable — you should be able to write a failing test before the feature exists.
+ During this skill:
- ## References
+ - modify only the spec directory and review aids;
+ - leave application code, tests, configuration, dependencies, branches, tickets, and commits unchanged;
+ - keep unresolved blockers explicit instead of approving around them;
+ - treat edits to an approved stage as invalidating that stage and every dependent approval.
- | Priority | Load when | Reference |
- |----------|-----------|-----------|
- | 1 — High | Spec involves frontend — need performance, bundle, rendering, or accessibility checklist items | `references/frontend-spec-checklist.md` |
+ Completion requires all three canonical files, matching SHA-256 hashes in `approval.md`, and explicit approval of the current requirements, design, and plan. Implementation begins only through a separate workflow.