architecture-decision-records
affaan-m/ecc
Capture architectural decisions as structured ADRs during coding sessions so future developers understand the reasoning behind your codebase.
What is architecture-decision-records?
This skill auto-detects architectural decision moments during Claude Code sessions and records them as structured Architecture Decision Records (ADRs). It maintains a searchable log of decisions, alternatives considered, and rationale, so the reasoning behind your codebase is preserved alongside the code rather than lost in Slack threads or memory.
- Detects decision moments (framework choices, database selection, API design, etc.) and prompts you to record them
- Generates structured ADR documents using the Nygard format with context, decision, alternatives, and consequences
- Maintains an indexed ADR directory (`docs/adr/`) with auto-numbered files and a README index
- Retrieves and displays existing ADRs when you ask "why did we choose X?"
- Tracks ADR lifecycle (proposed → accepted → deprecated/superseded) with status and linking
How to install architecture-decision-records
npx skills add null --skill architecture-decision-recordsHow to use architecture-decision-records
- 1.When you reach an architectural decision point (choosing a framework, database, pattern, etc.), explicitly say "let's record this decision" or "ADR this"
- 2.Review the auto-generated ADR draft that includes context, your decision, alternatives considered, and consequences
- 3.Approve the draft or request changes; the skill will only write files after your explicit confirmation
- 4.The ADR is saved to `docs/adr/NNNN-decision-title.md` and automatically indexed in `docs/adr/README.md`
- 5.Later, ask "why did we choose X?" and the skill will retrieve and display the relevant ADR from your project
Use cases
- Recording why you chose Next.js over Vue or React during a frontend framework decision
- Documenting the trade-offs when selecting PostgreSQL over MongoDB for your primary datastore
- Capturing the rationale for choosing REST API over GraphQL with alternatives considered
- Preserving the context around authentication/authorization strategy choices
- Retrieving past architectural decisions to onboard new team members or justify current patterns
- Development teams building systems where architectural decisions need to be documented and justified
- Tech leads and architects who want to preserve decision rationale for future reference
- Projects with multiple contributors where decision context is frequently lost or forgotten
- Teams practicing decision-driven development or architecture review processes
architecture-decision-records FAQ
No. The skill detects decision moments and suggests creating an ADR, but only writes files after you explicitly approve the draft. You control when ADRs are recorded.
You can record past decisions as ADRs. Note the original decision date in the ADR and mark the status accordingly (e.g., 'accepted' if it's still in effect).
Record decisions about technology choices (framework, database, language), architecture patterns, API design, data modeling, infrastructure, security, testing strategy, and process. Skip trivial decisions like variable naming or formatting.
Update the old ADR's status to 'superseded by ADR-NNNN' and link to the new ADR. This preserves the history of why you changed direction.
Yes. The skill will create the `docs/adr/` directory structure on first use (with your confirmation) and you can backfill past decisions or start recording new ones going forward.
Full instructions (SKILL.md)
Source of truth, from affaan-m/ecc.
name: architecture-decision-records description: Capture architectural decisions made during Claude Code sessions as structured ADRs. Auto-detects decision moments, records context, alternatives considered, and rationale. Maintains an ADR log so future developers understand why the codebase is shaped the way it is. metadata: origin: ECC
Architecture Decision Records
Capture architectural decisions as they happen during coding sessions. Instead of decisions living only in Slack threads, PR comments, or someone's memory, this skill produces structured ADR documents that live alongside the code.
When to Activate
- User explicitly says "let's record this decision" or "ADR this"
- User chooses between significant alternatives (framework, library, pattern, database, API design)
- User says "we decided to..." or "the reason we're doing X instead of Y is..."
- User asks "why did we choose X?" (read existing ADRs)
- During planning phases when architectural trade-offs are discussed
ADR Format
Use the lightweight ADR format proposed by Michael Nygard, adapted for AI-assisted development:
# ADR-NNNN: [Decision Title]
**Date**: YYYY-MM-DD
**Status**: proposed | accepted | deprecated | superseded by ADR-NNNN
**Deciders**: [who was involved]
## Context
What is the issue that we're seeing that is motivating this decision or change?
[2-5 sentences describing the situation, constraints, and forces at play]
## Decision
What is the change that we're proposing and/or doing?
[1-3 sentences stating the decision clearly]
## Alternatives Considered
### Alternative 1: [Name]
- **Pros**: [benefits]
- **Cons**: [drawbacks]
- **Why not**: [specific reason this was rejected]
### Alternative 2: [Name]
- **Pros**: [benefits]
- **Cons**: [drawbacks]
- **Why not**: [specific reason this was rejected]
## Consequences
What becomes easier or more difficult to do because of this change?
### Positive
- [benefit 1]
- [benefit 2]
### Negative
- [trade-off 1]
- [trade-off 2]
### Risks
- [risk and mitigation]
Workflow
Capturing a New ADR
When a decision moment is detected:
- Initialize (first time only) — if
docs/adr/does not exist, ask the user for confirmation before creating the directory, aREADME.mdseeded with the index table header (see ADR Index Format below), and a blanktemplate.mdfor manual use. Do not create files without explicit consent. - Identify the decision — extract the core architectural choice being made
- Gather context — what problem prompted this? What constraints exist?
- Document alternatives — what other options were considered? Why were they rejected?
- State consequences — what are the trade-offs? What becomes easier/harder?
- Assign a number — scan existing ADRs in
docs/adr/and increment - Confirm and write — present the draft ADR to the user for review. Only write to
docs/adr/NNNN-decision-title.mdafter explicit approval. If the user declines, discard the draft without writing any files. - Update the index — append to
docs/adr/README.md
Reading Existing ADRs
When a user asks "why did we choose X?":
- Check if
docs/adr/exists — if not, respond: "No ADRs found in this project. Would you like to start recording architectural decisions?" - If it exists, scan
docs/adr/README.mdindex for relevant entries - Read matching ADR files and present the Context and Decision sections
- If no match is found, respond: "No ADR found for that decision. Would you like to record one now?"
ADR Directory Structure
docs/
└── adr/
├── README.md ← index of all ADRs
├── 0001-use-nextjs.md
├── 0002-postgres-over-mongo.md
├── 0003-rest-over-graphql.md
└── template.md ← blank template for manual use
ADR Index Format
# Architecture Decision Records
| ADR | Title | Status | Date |
|-----|-------|--------|------|
| [0001](0001-use-nextjs.md) | Use Next.js as frontend framework | accepted | 2026-01-15 |
| [0002](0002-postgres-over-mongo.md) | PostgreSQL over MongoDB for primary datastore | accepted | 2026-01-20 |
| [0003](0003-rest-over-graphql.md) | REST API over GraphQL | accepted | 2026-02-01 |
Decision Detection Signals
Watch for these patterns in conversation that indicate an architectural decision:
Explicit signals
- "Let's go with X"
- "We should use X instead of Y"
- "The trade-off is worth it because..."
- "Record this as an ADR"
Implicit signals (suggest recording an ADR — do not auto-create without user confirmation)
- Comparing two frameworks or libraries and reaching a conclusion
- Making a database schema design choice with stated rationale
- Choosing between architectural patterns (monolith vs microservices, REST vs GraphQL)
- Deciding on authentication/authorization strategy
- Selecting deployment infrastructure after evaluating alternatives
What Makes a Good ADR
Do
- Be specific — "Use Prisma ORM" not "use an ORM"
- Record the why — the rationale matters more than the what
- Include rejected alternatives — future developers need to know what was considered
- State consequences honestly — every decision has trade-offs
- Keep it short — an ADR should be readable in 2 minutes
- Use present tense — "We use X" not "We will use X"
Don't
- Record trivial decisions — variable naming or formatting choices don't need ADRs
- Write essays — if the context section exceeds 10 lines, it's too long
- Omit alternatives — "we just picked it" is not a valid rationale
- Backfill without marking it — if recording a past decision, note the original date
- Let ADRs go stale — superseded decisions should reference their replacement
ADR Lifecycle
proposed → accepted → [deprecated | superseded by ADR-NNNN]
- proposed: decision is under discussion, not yet committed
- accepted: decision is in effect and being followed
- deprecated: decision is no longer relevant (e.g., feature removed)
- superseded: a newer ADR replaces this one (always link the replacement)
Categories of Decisions Worth Recording
| Category | Examples |
|---|---|
| Technology choices | Framework, language, database, cloud provider |
| Architecture patterns | Monolith vs microservices, event-driven, CQRS |
| API design | REST vs GraphQL, versioning strategy, auth mechanism |
| Data modeling | Schema design, normalization decisions, caching strategy |
| Infrastructure | Deployment model, CI/CD pipeline, monitoring stack |
| Security | Auth strategy, encryption approach, secret management |
| Testing | Test framework, coverage targets, E2E vs integration balance |
| Process | Branching strategy, review process, release cadence |
Integration with Other Skills
- Planner agent: when the planner proposes architecture changes, suggest creating an ADR
- Code reviewer agent: flag PRs that introduce architectural changes without a corresponding ADR
Related skills
More from affaan-m/ecc and the wider catalog.
article-writing
Write long-form content in a distinctive voice, from blog posts to guides, without sounding like an LLM.
automation-audit-ops
Evidence-first inventory and overlap audit for automation jobs, hooks, connectors, and MCP servers.
autonomous-loops
Patterns and architectures for autonomous Claude Code loops, from sequential pipelines to RFC-driven multi-agent DAG systems.
backend-patterns
Backend architecture patterns, API design, database optimization, and best practices for Node.js, Express, and Next.js.
benchmark
Measure performance baselines, detect regressions, and compare stack alternatives before/after changes.
benchmark-methodology
Agent skill from affaan-m/ecc.