python-code-style
Skill2 starsChanged 5 months agoApache-2.0View on GitHub
Enforce consistent Python code style across the project. Covers import ordering, string quoting, naming conventions, docstring format, and recommended linter setup. Use when writing new code, reviewing PRs for style, or configuring a linter.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- owenlamont/skillstheir own version, first seen Oct 20, 2026
- ZRMYDYCG/ClaudeCodetheir own version, first seen Oct 17, 2026
- anton-karlovskiy/deal-hunter-agentstheir own version, first seen Oct 13, 2026
- drzioner/gitwisetheir own version, first seen Jul 22, 2026
- NorkzYT/claude-code-autopilottheir own version, first seen Jun 11, 2026
- gabepublic/api-autonom-test-01their own version, first seen Apr 24, 2026
Used with
Projects with it also use python-error-handling, python-anti-patterns and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
justanestaSkillpython-error-handling
Python error handling and debugging. Use this skill when implementing error handling, designing exception hierarchies, debugging issues, or adding logging. Covers exception patterns, custom exceptions, logging with structlog, debugging tools, and error recovery.
Also in 4 projects that use this
CodeWithBehnamSkillpython-anti-patterns
Common Python anti-patterns to avoid. Use as a checklist when reviewing code, before finalizing implementations, or when debugging issues that might stem from known bad practices.
Also in 3 projects that use this
nilecuiSkillasync-python-patterns
Master Python asyncio, concurrent programming, and async/await patterns for high-performance applications. Use when building async APIs, concurrent systems, or I/O-bound applications requiring non-blocking operations.
Also in 4 projects that use this
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- Aver005/agent-skills★ 2same name
- CodeWithBehnam/cc-docs★ 2same name
- NorkzYT/claude-code-autopilot★ 2same name
- anton-karlovskiy/deal-hunter-agents★ 1same name
- drzioner/gitwise★ 1same name
- owenlamont/skills★ 1same name
- ZRMYDYCG/ClaudeCode★ 1same name
- gabepublic/api-autonom-test-01★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- architecture-decision-recordsSkill
- atlas-add-toolSkill
- atlas-build-bundleSkill
- atlas-ci-releaseSkill
- atlas-optimization-patternsSkill
- atlas-rag-evaluationSkill
- embedding-strategiesSkill
- hybrid-search-implementationSkill
- mcp-builderSkill
- python-observabilitySkill
- python-resilienceSkill
- python-testing-patternsSkill
- python-type-safetySkill
- readme-maintenanceSkill
- skill-creatorSkill
- uv-package-managerSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 3 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 77
When documenting parameters inline (not via Google-style section headers), place the description after --:
- Very specific: line 88
Always use f-strings. Do not use .format() or % formatting.
- Distinctive: line 100
No strict line length is enforced.
- Distinctive: line 101
Keep lines under ~100 characters when readable.
- Distinctive: line 110
Import groups separated by one blank line.
- Very specific: line 114
Add this as the first import in every .py file (after the module docstring):
- Very specific: line 150
If you set up pre-commit, add .pre-commit-config.yaml with ruff and ruff-format.
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
When to use
- Writing new Python files for the project
- Reviewing code for style consistency
- Configuring ruff or another linter/formatter
- Onboarding a new contributor
Project conventions
These are the conventions established by the existing codebase at atlas/.
Import ordering
Three groups separated by a blank line:
import re
from pathlib import Path
import numpy as np
import yaml
from .base import Embedder| Group | Contents |
| 1 — Standard library | os, re, pathlib, argparse, json, etc. |
| 2 — Third-party | numpy, yaml, mcp, onnxruntime, transformers, etc. |
| 3 — Local (relative) | from .base import ..., from .chunk import ... |
Within each group, sort alphabetically. Use import module over from module import symbol unless you need fewer than 3 symbols from a module.
String quoting
Double quotes for all strings and docstrings:
name = "servicenow-atlas"
description = f"Bundle version {version}"Single quotes are allowed only to avoid escaping inside f-strings:
f" - {h['publication']}/{h['file']}"Naming conventions
| Category | Style | Example |
| Modules/packages | snake_case | chunk.py, make_bundle.py |
| Classes | PascalCase | OnnxEmbedder, MlxEmbedder |
| Functions/methods | snake_case | parse_frontmatter, embed_with_progress |
| Constants | UPPER_CASE | DEFAULT_MODEL_ID, _MAX_CHUNK_CHARS |
Private (_ prefix) | _single_leading | _resolve_model_dir, _FRONTMATTER_RE |
| Type variables | _T or descriptive | — |
Docstrings
Triple double quotes ("""..."""). Module-level docstrings provide design context. Function docstrings describe parameters, return values, and edge cases.
For RST cross-references to other code, use :meth:, :class:, :mod::
"""...as described in :meth:`Embedder.embed`..."""When documenting parameters inline (not via Google-style section headers), place the description after --:
def chunk_file(path: Path, repo_root: Path) -> list[dict]:
"""Chunk a single markdown file, splitting on H2 boundaries.
Malformed YAML frontmatter is logged and treated as no frontmatter.
"""f-strings
Always use f-strings. Do not use .format() or % formatting.
# Correct
logger.info("Chunked %s files in %.2fs", count, elapsed)
# Also correct (f-strings for display strings)
path = f"{publication}/{filename}"Line length
No strict line length is enforced. Use judgment:
- Keep lines under ~100 characters when readable.
- Break long strings at logical boundaries (e.g., between sentences).
- Long argument lists can span multiple lines.
Blank lines
- Two blank lines before top-level class/function definitions.
- One blank line between methods inside a class.
- One blank line after module docstring.
- Import groups separated by one blank line.
from __future__ import annotations
Add this as the first import in every .py file (after the module docstring):
"""Module docstring."""
from __future__ import annotationsThis defers annotation evaluation and is required by the requires-python = ">=3.11" constraint.
Recommended setup
Configure ruff (not currently set up — recommended)
Create .ruff.toml:
target-version = "py311"
line-length = 100
[lint]
select = ["E", "F", "I", "N", "W", "UP", "D"]
ignore = ["D203", "D213", "D415"] # Allow flexible docstring convention
[format]
quote-style = "double"Then run:
ruff check .
ruff format .Pre-commit hook (optional)
If you set up pre-commit, add .pre-commit-config.yaml with ruff and ruff-format.
References
pyproject.toml— project configurationREADME.md— not a style guide, but documents project conventionsruffdocumentation for rule selection
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

