Command Palette

Search for a command to run...

Back to skills
skill № 36654

python-best-practices

Write maintainable Python with small functions, explicit boundaries, guard clauses, and readable state flow. Use when refactoring Python services, helpers…

FreeNo executable scripts
HoangNguyen0403by HoangNguyen0403★ 598 GitHub stars

Install python-best-practices in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Python Best Practices

Priority: P1 (HIGH)

Rules

  • Prefer small focused functions over long stateful procedures.
  • Push parsing, formatting, transport, and persistence into separate helpers.
  • Return early on invalid or terminal states.
  • Pass collaborators in; do not hide them behind globals or import-time singletons.
  • Keep naming literal and domain-specific.

Recipe

  1. Split orchestration from transformation.
  2. Extract repeated shape cleanup into one helper.
  3. Keep side effects at edges and pure decisions in the middle.
  4. Use fakes in tests instead of patching deep internal chains when possible.

Anti-Patterns

  • No god functions: break report builders and workflow loops into tested slices.
  • No boolean soup: name decision helpers instead of stacking flags inline.
  • No hidden retries: surface retry policy near the call site.
  • No print-debugging in shared runtime code: use structured logging or test assertions.

References

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

  • evals/evals.json

FAQ

What does the python-best-practices skill do?

Write maintainable Python with small functions, explicit boundaries, guard clauses, and readable state flow. Use when refactoring Python services, helpers, modules, or async logic for clarity—not generic test writing, tooling setup, or database transaction implementation.

How do I install the python-best-practices skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the python-best-practices skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare python-best-practices with