adr-generator

Generate MADR architectural decision records from git history and annotate code with ADR tags.

6|1|Updated Jun 5, 2026
One-click install
npx skills add https://github.com/hailcpy/gen-adr --skill adr-generator-hailcpy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adr-generator
Source: https://github.com/hailcpy/gen-adr
Command: npx skills add https://github.com/hailcpy/gen-adr --skill adr-generator-hailcpy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Existing codebases lack documentation explaining why architectural choices were made, leaving new developers and AI coding agents blind to past decisions. This Skill retroactively reconstructs that context by mining git history and producing MADR-format Architectural Decision Records plus inline code annotations. ## Core Features & Use Cases - Git History Analysis: Detects merge, squash, or rebase workflows, chunks commits into logical decision units, and clusters related changes across PR boundaries. - Deterministic Classification: Scores candidates using diff signals (new files, dependency changes, schema changes) to filter architectural decisions from bug fixes and noise, with a separate record type for workarounds (HACK/shim/polyfill patterns). - Hallucination Guardrails: Requires inline evidence citations for every Considered Option, verified deterministically against git by judge.py, plus syntax checks on all tagged files. - Use Case: Point it at a three-year-old repo and receive docs/decisions/0001-*.md files with linked commits, plus @ADR tags on the affected functions so any agent can grep for decision context. ## Quick Start Ask the agent to run the adr-generator skill on this repository in assisted mode, scoped to a module like src/payments since a specific tag.

Frequently Asked Questions about adr-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate ADRs from git history automatically?

Run the adr-generator skill on your repository; it analyzes commits, clusters related changes into decision candidates, classifies them by diff signals, and writes MADR files to docs/decisions/. Use quick mode for repos under ~500 commits or autonomous mode for larger histories.

What is the MADR format for architectural decision records?

MADR (Markdown Architectural Decision Records) is a lightweight template with sections for Status, Context, Considered Options, and Decision Outcome. This skill generates MADR files with a retroactive notice, evidence citations, and links back to the original commits.

Does adr-generator work with squash merges and rebase workflows?

Yes, it auto-detects merge commits, squash merges (via (#NNN) subject patterns), and linear rebase histories, choosing a chunking strategy per workflow. For rebase repos it groups by file-path affinity only, since rebasing destroys original timestamps.

Why does adr-generator stop on shallow clones?

A shallow clone has incomplete history, so retroactively generated ADRs would be misleading. The skill halts and instructs you to run git fetch --unshallow before proceeding, except in assisted mode where you can accept incomplete output.

How does the skill prevent hallucinated decision rationale?

Every Considered Option must carry an inline evidence citation (commit SHA plus a deleted/added/renamed file, removed line, or message phrase). The judge.py verifier checks each citation against git deterministically and drops any option that cannot be pinned to actual bytes.

When should I not use retroactive ADR generation?

Avoid it on repos with uninformative commit messages like "fix" or "wip", shallow clones, or codebases where decision context lives only in external tools like Confluence. Output quality scales directly with commit message discipline.