swab
Find and apply one small, safe code cleanup improvement with user approval (Boy Scout Rule)
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Find and apply one small, safe code cleanup improvement with user approval (Boy Scout Rule)
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Analyze repos in a workspace — generate compressed codebase indexes (AGENTS.md), per-repo docs, cross-repo dependency map, and master TOC for AI agent consumption
Explain a code element, file, or line range with diagrams and architectural context
Analyze an MCP server's GitHub repository for security risks, malicious intent, and code quality. Produces a trust rating and recommends whether to use it or suggests safer alternatives.
Conduct systematic multi-phase research on a topic and produce a documented findings report
Show a comprehensive project status report with git state, active specs, and suggested next actions
| name | swab |
| mode | agent |
| description | Find and apply one small, safe code cleanup improvement with user approval (Boy Scout Rule) |
| argument-hint |
A deck-cleaning skill that makes one small, focused improvement to the codebase, following the "Boy Scout Rule" — leave the code cleaner than you found it. Identifies the single best small cleanup opportunity and applies it with your approval.
Use TodoWrite to track the swab process:
- Scan codebase for improvement opportunities [in_progress]
- Prioritize and select best cleanup option [pending]
- Present cleanup suggestion to user [pending]
- Apply approved change [pending]
Scan for improvement opportunities:
Grep to search for common code smells across source filesBash to explore project structure and identify main source directoriesGlob to locate specific file types if neededTarget Areas:
d, temp, data, single letters)Update TodoWrite: mark "Scan codebase" as completed.
Update TodoWrite: mark "Prioritize and select best cleanup option" as in_progress.
Selection Criteria:
Priority Order:
Use Read to load the target file and verify the exact text to replace.
Update TodoWrite: mark "Prioritize and select best cleanup option" as completed.
Update TodoWrite: mark "Present cleanup suggestion to user" as in_progress.
Display Format:
🧽 Swabbing the deck... found some mess in {filename}
=== SUGGESTED CLEANUP ===
- {before_code}
+ {after_code}
Reason: {clear_explanation}
Risk: {Low|Medium}
Clean this up? [y/N]
Important: Present ONLY ONE option. Never show multiple options (causes decision paralysis). Save other opportunities for future runs.
Update TodoWrite: mark "Present cleanup suggestion to user" as completed.
Update TodoWrite: mark "Apply approved change" as in_progress.
If approved:
EditRead to verify the change was applied correctlyTodoWriteIf declined:
File Discovery:
Grep to find code patterns and smells across all source filesBash to explore project structure: find . -name "*.js" -not -path "*/node_modules/*" | head -20Glob to locate specific file types if neededCommon Grep Patterns:
# Single-letter variables
grep -rn " [a-z] = " src/ --include="*.{js,ts,py}"
# Magic numbers
grep -rn "[^a-zA-Z0-9_][0-9]\{3,\}[^0-9]" src/ --include="*.{js,ts,py}"
# Commented-out code
grep -rn "^[[:space:]]*//" src/ --include="*.{js,ts}" | head -10
No opportunities found:
🧽 Deck inspection complete.
No obvious cleanup opportunities found in the scanned files.
Your codebase looks pretty tidy already! ✨
Run again later as the code evolves, or try focusing on a specific directory.
Change application failure:
❌ Swab attempt failed.
The suggested change couldn't be applied safely.
This might happen if the file was modified since scanning.
Try running the command again.
This skill integrates with the Code Captain ecosystem by:
TodoWrite for visibility into skill progress