python-uv-project
Skill4 starsChanged 7 months agoMITView on GitHub
Scaffold opinionated Python projects with uv as the package/project manager and `uv init` as the bootstrap step. Use when creating or standardizing a Python repository that should include: git initialization, Makefile-driven `test`/`format`/`lint`/`typecheck` workflows, `prek` git hooks, strict typed data models with Pydantic, and Hatch-based semantic version bumps via `make bump-patch`, `make bump-minor`, and `make bump-major`. Also use when you want a solid generic Python repo baseline with README, LICENSE, `.gitignore`, `.editorconfig`, CI, coverage, settings management, and typed-package scaffolding.
We split this skill into the rules it gives an agent
42 rules. About 0 are common, 18 are distinctive, and 24 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
24
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Prefer current stable releases and avoid unnecessary version pin micromanagement unless the user asks for it.
- Very specific: line 21
Use a src/ layout for packages.
- Very specific: line 22
Use pytest for tests.
- Very specific: line 23
Use ruff for formatting and linting.
- Very specific: line 24
Use pyright for type checking.
- Very specific: line 25
Use pydantic (and pydantic-settings when config/env modeling is needed) for strict data contracts.
- Very specific: line 26
Use hatch for version bump operations.
- Distinctive: line 44
Treat this as the default "this is worth having" baseline, not as an excuse to add large framework-specific boilerplate.
- Very specific: line 50
Create the project with uv init rather than hand-writing pyproject.toml.
- Distinctive: line 51
Prefer package mode for reusable libraries and service code:
- Distinctive: line 58
Keep the initial setup non-interactive and scriptable.
- Very specific: line 62
Keep package code under src/<package_name>/.
- Very specific: line 63
Add tests/ for pytest.
- Distinctive: line 64
Add a small version module when needed for Hatch version management.
- Very specific: line 65
Add .gitignore entries appropriate for Python, .venv/, caches, and build artifacts.
- Very specific: line 67
If the generated layout is close but not fully aligned, update it rather than replacing uv defaults wholesale.
- Very specific: line 71
Add the development dependencies through uv and wire them into pyproject.toml.
- Distinctive: line 83
Use current stable releases by default.
- Distinctive: line 87
Every project created with this skill should expose these targets at minimum:
- Very specific: line 99
Prefer uv run ... inside Make targets so the project-local environment is always used.
- Very specific: line 100
Use the template in python-uv-project/references/templates.md.
- Very specific: line 104
Use prek for git hooks. Recommended split:
- Distinctive: line 110
Keep hooks fast on commit and comprehensive on push.
- Distinctive: line 111
Use a local-hook configuration that shells out to Make targets instead of duplicating commands.
- Distinctive: line 115
When the project touches structured data, configs, request/response models, or file-backed schemas:
- Very specific: line 119
prefer explicit field types over dict[str, Any]
- Distinctive: line 123
Do not leave loosely typed config parsing or ad hoc JSON validation in place if Pydantic can express it cleanly.
- Distinctive: line 130
keep settings models explicit and typed
- Distinctive: line 132
avoid reading raw environment variables throughout the codebase
- Distinctive: line 136
Use Hatch for release version changes and expose it via Make.
- Very specific: line 143
Prefer a simple, explicit Hatch configuration that updates one canonical version source.
- Very specific: line 144
If the repo uses a package module such as src/<package_name>/__about__.py, point Hatch there.
- Very specific: line 145
If the repo already manages version directly in pyproject.toml, keep the approach consistent.
- Very specific: line 149
If the project is expected to live beyond a one-off script, add a minimum GitHub Actions workflow.
- Very specific: line 150
Keep it small and boring: one job on ubuntu-latest, triggered on push to main and on pull_request.
- Very specific: line 158
Prefer make check as the single CI entry point so local and remote verification stay aligned.
- Distinctive: line 159
Do not add a matrix, release automation, cache tuning, or separate format job unless the project explicitly needs them.
- Distinctive: line 163
After generating or refactoring the project, run the full local workflow:
- Very specific: line 173
If hooks were added, also install them and ensure prek run --all-files passes.
- Very specific: line 177
Prefer uv sync / uv run instead of raw virtualenv activation instructions.
- Distinctive: line 178
Keep commands agent-friendly and non-interactive.
- Distinctive: line 180
If CI is requested, mirror the same Make targets rather than re-specifying tool commands in multiple places.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
python-uv-project - Opinionated Python Project Bootstrap
Build a modern Python repo around uv, fast local automation, and predictable quality gates.
Prefer current stable releases and avoid unnecessary version pin micromanagement unless the user asks for it.
Default stack
- Bootstrap with
uv init, then keep dependency management inuv. - Initialize git immediately and make the repo ready for normal commit flow.
- Use a
src/layout for packages. - Use
pytestfor tests. - Use
rufffor formatting and linting. - Use
pyrightfor type checking. - Use
pydantic(andpydantic-settingswhen config/env modeling is needed) for strict data contracts. - Use
hatchfor version bump operations. - Drive routine developer commands through
Makefiletargets:test,format,lint,typecheck. - Include a practical repo baseline:
README.md,LICENSE,.gitignore,.editorconfig, CI, and coverage support.
Standard repo baseline
For a generic Python project, include these by default unless the user asks for a slimmer scaffold:
README.mdwith setup, major Make targets, and developer workflow.LICENSEusing MIT by default when the repo is intended for sharing or publication..gitignorefor Python caches, local environments, build outputs, and IDE noise..editorconfigfor consistent whitespace and line endings.src/<package_name>/__about__.pyas the canonical version source for Hatch when appropriate.src/<package_name>/py.typedwhen the package may be distributed as a typed library.src/<package_name>/settings.pyforpydantic-settings-based configuration.- minimal GitHub Actions CI that runs the same Make targets used locally.
- coverage support through
pytest-covand a dedicatedmake coveragetarget.
Treat this as the default "this is worth having" baseline, not as an excuse to add large framework-specific boilerplate.
Workflow
1. Scaffold with uv
Create the project with uv init rather than hand-writing pyproject.toml.
Prefer package mode for reusable libraries and service code:
uv init --package <project-name>Then add the default toolchain with uv add / uv add --dev.
Keep the initial setup non-interactive and scriptable.
2. Normalize project layout
- Keep package code under
src/<package_name>/. - Add
tests/for pytest. - Add a small version module when needed for Hatch version management.
- Add
.gitignoreentries appropriate for Python,.venv/, caches, and build artifacts.
If the generated layout is close but not fully aligned, update it rather than replacing uv defaults wholesale.
3. Configure quality tooling
Add the development dependencies through uv and wire them into pyproject.toml.
Recommended dev tools:
pytestpytest-covwhen coverage is part of the baselineruffpyrighthatchpydanticpydantic-settingswhen the app has config models
Use current stable releases by default. Do not invent exact version pins unless the repo already pins tools consistently.
4. Add Makefile entry points
Every project created with this skill should expose these targets at minimum:
make testmake formatmake lintmake typecheckmake checkmake coveragemake bump-patchmake bump-minormake bump-major
Prefer uv run ... inside Make targets so the project-local environment is always used.
Use the template in python-uv-project/references/templates.md.
5. Install prek hooks
Use prek for git hooks.
Recommended split:
pre-commit:make formatandmake lintpre-push:make typecheckandmake test
Keep hooks fast on commit and comprehensive on push. Use a local-hook configuration that shells out to Make targets instead of duplicating commands.
6. Make Pydantic the source of truth for data
When the project touches structured data, configs, request/response models, or file-backed schemas:
- model them with
pydantic.BaseModel - validate inputs at boundaries
- prefer explicit field types over
dict[str, Any] - set stricter model config when appropriate (
extra="forbid", frozen models, validation on assignment, etc.) - centralize environment/config parsing in dedicated settings models
Do not leave loosely typed config parsing or ad hoc JSON validation in place if Pydantic can express it cleanly.
7. Establish logging and settings defaults
Set the project up so application code prefers logging over scattered print statements.
For reusable templates, include a minimal settings.py backed by pydantic-settings and keep environment parsing there.
- keep settings models explicit and typed
- load configuration once near the application boundary
- avoid reading raw environment variables throughout the codebase
8. Set up Hatch version bumps
Use Hatch for release version changes and expose it via Make. The user specifically wants:
make bump-patchmake bump-minormake bump-major
Prefer a simple, explicit Hatch configuration that updates one canonical version source.
If the repo uses a package module such as src/<package_name>/__about__.py, point Hatch there.
If the repo already manages version directly in pyproject.toml, keep the approach consistent.
9. Add minimal GitHub Actions and verify the scaffold
If the project is expected to live beyond a one-off script, add a minimum GitHub Actions workflow.
Keep it small and boring: one job on ubuntu-latest, triggered on push to main and on pull_request.
The minimum CI contract is:
make checkPrefer make check as the single CI entry point so local and remote verification stay aligned.
Do not add a matrix, release automation, cache tuning, or separate format job unless the project explicitly needs them.
10. Verify the scaffold
After generating or refactoring the project, run the full local workflow:
make format
make lint
make typecheck
make test
make coverageIf hooks were added, also install them and ensure prek run --all-files passes.
Implementation notes
- Prefer
uv sync/uv runinstead of raw virtualenv activation instructions. - Keep commands agent-friendly and non-interactive.
- Preserve existing repository conventions when modifying an already-started project.
- If CI is requested, mirror the same Make targets rather than re-specifying tool commands in multiple places.
References
- Copy/paste bootstrap snippets:
python-uv-project/references/templates.md
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- greats-soul-archive-contributor/AGENTS.mdAGENTS.md
- agentic-cli-designSkill
- ai-chat-frontendSkill
- autoresearch-agentSkill
- brainstorm-frameworksSkill
- business-planningSkill
- clawdbot-configSkill
- dashboard-design-guidebookSkill
- fermi-estimationSkill
- firecrawlSkill
- gogcliSkill
- greats-soul-archive-contributorSkill
- jp-grantsSkill
- openclaw-agent-creatorSkill
- opencode-agent-creatorSkill
- opencode-command-creatorSkill
- openspec-brownfield-baselineSkill
- oss-publishSkill
- product-improvement-proposalSkill
- rust-cliSkill
- slack-rsSkill
- unit-test-hygieneSkill
- wt-setupSkill
- youtube-summarizerSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

