Index of every page on this site: llms.txt
All skills
nielsmadan avatar

/review-history

@9fbe49f
Run it yourself

Analyze how code changed over time. Use when investigating regressions, understanding why code was written a certain way, or finding when a behavior changed.

Use this Skill: https://skilld.dev/gh/nielsmadan/agentic-coding/review-history

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈43 tokens for metadata: the name and description. ≈1.3k when used: this file.

Description uses 2.2% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈174 characters, or 2.2%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Review History

Investigate how code evolved over time to understand current behavior or find regressions.

Usage

/review-history src/auth/login.ts
/review-history the authentication flow
/review-history UserProfile component

Gotchas

  • git log -S finds commits where the string was added OR removed. A commit that deleted a function surfaces as equally relevant to the one that added it — verify the direction of change.
  • Squash merges erase commit-level traceability. git reflog only works locally and expires — if another contributor squashed and force-pushed, the original commits are unrecoverable.

Workflow

Step 1: Identify Target Files

From the provided topic, identify the relevant files:

  • If a file path is given, use it directly
  • If a feature/function name, locate relevant files using this strategy:
    1. Grep for the exact function/class name to find where it is defined and used
    2. Glob for files with the feature name in the path (e.g., **/*payment*)
    3. Prioritize source files over test files; include tests only if investigating test behavior
    4. Limit to the 5 most relevant files to keep the analysis focused

Step 2: Git History Analysis

Run these in parallel:

Recent commits touching the area:

git log --oneline -20 -- <file_or_directory>

Detailed blame for key sections:

# For files > 200 lines: target the specific function or section under investigation.
# Use Grep to find the line range first, then:
git blame -L <start>,<end> <file>

# For files ≤ 200 lines: blame the entire file:
git blame <file>

Find when specific code was introduced:

git log -S "<search_term>" --oneline -- <file>

Check for recent refactors:

git log --oneline --since="3 months ago" -- <file_or_directory>

Adjust the time window based on context:

  • Investigating a recent regression: use --since="2 weeks ago"
  • Understanding a feature's evolution: use --since="6 months ago" or omit --since entirely
  • If the initial window returns fewer than 3 commits, double the window and retry once

Step 3: Search Past Issue Logs

Check if this problem occurred before:

  1. List past issue logs:

    • Glob pattern: docs/log/*.md
  2. Search logs for relevant keywords:

    • Grep pattern: {keywords} path: docs/log/

Look for:

  • Similar error messages
  • Same file/function names
  • Related symptoms

Step 4: Synthesize Findings

Populate the report using these methods:

  • Recent Changes: List commits from git log, most recent first. Include only commits that touch the target code.
  • Key Code Introduction: Use git log -S results to identify when the function/feature first appeared and its last substantive change (skip formatting-only commits).
  • Related Past Issues: Direct matches from Step 3. If none found, state "None found in docs/log/".
  • Regression Risk: Compare current behavior against commit history. If code worked before a specific commit and broke after, name that commit. If no clear regression point, state "No clear regression identified — behavior may be by design."

Report:

## History Analysis: {target}

### Recent Changes
| Date | Commit | Author | Summary |
|------|--------|--------|---------|
| {date} | {hash} | {author} | {message} |

### Key Code Introduction
- `{function/feature}` introduced in {commit} on {date}
- Last modified: {commit} by {author}

### Related Past Issues
{any matching docs/log entries, or "None found"}

### Regression Risk
{assessment: was this working before? when did it break?}

Examples

Trace when a payment bug was introduced:

/review-history processPayment

Uses git log -S and git blame to trace the payment processing function, identifies the commit that changed the rounding logic three weeks ago, and cross-references with past issue logs to confirm this is when the billing discrepancy started.

Understand why validation works a certain way:

/review-history src/validators/address.ts

Analyzes the git history of the address validator, surfaces the original commit that added the unusual postal code regex along with its commit message explaining a partner API requirement, and checks past issue logs for related context.

Troubleshooting

Relevant commit was squashed or rebased away

Solution: Use git reflog to find the original commit before the squash or rebase. If the reflog has expired, search for the change using git log -S "<code_snippet>" --all to locate it in any branch or dangling commit.

History is too large to analyze effectively

Solution: Narrow the scope by passing a specific file path or function name instead of a broad directory. Use --since with git log to limit the time window, or focus on a single author's contributions with --author.

Notes

  • Focus on commits from the last 3-6 months unless investigating older issues
  • Pay attention to refactors, dependency updates, and merge commits
  • If a past issue log matches, read it fully - it may contain the solution

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts7mo4 checks · Risk SAFE
  • Gen Agent Trust Hub7mo

    The skill is a development tool designed to analyze code history and investigate regressions using standard git and grep commands. No malicious patterns or security risks were identified.

  • Socket7mo

    No alerts

  • Snyk7mo

    Risk: LOW · No issues

  • Runlayer8mo

    1 file scanned · No issues

Signed by skilld at 9fbe49f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 3 months ago
argument-hint
<file, function, or feature area>
effort
medium

README badge

README badge for nielsmadan/agentic-coding/review-history