Agent Skillsmtarcure/claude-vibe-squad › code-reachability-audit

code-reachability-audit

GitHub

用于全面审计代码可达性,防止误删活跃文件。涵盖静态/动态调用、CI、Hook及系统级配置等隐蔽入口,通过正负控制验证搜索有效性,区分真实调用与文本提及。

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

触发场景

判断文件是否为死代码 提议删除仓库中的文件或脚本

安装

npx skills add mtarcure/claude-vibe-squad --skill code-reachability-audit -g -y
更多选项

非标准路径

npx skills add https://github.com/mtarcure/claude-vibe-squad/tree/main/.agents/skills/code-reachability-audit -g -y

不安装直接使用

npx skills use mtarcure/claude-vibe-squad@code-reachability-audit

指定 Agent (Claude Code)

npx skills add mtarcure/claude-vibe-squad --skill code-reachability-audit -a claude-code -g -y

安装 repo 全部 skill

npx skills add mtarcure/claude-vibe-squad --all -g -y

预览 repo 内 skill

npx skills add mtarcure/claude-vibe-squad --list

SKILL.md

Frontmatter
{
    "name": "code-reachability-audit",
    "audience": "specialist",
    "description": "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."
}

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:

Surface Why it hides callers
Shell exec, source, bash "$VAR", paths built from $(dirname …)
Python subprocess, 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 adapters declarative wiring, not calls
~/Library/LaunchAgents/*.plist outside the repo entirely
crontab -l, systemd units same class as launchd on other platforms
Operator documentation a 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. Six repo scripts are bound that way. bin/doctor.sh now reports the mapping on every health run; read it 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).

版本历史

  • d5262e2 当前 2026-09-11 11:15

同 Skill 集合

.agents/skills/accessible-media-authoring/SKILL.md
.agents/skills/agent-prompt-engineering/SKILL.md
.agents/skills/agentic-safety-audit/SKILL.md
.agents/skills/audio-event-map-authoring/SKILL.md
.agents/skills/auto-scaffold/SKILL.md
.agents/skills/claim-verification/SKILL.md
.agents/skills/code-review-loop/SKILL.md
.agents/skills/color-theory/SKILL.md
.agents/skills/conversation-design/SKILL.md
.agents/skills/copy-refinement/SKILL.md
.agents/skills/cross-file-relationship-synthesis/SKILL.md
.agents/skills/dependency-cycle-audit/SKILL.md
.agents/skills/dependency-health-triage/SKILL.md
.agents/skills/detection-as-code/SKILL.md
.agents/skills/diff-aware-semgrep-scan/SKILL.md
.agents/skills/differential-review/SKILL.md
.agents/skills/dimensional-analysis-check/SKILL.md
.agents/skills/dual-level-retrieval/SKILL.md
.agents/skills/figma-implement-design/SKILL.md
.agents/skills/forensic-timeline-authoring/SKILL.md
.agents/skills/game-design-fundamentals/SKILL.md
.agents/skills/game-mechanics-balancing/SKILL.md
.agents/skills/head-tail/SKILL.md
.agents/skills/incident-response-runbook/SKILL.md
.agents/skills/interactive-audio-design/SKILL.md
.agents/skills/interface-ambiguity-check/SKILL.md
.agents/skills/keyword-clustering/SKILL.md
.agents/skills/knowledge-base-integration/SKILL.md
.agents/skills/layered-analysis-loop/SKILL.md
.agents/skills/level-design-patterns/SKILL.md
.agents/skills/locale-adaptation/SKILL.md
.agents/skills/narrative-structure/SKILL.md
.agents/skills/platform-compliance/SKILL.md
.agents/skills/player-engagement-psychology/SKILL.md
.agents/skills/requirements-elicitation/SKILL.md
.agents/skills/rule6-rights-gate/SKILL.md
.agents/skills/rule8-truth-gate/SKILL.md
.agents/skills/sandbox-provision-discipline/SKILL.md
.agents/skills/scope-decomposition/SKILL.md
.agents/skills/scope-estimation/SKILL.md
.agents/skills/security-ownership-map/SKILL.md
.agents/skills/security-threat-model/SKILL.md
.agents/skills/semgrep-rule-author/SKILL.md
.agents/skills/skill-description-trigger-authoring/SKILL.md
.agents/skills/sound-design-principles/SKILL.md
.agents/skills/structured-data-authoring/SKILL.md
.agents/skills/supply-chain-audit/SKILL.md
.agents/skills/take-over-resume/SKILL.md
.agents/skills/technical-seo-audit/SKILL.md

元信息

文件数
0
版本
d5262e2
Hash
bc0c33d8
收录时间
2026-09-11 11:15

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-12 15:30
浙ICP备14020137号-1 $访客地图$