Using Templates
Relevant source files
The following files were used as context for generating this wiki page:- spec-process-guide/templates/README.md
- spec-process-guide/templates/design-template.md
- spec-process-guide/templates/tasks-template.md
- spec-process-guide/templates/micro-spec-template.md
- spec-process-guide/templates/checklists.md
- spec-process-guide/process/README.md
- spec-process-guide/resources/standards.md
The templates within the Spec-Driven Development Guide provide a structured and accelerated path for creating comprehensive project specifications. They are designed to ensure consistency, quality, and completeness throughout the development lifecycle, from initial idea to implementation plan. By using these ready-to-use documents, teams can focus on the content of the specification rather than its format, leading to more efficient planning and collaboration.
The core of the methodology is a three-phase workflow, with each phase supported by a specific template. This ensures a smooth transition and clear traceability from user needs to technical tasks. The templates include placeholder content, examples, and validation checklists to guide developers and project managers.
Sources: spec-process-guide/templates/README.md:15-28, spec-process-guide/methodology/overview.md:15-39
Template Ecosystem
The project provides a collection of templates tailored for different needs and feature complexities. These are categorized into full spec templates for major features, lightweight templates for smaller changes, and supporting templates like checklists for quality assurance.
Sources: spec-process-guide/templates/README.md:17-26
The following diagram illustrates the different categories of templates available.
How to Use Templates
The general process for using any template is:
- Copy the Template: Select the appropriate template for the current development phase.
- Customize Sections: Adapt the structure to fit the specific feature's needs.
- Fill in Content: Replace placeholder text with actual project details.
- Validate Completeness: Use the integrated checklists to ensure all necessary information is included.
Sources: spec-process-guide/templates/README.md:30-35
The Three-Phase Workflow
The main templates support a three-phase workflow that takes a feature from concept to an implementation-ready state. Each phase builds upon the previous one, with approval gates ensuring alignment and quality.
Sources: spec-process-guide/process/README.md:21-29
This diagram shows the progression through the core templates.
Full Spec Templates
These templates are intended for comprehensive specification of medium to large features.
Sources: spec-process-guide/templates/README.md:19
Requirements Template
The process begins with the requirements-template.md. This document's purpose is to transform initial ideas into structured, testable requirements. It is formatted to use the EARS (Easy Approach to Requirements Syntax), which provides a formal structure for writing clear and unambiguous requirements.
The EARS format uses keywords like WHEN, IF, WHILE, and WHERE to define different types of requirements, ensuring each statement is a single, testable requirement.
Sources: spec-process-guide/templates/README.md:20, spec-process-guide/resources/standards.md:15-18
Design Template
Once requirements are approved, the design-template.md is used to translate them into a technical blueprint. This is a comprehensive document covering architecture, components, data models, security, and more.
Sources: spec-process-guide/templates/README.md:21, spec-process-guide/process/design-phase.md:15-23
Key Sections of the Design Template
| Section | Description |
|---|---|
| Overview | A high-level summary of the design approach and how it meets requirements. |
| Architecture | Describes how the feature fits into the system, its major components, and technology stack. |
| Components and Interfaces | Details each component's purpose, responsibilities, and its input/output interfaces. |
| Data Models | Defines data structures, validation rules, and relationships using formats like TypeScript interfaces. |
| API Design | Specifies RESTful API endpoints, including methods, paths, request/response bodies, and error codes. |
| Security Considerations | Outlines strategies for authentication, authorization, data protection, and input validation. |
| Error Handling | Defines error categories, response formats, and logging strategies. |
| Performance Considerations | Details expected load, performance targets, and optimization strategies. |
| Testing Strategy | Outlines the approach for unit, integration, end-to-end, and performance testing. |
| Deployment and Operations | Covers deployment strategy, configuration management, and monitoring. |
Sources: spec-process-guide/templates/design-template.md
Architecture Diagrams
The template encourages using Mermaid diagrams to visualize the architecture.
System Context Diagram Example:
This diagram shows how the feature interacts with external and internal systems.
Data Flow Diagram Example:
This sequence diagram illustrates the flow of data from user interaction to database and back.
Data and API Definitions
The template provides structured formats for defining data models and APIs.
Data Model Example:
interface EntityName {
id: string;
property1: string;
property2: number;
property3: boolean;
createdAt: Date;
updatedAt: Date;
}
Sources: spec-process-guide/templates/design-template.md:96-104
API Endpoint Example:
// Request
{
"property1": "string",
"property2": "number",
"property3": "boolean"
}
// Response
{
"id": "string",
"property1": "string",
"property2": "number",
"createdAt": "ISO date string"
}
Sources: spec-process-guide/templates/design-template.md:140-155
Tasks Template
After the design is approved, the tasks-template.md is used to break down the design into a manageable, actionable implementation plan.
Sources: spec-process-guide/templates/README.md:22
The template organizes work into phases, ensuring a logical build order from foundational setup to final deployment.
Implementation Phases:
- Phase 1: Foundation and Setup (Project structure, data models, DB schema)
- Phase 2: Core Business Logic (Services, repositories, workflows)
- Phase 3: API Layer (REST endpoints, auth, error handling)
- Phase 4: User Interface (UI components, user flows, state management)
- Phase 5: Integration and Testing (External services, monitoring, E2E tests)
- Phase 6: Deployment and Documentation (Deployment config, operational docs)
Sources: spec-process-guide/templates/tasks-template.md:34-124
Each task in the plan is expected to reference the specific requirements it addresses, ensuring traceability. The template also provides patterns for common task types, such as for the data, service, API, and UI layers.
Sources: spec-process-guide/templates/tasks-template.md:141-145, spec-process-guide/templates/tasks-template.md:175-219
Lightweight Templates
For smaller changes that do not require the full specification process, lightweight templates are available.
Sources: spec-process-guide/templates/README.md:24
Micro Spec Template
The micro-spec-template.md is an ultra-lightweight format for changes estimated to take less than one day, such as bug fixes, copy changes, or minor UI tweaks. It captures the "What", "Why", "How", and "Acceptance" criteria in a few lines.
Example Structure:
# [Brief Change Description]
**Type:** [Bug Fix/Copy Change/Config Update/Minor Feature]
**Effort:** [X hours]
## What
[One sentence describing the change]
## Why
[Brief justification - why is this needed?]
## How
- [Implementation step 1]
- [Implementation step 2]
## Acceptance
[Simple pass/fail criteria - how do you know it worked?]
Sources: spec-process-guide/templates/micro-spec-template.md:17-34
Supporting Templates
Checklists
The checklists.md file provides quality gates for each phase of the spec process. These checklists help validate the completeness and quality of the requirements, design, and task documents before moving to the next phase.
Checklist Categories:
- Requirements Phase Checklist: Covers content quality, EARS compliance, and stakeholder validation.
- Design Phase Checklist: Validates architecture, non-functional design, and requirements alignment.
- Tasks Phase Checklist: Ensures task structure, implementation planning, and full design coverage.
Sources: spec-process-guide/templates/checklists.md:3-165
Summary
The templates provided in this repository are a cornerstone of the spec-driven development methodology. They offer a standardized, scalable, and efficient way to move from a high-level idea to a detailed, implementation-ready plan. By leveraging these templates, teams can improve collaboration, reduce ambiguity, ensure quality, and preserve critical project knowledge.