Agent skill

Readable Py

by crazyguitar in crazyguitar/pysheeet

Readable Python code rules inspired by The Art of Readable Code.

MITAuto-check passedDevelopment

Install Readable Py

skills CLI
$ npx skills add crazyguitar/pysheeet --skill readable-py -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install crazyguitar/pysheeet readable-py --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/crazyguitar/pysheeet.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/readable-py .claude/skills/readable-py && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
readable-py
GitHub stars
8.2k
Token cost
~2.4k tokens
SKILL.md length
1,120 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Readable Python code rules inspired by The Art of Readable Code.

  • Works in 12 steps: Keep Functions Short and Focused → Flatten Control Flow — No Deep Nesting → Name Things Clearly → …
  • Refactoring Python code
  • SKILL.md covers 1. Keep Functions Short and…, 2. Flatten Control Flow — No…, 3. Name Things Clearly and 4. Make Control Flow Easy to…, plus 15 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Readable Py is an agent skill from crazyguitar/pysheeet. Readable Python code rules inspired by The Art of Readable Code. Use when writing, reviewing, or refactoring Python code. Enforces short functions, flat control flow, clear naming, readable structure, and Pythonic idioms.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Refactoring. It works with Python. The licence is MIT.

When your agent uses it

  • Refactoring Python code
  • Tasks that involve Refactoring

Example prompts

  • “/readable-py”

Requirements

  • Python 3

Workflow steps

12 steps, taken from the step headings in SKILL.md.

  1. Keep Functions Short and Focused
  2. Flatten Control Flow — No Deep Nesting
  3. Name Things Clearly
  4. Make Control Flow Easy to Follow
  5. Break Down Giant Expressions
  6. Extract Unrelated Subproblems
  7. One Task at a Time
  8. Reduce Variable Scope
  9. No Magic Numbers or Strings
  10. Fewer Function Arguments
  11. Consistency
  12. Write Less Code

What it can do on your machine

Read from SKILL.md and the folder at commit 9aa75d1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Readable Py loads about 2.4k tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 1,120 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from crazyguitar/pysheeet at commit 9aa75d1, republished under its MIT licence (© crazyguitar). 1,120 words, ~2,437 tokens.

