convention-boy-scout-rule

Add docstrings and type hints to nearby code during bug fixes.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/sunLeee/optimization --skill convention-boy-scout-rule
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convention-boy-scout-rule
Source: https://github.com/sunLeee/optimization/tree/main/.claude/skills/reference/philosophy/design/boy-scout
Command: npx skills add https://github.com/sunLeee/optimization --skill convention-boy-scout-rule

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Boy Scout Rule encourages making small, surgical improvements to code during edits, leaving the codebase in a better state than before.

Core Features & Use Cases

  • Small, safe changes alongside bug fixes
  • Add missing docstrings and type hints in nearby functions
  • Avoid large-scale refactors; focus on local improvements that preserve behavior

Quick Start

When you fix a bug, look for a nearby improvement you can safely apply and implement it in the same change.

Frequently Asked Questions about convention-boy-scout-rule

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

FAQPage Schema
How do I improve code quality during routine maintenance without large rewrites?

Improve code quality during routine maintenance by applying the Boy Scout Rule: make small, safe, surgical changes alongside bug fixes to leave the codebase cleaner without large-scale refactors.

What is the Boy Scout Rule in software engineering?

The Boy Scout Rule in software engineering is a practice of making small, localized improvements to nearby code during routine edits, ensuring you leave the code in a better state than you found it.

How do I add docstrings and type hints safely during a bug fix?

Add docstrings and type hints safely during a bug fix by keeping changes localized to nearby functions, ensuring these small readability improvements preserve the existing behavior of the code.

Can I make surgical code changes during code reviews without altering behavior?

Yes, you can make surgical code changes during code reviews by focusing on local improvements like adding missing docstrings and type hints, which safely enhance readability without altering behavior.

When should I avoid making refactoring changes during a bug fix?

Avoid refactoring changes during a bug fix if the improvement requires large-scale rewrites or risks altering existing behavior; the Boy Scout Rule emphasizes keeping changes small, safe, and localized.