{"data":{"slug":"discovered-96ef6831b0e71315c4885af6e5cc2983f0519524fa408d23","title":"Redundancy And Boundary Audit","summary":"Audit repository-level duplication, module boundaries, and naming fidelity using a falsifiable sync test and A\/B\/C classification. Produces a scan report for identifying true duplicates, same-name-different-concept cases, and same-shape-different-domain scenarios.","url":"https:\/\/skillshunter.net\/skills\/discovered-96ef6831b0e71315c4885af6e5cc2983f0519524fa408d23","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-96ef6831b0e71315c4885af6e5cc2983f0519524fa408d23","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-96ef6831b0e71315c4885af6e5cc2983f0519524fa408d23.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-96ef6831b0e71315c4885af6e5cc2983f0519524fa408d23\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before starting, locate the most recent scan report in your repo's configured report directory. For every finding, mark it as Resolved, Still valid, or Outdated. Use grep hit counts (e.g., `grep \"class AuditLogger\" src\/ \u2192 2`) for acceptance criteria, not line counts. Check the existing do-not-touch list before proposing any merge.","instructions":"---\nname: redundancy-and-boundary-audit\ndescription: Repository-level judgment framework for auditing duplication, module boundaries, and naming fidelity; complements module-level code review and produces a scan report. Use when asked to audit repo-level redundancy, boundary violations, or duplicate implementations. \u4ed3\u5e93\u7ea7\u91cd\u590d\u3001\u6a21\u5757\u8fb9\u754c\u4e0e\u547d\u540d\u4fdd\u771f\u5ba1\u8ba1\u6846\u67b6\uff1b\u8865\u5145\u6a21\u5757\u7ea7\u4ee3\u7801\u5ba1\u67e5\u5e76\u4ea7\u51fa\u626b\u63cf\u62a5\u544a\u3002\u8981\u6c42\u5ba1\u8ba1\u4ed3\u5e93\u7ea7\u5197\u4f59\u3001\u8fb9\u754c\u8fdd\u89c4\u6216\u91cd\u590d\u5b9e\u73b0\u65f6\u4f7f\u7528\u3002\nkeywords: [redundancy, boundary, duplicate, overlap, dedup, \u5197\u4f59, \u91cd\u590d, \u8fb9\u754c]\n---\n# Repository-Level Redundancy & Boundary Audit\n\nRepository-wide judgment framework for auditing duplication, module boundaries, and naming fidelity. Complements a module-level code-review skill (3-pass) \u2014 this skill operates at **repo level** and produces a scan report, not a code review.\n\n## Step 0 \u2014 MANDATORY: delta against the previous scan\n\nBefore any new analysis, locate the most recent scan report (your repo's configured report directory, or the first-ever scan if none exists). For EVERY finding in it, mark exactly one of:\n\n- **Resolved** \u2014 cite the commit or current `file:line` proving it\n- **Still valid** \u2014 re-verify the evidence still matches (line numbers drift; re-grep, don't trust)\n- **Outdated** \u2014 the code changed underneath it (e.g. a \"weak 3-file module\" grew 10\u00d7)\n\nA scan that skips Step 0 is worse than no scan: it manufactures the illusion that \"someone already checked\". This is why previous scans rot.\n\n## Step 1 \u2014 Ingest deterministic facts (never re-derive them by reading code)\n\nConsume, in order:\n\n1. Output of your repo's automated checks (duplicate-symbol scanners, path-cluster scanners, dead-reference checkers) \u2014 if any\n2. Latest architecture\/module inventory, if present\n3. Import graph \/ code graph, if fresh\n\nYour job starts where the checkers stop: they say \"4 classes named AuditLogger exist\"; you decide which of A\/B\/C each pair is. If a fact you need has no checker, note it as a tooling gap in the report \u2014 do not hand-count what a script should count.\n\n## Step 2 \u2014 Duplication triage (the core judgment)\n\nFor every duplicate-symbol \/ parallel-implementation candidate:\n\n**The falsifiable test**: two things are duplicates **iff a change to one MUST be synced to the other**. If you cannot name the concrete change that would need syncing, they are not duplicates.\n\nClassify into exactly one:\n\n| Class | Meaning | Action |\n|---|---|---|\n| **A \u2014 True duplicate** | Same concept, same contract; sync-or-break | Merge plan (bottom-up: leaf \u2192 stateful \u2192 orchestrator) |\n| **B \u2014 Same name, different concept** | Same name, different semantics | Rename one (the less-established); NO merge |\n| **C \u2014 Same shape, different domain** | Similar structure, different domain\/lifecycle | Leave alone; record in the do-not-touch list |\n\nHard rules (violations are how such audits fail):\n\n- Every A-class claim binds `file:line` for BOTH sides + the concrete sync-failure scenario\n- **Line counts are banned as evidence.** Acceptance criteria use grep hit counts (e.g. `grep \"class AuditLogger\" src\/ \u2192 2`)\n- Check the existing do-not-touch list BEFORE proposing any merge \u2014 C-class calls are already argued; re-litigating them wastes a cycle\n- Caller analysis MUST include `tests\/`, and import checks use symbol grep \/ AST, never single-line regex (multi-line parenthesized imports evade `from.*X` patterns)\n\n## Step 3 \u2014 Boundary & naming fidelity\n\nFor each module flagged by Step 1\/2, or new since the last scan:\n\n- **Deletion test**: \"if I delete this, what breaks?\" \u2014 name the concrete breakage, or flag the module as possibly vestigial (verify via used-by graph, not intuition)\n- **Naming match**: does the name describe what it does today? (`AuditLogger` that never logs fails this)\n- **Declared-vs-real behavior**: what the docstring\/README\/prompt claims vs what the code does. Real cases: a \"quality gate\" whose verdict nothing parses; a script whose documented CLI usage cannot run (no `__main__`)\n- **Capability-instruction alignment** (agent systems only): every instruction in an agent's prompt must be executable with its declared tools; impossible instructions produce hallucinated compliance\n\n## Step 4 \u2014 Multi-angle verification of suspects\n\nOne angle per pass over the suspect list \u2014 never mix angles (you go blind to all but the first pattern):\n\n1. Data\/control flow  2. Import-dependency collision  3. API contract  4. Test impact\n5. Frontend impact  6. Config\/env  7. DX  8. Rollback safety\n9. **Mechanism authenticity** \u2014 for every declared topic\/capability\/gate\/hook, find its consumer; zero consumers = decorative mechanism (report as HIGH)\n10. **Security-baseline regression** \u2014 spot-check path\/shell safety, HMAC, error sanitization against past review conclusions; do not re-audit from scratch\n11. **Process hygiene** \u2014 record-rule compliance (`file:line` on completed items), artifact-index registration, numbering collisions\n12. **Runtime smoke** \u2014 if you can run it: the service boots, the health endpoint returns 200, one happy path works\n\n## Step 5 \u2014 Report & closure (non-negotiable)\n\nOutput to your repo's configured report directory (never a git-ignored scratch dir \u2014 that is how a previous scan silently disappeared):\n\n- `00_delta.md` \u2014 Step 0 result\n- `10_duplication.md` \u2014 A\/B\/C table with evidence\n- `20_boundaries.md` \u2014 Step 3 findings\n- `30_angles.md` \u2014 Step 4, one section per angle actually run\n- `90_actions.md` \u2014 remediation matrix (impact \u00d7 risk), each action with `file:line`\n\nThen: register the report in your repo's artifact index; file every action item into the repo's issue\/todo tracker in the same session (an action that lives only in the report does not exist).\n\n## Output discipline\n\n- 0 findings is a legitimate result for a healthy area \u2014 never invent findings\n- Every finding: severity (HIGH\/MED\/LOW) + class tag (A\/B\/C or angle number) + `file:line` + falsifiable acceptance criterion\n- Confidence notes on judgment calls; a reviewer must be able to re-derive each verdict from its cited evidence alone\n","use_cases":["Identify and resolve true code duplicates across a repository","Verify module boundaries and naming fidelity","Ensure consistency between documentation and implementation","Audit for vestigial modules that may be deleted"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/chenyinrusi\/dsh-engineering-skills\/blob\/86d622bfbebb228269ad2b906c44069fd492397f\/skills\/redundancy-and-boundary-audit\/SKILL.md","source_commit":"86d622bfbebb228269ad2b906c44069fd492397f","license":null,"version":null,"listing_approved_at":"2026-11-28","created_at":"2026-11-28T07:59:18.000000Z","updated_at":"2026-11-28T18:37:41.000000Z","seo_title":"Redundancy and Boundary Audit for Code Repositories","seo_description":"Perform a repository-level audit to identify code duplication, module boundary violations, and naming inconsistencies. Uses a falsifiable sync test and A\/B\/C categoration","seo_keywords":["redundancy audit","code duplication","module boundary","naming fidelity","code audit","duplicate code detection","code repository analysis"]}}