Free tool

Story & spec templates
written for AI agents

Five markdown templates — feature story, bugfix, refactor, epic breakdown, and agent PR description — each filled in with a realistic example. Copy or download. Free, no signup.

By Kylian Migot · Updated July 2026 · 5 min read

Template library
5 markdown templates · filled-in examples · no signup, nothing leaves your browser
Template 1 · feature-story-spec.md

Feature story spec

Context, user-visible behavior, a scope fence, machine-checkable acceptance criteria, and an approval line. Shown filled in with a password-reset example.

# Feature spec: Password reset via email

> **Status:** draft → approved (agent may not start while draft)
> **Story:** STORY-142 · **Branch:** `feature/password-reset`
> **Requested by:** Kylian · **Agent:** Claude Code

## Context — why this exists

Users who forget their password currently email support and wait up to a
business day for a manual reset. We already send transactional email through
Postmark, so a self-serve flow removes that queue entirely. This is the top
recurring support request this quarter.

## User-visible behavior

- On `/login`, a "Forgot password?" link opens `/forgot-password`.
- Submitting any email shows the same confirmation message — "If an account
  exists for that address, we sent a reset link." No account enumeration.
- The email contains a single-use link valid for **30 minutes**.
- The link opens `/reset-password?token=…` with a new-password form
  (minimum 12 characters, confirmation field, inline validation).
- On success: redirect to `/login` with a success banner, and **all existing
  sessions for that user are revoked**.

## Scope

- `POST /api/auth/forgot-password` — issue token, send email.
- `POST /api/auth/reset-password` — validate token, set password, revoke sessions.
- New `password_reset_tokens` table: hashed token, user id, expires_at, used_at.
- Two pages: `/forgot-password` and `/reset-password`.
- One email template using the existing Postmark layout in `emails/`.

## Out of scope — do NOT touch

- The login form itself, beyond adding the one link.
- SSO / OAuth accounts (show "managed by your identity provider" instead).
- Rate-limiting infrastructure — reuse the existing `rateLimit()` helper.
- Password strength meter UI — that is STORY-155.

## Acceptance criteria (machine-checkable)

- [ ] Requesting a reset for an existing email creates exactly one token row and sends exactly one email.
- [ ] Requesting a reset for an unknown email returns 200 with a byte-identical response body.
- [ ] A token older than 30 minutes is rejected with 400 `TOKEN_EXPIRED`.
- [ ] A token is single-use: the second attempt returns 400 `TOKEN_USED`.
- [ ] A successful reset updates the password hash and deletes every session row for that user.
- [ ] A new password under 12 characters is rejected with a field-level error, not a toast.
- [ ] Lint and typecheck pass on the branch.

## Verification — run before opening the PR

```bash
npm test -- --grep "password reset"
npm run lint && npx tsc --noEmit
```

## Deliverable

One PR from `feature/password-reset` into `main`: code, tests, and the email
template. PR description generated from this spec (what/why, criteria
checklist with pass/fail, test evidence).

## Approval

- [ ] Spec approved by ____________ on ____-__-__ — the agent starts only after this box is checked.
Template 2 · bugfix-spec.md

Bugfix spec

Observed vs expected, reproduction steps, and a regression-test-first rule: the agent must write a failing test before touching the fix.

Template 3 · refactor-spec.md

Refactor spec

Motivation, invariants that must not change, a safety net of characterization tests, a scope fence, and a mechanical step-by-step outline.

Template 4 · epic-breakdown.md

Epic breakdown

Goal, constraints, and a dependency-aware story table built for slicing an epic across parallel agents — contract stories first, lanes after.

Template 5 · agent-pr-description.md

Agent PR description

A PR body generated from the spec: what & why, the acceptance-criteria checklist with pass/fail, test evidence, and review guidance.

01

Why templates beat blank pages for agent work

A blank page produces a different document every time — different sections, different levels of detail, different things silently left out. That variance is annoying between humans; with AI agents it compounds, because the spec is the prompt. An agent given an under-specified story fills the gaps with plausible guesses, and you discover which guesses at diff-review time.

The quieter payoff is reviewability. When every bugfix spec has the same shape, your reviewer — human or LLM — learns one shape. They stop parsing structure and start checking substance: is the scope fence right, is the repro real, did the failing test come first. Ten differently-shaped documents get ten shallow reviews; ten identical shapes get ten fast, deep ones. Templates also make omissions visible: an empty “Out of scope” heading is a question, while a missing one is invisible.

