Back to list
nguyennamkkb

dev-spec-driven

by nguyennamkkb

0🍴 0📅 Jan 9, 2026

SKILL.md


name: dev-spec-driven description: Spec-driven development workflow for iOS. Use when creating new features, writing requirements, design documents, implementation plans, EARS notation, user stories, acceptance criteria, property-based testing. allowed-tools: Read, Write, Grep, Glob

Spec-Driven Development

Table of Contents


1. Concept

Spec Files

Each feature requires 3 files in .claude/specs/[feature-name]/:

FileContentAgent
requirements.mdUser stories + EARS acceptance criteriawrite-spec
design.mdArchitecture + Features + Wireframeswrite-design
tasks.mdFeature-based implementation planwrite-tasks

Directory Structure

.claude/specs/
├── user-authentication/
│   ├── requirements.md
│   ├── design.md
│   └── tasks.md
├── product-catalog/
│   ├── requirements.md
│   ├── design.md
│   └── tasks.md
└── shopping-cart/
    └── ...

Core Principles

  1. Feature-based: Organized by feature, each feature is independent
  2. Traceability: US → AC → Property → Task all have IDs and references
  3. Checkpoints: User confirmation after each step
  4. No code in spec: Specs describe only, no sample code

2. Workflow

2.1 Overview Flow

Idea
    ↓
┌─────────────────┐
│ write-spec      │ → requirements.md
└────────┬────────┘
         ↓ [User Confirm]
┌─────────────────┐
│ write-design    │ → design.md
└────────┬────────┘
         ↓ [User Confirm]
┌─────────────────┐
│ write-tasks     │ → tasks.md
└────────┬────────┘
         ↓ [User Confirm]
┌─────────────────┐
│ execute-tasks   │ → Code
└─────────────────┘

2.2 User Confirmation (REQUIRED)

After CreatingAsk User
requirements.mdContinue to design? / Modify? / Stop?
design.mdContinue to tasks? / Modify? / Stop?
tasks.mdStart implementation? / Modify? / Stop?

Prompt Format:

❓ What would you like to do?
1. ✅ Continue to next step
2. ✏️ Request modifications
3. ⏸️ Stop here, continue later

2.3 Rules

  • NEVER automatically create the next file without asking user
  • ALWAYS wait for user confirmation before continuing
  • User selects Modify → Apply changes → Ask again

3. Requirements Format

3.1 Template

# [Feature Name] - Requirements

