deslop

📁 skyosev/agent-skills 📅 12 days ago
0
总安装量
6
周安装量
安装命令
npx skills add https://github.com/skyosev/agent-skills --skill deslop

Agent 安装分布

claude-code 4
opencode 3
codex 3
github-copilot 2
cursor 2

Skill 文档

Remove AI Code Slop

Check the diff against the base branch and remove all AI-generated slop introduced in this branch.

Remove

  • Redundant comments/docs: Delete narration that restates obvious behavior (e.g., “Increment the date”). Remove stale bug/workaround notes that no longer apply.
  • Verbose comments: Make long comment blocks more concise while keeping the intent.
  • Over-defensive handling: Remove unnecessary null/validation guards and broad try/catch blocks when inputs are trusted or exceptions should propagate. Prefer direct flow over catch-and-rethrow, empty catches.
  • Silent fallbacks: Replace defensive fallbacks that silently mask invalid input with explicit errors. Surface potential bugs instead of hiding them.
  • Type-system bypasses: Replace or remove casts/pragmas used only to silence errors (e.g., any, as unknown as T, // @ts-ignore, # type: ignore). Restore correct typing or remove the unnecessary construction.
  • Dead/unused code: Delete unused imports, variables, helpers, alternate implementations, and commented-out code. Keep the diff free of placeholders and vestiges.
  • Style drift: Conform to local patterns (naming, formatting, error handling, structure).
  • Duplication: Remove repeated logic and refactor to avoid duplicated semantics.

Process

  1. Diff against base: git diff $(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')...HEAD
  2. Scan for slop: Identify added narration, guards, catches, casts, suppressions, dead code, duplication, and out-of-style constructs.
  3. Edit for intent:
  • Remove slop while preserving legitimate behavior.
  • Fix root causes behind suppressions when feasible; otherwise remove the suppression if it was unnecessary.
  • Keep high-value comments that capture critical behavior or design intent that is not immediately obvious.
  1. Verify and summarize: Run tests/linters and write a 1–3 sentence summary of the cleanup (e.g., removed redundant commentary and null checks; removed unnecessary try/catch; aligned code with project conventions).