Skip to content

Commit 9d42aad

Browse files
cahaselerclaude
andcommitted
feat: add /cc-track:spotless command for scoped dead code cleanup
- New spotless command with 7-step workflow for comprehensive dead code analysis - Supports scoping by commit range, unstaged changes, spec branch, or session context - Dispatches parallel subagents for investigation and validation - Includes duplication detection and naming audit - User-gated execution with verification Also enhances dead-code-detector agent with AI code slop patterns: - Excessive defensive code detection - Type system workaround identification - Over-documentation flagging - Abandoned pattern detection - Debug artifact cleanup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ee8b869 commit 9d42aad

File tree

2 files changed

+437
-0
lines changed

2 files changed

+437
-0
lines changed

agents/dead-code-detector.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,38 @@ The following areas were checked and appear properly cleaned:
196196
- package.json scripts using deleted files
197197
- Build configs with stale entries
198198

199+
### AI Code Slop Patterns
200+
201+
AI-generated code often leaves behind artifacts that a human wouldn't. Look for:
202+
203+
**Excessive Defensive Code:**
204+
- Try-catch blocks around code that can't throw
205+
- Null checks in trusted internal codepaths
206+
- Redundant type guards after TypeScript already narrows
207+
- `|| []` or `?? {}` defaults where undefined is impossible
208+
209+
**Type System Workarounds:**
210+
- Casts to `any` or `unknown` to bypass type issues
211+
- `// @ts-ignore` or `// @ts-expect-error` without clear reason
212+
- Overly broad generic types that defeat type safety
213+
214+
**Over-Documentation:**
215+
- JSDoc comments restating what the code obviously does
216+
- Comments on every line of simple logic
217+
- Documentation style inconsistent with rest of codebase
218+
219+
**Abandoned Patterns:**
220+
- Functions that wrap other functions without adding value
221+
- Abstract classes with single implementations
222+
- Interfaces matching exactly one concrete type
223+
- Configuration objects with only default values used
224+
225+
**Debug Artifacts:**
226+
- `console.log` statements left behind
227+
- Commented-out alternative implementations
228+
- TODO/FIXME comments for completed work
229+
- Unused variables capturing intermediate values
230+
199231
## Tools to Use
200232

201233
**Note:** Knip (dead code detection) runs as part of the validation step before this review. If knip found issues, they would have been addressed before review agents are launched. Focus on manual analysis that knip might miss.

0 commit comments

Comments
 (0)