Help us improve
Share bugs, ideas, or general feedback.
Investigates GitHub repository history before risky code changes using git blame/log, PRs, review comments, and rename/cherry-pick heuristics. Use before editing API, security, concurrency, or migration code.
npx claudepluginhub codealive-ai/ai-driven-development --plugin ai-driven-developmentHow this skill is triggered — by the user, by Claude, or both
Slash command
/ai-driven-development:investigating-repository-historyThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill to reconstruct the historical intent behind code before changing it. The goal is not merely “find the blame commit”; the goal is to return a compact, cited history note explaining relevant PRs, review comments, constraints, rejected approaches, and anomalies.
Traces the latest change for a file range or pasted snippet via git blame and entire explain lookups to explain code provenance.
Traces git history to find when and why code changed, who wrote it, and root cause of bugs. Use for code archaeology, git blame, and change tracking.
Investigates historical context of existing code, patterns, or constraints via git log/blame, PR/ADR searches, and dependency analysis before proposing changes.
Share bugs, ideas, or general feedback.
Use this skill to reconstruct the historical intent behind code before changing it. The goal is not merely “find the blame commit”; the goal is to return a compact, cited history note explaining relevant PRs, review comments, constraints, rejected approaches, and anomalies.
Use this skill when the user asks any of these:
Do not use this skill for trivial new code with no dependency on existing behavior.
Before making a risky edit, produce a history note answering:
If the evidence is weak, say UNKNOWN and lower confidence. Never invent intent from a semantic match alone.
From the repository working tree, run the collector first. If the skill directory is not the current directory, prefix the script path with the installed skill path and pass --repo-dir /path/to/repo.
python3 scripts/history_context.py inspect \
--repo-dir /path/to/repo \
--path path/to/file.ext \
--start 120 --end 160 \
--question "Can I remove this constraint?" \
--format markdown
For symbol-level questions without exact lines:
python3 scripts/history_context.py inspect \
--repo-dir /path/to/repo \
--path path/to/file.ext \
--symbol SymbolOrFunctionName \
--question "Why does this behavior exist?" \
--format markdown
For JSON suitable for deeper agent reasoning:
python3 scripts/history_context.py inspect \
--repo-dir /path/to/repo \
--path path/to/file.ext \
--start 120 --end 160 \
--symbol SymbolOrFunctionName \
--question "What PR introduced this behavior?" \
--format json \
--output history-context.json
Then read only the relevant sections of the output. Do not paste huge raw PR/comment dumps into the final answer.
Load these files only when needed:
references/ANOMALIES.md — use when exact commit→PR mapping fails, or when squash, rebase, cherry-pick, backport, revert, rename, split, generated files, or mass refactors are possible.references/GH_CLI.md — use when the script fails or manual gh api calls are needed.references/DECISION_ATOMS.md — use when converting PR/comment evidence into constraints, risks, rejected approaches, or test requirements.references/OUTPUT_SCHEMA.md — use when producing a formal machine-readable report.references/EVALUATION.md — use when testing or improving the skill.git blame -w -M -C -C -C, git log --follow, git log -S, and git log -G.High confidence:
Medium confidence:
Low confidence:
Never claim “this was decided” unless a commit, PR body, review, review comment, issue comment, or linked issue supports it.
Use this concise template in the final answer or implementation plan:
## History note
Scope inspected: [paths, lines, symbols]
Relevant evidence:
- PR #[n] — [relation: exact/squash-like/rename-lineage/search], [why relevant], [confidence]
- Commit [sha] — [what it changed], [relation]
- Review/comment — [constraint or concern]
Decision atoms:
- [constraint/risk/rejected approach/test requirement] — [claim] — evidence: [PR/comment/commit]
Risk: [low|medium|high|unknown]
Confidence: [0.00-1.00]
Unknowns/truncation: [none or list]
Plan impact: [proceed|modify plan|ask human|do not change]
git blame is a seed generator, not truth. Formatting commits, moves, squashes, and refactors can hide origin.gh api responses may be truncated by the underlying GitHub endpoints. If truncation is possible, mark evidence incomplete.scripts/history_context.py — main collector for local Git + GitHub PR evidence. Run python3 scripts/history_context.py --help.scripts/compact_pr.py — fetch one or more PRs and print compact evidence. Run python3 scripts/compact_pr.py --help.scripts/validate_skill.py — validate this skill’s frontmatter and basic structure.