Agent skill

Investigating Repository History

by CodeAlive-AI in CodeAlive-AI/ai-driven-development

Investigate GitHub repository history before risky code changes using git blame/log, GitHub PRs, review comments, squash/rebase/cherry-pick/rename heuristics, and cited evidence.

MITAuto-check passedDevelopment

Install Investigating Repository History

skills CLI
$ npx skills add CodeAlive-AI/ai-driven-development --skill investigating-repository-history -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install CodeAlive-AI/ai-driven-development investigating-repository-history --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/CodeAlive-AI/ai-driven-development.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/investigating-repository-history .claude/skills/investigating-repository-history && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
investigating-repository-history
GitHub stars
159
Token cost
~2k tokens
SKILL.md length
757 words
Files
15 (incl. scripts, references, assets)
Skills in repo
22
Repo updated
First seen
Licence
MIT

At a glance

Investigate GitHub repository history before risky code changes using git blame/log, GitHub PRs, review comments, squash/rebase/cherry-pick/rename heuristics, and cited evidence.

  • Works in 6 steps: What code scope was inspected? → Which commits and PRs are relevant? → Which review comments or PR discussions… → …
  • Asking why code exists
  • SKILL.md covers Contents, Trigger conditions, Core rule and Fast path, plus 6 more sections
  • Runs Python scripts from its folder; calls python3, git and gh

What it does

Investigating Repository History is an agent skill from CodeAlive-AI/ai-driven-development. Investigate GitHub repository history before risky code changes using git blame/log, GitHub PRs, review comments, squash/rebase/cherry-pick/rename heuristics, and cited evidence. Use when asking why code exists, whether a change is safe, what PR introduced behavior, or before editing API, compatibility, security, concurrency, persistence, migration, or performance-sensitive code.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 19 other files, including scripts, reference files and assets (for example `README.md`, `agents/openai.yaml` and `assets/history-note-template.md`). Compatibility notes: Designed for Claude Code, Codex, and similar coding agents. Requires a local git clone; bundled scripts require Python 3.9+, git, and authenticated GitHub CLI…

It sits in Development, covering Git workflow. It works with GitHub and Git. The repository describes itself as: Practices, protocols, and skills for AI-driven software development. Skills and safety hooks for Claude Code, Codex, OpenCode, Cursor, Antigravity, and any agent supporting the… The licence is MIT.

When your agent uses it

  • Asking why code exists
  • Whether a change is safe
  • What PR introduced behavior
  • Before editing API

Example prompts

  • “/investigating-repository-history”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Designed for Claude Code, Codex, and similar coding agents. Requires a local git clone; bundled scripts require Python 3.9+, git, and authenticated GitHub CLI `gh` for GitHub PR evidence.
  • Pre-approved tools (allowed-tools): Bash(git:*), Bash(gh:*), Bash(python3:*), Read, Grep

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. What code scope was inspected?
  2. Which commits and PRs are relevant?
  3. Which review comments or PR discussions explain intent?
  4. What constraints, risks, rejected approaches, or tests were found?
  5. Is the evidence strong, weak, contradictory, stale, truncated, or unknown?
  6. How should the implementation plan change?

What it can do on your machine

Read from SKILL.md and the folder at commit 4cfeb10. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(git:*)
    • Bash(gh:*)
    • Bash(python3:*)
    • Read
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • git
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code, Codex, and similar coding agents. Requires a local git clone; bundled scripts require Python 3.9+, git, and authenticated GitHub CLI `gh` for GitHub PR evidence.

    From compatibility in the SKILL.md frontmatter.

Context cost

Investigating Repository History loads about 2k tokens when it runs, and up to ~5.2k if it reads all its reference files. Until then it costs about 104 tokens; SKILL.md has 757 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~104
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from CodeAlive-AI/ai-driven-development at commit 4cfeb10, republished under its MIT licence (© CodeAlive-AI). 757 words, ~1,952 tokens.