02

What makes acceptance criteria machine-checkable

An acceptance criterion is machine-checkable when pass/fail can be decided without asking the author. That means naming a concrete input and an observable output — a status code, an error code, a test name — instead of a quality adjective. Compare:

# Vague — a human has to interpret it, an agent will rationalize it
- [ ] Password reset works properly and is secure

# Machine-checkable — a test can decide it, and probably already does
- [ ] A token older than 30 minutes is rejected with 400 TOKEN_EXPIRED
- [ ] A token is single-use: the second attempt returns 400 TOKEN_USED

The vague version invites the agent to declare victory; the precise version converts almost line-for-line into test cases, which is exactly what you want the agent to write. A useful habit: if a criterion cannot be paired with a command in the spec’s verification block, rewrite it until it can. The feature and bugfix templates above are built around that rule.

03

How the epic template maps to parallel agents

The epic breakdown’s story table is not project-management decoration — the three middle columns are a scheduling algorithm. “Depends on” plus “parallel?” tells you which stories can become simultaneous agent lanes and which must serialize. The rule of thumb: shared-contract stories serialize, everything downstream parallelizes.

Contract stories run alone

Schema, shared types, API shapes — the files every other story imports. One agent, merged first, so the contract is stable before anyone builds on it.

Lane stories run together

Stories that only consume the contract and touch disjoint files can each get their own agent, branch, and worktree with no merge collisions.

The tell-tale smell

If two lanes both need to create or edit the same new file, the table is wrong: that file belongs in a contract story, not in either lane.

Spec status is the gate

A lane only starts when its spec column says approved. Draft specs queue work; they never launch agents.

The full playbook for running those lanes — branch naming, merge order, what to do when a lane stalls — is in our multi-agent coding workflow guide, and the git mechanics live in parallel agents with git worktrees.

04

Templates are the paper version of a workflow

Each template here is a stage of the same pipeline, frozen into a document: the story spec is the plan, the approval line is the gate, the acceptance criteria are the tests, and the PR description is the receipt. Used together, they give you the whole of spec-driven AI development with nothing but markdown files and discipline — no tooling required.

Paper has real limits, though: nothing stops an agent that skips the approval line, and nobody reconciles the PR checklist against the spec except you. If you want the spec generated interactively instead of edited by hand, try the agent spec builder; for the git-to-merge half of the pipeline, the AI PR automation guide covers how the PR description template gets filled and reviewed. Start on paper — it is the cheapest way to learn which sections your team actually needs.

FAQ

Which template do I start with?
Start with the feature story spec — it is the shape the other templates derive from. Use it on your next non-trivial task, keep the sections that earned their place, and only then adopt the bugfix and refactor variants. The epic breakdown matters once you are splitting work across several agents, and the PR description template is what the agent produces at the end, not something you fill in yourself.
How do I make an AI agent actually follow the template?
Reference it from your agent context file. Commit the templates to your repo (for example docs/templates/), then add a rule to CLAUDE.md or AGENTS.md: 'Before implementing any story, produce a spec using docs/templates/feature-story-spec.md and wait for approval.' Agents follow files they are pointed at far more reliably than instructions pasted into chat. If you do not have a context file yet, our free AGENTS.md generator builds one.
Are these templates compatible with Jira or Linear?
Yes — they are plain markdown, and both Jira and Linear render markdown in issue descriptions (Jira converts it on paste). The more common pattern is to keep the one-line story in Jira/Linear and the full spec as a markdown file in the repo or PR, where the agent and the reviewer can both read it. The acceptance-criteria checklists render as checkboxes in GitHub, GitLab, and Linear.
How detailed should acceptance criteria be?
Detailed enough that a script — or another agent — could judge pass/fail without asking you. Each criterion should name a concrete input and an observable output: a status code, an error code, a row count, a passing test. Five to eight criteria is the sweet spot for a single story; if you need fifteen, the story is too big and should be split before an agent touches it.
Why does the bugfix template require a failing test before the fix?
Because it is the only proof the agent actually reproduced the bug. A fix without a failing-first test might be patching a symptom, or nothing at all. The failing test pins the bug down, the passing test proves the fix, and the test stays in the suite so the bug cannot quietly return. It is the single highest-leverage rule you can impose on agent bugfixes.

Keep reading

Stop pasting templates by hand

AIDEN drafts the spec from your story card and holds the agent to it — approval gate included.

macOS 12+ · Bring your own Claude Code or Codex · Your code stays local