<!-- AUTO-GENERATED by scripts/gen-adapters.js - DO NOT EDIT -->
---
description: This skill should be used when the user asks to "clean up slop", "remove AI artifacts", "deslop the codebase", "find debug statements", "remove console.logs", "repo hygiene", or mentions "AI slop", "code cleanup", "slop detection".
agent: general
---

> **OpenCode Note**: Invoke agents using `@agent-name` syntax.
> Available agents: task-discoverer, exploration-agent, planning-agent,
> implementation-agent, deslop-agent, delivery-validator, sync-docs-agent, consult-agent
> Example: `@exploration-agent analyze the codebase`


# /deslop - AI Slop Cleanup

Senior maintainer performing periodic repo hygiene. Mission: remove AI-generated slop while preserving behavior and minimizing diffs.

## Constraints (Priority Order)

When constraints conflict, follow this priority:

1. **Preserve behavior and public APIs** (highest priority)
2. **Minimal diffs** - do not reformat unrelated code
3. **Prefer deletion over invention**
4. **No new dependencies or abstractions**
5. **Respect repo conventions** (check CLAUDE.md/AGENTS.md)

## Arguments

Parse from $ARGUMENTS or use defaults:

- **Mode**: `report` (default) or `apply`
- **Scope**: `all` (default), `diff`, or path
- **Thoroughness**: `quick`, `normal` (default), or `deep`

## Execution

### Phase 1: Spawn Deslop Agent

*(JavaScript reference - not executable in OpenCode)*

### Phase 2: Parse Agent Results

Extract structured JSON from agent output:

*(JavaScript reference - not executable in OpenCode)*

### Phase 3: Handle Mode

#### Report Mode (Default)

Present findings as markdown table:

```markdown
## Slop Hotspots

| Priority | File | Issue | Certainty | Fix |
|----------|------|-------|-----------|-----|
| 1 | src/api.js:42 | console.log | HIGH | auto |
| 2 | src/auth.js:15 | empty catch | HIGH | auto |
| 3 | lib/utils.js:88 | excessive comments | MEDIUM | review |

## Summary

- **HIGH certainty**: N (auto-fixable)
- **MEDIUM certainty**: N (review required)
- **LOW certainty**: N (flagged only)

## Do Next

- [ ] Run `/deslop apply` to auto-fix HIGH certainty items
- [ ] Review MEDIUM certainty items manually
```

#### Apply Mode

If fixes array is non-empty, spawn simple-fixer:

*(JavaScript reference - not executable in OpenCode)*

Present results:

```markdown
## Applied Fixes

| File | Line | Fix |
|------|------|-----|
| src/api.js | 42 | remove-line (console.log) |
| src/auth.js | 15 | add-comment (empty catch) |

**Total**: N fixes applied

## Remaining (manual review needed)

| File | Line | Issue | Certainty |
|------|------|-------|-----------|
| lib/utils.js | 88 | excessive comments | MEDIUM |
```

## Verification Strategy

After fixes are applied, run project's test command:

```bash
npm test
# or pytest, cargo test, go test ./...
```

On failure: `git restore .` and report which change failed.

## Ignore Zones

Skip these paths (handled by detection script):
- Build artifacts: `dist/`, `build/`, `target/`, `out/`, `.next/`
- Vendored: `vendor/`, `node_modules/`, `**/*.min.*`
- Generated: `**/*.gen.*`, lockfiles

## Error Handling

- Git not available: Exit with "Git required for rollback safety"
- Invalid scope path: Exit with "Path not found: <path>"
- Verification fails: Rollback with `git restore .`, report failure

## Additional Resources

### Reference Files

For detailed pattern documentation, consult:
- **`references/slop-categories.md`** - All pattern categories, severity levels, certainty thresholds, auto-fix strategies

### Scripts

- **`scripts/detect.js`** - Detection pipeline CLI (run with `--help` for options)