boy-scout-rule

Improve code quality while editing files without changing behavior.

187|20|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/TheBushidoCollective/han --skill boy-scout-rule
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: boy-scout-rule
Source: https://github.com/TheBushidoCollective/han/tree/main/core/skills/boy-scout-rule
Command: npx skills add https://github.com/TheBushidoCollective/han --skill boy-scout-rule

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill promotes making small, focused improvements whenever you touch code to keep the codebase healthier over time.

Core Features & Use Cases

  • Focused Improvements: Remove dead code, fix small lint issues, rename poorly named variables, and add missing types.
  • Non-Disruptive: Avoid large rewrites, avoid changing behavior without tests.
  • Documentation in Commit: Record Boy Scout improvements in the commit message.

Quick Start

While editing, scan for a single minor improvement (e.g., rename a variable), implement it, run tests, and commit with a note about the improvement.

Frequently Asked Questions about boy-scout-rule

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve code quality while editing existing files without major rewrites?

The Boy Scout Rule guides making small, focused improvements whenever you touch code—removing dead code, fixing lint issues, renaming variables, and adding type annotations. Apply one minor improvement per edit, run tests to preserve behavior, then document the change in your commit message.

What counts as a small, focused code improvement?

Small improvements include fixing lint violations, renaming poorly named variables, adding missing type annotations, extracting magic numbers into constants, removing unused imports, simplifying complex logic, and updating outdated comments. Each improvement should be narrow enough to review and test independently.

How do I ensure my code cleanup doesn't break functionality?

Run your full test and lint suites after each improvement to verify behavior is preserved. The Boy Scout Rule requires passing all tests before committing, ensuring cleanup changes don't introduce regressions or side effects.

When should I avoid large refactoring and stick to small changes?

Large rewrites risk introducing bugs and are harder to review. The Boy Scout Rule prioritizes small, maintainable enhancements that keep the codebase incrementally healthier. Save comprehensive refactors for dedicated tasks with explicit test coverage.

How do I document code improvements in my commits?

Record each Boy Scout improvement in your commit message to track why cleanup was applied. This creates a history of incremental quality gains and helps teammates understand the rationale behind minor changes during code review.