agentleFS
mythrenmythren/git-fence/skills/archaeology/SKILL.md

archaeology

Skill0 starsChanged 5 months agoMITView on GitHub

Investigate why code exists before changing it, using indexed git history (commit -> PR -> issue). Use when a git-fence warning fires, when the user asks why code exists or whether it is safe to delete, before removing a check/workaround/special case that looks unnecessary, or when simplifying old code.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. ai-analyst-lab/ai-analyst★ 304same name
    2. rana/skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repositoryOne other file it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If git-fence is not on PATH (plugin-only install), substitute python3 "$CLAUDE_PLUGIN_ROOT/bin/git-fence" for git-fence in every command …

    line 12
  2. Very specific:

    If git-fence stats errors with "no index", run the index command first.

    line 22
  3. Distinctive:

    Decide with evidence: Only after you can state *what bug the code prevents* decide whether removal is safe.

    line 43
  4. Very specific:

    When a [git-fence] warning appears during an edit, do not silently proceed or silently back off:

    line 50
  5. Very specific:

    Run git-fence why on the flagged lines.

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Archaeology

Old code that looks wrong is often a fence someone built on purpose. Before removing or simplifying it, recover the reason it exists.

Prerequisite

If git-fence is not on PATH (plugin-only install), substitute python3 "$CLAUDE_PLUGIN_ROOT/bin/git-fence" for git-fence in every command below (or locate the plugin under ~/.claude/plugins/).

The repo must be indexed once (fast - thousands of commits per second):

git-fence index --github   # --github enriches with PR/issue data via gh

If git-fence stats errors with "no index", run the index command first.

Workflow

  1. Ask the index first.
    • git-fence why <file> <line> - full provenance of one line: commit, PR, linked issues.
    • git-fence why <file> - all fix-linked commits that touched the file.
    • git-fence check <file> <start> <end> - load-bearing commits in a line range.
  2. Read the actual discussion when stakes are high. The index gives you PR and issue URLs. For security fixes, regressions, or anything you plan to delete, fetch the PR/issue with gh pr view <n> / gh issue view <n> and read why the change was made and what alternatives were rejected.
  3. Dig deeper when the index has no answer.
    • git log -L <start>,<end>:<file> - full evolution of a line range, including commits that predate squash merges.
    • git log --follow --oneline -- <file> - history across renames.
    • A test added in the same commit is the best spec for what the code protects. Check with git show <sha> --stat.
  4. Decide with evidence. Only after you can state what bug the code prevents decide whether removal is safe. If the original bug can no longer occur (dependency removed, API changed), say so explicitly and delete with confidence. If you cannot reconstruct the reason, keep the code and say why.

Responding to a git-fence hook warning

When a [git-fence] warning appears during an edit, do not silently proceed or silently back off:

  1. Run git-fence why on the flagged lines.
  2. State in one sentence what the original bug was.
  3. Confirm your edit does not reintroduce it (keep the guard, keep the test), or adjust the edit so it does not.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.