Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Commit d626eb2

Browse files
z23ccclaude
andcommitted
feat: add ADR template and integration guide
Architecture Decision Record template for documenting the 'why' behind architectural decisions, with flow-code integration guidance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3201c97 commit d626eb2

2 files changed

Lines changed: 122 additions & 0 deletions

File tree

docs/adr-guide.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# ADR Integration Guide
2+
3+
Architecture Decision Records capture the *why* behind significant technical decisions. This guide covers when to write them, where to store them, and how they integrate with flow-code.
4+
5+
## When to Create an ADR
6+
7+
Write an ADR when making a decision that would be expensive to reverse:
8+
9+
- **Technology choices** — frameworks, libraries, major dependencies
10+
- **Architectural patterns** — data model design, API style, auth strategy
11+
- **Infrastructure decisions** — hosting, build tools, deployment approach
12+
- **Pattern changes** — moving from one approach to another (e.g., REST to GraphQL)
13+
14+
Do NOT write ADRs for routine implementation choices, obvious decisions, or throwaway prototypes.
15+
16+
## Where to Store ADRs
17+
18+
Use `docs/decisions/` with sequential numbering:
19+
20+
```
21+
docs/decisions/
22+
ADR-001-use-libsql-for-storage.md
23+
ADR-002-wave-checkpoint-execution-model.md
24+
ADR-003-teams-file-locking-protocol.md
25+
```
26+
27+
Use the template at `references/adr-template.md` as your starting point.
28+
29+
## Referencing ADRs in Task Specs
30+
31+
When a task implements or depends on an architectural decision, reference the ADR in the task spec:
32+
33+
```bash
34+
flowctl task create --title "Implement file locking" \
35+
--spec "Implements ADR-003. See docs/decisions/ADR-003-teams-file-locking-protocol.md"
36+
```
37+
38+
In inline code, link to the ADR near the relevant implementation:
39+
40+
```
41+
// Auth strategy per ADR-002. See docs/decisions/ADR-002-auth-strategy.md
42+
```
43+
44+
## Integration with /flow-code:plan
45+
46+
During planning, ADRs surface naturally at two points:
47+
48+
1. **Plan creation** — When `/flow-code:plan` encounters an architectural decision, create the ADR as a task in the epic. The ADR task should complete before implementation tasks that depend on it.
49+
50+
2. **Plan review**`/flow-code:plan-review` should verify that significant architectural decisions have corresponding ADRs. Missing ADRs are a review finding.
51+
52+
### Example: ADR as a Plan Task
53+
54+
```
55+
Epic: fn-50-migrate-to-graphql
56+
Task 1: Write ADR-005 documenting REST-to-GraphQL migration rationale
57+
Task 2: Implement GraphQL schema (depends on Task 1)
58+
Task 3: Migrate endpoints (depends on Task 2)
59+
```
60+
61+
## ADR Lifecycle
62+
63+
```
64+
PROPOSED -> ACCEPTED -> SUPERSEDED by ADR-XXX
65+
-> DEPRECATED
66+
```
67+
68+
Never delete old ADRs. When a decision changes, write a new ADR that supersedes the old one. The historical record is the whole point.

references/adr-template.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# ADR-NNN: [Short decision title]
2+
3+
## Status
4+
5+
<!-- One of: Proposed | Accepted | Superseded by ADR-XXX | Deprecated -->
6+
Proposed
7+
8+
## Date
9+
10+
<!-- YYYY-MM-DD when the decision was made or proposed -->
11+
YYYY-MM-DD
12+
13+
## Context
14+
15+
<!-- What is the problem or situation that requires a decision?
16+
Include:
17+
- The specific technical challenge or requirement
18+
- Relevant constraints (performance, team size, timeline, budget)
19+
- Any forcing functions that make this decision necessary now
20+
Keep factual — save opinions for Decision and Alternatives. -->
21+
22+
## Decision
23+
24+
<!-- What is the decision and why?
25+
State the chosen approach clearly, then explain the reasoning.
26+
Link to any supporting evidence (benchmarks, spikes, docs). -->
27+
28+
## Alternatives Considered
29+
30+
<!-- List each alternative with pros, cons, and reason for rejection.
31+
Format per alternative:
32+
33+
### [Alternative name]
34+
- **Pros:** ...
35+
- **Cons:** ...
36+
- **Rejected because:** one-sentence reason
37+
-->
38+
39+
## Consequences
40+
41+
<!-- What are the positive and negative results of this decision?
42+
Include:
43+
- What becomes easier or possible
44+
- What becomes harder or impossible
45+
- New constraints or obligations introduced
46+
- Skills or infrastructure the team now needs
47+
- Follow-up actions required -->
48+
49+
---
50+
51+
<!-- Storage convention: docs/decisions/ADR-NNN-short-title.md
52+
Lifecycle: PROPOSED -> ACCEPTED -> (SUPERSEDED or DEPRECATED)
53+
Never delete old ADRs — they preserve historical context.
54+
When superseding, write a new ADR that references the old one. -->

0 commit comments

Comments
 (0)