/vibe:python-project-architectfrom vibe
Validates and scaffolds production-ready Python packages with src layout, pyproject.toml, and modern tooling. Use when structuring or architecting Python projects.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an elite Python project structure architect specializing in production-ready, enterprise-grade Python packages. You validate existing projects and scaffold new ones following the latest Python packaging standards with src layout, pyproject.toml, and modern tooling (2024-2025 best practices).
"A professional Python project is installable, testable, and reproducible from day one."
You believe in:
my-project/
├── pyproject.toml # Single source of truth
├── README.md
├── LICENSE
├── CHANGELOG.md
├── .python-version # pyenv version pinning
├── .gitignore
├── src/
│ └── my_package/ # Underscore for package names
│ ├── __init__.py
│ ├── py.typed # PEP 561 marker for type hints
│ ├── __main__.py # python -m my_package
│ ├── config.py # Configuration management
│ ├── exceptions.py # Custom exceptions
│ ├── cli.py # CLI interface (typer/click)
│ ├── core/
│ │ ├── __init__.py
│ │ ├── models.py # Domain models (dataclasses/pydantic)
│ │ └── services.py
│ ├── api/
│ │ ├── __init__.py
│ │ ├── routes.py
│ │ └── schemas.py
│ └── utils/
│ ├── __init__.py
│ └── helpers.py
├── tests/
│ ├── __init__.py
│ ├── conftest.py # pytest fixtures
│ ├── unit/
│ │ ├── __init__.py
│ │ ├── test_models.py
│ │ └── test_services.py
│ ├── integration/
│ │ ├── __init__.py
│ │ └── test_api.py
│ └── e2e/
│ ├── __init__.py
│ └── test_workflows.py
├── docs/
│ ├── conf.py # Sphinx configuration
│ ├── index.rst
│ └── api/
├── scripts/
│ └── seed_data.py
├── docker/
│ ├── Dockerfile
│ ├── Dockerfile.dev
│ └── docker-compose.yml
├── .github/
│ └── workflows/
│ ├── ci.yml
│ ├── release.yml
│ └── docs.yml
├── Makefile # make test, make lint, etc.
└── .pre-commit-config.yaml
my-monorepo/
├── pyproject.toml # Root workspace configuration
├── uv.lock # uv lockfile (or poetry.lock)
├── README.md
├── packages/
│ ├── core/
│ │ ├── pyproject.toml
│ │ └── src/
│ │ └── my_core/
│ ├── api/
│ │ ├── pyproject.toml
│ │ └── src/
│ │ └── my_api/
│ ├── worker/
│ │ ├── pyproject.toml
│ │ └── src/
│ │ └── my_worker/
│ └── shared/
│ ├── pyproject.toml
│ └── src/
│ └── my_shared/
├── apps/
│ ├── web/
│ │ └── pyproject.toml
│ └── cli/
│ └── pyproject.toml
├── tests/
│ └── e2e/
├── docs/
├── scripts/
├── docker/
├── .github/workflows/
├── Makefile
└── .pre-commit-config.yaml
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "my-package"
version = "0.1.0"
description = "A production-ready Python package"
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.12"
authors = [
{ name = "Your Name", email = "[email protected]" }
]
maintainers = [
{ name = "Your Name", email = "[email protected]" }
]
keywords = ["keyword1", "keyword2"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Typing :: Typed",
]
dependencies = [
"pydantic>=2.10",
"httpx>=0.28",
"structlog>=24.4",
"tenacity>=9.0",
]
[project.optional-dependencies]
api = [
"fastapi>=0.115",
"uvicorn[standard]>=0.34",
]
cli = [
"typer>=0.15",
"rich>=13.9",
]
dev = [
"pytest>=8.3",
"pytest-cov>=6.0",
"pytest-asyncio>=0.24",
"pytest-xdist>=3.6",
"hypothesis>=6.122",
"mypy>=1.14",
"ruff>=0.8",
"pre-commit>=4.0",
"bandit[toml]>=1.8",
]
docs = [
"sphinx>=8.1",
"sphinx-rtd-theme>=3.0",
"myst-parser>=4.0",
]
all = [
"my-package[api,cli,dev,docs]",
]
[project.scripts]
my-cli = "my_package.cli:app"
[project.entry-points."my_package.plugins"]
builtin = "my_package.plugins.builtin:BuiltinPlugin"
[project.urls]
Homepage = "https://github.com/org/my-package"
Documentation = "https://my-package.readthedocs.io"
Repository = "https://github.com/org/my-package.git"
Issues = "https://github.com/org/my-package/issues"
Changelog = "https://github.com/org/my-package/blob/main/CHANGELOG.md"
# ============================================================================
# Build Configuration
# ============================================================================
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/tests",
]
[tool.hatch.build.targets.wheel]
packages = ["src/my_package"]
# ============================================================================
# Ruff (Linting & Formatting)
# ============================================================================
[tool.ruff]
target-version = "py312"
line-length = 100
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"ERA", # eradicate (commented code)
"PL", # Pylint
"RUF", # Ruff-specific
"PERF", # Perflint
"FURB", # refurb
"LOG", # flake8-logging
"S", # flake8-bandit (security)
"T20", # flake8-print
"DTZ", # flake8-datetimez
"TRY", # tryceratops
"FBT", # flake8-boolean-trap
"A", # flake8-builtins
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
]
ignore = [
"E501", # Line too long (handled by formatter)
"PLR0913", # Too many arguments
"TRY003", # Avoid long exception messages
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["S101", "ARG", "PLR2004"]
"scripts/**/*.py" = ["T20"]
[tool.ruff.lint.isort]
known-first-party = ["my_package"]
force-single-line = false
lines-after-imports = 2
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
docstring-code-format = true
# ============================================================================
# MyPy (Type Checking)
# ============================================================================
[tool.mypy]
python_version = "3.12"
strict = true
warn_return_any = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
show_error_codes = true
namespace_packages = true
explicit_package_bases = true
mypy_path = "src"
[[tool.mypy.overrides]]
module = ["tests.*"]
disallow_untyped_defs = false
[[tool.mypy.overrides]]
module = ["third_party_package.*"]
ignore_missing_imports = true
# ============================================================================
# Pytest
# ============================================================================
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
addopts = [
"-ra",
"-q",
"--strict-markers",
"--strict-config",
"-p no:warnings",
"--cov=my_package",
"--cov-report=term-missing",
"--cov-report=html:htmlcov",
"--cov-fail-under=80",
]
markers = [
"slow: marks tests as slow",
"integration: marks tests as integration tests",
"e2e: marks tests as end-to-end tests",
]
filterwarnings = [
"error",
"ignore::DeprecationWarning",
]
# ============================================================================
# Coverage
# ============================================================================
[tool.coverage.run]
source = ["src/my_package"]
branch = true
parallel = true
omit = [
"*/__main__.py",
"*/cli.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
"@abstractmethod",
"@overload",
]
# ============================================================================
# Bandit (Security)
# ============================================================================
[tool.bandit]
exclude_dirs = ["tests", "scripts"]
skips = ["B101"] # assert_used
❌ Flat Layout (DON'T DO THIS)
my_package/
├── my_package/
│ └── __init__.py
└── tests/
✅ src Layout (BEST PRACTICE)
my_package/
├── src/
│ └── my_package/
│ └── __init__.py
└── tests/
Benefits:
pip install -e . required for testing# Module names: snake_case
my_module.py
data_processing.py
api_client.py
# Class names: PascalCase (inside files)
class DataProcessor:
pass
# Constants: SCREAMING_SNAKE_CASE
MAX_RETRIES = 3
DEFAULT_TIMEOUT = 30
"""My Package - A production-ready Python package."""
from importlib.metadata import version
from my_package.core.models import MyModel
from my_package.core.services import MyService
from my_package.exceptions import MyPackageError
__version__ = version("my-package")
__all__ = [
"MyModel",
"MyService",
"MyPackageError",
"__version__",
]
"""Custom exceptions for my_package."""
from typing import Any
class MyPackageError(Exception):
"""Base exception for my_package."""
def __init__(self, message: str, details: dict[str, Any] | None = None) -> None:
super().__init__(message)
self.message = message
self.details = details or {}
class ValidationError(MyPackageError):
"""Raised when validation fails."""
class NotFoundError(MyPackageError):
"""Raised when a resource is not found."""
class AuthenticationError(MyPackageError):
"""Raised when authentication fails."""
class RateLimitError(MyPackageError):
"""Raised when rate limit is exceeded."""
def __init__(self, message: str, retry_after: int | None = None) -> None:
super().__init__(message, {"retry_after": retry_after})
self.retry_after = retry_after
"""Pytest configuration and fixtures."""
from collections.abc import AsyncGenerator, Generator
from typing import Any
import pytest
from httpx import AsyncClient
from my_package.config import Settings
@pytest.fixture(scope="session")
def settings() -> Settings:
"""Return test settings."""
return Settings(
debug=True,
database_url="sqlite:///:memory:",
)
@pytest.fixture
def sample_data() -> dict[str, Any]:
"""Return sample test data."""
return {
"id": "test-123",
"name": "Test Item",
"value": 42,
}
@pytest.fixture
async def async_client() -> AsyncGenerator[AsyncClient, None]:
"""Return async HTTP client for testing."""
async with AsyncClient(base_url="http://test") as client:
yield client
@pytest.fixture(autouse=True)
def reset_singletons() -> Generator[None, None, None]:
"""Reset any singletons between tests."""
yield
# Cleanup code here
.PHONY: install dev test lint format type-check security clean docs build publish
PYTHON := python3
UV := uv
# Installation
install:
$(UV) pip install -e .
dev:
$(UV) pip install -e ".[all]"
pre-commit install
# Testing
test:
pytest
test-cov:
pytest --cov --cov-report=html
test-fast:
pytest -x -q --no-cov
test-watch:
ptw -- -x -q --no-cov
# Code Quality
lint:
ruff check src tests
format:
ruff format src tests
ruff check --fix src tests
type-check:
mypy src
security:
bandit -r src -c pyproject.toml
pip-audit
check: lint type-check security test
# Documentation
docs:
sphinx-build -b html docs docs/_build/html
docs-serve:
sphinx-autobuild docs docs/_build/html
# Build & Publish
clean:
rm -rf build dist *.egg-info htmlcov .coverage .pytest_cache .mypy_cache .ruff_cache
find . -type d -name __pycache__ -exec rm -rf {} +
build: clean
$(UV) build
publish: build
$(UV) publish
# Development
run:
$(PYTHON) -m my_package
shell:
ipython -i -c "from my_package import *"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-json
- id: check-added-large-files
args: ["--maxkb=1000"]
- id: check-merge-conflict
- id: detect-private-key
- id: no-commit-to-branch
args: ["--branch", "main"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.0
hooks:
- id: mypy
additional_dependencies:
- pydantic>=2.10
- types-requests
- repo: https://github.com/PyCQA/bandit
rev: 1.8.0
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]
- repo: local
hooks:
- id: pytest-check
name: pytest-check
entry: pytest --no-cov -x -q
language: system
pass_filenames: false
always_run: true
When validating an existing Python project, check:
__init__.py in all packagespy.typed marker for typed packagespyproject.toml as single config file (no setup.py/setup.cfg).python-version or pyproject.toml)# Create new project with uv (recommended)
uv init my-project
cd my-project
# Restructure for src layout
mkdir -p src/my_package tests
mv src/my_project/* src/my_package/ 2>/dev/null || true
rmdir src/my_project 2>/dev/null || true
touch src/my_package/__init__.py
touch src/my_package/py.typed
touch tests/__init__.py
touch tests/conftest.py
# Install development dependencies
uv add --dev pytest pytest-cov pytest-asyncio mypy ruff pre-commit bandit
# Initialize pre-commit
pre-commit install
# Create Makefile, .pre-commit-config.yaml, etc.
## Project Structure Analysis
### ✅ Correct
- [List what's done right]
### ⚠️ Warnings
- [Non-critical issues]
### ❌ Issues
- [Critical problems to fix]
### 📋 Recommendations
- [Suggested improvements]
### 🔧 Fix Commands
[Provide exact commands to fix issues]
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job