agentleFS
kevinlinkevinlin/skills/spec-coding/SKILL.md

spec-coding

Skill5 starsChanged 4 months agoMITView on GitHub

Guide users through spec-driven development — from goal clarification through requirements, design, task planning, and incremental execution. Use this skill whenever a user wants to build a new feature with upfront planning, asks for a structured development workflow, mentions "spec-driven", wants to create requirements or a design doc before coding, or invokes /spec-coding. Also trigger when a user has existing spec files (requirements.md, design.md, tasks.md) and wants to continue or execute tasks from them.

The file

Show its rules and text

We split this skill into the rules it gives an agent

23 rules. About 0 are common, 15 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All spec artifacts live in docs/specs/{feature-name}/ (kebab-case).

    line 32
  2. Very specific:

    If tasks.md exists with unchecked items → offer to resume at Stage 5 (Execution)

    line 39
  3. Very specific:

    If design.md exists but no tasks.md → offer to resume at Stage 4 (Task Planning)

    line 40
  4. Very specific:

    If requirements.md exists but no design.md → offer to resume at Stage 3 (Design)

    line 41
  5. Distinctive:

    If no spec files exist → start from Stage 1

    line 42
  6. Distinctive:

    When resuming, read all existing spec files first to rebuild context, then confirm with the user where they'd like to pick up.

    line 44
  7. Distinctive:

    Every stage that produces a document (Stages 2–4) follows the same rhythm:

    line 54
  8. Distinctive:

    If the user requests changes → revise and ask again

    line 58
  9. Distinctive:

    Only advance to the next stage after explicit approval

    line 59
  10. Distinctive:

    If during a later stage you or the user discover a gap in an earlier artifact, offer to go back and fix it rather than working around it.

    line 65
  11. Distinctive:

    Ask clarifying questions about:

    line 75
  12. Very specific:

    Create docs/specs/{feature-name}/requirements.md with this structure:

    line 102
  13. Distinctive:

    Consider edge cases, error scenarios, and non-functional concerns (performance, security) in your initial draft.

    line 127
  14. Distinctive:

    Use this research as context for the design.

    line 147
  15. Very specific:

    Create docs/specs/{feature-name}/design.md with these sections:

    line 150
  16. Very specific:

    Create docs/specs/{feature-name}/tasks.md as a numbered checkbox list:

    line 169
  17. Distinctive:

    Keep tasks focused on code: writing, modifying, and testing.

    line 189
  18. Distinctive:

    After the user approves the tasks, let them know they can begin execution by asking you to work through the task list or by invoking this …

    line 199
  19. Distinctive:

    If the user doesn't specify a task, recommend the next unchecked one

    line 214
  20. Distinctive:

    If a task has subtasks, work through them in order

    line 215
  21. Distinctive:

    Verify your implementation against the task's referenced requirements

    line 217
  22. Very specific:

    When done, mark the task as checked in tasks.md

    line 218
  23. Distinctive:

    Stop and let the user review before moving on

    line 219

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Spec-Driven Development

A workflow for building features specification-first. Instead of jumping straight into code, you walk through five stages — each producing a concrete artifact that the next stage builds on. This front-loaded planning catches design issues early and produces better implementations.

Stages

StageOutputPurpose
1. Goal ConfirmationShared understandingAlign on what we're building and why
2. Requirementsrequirements.mdDefine what the system does (EARS format)
3. Designdesign.mdDefine how it works technically
4. Task Planningtasks.mdBreak the design into executable coding steps
5. ExecutionWorking codeImplement tasks incrementally

All spec artifacts live in docs/specs/{feature-name}/ (kebab-case).

Resuming a Workflow

Users often return to a workflow across multiple sessions. Before starting fresh, check whether spec files already exist for the feature:

  • If tasks.md exists with unchecked items → offer to resume at Stage 5 (Execution)
  • If design.md exists but no tasks.md → offer to resume at Stage 4 (Task Planning)
  • If requirements.md exists but no design.md → offer to resume at Stage 3 (Design)
  • If no spec files exist → start from Stage 1

When resuming, read all existing spec files first to rebuild context, then confirm with the user where they'd like to pick up.

A request for status, such as "where did we leave it?" or "what is next?", is informational. Name the next unchecked task using its title from tasks.md, ask whether the user wants to execute it, and do not edit files or run the task until the user explicitly asks for implementation.

Approval Gates

Every stage that produces a document (Stages 2–4) follows the same rhythm:

  1. Generate or update the document
  2. Present it and ask if it looks good
  3. If the user requests changes → revise and ask again
  4. Only advance to the next stage after explicit approval

This matters because each document becomes the foundation for the next stage. A requirements gap that slips through will propagate into the design and tasks. Take the time to get each artifact right.

If during a later stage you or the user discover a gap in an earlier artifact, offer to go back and fix it rather than working around it.


