From deslop
Use when user wants to clean AI slop from code. Use for cleanup, remove debug statements, find ghost code, repo hygiene, deslop. Pulls analyzer-supplied slop-fixes (tracked artifacts, orphan exports, empty catches, tautological tests) and slop-targets (defensive cargo cult, bot-authored, wrapper towers, single-impl, stylistic outliers, semantic duplicates) when repo-intel exists; falls back to regex+AST detection otherwise.
npx claudepluginhub agent-sh/deslop --plugin deslopThis skill uses the workspace's default tool permissions.
Clean AI slop from code with certainty-based findings and auto-fixes.
Applies Acme Corporation brand guidelines including colors, fonts, layouts, and messaging to generated PowerPoint, Excel, and PDF documents.
Builds DCF models with sensitivity analysis, Monte Carlo simulations, and scenario planning for investment valuation and risk assessment.
Calculates profitability (ROE, margins), liquidity (current ratio), leverage, efficiency, and valuation (P/E, EV/EBITDA) ratios from financial statements in CSV, JSON, text, or Excel for investment analysis.
Clean AI slop from code with certainty-based findings and auto-fixes.
const args = '$ARGUMENTS'.split(' ').filter(Boolean);
const mode = args.find(a => ['report', 'apply'].includes(a)) || 'report';
const scope = args.find(a => a.startsWith('--scope='))?.split('=')[1] || 'all';
const thoroughness = args.find(a => a.startsWith('--thoroughness='))?.split('=')[1] || 'normal';
Arguments: [report|apply] [--scope=<path>|all|diff] [--thoroughness=quick|normal|deep]
report (default) or applyall (default): Entire codebasediff: Only files changed in current branch<path>: Specific directory or filenormal)
quick: Regex patterns onlynormal: + multi-pass analyzersdeep: + CLI tools (jscpd, madge) if availableWhen the repo has been analyzed (/repo-intel init or enrich), the analyzer pre-computes two query results that drop straight into the pipeline — no detection needed for the first, narrowed scan for the second.
slop-fixes — pinpoint structured fixes (Haiku-tier)
The analyzer-supplied fixes are HIGH-certainty, pre-located, and self-contained (file + line range + action + reason). They flow directly into the fixes array without re-running detection. Categories: tracked artifacts, stale CI configs, duplicate tooling, orphan exports, empty catches, tautological tests.
slop-targets — ranked Sonnet/Opus scan candidates
A scored list of files (Sonnet tier) and cross-file areas (Opus tier) where slop is likely. Used as the targetFiles input to the detection pipeline so we scan only suspicious files instead of everything. Suspect labels (defensive-cargo-cult / could-be-shorter / bot-authored / cliché-names / wrapper-tower / single-impl / high-bug-community / and — when the embedder is installed — stylistic-outlier / semantic-duplicate) let downstream tooling pick a tailored reviewer prompt per file.
The lib/repo-intel-signals module wraps both queries:
const signals = require('../../lib/repo-intel-signals');
const fixes = signals.getSlopFixes(cwd); // {fixes:[…]} or null
const targets = signals.getSlopTargets(cwd); // {targets:[…]} or null
const targetFiles = signals.targetsToFileList(targets);
const directFixes = (fixes?.fixes || [])
.map(signals.toDeslopFix)
.filter(Boolean);
When repo-intel is absent, all helpers return null and the pipeline falls back to the unguided (scan-everything) behavior. No agent action needed beyond passing targetFiles through to runPipeline().
The detection script is at ../../scripts/detect.js relative to this skill.
Run detection (use relative path from skill directory):
# If aiTargetFiles is available from Phase 0, pass them explicitly:
# node ../../scripts/detect.js file1.ts file2.ts --compact
# Otherwise scan everything:
node ../../scripts/detect.js . --compact --max 50
For deep thoroughness (includes CLI tools if available):
node ../../scripts/detect.js . --deep --compact --max 50
For diff scope (only changed files):
BASE=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' || echo "main")
# Use newline-separated list to safely handle filenames with special chars
git diff --name-only origin/${BASE}..HEAD | \
xargs -d '\n' node ../../scripts/detect.js --compact
Note: The relative path ../../scripts/detect.js navigates from skills/deslop/ up to the plugin root where scripts/ lives.
The pipeline automatically reads repo-intel data via lib/collectors/git.js and the slop-targets suspect labels (no agent action required). If repo-intel exists in the state directory, findings are enriched:
defensive-cargo-cult or bot-authored, severity is bumped one levelnlp:<suspect> annotation for the reviewer promptSort findings by:
Skill returns structured JSON - does NOT apply fixes (orchestrator handles that). The merged result includes both analyzer-supplied fixes (Phase 0) and pipeline-detected findings (Phase 1/1b/2), with a source field per fix so consumers can tell them apart.
JSON structure between markers:
=== DESLOP_RESULT ===
{
"mode": "report|apply",
"scope": "all|diff|path",
"filesScanned": N,
"findings": [
{
"file": "src/api.js",
"line": 42,
"pattern": "debug-statement",
"message": "console.log found",
"certainty": "HIGH",
"severity": "medium",
"autoFix": true,
"fixType": "remove-line"
}
],
"fixes": [
{
"file": "src/api.js",
"line": 42,
"fixType": "remove-line",
"pattern": "debug-statement"
}
],
"summary": {
"high": N,
"medium": N,
"low": N,
"autoFixable": N
}
}
=== END_RESULT ===
| Level | Meaning | Action |
|---|---|---|
| HIGH | Definitely slop, safe to auto-fix | Auto-fix via simple-fixer |
| MEDIUM | Likely slop, needs verification | Review first |
| LOW | Possible slop, context-dependent | Flag only |
Analyzer-supplied (Phase 0, slop-fixes query):
tracked-artifact: log files at root, .DS_Store, .swp/.bak/.orig, coverage/.nyc_output treesstale-ci-config: .travis.yml / appveyor.yml / .drone.yml when an active CI is also presentduplicate-tooling: ESLint+Biome, Prettier+Biome, multiple JS lockfilesorphan-export: file exports with zero importers in the project graph (skips entry points)empty-catch (analyzer): TS/JS empty catch blocks, Python except: passtautological-test: expect(x).toBe(x) assertionsPipeline-detected (Phase 1, regex):
debug-statement: console.log, console.debug, print, println!debug-import: Unused debug/logging importsplaceholder-text: "Lorem ipsum", "TODO: implement"empty-catch (pipeline): Empty catch blocks without commenttrailing-whitespace: Trailing whitespacemixed-indentation: Mixed tabs/spacesexcessive-comments: Comment/code ratio > 2:1doc-code-ratio: JSDoc > 3x function bodystub-function: Returns placeholder value onlydead-code: Unreachable after return/throwinfrastructure-without-impl: DB clients created but never usedover-engineering: File/export ratio > 20xbuzzword-inflation: Claims without evidenceshotgun-surgery: Files frequently change togetherThese correspond to the autoFix values emitted by slop-patterns:
| AutoFix Strategy | Action | Patterns |
|---|---|---|
remove | Delete line | debug-statement, debug-import, placeholder-text |
add_logging | Add proper error logging | empty-catch |
replace | Replace with corrected code | mixed-indentation |
This skill is invoked by:
deslop-agent for /deslop command/next-task Phase 8 (pre-review gates) with scope=diffThe orchestrator spawns simple-fixer to apply HIGH certainty fixes.
Expected: the orchestrator (the command that spawned this agent) has already checked <stateDir>/repo-intel.json and either pre-fetched the data into your context or skipped (user declined to generate). Do not call AskUserQuestion here - subagents cannot interact with the user.
If the pre-fetched data is empty, proceed with the available context. The orchestrator has already made the decision on the user's behalf.
Binary: agent-analyzer auto-downloads to ~/.agent-sh/bin/ from agent-sh/agent-analyzer GitHub releases (~10 MB) on first use. The lib/agentsys resolver locates the agentsys install (CC marketplace clone, npm global, or sibling repo).