skills/reuse-analysis/SKILL.md
Discovers existing functions/patterns/utilities that must be reused (not reimplemented) and identifies antipatterns to avoid. Triggers at Phase 1 (discovery) and Phase 5 (verification).
npx skillsauth add bigeasyfreeman/adlc reuse-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Before building anything new, prove it doesn't already exist. This skill discovers reusable code, enforces pattern continuation, and prevents antipattern repetition.
Use this with paved-road-registry: reuse-analysis finds concrete helpers, functions, and modules not to reimplement; paved-road-registry records the broader repo-local build contract for APIs, CLIs, schemas, storage, auth, observability, tests, and runtime conventions. When a task needs an implementation_interface_contract, reuse-analysis supplies the reuse list and helps verify the interface does not reimplement an existing surface.
Parse the codebase to find existing functions, classes, and utilities. Prioritize:
utils/, helpers/, common/, shared/ modulescompound_context.learning_refs from docs/solutions/, using only compact summaries, source refs, verifier refs, and stale conditionsRead compound_context.learning_refs before broad matching. Each ref is a prior-art candidate:
path, title, summary, source_evidence, and verifierMatch task description terms against:
For integration or reusable framework work, produce implementation-interface inputs:
Rank discovered items by relevance to the current task. Filter out false positives.
### DO NOT REIMPLEMENT: function_name
- File: path/to/file.py:42
- Signature: def function_name(arg1: str, arg2: int) -> Result
- Purpose: One-line description of what it does
- How to use: `result = function_name("input", 42)`
Known bad patterns in the codebase that must NOT be repeated:
### ANTIPATTERN: descriptive_name
- What: Description of the bad pattern
- Where seen: path/to/file.py (if known, or "historical")
- Why bad: Explanation of the problem it causes
- Instead: What to do instead
The concrete learning store is docs/solutions/. If it is missing or empty, record the compound_context.no_op_reasons and proceed with code and Graphify research.
Compare new functions against the reuse catalog:
existing_function() from path/to/module.py instead"Remove when: Models consistently discover and reuse existing patterns without hints. At that point, keep verification (Phase 5) but remove discovery hints (Phase 1).
| Excuse | Rebuttal | |--------|---------| | "My version is slightly different" | Extend the existing function. Don't duplicate and diverge. | | "I didn't know it existed" | That's why reuse analysis runs first. Now you know. | | "The existing code is messy" | Refactor it in a separate task. Don't create a parallel implementation. | | "It's faster to rewrite" | Rewriting is faster today. Maintaining two versions is slower forever. |
compound_context.learning_refs checked, cited, rejected as stale, or recorded as no-opreuse, consumes, emits, and validation gates identified when the task changes an integration boundarydevelopment
Discovers and records repo-local approved build paths so agents reuse proven patterns instead of inventing parallel architectures.
development
Scoped maintenance for docs/solutions entries when stale signals, refactors, or explicit user scope require refresh.
documentation
Conditionally captures verified reusable ADLC learnings into docs/solutions after successful closeout.
development
Uses Graphify as ADLC's graph-backed research layer and Beads as an optional dependency-aware task memory layer. Produces evidence for compatibility, reuse, accuracy, dark-code hotspots, and long-horizon handoff.