Download SKILL.mdSave it as .claude/skills/readable-py/SKILL.md (or your agent's skills folder).
name
readable-py
description
Readable Python code rules inspired by The Art of Readable Code. Use when writing, reviewing, or refactoring Python code. Enforces short functions, flat control flow, clear naming, readable structure, and Pythonic idioms.

Readable Python Rules (/readable-py)

Apply these rules when writing, reviewing, or refactoring Python code. Inspired by The Art of Readable Code by Dustin Boswell and Trevor Foucher.

Core principle: Code should be easy to understand. The time it takes someone else (or future you) to understand the code is the ultimate metric.

1. Keep Functions Short and Focused

  • A function should do one thing. If you can describe what it does with "and", split it.
  • Aim for functions that fit on one screen (~15-25 lines). If it's longer, extract sub-tasks.
  • Each function should operate at a single level of abstraction — don't mix high-level logic with low-level details in the same function.

2. Flatten Control Flow — No Deep Nesting

  • Never nest more than 2 levels deep. If you have a loop inside a loop, or an if inside a loop inside an if, extract the inner block into a helper function with a descriptive name.
  • Use early returns / guard clauses to handle edge cases at the top, keeping the main logic flat.
  • Prefer continue or break to skip iterations rather than wrapping the body in a conditional.
  • Replace complex conditionals with well-named helper functions or variables that explain the intent.
# Bad: nested and hard to follow
for user in users:
    if user.is_active:
        for order in user.orders:
            if order.is_pending:
                process(order)

# Good: flat, each function name explains what it does
active_users = get_active_users(users)
for user in active_users:
    process_pending_orders(user.orders)

3. Name Things Clearly

  • Pack information into names. Use specific, concrete words — fetch_page not get, num_retries not n.
  • Avoid generic names like tmp, data, result, val, info, handle — unless the scope is tiny (2-3 lines).
  • Use names that can't be misconstrued. If a range is inclusive, say max_items not limit. If a boolean, use is_, has_, should_, can_ prefixes.
  • Match the name length to the scope. Short names for small scopes, descriptive names for wide scopes.
  • Don't use abbreviations unless they're universally understood (num, max, min, err are fine; svc_mgr_cfg is not).

4. Make Control Flow Easy to Follow

  • Put the changing/interesting value on the left side of comparisons: if length > 10 not if 10 < length.
  • Order if/else blocks: positive case first, simpler case first, or the more interesting case first.
  • Minimize the number of variables the reader has to track. Reduce the mental footprint of each block.
  • Avoid the ternary operator for anything non-trivial — if it's not immediately obvious, use an if/else.

5. Break Down Giant Expressions

  • Use explaining variables to break complex expressions into named pieces.
  • Use summary variables to capture a long expression that's used more than once.
  • Apply De Morgan's laws to simplify negated boolean expressions.
# Bad
if not (age >= 18 and has_id and not is_banned):
    deny()

# Good
is_eligible = age >= 18 and has_id and not is_banned
if not is_eligible:
    deny()

6. Extract Unrelated Subproblems

  • If a block of code is solving a subproblem unrelated to the main goal of the function, extract it.
  • The helper function should be pure and self-contained — it shouldn't need to know about the calling context.
  • This is the single most effective way to improve readability: separate what you're doing from how.

7. One Task at a Time

  • Each section of code should do one task. If a function is doing parsing AND validation AND transformation, split them into separate steps.
  • List the tasks a function does. If there's more than one, reorganize so each task is in its own block or function.

8. Reduce Variable Scope

  • Declare variables close to where they're used. Don't declare at the top of a function if it's only used 30 lines later.
  • Minimize the "live time" of a variable — the fewer lines between its assignment and last use, the easier it is to follow.
  • Prefer write-once variables. Variables that are assigned once and never modified are easier to reason about.
  • Eliminate unnecessary variables. If a variable is used only once and doesn't clarify anything, inline it.

9. No Magic Numbers or Strings

  • Replace magic numbers and strings with named constants: if retries > MAX_RETRIES not if retries > 3.
  • If a value has meaning, give it a name. The name documents the intent.
  • Group related constants together.

10. Fewer Function Arguments

  • Aim for 3 or fewer arguments per function. More than that is a smell.
  • Group related arguments into an object, dataclass, or named tuple.
  • If a function needs many config-like options, pass a single config/options object.
  • Boolean flag arguments are a sign the function does two things — split it instead.
Show full SKILL.md (441 more words)Show less

11. Consistency

  • If the codebase does something one way, do it the same way. Don't mix styles.
  • Consistent naming patterns, consistent structure, consistent error handling.
  • When joining an existing codebase, match the existing conventions even if you'd prefer a different style.
  • Surprise is the enemy of readability — predictable code is readable code.

12. Write Less Code

  • The best code is no code at all. Question whether a feature is truly needed before implementing.
  • Don't over-engineer. Solve the problem at hand, not hypothetical future problems.
  • Remove dead code. Commented-out code is dead code.
  • Use standard libraries before writing custom solutions.

13. Comments: Explain Why, Not What

  • Don't comment what the code does — the code already says that. Comment why it does it.
  • Comment flaws and workarounds: // TODO:, // HACK:, // XXX: with explanation.
  • Comment surprising behavior or non-obvious decisions — things where a reader would ask "why?".
  • Don't comment bad code — rewrite it. If you need a comment to explain what a block does, extract it into a well-named function instead.

14. Design Code to Survive Auto-Formatting

  • Write code that looks good after the auto-formatter runs. If a chained expression or repeated pattern would be broken across 4+ lines by the formatter, extract a helper function instead.
  • Prefer one-line helper calls over long inline chains that the formatter will expand vertically.
  • The formatter is your reader's first impression. Run it before committing — if the result looks ugly, that's a signal to refactor, not to disable the formatter.
python
# Bad: black wraps this into a multi-line mess
result = (
    client.get_session()
    .query(User)
    .filter(User.active == True)
    .options(joinedload(User.orders))
    .order_by(User.created_at.desc())
    .limit(page_size)
    .all()
)

# Good: extract a helper so the call site stays clean
def get_active_users(session, page_size: int) -> list[User]:
    return (
        session.query(User)
        .filter(User.active == True)
        .options(joinedload(User.orders))
        .order_by(User.created_at.desc())
        .limit(page_size)
        .all()
    )

users = get_active_users(client.get_session(), page_size=20)
python
# Bad: dict comprehension with inline chain — black expands to 5+ lines
config = {
    k: settings.get(k, defaults.get(k, fallbacks.get(k, None)))
    for k in required_keys
}

# Good: extract the lookup
def resolve_setting(key, settings, defaults, fallbacks):
    return settings.get(key, defaults.get(key, fallbacks.get(key)))

config = {k: resolve_setting(k, settings, defaults, fallbacks) for k in required_keys}

Python-Specific Rules

15. Prefer Comprehensions — But Keep Them Simple

  • Use list/dict/set comprehensions for simple transforms and filters.
  • If a comprehension needs a nested loop AND a conditional, it's too complex — use a regular loop or extract a helper.
  • Generator expressions for large sequences to avoid materializing the whole list.
python
# Good: simple and readable
names = [user.name for user in users if user.is_active]

# Bad: too much going on
result = [transform(item) for group in data for item in group.items if item.valid and item.type == "A"]

# Good: break it up
valid_items = get_valid_items(data, item_type="A")
result = [transform(item) for item in valid_items]

16. Use Unpacking

  • Tuple unpacking over index access: name, age = get_user() not result[0], result[1].
  • Star unpacking for head/tail: first, *rest = items.
  • Dict unpacking with ** for merging dicts.
  • Unpacking makes the structure of the data explicit in the code.

17. Use enumerate, zip, and Itertools

  • Use enumerate(items) — never track indices manually with i += 1.
  • Use zip(a, b) to iterate in parallel — never index into parallel lists.
  • Use itertools (chain, groupby, islice) before writing manual iteration logic.

18. Use Dataclasses and NamedTuples Over Raw Dicts/Tuples

  • If a dict always has the same keys, it should be a dataclass or NamedTuple.
  • If a function returns more than 2 values, return a dataclass or NamedTuple — not a raw tuple.
  • This gives you names, type hints, and readable attribute access for free.

19. Use pathlib for File Paths

  • Use pathlib.Path instead of os.path.join and string manipulation.
  • Path objects are readable, composable (/ operator), and cross-platform.

© crazyguitar, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/readable-py of crazyguitar/pysheeet.

Open the folder on GitHubat commit 9aa75d1

Compare with similar skills

Readable Py next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Readable Py compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Readable Py this skillcrazyguitar/pysheeet8.2k—~2.4kAutomated safety check: PassMIT
Dignified Python Standardsdocling-project/docling68k—~1.5kAutomated safety check: PassApache-2.0
Nexus MapperHaaaiawd/Nexus-skills1661 repos~2.5kAutomated safety check: NotesNone
Refactor OpCVCUDA/CV-CUDA2.7k—~1.5kAutomated safety check: PassCustom licence
Readable Verilog GeneratorEriemon/verilog-generator308—~5.4kAutomated safety check: PassApache-2.0
Python Designmindfold-ai/Trellis15k—~4kAutomated safety check: PassAGPL-3.0

Similar skills

  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    68k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Nexus Mapper

    Haaaiawd/Nexus-skills

    Generate a persistent .nexus-map/ knowledge base that lets any AI session instantly understand a codebase's architecture, systems, dependencies, and change hotspots.

    166 GitHub starsUsed in 1 repo~2.5k tokens
    DevelopmentAuto-check: notes
  • Refactor Op

    CVCUDA/CV-CUDA

    Find and safely apply per-operator refactoring / redundancy-reduction opportunities in a CV-CUDA operator (near-duplicate Tensor/VarShape kernels, reinvented shared utilities, dead code).

    2.7k GitHub stars~1.5k tokensUpdated 20 days ago
    DevelopmentAuto-check passed
  • Readable Verilog Generator

    Eriemon/verilog-generator

    A skill your agent uses when creating, writing, reviewing, annotating, repairing, refactoring, or validating readable Verilog RTL, including synthesizable Verilog-2001 .v files, existing-RTL…

    308 GitHub stars~5.4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Python Design

    mindfold-ai/Trellis

    Python design patterns for CLI scripts and utilities — type-first development, deep modules, complexity management, and red flags.

    15k GitHub stars~4k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • Coding Agent

    mastra-ai/mastra

    Authoring playbook for building agents that write, edit, review, or refactor code.

    29k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed

More from crazyguitar/pysheeet

  • Py

    crazyguitar/pysheeet

    Comprehensive Python programming reference covering syntax, concurrency, networking, databases, ML/LLM development, and HPC.

    8.2k GitHub stars~886 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Readable Py

What does Readable Py do?

Readable Python code rules inspired by The Art of Readable Code. Readable Py is an agent skill from crazyguitar/pysheeet. Readable Python code rules inspired by The Art of Readable Code.

When should I use Readable Py?

Readable Py fits situations like: refactoring Python code; tasks that involve Refactoring.

How do I install Readable Py in Claude Code?

Run `npx skills add crazyguitar/pysheeet --skill readable-py -a claude-code`. Or copy the skill folder (skills/readable-py in crazyguitar/pysheeet) into .claude/skills/readable-py in your project. Claude Code loads it when a task matches its description.

How do I install Readable Py in Codex?

Run `npx skills add crazyguitar/pysheeet --skill readable-py -a codex`. Or copy the skill folder (skills/readable-py in crazyguitar/pysheeet) into .agents/skills/readable-py in your project. Codex loads it when a task matches its description.

Can I use Readable Py in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add crazyguitar/pysheeet --skill readable-py -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/readable-py, .gemini/skills/readable-py, .github/skills/readable-py and .opencode/skills/readable-py in your project.

What does Readable Py need to run?

SKILL.md names no scripts, command-line tools or credentials: Readable Py is instructions for the agent only. Our summary lists: Python 3.

Does Readable Py access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Readable Py safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Readable Py use?

Readable Py is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Readable Py use?

About 2.4k tokens (SKILL.md is roughly 9.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Readable Py?

Skills that share tags, products or a category with Readable Py: Dignified Python Standards (docling-project/docling, 68k stars), Nexus Mapper (Haaaiawd/Nexus-skills, 166 stars), Refactor Op (CVCUDA/CV-CUDA, 2.7k stars) and Readable Verilog Generator (Eriemon/verilog-generator, 308 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Readable Py?

crazyguitar (a GitHub user) maintains it in crazyguitar/pysheeet, which has 8,162 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 6, 2026.

Source: crazyguitar/pysheeet on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.