From boy-scout
This skill should be used proactively—without waiting for the user to ask—whenever Claude notices a refactoring opportunity, code smell, or improvement while working on any task. Trigger on observations like "this function is getting long", "this logic appears to be duplicated elsewhere", "this variable name doesn't reveal its intent", "there's no test for this module", or "this abstraction is doing too much". The skill records the opportunity silently without interrupting the current task, so Claude can stay focused while nothing goes unnoticed.
How this skill is triggered — by the user, by Claude, or both
Slash command
/boy-scout:record-opportunityThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Apply the Boy Scout Rule — *leave every piece of code a little better than you found it* —
Apply the Boy Scout Rule — leave every piece of code a little better than you found it — without derailing the current task. When Claude notices an improvement opportunity during normal work (editing, reviewing, implementing), record it immediately so it can be addressed in a dedicated Boy Scout session later.
This skill complements the passive hook-based detection: hooks catch structural issues via static analysis; this skill captures the semantic opportunities that only contextual understanding reveals.
Record an opportunity whenever noticing any of the following while doing other work:
Do not stop the current task to fix the issue. Record and continue.
Run the record.py script via Bash, filling in the appropriate arguments:
python3 "$CLAUDE_PLUGIN_ROOT/skills/record-opportunity/record.py" \
--type <type> \
--file <relative/path/to/file.rs> \
--description "<intent-revealing description>" \
--severity <low|medium|high> \
[--lines <start>-<end>] \
[--context "<suggested approach>"]
| Argument | Required | Values | Notes |
|---|---|---|---|
--type | ✅ | duplication, function_size, naming, test_coverage, custom | Pick the closest category |
--file | ✅ | string | Relative to project root |
--description | ✅ | string | Explain what the issue is and why it matters |
--severity | ✅ | low, medium, high | See severity guide below |
--lines | optional | 42 or 42-58 | Omit for file-level issues |
--context | optional | string | Suggest an approach or name a pattern |
| Severity | Use when… |
|---|---|
high | The issue actively hinders understanding or is likely to cause bugs |
medium | The issue adds friction; addressing it would clearly improve the code |
low | Minor polish — nice to have but not urgent |
Duplicated parsing logic:
python3 "$CLAUDE_PLUGIN_ROOT/skills/record-opportunity/record.py" \
--type duplication \
--file src/routes/auth.rs \
--lines 88-104 \
--description "JSON body parsing logic duplicated from src/routes/users.rs:45-61" \
--severity medium \
--context "Extract to a shared parse_json_body<T>() helper in src/util/http.rs"
Function doing too much:
python3 "$CLAUDE_PLUGIN_ROOT/skills/record-opportunity/record.py" \
--type function_size \
--file src/compiler/lower.elm \
--lines 200-280 \
--description "lowerExpr handles literals, lambdas, and let-bindings in a single 80-line match" \
--severity medium \
--context "Split into lowerLiteral, lowerLambda, lowerLet following the existing pattern"
Misleading name:
python3 "$CLAUDE_PLUGIN_ROOT/skills/record-opportunity/record.py" \
--type naming \
--file src/pipeline/process.ts \
--lines 34 \
--description "Variable 'data' holds a validated UserProfile, not raw data — rename to userProfile" \
--severity low
Missing tests:
python3 "$CLAUDE_PLUGIN_ROOT/skills/record-opportunity/record.py" \
--type test_coverage \
--file src/billing/invoice.py \
--description "Invoice.apply_discount() has no tests; edge cases around negative discounts are untested" \
--severity high
On success, the script prints a confirmation JSON and exits 0:
{
"id": "a3f9c12e",
"position": 4,
"message": "Recorded opportunity #4: [duplication] src/routes/auth.rs — ..."
}
The opportunity is appended to .claude/boy-scout-todos.jsonl in the project's
.claude/ directory. It will appear in the Boy Scout session summary at the
end of the current Claude session.
After running the script, add a brief inline note in the current response — one line, no interruption to the main flow:
(Boy Scout: noted duplication in
src/routes/auth.rs:88-104for later.)
Then continue with the original task.
.claude/boy-scout-todos.jsonl (avoid duplicates)npx claudepluginhub xpepper/boy-scoutImproves code approach, clarity, and quality with concrete before/after suggestions and tradeoffs. Use when code works but needs a focused second pass.
Audits a codebase as a senior advisor and produces prioritized, self-contained implementation plans for other models/agents to execute. Read-only — never implements or fixes code itself.
Provides structured workflow packs for 7 common Claude Code tasks: codebase exploration, bug fixing, safe refactoring, TDD, repo review before merge, CLAUDE.md generation, and migration planning.