AGENT SKILL

bmad-extract-lessons-from-adrs

Mine architecture decision records (ADRs), gotcha files, runbooks, and docs/archive for cross-project lessons that warrant ai-playbook canonical specs. Use when a project lacks a populated retros/ directory but has equivalent material in other forms.

License 许可
MIT
最近更新
2026-11-09
Stars
★ 6
Forks
1

01 前言 Front Matter

name
bmad-extract-lessons-from-adrs
license
MIT
metadata
{ "author": "ai-playbook", "version": "1.0", "generatedBy": "0.11.0" }
description
Mine architecture decision records (ADRs), gotcha files, runbooks, and docs/archive for cross-project lessons that warrant ai-playbook canonical specs. Use when a project lacks a populated retros/ directory but has equivalent material in other forms.
compatibility
Requires read access to the consumer's docs tree; emits a structured lessons digest.

03 SKILL.md 正文

bmad-extract-lessons-from-adrs

Mine alternative retro-equivalent surfaces (ADRs, gotchas, runbooks, post-mortems, docs/archive) for cross-project patterns that warrant inclusion in the next ai-playbook release.

When to use

Use this skill when:

  • A project has no populated retros/ directory but has an extensive ADR set.
  • A project has retros but they're terse / project-specific and you want a second pass against alternative surfaces.
  • You're authoring an ai-playbook release that consolidates cross-project lessons (e.g. v0.11.0) and want to verify coverage across all consumers.

Don't use when:

  • The project has comprehensive retros that already capture the lessons (read those directly).
  • You want a quick lookup for a specific topic (just Grep the relevant directory).

Inputs

  • Consumer project root (cwd or explicit path).
  • Optional: a "filter focus" — a topic to bias the mining toward (e.g. "DI patterns", "secret rotation", "cascade failures"). If absent, the skill returns broad coverage.

Mining strategy

The skill walks the consumer's docs tree in this order, sampling each surface for retro-equivalent content:

1. ADRs

Path: decisions/, docs/adr/, architecture/decisions/ (whichever exists).

Read each ADR's:

  • "Context" / "Problem" sections — usually contains the failure mode that motivated the decision.
  • "Why NOT X" / "Rejected alternatives" sections — the lessons-learned of approaches that failed.
  • "Consequences" section — the durable trade-off the team accepted.

Skip ADRs about pure tech selection (e.g. "ADR-009: PostgreSQL over MySQL") unless the rationale section lists incident-driven motivations.

2. Gotchas

Path: gotchas.md, docs/gotchas.md, or per-bounded-context <bc>/gotchas.md.

Each gotcha is implicitly a one-line postmortem. Read the why (often only 1-2 sentences); cross-reference if it recurs in other surfaces.

3. Runbooks

Path: runbooks/, docs/runbooks/.

Filter by name patterns suggesting incident response:

  • runbook-*-down-*.md
  • runbook-*-cascade.md
  • runbook-*-recovery.md
  • runbook-*-emergency.md

Read these for cascade graphs + failure-mode taxonomies.

4. docs/archive (or equivalent)

Path: docs/archive/, docs/_archived/, archive/.

Look for files with audit / TODO / context titles:

  • *-AUDIT.md — security audits, often containing concrete incident chains.
  • TODO-*.md — abandoned features (the why abandoned is the lesson).
  • CONTEXT.md — historical decisions written when memory was fresh.

5. CHANGELOGs

Path: CHANGELOG.md, .ai-playbook/CHANGELOG.md.

Look for notes on hotfixes / rollbacks. Pattern: a sequence of small patch releases close in time (v0.10.0 → v0.10.1 → v0.10.2 within a week) usually means real-world gaps surfaced post-merge — extract the gap.

6. Postmortems (if present)

Path: docs/postmortems/, postmortems/.

These are the canonical retro surface; read each entirely.

Output structure

Emit a structured digest as a single markdown document:

# Lessons mined from <project> — <YYYY-MM-DD>

> Source surfaces walked:
> - decisions/ (N files read)
> - gotchas.md (M lines read)
> - runbooks/ (P files read)
> - docs/archive/ (Q files read)
> - postmortems/ (R files read; or "none present")

## Cross-project patterns (recurring; warrant ai-playbook canonical spec)

### Pattern: <name>
- **Severity**: HIGH / MED / LOW
- **Sources**: <ADR-N>, <gotcha-line>, <runbook>
- **Symptom**: one sentence
- **Suggested ai-playbook deliverable**: spec / skill / runbook / template

## Project-specific patterns (informational; NOT for ai-playbook)

- <pattern>: <one-line summary>; reason it's project-specific.

## Surfaces NOT walked (if any)