## Table of Contents
- [1. Overview](#1-overview)
- [2. User Stories](#2-user-stories)
- [3. Non-Functional Requirements](#3-non-functional-requirements)

## 1. Overview
[Brief feature description - 2-3 sentences]

## 2. User Stories

### US-001: [Story name]
**As a** [role]
**I want** [action]
**So that** [benefit]

#### Acceptance Criteria
- AC-001.1: WHEN [trigger] THE SYSTEM SHALL [behavior]
- AC-001.2: WHEN [trigger] THE SYSTEM SHALL [behavior]
- AC-001.3: IF [error] THEN THE SYSTEM SHALL [error handling]

### US-002: [Story name]
...

## 3. Non-Functional Requirements
- NFR-001: Performance - [requirement]
- NFR-002: Security - [requirement]

3.2 EARS Patterns

PatternFormatExample
Event-drivenWHEN [event] THE SYSTEM SHALL [response]WHEN user taps login THE SYSTEM SHALL validate credentials
State-drivenWHILE [state] THE SYSTEM SHALL [behavior]WHILE offline THE SYSTEM SHALL show cached data
UnwantedIF [condition] THEN THE SYSTEM SHALL [response]IF password invalid THEN THE SYSTEM SHALL show error
OptionalWHERE [feature enabled] THE SYSTEM SHALL [behavior]WHERE premium user THE SYSTEM SHALL show advanced features

3.3 Rules

  • Each User Story has ID: US-XXX
  • Each Acceptance Criteria has ID: AC-XXX.Y
  • EARS notation required for AC
  • Must have error handling criteria (IF...THEN)

4. Design Format

4.1 Main Structure

# [Feature Name] - Technical Design

## Table of Contents
- [1. Overview](#1-overview)
- [2. Shared](#2-shared)
- [3. Features](#3-features)
  - [3.1 Feature: List Screen](#31-feature-list-screen)
  - [3.2 Feature: Detail Screen](#32-feature-detail-screen)
  - [3.3 Feature: Form Screen](#33-feature-form-screen)
- [4. Navigation](#4-navigation)
- [5. Correctness Properties](#5-correctness-properties)

4.2 Shared Section

SubsectionContent
2.1 Data ModelsModels table + Relationships
2.2 ServicesService methods + API Contracts
2.3 DependenciesExternal + Internal dependencies

4.3 Feature Section (EACH FEATURE INDEPENDENT)

Each feature (3.1, 3.2, 3.3) has 6 parts:

SubsectionContent
3.X.1 WireframeASCII diagram
3.X.2 ComponentsTable: Component, Type, Responsibility
3.X.3 StatesTable: State, Condition, UI
3.X.4 ActionsTable: Action, Trigger, Effect
3.X.5 FilesTable: File, Responsibility
3.X.6 Acceptance ChecklistChecklist mapped to AC-xxx

4.4 Correctness Properties

TypeDescriptionExample
InvariantAlways true after any operation"Balance >= 0 after any transaction"
Round-tripEncode/decode returns original value"JSON encode then decode = original"
IdempotentMultiple executions = single execution"Delete twice = delete once"
CommutativeOrder doesn't matter"Add A then B = Add B then A"

4.5 Rules

  • Each feature is an independent, complete unit
  • Each feature MUST have Acceptance Checklist
  • NO sample code, description only
  • Table of contents has line numbers for fast AI navigation

5. Tasks Format

5.1 Main Structure

# [Feature Name] - Implementation Plan

## Table of Contents
- [1. Overview](#1-overview)
- [2. Shared Tasks](#2-shared-tasks)
- [3. Feature Tasks](#3-feature-tasks)
  - [3.1 Feature: List Screen](#31-feature-list-screen)
  - [3.2 Feature: Detail Screen](#32-feature-detail-screen)
  - [3.3 Feature: Form Screen](#33-feature-form-screen)
- [4. Integration Tasks](#4-integration-tasks)
- [5. Progress](#5-progress)

5.2 Task Sections

SectionContentWhen
2. Shared TasksModels, ServicesDo first
3.1 Feature: ListViewModel → Views → VerifyAfter Shared
3.2 Feature: DetailViewModel → Views → VerifyAfter 3.1
3.3 Feature: FormViewModel → Views → VerifyAfter 3.2
4. IntegrationNavigation, Entry pointAfter all Features

5.3 Each Feature Has 3 Parts

PartTasks
X.1 ViewModelCreate ViewModel, [PBT] property
X.2 ViewsCreate components, Create main view
X.3 VerifyVerify Acceptance Checklist

5.4 Checkpoints

Each section has a Checkpoint:

**Checkpoint 3.1:** ⬜ Feature List Screen complete

Checkpoint = Gate to next section:

  • ⬜ = Not started
  • 🔄 = In progress
  • ✅ = Done (Build pass + tests pass + checklist done)

5.5 Task Format

- [ ] **3.1.2.1** Create [Name]View
  - File: `Features/[Name]/Views/[Name]View.swift`
  - Wireframe: Design 3.1.1
  - Refs: AC-001.1, AC-001.3

5.6 Rules

  • Task ID: [Section].[Subsection].[Task] (e.g., 3.1.2.1)
  • MUST have: File, Design reference, Refs (AC-xxx)
  • Complete each Feature before moving to next Feature
  • DO NOT work on multiple Features in parallel
  • DO NOT skip Checkpoints

6. Traceability

6.1 Traceability Chain

US-001 (User Story)
  └── AC-001.1 (Acceptance Criteria)
        └── Design 3.1 (Feature section)
              └── Property P1 (Correctness Property)
                    └── Task 3.1.1.2 [PBT] (Property-based test)

6.2 Traceability Matrix (in tasks.md)

ACDesign SectionTasksStatus
AC-001.13.1 List Screen3.1.1.1, 3.1.2.2
AC-001.23.2 Detail Screen3.2.1.1, 3.2.2.2
AC-002.13.3 Form Screen3.3.1.1, 3.3.2.1

6.3 Rules

  • Every AC MUST have a task
  • Every task MUST reference AC or Design section
  • Every Property MUST reference AC

7. Agents

7.1 Agent Chain

AgentInputOutputSkill
write-specIdearequirements.mddev-spec-driven
write-designrequirements.mddesign.mddev-spec-driven, ios-architecture
write-tasksdesign.mdtasks.mddev-spec-driven
execute-taskstasks.mdCodedev-spec-driven, ios-architecture, ios-components
refine-specFeedbackUpdated specsdev-spec-driven

7.2 When to Use Which Agent

SituationAgent
Create new feature from scratchwrite-spec → write-design → write-tasks
Have requirements, need designwrite-design → write-tasks
Have design, need taskswrite-tasks
Implement taskexecute-tasks
Add/modify requirementsrefine-spec
Sync tasks with coderefine-spec

7.3 Rules

  • Each agent creates 1 file
  • After each file → User confirm
  • DO NOT skip agents in chain

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon