python
This skill should be used every time you work on Python projects or Python code changes in this repository.
SKILL.mdskills/software-engineering/python/SKILL.md
GitHubPython Project Rules (uv + msgspec)
This file defines the preferred Python project organization for this repo.
Core Principles
- All Python projects must use
uvfor environment, dependency, and run management. - All runnable entrypoints must be defined in
pyproject.tomlunder[project.scripts]. - Run entrypoints via
uv run <script>(example:uv run main). - All data models must use
msgspec.Struct(no dataclasses or pydantic). - Only create Python files under
src/(no code outsidesrc/). - Never use relative imports.
Project Layout (Typical)
pyproject.toml
src/
└── <package_name>/
├── __init__.py
├── main.py
├── core/
├── services/
├── adapters/
├── config/
└── utils/
Entry Points
All runnable commands must be declared in pyproject.toml:
[project.scripts]
main = "<package_name>.main:main"
Modeling Rules
Use msgspec.Struct for all models:
import msgspec
class User(msgspec.Struct):
id: str
email: str