python-architect

A planning guide for designing Python projects and features. It lays out module structure, dependency contracts, type hints, and pytest test stubs before implementation.

In plain words
What is it for?
Use it to plan Python packages, services, and integrations, including their dependencies and tests. It can also describe component and data flows with Mermaid diagrams.
Why use it?
It helps prevent tangled modules and code that is difficult to test. It also makes the intended structure clear before coding begins.

Skill for Claude CodeCodex

Part of the python-dev plugin — 3 skills, 1 command, 1 agent shipped together

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/dmitriyyukhanov/claude-plugins/python-architect
Any agent
npx skills add DmitriyYukhanov/claude-plugins --skill python-architect
Clone the repo
git clone --depth 1 https://github.com/DmitriyYukhanov/claude-plugins

Made for: Claude Code, Codex.

Or install python-dev, the plugin that ships this one along with the rest of its 3 skills, 1 command, 1 agent.

Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 874 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.00028 $0.00874
Opus 5 $0.00014 $0.00437
Sonnet 5 $0.00006 $0.00175
Haiku 4.5 $0.00003 $0.00087

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

Security

Grade A, and why

python-architect 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-dev/skills/python-architect/SKILL.md · 147 lines

How it starts

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

Python Architect Skill

You are a senior Python architect designing clean, testable systems.

Core Principles

  • Respect project-local standards first (pyproject.toml, Ruff/Flake8, mypy/pyright, framework conventions)
  • Use type hints everywhere
  • Define protocols for dependencies
  • Design for testability with dependency injection
  • Keep modules focused and cohesive
  • Generate pytest test stubs first

Architecture Outputs

  1. Protocols: ABC or Protocol classes for contracts
  2. Test Stubs: pytest test cases
  3. Module Structure: Clear package hierarchy
  4. Mermaid Diagrams: Component and data flow diagrams

Python Guidelines

Project Structure

project/
├── src/
│   └── package_name/
│       ├── __init__.py
│       ├── domain/           # Business logic
│       ├── services/         # Application services
│       ├── adapters/         # External integrations
│       └── config.py         # Configuration
├── tests/
│   ├── unit/
│   ├── integration/
│   └── conftest.py
├── pyproject.toml
└── requirements.txt

Type Hints

from __future__ import annotations

from dataclasses import dataclass
from typing import Protocol

class UserRepository(Protocol):
    def find_by_id(self, user_id: str) -> User | None: ...
    def save(self, user: User) -> None: ...

@dataclass
class User:
    id: str
    name: str
    email: str

Dependency Injection

class UserService:
    def __init__(self, repository: UserRepository) -> None:
        self._repository = repository

    def get_user(self, user_id: str) -> User | None:
        return self._repository.find_by_id(user_id)

Test Architecture

Test Distribution

  • ~75% Unit Tests: Fast, mocked dependencies
  • ~20% Integration Tests: Database, API interactions
  • ~5% E2E Tests: Full workflows

Test Stub Template (pytest)

import pytest
from unittest.mock import Mock

class TestUserService:
    @pytest.fixture
    def mock_repository(self) -> Mock:
        return Mock(spec=UserRepository)

    @pytest.fixture
    def service(self, mock_repository: Mock) -> UserService:
        return UserService(mock_repository)

    def test_get_user_returns_user_when_exists(
        self, service: UserService, mock_repository: Mock
    ) -> None:
        # Arrange
        expected_user = User(id="1", name="Test", email="[email protected]")
        mock_repository.find_by_id.return_value = expected_user

        # Act
        result = service.get_user("1")

        # Assert
        assert result == expected_user
        mock_repository.find_by_id.assert_called_once_with("1")

    def test_get_user_returns_none_when_not_exists(
        self, service: UserService, mock_repository: Mock
    ) -> None:
        # Arrange
        mock_repository.find_by_id.return_value = None

        # Act
        result = service.get_user("unknown")

        # Assert
        assert result is None

Read the full file on GitHub · 147 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 · 147 lines · 28 tokens per session scan A b68b09a46b3f

Subscribe to this mod's changes

python-architect is a skill published in the GitHub repository DmitriyYukhanov/claude-plugins (7 stars, last pushed 2d ago), licensed MIT. It adds 28 tokens to every session and 874 once invoked, about $0.0001 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

python-project

Scaffold and modernize a Python project with uv. Sets up the src/ layout; a pyproject.toml on uv's native uvbuild backend; runtime deps plus a dev dependency group (PEP 735) pinning developer tooling like ruff, ty (or pyright), and pytest; a committed uv.lock and pinned interpreter; a thin main entry point; and a…

bitwise-media-group/skills · 226 tokens

python-typing

Python static typing and type annotations, checked with a static type checker — ty (Astral) or pyright (Microsoft/Pylance). Use when adding, writing, or reviewing type hints or annotations on Python functions, methods, parameters, or return values; adding return type annotations across a module; fixing or resolving…

bitwise-media-group/skills · 204 tokens

python-style

Modern Python house style: ruff is the single formatter and linter (replacing black, isort, flake8, pylint, pyupgrade) with an opinionated lint select set, plus idioms ruff cannot enforce — pathlib over os.path, module-level logging instead of print, specific chained exceptions, dataclasses for data, comprehensions…

bitwise-media-group/skills · 189 tokens

python-testing

Python test authoring and review with pytest. Use when writing, adding, generating, or reviewing Python tests or unit tests for a function, module, or class; running pytest or a single test (the -k flag and other invocation flags for a Makefile or CI); parametrizing test cases into the table-driven pattern; setting up…

bitwise-media-group/skills · 178 tokens

python-backend-expert

This skill should be used when the user is writing, reviewing, debugging, or architecting Python backend code using Litestar or FastAPI with SQLAlchemy or Advanced Alchemy. Provides expert critique covering SOLID principles, hexagonal architecture, repository/service patterns, dependency injection, async correctness…

mathisk2095/jko-claude-plugins · 183 tokens

milp-modeling-gurobi

When the user wants to build, solve, and debug mixed-integer linear programs in Python with Gurobi — creating variables, writing constraint-builder functions, setting objectives and parameters, handling solver status, and extracting solutions safely. Also use when the user mentions "gurobipy," "build a MIP model,"…

hajibabaie/combinatorial-optimization-skills · 141 tokens