clean-names
Skill193 starsChanged 7 months agoMITView on GitHub
Use when naming, renaming, or fixing names of variables, functions, classes, interfaces, or modules in TypeScript. Enforces Clean Code principles—descriptive names, appropriate length, no encodings.
2 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
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- phanijapps/memex★ 041% same
- ramybarsoum/claude-skills★ 041% same
Wrote their own version · 0
None found.
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
- boy-scoutSkill
- clean-commentsSkill
- clean-functionsSkill
- clean-generalSkill
- clean-testsSkill
- typescript-clean-codeSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Don't pick names that communicate implementation.
- Distinctive: line 50
Use terms from the domain, design patterns, or well-known conventions.
- Distinctive: line 99
Don't encode type or scope information into names.
- Distinctive: line 125
If a function does something beyond what its name suggests, the name is misleading.
≈ “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
Clean Names
N1: Choose Descriptive Names
Names should reveal intent. If a name requires a comment, it doesn't reveal its intent.
// Bad - what is d?
const d = 86400;
// Good - obvious meaning
const SECONDS_PER_DAY = 86400;
// Bad - what does this function do?
function proc(values: number[]) {
return values.filter((value) => value > 0);
}
// Good - intent is clear
function filterPositiveNumbers(numbers: number[]) {
return numbers.filter((number) => number > 0);
}N2: Choose Names at the Appropriate Level of Abstraction
Don't pick names that communicate implementation; choose names that reflect the level of abstraction of the class or function.
// Bad - too implementation-specific
function getMapOfUserIdsToNames() {
// ...
}
// Good - abstracts the data structure
function getUserDirectory() {
// ...
}N3: Use Standard Nomenclature Where Possible
Use terms from the domain, design patterns, or well-known conventions.
// Good - uses pattern name
class UserFactory {
create(data: unknown) {
// ...
}
}
// Good - uses domain term
function calculateAmortization(principal: number, rate: number, term: number) {
// ...
}N4: Unambiguous Names
Choose names that make the workings of a function or variable unambiguous.
// Bad - ambiguous
function rename(source: string, target: string) {
// ...
}
// Good - clear what's being renamed
function renameFile(oldPath: string, newPath: string) {
// ...
}N5: Use Longer Names for Longer Scopes
Short names are fine for tiny scopes. Longer scopes need longer, more descriptive names.
// Good - short name for tiny scope
const total = numbers.reduce((sum, n) => sum + n, 0);
// Good - longer name for module-level constant
const MAX_RETRY_ATTEMPTS_BEFORE_FAILURE = 5;
// Bad - short name at module level
const MAX = 5;N6: Avoid Encodings
Don't encode type or scope information into names. Modern editors make this unnecessary.
// Bad - Hungarian notation
const strName = "Alice";
const arrUsers: string[] = [];
const nCount = 0;
// Good - clean names
const name = "Alice";
const users: string[] = [];
const count = 0;
// Bad - interface prefix
interface IUserRepository {
findById(id: string): Promise<unknown>;
}
// Good - just name it
interface UserRepository {
findById(id: string): Promise<unknown>;
}N7: Names Should Describe Side Effects
If a function does something beyond what its name suggests, the name is misleading.
const configStore = new Map<string, string>();
// Bad - name doesn't mention file creation
function getConfig(configPath: string) {
if (!configStore.has(configPath)) {
configStore.set(configPath, "{}"); // Hidden side effect!
}
return JSON.parse(configStore.get(configPath) ?? "{}");
}
// Good - name reveals behavior
function getOrCreateConfig(configPath: string) {
if (!configStore.has(configPath)) {
configStore.set(configPath, "{}");
}
return JSON.parse(configStore.get(configPath) ?? "{}");
}Quick Reference
| Rule | Principle | Example |
| N1 | Descriptive names | SECONDS_PER_DAY not d |
| N2 | Right abstraction level | getUserDirectory() not getMapOf... |
| N3 | Standard nomenclature | UserFactory, calculateAmortization |
| N4 | Unambiguous | renameFile(oldPath, newPath) |
| N5 | Length matches scope | Short for loops, long for globals |
| N6 | No encodings | users not arrUsers |
| N7 | Describe side effects | getOrCreateConfig() |
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.

