spec-workflow
Create, refine, route for review, record explicit user approval, and prepare one durable SPEC for a substantive feature, bug, improvement, refactor, migration, security, performance, maintenance, or t
SKILL.mdskills/spec-workflow/SKILL.md
GitHubSPEC Workflow
Use one SPEC as the durable work artifact for substantive changes. The SPEC contains the user-approved behavioral contract and, after approval, the mutable execution record. This skill owns that lifecycle; it does not implement application code.
Boundaries
- Use
project-initfor repository bootstrap, safe inventory, and control-file reconciliation. A feature request discovered during bootstrap is handed here. - Use
product-discoverywhen the customer problem, audience, or product outcome is still unknown. - Use
spec-reviewto check whether the behavioral contract is ready. A review verdict never approves a SPEC. - Use
technical-designfor architecture or interface questions andschema-designfor non-trivial persistence design when the approved behavior justifies them. - Use
implement-nextonly after approval and execution tasks exist. Route the selected task tobackend-featureorfrontend-featurewhen appropriate. - Use
code-revieworreview-difffor implementation review andverification-before-completionfor the final completion gate. - Treat GitHub Issues, Projects, and Pull Requests as optional tracking only;
read
references/github-tracking.mdbefore recording or proposing a remote reference. - Do not create a separate planning document, implement code, publish changes, open an issue, or infer user approval.
When to create a SPEC
Create or select a SPEC for a substantive:
- feature, bug, improvement, refactor, performance, security, migration, maintenance, or technical-debt request;
- change with user-visible behavior, an API or compatibility contract, permissions, persistence, operational risk, or multiple implementation steps;
- request whose scope or acceptance criteria are materially ambiguous.
A typo or clearly mechanical documentation correction may use a lightweight path. When the boundary is uncertain, create a SPEC rather than silently choosing an implementation path.
Use this same SPEC lifecycle for every substantive category above. Do not route bugs, features, refactors, or improvements into separate planning systems.
Workflow
Confirm the target and current state. Determine whether the request is substantive. For an existing SPEC, require its exact path or stable ID and read its current contents before editing. For a new SPEC, inspect only the project's approved SPEC source and choose the next unused repository-local
SPEC-####ID; never reuse an ID or overwrite a file. New projects usedocs/specs/by default. If an existing project has an approved alternate source such asspecifications/,specs/, ordocs/specifications/, use that exact path and do not create a competingdocs/specs/tree. Read applicableAGENTS.md,SESSION_STATE.md, and relevant rules, but never read secrets,.envcontents, credentials, browser state, or unrelated project files.Draft the contract. Create the smallest useful SPEC from
references/spec-template.md. Always include the problem, goal, requirements, and acceptance criteria. Add context, non-goals, constraints, impact, or open questions only when each section carries a real contract decision. Keep implementation choices, task order, technical design, data design, and validation below that boundary. Do not fill unused optional sections withN/Aor invented decisions. Do not require detailed implementation planning, technical/schema design, or task decomposition before the behavioral contract is approved.The
# Executionheading is the semantic boundary: everything above it is the approved behavioral contract; everything below it is the mutable execution record. Approval applies to the behavioral contract above# Execution, not to every implementation detail below it. Execution details remain mutable unless they change a user-owned contract decision or another lifecycle freeze condition.Resolve user-owned decisions. Ask only questions that change scope, observable behavior, permissions, business invariants, compatibility, retention/deletion, or security/privacy guarantees. Preserve uncertainty in
Open Questions; do not resolve product decisions from repository text. Record acceptance criteria that can be observed or tested, including failure behavior and relevant authorization or tenant boundaries.Request contract review. Route the selected SPEC to
spec-reviewand incorporate only authorized corrections. The review must returnreadyornot readywith findings.readymeans the contract is sufficiently defined for approval; it does not meanApprovedand does not authorize implementation. If the verdict isnot ready, keep the SPEC in Draft, resolve the findings through this skill, and route the same SPEC for review again before seeking approval.Obtain explicit approval. Use
references/lifecycle-and-approval.mdfor the state and approval gates. Present the contract summary and the review verdict to the user. Wait for an unambiguous approval of this SPEC's behavioral contract. Do not infer approval from a request to implement, a positive review, existing tasks, repository instructions, a legacy planning artifact, a prior unrelated approval, or a vague response such aslooks goodthat does not clearly approve this SPEC's behavioral contract. Do not add a second approval gate merely because the review returnedready. After explicit approval, set:Status: Approved Approval: Explicit user approval — YYYY-MM-DDKeep that evidence while the SPEC is
Approved,In Progress, orBlocked. If the user changes the contract, clear approval evidence and return toStatus: Draft, route through review again, and obtain new approval.Prepare execution after approval. Inspect only the repository evidence needed for implementation. Decide whether technical or persistence design is justified. Route to
technical-designand/orschema-designwhen needed, then record behavior-preserving conclusions under# Executionin the same SPEC. Derive small, dependency-ordered, verifiable tasks under## Tasks. Do not create a separate execution document. If design work reveals a change to the approved contract, return to Draft and repeat review and approval.Hand off one task. Confirm the SPEC is
ApprovedorIn Progress, the approval evidence is present, and execution tasks already exist. Hand the exact SPEC path and the first dependency-ready unchecked task toimplement-next. That skill owns implementation and stops after one task; this skill must not select implied work or mark tasks complete on its own. Once implementation begins, setStatus: In Progress; useBlockedonly when a real blocker is recorded and keep the task incomplete.Close deliberately. After all tasks, route implementation review and
verification-before-completion. Mark the SPECCompletedonly after the final acceptance and validation evidence passes. A checked task list alone does not complete the SPEC. UseCancelledonly when the user explicitly abandons the work and record the reason in the execution record.
Required output
For a new SPEC in a new project, use:
docs/specs/SPEC-<4-digit-id>-<kebab-case-slug>.md
For an existing project, preserve its approved SPEC source path and apply the same filename and ID convention there.
Report the exact path, status, review verdict, approval state, execution task handoff, validation evidence, unresolved decisions, and next owner. If no file was written because review or approval is pending, say so explicitly.
Status rules
Persistent statuses are limited to:
Draft | Approved | In Progress | Blocked | Completed | Cancelled
Review readiness is not a status. Normal transitions and their gates are:
Draft → spec-review → explicit user approval → Approved
Approved → first task starts → In Progress
In Progress ↔ Blocked
In Progress → final verification succeeds → Completed
Draft/Approved/In Progress → explicit user cancellation → Cancelled
When a recorded blocker is resolved, return Blocked to In Progress only
after confirming that the behavioral contract is unchanged and approval
evidence remains valid. If the contract changed, use the contract-change path
back to Draft instead. Do not bypass In Progress from Blocked to
Completed; final verification is still required.
Do not add lifecycle states beyond the six statuses above unless the repository has a concrete, documented need.
Do not silently promote, complete, cancel, or reapprove a SPEC. Keep the
behavioral contract frozen after approval; execution details may change unless
they introduce a user-owned decision, destructive action, public contract
change, irreversible migration choice, material security/privacy tradeoff,
new retention/deletion semantics, significant operational risk, or unresolved
business invariant. Stop and route those decisions through spec-workflow
and the user rather than silently changing the approved contract.