boy-scout
Skill193 starsChanged 7 months agoMITView on GitHub
Use when fixing, editing, changing, debugging, or working with any TypeScript code. Applies the Boy Scout Rule—always leave code cleaner than you found it. Orchestrates other clean code skills as needed.
3 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- phanijapps/memexedited, first seen Oct 17, 2026
- ramybarsoum/claude-skillsedited, first seen Oct 13, 2026
- rolandtolnay/llm-toolkittheir own version, first seen Oct 11, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- phanijapps/memex★ 079% same
- ramybarsoum/claude-skills★ 078% same
Wrote their own version · 1
- rolandtolnay/llm-toolkit★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- boy-scoutSkill
- clean-commentsSkill
- clean-functionsSkill
- clean-generalSkill
- clean-namesSkill
- clean-testsSkill
- python-clean-codeSkill
- clean-commentsSkill
- clean-functionsSkill
- clean-generalSkill
- clean-namesSkill
- clean-testsSkill
- typescript-clean-codeSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
If we all followed this simple rule:
- Distinctive: line 27
Every time you touch code, look for at least one small improvement:
- Very specific: line 31
Delete a redundant comment -> triggers clean-comments
- Distinctive: line 32
Remove dead code or unused imports
- Very specific: line 38
Remove duplication (DRY) -> triggers clean-general
- Distinctive: line 39
Add missing boundary checks
- Distinctive: line 98
Leave code worse than you found it
- Distinctive: line 100
Wait for a dedicated refactoring sprint
- Distinctive: line 106
Keep changes proportional to your task
- Distinctive: line 107
Leave a trail of quality improvements
- Distinctive: line 111
When working on code:
- Distinctive: line 124
Every piece of code you touch gets a little better.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
The Boy Scout Rule
"Always leave the campground cleaner than you found it." — Robert Baden-Powell
"Always check a module in cleaner than when you checked it out." — Robert C. Martin, Clean Code
The Philosophy
You don't have to make every module perfect. You simply have to make it a little bit better than when you found it.
If we all followed this simple rule:
- Our systems would gradually get better as they evolved
- Teams would care for the system as a whole
- The relentless deterioration of software would end
When Working on Code
Every time you touch code, look for at least one small improvement:
Quick Wins (Do These Immediately)
- Rename a poorly named variable -> triggers
clean-names - Delete a redundant comment -> triggers
clean-comments - Remove dead code or unused imports
- Replace a magic number with a named constant
- Extract a deeply nested block into a well-named function
Deeper Improvements (When Time Allows)
- Split a function that does multiple things -> triggers
clean-functions - Remove duplication (DRY) -> triggers
clean-general - Add missing boundary checks
- Improve test coverage -> triggers
clean-tests
The Rule in Practice
// You're asked to fix a bug in this function:
function proc(d: number[], x: number[], flag = false): number[] {
// process data
for (const i of d) {
if (i > 0) {
if (flag) {
x.push(i * 1.0825); // tax
} else {
x.push(i);
}
}
}
return x;
}
// Don't just fix the bug and leave.
// Leave it cleaner:
const TAX_RATE = 0.0825;
/** Filter positive values, optionally applying tax. */
function processPositiveValues(
values: readonly number[],
applyTax = false
): number[] {
const rate = applyTax ? 1 + TAX_RATE : 1;
return values.filter((v) => v > 0).map((v) => v * rate);
}What changed:
- ✅ Descriptive function name
- ✅ Clear parameter names
- ✅ Explicit TypeScript types
- ✅ Named constant for magic number
- ✅ No output argument mutation
- ✅ Useful inline documentation
Skill Orchestration
This skill coordinates with specialized skills based on what you're doing:
| Task | Trigger Skill |
| Writing/reviewing any TypeScript | typescript-clean-code (master) |
| Naming variables, functions, classes | clean-names |
| Writing or editing comments | clean-comments |
| Creating or refactoring functions | clean-functions |
| Reviewing code quality | clean-general |
| Writing or reviewing tests | clean-tests |
The Mindset
Don't:
- Leave code worse than you found it
- Say "that's not my code"
- Wait for a dedicated refactoring sprint
- Make massive changes unrelated to your task
Do:
- Make one small improvement with every commit
- Fix what you see, even if you didn't break it
- Keep changes proportional to your task
- Leave a trail of quality improvements
AI Behavior
When working on code:
- Complete the requested task first
- Identify at least one small cleanup opportunity
- Apply the appropriate specialized skill
- Note the improvement made (e.g., "Also cleaned up: renamed
xtoresultsfor clarity")
When reviewing code:
- Load
typescript-clean-codefor comprehensive rule checking - Flag violations by rule number
- Suggest incremental improvements, not complete rewrites
The Boy Scout Promise
Every piece of code you touch gets a little better. Not perfect-just better.
Over time, better compounds into excellent.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

