ai-agent-dev-workflow

Spec Template

This is the output format for spec files. The /spec skill writes specs to the location configured in PROJECT.md (default: docs/specs/<feature-name>.md). Use kebab-case for filenames.

Load this file during Phase 2 (Specify) to understand the required structure.


Template

---
feature: "<Feature Name>"
status: Draft
created: YYYY-MM-DD
source: "<the user's original request text>"
spec-version: 1
---

# Feature: <Feature Name>

## Overview

<2-3 sentences: WHAT this feature does and WHY it matters.
Focus on user value. No implementation details — no frameworks,
no file paths, no algorithms.>

## User Stories

### US1: <Story Title> [P1]

**As a** <role>, **I want** <goal>, **so that** <benefit>.

**Why P1:** <one sentence justifying this priority>

**Acceptance Criteria:**
1. **Given** <precondition>, **When** <action>, **Then** <outcome> (1 test)
2. **Given** <precondition>, **When** <error condition>, **Then** <error outcome> (1 test)
3. **Given** <varying inputs>, **When** <action>, **Then** <expected outcomes> (parameterized)

### US2: <Story Title> [P2]

**As a** <role>, **I want** <goal>, **so that** <benefit>.

**Why P2:** <one sentence justifying this priority>

**Acceptance Criteria:**
1. **Given** <precondition>, **When** <action>, **Then** <outcome> (1 test)

## Edge Cases

- <Edge case 1: scenario and expected behavior> [Category N]
- <Edge case 2: scenario and expected behavior> [Category N]

## Out of Scope

- <Explicitly excluded behavior 1>
- <Explicitly excluded behavior 2>

## Assumptions

- <Reasonable default chosen, with rationale>
- <Another assumption, with what would change if wrong>

## Affected Components

| File / Module | Role | Impact |
|---|---|---|
| <path/to/file> | <what it does> | <what changes> |
| <path/to/module> | <what it does> | <what changes> |

## TDD Mapping

| Spec Section | TDD Phase | How to Use |
|---|---|---|
| User Stories | Phase 1: Analysis | Scope of what to explore |
| Acceptance Criteria | Phase 3: Pre-Test | Write these as failing tests |
| Edge Cases | Phase 3: Pre-Test | Additional test cases |
| Affected Components | Phase 2: Planning | Starting point for chunk decomposition |
| Assumptions | Phase 1: Analysis | Context for architecture decisions |

## Clarifications

### Session YYYY-MM-DD

- Q: <question> -> A: <resolved answer>

## Notes

<Validation warnings, deferred items, or anything that doesn't
fit above. Remove this section if empty.>

Section Guidelines

Frontmatter

---
feature: "User Search"        # Human-readable feature name
status: Draft                  # Draft | Ready | Ready-with-warnings
created: 2026-03-26            # Date spec was first created
source: "add search to..."    # The user's original $ARGUMENTS
spec-version: 1                # Bumped when spec is re-run/updated
---

Overview

User Stories

Acceptance Criteria

Edge Cases

Out of Scope

Assumptions

Affected Components

TDD Mapping

Clarifications

Notes