deslop
БесплатноБез исполняемых скриптовНе проверенRemove AI slop (fabricated casts, evidence widening, defensive clutter, mock patching, vacuous names) from recent changes while keeping tests green. Use when…
от FradSer★ 598 звёзд на GitHubОб этом скилле
De-slop
Remove AI slop from a bounded change set without changing behavior. AI slop is the set of low-evidence, low-signal patterns that language-model-generated code tends to emit under completion pressure: fabricated evidence, discarded type information, defensive clutter, test-cheating seams, and vacuous names. The categories are language-neutral: apply them to whatever stack the change set touches.
Run this as a focused pass over a diff, an uncommitted change set, or named files. Never add features, never change public behavior, and never trade a working product for cleanup. Tests and types must stay green; if the change set has no test coverage, report that and stop before rewriting anything.
The five slop categories
Each category reads what it is → how to fix it. Match them against the change set:
- Fabricated evidence: casts, suppressions, or unsafe escapes that assert a type or invariant the code never established: chained
as/as unknown as,cast(Any, x),# type: ignore,@ts-ignore/@ts-expect-errorwithout justification,unsafeblocks or.unwrap()standing in for real handling, non-null!assertions on nullable values. → Replace with boundary parsing, type guards, or pattern matching; when a suppression is genuinely required, pair it with a non-empty invariant justification. - Evidence widening: known, precise values funneled into top types or open dictionaries: parameters and returns typed
object/unknown/any/interface{}/dict[str, Any], finite records degraded to open maps,as anyto silence a mismatch. → Preserve the precise type end to end; widen only at an unparsed boundary and parse there. - Defensive clutter: no-op protection against cases a trusted codepath cannot produce:
try/except: pass, redundant null checks inside internal call chains where the value is guaranteed, conditional empty-object spreads and similar omission tricks, silent fallback defaults. → Delete the check; validate at the boundary once instead of everywhere. - Mock patching: tests that monkey-patch or mock a module's internals to force the code under test to pass:
patch("module.path")on the subject's own collaborators,vi.mock/jest.mockon internal modules, snapshots derived from the implementation. → Test through real seams: inject an adapter, point the code at an in-memory implementation, or exercise the public interface. - Vacuous names: symbols named after their type or shape instead of their domain meaning:
data,info,item,result,obj,helper,manager,*Shape,handleX. → Rename to the domain concept the symbol carries; if no honest name exists, the design is murky and that is a finding, not a rename.
Two binding rules:
- Repo tooling overrides. If the repository enforces a category through lint or CI, skip it here: tooling already rejects it, and duplicating it wastes effort.
- Behavior is frozen. Every rewrite must keep observable behavior, public interfaces, and test outcomes identical. A de-slop pass that requires a behavior change is out of scope: record it as a finding instead.
Process
1. Pin the scope
Resolve the change set before touching anything:
- If the user named a diff base, files, or a review request, use that.
- Otherwise use the uncommitted change set (
git statusplusgit diff). - An empty scope is a stop: report that there is nothing to de-slop.
2. Inventory findings
For a compound guard, justify each predicate separately by tracing the exact expression and conversion order on a concrete input. A failure rejected by another predicate does not prove this one necessary. If no distinguishing input is established, record the claimed necessity as unverified rather than converting a redundant check into a proven requirement. Removing a proven inert predicate preserves the accepted grammar and does not require changing the spec or obtaining a new product decision. Reconcile cleanup, review and handoff verdicts against the final candidate after remediation.
Scan the scope once per category. Produce a findings list: category, location (file plus hunk), the offending line quoted, and the replacement plan. A finding without a concrete replacement plan is not ready to fix: leave it as a reported finding.
3. Rewrite
Apply the plans in one pass, category by category. For each rewrite:
- Replace the slop with the typed, seam-based, or renamed equivalent.
- Keep tests green after each category batch; run the repository's test suite or the affected subset between batches.
- Stop and report when a planned rewrite cannot keep tests green: the slop was load-bearing, which is itself a finding.
4. Verify
Run the verification the repository already uses: tests, typecheck, and lint. A de-slop pass ends green or it has not ended. Record each actually failed command and its observed result separately from reasoning about an unexecuted alternative. Do not describe a rejected design, source i
Установить deslop в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл deslop?
Remove AI slop (fabricated casts, evidence widening, defensive clutter, mock patching, vacuous names) from recent changes while keeping tests green. Use when the user asks to de-slop, clean up AI-generated code, or remove defensive clutter from a diff.
Как установить скилл deslop?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл deslop запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic