Home › Agent workflows › Spec-driven development AGENTS.md

Spec-driven development AGENTS.md

AGENTS.md workflow for spec-driven development: write a spec, then a plan, then tasks, and implement against them.

AGENTS.mdAgent workflows

How to use

Save this as AGENTS.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

Note: Review and test before use. Provided as is, without warranty. See Terms.

AGENTS.mdDownload  
# AGENTS.md: Spec-driven workflow

For any feature bigger than a small fix, work through three documents in `specs/<feature>/` before writing code.

## 1. `spec.md` (what and why)
- Problem, users, and goals; explicit non-goals.
- User-visible behavior as numbered requirements (`R1: A signed-in user can export orders as CSV`), with acceptance criteria written as Given/When/Then.
- Edge cases and error states. Open questions at the top, marked `[?]`.
- No implementation details here. Ask the user to confirm the spec before continuing.

## 2. `plan.md` (how)
- Architecture and data model changes, APIs/contracts, libraries, and why. Reference existing code to reuse.
- Security, performance, and migration considerations.
- How each requirement (R1, R2...) will be verified.

## 3. `tasks.md` (steps)
- A checklist of small tasks, each tied to requirements, in dependency order, each with its test.
- Mark tasks done (`[x]`) as you complete them so work can resume in a new session.

## Implementing
- Do tasks in order. Write or update the test for a task first, then the code.
- If you discover the spec or plan is wrong, stop and update the document (and tell the user) instead of silently diverging.
- Keep commits per task, referencing the task.

## Done
All tasks checked, every requirement has a passing test, and the docs reflect what was built.

More: all Agent workflows rules · all AGENTS.md rules

Related rules

Code review Copilot instructions

Copilot instructions focused on pull request review: what to flag, severity labels, and how to word comments.

GitHub CopilotAgent workflows

Code review prompt file (Copilot)

A Copilot prompt file (/review-changes) that reviews the current changes and reports issues by severity without editing.

GitHub CopilotAgent workflows

Code reviewer subagent (Claude Code)

A Claude Code subagent definition that reviews the current diff for bugs, security, and tests, reporting by severity.

Claude Code (CLAUDE.md)Agent workflows

/commit slash command (Claude Code)

A Claude Code /commit slash command that reviews staged changes and writes a Conventional Commits message.

Claude Code (CLAUDE.md)Agent workflows

Context management for long agent sessions CLAUDE.md

CLAUDE.md practices for keeping Claude Code effective in long sessions: lean memory, notes files, subagents, and resets.

Claude Code (CLAUDE.md)Agent workflows

Git commits & PRs AGENTS.md

AGENTS.md rules for how agents commit: Conventional Commits, atomic changes, safe git commands, and PR descriptions.

AGENTS.mdAgent workflows

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.