Extract adrs

From atomicinnovation/accelerator · View interactive version

Extract adrs is an AI agent skill from the GitHub repository atomicinnovation/accelerator. Extract architecture decision records from existing meta documents (research, plans). Scans documents for implicit or explicit architectural decisions and converts selected ones into formal ADRs. Use when decisions are buried in research or planning documents and need to be captured formally.

How to use this skill

Skill file

Extract ADRs from Meta Documents

!accelerator config context --skill extract-adrs --fail-safe

!accelerator config agents --fail-safe

If no "Agent Names" section appears above, use these defaults:

accelerator:reviewer, accelerator:codebase-locator,

accelerator:codebase-analyser, accelerator:codebase-pattern-finder,

accelerator:documents-locator, accelerator:documents-analyser,

accelerator:web-search-researcher.

Decisions directory: !accelerator config path decisions --fail-safe

Codebase research directory: !accelerator config path research_codebase --fail-safe

Plans directory: !accelerator config path plans --fail-safe

You are tasked with identifying architectural decisions within existing meta

documents and helping the user capture them as formal ADRs.

Initial Setup

When this command is invoked:

  1. Check if parameters were provided:
I'll help you extract architectural decisions from existing documents.

You can:
1. Specify documents to scan: `/accelerator:extract-adrs @{research directory}/2026-03-18-auth-flow.md`
2. Let me scan all documents in the configured directories for decisions (this may take a moment)

Which would you prefer?

Wait for user input.

Process Steps

Step 1: Identify Source Documents

  1. If specific files were provided, read them FULLY
  2. If scanning all meta documents:

configured research, plans, and decisions directories (shown above)

```

I found the following documents:

Research:

Plans:

Which documents should I scan for decisions? (enter numbers, "all", or

specific paths)

```

Step 2: Analyse Documents for Decisions

  1. Spawn {documents analyser agent} agents (one per document, in parallel) with

instructions to identify architectural decisions. Look for:

"The approach is...")

"We considered...")

"We'll follow the X approach")

"Given the constraint of...")

  1. Wait for all agents to complete
  1. Present discovered decisions as Y-statement summaries:
I found the following architectural decisions in the scanned documents:

1. **[Short title]** — In the context of [X], facing [Y], we decided for [Z]
   to achieve [Q], accepting [D].
   Source: `{research directory}/2026-03-18-topic.md`

2. **[Short title]** — In the context of [X], facing [Y], we decided for [Z]
   to achieve [Q], accepting [D].
   Source: `{plans directory}/2026-03-18-topic.md`

3. ...

Which decisions would you like to capture as ADRs? (enter numbers, "all",
or "none")

Wait for user selection.

Step 3: Generate ADRs

  1. Gather metadata by running

accelerator corpus metadata derive.

  1. For each selected decision, generate a draft ADR using the create-adr

template with:

are assigned after approval to avoid gaps from skipped ADRs

  1. Present each generated ADR for user review:

```

Here's draft ADR #N of M:

[ADR content with placeholder number]

Does this look good? (yes / revise / skip / approve all remaining)

```

Wait for approval before proceeding. If the user selects "approve all

remaining", accept all subsequent drafts without further prompts.

  1. Assign final ADR numbers to approved ADRs only, by running:

```

accelerator corpus adr next-number --count N

```

where N is the number of approved (not skipped) ADRs. Replace placeholder

numbers with the assigned sequential numbers. This ensures no gaps from

skipped decisions.

Step 4: Write ADRs

  1. Create the configured decisions directory if it doesn't exist
  1. Populate frontmatter for each approved ADR. Before writing the

file, capture metadata and substitute the unified base fields into

the template's frontmatter block:

1. Invoke accelerator corpus metadata derive

once for the batch to obtain Current Date/Time (UTC):.

2. For each approved ADR, substitute every field below with the

indicated value:

YAML string

(config → VCS user → prompt)

Optional linkage / decision-maker keys are omit-by-default:

the template shows each as ""/[], but write a key

into the artifact only when it has a value, and omit it

entirely otherwise (do not carry the empty placeholder through).

("work-item:NNNN"). Fill when the source names an owning work

item; otherwise omit the key.

"adr:ADR-NNNN" to the ADR(s) this one replaces. Fill when the

source records a supersession; otherwise omit the key.

ADRs (["adr:ADR-NNNN", ...]). Fill when related decisions are

explicit in the source; otherwise omit the key.

when the source names them; otherwise omit the key.

  1. Write each approved ADR to:

{decisions directory}/ADR-NNNN-description.md

  1. Present summary:

```

Created the following ADRs:

All ADRs are in "proposed" status. Use /accelerator:review-adr to

review and accept them.

```

Validate the frontmatter: after writing each ADR, run

accelerator corpus frontmatter validate --file {decisions directory}/ADR-NNNN-description.md

If it exits non-zero, that ADR violates the canonical frontmatter standard;

report the emitted violation and fix the frontmatter before completing.

ADR Template

The ADR template is loaded directly via the template loader so the

shape stays in sync with create-adr:

!accelerator config template adr --fail-safe

When populating the template from extracted decisions:

Important Notes

worth an ADR. Help the user distinguish between significant decisions and

routine implementation choices.

not acceptance.

that wasn't in the original.

may wish to note the ADR in the source document.

each becomes a separate ADR.

for batch creation.

!accelerator config instructions extract-adrs --fail-safe

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.