一键导入
adr-workflow
ADR-driven development workflow
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
ADR-driven development workflow
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | adr-workflow |
| description | ADR-driven development workflow |
| disable-model-invocation | false |
Every task gets an ADR before any code changes. This creates an observability layer where every decision, change, and tradeoff is recorded.
Do NOT use EnterPlanMode. The ADR replaces plan mode entirely.
ADRs live in docs/decisions/ alongside the project's docs. Implementation code lives in the repo. The ADR captures why and what; the code captures how.
docs/
decisions/
adr-001-add-auth/
index.md # The decision record
ticket-1-add-routes.md # Implementation tickets
ticket-2-add-middleware.md
src/
auth/ # Implementation lives here
The decisions directory is docs/decisions/. Create it if it doesn't exist.
Scan for existing adr-NNN-* folders. The next number is max(existing) + 1, zero-padded to 3 digits. Start at 001 if none exist.
Choose a short slug: adr-003-add-search-api.
Also ensure docs/decisions/index.md has a database schema. Read the file if it exists; if it already contains database: in its frontmatter, leave it unchanged. Otherwise create or overwrite it with:
---
title: Decisions
database:
schema:
status:
type: select
options: [proposed, accepted, superseded]
default: proposed
defaultView: list
---
# Decisions
All architecture decisions for this project.
<div data-type="database" data-path="." data-view="list"></div>
Create directory docs/decisions/adr-NNN-slug/ and write index.md:
---
type: adr
status: proposed
database:
schema:
status:
type: select
options: [todo, in-progress, review, done]
default: todo
priority:
type: select
options: [critical, high, medium, low]
assignee:
type: select
options: [opus, sonnet, haiku]
defaultView: board
groupBy: status
---
# ADR-NNN: Title
## Context
## Decision
## Consequences
## Tickets
<div data-type="database" data-path="." data-view="board"></div>
The database frontmatter and data-path="." div allow rendering the ticket files as a kanban board.
Before writing the ADR, explore the codebase:
Use Explore agents for broad codebase research. Use Grep/Glob for targeted searches.
Fill in index.md. Do NOT leave sections as placeholders.
Create one .md file per implementation step in the ADR folder.
Filename: ticket-N-short-slug.md
Format:
---
title: Short descriptive title
status: todo
priority: critical|high|medium|low
assignee: opus|sonnet|haiku
blocked_by: []
---
# Title
Implementation instructions with enough detail for the assigned model to work independently.
## Files to touch
- `src/path/to/file.ts` — what to change and why
blocked_by: List ticket numbers (e.g. [1, 3]) that must complete before this ticket can start. Leave empty [] or omit for tickets with no dependencies.
When creating tickets, explicitly set blocked_by based on logical dependencies (e.g., a ticket that wires components depends on the ticket that creates them).
Assignee = model selection:
Show the full overview of the ticket as well as a file system link to the location of the ADR
Use AskUserQuestion to present the ADR. Include:
Do NOT write implementation code until the user approves.
After approval:
blocked_by from each ticket's frontmatterblocked_by, add an implicit dependency (B waits for A, lower ticket number first)Using the dependency graph from 8a, classify tickets into two groups:
blocked_by AND no file overlaps with other ready tickets. These can run concurrently in worktrees.blocked_by dependencies OR file overlaps with other tickets. These MUST run one at a time on main, each building on the previous commit.Important: Most ADRs have a dependency chain (ticket 2 depends on 1, ticket 3 depends on 2). In this common case, ALL tickets are sequential — do NOT use worktrees.
For each parallel ticket with no dependencies:
Agent tool:
model based on the ticket's assignee field (haiku/sonnet/opus)isolation: "worktree" — each agent gets its own branchrun_in_background: truemode: "bypassPermissions"status: todo → status: in-progressFor each sequential ticket, one at a time, in dependency order:
Agent tool:
model based on the ticket's assignee field (haiku/sonnet/opus)isolation — runs directly on main so it sees all prior ticket commitsrun_in_background: truemode: "bypassPermissions"status: todo → status: in-progressEvery agent prompt includes:
## REQUIRED: Commit your work
When your implementation is complete, you MUST create a git commit. This is not optional.
Run:
git add -A
git commit -m "feat(adr-NNN): <ticket title>"
Replace NNN with the ADR number and use the exact ticket title as the commit message body.
Do not push.
mode: "bypassPermissions"status: done. If worktree, merge branch into main. Then check if downstream tickets are now unblocked.index.md: status: proposed → status: acceptedticket-N-fix-integration.md, spawn agent, re-verifyImportant: Agents write implementation code to the repo (the working directory). ADR files live in docs/decisions/. Only the main session writes to the decisions directory — agents don't need decisions access.