agentleFS
mtarcuremtarcure/claude-vibe-squad/.agents/skills/code-reachability-audit/SKILL.md

code-reachability-audit

Skill220 starsChanged 17 days agoMITView on GitHub

Use before classifying a repository file or script as dead or proposing deletion: census static, dynamic, CI, hook, manifest, documentation, and host-scheduler callers; prove the search with positive and negative controls; classify reachability and resolve misleading mentions. Not for restructuring a live module graph.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    Use (^|[^A-Za-z0-9_-])<basename> — allow a path separator before the name, forbid word characters.

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 Reachability Audit

Deciding a file is dead is a deletion, and deletions are irreversible. The claim "nothing calls this" is an absence claim, so it needs an exhaustive search plus a control proving the search can detect presence. A grep miss is not proof.

The search set — every surface, not just the obvious ones

A repo-only git grep is not exhaustive. Check all of these:

SurfaceWhy it hides callers
Shellexec, source, bash "$VAR", paths built from $(dirname …)
Pythonsubprocess, Path(...), names assembled from parts
.github/workflows/**CI is a caller with no in-repo reference to it
Git hooks (.githooks/**)invoked by git, never by code
Plugin manifests, lane adaptersdeclarative wiring, not calls
~/Library/LaunchAgents/*.plistoutside the repo entirely
crontab -l, systemd unitssame class as launchd on other platforms
Operator documentationa script a human runs on purpose is live with zero programmatic callers

The launchd surface is the one that bites. On 2026-08-06 an audit classified bin/squad-monitor.sh as dead on correct in-repo evidence — its only references were two tests. It runs every 120 seconds via com.chrono.squad-monitor, registered in ~/Library/LaunchAgents/, where no git grep reaches. Several repo scripts are bound that way. bin/doctor.sh now reports the live mapping on every health run, computed from the main checkout; read that mapping (not any fixed count, which drifts) before calling anything dead.

Matching, without fooling yourself

Both failure directions are real and both happened in one session:

  • Too loose. A bare basename search reported capture.py as having six callers. Every hit was inside autocapture.py.
  • Too strict. Anchoring with [^A-Za-z0-9_/-] then excluded /, hiding path-qualified references, so a file with a live caller looked orphaned.

Use (^|[^A-Za-z0-9_-])<basename> — allow a path separator before the name, forbid word characters.

Two controls, every time

  1. Positive — search for a file you know is live and confirm the census returns its callers. If it cannot find a known caller, its silence is meaningless.
  2. Negative — search for an invented filename and confirm zero rows. This is what makes empty output evidence rather than an artifact.

Read the hit before believing it

A reference is not always a call:

  • vs-dashboard-loop.sh mentions watch-lane.sh in a comment — "Replaces the old 4-lane watch-lane.sh render." A mention of what something replaced is not a call.
  • Prose documenting a removal necessarily names the thing removed. A regex counting "stale terminology" will score those as drift; they are the record of the change.
  • A parser may consume a literal string that looks like prose. Seven references to Expected Model Lane Tool Surface were to a block name still emitted at runtime; renaming them would have broken the parser.

Buckets

entry-point (humans or CI invoke it; zero callers is correct) · live · reachable-dynamically (runtime-constructed path; evidence required) · legacy-live (reachable but built for a retired architecture — say what must change before retiring it) · dead.

Before deleting

  • Prove equivalence where you can. Truncating a file after an unconditional exit should produce byte-identical output — restore the original inside its own directory so path resolution matches, and diff the two runs. A control run from a temp directory measures the environment, not the change.
  • Deleting code deletes its dedicated tests too; a test for removed code is also dead. A test that covers the removed thing among others is not — edit it or leave the code alone.
  • Sweep for stranded references afterwards: file headers describing what is "below", docs pointing at output directories nothing writes any more, and glob-based config where case matters (action-log.md will not match ACTION-LOG.md).

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.