Skip to content
Back to skills

Python Expert Best Practices Code Review

ASecurity

Python best practices for writing production-grade code. This skill should be used when writing, reviewing, or refactoring Python code. Triggers on tasks involving Python development, error handling patterns, dictionary operations, and code quality improvements.

  • 8 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added February 11, 2026
code-qualitypythongodebuggingrefactoringcode-reviewapi

Works with

  • api

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add wispbit-ai/skills --skill python-expert-best-practices-code-review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Expert Best Practices Code Review?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python Expert Best Practices Code Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/wispbit-ai-python-expert-best-practices-code-review/badge)](https://www.skillsdirectory.com/skills/wispbit-ai-python-expert-best-practices-code-review)

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

Download with Pro
SKILL.md
---
name: python-expert-best-practices-code-review
description: Python best practices for writing production-grade code. This skill should be used when writing, reviewing, or refactoring Python code. Triggers on tasks involving Python development, error handling patterns, dictionary operations, and code quality improvements.
license: MIT
metadata:
  author: wispbit
  version: "1.0.0"
---

# Python 3.14+ Expert Best Practices

Simple, pragmatic, opinionated. Only what matters for writing production-grade python code.

## When to Apply

Reference these guidelines when:
- Writing Python functions, classes, or modules
- Reviewing Python code for error handling issues
- Refactoring existing Python codebases
- Implementing data validation and API boundaries
- Optimizing error detection and debugging patterns

## Rule Categories by Priority

| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Error Handling | CRITICAL | `dict-`, `operators-` |
| 2 | Common Bugs | CRITICAL-HIGH | `no-mutable-`, `no-generic-` |
| 3 | Code Clarity | HIGH-MEDIUM | `listcomp-`, `no-inline-` |
| 4 | Code Style | LOW | `avoid-`, `unnecessary-` |

## Quick Reference

- `dict-required-keys` - Use `d[key]` for required dictionary keys to fail fast with KeyError
- `no-mutable-defaults` - No mutable defaults in function/method parameters
- `operators-return-notimplemented` - Return NotImplemented for unsupported operand types and design + vs += intentionally
- `no-generic-except` - Avoid generic except clauses to prevent hiding unexpected errors
- `listcomp-no-side-effects` - List comprehensions must produce a value you use (no side-effect listcomps)
- `no-inline-imports` - Place all import statements at the top of the file
- `avoid-explanatory-comments` - Avoid unnecessary comments for self-documenting code
- `unnecessary-else-blocks` - Avoid unnecessary else blocks after return/break/continue statements

## How to Use

Read individual rule files for detailed explanations and code examples:

```
rules/dict-required-keys.md
rules/no-mutable-defaults.md
rules/operators-return-notimplemented.md
rules/no-generic-except.md
rules/listcomp-no-side-effects.md
rules/no-inline-imports.md
rules/avoid-explanatory-comments.md
rules/unnecessary-else-blocks.md
```

Each rule file contains:
- Brief explanation of why it matters
- When to use and when not to use the pattern
- Implementation requirements
- Incorrect code example with explanation
- Correct code example with explanation
- Additional context and references

Files in this skill

  • SKILL.md2.5 KB
  • rules/avoid-explanatory-comments.md579 B
  • rules/dict-required-keys.md3.4 KB
  • rules/listcomp-no-side-effects.md2.5 KB
  • rules/no-generic-except.md646 B
  • rules/no-inline-imports.md969 B
  • rules/no-mutable-defaults.md2.1 KB
  • rules/operators-return-notimplemented.md2.7 KB
  • rules/unnecessary-else-blocks.md935 B

Attribution

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

Loading comments…