一键导入
deslop
Use when user wants to clean AI slop from code. Use for cleanup, remove debug statements, find ghost code, repo hygiene.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when user wants to clean AI slop from code. Use for cleanup, remove debug statements, find ghost code, repo hygiene.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when user asks to "discover tasks", "find next task", "prioritize issues", "what should I work on", or "list open issues". Discovers and ranks tasks from GitHub, GitLab, local files, and custom sources.
Use when preparing releases, validating cross-platform compatibility, or updating installation infrastructure. Meta-skill for maintaining AgentSys's 3-platform architecture.
Use when user asks to "run repo intel", "generate repo map", "analyze repo", "query hotspots", "check ownership", or "bus factor". Unified static analysis - git history, AST symbols, project metadata.
Use when mapping code paths, entrypoints, and likely hot files before profiling.
Use when generating performance hypotheses backed by git history and code evidence.
Cross-tool AI consultation. Use when user asks to 'consult gemini', 'ask codex', 'get second opinion', 'cross-check with claude', 'consult another AI', 'ask opencode', 'copilot opinion', or wants a second opinion from a different AI tool.
| name | deslop |
| description | Use when user wants to clean AI slop from code. Use for cleanup, remove debug statements, find ghost code, repo hygiene. |
| version | 5.1.0 |
| argument-hint | [report|apply] [--scope=all|diff|path] [--thoroughness=quick|normal|deep] |
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 availableThe detection script is at ../../scripts/detect.js relative to this skill.
Run detection (use relative path from skill directory):
# Scripts are at plugin root: ../../scripts/ from skills/deslop/
node ../../scripts/detect.js . --thoroughness normal --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 --thoroughness normal --compact
Note: The relative path ../../scripts/detect.js navigates from skills/deslop/ up to the plugin root where scripts/ lives.
If repo-map exists, enhance detection with AST-based analysis:
// Use relative path from skill directory to plugin lib
// Path: skills/deslop/ -> ../../lib/repo-map
const repoMap = require('../../lib/repo-map');
if (repoMap.exists(basePath)) {
const map = repoMap.load(basePath);
const usageIndex = repoMap.buildUsageIndex(map);
// Find orphaned infrastructure with HIGH certainty
const orphaned = repoMap.findOrphanedInfrastructure(map, usageIndex);
for (const item of orphaned) {
findings.push({
file: item.file,
line: item.line,
pattern: 'orphaned-infrastructure',
message: `${item.name} (${item.type}) is never used`,
certainty: 'HIGH',
severity: 'high',
autoFix: false
});
}
// Find unused exports
const unusedExports = repoMap.findUnusedExports(map, usageIndex);
for (const item of unusedExports) {
findings.push({
file: item.file,
line: item.line,
pattern: 'unused-export',
message: `Export '${item.name}' is never imported`,
certainty: item.certainty,
severity: 'medium',
autoFix: false
});
}
}
Sort findings by:
Skill returns structured JSON - does NOT apply fixes (orchestrator handles that).
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 |
debug-statement: console.log, console.debug, print, println!debug-import: Unused debug/logging importsplaceholder-text: "Lorem ipsum", "TODO: implement"empty-catch: 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 together| Fix Type | Action | Patterns |
|---|---|---|
remove-line | Delete line | debug-statement, debug-import |
add-comment | Add explanation | empty-catch |
remove-block | Delete code block | stub-function with TODO |
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.