Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Remove AI-generated code slop from branches. Use after AI-assisted coding sessions to clean up defensive bloat, unnecessary comments, type casts, and style inconsistencies. Focuses on identifying and removing AI artifacts that degrade code quality.
.claude/skills/aiskillstore-ai-code-cleanup/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 79% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 21% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 66% | 0% |
| case-22 | ✓→✓ | = Same ✓ | 345% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 44% | 0% |
This skill identifies and removes AI-generated artifacts that degrade code quality, including defensive bloat, unnecessary comments, type casts, and style inconsistencies.
Remove AI slop from this branchClean up the code in this pull requestRemove unnecessary comments and defensive code from src/Patterns:
Example:
javascript// ❌ AI-generated: Obvious comment // Set the user's name user.name = name; // ✅ Clean: Self-documenting code user.name = name;
Patterns:
Example:
javascript// ❌ AI-generated: Unnecessary defensive code function processUser(user) { try { if (user && user.name && typeof user.name === 'string') { return user.name.toUpperCase(); } return null; } catch (error) { console.error(error); return null; } } // ✅ Clean: Trust the input, handle real errors function processUser(user) { return user.name.toUpperCase(); }
Patterns:
any to bypass type issuesas X)@ts-ignore or @ts-expect-error without legitimate reasonExample:
typescript// ❌ AI-generated: Type workaround const data = response.data as any; const result = processData(data as ProcessedData); // ✅ Clean: Proper typing const data = response.data; const result = processData(data);
Patterns:
Example:
javascript// ❌ AI-generated: Inconsistent style const UserData = fetchUser(); var processedData = process(UserData); let FinalResult = format(processedData); // ✅ Clean: Consistent style const userData = fetchUser(); const processedData = process(userData); const finalResult = format(processedData);
Patterns:
bashgit diff $(git merge-base HEAD main)..HEAD --name-only
For each changed file:
Input: Remove unnecessary comments from src/auth.js
Output:
markdown## AI Code Cleanup: src/auth.js ### Removed - 12 redundant comments explaining obvious code - 3 comments inconsistent with file style - 5 over-documented simple operations ### Changes
// Before // Function to validate user email // Takes email string as input // Returns boolean indicating validity function validateEmail(email) { // Check if email is not empty if (!email) { return false; // Return false if empty } // Return regex test result return /^^\s@]+@^\s@]+\.^\s@]+$/.test(email); }
// After function validateEmail(email) { if (!email) return false; return /^^\s@]+@^\s@]+\.^\s@]+$/.test(email); }
### Result
- Lines reduced: 12 → 4
- Functionality preserved
- Tests pass
Input: Remove defensive bloat from src/api/users.js
Output:
markdown## AI Code Cleanup: src/api/users.js ### Removed - 3 unnecessary try/catch blocks - 8 redundant null checks on validated inputs - 2 error handlers that can never trigger ### Changes
// Before async function getUser(userId) { try { if (!userId || typeof userId !== 'string') { throw new Error('Invalid userId'); } const user = await db.users.findById(userId); if (user && user.id) { return user; } return null; } catch (error) { console.error(error); throw error; } }
// After async function getUser(userId) { const user = await db.users.findById(userId); return user || null; }
### Result
- Code reduced: 15 lines → 3 lines
- Functionality preserved
- Error handling appropriate for context
references/REFACTORING_PLAN.template.md - Refactoring plan template with code smells, before/after metrics, and rollback strategy| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-22 | pass→pass | 2,944 | 4,209 | +43% | 1 | 1 | 0% | 522 | 2,325 | +345% | 0 | 0 | — |
case-01 | pass→pass | 10,385 | 5,715 | -45% | 1 | 1 | 0% | 1,790 | 2,581 | +44% | 0 | 0 | — |
case-02 | fail→pass | 8,368 | 4,657 | -44% | 1 | 1 | 0% | 1,337 | 2,388 | +79% | 0 | 0 | — |
case-03 | pass→pass | 7,006 | 6,555 | -6% | 1 | 1 | 0% | 1,195 | 2,734 | +129% | 0 | 0 | — |
case-04 | pass→pass | 10,260 | 6,197 | -40% | 1 | 1 | 0% | 1,658 | 2,572 | +55% | 0 | 0 | — |
case-05 | pass→pass | 6,837 | 4,160 | -39% | 1 | 1 | 0% | 1,076 | 2,236 | +108% | 0 | 0 | — |
case-06 | pass→pass | 5,461 | 4,162 | -24% | 1 | 1 | 0% | 928 | 2,344 | +153% | 0 | 0 | — |
case-07 | pass→pass | 2,601 | 2,395 | -8% | 1 | 1 | 0% | 404 | 1,994 | +394% | 0 | 0 | — |
case-08 | pass→pass | 3,700 | 3,529 | -5% | 1 | 1 | 0% | 527 | 2,246 | +326% | 0 | 0 | — |
case-09 | pass→pass | 10,598 | 7,442 | -30% | 1 | 1 | 0% | 1,758 | 2,826 | +61% | 0 | 0 | — |
case-10 | fail→fail | 6,324 | 2,366 | -63% | 1 | 1 | 0% | 1,004 | 2,054 | +105% | 0 | 0 | — |
case-11 | fail→pass | 9,904 | 2,281 | -77% | 1 | 1 | 0% | 1,634 | 1,970 | +21% | 0 | 0 | — |
case-12 | pass→pass | 7,869 | 5,944 | -24% | 1 | 1 | 0% | 1,258 | 2,608 | +107% | 0 | 0 | — |
case-13 | pass→pass | 4,816 | 4,123 | -14% | 1 | 1 | 0% | 778 | 2,307 | +197% | 0 | 0 | — |
case-14 | fail→fail | 12,751 | 6,496 | -49% | 1 | 1 | 0% | 2,119 | 2,604 | +23% | 0 | 0 | — |
case-15 | pass→pass | 11,226 | 9,013 | -20% | 1 | 1 | 0% | 1,911 | 3,128 | +64% | 0 | 0 | — |
case-16 | fail→fail | 8,369 | 4,472 | -47% | 1 | 1 | 0% | 1,329 | 2,373 | +79% | 0 | 0 | — |
case-17 | fail→pass | 9,652 | 6,093 | -37% | 1 | 1 | 0% | 1,600 | 2,660 | +66% | 0 | 0 | — |
case-18 | pass→pass | 8,725 | 12,170 | +39% | 1 | 1 | 0% | 1,451 | 2,699 | +86% | 0 | 0 | — |
case-19 | fail→fail | 8,567 | 2,541 | -70% | 1 | 1 | 0% | 1,429 | 2,005 | +40% | 0 | 0 | — |
case-20 | pass→pass | 2,965 | 2,732 | -8% | 1 | 1 | 0% | 472 | 2,004 | +325% | 0 | 0 | — |
case-21 | pass→pass | 9,072 | 5,711 | -37% | 1 | 1 | 0% | 1,468 | 2,604 | +77% | 0 | 0 | — |
case-23 | pass→pass | 9,604 | 4,900 | -49% | 1 | 1 | 0% | 1,640 | 2,411 | +47% | 0 | 0 | — |
case-24 | pass→pass | 22,500 | 13,703 | -39% | 1 | 1 | 0% | 4,678 | 4,525 | -3% | 0 | 0 | — |
case-25 | pass→pass | 11,876 | 5,800 | -51% | 1 | 1 | 0% | 2,316 | 2,701 | +17% | 0 | 0 | — |
case-26 | pass→pass | 17,069 | 11,933 | -30% | 1 | 1 | 0% | 3,465 | 4,024 | +16% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 26 cases were attempted. The headline lift of +12 percentage points is the difference between those two pass rates over the 26 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.