vs-deslop
Use when code works but feels AI-generated, bloated, repetitive, over-defensive, or needs cleanup before review or shipping.
- License 许可
- MIT
- 所属仓库
- vltansky/vs
- 最近更新
- 2026-11-06
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- vs-deslop
- description
- Use when code works but feels AI-generated, bloated, repetitive, over-defensive, or needs cleanup before review or shipping.
02 资源文件 34
- 参考文档agents/openai.yaml153 B
- 许可证LICENSE.anti-slop1.0 KB
- 许可证LICENSE.oxlint-plugin-inhuman1.0 KB
- 脚本scripts/anti-slop-effect.oxlintrc.json1.8 KB
- 脚本scripts/anti-slop.oxlintrc.json1.7 KB
- 脚本scripts/load-ts.mjs95 B
- 脚本scripts/reject-anti-slop.mjs5.6 KB
- 脚本scripts/reject-code-slop.mjs1.5 KB
- 脚本scripts/run-anti-slop.mjs4.5 KB
- 脚本scripts/ts-hooks.mjs719 B
- 脚本test/anti-slop.static.eval.ts10.0 KB
- 脚本test/fixtures/anti-slop-bad.ts113 B
- 脚本test/fixtures/anti-slop-good.ts93 B
- 参考文档test/fixtures/anti-slop-note.md35 B
- 脚本test/fixtures/ceremony-wrapper.ts263 B
- 脚本test/fixtures/clean-add.ts84 B
- 脚本test/fixtures/comment-only-canary.ts104 B
- 参考文档test/fixtures/consumer-pkg-skill.md101 B
- 脚本test/fixtures/deslop-targets-bad.ts589 B
- 参考文档test/fixtures/hash-only-skill.md124 B
- 脚本test/fixtures/leftover-oxlint-bad.ts550 B
- 参考文档test/fixtures/mention-only-inherit-hash-skill.md259 B
- 参考文档test/fixtures/mention-only-inherit-skill.md194 B
- 参考文档test/fixtures/no-names-skill.md101 B
- 参考文档test/fixtures/oxlint-prose-hash-skill.md178 B
- 参考文档test/fixtures/oxlint-prose-skill.md113 B
- 参考文档test/fixtures/paragraph-paste-hash-skill.md668 B
- 参考文档test/fixtures/paragraph-paste-skill.md603 B
- 脚本test/fixtures/second-miss-after-pass.ts260 B
- 脚本test/fixtures/try-catch-theater.ts155 B
- 参考文档test/fixtures/whole-tree-skill.md102 B
- 脚本test/peer-skills-iter.static.eval.ts3.6 KB
- 脚本test/peer-skills.static.eval.ts6.3 KB
- 脚本test/vs-deslop.static.eval.ts3.0 KB
03 SKILL.md 正文
Deslop
Clean working code without changing behavior. This is the focused cleanup building block: remove AI-ish noise, needless abstraction, duplicated logic, stale fallbacks, and review-hostile clutter while preserving the product contract.
Use vs-ponytail in composed mode to prefer
structural deletion and native or existing capabilities over a new
cleanup abstraction.
Flow Contract
- Kind: Building block
- Inputs: Changed files or explicit scope, behavior that must stay unchanged, and available verification commands
- Outputs: Cleanup summary, changed files, behavior-preservation evidence, and deferred findings
- Status:
CLEAN,CLEANED,WARN,FAIL, orBLOCKED - Consumers:
vs:roast-codePass 1,vs:build-itPhase 4,vs:ship-itpre-PR review, standalone cleanup requests - Skip conditions: Skip when the diff is trivial, generated-only, or the user explicitly asks for review-only/no edits
Cleanup Targets
Inspect the requested scope for:
- flatten first: delete down to one layer. A new wrapper, helper, file, or mode flag is not a cleanup
- structural simplifications that delete whole concepts, branches, modes, wrappers, or layers instead of merely polishing them
- duplicate logic or copy-paste with tiny variations
- one job per unit: do not restate the same logic in many layers
- unnecessary
async/awaitor Promise wrapping around sync work - pass-through wrappers that add no meaning
- ceremony types and files (
Manager,Service,Factory,Helper,Utils) that exist for a single call, plus config objects wrapping two or three parameters and boolean mode flags that split one path - a single-use extract: a helper with one call site that only moved lines
- a helper or type that fails the portability test: if it could move to another repo unchanged, it is generic filler, not this product's logic
- synonym cycling of the same domain concept (rotating the name across layers: user / account / customer for one entity)
- defensive null checks on values proven non-null by types or callers
- fallback branches that hide primary-path failures
- silent defaults and optional chaining that hide missing required data:
?.on a required field,?? [],?? {}, or|| defaultthat papers over an invariant the caller should have supplied - try/catch theater: a try/catch around non-throwing code, an empty catch, or a catch that logs and swallows a real failure
any, a non-null assertion (!), and an uncommented type assertion that fabricates evidence- comments that narrate obvious code, hand-holding notes, and JSDoc that is only restating the signature
- dead imports, stale flags, temporary debug leftovers,
console.log/console.debug/console.infoleft in production paths, and a stale TODO fossil - inconsistent naming or one-off conventions that fight the codebase
- ad-hoc conditionals bolted into busy flows where a typed model, dispatcher, policy object, or canonical helper would make the path easier to reason about
- cast-heavy or optionality-heavy boundaries that hide the real invariant,
in particular:
unknownorobjectin a signature where the caller already knows the typeRecord<string, unknown>and equivalents standing in for an owned contract- chained assertions (
value as object as User) that fabricate evidence - widening a known value and asserting it back later
- a broad annotation where
satisfieswould preserve the inferred keys - ad-hoc
typeofnarrowing where the value should be parsed once at the boundary
Run skills/vs-deslop/scripts/reject-code-slop.mjs on each in-scope file
before reporting CLEAN or CLEANED. Exit 1 is a catalog fail.
Then run the on-demand anti-slop file pass on the same in-scope TS/JS
files (named files only — not a whole-repo lint, and do not write
oxlint.config into the consumer repo):
node skills/vs-deslop/scripts/run-anti-slop.mjs <file.ts> [file.ts ...]
That command runs oxlint with the vs-owned config on named files:
the vendored generic anti-slop rules, eslint/no-useless-catch,
eslint/no-console (console.error and console.warn allowed),
eslint/no-empty, eslint/no-unused-vars, eslint/require-await,
typescript/no-explicit-any, typescript/no-non-null-assertion,
unicorn/no-useless-fallback-in-spread, unicorn/no-unnecessary-await,
inhuman/no-empty-wrappers, and inhuman/no-swallowed-catch. Exit 1
is a catalog fail (not CLEAN). If oxlint or the plugin cannot run,
report WARN or BLOCKED — do not pretend CLEAN. Enable the Effect
rule only when the target repo uses Effect. No-args, a directory, or
zero JS/TS names among args is not a pass (not CLEAN). Do not write
oxlint.config or node_modules into the consumer cwd. Do not spawn
a consumer package CLI.
Score the file pass with skills/vs-deslop/scripts/reject-anti-slop.mjs
(identity 9f42cf49e0a4ee9de516dbacbac04e687a0b7ed39e117d23d409555f45e18ef8;
exit 1 is a fail). Exclusive is the live skills/vs-deslop/SKILL.md path
or a published skill-bytes pair. Exclusive cases live under test/fixtures.
Procedure
Exclusive order: Lock behavior first, then collect → validate/discard FP → surgical delete → verify → rescan. Do not skip or invert these.
- Lock behavior first. Identify the existing tests or direct checks that prove behavior. If none exist and cleanup could change behavior, add the narrowest regression test before editing. Do not invent types, files, flags, or behavior "for cleanliness."
- Collect candidates. Do not edit yet. Name each smell, its category, the invariant or call site, and the file it affects. Do not broaden scope just because adjacent code is ugly.
- Validate each candidate. Keep a change only when it is formula, not a necessary defense (auth, validation at a trust boundary, required error handling). A false positive that deletes a real guard is worse than one leftover tell. Discard it and say why.
- Flatten first. The first cleanup move is one-layer delete. Before extracting a helper, ask whether a simpler state shape, ownership boundary, or default flow would remove the branch/helper/wrapper entirely. One clean delete beats three clumsy rewrites. Do not clean by adding a wrapper, helper, file, or mode flag.
- Edit in safe, surgical passes. Take the minimum effective edit. Leave strong local code alone. Prefer deletion and simplification over abstraction. Do not restructure modules or reorder files for aesthetics unless a concept disappears. Preserve public APIs unless the user explicitly asked for a breaking cleanup. Preserve local idiom: flattening working house style into a generic house style is a cleanup defect. Cleanup must not add a file, wrapper, interface, flag, or helper that did not exist; do not introduce new slop while removing old.
- Verify after cleanup. Re-run the targeted proof and any required guardrail.
- Rescan, then stop. Walk the cleanup targets and the quick checks
again. The deslop run ends the pass. At most 2 rescans. Then stop.
CLEAN/CLEANEDmeans no in-scope leftover is still cuttable. If the leftover is only deferred (risky / out of scope): WARN, not another rescan. Do not keep looping.
Quick checks before reporting CLEAN or CLEANED
- try/catch around non-throwing work, empty catch, or swallow?
?./?? []/?? {}hiding a required value?- unnecessary
async/awaitor Promise wrapping? anyor uncommented type assertion?- hand-holding comment or JSDoc restating the signature?
console.log/ stale TODO fossil / dead import?- synonym cycling of one domain name?
- still cuttable concept left in scope after one flatten pass?
skills/vs-deslop/scripts/reject-code-slop.mjsexit 1 after that pass?skills/vs-deslop/scripts/run-anti-slop.mjsexit 1 on those named TS/JS files?- oxlint/plugin cannot run: WARN/BLOCKED, not CLEAN?
Output
## Deslop Result
- Status: CLEAN | CLEANED | WARN | FAIL | BLOCKED
- Scope: <files or diff range>
- Cleaned:
- <change, smell category, and why it preserved behavior>
- Deferred:
- <risky, false-positive, or out-of-scope cleanup>
- Evidence:
- `<command>` - <result>
Output style
Apply the shared output style to every user-facing message.
Workflow
Direct: emit Next only. Composed: return to caller.
Prev: /vs-build-it | /vs-roast-code | /vs-qa
Next: /vs-verify
Relevant: /vs-ui
04 同仓库更多 Skills
vs-write
Use when asked to write, rewrite, edit, tighten, simplify, or polish prose for clarity, or to put text in STE, ASD-STE100, or controlled language. Produces plain, direct, accessible copy without losing substance or precision.
vs-fake-verify
暂无简介
vs-fake-verify
暂无简介
vs-verify
Use when asked to verify, prove it works, check completion, or before claiming done. Produces evidence-backed PASS/WARN/FAIL status.
vs-fake-verify
暂无简介
vs-verify
Use when asked to verify, prove it works, check completion, or before claiming done. Produces evidence-backed PASS/WARN/FAIL status.