Claude-skill-registry git-adr
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/git-adr" ~/.claude/skills/majiayu000-claude-skill-registry-git-adr && rm -rf "$T"
skills/data/git-adr/SKILL.mdgit-adr Skill
Comprehensive skill for managing Architecture Decision Records using the git-adr CLI tool.
Auto-Context Loading
At session start, if in a git-adr repository, automatically load ADR summary:
# Silent detection and load git notes --ref=adr list &>/dev/null && git adr list --format oneline 2>/dev/null
This provides awareness of existing decisions without consuming excessive context. See workflows/session-start.md for full behavior.
On-Demand Hydration
Use progressive loading for token efficiency:
| Trigger | Action |
|---|---|
| "Show me ADR {id}" | → full content |
| "What did we decide about X" | → snippets |
| "Record this decision" | Guided creation workflow |
See workflows/decision-recall.md for recall patterns. See workflows/decision-capture.md for creation flow.
CRITICAL RULES
NEVER modify user configuration without explicit permission.
- Do NOT run
orgit-adr config --set
commands unless the user explicitly asks to change configgit config adr.* - Do NOT "check" config by running set commands - use
orgit config --get
onlygit-adr config --get - Before using AI features, READ the existing config with
- do NOT assume or set valuesgit config --local --list | grep adr - If AI config is missing, ASK the user what provider/model they want - do NOT set defaults
- The user's config is sacred - treat it as read-only unless explicitly told otherwise
What is git-adr?
git-adr is a command-line tool that manages ADRs using git notes instead of files:
- Non-intrusive: ADRs don't clutter the working tree
- Portable: Travel with git history
- Linkable: Associate decisions with commits
- Syncable: Push/pull like regular git content
Quick Command Reference
| Command | Description |
|---|---|
| Initialize ADR tracking |
| Create new ADR |
| List all ADRs |
| Display an ADR |
| Edit an ADR |
| Search ADRs |
| Supersede a decision |
| Link ADR to commit |
| Push ADRs to remote |
| Pull ADRs from remote |
| Show statistics |
| Export to files |
| Show configuration |
For full command documentation, see references/commands.md.
Execution Patterns
Before Executing Commands
Always verify the environment:
# 1. Check git-adr is installed git adr --version # 2. Verify in a git repository git rev-parse --is-inside-work-tree # 3. For most commands, check if initialized git notes --ref=adr list 2>/dev/null || echo "Not initialized"
Error Handling
If git-adr is not installed:
git-adr is not installed. Install with: cargo install git-adr # or brew tap zircote/tap && brew install git-adr
If not in a git repository:
git-adr requires a git repository. Initialize with: git init git adr init
If ADRs not initialized:
ADR tracking not initialized. Run: git adr init
Format Selection
Reading Project Configuration
Always check the project's configured template before generating content:
# Get configured template (defaults to madr if not set) TEMPLATE=$(git config --get adr.template 2>/dev/null || echo "madr") echo "Using template: $TEMPLATE"
Available Formats
| Format | Config Value | Best For |
|---|---|---|
| MADR | | General purpose, option analysis (default) |
| Nygard | | Quick, minimal decisions |
| Y-Statement | | Ultra-concise, single sentence |
| Alexandrian | | Pattern-based, forces analysis |
| Business Case | | Stakeholder approval, ROI |
| Planguage | | Measurable quality requirements |
For format templates, see references/formats/.
Creating ADRs
Workflow
- Check format: Read
configadr.template - Load template: Read appropriate format from references/formats/
- Generate content: Fill template with user's context
- Execute command:
with contentgit adr new "<title>"
Example: Creating a MADR
# Create ADR (opens editor with template) git adr new "Use PostgreSQL for primary database" # Or with specific format override git adr new "Use PostgreSQL" --template nygard
When generating content, follow the structure in the appropriate format template.
Common Workflows
New Project Setup
git adr init git adr new "Record architecture decisions" git adr sync --push
Team Collaboration
git adr sync --pull # Get latest git adr new "Add caching" # Create decision git adr sync --push # Share with team
Linking to Implementation
# After implementing a decision git adr link 20250115-use-postgresql abc1234 # View linked commits git adr show 20250115-use-postgresql
Superseding Decisions
# When replacing a decision git adr supersede 20250101-use-mysql "Migrate to PostgreSQL"
For more workflows, see references/workflows.md.
Configuration
Common configuration options:
# Set default template git adr config adr.template madr # Set editor git adr config --global adr.editor "code --wait" # Enable auto-sync git adr config adr.sync.auto_push true git adr config adr.sync.auto_pull true
For all configuration options, see references/configuration.md.
ADR Best Practices
When to Write an ADR
Write an ADR for decisions that are:
- Significant: Affects architecture or design
- Structural: Changes system organization
- Hard to reverse: Would require substantial effort to change
What Makes a Good ADR
- Clear context: Explains the situation and constraints
- Explicit decision: States what was decided
- Documented consequences: Lists positive, negative, and neutral effects
- Alternatives considered: Shows options evaluated
Common Mistakes
- Too detailed (specification, not decision)
- Too brief (no context or rationale)
- Not updating status when decisions change
- Writing long after the decision was made
For complete guidance, see references/best-practices.md.
Progressive Loading Guide
Load reference files based on user intent:
| User Intent | Load File |
|---|---|
| "Create an ADR" | |
| "What commands are available?" | |
| "Configure git-adr" | |
| "What is an ADR?" | |
| "Set up for my team" | |
| "Find decisions about X" | |
| "Record this decision" | |
| "What did we decide" | |
ADR Content Generation
When generating ADR content:
- Read the project's configured format
- Load the corresponding template from references/formats/
- Ask clarifying questions if context is insufficient:
- What problem are you solving?
- What alternatives did you consider?
- What are the constraints?
- Fill the template with the gathered information
- Execute the command to create the ADR
Content Quality Checklist
Before creating an ADR, ensure:
- Context explains the situation clearly
- Decision is explicitly stated
- Consequences are categorized (positive/negative/neutral)
- Alternatives were considered (for MADR format)
- Status is appropriate (proposed/accepted)
Reference Files
| File | Purpose |
|---|---|
| Full command documentation |
| All config options |
| ADR writing guidance |
| Common workflow patterns |
| Natural language → search mapping |
| MADR template |
| Nygard template |
| Y-Statement template |
| Alexandrian template |
| Business Case template |
| Planguage template |
| Auto-context loading behavior |
| Guided ADR creation workflow |
| Find past decisions workflow |