Agent skill
generating-adrs
Use when PRD/TRD contains architectural decisions to document - extracts decisions from refined requirements (architecture choices, data model decisions, API patterns, technology selections, integration strategies, reuse patterns) and generates MADR-format ADRs. One ADR per decision point. Also use when asked to document decisions, create decision records, or retrospectively capture architectural choices.
Install this agent skill to your Project
npx add-skill https://github.com/galihcitta/dotclaudeskills/tree/main/skills/generating-adrs
SKILL.md
Generating ADRs
Extract architectural decisions from PRDs/TRDs and generate MADR (Markdown Any Decision Record) format ADR documents.
When to Use
- PRD/TRD contains architectural choices to document
- User asks to "document decisions" or "create ADRs"
- Retrospectively capturing decisions from existing requirements
- Before implementation to formalize choices
- After implementation to document what was decided and why
When NOT to Use
- Simple bug fixes with no architectural impact
- Requirements without design decisions
- Already-documented decisions (check existing ADRs first)
Workflow
Phase 0: Locate PRD and Existing ADRs
Step 1: Find the source PRD/TRD
Read the PRD directory or file provided by user.
Step 2: Check for existing ADRs
# Look for existing ADR directory at project level
ls -la <project>/adrs/ <project>/docs/adrs/ 2>/dev/null
If ADRs exist, determine next sequence number. If not, start at 0001.
Step 3: Determine output location
ADRs go in <project>/adrs/ directory (project level, NOT inside PRD folder).
Example: PRD at /Works/tada/bridge/agent-workflow/requirements/ → ADRs at /Works/tada/bridge/adrs/
Phase 1: Identify Decision Points
Scan PRD for decision patterns. See references/decision-patterns.md for full taxonomy.
Decision Types to Extract:
| Type | Signals | Often Missed? |
|---|---|---|
| Architecture | ASCII diagrams, "→", "async vs sync" | No |
| Data Model | "Key Design Decision", schema diagrams | No |
| API Design | "Internal API", auth patterns | Yes |
| Technology | "Uses Redis", TTL values | No |
| Integration | "Each X in own transaction", retry patterns | Yes |
| Business Logic | "Before/After", "Once per X not Y" | No |
| Reuse Patterns | "Hybrid approach", "Reuse existing" | Yes |
Critical: Check for commonly missed decisions:
- Reuse vs build-new decisions ("hybrid approach", "thin wrapper")
- Error isolation patterns ("each config in own transaction")
- Internal vs external API decisions
- Calculation context decisions (what value is used as base)
Phase 2: Determine ADR Scope
For each decision, assess if it warrants own ADR:
Create separate ADR when:
- Affects multiple components
- Involves documented trade-offs
- May be questioned later
- Sets precedent for future work
Combine into single ADR when:
- Decisions tightly coupled
- Same rationale drives multiple choices
- From "Confirmed Decisions" table (can group)
Skip ADR when:
- Implementation detail only
- Standard practice with no alternatives
- Single-component impact
Phase 3: Generate ADRs
Use MADR format from references/madr-template.md.
Required sections (baseline test showed these are often missing):
---
status: accepted
date: YYYY-MM-DD
---
# ADR-NNNN: Title
## Status
{proposed | accepted | deprecated | superseded by ADR-XXXX}
## Context and Problem Statement
{WHY was this decision needed - 2-3 sentences}
## Decision Drivers
- {Driver 1}
- {Driver 2}
## Considered Options
1. {Option 1}
2. {Option 2}
## Decision Outcome
Chosen option: "{Option X}", because {justification}.
### Consequences
- Good, because {positive impact}
- Bad, because {negative impact}
- Neutral, because {neutral impact}
Consequence format is critical - always use:
Good, because {specific positive}Bad, because {specific negative}Neutral, because {neither positive nor negative}
Phase 4: Create Index
Generate adrs/README.md:
# Architecture Decision Records
| ID | Title | Status | Date |
|----|-------|--------|------|
| [ADR-0001](ADR-0001-decision-title.md) | Decision Title | Accepted | YYYY-MM-DD |
| [ADR-0002](ADR-0002-another-decision.md) | Another Decision | Accepted | YYYY-MM-DD |
Phase 5: Save Output
Directory structure:
<project>/adrs/
README.md # Index
ADR-0001-first-decision.md
ADR-0002-second-decision.md
Naming convention:
- 4-digit sequence:
ADR-0001notADR-001 - Kebab-case:
ADR-0001-use-async-queue.md - Title in file:
# ADR-0001: Use Async Queue
Quick Reference
| Aspect | Correct | Incorrect |
|---|---|---|
| Location | <project>/adrs/ |
<prd-folder>/adr/ |
| Numbering | ADR-0001 (4 digits) |
ADR-001 (3 digits) |
| Consequences | Good, because... |
Free-form text |
| Frontmatter | Include status, date |
None |
| Options | At least 2 listed | Only chosen option |
Common Mistakes
| Mistake | Fix |
|---|---|
| Missing "Considered Options" | Always list 2+ options, even if one was obvious |
| Free-form consequences | Use "Good/Bad/Neutral, because" format |
| Missing reuse decisions | Check for "hybrid", "reuse", "thin wrapper" |
| ADRs in PRD folder | Put at project level <project>/adrs/ |
| 3-digit numbering | Use 4 digits: ADR-0001 |
| Missing context | Explain WHY decision was needed, not just what |
Anti-Patterns
- Missing alternatives - Always document what was NOT chosen
- Vague context - Be specific about forces and constraints
- No negative consequences - Every decision has trade-offs
- Wrong location - ADRs at project level, not inside PRD
- Skipping reuse decisions - "Hybrid approach" is architectural
See Also
references/madr-template.md- Full and minimal templatesreferences/decision-patterns.md- How to identify decisionsreferences/extraction-examples.md- PRD → ADR transformations
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
troubleshooting-kubernetes
Diagnoses and fixes Kubernetes issues with interactive remediation. Use when pods crash (CrashLoopBackOff, OOMKilled), services unreachable (502/503, empty endpoints), deployments stuck (ImagePullBackOff, pending). Also use when tempted to run kubectl fix commands directly without presenting options, or when user says "just fix it" for K8s issues.
code-reviewer
Comprehensive code review skill for TypeScript, JavaScript, Python, Swift, Kotlin, Go. Includes automated code analysis, best practice checking, security scanning, and review checklist generation. Use when reviewing pull requests, providing code feedback, identifying issues, or ensuring code quality standards.
prd-to-ralph
Use when converting PRD/requirements into JSON format for Ralph Wiggum autonomous loops. Extracts user stories, orders by dependency (schema first, then backend, then UI, then dashboard), auto-adds standard criteria (typecheck, build, lint, tests), outputs structured JSON ready for autonomous iteration.
detecting-ai-code
Use when auditing code for AI authorship, reviewing acquisitions/contractors, verifying academic integrity, or during code review - provides systematic tiered framework for detecting fully AI-generated AND AI-assisted code patterns with confidence scoring
refining-requirements
Use when PRD is prose-heavy, ambiguous, has scattered file paths, missing API contracts, or says "similar to X" without explanation. Transforms rough requirements into implementation-ready specs. Auto-detects tech stack, validates file paths (EXISTS/CREATE/VERIFY markers), handles greenfield and multi-stack projects. Do NOT use for simple bug fixes, typos, or already-structured Jira tickets with clear file paths and acceptance criteria.
interviewing-plans
Use when a plan, PRD, or spec has vague requirements, undefined terms, or missing details - conducts structured interview using AskUserQuestion to surface hidden assumptions, challenge ambiguities, and produce implementation-ready specs. Also use proactively when encountering plans that say things like "make it faster" or "improve UX" without concrete definitions.
Didn't find tool you were looking for?