/adr:new
Create New ADR
Section titled “Create New ADR”Create a new Architectural Decision Record with the specified title.
Process
Section titled “Process”- Read configuration from
.claude/adr.local.mdif present - Determine next ADR number by scanning existing ADRs
- Ask for format if not specified in config (default: MADR)
- Gather context through elicitation questions
- Create ADR file using selected template
- Update index (README.md) with new entry
Configuration Reading
Section titled “Configuration Reading”Check for .claude/adr.local.md:
adr_paths: Where to create the ADRdefault_format: Template format (madr, nygard, y-statement, etc.)numbering.pattern: How to number (4digit, 3digit, date)madr_variant: Which MADR variant (full, minimal, bare)
Numbering Logic
Section titled “Numbering Logic”- Scan existing ADRs in the configured directory
- Extract highest number
- Increment by 1
- Format according to
numbering.pattern:4digit: 0001, 0002, etc.3digit: 001, 002, etc.date: 20250115, etc.custom: Apply custom pattern
Title Slug Generation
Section titled “Title Slug Generation”Convert title to slug:
- Lowercase
- Replace spaces with hyphens
- Remove special characters
- Truncate if too long
Example: “Use PostgreSQL for Primary Storage” → “use-postgresql-for-primary-storage”
Elicitation
Section titled “Elicitation”If argument is just a title, ask clarifying questions:
- Context: “What is the problem or situation requiring this decision?”
- Options (if using MADR): “What alternatives are being considered?”
- Decision Drivers: “What factors are influencing this decision?”
Use AskUserQuestion for structured input when helpful.
Template Selection
Section titled “Template Selection”Use template from ${CLAUDE_PLUGIN_ROOT}/templates/{format}/:
madr/adr-template-full.mdmadr/adr-template-minimal.mdstructured-madr/adr-template.md(comprehensive with frontmatter and audit)nygard/adr-template.mdy-statement/adr-template.mdalexandrian/adr-template.mdbusiness-case/adr-template.mdtyree-akerman/adr-template.md
File Creation
Section titled “File Creation”Create file at: {adr_path}/{number}-{slug}.md
Replace template placeholders:
{TITLE}→ User-provided title{NUMBER}→ Generated number{DATE}→ Current date (YYYY-MM-DD){STATUS}→ “proposed” (initial status)
Index Update
Section titled “Index Update”After creating ADR, update the README.md index:
- Read existing README.md
- Find ADR table
- Add new entry
- Write updated README.md
Output
Section titled “Output”After creation, report:
- File path created
- ADR number assigned
- Next steps (fill in sections, submit for review)
Error Handling
Section titled “Error Handling”- If no ADR directory exists, offer to create it
- If configuration is missing, use defaults
- If title is empty, prompt for it