python-project

python-project is a skill for Claude Code, Codex from majiayu000/spellbook. It costs 43 tokens per session (2,786 once invoked), scanned C, original, MIT.

A modern architecture guide for Python projects, including APIs, command-line tools, and data pipelines.

In plain words
What is it for?
Use it to structure Python applications with uv, Ruff, Pydantic, FastAPI, type hints, a src directory, and async programming patterns.
Why use it?
It provides consistent choices for project layout, dependency management, validation, formatting, typing, and asynchronous code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to structure Python applications with uv, Ruff, Pydantic, FastAPI, type hints, a src directory, and async programming patterns.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/majiayu000/spellbook/python-project
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.

Any agent
npx skills add majiayu000/spellbook --skill python-project
Clone the repo
git clone --depth 1 https://github.com/majiayu000/spellbook

Made for: Claude Code, Codex.

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-project

README.md
[![agentmods](https://agentmods.dev/badge/skills/majiayu000/spellbook/python-project/github.svg)](https://agentmods.dev/skills/majiayu000/spellbook/python-project)
Your own site
<a href="https://agentmods.dev/skills/majiayu000/spellbook/python-project"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/python-project/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for python-project

Your own site · 80×15
<a href="https://agentmods.dev/skills/majiayu000/spellbook/python-project"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/python-project.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,786 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00043 $0.02786
Opus 5 $0.00022 $0.01393
Sonnet 5 $0.00009 $0.00557
Haiku 4.5 $0.00004 $0.00279

Measured 5d ago against content hash 9caec9140d7c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

python-project scanned grade C with 2 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 5d ago.

The scan reads SKILL.md. This mod also ships 19 executable files (templates/api/src/myapp/__init__.py, templates/api/src/myapp/__main__.py, templates/api/src/myapp/api/__init__.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -LsSf https://astral.sh/uv/install.sh | sh

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -LsSf https://astral.sh/uv/install.sh | sh
skills/python-project/SKILL.md · 463 lines

How it starts

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

Python Project Architecture

Core Principles

  • Type hints everywhere — Pydantic for runtime, mypy for static
  • uv for everything — Package management, virtualenv, Python version
  • Ruff only — Replace Flake8 + Black + isort with single tool
  • src layout — All code under src/ directory
  • pyproject.toml only — No setup.py, no requirements.txt
  • Async all the way — Once async, stay async through call chain
  • No backwards compatibility — Delete, don't deprecate. Change directly
  • LiteLLM for LLM APIs — Use LiteLLM proxy for all LLM integrations

No Backwards Compatibility

Delete unused code. Change directly. No compatibility layers.

# ❌ BAD: Deprecated decorator kept around
import warnings

def old_function():
    warnings.warn("Use new_function instead", DeprecationWarning)
    return new_function()

# ❌ BAD: Alias for renamed functions
new_name = old_name  # "for backwards compatibility"

# ❌ BAD: Unused parameters with underscore
def process(_legacy_param, data):
    ...

# ❌ BAD: Version checking for old behavior
if version < "2.0":
    # old behavior
    ...

# ✅ GOOD: Just delete and update all usages
def new_function():
    ...
# Then: Find & replace all old_function → new_function

# ✅ GOOD: Remove unused parameters entirely
def process(data):
    ...

LiteLLM for LLM APIs

Use LiteLLM proxy. Don't call provider APIs directly.

# src/myapp/llm.py
from openai import AsyncOpenAI

from myapp.config import settings

# Connect to LiteLLM proxy using OpenAI SDK
client = AsyncOpenAI(
    base_url=settings.litellm_url,  # "http://localhost:4000"
    api_key=settings.litellm_api_key,
)


async def complete(prompt: str, model: str = "gpt-4o") -> str:
    """Call any LLM through LiteLLM proxy."""
    response = await client.chat.completions.create(
        model=model,  # "gpt-4o", "claude-3-opus", "gemini-pro", etc.
        messages=[{"role": "user", "content": prompt}],
    )
    return response.choices[0].message.content or ""

Read the full file on GitHub · 463 lines

Files

What ships with it

27 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. 5d ago First seen · 463 lines · 43 tokens per session scan C 9caec9140d7c

Subscribe to this mod's changes

python-project is a skill published in the GitHub repository majiayu000/spellbook (277 stars, last pushed yesterday), licensed MIT. It adds 43 tokens to every session and 2,786 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). 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

Python Patterns

Use this skill when writing or reviewing modern Python code and you want consistent patterns for typing, async, structure, packaging, and correctness (especially in services, scripts, CLIs, and data tooling).

AmariahAK/atlarix-skills · 2 tokens

Cursor rules for FastAPI services with router/service/repository boundaries, typ

Cursor rules for FastAPI services with router/service/repository boundaries, typed provider adapters, bulkhead isolation, idempotency, and domain exceptions.

AmariahAK/atlarix-skills · 14 tokens

Blender Python add-on rules for operators, panels, properties, registration, tes

Blender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting.

AmariahAK/atlarix-skills · 16 tokens

FastAPI best practices and patterns for building modern Python web APIs

Skill "FastAPI best practices and patterns for building modern Python web APIs" from AmariahAK/atlarix-skills, covering when to use this skill, source, fastapi best practices, project structure and api design.

AmariahAK/atlarix-skills · 12 tokens

FastAPI Patterns

Use this skill when building Python APIs with FastAPI and you want consistent boundary validation, async correctness, and maintainable dependency injection patterns.

AmariahAK/atlarix-skills · 3 tokens

cross-sdk-parity

Keep TypeScript and Python SDK behavior, generated client usage, public API naming, and docs examples aligned. Use when a change affects both SDKs, when generated client pins move, when comparing TS/Python behavior, or when a backend API contract changed. Do not use for single-language internal-only changes.

ComposioHQ/composio · 66 tokens