deslop
Use when the user says deslop, debloat, tidy, simplify, clean up this diff, or deslop a branch diff, or asks to remove dead code, placeholders, stubs, dead fields, redundant wrappers, or stale config, or the slop skill routes here.
Install / Use
npx skills add OutlineDriven/outline-driven-developmentInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
OperationsSupported Platforms
Tags
Skill content
View source on GitHubname: deslop description: 'Use when the user says deslop, debloat, tidy, simplify, clean up this diff, or deslop a branch diff, or asks to remove dead code, placeholders, stubs, dead fields, redundant wrappers, or stale config, or the slop skill routes here. Not for remote, credential, publish, deploy, or irreversible changes.'
Deslop
Four modes share one spine: bound scope, verify with the repo's own command, rollback on regression, atomic commits separate from behavior changes.
Contract
| Field | Bound contract |
|---|---|
| Trigger | The user says deslop, debloat, tidy, simplify, clean up this diff, deslop a branch diff, remove dead code, find placeholders or stubs, remove dead fields, redundant wrappers, or stale config, or the slop skill routes code findings here |
| Authority | Reversible local writes to production source files or prose artifacts; may run the repo verifier and git restore on regression |
| Side effect | Local writes to production source files or prose artifacts; no edits to tests, fixtures, mocks, examples, generated, vendored, or lockfile/build artifacts |
| Done | Mode-specific done predicate holds; verifier green or rollback confirmed |
Refusal
Not for behavior changes, new abstractions, or refactors that introduce patterns — a tidy pass that would change observable behavior stops and reports a candidate for a separate refactor. Not for remote, credential, publish, deploy, or irreversible changes. Not for duplication across artifacts or drift — those are handed off, not force-compressed. Not for non-code targets (memory, git workspace, docs) — route to their owners. Not for opportunistic sweeps across untouched files in tidy mode — the candidate must lie in code already under edit.
Mode selection
| User says | Mode | Target | |---|---|---| | deslop, remove debug code, find placeholders or stubs, remove dead code, slop routed here | slop | Production source files | | debloat, tighten this, too long | bloat | One padded prose artifact (document, skill, spec) | | tidy this up, simplify, clean up this diff, polish my changes, make this simpler | tidy | Code in the working tree | | dead field, redundant wrapper, stale config, duplicate state, speculative abstraction | tidy | Code already under edit | | deslop this branch diff, remove AI debris from my branch, clean up added lines only | diff | Added/modified lines in a branch diff |
Shared spine
-
Bound scope. Prefer changed files unless the user requested a full sweep. Exclude tests, fixtures, mocks, examples, generated output, vendored code, lockfiles, build artifacts, and minified bundles:
**/test/**,**/tests/**,**/__tests__/**,*.test.*,*.spec.*,*_test.*,*Test.java,**/fixtures/**,**/mocks/**,**/testdata/**,**/examples/**,**/benches/**,dist/**,build/**,target/**,coverage/**,vendor/**,node_modules/**,*.min.*, generated/protobuf/openapi outputs. Keep Markdown out of whitespace cleanup — trailing spaces can be semantic line breaks. Done when: the file set is enumerated and exclusions applied. -
Verify. Run the repo's own test command after fixes. Derive it from manifests in this order: package script (
test, thencheck, thentypecheck),cargo test,go test ./...,pytest,mvn test,gradle test,dotnet test,bundle exec rspecorrake test,composer testorphpunit,swift test, or the project's documented command. If no command exists, run the narrowest parser/type check available, state the limitation, and treat every fix as unverified. Done when: the verifier has run or the limitation is stated. -
Rollback on regression. If verification fails, immediately
git restore -- <file...>every changed file, rerun the verifier to confirm baseline, and report the failed fix group as blocked with file/line and failing command. Never suppress tests, rewrite expectations, or keep partial results. Done when: baseline is confirmed restored or fixes are verified green. -
Commit separately. Cleanup commits are always separate from behavior commits. Use atomic commits with clear messages naming what was removed. If a cleanup is mixed into a behavior commit, split it with
git move --fixuporgit splitbefore merging. Done when: each commit has exactly one concern and the diff is net-deletion or inline-and-delete only.
Slop mode
Certainty-graded mechanical slop removal from production source. Full category catalog, per-language instances, and autofix strategy semantics: references/slop-catalog.md.
-
HIGH deterministic scan. Use
searchfor line patterns andast-grepwhere syntax shape matters. Record{file, line, pattern, certainty: HIGH, strategy}for each finding. Categories: debug output (stream-writing mechanism left behind after debugging — exclude output that is the product: CLIs, loggers, entrypoints), placeholder or unimplemented body (empty block, no-op, not-yet-implemented throw, TODO-marked panic), swallowed failure (catch/except/rescue that discards the error so the unhappy path continues with invalid state), crash-on-failure shortcut (forced unwrap, unchecked cast, abort-on-error where failure is recoverable — flag only), hardcoded credential (sk-,ghp_/github_pat_,AKIA,Bearer <token>, JWT strings, private-key blocks — flag only), placeholder text (lorem ipsum,asdf asdf,foo bar baz,replace this,TODO: implement), privilege and supply-chain hazard (chmod 777, piping download into shell — flag only), whitespace artifact (mixed tabs+spaces on one indentation prefix, trailing whitespace outside Markdown). Done when: every HIGH category has been scanned. -
MEDIUM contextual scan. Use codegraph first when indexed; otherwise combine
ast-grep,search, and direct reads of the narrow files. Report only, no auto-fix: comment bloat (doc-to-code ratio >3 for a real function with ≥3 code lines, or >2 comments per code line inside a function; filler/hedging/buzzword comments), dead or unreachable code (statements afterreturn/throw/break/continuethat are not a language-required fallthrough), commented-out code (consecutive comment lines whose content is code), mutable global state (module-level binding named as constant but declared mutable, or mutable global collection outside settings/constants), missing safety justification (escape-hatch construct entered without the adjacent comment its convention requires), suppression escape (warning or type-check suppression applied instead of fixing the finding), over-engineering indicators (file/export ratio >20, lines/export >500, directory depth >4 without real module boundaries), unsubstantiated capability claim ("production-ready", "secure", "enterprise-grade", "scalable" with fewer than two concrete supporting code signals), infrastructure without implementation (Client/Connection/Pool/Service/Provider/Manager/Factory/Repository/Gateway/Queue/Cache/Storevalues created but never used beyond setup/export), stub return values (function whose only significant body line returns0/null/undefined/None/nil/false/true/[]/{}/""/empty collections/Default::default()/Optional.empty()— escalate attention when adjacent TODO/FIXME/STUB text exists, keep auto-fix disabled). Done when: MEDIUM findings are recorded. -
LOW optional CLI scan. Run only tools already available in the repo or PATH; never install. Record findings as LOW and
flag-only:jscpdfor duplication,madgefor cycles, and the linter the project already declares (derived from its manifest or config:eslint,clippy,golangci-lint,ruff,ktlint,rubocop,phpstan,swiftlint, the .NET analyzers, and equivalents). If a tool is absent, writemissing: <tool>and continue. Done when: available tools have run. -
Prioritize. Sort HIGH before MEDIUM before LOW; then severity; then scope proximity to changed files; then fix strategy. Keep a separate
fixeslist containing only HIGH findings withremove-line,remove-block,replace-whitespace, oradd-commentstrategies. Exclude everyflag-onlyfinding from automatic edits. Done when: the fix list is ordered and flag-only findings are excluded. -
Fix HIGH only. Apply the smallest edit that removes the deterministic slop:
remove-line(debug prints, trailing whitespace, isolated commented-out code blocks),replace-whitespace(convert mixed indentation to the file's dominant style; strip trailing spaces),add-comment(empty catch/except blocks only when the correct behavior is intentionally swallowing the error and the surrounding code proves that intent — otherwise flag, do not invent logging),remove-block(placeholder block only when it is unreachable/dead and removal cannot change API behavior — stubs on live API surfaces are report-only),flag-only(hardcoded secrets, crash-on-failure shortcuts, placeholder implementations, dead code requiring control-flow judgment, architectural smells). Done when: all HIGH non-flag fixes are applied.
Done when: HIGH fixes applied and verified, MEDIUM/LOW findings left flagged for manual inspection, verifier green or rollback confirmed.
Bloat mode
Compress one padded but fully binding prose artifact in place. Every rule present before the pass is present after; the artifact is materially denser.
-
Read end to end. Note in one line what each section must convey. No second artifact is read or written. Done when: the artifact's load-bearing structure is mapped.
-
Find padding. A needless qualifier, a sentence fusing three ideas, an enumeration better expressed as a rule plus a short list, a nearby restatement, litigation history where the rule alone suffices. Done when: padding candidates are listed.
-
Compress in place. Cut the padding, split fused sentences, replace excessive enumerations with a rule and short list, keep repeated points once. Move nothing to another artifact and re-derive nothing. Done when: the artifact is materially denser.
-
Keep every load-bearing claim. If cutting a word would lose one, keep the word. Do not accept the loss. Done when: every prior rule and claim is confirmed present.
-
Hand off non-bloat. Duplication across artifacts and drift are not bloat; do not force-compress them. State that they were handed off rather than removing them. Done when: non-bloat defects are named and left for their owner.
-
Review and cut again with fresh eyes. The first pass always leaves some. Done when: a second pass finds nothing genuine to cut.
Done when: every prior rule and claim remains, the artifact is materially denser, and non-bloat problems are handed off.
Tidy mode
Remove constructs that do not earn their keep from code in the working tree, then verify. Branch-specific detection patterns: references/dead-fields.md (dead fields and members), references/dead-config.md (dead flags, env vars, branches), references/redundant-wrappers.md (inline-then-delete wrappers).
-
Confirm scope. In cleanup-codebase trigger shape (dead field, redundant wrapper, stale config), the candidate must lie in a file already touched by the active change. If it does not, stop: opportunistic sweeps across untouched files are out of scope. In tidy trigger shape (tidy this up, simplify), the scope is the user-named target, the active file, or the current diff. Done when: the exact files and functions in scope are identified.
-
Read end to end. Understand what each function, type, and module in scope must do or convey. Note the behavioral contract each piece serves. Done when: the scope's contracts are mapped.
-
Classify candidates. For each construct in scope:
- Dead code: unreachable paths, unused imports, unexported helpers with zero callers, commented-out blocks, stale feature-flag branches that are always-on or always-off.
- Redundant construct: duplicated logic, a wrapper
Truncated for display — read the full file on GitHub.
Related Skills
worldmonitor
85.6kReal-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
nacos
33.3kan easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.
dbx
18.1k20 MB lightweight cross-platform database client for 90+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker.
drawio-skill
9.1kFrom text & real sources to maintainable .drawio architecture models: Diagram IR with source-kind profiles, incremental sync preserving manual layout, multi-view projection, architecture-as-test with a CI action, query/review, what-if, accessible Story Mode, and a built-in MCP server
Security Score
Audited on Invalid Date