- <surface>: skipped because <reason>.

Constraint: the output is never written automatically to <project>/retros/. The operator decides which patterns to keep + where they land. The skill emits to stdout / a transient file; the operator copies what they want.

Steps

  1. Locate the project root — cwd unless explicitly provided.
  2. Walk surface 1 (ADRs) — list ADR files, sample each (read first 50 lines + grep for "incident" / "outage" / "broke" / "failed" / "rolled back" / "rejected because"). Tag findings with the ADR number.
  3. Walk surface 2 (gotchas) — read fully (gotcha files are typically <100 lines). Tag findings with line numbers.
  4. Walk surface 3 (runbooks) — list runbook files, filter by incident-pattern names, sample each.
  5. Walk surface 4 (docs/archive) — list files, sample those with audit/TODO/context titles.
  6. Walk surface 5 (CHANGELOGs) — read; flag patch-release sequences.
  7. Walk surface 6 (postmortems) — read all if present.
  8. Cross-reference — patterns appearing in ≥2 surfaces become "recurring" candidates; one-source patterns become "project-specific".
  9. Write the digest per the output schema above.
  10. Show the digest to the operator + suggest next steps (which patterns to promote, which to defer).

Fluid workflow integration

This skill pairs with:

  • bmad-retrospective — when the project has retros/, prefer that; this skill is for projects without retros.
  • openspec-propose for an ai-playbook release — after mining, the recurring patterns become draft proposal.md content.
  • bmad-distillator — sister skill that consolidates BMAD planning artefacts; this skill consolidates post-implementation lessons.

Anti-patterns

  • Auto-writing to <project>/retros/: forbidden. The operator's project doesn't necessarily want a synthesised retro; let them decide.
  • Skipping CHANGELOG on the assumption it's purely descriptive: forbidden. Patch-release cadence is a strong signal.
  • Treating every "Rejected alternative" in an ADR as a lesson: avoid. Some are simple "didn't fit" with no incident behind them; keep the lesson list to incident-driven rejections.
  • Promoting a pattern based on one surface: forbidden. Cross-project canonical specs need ≥2 surfaces (within or across projects).

Reference invocation

/bmad-extract-lessons-from-adrs

# With filter focus:
/bmad-extract-lessons-from-adrs --focus="cascade failures"

# Against a specific project (when cwd is elsewhere):
/bmad-extract-lessons-from-adrs --project=/path/to/project-d

Validation

Each ai-playbook release SHOULD invoke this skill against every consumer in consumers.yaml where retros/ is empty.

04 同仓库更多 Skills

Wizarck
Wizarck/ai-playbook

sweep

Use when the user wants to find code that has quietly stopped being used — types /sweep, asks for a "dead code sweep", "repo entropy", "what can we delete", "orphan files", "unused code", or asks to review a sweep ledger. Adjudicates candidates a deterministic scanner already produced; it never deletes anything and never re-derives findings from raw source. Pairs with ponytail, which gates what gets written rather than what rots.

★ 6
Wizarck
Wizarck/ai-playbook

ponytail

Use when the user wants the laziest solution that actually works — types /ponytail, says "be lazy", "lazy mode", "simplest solution", "minimal solution", "yagni", "do less", or "shortest path", or complains about over-engineering, bloat, boilerplate, or unnecessary dependencies. Supports intensity levels lite, full, ultra (default). Pairs with caveman, which compresses prose, not code.

★ 6
Wizarck
Wizarck/ai-playbook

ponytail-review

Use when the user wants a code review focused exclusively on over-engineering — says "review for over-engineering", "what can we delete", "is this over-engineered", "simplify review", or invokes /ponytail-review. Complements correctness/security review; this one only hunts complexity in the current diff. Gated by the ponytail review_ponytail component.

★ 6
Wizarck
Wizarck/ai-playbook

ponytail-debt

Use when the user wants to harvest every `ponytail:` comment in the codebase into a tracked debt ledger — says "ponytail debt", "/ponytail-debt", "what did ponytail defer", "list the shortcuts", "ponytail ledger", or "what did we mark to do later". One-shot report, changes nothing. Gated by the ponytail debt_ponytail component.

★ 6
Wizarck
Wizarck/ai-playbook

ponytail-audit

Use when the user wants a whole-repo audit for over-engineering — says "audit this codebase", "audit for over-engineering", "what can I delete from this repo", "find bloat", or invokes /ponytail-audit. Like ponytail-review but scans the entire tree, not a diff. One-shot report, applies no fixes. Gated by the ponytail audit_ponytail component.

★ 6
Wizarck
Wizarck/ai-playbook

openspec-propose

Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.

★ 6