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:
| Section | Description |
|---|---|
| Summary | 1-3 sentences on the value delivered |
| User Stories | Prioritized stories (P1=MVP, P2, P3) |
| Edge Cases | Edge cases and error scenarios |
| Functional Requirements | FR-001, FR-002... testable |
| Key Entities | Simplified data model |
| Success Criteria | Measurable metrics |
| Out of Scope | What 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:
| Section | Description |
|---|---|
| Technical Context | Stack, constraints, performance |
| Project Structure | File tree |
| Impacted Files | To create, to modify, tests |
| Chosen Approach | Architecture + justification |
| Phases | Breakdown into sequential phases |
| Risks | Impact, 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:
| Section | Description |
|---|---|
| Phase 1: Setup | Structure and dependencies |
| Phase 2: Foundation | Blocking infrastructure |
| Phase 3+: User Stories | Tasks per story |
| Phase N: Polish | Documentation, refactoring |
| Dependencies | Execution graph |
Markers:
| Marker | Meaning |
|---|---|
[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
| Priority | Meaning | When to use |
|---|---|---|
| P1 | Essential MVP | Minimum viable feature |
| P2 | Important | Significantly improves UX |
| P3 | Nice-to-have | Can be deferred |
Identifiers
| Prefix | Type | Example |
|---|---|---|
US | User Story | US1, US2, US3 |
FR | Functional Requirement | FR-001, FR-002 |
SC | Success Criterion | SC-001, SC-002 |
T | Task | T001, 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
- Explore → Specify → Plan → TDD → Audit → Commit Workflow - Complete workflow
- /work:work-specify - Specification command
- /work:work-plan - Planning command
- /work:work-clarify - Clarification of ambiguities