/adr:export
Export ADRs
Section titled “Export ADRs”Export Architectural Decision Records to HTML, JSON, or PDF format for sharing, documentation sites, or archival.
Process
Section titled “Process”- Parse export options
- Read all ADRs
- Parse and structure content
- Generate output in specified format
- Write to output location
Argument Parsing
Section titled “Argument Parsing”Supported arguments:
--format=<format>: Output format (html, json, pdf)--output=<path>: Output directory or file--filter=<status>: Only export ADRs with status--single: Export as single combined file--ids=<ids>: Export specific ADRs (comma-separated)
Default: HTML format to {adr_path}/export/
HTML Export
Section titled “HTML Export”Single ADR Export
Section titled “Single ADR Export”Convert each ADR to styled HTML:
- Apply CSS styling
- Add status badges
- Format code blocks
- Include navigation links
Combined Export
Section titled “Combined Export”Create single HTML document:
- Table of contents
- All ADRs in sequence
- Status filtering
- Search functionality (if JavaScript enabled)
Styling
Section titled “Styling”Apply project styling or defaults:
- Status badge colors
- Typography
- Responsive layout
- Print-friendly styles
Example HTML structure:
<!DOCTYPE html><html><head> <title>Architecture Decision Records</title> <style>/* ADR styles */</style></head><body> <header> <h1>Architecture Decision Records</h1> <nav></nav> </header> <main> <article id="adr-0001"> <span class="badge badge-accepted">Accepted</span> <h2>ADR-0001: Use PostgreSQL</h2>
</article> </main></body></html>JSON Export
Section titled “JSON Export”Export structured data for tooling integration.
Schema: See ${CLAUDE_PLUGIN_ROOT}/schemas/adr-export.schema.json for the full JSON schema.
{ "metadata": { "project": "Project Name", "exported": "{ISO-8601-timestamp}", "total": 25 }, "adrs": [ { "id": "0001", "title": "Use PostgreSQL for Primary Storage", "slug": "use-postgresql-for-primary-storage", "status": "accepted", "date": "{date}", "format": "madr", "file": "docs/adr/0001-use-postgresql.md", "sections": { "context": "...", "decision": "...", "consequences": ["...", "..."] }, "links": { "supersedes": [], "superseded_by": null, "relates_to": ["0003", "0007"] } } ], "statistics": { "by_status": { "accepted": 20, "proposed": 3, "deprecated": 1, "superseded": 1 }, "by_month": { "2025-01": 5, "2024-12": 3 } }}PDF Export
Section titled “PDF Export”Generate PDF document:
Using Markdown-to-PDF
Section titled “Using Markdown-to-PDF”# If pandoc availablepandoc docs/adr/*.md -o adrs.pdf --tocVia HTML
Section titled “Via HTML”- Generate HTML
- Use browser print-to-PDF
- Or use headless Chrome/Puppeteer
PDF Styling
Section titled “PDF Styling”- Professional document layout
- Page numbers
- Table of contents
- Status indicators
- Header/footer with project name
Output Options
Section titled “Output Options”Directory Export
Section titled “Directory Export”Export each ADR as separate file:
export/├── index.html├── 0001-use-postgresql.html├── 0002-event-driven.html└── assets/ └── styles.cssSingle File Export
Section titled “Single File Export”Combine all ADRs:
export/adrs.htmlexport/adrs.jsonexport/adrs.pdfConfiguration
Section titled “Configuration”Read from .claude/adr.local.md:
export: default_format: html html_template: default include_toc: true include_status_badges: true output_dir: nullOutput
Section titled “Output”Report export complete:
- Format: {format}
- ADRs exported: {count}
- Output location: {path}
- Total size: {size}
Error Handling
Section titled “Error Handling”- If output directory doesn’t exist, create it
- If PDF tools unavailable, suggest alternatives
- If ADRs have parsing errors, report and continue