{
  "markdown": "# deslop\n\nDetect and remove AI-generated slop from codebases with certainty-based findings and safe auto-fixes.\n\n## Why\n\nAI coding tools leave behind debug statements, placeholder text, empty catch blocks, over-commented code, and dead abstractions. Manual cleanup is tedious and error-prone. deslop runs a 3-phase detection pipeline that categorizes every finding by certainty level - HIGH findings get auto-fixed, MEDIUM findings get flagged for review, and LOW findings are reported without action. Behavior is preserved. Diffs are minimal.\n\n**Use cases:**\n\n- Pre-PR hygiene - scan changed files before opening a pull request\n- Periodic repo maintenance - sweep the full codebase for accumulated slop\n- CI gate - fail on HIGH-certainty slop in changed files\n\n## Installation\n\n```bash\nagentsys install deslop\n```\n\n## Quick Start\n\n```bash\n# Report slop findings (no changes made)\n/deslop\n\n# Auto-fix HIGH certainty findings\n/deslop apply\n\n# Scan only changed files in current branch\n/deslop report --scope=diff\n\n# Fix up to 10 findings in a specific directory\n/deslop apply src/ 10\n```\n\n## How It Works\n\ndeslop uses a 3-phase detection pipeline with increasing analysis depth:\n\n**Phase 1 - Regex patterns (HIGH certainty).** Fast pattern matching for `console.log`, `print()`, `dbg!()`, TODO/FIXME markers, empty catch blocks, hardcoded secrets, trailing whitespace, and mixed indentation. These are safe to auto-fix.\n\n**Phase 2 - Multi-pass analyzers (MEDIUM certainty).** Structural analysis for doc-to-code ratio problems, verbose over-commenting, over-engineering, buzzword inflation, dead code after return/throw, and stub functions. These need human review.\n\n**Phase 3 - CLI tools (LOW certainty, optional).** Runs external tools when available - jscpd for duplication, madge for circular dependencies, eslint/pylint/clippy/golangci-lint for language-specific issues. Findings are flagged but not auto-fixed.\n\n**Thoroughness levels** control which phases run:\n\n| Level | Phases | Speed |\n|-------|--------|-------|\n| `quick` | Phase 1 only | Seconds |\n| `normal` (default) | Phase 1 + 2 | Seconds |\n| `deep` | Phase 1 + 2 + 3 | Depends on CLI tools |\n\n**Repo-intel integration** - when repo-intel data is available, deslop targets AI-written files first (`recent-ai` query) and escalates MEDIUM findings to HIGH for files with no test coverage (`test-gaps` query).\n\n## Certainty Levels\n\n| Level | Meaning | Action |\n|-------|---------|--------|\n| HIGH | Definitely slop - safe to remove | Auto-fixed in apply mode |\n| MEDIUM | Likely slop - needs context | Flagged for review |\n| LOW | Possible slop - context-dependent | Reported only |\n\n## Usage\n\n### Report Mode (default)\n\n```bash\n/deslop\n/deslop report --scope=diff\n/deslop report --thoroughness=deep\n```\n\nOutputs a prioritized table of findings with certainty levels and suggested fixes. No files are modified.\n\n### Apply Mode\n\n```bash\n/deslop apply\n/deslop apply --scope=diff\n/deslop apply src/ 10\n```\n\nAuto-fixes all HIGH certainty findings, then runs the project's test suite. If tests fail, all changes are rolled back with `git restore .` and the failing fix is reported.\n\n### Scope Options\n\n- `all` (default) - scan entire codebase\n- `diff` - only files changed in current branch\n- `<path>` - specific directory or file\n\n### Thoroughness Options\n\n```bash\n/deslop --thoroughness=quick    # Phase 1 only\n/deslop --thoroughness=normal   # Phase 1 + 2 (default)\n/deslop --thoroughness=deep     # All phases\n```\n\n## Supported Languages\n\nTwo layers, two coverage stories:\n\n| Layer | Languages | Detection |\n|-------|-----------|-----------|\n| **Analyzer slop queries** (when `repo-intel.json` present) | JavaScript/TypeScript, Python, Rust, Go, Java | tree-sitter AST: empty error handling per language idiom, tautological assertions across major test frameworks, orphan exports, cliché-name clusters, wrapper towers, single-impl traits, high-bug communities |\n| **Regex pipeline** (always) | JavaScript/TypeScript, Python, Rust, Go, Java | universal patterns (debug statements, trailing whitespace, mixed indentation, placeholder text), language-specific patterns where defined |\n\nKotlin, C/C++, and Shell files are walked but no language-specific detectors are bundled today; only universal regex patterns apply. Tracked in [#27](https://github.com/agent-sh/agent-analyzer/issues/27).\n\n## Requirements\n\n- Git (required for rollback safety)\n- Node.js\n- [agentsys](https://github.com/agent-sh/agentsys) runtime\n- For deep mode: jscpd, madge, eslint, pylint, clippy, or golangci-lint (optional, used when available)\n\n## Related Plugins\n\n- [next-task](https://github.com/agent-sh/next-task) - invokes deslop in Phase 8 pre-review gates\n- [enhance](https://github.com/agent-sh/enhance) - broader code quality analysis\n- [audit-project](https://github.com/agent-sh/audit-project) - multi-agent code review\n\n## License\n\nMIT\n",
  "bytes": 4881,
  "sha": "04c973f3c61369335731d804c3d6c9b7bf9805e34a68e9a52a0772a2fcdd8976",
  "repo_slug": "agent-sh/deslop",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_agent_sh_deslop_deslop_b6d2d99f/readme"
}