npx skills add https://github.com/avifenesh/awesome-slash --skill deslop基于确定性发现和自动修复,清理代码中的 AI 冗余内容。
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';
参数:[report|apply] [--scope=<path>|all|diff] [--thoroughness=quick|normal|deep]
report (默认) 或 applyall (默认): 整个代码库diff: 仅当前分支中更改的文件广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
<path>: 特定目录或文件normal)
quick: 仅使用正则表达式模式normal: + 多遍分析器deep: + CLI 工具 (jscpd, madge),如果可用检测脚本位于相对于此技能的 ../../scripts/detect.js。
运行检测 (使用从技能目录开始的相对路径):
# 脚本位于插件根目录:从 skills/deslop/ 向上到 ../../scripts/
node ../../scripts/detect.js . --thoroughness normal --compact --max 50
对于 diff 范围 (仅更改的文件):
BASE=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' || echo "main")
# 使用换行符分隔的列表,以安全处理包含特殊字符的文件名
git diff --name-only origin/${BASE}..HEAD | \
xargs -d '\n' node ../../scripts/detect.js --thoroughness normal --compact
注意 : 相对路径 ../../scripts/detect.js 是从 skills/deslop/ 导航到包含 scripts/ 的插件根目录。
如果 repo-map 存在,则使用基于 AST 的分析增强检测:
// 使用从技能目录到插件 lib 的相对路径
// 路径: 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);
// 查找被遗弃的基础设施,确定性为 HIGH
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
});
}
// 查找未使用的导出
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
});
}
}
按以下顺序对发现项进行排序:
技能返回结构化的 JSON - 不应用修复 (由编排器处理)。
标记之间的 JSON 结构:
=== 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 ===
| 级别 | 含义 | 操作 |
|---|---|---|
| HIGH | 确定是冗余内容,可安全自动修复 | 通过 simple-fixer 自动修复 |
| MEDIUM | 可能是冗余内容,需要验证 | 先审查 |
| LOW | 可能是冗余内容,取决于上下文 | 仅标记 |
debug-statement: console.log, console.debug, print, println!debug-import: 未使用的调试/日志导入placeholder-text: "Lorem ipsum", "TODO: implement"empty-catch: 没有注释的空 catch 块trailing-whitespace: 尾随空格mixed-indentation: 混合制表符/空格excessive-comments: 注释/代码比率 > 2:1doc-code-ratio: JSDoc 长度 > 函数体 3 倍stub-function: 仅返回占位符值dead-code: return/throw 后无法访问的代码infrastructure-without-impl: 创建但从未使用的 DB 客户端over-engineering: 文件/导出比率 > 20 倍buzzword-inflation: 无证据支持的声明shotgun-surgery: 频繁一起更改的文件| 修复类型 | 操作 | 模式 |
|---|---|---|
remove-line | 删除行 | debug-statement, debug-import |
add-comment | 添加解释 | empty-catch |
remove-block | 删除代码块 | 包含 TODO 的 stub-function |
此技能由以下方式调用:
deslop-agent 用于 /deslop 命令/next-task 阶段 8 (预审查门控) 使用 scope=diff编排器会启动 simple-fixer 来应用 HIGH 确定性的修复。
每周安装次数
1
仓库
GitHub 星标数
550
首次出现
1 天前
安全审计
安装于
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
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.
Weekly Installs
1
Repository
GitHub Stars
550
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
Python PDF处理教程:合并拆分、提取文本表格、创建PDF文件
59,800 周安装
browser-use CLI 浏览器自动化工具:快速持久会话,支持多步骤工作流
60,300 周安装
新闻内容提取工具 - 支持12个主流平台,自动输出JSON和Markdown格式
205 周安装
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
62,200 周安装
专业SEO审计工具:全面网站诊断、技术SEO优化与页面分析指南
63,800 周安装
Azure GitHub Copilot SDK 部署指南:从零构建、集成到现有项目与模型配置
75,700 周安装