senior-python-engineering

Coding standards for writing Python in this repository. They favor small, typed, testable modules, with input validation at boundaries and side effects kept at the edges.

In plain words
What is it for?
Use them when implementing or designing Python modules, data models, adapters, or changes under the agent platform’s source directory.
Why use it?
They make Python code easier to understand, test, and change safely. They also clarify when to use validated data models or simpler internal data structures.

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/extra-org/extra/senior-python-engineering
Any agent
npx skills add extra-org/extra --skill senior-python-engineering
Clone the repo
git clone --depth 1 https://github.com/extra-org/extra

Made for: Claude Code, Codex.

Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,281 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.00039 $0.01281
Opus 5 $0.00019 $0.00641
Sonnet 5 $0.00008 $0.00256
Haiku 4.5 $0.00004 $0.00128

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

Security

Grade A, and why

senior-python-engineering 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.

.claude/skills/senior-python-engineering/SKILL.md · 119 lines

How it starts

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

Skill: Senior Python Engineering

Purpose

Set the standard for writing Python in this repository: small, typed, explicit, testable modules with side effects pushed to the edges — code that future agents can safely modify without fear.

When to Use This Skill

  • Implementing any Python code in src/agentplatform/ (tasks 0001+).
  • Designing a new module, model, or adapter.
  • Deciding between dataclass vs. Pydantic, sync vs. async, or where to put a dependency.

Files to Read First

  • AGENTS.md (architecture rules and planned package layout).
  • docs/ARCHITECTURE.md (layer responsibilities).
  • .ai/skills/architecture-review.md (invariants you must not break).
  • pyproject.toml (configured tools: ruff, mypy, pytest).

Core Principles

  • Small modules, single responsibility. One layer concern per module; no giant files.
  • Explicit typed models. Type everything; mypy runs strict.
    • Use Pydantic for data crossing a boundary that needs validation/parsing (YAML spec models, plugin/API payloads).
    • Use dataclasses (often frozen) for internal domain models that don't need runtime validation (e.g. compiled graph nodes). Choose intentionally, not at random.
  • Separate domain models from transport/API models. Don't reuse a FastAPI request model as your internal domain object.
  • Keep side effects at boundaries. I/O, network, time, and randomness live in adapters at the edges; core logic stays pure and testable.
  • Dependency injection over hidden globals. Pass collaborators in; no module-level mutable singletons, and never mutable global request state.
  • Adapters via explicit interfaces. External integrations (LLM, MCP, DB, plugins) sit behind ABCs so implementations are navigable and can be faked in tests. Reach for typing.Protocol where the typing is structural rather than nominal: runtime_checkable Protocols for optional capabilities detected with isinstance (see agent_engine/engine/), plain Protocols for the minimal shape a function needs of its argument.
  • Clear async boundaries. Don't mix blocking I/O into async paths; keep async at the edges and be consistent within a module.
  • Typed, actionable errors. Define specific exception types; messages name the offending thing (key, id, variable). Avoid bare except.
  • Small, intent-named functions. A function name should describe what it does; if you need "and" in the name, split it.
  • Avoid clever code and premature abstraction. Write the simple version; abstract only when a second real case appears.

Read the full file on GitHub · 119 lines

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 · 119 lines · 39 tokens per session scan A 13295ee905ba

Subscribe to this mod's changes

senior-python-engineering is a skill published in the GitHub repository extra-org/extra (108 stars, last pushed 4d ago), licensed MIT. It adds 39 tokens to every session and 1,281 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-30.