Skip to content
Back to skills

Coding Standard Python

ASecurity

Enforce Python PEP 8 coding standards including snake_case variables, PascalCase classes, and snake_case filenames.

  • 27 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
developmentpythonapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add jdubray/puffin --skill coding-standard-python --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Coding Standard Python?

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

Security grade badge for Coding Standard Python
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jdubray-coding-standard-python/badge)](https://www.skillsdirectory.com/skills/jdubray-coding-standard-python)

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: coding-standard-python
description: Enforce Python PEP 8 coding standards including snake_case variables, PascalCase classes, and snake_case filenames.
---

# Python Coding Standards (PEP 8)

When reviewing or generating Python code, follow these rules:

## File Naming
- **Source files:** Use snake_case (e.g., `user_service.py`, `api_client.py`)
- **Package directories:** Use snake_case (e.g., `data_processing/`, `utils/`)
- **Test files:** Use `test_` prefix (e.g., `test_user_service.py`)
- **Config files:** Use snake_case (e.g., `config_settings.py`)

## Variable Naming
- **Variables:** snake_case (e.g., `user_name`, `is_active`, `total_count`)
- **Constants:** UPPER_SNAKE_CASE (e.g., `MAX_RETRIES`, `API_BASE_URL`)
- **Boolean variables:** Prefix with `is_`, `has_`, `can_`, `should_` (e.g., `is_loading`, `has_error`)
- **Protected variables:** Single underscore prefix (e.g., `_internal_data`)
- **Private variables:** Double underscore prefix (e.g., `__private_data`)

## Function Naming
- **Functions:** snake_case (e.g., `calculate_total()`, `fetch_user_data()`)
- **Private functions:** Prefix with underscore (e.g., `_validate_input()`, `_process_data()`)
- **Dunder methods:** Double underscores (e.g., `__init__`, `__str__`, `__repr__`)

## Class Naming
- **Classes:** PascalCase (e.g., `UserService`, `DataProcessor`, `ApiClient`)
- **Exception classes:** PascalCase with `Error` or `Exception` suffix (e.g., `ValidationError`)
- **Abstract classes:** PascalCase, optionally prefix with `Base` or `Abstract` (e.g., `BaseHandler`)

## Method Naming
- **Instance methods:** snake_case (e.g., `get_user()`, `process_data()`)
- **Class methods:** snake_case with `@classmethod` decorator
- **Static methods:** snake_case with `@staticmethod` decorator
- **Properties:** snake_case with `@property` decorator

## Module Organization
- Imports at the top: standard library, third-party, local imports (separated by blank lines)
- Module-level dunder names after imports (`__all__`, `__version__`)
- One class per file for large classes; multiple related classes okay for small ones
- Use `__all__` to define public API

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.