com um clique
deslop
Remove AI-generated code slop from a diff, path, branch, or repository
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Remove AI-generated code slop from a diff, path, branch, or repository
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
| name | deslop |
| description | Remove AI-generated code slop from a diff, path, branch, or repository |
Use this skill to clean AI-shaped code before a commit, PR, or final answer.
Start with the five dangerous patterns from AI_DANGER_PATTERNS.md. These are worse than cosmetic slop because they can hide real bugs.
Determine the target based on the argument passed:
git diff HEAD)apps/desktop/src/renderer/) — scan that path only--diff — scan the diff of the current branch against main (git diff main...HEAD)--all — scan the full codebase (apps/desktop/src/ and
apps/desktop/src-tauri/src/)Fix each issue you find, then report a 1-3 sentence summary of what you changed.
Before editing, read:
AI_DANGER_PATTERNS.mdCLAUDE.md.claude/rules/*.md file for touched pathsFix dangerous AI patterns first:
if/else nestingThen clean cosmetic AI slop:
any to work around type issues — fix the types insteaduseCallback or useMemo_unused variables that should just be removed// removed, // old, // TODO: maybe later without an issue→, ←, ⇒, ✓, ✗) — use plain words: "to", "becomes", "returns", "yes", "no"Replace silent failure with either:
Bad:
try {
return await api.getInstalledMods()
} catch {
return []
}
Better:
return await api.getInstalledMods()
or:
try {
return await api.getInstalledMods()
} catch (error) {
logger.error("Failed to load installed mods", { error })
throw error
}
Do not simplify domain-specific code into generic helpers.
If a helper hides game-specific behavior, restore explicit domain branching or rename it to the real domain rule.
Remove impossible-state checks from trusted code.
Do not widen types to include null or undefined unless the domain really allows it.
Validate at boundaries instead.
Flatten nested conditions. Use guard clauses and early returns. Remove else after return, throw, continue, or break.
Delete future-facing options, flags, helpers, managers, factories, and adapters unless they are needed by current behavior.
Inline one-use helpers when they do not name a real domain concept.
Do not remove useful file-level or section-level comments.
Keep comments that explain: reference implementations, file formats, algorithm provenance, archive format behavior, security-sensitive path assumptions, game-specific loader rules, why a port must remain byte-compatible, test scenario intent.
The structural comments in pdmod.rs (.pdmod format description, Bob Jenkins hash provenance, hashlist reference) are load-bearing domain knowledge — never remove them.
Only remove comments that repeat nearby code or describe basic syntax.
Fix these when found:
zinc-*, red-*, gray-*) — use semantic tokens from src/renderer/src/index.cssReactMarkdown — use components/MarkdownContent.tsx<select> — use components/Select.tsxt('key') from ../i18napi.getMod, api.listModFiles, or api.listModLinks calls in renderer components — use getCachedMod, getCachedModFiles, or getCachedModLinksapi.getThumbnail calls — use getLocalThumbnail or getCachedThumbnailUrlgenerate_handler![...], and src/renderer/src/api.tsconsole.log or console.warnStop and ask for direction only if cleanup would require a behavior decision.
Do not ask before removing obvious comments, flattening obvious control flow, or deleting unrelated generated noise.
Add user-facing entries to CHANGELOG.md's Unreleased section for recent changes
Review a diff for AI-shaped code before a PR, commit, or final summary
Remove useless comments and keep only human-useful context
Flatten nested conditionals and make the happy path readable
Audit a diff for the five dangerous AI patterns
Propose a conventional commit message for the current diff