python-guidelines

python-guidelines is a skill for Claude Code, Codex from fcakyon/claude-codex-settings. It costs 42 tokens per session (1,092 once invoked), scanned A, original, Apache-2.0.

A set of guidelines for writing, reviewing, and refactoring Python code. Python is a programming language commonly used for applications, automation, and data work.

In plain words
What is it for?
Use it when integrating features, choosing code structure, validating inputs, formatting docstrings, or improving existing Python code.
Why use it?
It helps keep changes consistent with the existing codebase and avoid unnecessary abstractions, duplicated code, hidden errors, and hard-to-explain implementations.

Skill for Claude CodeCodex

Part of the python-skills plugin — 1 skill shipped together

About the project

claude-codex-settings is a collection of configurations and reusable extensions for Claude Code, OpenAI Codex, Cursor, and related coding tools. Developers use its skills, commands, hooks, agents, plugins, and MCP servers to shape coding-agent workflows and connect alternative model APIs. The catalogue entries are components of this collection that can be installed into supported coding tools.

fcakyon/claude-codex-settings · 1,127 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/fcakyon/claude-codex-settings/python-guidelines
Any agent
npx skills add fcakyon/claude-codex-settings --skill python-guidelines
Clone the repo
git clone --depth 1 https://github.com/fcakyon/claude-codex-settings

Made for: Claude Code, Codex.

Or install python-skills, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for python-guidelines

README.md
[![agentmods](https://agentmods.dev/badge/skills/fcakyon/claude-codex-settings/python-guidelines.svg)](https://agentmods.dev/skills/fcakyon/claude-codex-settings/python-guidelines)
Your own site
<a href="https://agentmods.dev/skills/fcakyon/claude-codex-settings/python-guidelines"><img src="https://agentmods.dev/badge/skills/fcakyon/claude-codex-settings/python-guidelines.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,092 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00042 $0.01092
Opus 5 $0.00021 $0.00546
Sonnet 5 $0.00008 $0.00218
Haiku 4.5 $0.00004 $0.00109

Measured 2d ago against content hash 85b836dd2e8e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python-guidelines scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/python-skills/skills/python-guidelines/SKILL.md · 110 lines

How it starts

The opening of the file, as written. The whole thing — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python Guidelines

Integrate into existing code. Don't append to it.

Simple is better than complex. Flat is better than nested. Errors should never pass silently. Unless explicitly silenced. If the implementation is hard to explain, it's a bad idea.

-- The Zen of Python (PEP 20)

Code Philosophy

  • Match existing naming, importing, and signature patterns. Use existing utilities and data structures.
  • Functions have a single purpose. Don't hardcode behavior that makes them less general.
  • No trivial wrappers for 2 lines or less. Inline it.
  • Inline single-use variables at the usage site.
  • No try/except unless critical. Let errors surface.
  • No duplicate code.
  • Functions handle their own input validation. No if-else checks in main.
  • Use pathlib, not os.path.
  • Consider API and time costs for MongoDB/Gemini/OpenAI/Claude/Voyage.

Don't do this:

# Generate comment report only if requested
if include_comments:
    comment_report = generate_comments_report(start_date, end_date, team, verbose)
else:
    comment_report = ""
    print("   Skipping comment analysis (disabled)")

Do this:

comment_report = generate_comments_report(start_date, end_date, team, verbose) if include_comments else ""

Ask yourself: "Am I adding code, or integrating into what exists?"

Simplicity Over Abstraction

YAGNI: You Aren't Gonna Need It.

Don't build for hypothetical future requirements. Add complexity only when the current task demands it.

Avoid:

  • Abstract base classes for a single implementation
  • Configuration options nobody asked for
  • Error handling for impossible scenarios
  • Wrapper classes around a single function
  • Dependency injection when direct calls work
  • Generic type parameters for one concrete type

Three similar lines of code is better than a premature abstraction. Refactor when the third real use case appears, not before.

But simplicity does not mean chaos. Always maintain:

  • Clear function names that describe what they do
  • Logical grouping of related code into modules
  • Consistent naming conventions across the project
  • Clean separation between I/O and logic
  • Explicit parameters over global state or side effects

Read the full file on GitHub · 110 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 110 lines · 42 tokens per session scan A 85b836dd2e8e

Subscribe to this mod's changes

python-guidelines is a skill published in the GitHub repository fcakyon/claude-codex-settings (1,127 stars, last pushed today), licensed Apache-2.0. It adds 42 tokens to every session and 1,092 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

temporal-python-testing

Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.

wshobson/agents · 45 tokens

neo4j-driver-python-skill

Neo4j Python Driver v6 — driver lifecycle, executequery, managed and explicit transactions, async (AsyncGraphDatabase), result handling, data type mapping, error handling, UNWIND batching, connection pool tuning, and causal consistency. Use when writing Python code that connects to Neo4j via GraphDatabase.driver…

neo4j-contrib/neo4j-skills · 186 tokens

python-packaging-bug-finder

Use when you need to find known packaging bugs, fixes, and workarounds for Python projects by searching GitHub issues and analyzing their resolution status.

opendatahub-io/ai-helpers · 37 tokens

python-packaging-static-audit

Run hexora static analysis on a Python package repository to detect suspicious code patterns, then triage findings with deterministic rules and AI reasoning to produce a structured risk report section.

opendatahub-io/ai-helpers · 41 tokens

torchtalk-analyzer

Analyze PyTorch internals across Python, C++, and CUDA layers using the TorchTalk MCP server. Use when asked about how PyTorch operators work internally, where functions are implemented, what would break if code is modified, or finding tests for PyTorch operators.

opendatahub-io/ai-helpers · 58 tokens

python-full-deps

Resolve the full install-time dependency tree for a Python package. Use when the user needs all transitive dependencies, full dependency list, or install requirements resolved for a specific Python version with environment markers.

opendatahub-io/ai-helpers · 44 tokens