agentleFS
pitimonpitimon/claude-governance/skills/spec-driven-dev/SKILL.md

spec-driven-dev

Skill4 starsChanged 6 months agoMITView on GitHub

Create a formal specification before implementation. Use when: starting any feature larger than a trivial fix, planning a new module, or when requirements need clarity before coding begins. Developer defines WHAT and constraints, AI generates HOW within guardrails. Invoke with /spec-driven-dev to start the spec-driven development workflow.

12 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    Use /spec-driven-dev when starting any feature larger than a trivial fix — especially multi-file changes, new modules, or features with …

    line 19
  2. Distinctive:

    Before starting, classify the feature using Three Loops:

    line 25
  3. Very specific:

    Write spec.md in project root or feature directory using the template below.

    line 41
  4. Distinctive:

    Follow existing patterns from codebase

    line 53
  5. Distinctive:

    Check implementation against each acceptance criterion

    line 57
  6. Distinctive:

    Run tests (unit, integration, E2E as appropriate)

    line 58
  7. Very specific:

    Create this as spec.md (or <feature-name>.spec.md) in the appropriate directory:

    line 65
  8. Distinctive:

    Before marking the spec as ready:

    line 122

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “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

Developer = spec author (defines WHAT + constraints). AI = code generator (implements HOW within guardrails).

Scope and When to Use

Use /spec-driven-dev when starting any feature larger than a trivial fix — especially multi-file changes, new modules, or features with unclear requirements. The spec becomes the contract between human intent and AI implementation.

Skip this for trivial fixes (Out-of-Loop tasks): formatting, lint fixes, import cleanup, single-line bug fixes.

Decision Loop Classification

Before starting, classify the feature using Three Loops:

  • Out-of-Loop (AI autonomous): Skip spec — trivial fixes, formatting, import organization
  • On-the-Loop (AI proposes, human approves): Write spec, get approval, implement with oversight
  • In-the-Loop (human decides): Write spec, human drives design, AI assists implementation

Workflow

1. Understand

  • Explore relevant codebase areas (Glob, Grep, Read)
  • Clarify requirements with user (AskUserQuestion)
  • Reference DOMAIN.md for entity definitions and invariants (if present)

2. Specify

Write spec.md in project root or feature directory using the template below.

3. Plan

  • Enter Plan Mode to generate implementation plan from spec
  • Plan must reference spec acceptance criteria
  • Identify files to create/modify

4. Implement

  • Code to spec in iterations (On-the-Loop: AI proposes, human approves)
  • Each iteration should be reviewable
  • Follow existing patterns from codebase

5. Verify

  • Check implementation against each acceptance criterion
  • Run tests (unit, integration, E2E as appropriate)
  • Validate domain invariants from DOMAIN.md are preserved (if present)

Spec Template

Create this as spec.md (or <feature-name>.spec.md) in the appropriate directory:

# Spec: [Feature Name]

## Overview

- **Motivation**: Why this feature exists
- **Success criteria**: How we know it's done

## Requirements

### Functional (MUST)

- [ ] Requirement 1
- [ ] Requirement 2

### Functional (SHOULD)

- [ ] Nice-to-have 1

### Non-Functional

- Performance: [targets]
- Security: [considerations]

## Domain Impact

- **Entities affected**: (reference DOMAIN.md if available)
- **New invariants**: any new constraints introduced
- **API changes**: request/response schema changes

## Constraints

- **Anti-requirements**: what NOT to do
- **Patterns to follow**: existing codebase patterns
- **Dependencies**: external services, libraries
- **Compatibility**: backwards compatibility requirements

## Acceptance Criteria

1. Given [context], when [action], then [result]
2. Edge case: [scenario] -> [expected behavior]
3. Error case: [scenario] -> [expected error handling]

## Verification

- **Unit tests**: [what to test]
- **Integration tests**: [API/service interactions]
- **E2E tests**: [user flows, if applicable]
- **Production validation**: [how to verify in prod]

Governance Checklist

Before marking the spec as ready:

  • Decision loop classified (Out/On/In-the-Loop)
  • Domain impact assessed
  • Anti-requirements defined (what NOT to do)
  • Acceptance criteria are testable
  • Breaking changes identified and flagged

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.