← ClaudeAtlas

backfill-decisionslisted

Mine a repository's git history for architecturally significant decisions made in the past and retroactively write Decision Records for them, following the log-decision conventions. User-only: runs only when explicitly invoked with /backfill-decisions [time range, path, or topic]. When the user wants to document historical or undocumented decisions, reconstruct ADRs/DRs from git history, generate ADRs for a legacy or existing codebase, or document the architecture history, suggest running this command. For a decision being made right now, use /log-decision instead.
azborgonovo/ai-skills · ★ 0 · DevOps & Infrastructure · score 78
Install: claude install-skill azborgonovo/ai-skills
# Backfill Decisions Reconstruct Decision Records (DRs) for significant past decisions by mining git history. This skill produces *retroactive* DRs — the decision has already been made and adopted; the goal is to capture the evidence and reasoning that history reveals, honestly marked as a reconstruction. > **Making a decision now?** Use `/log-decision` to record it while the reasoning is fresh, or `/decide` if you're still exploring options. This skill is only for decisions already buried in the repository's past. ## Execution Steps ### Phase 0 — Preconditions and Scope 1. Run `git rev-parse --is-inside-work-tree`. If not inside a repository, stop and tell the user. 2. Run `git rev-parse --is-shallow-repository`. If `true`, warn the user that the clone is shallow — the history is truncated and mining it would silently miss most decisions — and suggest `git fetch --unshallow` before continuing. 3. Gauge the repo: `git rev-list --count HEAD` for commit count, and `git log --reverse --date=short --pretty='%ad' | head -1` for the first commit date. 4. Parse `$ARGUMENTS` if provided — any combination of: - a **date range** like `2023..2024` → translate to `--since`/`--until` on every `git log` - a **path** like `src/api` → append `-- <path>` to every `git log` - a **topic keyword** like `"database"` → add it to the grep patterns in Phase 2 5. If more than ~1,500 commits are in scope and no range was given, use `AskUserQuestion`: scan the whole history **era-by-era**