← ClaudeAtlas

clean-nameslisted

Use when naming, renaming, or fixing names of variables, functions, classes, or modules in Python. Enforces Clean Code principles—descriptive names, appropriate length, no encodings.
phanijapps/memex · ★ 0 · AI & Automation · score 75
Install: claude install-skill phanijapps/memex
# Clean Names ## N1: Choose Descriptive Names Names should reveal intent. If a name requires a comment, it doesn't reveal its intent. ```python # Bad - what is d? d = 86400 # Good - obvious meaning SECONDS_PER_DAY = 86400 # Bad - what does this function do? def proc(lst): return [x for x in lst if x > 0] # Good - intent is clear def filter_positive_numbers(numbers): return [n for n in numbers if n > 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. ```python # Bad - too implementation-specific def get_dict_of_user_ids_to_names(): ... # Good - abstracts the data structure def get_user_directory(): ... ``` ## N3: Use Standard Nomenclature Where Possible Use terms from the domain, design patterns, or well-known conventions. ```python # Good - uses pattern name class UserFactory: def create(self, data): ... # Good - uses domain term def calculate_amortization(principal, rate, term): ... ``` ## N4: Unambiguous Names Choose names that make the workings of a function or variable unambiguous. ```python # Bad - ambiguous def rename(old, new): ... # Good - clear what's being renamed def rename_file(old_path: Path, new_path: Path): ... ``` ## N5: Use Longer Names for Longer Scopes Short names are fine for tiny scopes. Longer scopes need longer, more descriptive names. ```python # Good - short name