skills/python-monorepo/SKILL.md
Python monorepo architecture with uv workspaces, mise, and apps/packages pattern. Use when setting up project structure, configuring workspaces, managing dependencies across packages, or designing multi-app Python repositories.
npx skillsauth add martinffx/claude-code-atelier python-monorepoInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Modern Python monorepo architecture using uv for workspace management and mise for Python version and task orchestration.
Monorepo: Single repository containing multiple related packages and applications
uv workspace: Python's answer to npm/pnpm workspaces
my-monorepo/
├── .mise.toml # Python version + task runner
├── pyproject.toml # Root workspace config
├── uv.lock # Unified lock file
├── apps/ # Deployable applications
│ ├── api/
│ └── worker/
└── packages/ # Shared libraries
├── core/
└── utils/
Root pyproject.toml:
[project]
name = "my-monorepo"
version = "0.1.0"
requires-python = ">=3.12"
[tool.uv.workspace]
members = ["apps/*", "packages/*"]
[tool.uv]
dev-dependencies = [
"pytest>=8.0.0",
"ruff>=0.8.0",
"basedpyright>=1.0.0",
]
See references/workspace-config.md for detailed configurations.
Workspace packages reference each other by distribution name:
packages/utils/pyproject.toml:
[project]
name = "my-utils"
dependencies = ["my-core"]
apps/api/pyproject.toml:
[project]
name = "my-api"
dependencies = ["my-core", "my-utils", "fastapi>=0.100.0"]
packages/core/src/my_core/entities.py:
class User:
def __init__(self, email: str):
self.email = email
apps/api/src/my_api/main.py:
from my_core.entities import User # Import from workspace package
def run():
# App code...
apps/ → packages/ (Apps depend on packages)
packages/ ⇏ apps/ (Never the reverse)
Rules:
.mise.toml:
[tools]
python = "3.12"
[tasks.check]
depends = ["lint", "typecheck", "test"]
[tasks.lint]
run = "uv run ruff check ."
Usage: mise run check
uv sync # Install all packages
uv add fastapi --package my-api # Add to specific package
uv add my-core --package my-api # Add workspace package
uv run pytest # Run tests
uv lock --upgrade # Update dependencies
For detailed patterns:
references/workspace-config.md - pyproject.toml patterns, dependencies, versionsreferences/docker.md - Multi-stage Docker buildsreferences/namespace-packages.md - PEP 420 namespace packagesdevelopment
Security architecture and threat modeling knowledge. Auto-invokes when designing features that handle untrusted data, authentication, authorization, external integrations, file uploads, or sensitive data. Provides risk assessment frameworks, trust boundary analysis, and security design principles — not implementation code.
testing
Adversarial review of non-trivial decisions using fresh-context scrutiny. Use when correctness matters more than speed, when stakes are high (production, security-sensitive logic, irreversible operations), or before committing significant architectural or implementation choices.
development
Compact the current conversation into a handoff document for another agent to pick up.
testing
Socratic interrogation of plans against the project's domain model and documented decisions. Use when the user wants to stress-test a plan, clarify terminology, or validate assumptions against existing domain language. Updates CONTEXT.md and ADRs inline as decisions crystallise.