dead-code
Skill1 starsChanged 7 months agoMITView on GitHub
Find unused code in the project — Apex methods/fields with no references, LWC components never imported anywhere, custom labels never used in source, custom permissions never checked, and orphan flow elements. Reports candidates for deletion (the user decides).
7 other projects use a version of this.
Adopted by
Most recently taken up by
- parcadei/Continuous-Claudetheir own version, first seen Oct 17, 2026
- eabz/tiriththeir own version, first seen Oct 10, 2026
- kaeawc/auto-mobiletheir own version, first seen Oct 8, 2026
- parcadei/Continuous-Claude-v2their own version, first seen Oct 8, 2026
- Jinbae10/skillstheir own version, first seen Jul 7, 2026
- Pradnyeshp/Claude-Skillstheir own version, first seen Jul 6, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- parcadei/Continuous-Claude★ 3.9ksame name
- parcadei/Continuous-Claude-v2★ 3.9ksame name
- parcadei/Continuous-Claude-v3★ 3.9ksame name
- kaeawc/auto-mobile★ 56same name
- eabz/tirith★ 4same name
- Pradnyeshp/Claude-Skills★ 2same name
- Jinbae10/skills★ 0same name
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 repository53 other files it gives its agents.
- templates/CLAUDE.mdCLAUDE.md
- adrSkill
- agent-deploySkill
- agent-discoverSkill
- agent-eval-trendSkill
- agent-exchange-listSkill
- agent-specSkill
- agent-testSkill
- agent-vs-flow-vs-apexSkill
- before-vs-after-triggerSkill
- code-reviewSkill
- complexitySkill
- coverage-trendSkill
- dependency-graphSkill
- deploySkill
- destructive-changesSkill
- diff-deploySkill
- erdSkill
- field-impactSkill
- flaky-test-finderSkill
- flow-auditSkill
- flow-vs-apexSkill
- fls-auditSkill
- gateway-configSkill
- generate-docsSkill
- limit-usageSkill
- lwc-vs-reactSkill
- mcp-tool-vs-restSkill
- notifySkill
- onboardSkill
- org-diffSkill
- org-exploreSkill
- package-versionSkill
- pattern-packSkill
- perf-reviewSkill
- permset-auditSkill
- pr-prepareSkill
- queueable-vs-batchSkill
- quick-deploySkill
- react-initSkill
- release-notesSkill
- scratch-orgSkill
- security-scanSkill
- sequence-diagramSkill
- sf-initSkill
- sharing-reviewSkill
- slack-agentSkill
- soql-analyzerSkill
- test-coverageSkill
- test-dataSkill
- test-planSkill
- trust-evalSkill
- trust-layer-auditSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 1 is distinctive, and 11 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
If no references found anywhere in source → finding DEAD-METHOD
- Very specific: line 43
If no references → finding DEAD-FIELD
- Very specific: line 48
Search for c-<kebab-case> in HTML files (other LWCs)
- Very specific: line 49
Search for from 'c/<camelCase>' in JS files
- Very specific: line 50
If js-meta.xml has <isExposed>true</isExposed>, the component might be referenced from an Experience Cloud / Lightning page builder — it's …
- Very specific: line 51
If unexposed and unreferenced → finding DEAD-LWC
- Very specific: line 63
If nothing matches → finding DEAD-LABEL.
- Very specific: line 68
Search Apex for FeatureManagement.checkPermission('<DeveloperName>') and Schema.SObjectType.<...>.PermissionsChecked
- Very specific: line 69
Search LWC for import HAS_PERM from '@salesforce/customPermission/<DeveloperName>'
- Very specific: line 70
If nothing → finding DEAD-CUSTOM-PERM
- Very specific: line 76
If found → finding DEAD-FLOW-ELEMENT (one per element, with element name)
- Distinctive: line 123
Skip test classes for "unused method" finding: Test methods are entry points by definition (run by the test runner)
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are scanning for unreferenced code. Findings are candidates for deletion — the user reviews and decides. Some matches are false positives (reflection, dynamic SOQL, deserialization), so the report errs toward conservative reporting.
Read Project Config First
source "${CLAUDE_PLUGIN_ROOT}/hooks/lib/config.sh"
APEX_SRC="$(sf_config_get '.paths.apexSource' "$ENV")"
LWC_SRC="$(sf_config_get '.paths.lwcSource' "$ENV")"
TEST_SUFFIX="$(sf_config_get '.naming.apex.testSuffix' "$ENV")"Input
$ARGUMENTS:
- (empty) — full scan
apex— Apex methods/fields onlylwc— LWC components onlylabels— custom labels only--ci/--format json|sarif/--out <path>
Steps
1. Apex unused methods
For each public/global method (not test methods, not @AuraEnabled):
- Find references:
<ClassName>\.<method>\band<method>\(from within the same class - Trigger handler methods (
beforeInsert, etc.) are entry points — exclude execute(QueueableContext),execute(BatchableContext, ...),start,finish— async entry points; exclude@RemoteAction,@HttpGet, etc. — REST entry points; exclude- If no references found anywhere in source → finding
DEAD-METHOD
2. Apex unused fields
For each public/private instance/static field on a class:
- Find references:
\.<fieldName>\band<fieldName>\bwithin the class @AuraEnabledfields on DTOs — entry points; exclude- If no references → finding
DEAD-FIELD
3. LWC unused components
For each LWC bundle in ${LWC_SRC}:
- Search for
c-<kebab-case>in HTML files (other LWCs) - Search for
from 'c/<camelCase>'in JS files - If
js-meta.xmlhas<isExposed>true</isExposed>, the component might be referenced from an Experience Cloud / Lightning page builder — it's an entry point (don't flag) - If unexposed and unreferenced → finding
DEAD-LWC
4. Custom labels
find force-app -name '*.labels-meta.xml' -exec ...For each <fullName> in custom labels XML, search source for:
- Apex:
System.Label.<Name>andLabel.<Name> - LWC JS:
import X from '@salesforce/label/c.<Name>' - Layouts/Flows:
<Name>value references
If nothing matches → finding DEAD-LABEL.
5. Custom permissions
For each <CustomPermission> defined:
- Search Apex for
FeatureManagement.checkPermission('<DeveloperName>')andSchema.SObjectType.<...>.PermissionsChecked - Search LWC for
import HAS_PERM from '@salesforce/customPermission/<DeveloperName>' - If nothing → finding
DEAD-CUSTOM-PERM
6. Orphan flow elements
For each force-app/**/flows/*.flow-meta.xml:
- Parse the XML structurally and look for elements (decisions, assignments) that are not connected to any path from the start element
- If found → finding
DEAD-FLOW-ELEMENT(one per element, with element name)
This is heuristic — flow connector parsing is complex; flag for human review.
Output
Default Markdown:
# Dead Code Report: <project.name>
Apex files scanned: 47 (production)
LWC bundles scanned: 18 (in-scope)
Custom labels: 142
Run at: 2026-04-28T15:00:00Z
## Findings
### High (likely dead — review and delete)
- `DEAD-METHOD` `OrderHelper.legacyComputeTotal()` — no references in 47 production files (force-app/.../OrderHelper.cls:120)
- `DEAD-LWC` `acmeOldDashboard` — bundle has 1.2K of code, isExposed=false, never imported
- ...
### Medium (probably dead — investigate)
- `DEAD-LABEL` `c.Old_Welcome_Banner` — defined in CustomLabels.labels-meta.xml, unused in source
- `DEAD-CUSTOM-PERM` `Manage_Legacy_System` — never checked in source
- ...
### Low (suspicious — false-positive risk)
- `DEAD-METHOD` `OrderApiClient.serializeForExternal()` — only string-referenced via `JSON.deserialize`; this scan can't detect dynamic invocation. Confirm before deleting
## Caveats
- Reflection, dynamic Apex (`Type.forName`), and deserialization can reference symbols this scan misses. **Always grep for the symbol as a string** before deleting (the report does this automatically for medium/low confidence)
- Apex methods exposed via REST/SOAP that aren't called from source may still have external consumers
- LWCs referenced only from Lightning App Builder pages won't appear in source; verify in the org before deletingCI mode: SARIF emit per finding with the appropriate ruleId.
Exit codes
- 0 — no findings
- 1 — any finding (informational; this skill never blocks merges by default)
- 2 — config error
Rules
- Bias toward false positives in the medium/low buckets. Hidden references via reflection / deserialization are real; the user must verify
- Don't auto-delete. This is a report. The user runs
/argo:destructive-changes add ...if they want to remove items - Skip test classes for "unused method" finding. Test methods are entry points by definition (run by the test runner)
- Honor custom annotations.
@AuraEnabled,@HttpGet/etc.,@InvocableMethod,@RemoteAction,@future,@Schedulable,@Database.Batchable,@TestVisible— all are entry-point markers - Cross-link to /destructive-changes. The next step after dead-code review is usually destructive-changes
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
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.

