boy-scout-rule

Guide incremental code improvements by removing dead code and fixing linting issues.

1|Updated Jun 18, 2025
One-click install
npx skills add https://github.com/knopki/dotfiles --skill boy-scout-rule-knopki
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: boy-scout-rule
Source: https://github.com/knopki/dotfiles/tree/main/home/private_dot_config/opencode/skills/boy-scout-rule
Command: npx skills add https://github.com/knopki/dotfiles --skill boy-scout-rule-knopki

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers maintain code quality by encouraging incremental improvements during development, ensuring that code is left in a better state than it was found.

Core Features & Use Cases

  • Code Quality Improvement: Automatically identifies and suggests fixes for common code quality issues like dead code, linting errors, poor naming, and outdated comments.
  • Refactoring Assistance: Guides developers to make small, focused improvements without undertaking large, risky refactors.
  • Use Case: When fixing a bug or adding a small feature, use this Skill to ensure you also clean up any technical debt in the touched files, such as removing unused variables or improving the clarity of a function name.

Quick Start

Apply the boy scout rule to the code you are currently working on.

Frequently Asked Questions about boy-scout-rule

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

FAQPage Schema
How do I reduce technical debt while fixing bugs in existing code?

To reduce technical debt while fixing bugs, apply incremental refactoring to make small, focused improvements like removing dead code and fixing linting errors in the modified files. This ensures code is left cleaner than found.

What is the Boy Scout Rule for code maintenance?

The Boy Scout Rule for code maintenance is a development practice guiding developers to leave code cleaner than they found it. It facilitates proactive code quality improvement through small, incremental refactoring during regular development.

How do I identify code quality issues like dead code and poor naming for refactoring?

You identify code quality issues by analyzing modified files for dead code, linting errors, poor naming conventions, missing type annotations, and complex logic. This allows you to target specific technical debt for incremental simplification.

Can I do small refactoring improvements without undertaking large risky code changes?

Yes, you can execute small, focused refactoring improvements without large risky changes by targeting only the files you are currently modifying. This minimizes risk while continuously improving codebase maintainability and reducing technical debt.

What's the best way to clean up code maintenance issues during feature development?

The best way to clean up code maintenance issues during feature development is making incremental improvements within touched files, such as updating outdated comments, adding type annotations, and simplifying complex logic alongside your primary development tasks.

When should I apply incremental refactoring to address technical debt?

You should apply incremental refactoring to address technical debt whenever you are fixing a bug or adding a small feature. This proactive approach ensures continuous code quality improvement without requiring dedicated refactoring sprints.