Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Py Clean Names

ASecurity

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. Also trigger on: single-letter or cryptic identifiers (`d`, `x`, `proc`), Hungarian notation (`str_name`, `lst_users`, `i_count`), `I`-prefixed classes, function names that hide side effects (e.g. `get_config` that also writes a file), non-standard abbreviations, or asks like "rename this", "what does this variab...

2 stars
0 votes
0 copies
1 views
Added 9/19/2026
developmentpythongo

Security Analysis

A100/100

Scanned 9/19/2026

$npx -y skills add CasLubbers/code-design-skills --skill py-clean-names --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Py Clean Names?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Py Clean Names
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/caslubbers-py-clean-names/badge)](https://www.skillsdirectory.com/skills/caslubbers-py-clean-names)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: py-clean-names
description: 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. Also trigger on: single-letter or cryptic identifiers (`d`, `x`, `proc`), Hungarian notation (`str_name`, `lst_users`, `i_count`), `I`-prefixed classes, function names that hide side effects (e.g. `get_config` that also writes a file), non-standard abbreviations, or asks like "rename this", "what does this variable mean", "clearer name".
---

# 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 for tiny scope
total = sum(x for x in numbers)

# Good - longer name for module-level constant
MAX_RETRY_ATTEMPTS_BEFORE_FAILURE = 5

# Bad - short name at module level
MAX = 5
```

## N6: Avoid Encodings

Don't encode type or scope information into names. Modern editors make this unnecessary.

```python
# Bad - Hungarian notation
str_name = "Alice"
lst_users = []
i_count = 0

# Good - clean names
name = "Alice"
users = []
count = 0

# Bad - interface prefix
class IUserRepository:
    ...

# Good - just name it
class UserRepository:
    ...
```

## N7: Names Should Describe Side Effects

If a function does something beyond what its name suggests, the name is misleading.

```python
# Bad - name doesn't mention file creation
def get_config():
    if not config_path.exists():
        config_path.write_text("{}")  # Hidden side effect!
    return json.loads(config_path.read_text())

# Good - name reveals behavior
def get_or_create_config():
    if not config_path.exists():
        config_path.write_text("{}")
    return json.loads(config_path.read_text())
```

## Quick Reference

| Rule | Principle | Example |
|------|-----------|---------|
| N1 | Descriptive names | `SECONDS_PER_DAY` not `d` |
| N2 | Right abstraction level | `get_user_directory()` not `get_dict_of_...` |
| N3 | Standard nomenclature | `UserFactory`, `calculate_amortization` |
| N4 | Unambiguous | `rename_file(old_path, new_path)` |
| N5 | Length matches scope | Short for loops, long for globals |
| N6 | No encodings | `users` not `lst_users` |
| N7 | Describe side effects | `get_or_create_config()` |

Attribution

CasLubbersCasLubbers
View sourceSee grades on GitHubMore from CasLubbers →
SSkills Directory ProSkills Directory

Get any skill into Claude in one click.

Download any skill as a ZIP for Claude.ai, Claude Desktop, or .claude/skills. $9/mo.

See Pro

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills Directory ProSkills Directory

Get any skill into Claude in one click.

Download any skill as a ZIP for Claude.ai, Claude Desktop, or .claude/skills. $9/mo.

See Pro

Related Skills

Clean Code

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

304955 votes

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

285172 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

10311 votes
View all in development →