rnd-cleanuplisted
Install: claude install-skill oleksify/rnd-framework
# R&D Cleanup
Post-verification entropy reduction. Runs after a task has passed verification. Detects code rot introduced during the build, applies mutations, re-verifies, and rolls back on failure.
## The Iron Laws
```
1. NEVER MODIFY TEST FILES OR PRE-REGISTRATION DOCUMENTS
2. NEVER AUTO-COMMIT — CHANGES STAY IN THE WORKING TREE
3. ROLL BACK ALL TOUCHED FILES ON ANY NON-PASS VERDICT
4. EMPTY CANDIDATE LIST → SKIP IMMEDIATELY, NO NO-OP EDITS
```
## Four Detection Categories
Run all four on every task.
### 1. Dead Functions / Unused Exports
Use language-specific tooling when available; fall back to LLM diff review for unsupported languages.
| Language | Tool |
|----------|------|
| TypeScript / JS | `ts-prune`; or Grep for exported symbol with no inbound import |
| Python | `ruff check --select F401,F841` on changed files |
| Bash, Markdown, other | LLM diff review — reason about whether any function/variable introduced in this build is called from outside its own file |
A finding: symbol defined in the diff with zero references from project entry points.
### 2. Orphan Files
1. Extract changed files from `$RND_DIR/builds/T<id>-manifest.md`.
2. Grep for each new file's basename and exported identifiers across the project.
3. A file is an orphan if no other file imports or references it AND it is not itself an entry point (`main`, `index`, `__main__`, CLI script in `package.json`/`pyproject.toml`).
### 3. Duplicate / Parallel Implementations
LLM diff review only. R