agentleFS
peopleforresterpeopleforrester/claude-dotfiles/skills/development/spec-driven-development/SKILL.md

spec-driven-development

Skill3 starsChanged 8 months agoMITView on GitHub

Interview-first specification workflow for feature development. Guides through 8 question categories to build comprehensive specs before coding. Use when starting new features, planning complex changes, or establishing clear requirements before implementation.

68 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use using-agent-skills, git-workflow-and-versioning and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • LLl0k0laDSkill

    using-agent-skills

    Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.

    Also in 28 projects that use this

  • LLl0k0laDSkill

    git-workflow-and-versioning

    Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams.

    Also in 27 projects that use this

  • vinvcnSkill

    constraint-driven-development

    把一个项目的质量线确立为书面契约,并阻止 agent 悄悄降低它。通过访谈确定用户在意哪些维度,当用户心里没有数字时提供合理的默认阈值,把一切记录进 CONSTRAINTS.md,并盯住 diff 中质量线被削弱的迹象——新增的 @ts-ignore 或 eslint-disable 抑制注释、被跳过或删除的测试、被剥掉的断言、未实现的 stub、被调低的阈值。当没有任何质量线被写下来时使用;当用户说 "set up constraints" 或 "define our standards" 时;当用户希望把他们在意的维度——无障碍性、Web 性能、覆盖率——设置成被强制执行的约束时;当 agent 为了变绿不断静默检查或跳过测试时;当你需要一个覆盖率或性能阈值却不知道该选什么数字时;或者当 agent 写下的代码超出任何人会读的体量时。

    Also in 4 projects that use this

  • az9713Skill

    code-simplification

    Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

    Also in 31 projects that use this

  • az9713Skill

    deprecation-and-migration

    Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.

    Also in 20 projects that use this

  • +7 more from LLl0k0laD

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 65 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Not all categories need equal depth.

    line 143

“Common” is measured: kept by at least 6 in 10 of the 65 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

Build comprehensive specifications through structured interviews before writing any code. Captures requirements, constraints, edge cases, and acceptance criteria upfront.

When to Use

  • Starting a new feature with unclear requirements
  • Planning complex changes that span multiple components
  • Onboarding to an unfamiliar codebase
  • Creating documentation for future reference
  • Establishing clear acceptance criteria before implementation

Core Concepts

Spec File Structure

Specs are stored in .spec/ at the project root:

.spec/
├── user-auth.spec.md       # The specification document
├── user-auth.tasks.md      # Task breakdown with checkboxes
└── user-auth.log.md        # Implementation notes and decisions

Spec Document Format

# Spec: User Authentication

## Status: draft | active | completed | archived
## Created: 2026-02-05
## Updated: 2026-02-05

## Overview
One-paragraph summary of what this feature does and why.

## Functional Requirements
- User can register with email and password
- User can log in and receive a session token
- User can log out and invalidate their session

## Technical Constraints
- Language: TypeScript
- Framework: Express.js
- Database: PostgreSQL
- Must integrate with existing user model

## Data Model
- User: id, email, password_hash, created_at, updated_at
- Session: id, user_id, token, expires_at

## Edge Cases & Error Handling
- Invalid email format → 400 with validation message
- Duplicate email → 409 Conflict
- Wrong password → 401 with generic message (no info leak)
- Expired session → 401 with refresh guidance

## Security Considerations
- Passwords hashed with bcrypt (cost factor 12)
- Session tokens are UUIDs, not JWTs (revocable)
- Rate limiting on login endpoint (5 attempts/minute)
- No password in logs or error messages

## Testing Strategy
- Unit tests: validation logic, password hashing
- Integration tests: full auth flow with test database
- E2E tests: login/logout via API
- Coverage target: 80%

## Non-Functional Requirements
- Login response time < 500ms
- Support 1000 concurrent sessions
- Session cleanup job runs daily

## Implementation Approach
1. Database schema and migrations
2. User model and repository
3. Auth service (register, login, logout)
4. Auth middleware for protected routes
5. Rate limiting middleware
6. Tests for each layer

