Get the FREE Ultimate OpenClaw Setup Guide →

adr-integration

npx machina-cli add skill zircote/adr/adr-integration --openclaw
Files (1)
SKILL.md
5.7 KB

ADR Integration

This skill provides guidance on integrating ADRs with CI/CD pipelines, documentation sites, and other development tools for automated workflows and better discoverability.

CI/CD Integration

GitHub Actions

name: ADR Checks

on:
  pull_request:
    paths:
      - 'docs/adr/**'

jobs:
  adr-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Check ADR format
        run: |
          # Verify ADR numbering
          # Check required sections
          # Validate links

      - name: Update ADR index
        run: |
          # Regenerate README.md
          # Check for changes

GitLab CI

adr-validation:
  stage: lint
  rules:
    - changes:
        - docs/adr/**
  script:
    - ./scripts/validate-adrs.sh
    - ./scripts/update-adr-index.sh

Pre-commit Hooks

# .pre-commit-config.yaml
repos:
  - repo: local
    hooks:
      - id: adr-lint
        name: Lint ADRs
        entry: ./scripts/lint-adr.sh
        language: script
        files: ^docs/adr/.*\.md$

Documentation Site Integration

MkDocs

# mkdocs.yml
nav:
  - Home: index.md
  - Architecture:
    - Overview: architecture/overview.md
    - Decision Records: architecture/adr/README.md

plugins:
  - search
  - macros:
      module_name: adr_macros

Docusaurus

// docusaurus.config.js
module.exports = {
  docs: {
    sidebar: {
      Architecture: [
        'architecture/overview',
        {
          type: 'category',
          label: 'Decision Records',
          items: ['architecture/adr/README'],
        },
      ],
    },
  },
};

Sphinx

.. toctree::
   :maxdepth: 2
   :caption: Architecture

   architecture/overview
   architecture/adr/index

Export Formats

HTML Export

Generate standalone HTML:

  • Apply CSS styling
  • Include navigation
  • Add status badges
  • Generate table of contents

JSON Export

Export for tooling integration:

{
  "adrs": [
    {
      "id": "0001",
      "title": "Use PostgreSQL",
      "status": "accepted",
      "date": "2025-01-15",
      "file": "docs/adr/0001-use-postgresql.md",
      "supersedes": [],
      "superseded_by": null,
      "related": ["0003", "0007"]
    }
  ],
  "stats": {
    "total": 25,
    "accepted": 20,
    "proposed": 3,
    "deprecated": 1,
    "superseded": 1
  }
}

PDF Export

Generate PDFs for:

  • Stakeholder presentations
  • Audit documentation
  • Offline reading
  • Compliance records

Tool Integrations

Jira/Issue Trackers

Link ADRs to tickets:

  • Create "ADR" issue type
  • Link implementation tickets to ADRs
  • Track ADR lifecycle in workflow

Confluence/Wiki

Sync ADRs to wiki:

  • Auto-publish accepted ADRs
  • Include cross-links
  • Maintain version history

Slack/Teams

ADR notifications:

  • New ADR proposed
  • ADR accepted/rejected
  • Compliance violations

Architecture Tools

Export to architecture tools:

  • C4 model diagrams
  • Enterprise architecture tools
  • Design documentation

Git Integration

Commit Messages

Reference ADRs in commits:

feat: implement event-driven order processing

Implements ADR-0012 (Event-Driven Architecture)

- Add order event publisher
- Create payment event handler
- Remove synchronous calls

Branch Naming

Include ADR reference:

feature/adr-0012-event-driven-orders
fix/adr-0015-auth-compliance

Pull Request Templates

## Related ADRs

- [ ] This PR implements ADR-XXXX
- [ ] This PR complies with accepted ADRs
- [ ] This PR proposes new ADR (link below)

### ADR Compliance Check

- [ ] Architecture patterns followed
- [ ] Technology choices match ADRs
- [ ] No ADR violations introduced

Automation Scripts

Index Generation

Auto-generate README.md index:

#!/bin/bash
# Generate ADR index from files

echo "# Architecture Decision Records"
echo ""
echo "| ID | Title | Status | Date |"
echo "|----|-------|--------|------|"

for file in docs/adr/[0-9]*.md; do
  # Extract metadata
  # Format table row
  echo "| $id | [$title]($file) | $status | $date |"
done

Link Validation

Check ADR cross-references:

#!/bin/bash
# Validate ADR links

for file in docs/adr/*.md; do
  # Find ADR references (ADR-XXXX)
  # Verify linked ADRs exist
  # Report broken links
done

Status Sync

Ensure bidirectional links:

#!/bin/bash
# Sync supersedes/superseded-by

for file in docs/adr/*.md; do
  # If A supersedes B
  # Verify B has superseded-by: A
done

Monitoring and Metrics

ADR Health Dashboard

Track metrics:

  • Total ADRs by status
  • ADRs created per month
  • Average time to accept
  • Supersession rate
  • Compliance violations

Alerts

Set up notifications for:

  • ADRs proposed > 30 days
  • Deprecated ADRs without successors
  • Compliance violations
  • Missing links/metadata

Configuration

Configure integrations in .claude/adr.local.md:

git:
  enabled: true
  auto_commit: false
  commit_template: "docs(adr): {action} ADR-{id} {title}"

export:
  default_format: html
  html_template: default
  include_toc: true
  output_dir: null

integration:
  docs_site: mkdocs
  issue_tracker: jira
  notifications: slack

Additional Resources

Reference Files

  • references/ci-templates.md - CI/CD pipeline templates
  • references/export-templates.md - Export format templates

Related Skills

  • adr-compliance - Compliance checking integration
  • adr-fundamentals - Basic ADR workflow

Source

git clone https://github.com/zircote/adr/blob/main/skills/adr-integration/SKILL.mdView on GitHub

Overview

ADR integration provides practical guidance for weaving Architectural Decision Records into CI/CD pipelines, documentation sites, and related tooling. It helps automate ADR checks, index regeneration, and exporting ADR data to support tooling, audits, and improved discoverability.

How This Skill Works

Technically, it offers templates and examples to hook ADR validation into CI pipelines, generate an ADR index, and export ADR data for downstream tools. It covers GitHub Actions, GitLab CI, and pre-commit hooks, plus documentation site configs for MkDocs, Docusaurus, and Sphinx.

When to Use It

  • When validating ADR format during PRs and ensuring ADR numbering
  • When regenerating or syncing the ADR index for docs sites
  • When exporting ADR data to JSON or PDF for tooling and audits
  • When linking ADRs to tickets in Jira or wiki pages for discoverability
  • When configuring CI or pre-commit hooks to automate ADR checks

Quick Start

  1. Step 1: Identify ADRs under docs/adr and adopt a standard template
  2. Step 2: Pick integration points (CI, docs site, or tooling) and implement checks or exports
  3. Step 3: Run your pipeline or site build to validate, index, and export ADRs

Best Practices

  • Define a consistent ADR template with required sections
  • Automate ADR validation and indexing in CI/CD
  • Regenerate the ADR index on changes and review diffs
  • Use standardized export formats for tooling (HTML, JSON, PDF)
  • Document tool integrations and cross-links for discoverability

Example Use Cases

  • GitHub Actions workflow that lints ADRs in docs/adr and regenerates the ADR index
  • GitLab CI job that runs ADR validation scripts and updates the ADR index on changes
  • Pre-commit hook that lints ADR MD files before commit
  • MkDocs site config showing ADRs under Architecture and a generated index
  • Docusaurus/Sphinx doc setups demonstrating ADR links and JSON export for tooling

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers