redundancy-scan
Skill2 starsChanged 40 days agoMITView on GitHub
Fleet workflow for finding duplication, deprecation, and redundancy (exact file clones, deprecation markers, lockstep/mirror comments, basename collisions). Multi-session friendly with machine findings + human classification (intentional vs accidental). Use when /redundancy-scan, /dedupe, fleet redundancy audit, find duplicates, dead dual implementations, deprecated code still shipping, or extend-before-create consolidation passes.
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 50
Default knobs: config/defaults.json (exclude dirs, marker lists, size limits).
- Distinctive: line 58
Do not put private planning-repo paths in config committed to this package.
- Distinctive: line 62
Prefer the fleet shared archive (not product git):
- Very specific: line 109
Run run-scan.js for scope.
- Distinctive: line 111
Do not delete code yet.
- Very specific: line 141
Prefer consolidate onto @revealui/* native parts.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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.
Files
Redundancy / deprecation / duplication scan
Purpose
Find accidental duplication and stale dual paths across a repo or the whole fleet, without deleting intentional duals (decoupling, test isolation, public facades).
Complements:
| Skill / lane | Relationship |
exhaustive-audit | Line-level completeness of a tree |
fleet-redundancy lane + remediation spec | Program backlog for consolidation PRs |
extend-before-create hardline | Why we scan before building net-new |
knowledge-graph | Optional: after findings, map “who imports both” |
Detection classes (this skill)
| Class | Detector | What it means |
exact-duplicate | hash-dups.js | Same sha256 body, ≥2 paths |
deprecation-marker | marker-scan.js | @deprecated, SUPERSEDED, DO NOT USE, TODO remove… |
redundancy-marker | marker-scan.js | “keep in lockstep”, “mirrors”, “byte-identical”… |
basename-collision | name-collision.js | Same filename in many dirs (heuristic) |
Not automated here (session follow-ups): unused exports (knip), clone near-matches (jscpd), dual SECURITY_PATHS (GAP-404), package catalog drift (syncpack). Run those tools when the mechanical pass is done; record results into the same run directory.
Config
Default knobs: config/defaults.json (exclude dirs, marker lists, size limits).
Override:
node scripts/run-scan.js --root … --out-dir … --config /path/to/override.jsonDo not put private planning-repo paths in config committed to this package.
Artifacts
Prefer the fleet shared archive (not product git):
export REVEALFLEET_ARCHIVE="${REVEALFLEET_ARCHIVE:-$REVEALFLEET_ROOT/archive/cold}"
OUT="$REVEALFLEET_ARCHIVE/audits/$(date -u +%Y-%m-%d)-redundancy-<scope>"$OUT/
RUN.json
raw/*.jsonl # per-detector outputs
findings.jsonl # merged
report.md # human summary
summary.json
classified/ # optional: agent-edited classificationsQuick start (one repo)
SKILL="$REVEALFLEET_ROOT/revskills/skills/redundancy-scan"
export REVEALFLEET_ARCHIVE="${REVEALFLEET_ARCHIVE:-$REVEALFLEET_ROOT/archive/cold}"
OUT="$REVEALFLEET_ARCHIVE/audits/$(date -u +%Y-%m-%d)-redundancy-revealui"
mkdir -p "$OUT"
node "$SKILL/scripts/run-scan.js" \
--root "$REVEALFLEET_ROOT/revealui" \
--out-dir "$OUT"
# read $OUT/report.md then classify findingsFleet mode
node "$SKILL/scripts/run-scan.js" \
--root "$REVEALFLEET_ROOT" \
--fleet \
--out-dir "$REVEALFLEET_ARCHIVE/audits/$(date -u +%Y-%m-%d)-redundancy-fleet"Skips hidden directories, archive/, tmp/, docs/, scripts/, worktrees/, and *-wt sibling folders. Nested tmp/worktrees dirs are also in defaults.json excludeDirNames.
Workflow (multi-session)
Session A — detect (mechanical)
- Run
run-scan.jsfor scope. - Workboard note:
redundancy-scan:<date>-<scope>. - Do not delete code yet.
Session B — classify (judgment)
For each high-signal finding (start with exact-duplicate and deprecation markers on runtime paths):
| Classification | Action |
| intentional | Record reason (decoupling, test isolation, facade). Leave code. |
| accidental + small | One PR consolidate / delete (extend-before-create). |
| accidental + large | File a gap or fleet-redundancy lane item; link finding ids. |
| deprecation without owner | Either remove, or gap with removal plan + deadline. |
Append classifications to classified/decisions.jsonl:
{
"id": "DUP-EXACT-0001",
"classification": "accidental",
"action": "gap|pr|leave",
"gap": null,
"notes": "two copies of PEM unescape; keep packages/security",
"agent": "…",
"ts": "…"
}Session C — remediate
- Implement only classified accidental items (or owner-authorized).
- Prefer consolidate onto
@revealui/*native parts. - Public PRs: no private planning paths in bodies.
- Re-run scan on touched packages; delta should shrink.
Optional tools (document in RUN.json)
# near-dupe clones (if available)
pnpm dlx jscpd <root> --ignore "**/node_modules/**,**/dist/**"
# unused (if configured in monorepo)
pnpm exec knip # only when package supports it
# catalog drift
pnpm exec syncpack lintPaste summary counts into $OUT/optional-tools.md.
Severity guide
| Signal | Suggested severity |
Exact dup in packages/ runtime | medium → high if security/billing |
| Exact dup only in tests/fixtures | low / often intentional |
| Deprecation marker in hot path still imported | high |
| Deprecation marker in docs only | info |
| Basename collision for unique domain files | medium (investigate) |
| Basename collision for common names | ignore / allowlist |
Multi-agent concurrency
- Detect phase is single-writer on
$OUT(one agent runsrun-scan.js). - Classify can shard by finding id ranges or by class (
exact-duplicatevsdeprecation-marker). - Remediate uses normal worktrees from
origin/test; one PR cluster per theme (logger, ValidationError, PEM unescape…).
Anti-patterns
| Do not | Why |
| Delete every exact dup without classification | Breaks intentional duals |
| Treat jscpd % as a gate without filtering drafts/untracked | Inflated (blog-drafts history) |
| Open a second “redundancy backlog” at docs root | Use findings.jsonl + gaps/lanes |
| Re-author extend-before-create policy in Grok | Pointer to claude-config hardline only |
Related references
references/methodology.md— full taxonomy and intentional-dup examplesconfig/defaults.json— markers and excludes- Fleet lane: operator planning
fleet-redundancy+ remediation spec (when authorized) - Hardlines: extend-before-create, audit-first mindfulness, code-over-docs
Scripts
| Script | Role |
run-scan.js | Orchestrate all detectors + merge report |
hash-dups.js | Exact content clones |
marker-scan.js | Deprecation + redundancy phrase hits |
name-collision.js | Basename multipaths |
merge-report.js | Combine JSONL → report.md |
Other versions1 project uses a version of this.
Word for word · 1
- RevealUIStudio/revskills★ 2100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
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 repository29 other files it gives its agents.
- skills/revealui-design/CLAUDE.mdCLAUDE.md
- drizzle-dbSkill
- electric-syncSkill
- exhaustive-auditSkill
- grok-bot-checkpointSkill
- knowledge-graphSkill
- mcp-serverSkill
- multi-agent-memorySkill
- next-best-practicesSkill
- revealui-checkpointSkill
- revealui-cleanupSkill
- coordinateSkill
- revealui-designSkill
- revealui-design-statusSkill
- revealui-doctorSkill
- revealui-opsSkill
- revealui-pickupSkill
- revealui-recoverSkill
- revealui-rollupSkill
- revealui-skills-testSkill
- revealui-snapshotSkill
- revealui-sync-ltsSkill
- revealui-sync-rulesSkill
- revealui-trackerSkill
- revvault-resolveSkill
- security-hardeningSkill
- tailwind-v4Skill
- vitest-testingSkill
- yjs-collaborationSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

