Skip to content
Agentmart
Submit a tool

python-pep8

Detailed PEP 8 guide for Python code — layout, imports, names, whitespace, comments, programming recommendations (None comparisons, exceptions, return…

Skill by wachawo

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/wachawo-python-pep8

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Detailed PEP 8 guide for Python code — layout, imports, names, whitespace, comments, programming recommendations (None comparisons, exceptions, return, strings). Use when reviewing or fixing the style of a Python file, mentioning "PEP 8", "code style", or wanting to bring code into line with the canon.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/python-pep8

What's inside

Skill name
python-pep8
Description
Detailed PEP 8 guide for Python code — layout, imports, names, whitespace, comments, programming recommendations (None comparisons, exceptions, return, strings). Use when reviewing or fixing the style of a Python file, mentioning "PEP 8", "code style", or wanting to bring code into line with the canon.
License
MIT
Instructions
443 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# PEP 8 for Python

A summary of [PEP 8](https://peps.python.org/pep-0008/) with practical do/don't examples. Ruff/black handle formatting automatically — this guide is about the *semantic* decisions auto-formatters do not make.

## 1. Code layout

### Indentation

4 spaces per level. No tabs in new code.

```python
# OK
def f(
        a, b, c,
        d):
    print(a)

# OK (vertical alignment)
result = some_fn(arg1, arg2,
                 arg3, arg4)
```

### Line length

- Code: **79** characters (PEP 8) or **88** (black/ruff default — recommended).
- Docstrings/comments: **72**.

```python
# Bad (too long)
result = some_very_long_function_name_that_exceeds_the_character_limit(a, b, c)

# Good
result = some_very_long_function_name_that_exceeds_the_character_limit(
    a, b, c,
)
```

### Blank lines

- **Two** blank lines between top-level functions/classes.
- **One** between methods of a class.
- Blank lines inside a function — sparingly, for logical blocks.

```python
class A:
    def m1(self): ...

    def m2(self): ...


def standalone():
    ...
```

### Line breaks at binary operators

Break **before** the operator, not after (mathematical convention, reads more clearly).

```python
# Good
income = (gross_wages
          + taxable_interest
          - ira_deduction)

# Bad
income = (gross_wages +
          taxable_interest -
          ira_deduction)
```

### Encoding

UTF-8 without BOM. No `# -*- coding: utf-8 -*-` in Python 3 (it is already the default).

## 2. Imports

Groups (with a blank line between):
1. Standard library.
2. Third-party packages.
3. Local modules.

```python
import os
import sys
from datetime import datetime

import flask
import peewee

from models import User
from serializers import user_serializer
```

- **One import per line**: `import os` + `import sys`, not `import os, sys`.
- **Absolute imports preferred**: `from myapp.utils import x`, not `from .utils import x` (except in explicit package cases).
- **No** `from x import *`.
- Imports at the top of the file, after the module docstring.

## 3. Naming

| Entity | Style | Example |
|---|---|---|
| Module / package | `snake_case` | `data_processor.py` |
| Class | `PascalCase` | `UserAccount`, `HTTPServer` |
| Exception | `PascalCase` + `Error` | `ValidationError` |
| Function, method | `snake_case` | `calculate_total` |
| Variable | `snake_case` | `user_count` |
| Constant | `UPPER_CASE` | `MAX_CONNECTIONS = 100` |
| Type variable | short `PascalCase` | `T`, `KT`, `VT` |

Special notes:

- `self` for instance methods, `cls` for classmethod. Not `this`, not `obj`.
- Conflict with a keyword: `class_`, `type_` (trailing underscore).
- **One** leading `_` — non-public (by convention, not enforced).
- **Two** leading `__` — name mangling (only meaningful in inheritance).
- **Two** on both sides `__name__` — dunder, do not define your own.

```python

From wachawo/claude-skills, MIT.

More from wachawo/claude-skills

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
May 5, 2026 (5 months ago)
Last release
May 5, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from wachawo

Cite this page

python-pep8 skill. Agent Mart. https://agentmart.dev/skills/wachawo-python-pep8 (last updated 2026-10-24)