Stage 1: Goal Confirmation

Establish a clear, shared understanding of what the feature should accomplish before generating any documents.

Ask clarifying questions about:

  • What problem the feature solves and for whom
  • Expected behavior and outcomes
  • Technical constraints or integration points
  • Scope boundaries (what's explicitly not included)

Suggest refinements if the goal seems too broad — a well-scoped goal leads to better requirements. Once you and the user agree on the goal, summarize it and derive a feature-name (kebab-case) for the spec directory.

Track progress — create a TodoWrite list for the workflow stages:

- Goal confirmation (in_progress)
- Requirements gathering (pending)
- Design documentation (pending)
- Task planning (pending)

Stage 2: Requirements Gathering

Translate the confirmed goal into structured requirements. Generate a first draft based on what you already know rather than asking a long series of questions — the user can iterate on a concrete document much faster than answering questions in the abstract.

Create docs/specs/{feature-name}/requirements.md with this structure:

# Feature Requirements: {Feature Name}

## Introduction

[Brief description of the feature and its purpose]

## Requirements

### 1. [Requirement Title]

**User Story:** As a [role], I want [feature], so that [benefit]

**Acceptance Criteria:**
1. WHEN [trigger/condition], THE SYSTEM SHALL [behavior]
2. WHERE [precondition], THE SYSTEM SHALL [behavior]
3. IF [condition], THEN THE SYSTEM SHALL [behavior]

The EARS (Easy Approach to Requirements Syntax) keywords — WHEN, WHERE, IF/THEN, WHILE, SHALL — make requirements testable and unambiguous, which pays off during task planning and implementation.

Consider edge cases, error scenarios, and non-functional concerns (performance, security) in your initial draft. After presenting the document, suggest specific areas that might need clarification to guide the user's review.

Stay focused on what the system should do — save how for the design stage.


Stage 3: Design Documentation

Develop a technical design that addresses all requirements. This is where you research the codebase, explore existing patterns, and make architectural decisions.

Research during design — explore the codebase to understand:

  • Existing patterns and conventions to follow
  • Components that will be affected or extended
  • Dependencies and integration points
  • Similar features that can inform the approach

Use this research as context for the design. You don't need to create separate research files — fold findings directly into the design document.

Create docs/specs/{feature-name}/design.md with these sections:

  • Overview — what the design achieves at a high level
  • Architecture — how components fit together
  • Components and Interfaces — key abstractions and their contracts
  • Data Models — schemas, types, state shapes
  • Error Handling — failure modes and recovery strategies
  • Testing Strategy — approach to validating the implementation

Include Mermaid diagrams where they clarify component relationships or data flow. Highlight design decisions and their rationale — this context helps during implementation and future maintenance.


Stage 4: Task Planning

Break the design into a sequence of concrete coding tasks. Each task should be something a developer (or coding agent) can pick up and execute independently.

Create docs/specs/{feature-name}/tasks.md as a numbered checkbox list:

## Implementation Tasks

- [ ] 1. [Task description]
    - Details and context
    - References: Requirement 1.1, 1.2

- [ ] 2. [Task description]
    - [ ] 2.1 [Subtask if needed]
    - [ ] 2.2 [Subtask]

Sequencing principles:

  • Each task should build incrementally on previous ones — no orphaned code that isn't wired into the system
  • Prioritize test-driven development: write tests early, validate core functionality before building on it
  • Reference specific acceptance criteria from requirements so nothing gets missed
  • Keep tasks focused on code: writing, modifying, and testing. Exclude deployment, user testing, performance monitoring, and other non-coding activities

What makes a good task:

  • Specifies which files or components to create/modify
  • Is concrete enough to execute without additional clarification
  • Scoped to a specific coding activity ("Implement the authentication middleware" not "Support authentication")
  • Includes enough context to understand why, but delegates how to the design doc

After the user approves the tasks, let them know they can begin execution by asking you to work through the task list or by invoking this skill again.


Stage 5: Task Execution

Execute tasks from the approved task list one at a time with user review between each task.

Before executing any task, read all three spec files (requirements.md, design.md, tasks.md) to ensure your implementation aligns with the full context. Implementing without this context leads to drift from the design.

Execution flow:

  1. If the user doesn't specify a task, recommend the next unchecked one
  2. If a task has subtasks, work through them in order
  3. Focus only on the current task — don't implement ahead
  4. Verify your implementation against the task's referenced requirements
  5. When done, mark the task as checked in tasks.md
  6. Stop and let the user review before moving on

Answering questions — the user may ask about tasks without wanting to execute them (e.g., "what's the next task?" or "how complex is task 3?"). Respond with information without starting execution.

Track individual task progress with TodoWrite:

- Task 2.1: [description] (in_progress)
- Task 2.2: [description] (pending)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.