Spec Writer
Turn a feature request into spec files a coding agent can execute: requirements with EARS acceptance criteria (WHEN <condition> THE SYSTEM SHALL <behavior>), a design grounded in the current code, and a dependency-ordered task list in which every task traces to the criteria it satisfies. Writes Kiro's requirements.md, design.md, and tasks.md, or Spec Kit's spec.md, plan.md, and tasks.md, whichever the repository already uses. Use before handing a multi-file feature to an agent, or when an existing spec has acceptance criteria nobody can test.
This skill turns a feature request into spec files an agent can build from: requirements with EARS acceptance criteria, a design that cites the real code, and a dependency-ordered tasks.md where each task names its criteria and the test that proves them. It writes Kiro's or Spec Kit's file layout, whichever the repo uses, and stops for review.
Install to ~/.claude/skills/spec-writer/SKILL.md
npx agentscamp add skills/spec-writerSpec-driven development moves corrections upstream: you fix a sentence in a spec instead of redirecting an agent halfway through a diff. Two file conventions are common. Kiro generates three files per spec: requirements.md (user stories and acceptance criteria in EARS notation), design.md (architecture, sequence diagrams, error handling, testing strategy), and tasks.md (discrete, trackable implementation tasks). GitHub Spec Kit splits the work into spec.md (the what and why, no tech stack), plan.md (the technical plan), and a dependency-ordered tasks.md. This skill writes whichever layout the repository already uses, so the files work with that tool's own commands and with the spec-implementer agent. What it adds over a blank template is discipline: every criterion is testable, every design element serves a requirement, and every task traces to the criteria it satisfies.
When to use this skill
- A feature touches several files or layers and you want an agent to build it from an agreed spec, not from a chat thread.
- A spec exists, but its acceptance criteria say "fast" or "user-friendly" and nobody could write a test from them.
- The team uses Kiro or Spec Kit and you want a spec in the same format without running the full tool flow.
- Work will span sessions or people, and the task list has to survive a context reset.
When NOT to use this skill
- A one-file change or a bug with an obvious fix: write the test and fix it, or use /plan-feature for a quick plan.
- A design document for human reviewers that argues alternatives: /write-design-doc.
- Recording a decision already made: the adr-writer skill.
- Building the spec: the spec-implementer agent works through
tasks.mdone task at a time. - Spec Kit is installed and you want its whole flow: run its skills directly (
/speckit-specify,/speckit-plan,/speckit-tasks).
Instructions
-
Detect the convention before writing anything.
- Spec Kit: its Claude Code integration installs skills at
.claude/skills/speckit-<command>/SKILL.md, soGlobfor.claude/skills/speckit-*/SKILL.md. Existingspec.md+plan.md+tasks.mdsets also mean Spec Kit. If the repo has a Spec Kit constitution (created by/speckit-constitution), read it and follow its principles. - Kiro: existing
requirements.md+design.md+tasks.mdsets (a bug spec usesbugfix.mdin place ofrequirements.md). Globfor**/requirements.md,**/spec.md, and**/tasks.md, excludingnode_modules, and put the new spec beside the existing ones using the same folder naming.- Neither: ask which layout to use. If the user has no preference, use Kiro's three file names in a folder the user confirms, such as
docs/specs/<feature-slug>/. Do not invent a tool-specific directory.
- Spec Kit: its Claude Code integration installs skills at
-
Restate the request and surface the gaps. Write one paragraph: who needs what, and why. List what the request leaves open (scope boundaries, error behavior, permissions, limits, what happens to existing data). Ask up to five questions in one batch. Anything still unanswered becomes a labelled assumption in the requirements, never a silent choice.
-
Read the code the feature touches. Use
Read,Grep, andGlobon the entry points, the closest existing feature, the data models, the test layout, andCLAUDE.mdor the README for the test command. Requirements stay free of technology, but you need the code to know what already exists and to write a design that fits. -
Write the requirements with EARS acceptance criteria. Kiro's
requirements.mduses EARS (Easy Approach to Requirements Syntax): each criterion followsWHEN [condition/event] THE SYSTEM SHALL [expected behavior], for example "WHEN a user submits a form with invalid data THE SYSTEM SHALL display validation errors next to the relevant fields". Structure:- Numbered requirements, each with a user story ("As a … I want … so that …").
- Numbered criteria under each (
1.1,1.2), one observable behavior per criterion, including the failure and edge cases, not only the happy path. - No implementation words (no table names, libraries, or endpoints) and no unmeasurable adjectives. "Fast" becomes a threshold; if nobody knows the threshold, it becomes an open question.
- An Out of scope list and an Assumptions list.
For Spec Kit,
spec.mdholds the same content: the what and the why, with the tech stack left forplan.md. Order the user stories by priority, because Spec Kit's task phases follow that order. Use EARS criteria unless the repo's existingspec.mdfiles use another criteria format; then match theirs. -
Write the design (
design.mdorplan.md). Cover architecture and components, interfaces and data models, a sequence diagram for the main flow, error handling, and the testing strategy. Cite real file paths and symbols from step 3. Every design element names the requirement numbers it serves; an element that serves none is either scope creep or a missing requirement, so resolve it. -
Write
tasks.md. A checkbox list, dependency-ordered, each task small enough for one focused session:- [ ] 3. Add the export endpoint - Files: src/routes/reports.ts, src/services/export.ts - Requirements: 1.1, 1.3, 2.2 - Done when: test/export.test.ts "returns 413 when the report exceeds the row limit" passesEvery task names the criteria it satisfies and the test that proves them; put the test first in the task when that is practical. For Spec Kit, group tasks in its phases: Setup, Foundational (blocking prerequisites), one phase per user story in priority order, then Polish, and mark tasks that can run in parallel with the marker the repo's existing
tasks.mdfiles use. -
Check traceability before handing over. Every criterion is covered by at least one task. Every task other than setup traces to at least one criterion. Every design element serves a requirement. No criterion contains an untestable word. If Spec Kit is installed, its
/speckit-analyzestep runs a read-only consistency check acrossspec.md,plan.md, andtasks.md; recommend it. -
Stop for review. The spec is the deliverable. Do not start implementing, and do not create source or test files. Report the files written, the open questions, and the assumptions the reviewer must confirm.
WARNING
An acceptance criterion an agent cannot test is a criterion the agent will decide for you. "THE SYSTEM SHALL handle large reports gracefully" turns into whatever the implementing session finds easiest. Name the condition and the observable result, or list the question under Open questions and leave the criterion out until someone answers it.
NOTE
The spec does not need to be long. Three requirements with sharp criteria beat fifteen vague ones, and a reviewer reads them. Spec-driven work pays off on features with real surface area; for a spike, the spec would be fiction.
Output
The spec files in the detected layout (requirements.md, design.md, tasks.md, or spec.md, plan.md, tasks.md), and a short report: the layout chosen and why, the files written, a traceability summary (criteria count, tasks count, any gaps), the open questions, and the assumptions.
Example
Excerpt from a Kiro-layout spec for a fictional "Acme Reports" CSV export:
## Requirement 1: Export a report as CSV
**User story:** As an account admin, I want to download a report as CSV, so that I can analyse it in a spreadsheet.
### Acceptance criteria
1.1 WHEN an admin selects "Export CSV" on a report THE SYSTEM SHALL download a UTF-8 CSV file with one header row and one row per report line.
1.2 WHEN a report has zero rows THE SYSTEM SHALL download a CSV that contains only the header row.
1.3 WHEN a report exceeds 50,000 rows THE SYSTEM SHALL refuse the export and show "This report is too large to export; filter it first."
1.4 WHEN a user without the admin role requests an export THE SYSTEM SHALL return a 403 response and download nothing.
### Assumptions
- The 50,000-row limit comes from the request thread; confirm before implementation.
### Out of scope
- Scheduled or emailed exports.The /spec command runs this procedure from a feature description and stops for review. Once the spec is approved, the spec-implementer agent builds tasks.md one checked-off task at a time. The best spec-driven development tools roundup compares Kiro, Spec Kit, and the alternatives.
Filed under
claude · spec-driven-development · ears · kiro · spec-kit · planning · developers
Related
- Spec ImplementerUse this agent to implement an approved spec's tasks.md one task at a time: it reads the linked requirements and design, writes the tests that prove each task's acceptance criteria, implements until they pass, and checks the task off only then. It stops and asks when the spec is ambiguous or contradicts the code, and never changes requirements on its own. Examples — "implement tasks 1 to 3 from docs/specs/report-csv-export/tasks.md", "continue the spec where the last session stopped", "implement the next unchecked task and show me the test that proves it".
- Best Spec-Driven Development Tools in 2026GitHub Spec Kit, Kiro, OpenSpec, Taskmaster, BMAD Method, Agent OS and cc-sdd compared on workflow, artifacts, agent support and how much process each adds.
- SpecDraft spec files for a feature: requirements with EARS acceptance criteria, a design, and a traceable task list, in the repo's Kiro or Spec Kit layout. Stops for review before any implementation.
- Spec-Driven Development (SDD)Spec-driven development is a way of building with AI coding agents where a written spec, not the prompt or the code, is the source of truth for the work.
- Taskmaster (task-master-ai)Taskmaster (task-master-ai) turns a PRD into dependency-ordered tasks and subtasks that your coding agent works through, from a CLI or an MCP server.
- Breakdown TaskDecompose a task into an ordered checklist of small, verifiable steps.
- Spec KitGitHub's open-source toolkit for spec-driven development — a specify CLI and /speckit slash commands that walk any coding agent from spec to implementation.
- Spec-Driven Development with AI AgentsWrite the spec, let the agent implement against it — the SDD workflow (spec → plan → tasks → implement), when it beats prompt-and-iterate, and the tooling.