Download SKILL.mdSave it as .claude/skills/investigating-repository-history/SKILL.md (or your agent's skills folder). This skill also uses 14 other files; get the full folder from GitHub.
name
investigating-repository-history
description
Investigate GitHub repository history before risky code changes using git blame/log, GitHub PRs, review comments, squash/rebase/cherry-pick/rename heuristics, and cited evidence. Use when asking why code exists, whether a change is safe, what PR introduced behavior, or before editing API, compatibility, security, concurrency, persistence, migration, or performance-sensitive code.
allowed-tools
Bash(git:*), Bash(gh:*), Bash(python3:*), Read, Grep
compatibility
Designed for Claude Code, Codex, and similar coding agents. Requires a local git clone; bundled scripts require Python 3.9+, git, and authenticated GitHub CLI `gh` for GitHub PR evidence.
license
MIT
metadata.version
1.0.0
metadata.methodology
Provenance Mesh

Repository History Investigator

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.

Contents

Trigger conditions

Use this skill when the user asks any of these:

  • “Why is this code written this way?”
  • “Can I remove/simplify/change this check, constraint, branch, migration, public API, or feature flag?”
  • “Which PR introduced this behavior or regression?”
  • “Find the relevant PR/review discussion/history for this code.”
  • Before editing code that touches API compatibility, security, concurrency, persistence, migrations, performance, generated interfaces, feature flags, or unclear legacy/workaround logic.

Do not use this skill for trivial new code with no dependency on existing behavior.

Core rule

Before making a risky edit, produce a history note answering:

  1. What code scope was inspected?
  2. Which commits and PRs are relevant?
  3. Which review comments or PR discussions explain intent?
  4. What constraints, risks, rejected approaches, or tests were found?
  5. Is the evidence strong, weak, contradictory, stale, truncated, or unknown?
  6. How should the implementation plan change?

If the evidence is weak, say UNKNOWN and lower confidence. Never invent intent from a semantic match alone.

Fast path

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.

bash
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:

bash
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:

bash
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.

Progressive disclosure

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.

Investigation workflow

  1. Define scope. Identify paths, line ranges, symbols, tests, error strings, feature flags, and any proposed diff.
  2. Collect local history. Use the script or manual git blame -w -M -C -C -C, git log --follow, git log -S, and git log -G.
  3. Map commits to PRs. Prefer exact GitHub commit→PR association. Treat it as one signal, not the entire answer.
  4. Fetch PR evidence. For candidate PRs, inspect PR body, files, commits, reviews, inline review comments, and issue comments.
  5. Resolve anomalies. If mapping is weak, apply the Provenance Mesh: commit association + patch equivalence + content/symbol lineage.
  6. Extract decision atoms. Convert evidence into explicit claims: constraints, compatibility requirements, security invariants, performance constraints, rejected approaches, test requirements.
  7. Assess risk. Downgrade confidence for semantic-only matches, path-only matches, reverted PRs, API truncation, large PRs, generated files, or missing PRs.
  8. Produce a history note before editing code.
Show full SKILL.md (242 more words)Show less

Evidence confidence rules

High confidence:

  • exact GitHub commit→PR association; or
  • patch/hunk equivalence plus path/symbol agreement; or
  • review comment remaps to the current hunk/symbol and matches the proposed change.

Medium confidence:

  • same symbol/path plus relevant PR discussion, but no patch-level match.

Low confidence:

  • semantic search only, title/body match only, path-only match, or stale/reverted evidence.

Never claim “this was decided” unless a commit, PR body, review, review comment, issue comment, or linked issue supports it.

Output template

Use this concise template in the final answer or implementation plan:

markdown
## 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]

Gotchas

  • git blame is a seed generator, not truth. Formatting commits, moves, squashes, and refactors can hide origin.
  • A PR can be relevant even if it did not introduce the current line; review comments may explain why an alternative was rejected.
  • Squash merges often require patch/hunk matching because the final commit SHA differs from PR commits.
  • File paths are not identity. Track file lineage, directory moves, symbol fingerprints, and hunk context.
  • Reverted PRs are stale evidence unless a later PR reintroduced the same decision.
  • Large gh api responses may be truncated by the underlying GitHub endpoints. If truncation is possible, mark evidence incomplete.
  • General PR conversation comments come from issue comments; inline review comments come from PR review comments.

Available scripts

  • 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.

© CodeAlive-AI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 14 other files (scripts, references, assets) in skills/investigating-repository-history of CodeAlive-AI/ai-driven-development.

  • SKILL.md
  • LICENSE
  • README.md
  • agents/openai.yaml
  • assets/history-note-template.md
  • references/ANOMALIES.md
  • references/DECISION_ATOMS.md
  • references/EVALUATION.md
  • references/GH_CLI.md
  • references/OUTPUT_SCHEMA.md
  • scripts/compact_pr.py
  • scripts/history_context.py
  • scripts/validate_skill.py
  • tests/__init__.py
  • tests/test_skill.py

Open the folder on GitHubat commit 4cfeb10

Compare with similar skills

Investigating Repository History next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Investigating Repository History compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Investigating Repository History this skillCodeAlive-AI/ai-driven-development159—~2kAutomated safety check: PassMIT
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Create Pull Requestcline/cline70k1 repos~1.6kAutomated safety check: PassApache-2.0
Release Bumpjamiepine/voicebox57k—~1.1kAutomated safety check: PassMIT
Create Pull Request with Work Item IDmakeplane/plane61k—~824Automated safety check: PassAGPL-3.0
Creating Description For Gh PRredis/jedis12k—~838Automated safety check: PassMIT

Similar skills

  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

    70k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Release Bump

    jamiepine/voicebox

    Ends a release cycle by moving the Unreleased changelog notes under a dated version heading, bumping version files with bumpversion and tagging the commit.

    57k GitHub stars~1.1k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Opens a pull request for the current branch using the repo's template, a work item ID in the title and a description filled in from the actual diff.

    61k GitHub stars~824 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Official

    Generate a clear, concise GitHub PR title and description from the diff between two local git branches, and save it to prDescription.md in the repo root.

    12k GitHub stars~838 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Pascal Editor PR Opener

    pascalorg/editor

    Opens or refreshes a pull request on pascalorg/editor from the current branch, describing only what the branch's commits and diff actually contain.

    25k GitHub stars~619 tokensUpdated today
    DevelopmentAuto-check passed

More from CodeAlive-AI/ai-driven-development

All 22 skills in this repo
  • Plugins Management

    CodeAlive-AI/ai-driven-development

    Create, publish, delete, and submit plugins for coding agents (Claude Code, OpenCode, Devin CLI/Desktop).

    159 GitHub stars~3.1k tokensUpdated 3 days ago
    Auto-check: notes
  • Windows QA Engineer

    CodeAlive-AI/ai-driven-development

    A skill your agent uses when testing Windows 11 desktop apps (WinForms/WPF/UWP) via UFO UIA/Win32 automation MCP.

    159 GitHub stars~1.4k tokensUpdated 3 days ago
    Auto-check passed
  • Agentic Readiness

    CodeAlive-AI/ai-driven-development

    Audit and improve repositories for reliable agentic work across Codex and Codex App, Claude Code, and OpenCode.

    159 GitHub stars~1.2k tokensUpdated 3 days ago
    Auto-check passed
  • Hooks Management

    CodeAlive-AI/ai-driven-development

    Manage hooks and automation for coding agents (Claude Code, Codex CLI, OpenCode, Devin CLI/Desktop).

    159 GitHub stars~4.8k tokensUpdated 3 days ago
    Auto-check: notes
  • Semantic Scholar Deep

    CodeAlive-AI/ai-driven-development

    Deep research over the Semantic Scholar Graph API. An agent skill from CodeAlive-AI/ai-driven-development.

    159 GitHub stars~2.2k tokensUpdated 3 days ago
    Auto-check passed
  • Fetch URL As Markdown

    CodeAlive-AI/ai-driven-development

    Fetch a web page (URL) and return clean Markdown via local trafilatura, with Exa MCP as a fallback for JS-rendered or anti-bot pages.

    159 GitHub stars~906 tokensUpdated 3 days ago
    Auto-check passed

Works with

Categories

Questions about Investigating Repository History

What does Investigating Repository History do?

Investigate GitHub repository history before risky code changes using git blame/log, GitHub PRs, review comments, squash/rebase/cherry-pick/rename heuristics, and cited evidence. Investigating Repository History is an agent skill from CodeAlive-AI/ai-driven-development. Investigate GitHub repository history before risky code changes using git blame/log, GitHub PRs, review comments, squash/rebase/cherry-pick/rename heuristics, and cited evidence.

When should I use Investigating Repository History?

Investigating Repository History fits situations like: asking why code exists; whether a change is safe; what PR introduced behavior; before editing API.

How do I install Investigating Repository History in Claude Code?

Run `npx skills add CodeAlive-AI/ai-driven-development --skill investigating-repository-history -a claude-code`. Or copy the skill folder (skills/investigating-repository-history in CodeAlive-AI/ai-driven-development) into .claude/skills/investigating-repository-history in your project. Claude Code loads it when a task matches its description.

How do I install Investigating Repository History in Codex?

Run `npx skills add CodeAlive-AI/ai-driven-development --skill investigating-repository-history -a codex`. Or copy the skill folder (skills/investigating-repository-history in CodeAlive-AI/ai-driven-development) into .agents/skills/investigating-repository-history in your project. Codex loads it when a task matches its description.

Can I use Investigating Repository History in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add CodeAlive-AI/ai-driven-development --skill investigating-repository-history -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/investigating-repository-history, .gemini/skills/investigating-repository-history, .github/skills/investigating-repository-history and .opencode/skills/investigating-repository-history in your project.

What does Investigating Repository History need to run?

Going by SKILL.md and its folder, Investigating Repository History needs Python for the scripts in its folder and the command-line tools its instructions call (python3, git and gh). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Bash(git:*), Bash(gh:*), Bash(python3:*), Read, Grep. Compatibility (from SKILL.md): Designed for Claude Code, Codex, and similar coding agents. Requires a local git clone; bundled scripts require Python 3.9+, git, and authenticated GitHub CLI `gh` for GitHub PR evidence..

Does Investigating Repository History access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Investigating Repository History safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Investigating Repository History use?

Investigating Repository History is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Investigating Repository History use?

About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.3k tokens, read only when the agent opens those files.

What are the alternatives to Investigating Repository History?

Skills that share tags, products or a category with Investigating Repository History: Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars), Create Pull Request (cline/cline, 70k stars), Release Bump (jamiepine/voicebox, 57k stars) and Create Pull Request with Work Item ID (makeplane/plane, 61k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Investigating Repository History?

CodeAlive-AI (a GitHub organization) maintains it in CodeAlive-AI/ai-driven-development, which has 159 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on October 8, 2026.

Source: CodeAlive-AI/ai-driven-development on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.