## Acceptance Criteria
- [ ] User can register with valid email/password
- [ ] User can log in and receive session token
- [ ] Protected routes reject unauthenticated requests
- [ ] Rate limiting prevents brute force attacks
- [ ] All tests pass with 80% coverage

Interview Process

The 8 Categories

The interview covers 8 categories to build a complete spec:

#CategoryKey Questions
1FunctionalWhat does it do? Who uses it? What are the inputs/outputs?
2TechnicalWhat language/framework? What existing patterns to follow?
3Data ModelWhat entities? Relationships? Storage mechanism?
4Edge CasesWhat can go wrong? How should errors be handled?
5SecurityAuth requirements? Input validation? Secrets handling?
6TestingWhat needs tests? Unit vs integration vs E2E? Coverage?
7Non-FunctionalPerformance targets? Scalability? Accessibility?
8ImplementationSuggested approach? Task breakdown? Dependencies?

Interview Flow

  1. Start with functional requirements — understand the "what"
  2. Move to technical constraints — understand the "how"
  3. Define the data model — understand the "with what"
  4. Explore edge cases — understand the "what if"
  5. Address security — understand the "how safe"
  6. Plan testing — understand the "how verified"
  7. Non-functional requirements — understand the "how well"
  8. Implementation approach — understand the "in what order"

Adaptive Questioning

Not all categories need equal depth. Adapt based on the feature:

Feature TypeFocus Categories
UI componentFunctional, Edge Cases, Testing
API endpointFunctional, Data Model, Security, Edge Cases
Background jobTechnical, Edge Cases, Non-Functional
Data migrationData Model, Edge Cases, Testing
Security featureSecurity, Testing, Edge Cases

Integration with Other Tools

During Planning

ToolWhen to Use
planner agentGenerate detailed task breakdown from spec
architect agentCreate ADRs for significant decisions
/multi-plan commandComplex specs needing both agents

During Implementation

ToolWhen to Use
/tdd commandImplement with test-driven development
/orchestrate commandMulti-agent execution of spec tasks
/verify commandQuality gate before marking complete

Task Tracking

Tasks are tracked in {slug}.tasks.md:

# Tasks: User Authentication

## Progress: 3/8 complete (37%)

### Phase 1: Foundation
- [x] 1.1 Create database migration for users table
- [x] 1.2 Create database migration for sessions table
- [ ] 1.3 Create User model with repository pattern

### Phase 2: Core Implementation
- [x] 2.1 Implement AuthService.register()
- [ ] 2.2 Implement AuthService.login()
- [ ] 2.3 Implement AuthService.logout()
- [ ] 2.4 Create auth middleware

### Phase 3: Hardening
- [ ] 3.1 Add rate limiting
- [ ] 3.2 Add input validation
- [ ] 3.3 Add comprehensive tests

Implementation Log

Track decisions and notes in {slug}.log.md:

# Implementation Log: User Authentication

## 2026-02-05 — Started implementation

### Task 1.1: User table migration
- Created migration with bcrypt for password hashing
- Decided on UUID primary keys for security
- Added unique constraint on email

### Task 2.1: AuthService.register()
- Used repository pattern from existing UserRepository
- Added email validation with Zod
- Password validation: min 12 chars, requires number and special char

Commands

CommandPurpose
/spec-newStart interview to create a new spec
/spec-statusShow spec progress and next tasks
/spec-taskUpdate task status and add notes

Best Practices

  1. Interview before coding — resist the urge to jump into implementation
  2. Keep specs updated — update when requirements change
  3. Link specs to PRs — reference spec slug in PR descriptions
  4. Review completed specs — retrospective for process improvement
  5. Share with team — specs are documentation for future maintainers

Checklist

  • All 8 categories addressed (or explicitly N/A)
  • Acceptance criteria are testable
  • Edge cases include error responses
  • Security considerations documented
  • Testing strategy matches feature complexity
  • Task breakdown is ordered by dependencies

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.