Aller au contenu principal

Templates

Predefined structures for the Explore → Specify → Plan → TDD → Audit → Commit workflow

What is a Template?

A template is a structured document model that guides the creation of specifications, implementation plans, and task lists. Templates ensure a consistent and complete approach for each feature.

┌────────────────────────────────────────────────────────────────┐
│ │
│ /work:work-specify /work:work-plan │
│ ───────────── ────────── │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ spec.md │ │ plan.md │ │
│ │ (User Stories│ + │ (Architecture│ │
│ │ Criteres) │ │ Phases) │ │
│ └──────────────┘ └──────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ │
│ │ tasks.md │ │
│ │ (Taches │ │
│ │ detaillees) │ │
│ └──────────────┘ │
│ │
└────────────────────────────────────────────────────────────────┘

File Structure

Templates are in .claude/templates/:

.claude/templates/
├── spec-template.md # Functional specification template
├── plan-template.md # Implementation plan template
└── tasks-template.md # Task breakdown template

The 3 Templates

1. spec-template.md - Functional Specification

Used by /work:work-specify to create a specification centered on user value.

Main content:

SectionDescription
Summary1-3 sentences on the value delivered
User StoriesPrioritized stories (P1=MVP, P2, P3)
Edge CasesEdge cases and error scenarios
Functional RequirementsFR-001, FR-002... testable
Key EntitiesSimplified data model
Success CriteriaMeasurable metrics
Out of ScopeWhat is explicitly excluded

User Story format:

### US1 - [Title] (Priority: P1) MVP

**As a** [user]
**I want** [action]
**So that** [benefit]

**Acceptance criteria**:
1. **Given** [state], **When** [action], **Then** [result]

2. plan-template.md - Implementation Plan

Used by /work:work-plan to define the technical architecture and phases.

Main content:

SectionDescription
Technical ContextStack, constraints, performance
Project StructureFile tree
Impacted FilesTo create, to modify, tests
Chosen ApproachArchitecture + justification
PhasesBreakdown into sequential phases
RisksImpact, probability, mitigation

Phase format:

### Phase 2: User Story 1 (P1 - MVP)

**Goal**: [Take from the spec]

#### Tests (if TDD)
- [ ] T004 - [P] Unit test [component]

#### Implementation
- [ ] T006 - [P] Implement [model]
- [ ] T007 - Implement [service] (depends on T006)

**Checkpoint**: US1 functional and testable.

3. tasks-template.md - Task Breakdown

Generated by /work:work-plan to list atomic tasks with dependencies.

Main content:

SectionDescription
Phase 1: SetupStructure and dependencies
Phase 2: FoundationBlocking infrastructure
Phase 3+: User StoriesTasks per story
Phase N: PolishDocumentation, refactoring
DependenciesExecution graph

Markers:

MarkerMeaning
[P]Parallelizable task
[US1]Belongs to User Story 1
[US2]Belongs to User Story 2

Workflow with Templates

Associated commands

/work:work-specify "My feature"


Generates: specs/my-feature/spec.md


/work:work-clarify (optional)


/work:work-plan "My feature"


Generates: specs/my-feature/plan.md
specs/my-feature/tasks.md

Generated structure

specs/[feature]/
├── spec.md # Functional specification
├── plan.md # Implementation plan
├── tasks.md # Task breakdown
└── clarifications.md # Clarifications history (optional)

Conventions

Priorities

PriorityMeaningWhen to use
P1Essential MVPMinimum viable feature
P2ImportantSignificantly improves UX
P3Nice-to-haveCan be deferred

Identifiers

PrefixTypeExample
USUser StoryUS1, US2, US3
FRFunctional RequirementFR-001, FR-002
SCSuccess CriterionSC-001, SC-002
TTaskT001, T002

Parallelization

┌────────────────────────────────────────────────────────────────┐
│ │
│ Tasks marked [P] Tasks without [P] │
│ ────────────────── ────────────── │
│ │
│ Can run Have sequential │
│ in parallel dependencies │
│ │
│ ┌─────┐ ┌─────┐ ┌─────┐ │
│ │T001 │ │T002 │ │T003 │ │
│ │ [P] │ │ [P] │ │ │ │
│ └──┬──┘ └──┬──┘ └──┬──┘ │
│ │ │ │ │
│ └────┬───┘ ▼ │
│ │ ┌─────┐ │
│ ▼ │T004 │ (depends on T003) │
│ [Merge] └─────┘ │
│ │
└────────────────────────────────────────────────────────────────┘

Complete Example

1. Specification (excerpt)

# Specification: User Authentication

## User Stories

### US1 - Basic login (P1) MVP

**As a** visitor
**I want** to log in with email/password
**So that** I can access my account

**Acceptance criteria**:
1. **Given** an existing user,
**When** they enter valid credentials,
**Then** they are redirected to the dashboard

2. Plan (excerpt)

## Impacted Files

### To create
| File | Responsibility |
|------|----------------|
| `src/services/auth.ts` | Authentication service |
| `src/components/LoginForm.tsx` | Login form |

### Phase 2: User Story 1 (P1 - MVP)

- [ ] T004 - [P] [US1] Create AuthService in `src/services/auth.ts`
- [ ] T005 - [US1] Implement LoginForm (depends on T004)

3. Tasks (excerpt)

## Phase 3: User Story 1 - Login (P1) MVP

### US1 Implementation

- [ ] T004 - [P] [US1] Create AuthService in `src/services/auth.ts`
- [ ] T005 - [P] [US1] Create types in `src/types/auth.ts`
- [ ] T006 - [US1] Implement LoginForm in `src/components/LoginForm.tsx`
- [ ] T007 - [US1] Add route `/login` in `src/routes/index.ts`

**Checkpoint**: US1 functional - user can log in.

Best Practices

Specification (spec.md)

  • Focus on user value: no technical details
  • Independent user stories: each story testable on its own
  • Measurable criteria: avoid the vague ("fast", "simple")
  • Maximum 3 clarifications: make informed choices otherwise

Plan (plan.md)

  • Justify choices: explain why this architecture
  • Identify risks: anticipate problems
  • Clear phases: checkpoints at each step

Tasks (tasks.md)

  • Exact paths: include file paths
  • Fine granularity: 1 task = 1 potential commit
  • Explicit dependencies: use [P] for parallelization

See also