python-rules

A set of practical rules for running Python projects with their required versions, packages, imports, and command-line tools.

In plain words
What is it for?
Use it to run scripts through uv, Poetry, or Pipenv, execute package modules correctly, select a compatible Python version, and install tools with Homebrew or pipx.
Why use it?
It prevents missing-package errors, broken package imports, incompatible Python versions, and blocked system-wide installs on macOS.

Skill for Claude CodeCodex

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/juan294/cc-rpi/python-rules
Any agent
npx skills add juan294/cc-rpi --skill python-rules
Clone the repo
git clone --depth 1 https://github.com/juan294/cc-rpi

Made for: Claude Code, Codex.

Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 347 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.00030 $0.00347
Opus 5 $0.00015 $0.00173
Sonnet 5 $0.00006 $0.00069
Haiku 4.5 $0.00003 $0.00035

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

Security

Grade A, and why

python-rules 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.

templates/skills/python-rules/SKILL.md · 74 lines

What it actually says

Python Development

Virtual Environment Runner

Wrong -- bare python3 has no project dependencies:

python3 scripts/run_analysis.py
# ModuleNotFoundError: No module named 'pandas'

Right -- use the project's venv runner:

uv run python scripts/run_analysis.py
# Or: poetry run python scripts/run_analysis.py
# Or: pipenv run python scripts/run_analysis.py

Package-Relative Imports

Wrong -- direct execution breaks relative imports:

python scripts/etl/transform.py
# ModuleNotFoundError: No module named 'scripts.etl.utils'

Right -- use -m for scripts with package imports:

python -m scripts.etl.transform

Python Version for uv

Wrong -- uv auto-selects newest Python, packages lack wheels:

uv sync
# error: No wheel found for numpy on Python 3.14

Right -- specify a stable Python version:

# Check project requirements:
cat .python-version
# Pin the version:
uv sync --python 3.13

pip on macOS

Wrong -- system pip blocked by PEP 668 on macOS:

pip3 install httpie
# error: externally-managed-environment

Right -- use brew for CLI tools, pipx for Python apps:

brew install httpie
# Or for Python-specific apps:
pipx install httpie
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 · 74 lines · 30 tokens per session scan A 562d92b13b52

Subscribe to this mod's changes

python-rules is a skill published in the GitHub repository juan294/cc-rpi (5 stars, last pushed 12d ago), licensed MIT. It adds 30 tokens to every session and 347 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-08-31.

Related

Other skills, from other repositories

claude-md-review

Audit a CLAUDE.md file for the patterns that actually degrade Claude Code's output — vagueness, unnamed files, stale facts, and bloat. Use when asked to review, audit, improve, shrink, or fix a CLAUDE.md, and when a project's results feel inconsistent or Claude keeps rediscovering the same context.

wesammustafa/Claude-Code-Everything-You-Need-to-Know · 69 tokens

best-practices

Searchable knowledge base of 152+ programming best practices across 30+ languages and frameworks. BM25-powered search over curated resources from industry leaders (Google, Airbnb, Uber, Mozilla, Shopify, OWASP).

dereknguyen269/programing-best-practices · 0 tokens

common-session-retrospective

Analyze conversation corrections to detect skill gaps and prepare targeted skill-library maintenance tasks. Use after any session with user corrections, rework, or retrospective requests. After finding correction loops, also load +common/common-learning-log to persist mistake entries to AGENTSLEARNING.md.

HoangNguyen0403/agent-skills-standard · 59 tokens

common-workflow-writing

Rules for writing concise, token-efficient workflow and skill files. Prevents over-building that requires costly optimization passes. Use when creating or editing workflow files, SKILL.md files, or new skill definitions.

HoangNguyen0403/agent-skills-standard · 45 tokens

JavaScript Tooling

Development tools, linting, and testing for JavaScript projects.

HoangNguyen0403/agent-skills-standard · 18 tokens

common-ui-design

Design distinctive, production-grade frontend UI with bold aesthetic choices. Use when building web components, pages, interfaces, dashboards, or applications in any framework (React, Next.js, Angular, Vue, HTML/CSS).

HoangNguyen0403/agent-skills-standard · 47 tokens