Skip to content

NoxelS/agentic-uv

Repository files navigation

agentic-uv

Build status Supported Python versions License

A Cookiecutter template for Python projects that enforces best practices from the first commit β€” and ships AI coding agents that already know and follow every one of them.

Quickstart πŸš€

Navigate to the directory where you want to create your project, then run:

uvx cookiecutter https://github.com/NoxelS/agentic-uv.git

What this is

agentic-uv generates a production-ready Python project with:

  • Strict linting, type checking, security scanning, and coverage enforcement wired up and passing before you write a single line of business logic
  • A full CI/CD pipeline covering quality, security, and multi-version testing out of the box
  • Pre-configured .claude/ and .copilot/ directories that give AI coding agents (OpenCode, GitHub Copilot) complete, structured knowledge of every quality rule, testing convention, and deployment workflow in the project

The key idea: the agents don't just have access to your code β€” they ship with explicit, up-to-date instructions on how this specific project is built, tested, and maintained. They enforce the same standards a senior engineer would.


Best-Practice Enforcement β€” Baked In

Every generated project starts with the full quality stack already configured and passing:

Code Quality

  • ruff β€” linter and formatter with 18+ rule sets (security, complexity, performance, style, imports)
  • mypy or ty β€” strict static type checking, no implicit Any
  • bandit β€” security scanning on every commit via pre-commit
  • vulture β€” dead code detection on every commit
  • deptry β€” unused, missing, and transitive dependency detection (optional)
  • pre-commit β€” all checks run automatically before any commit lands

Testing & Coverage

  • pytest with pytest-cov and pytest-xdist
  • 80% coverage threshold enforced β€” CI fails if coverage drops below 80%
  • hypothesis β€” property-based testing with starter examples included
  • mutmut β€” mutation testing to verify test quality
  • Integration test scaffold under tests/integration/

Security Auditing

  • pip-audit β€” dependency vulnerability scanning
  • Weekly scheduled security audit in CI (bandit + pip-audit)
  • make audit runs the full security check locally

CI/CD

  • GitHub Actions β€” quality, security, and test jobs on every push and PR
  • Multi-Python-version matrix: 3.10, 3.11, 3.12, 3.13, 3.14
  • Optional Codecov integration

Documentation

  • Optional MkDocs with Material theme, auto-deployed to GitHub Pages

Containerization


Agent-Based Development

Every generated project ships with fully pre-configured agent context in .claude/ (OpenCode) and .copilot/ (GitHub Copilot). The agents don't need to discover the project conventions β€” they are given them explicitly.

What agents know from day one

Each agent loads a structured set of rules covering every aspect of the project:

Rule file What the agent learns
code-style.md Type hints, naming conventions, formatting standards
testing.md pytest patterns, coverage requirements, fixture design
best-practices.md Security standards, type safety, error handling
deployment.md CI/CD workflows, release process, GitHub Actions
commit-guidelines.md Conventional commit format enforced on every commit
agent-interaction.md How to work iteratively β€” no premature session termination
implementation-strategy.md Risk assessment and implementation planning approach
error-handling.md Error propagation, exception design, logging standards

OpenCode skills included

Agents can load specialised skills for common workflows:

Skill What it does
lint-project Runs make check β€” ruff, mypy, pre-commit, deptry
test-project Runs make test β€” pytest with coverage reporting
check-project Full pipeline β€” lint then test
post-change-validation Recommends the right validation skill after any code change
coding-standards Detects anti-patterns, code smells, readability issues
implementation-approach Selects vertical/horizontal/hybrid strategy with risk assessment
subagents-orchestration-guide Orchestrates multi-agent task distribution for large features

Subagent definitions included

For complex features, a full set of specialised subagents is pre-defined:

Agent Role
requirement-analyzer Analyses scope and determines implementation scale
prd-creator Produces structured Product Requirements Documents
technical-designer Creates Architecture Decision Records and Design Docs
work-planner Breaks Design Docs into phased, ordered work plans
task-decomposer Decomposes work plans into atomic implementation tasks
task-executor Executes a single task and returns structured output
quality-fixer Runs the full QA pipeline and self-heals until all checks pass
document-reviewer Reviews any document for completeness and consistency
design-sync Verifies consistency across multiple Design Docs
acceptance-test-generator Generates integration test skeletons from acceptance criteria
integration-test-reviewer Reviews integration and E2E tests against skeletons

Quickstart

Navigate to the directory where you want to create your project, then run:

uvx cookiecutter https://github.com/NoxelS/agentic-uv.git

Or without uv:

pip install cookiecutter
cookiecutter https://github.com/NoxelS/agentic-uv.git

Follow the prompts. Once complete, navigate into the generated directory and run:

make install   # set up virtualenv and pre-commit hooks
make check     # linting, type checking, security scanning
make test      # pytest with coverage

Everything passes on a fresh project. Start writing code in your_project/.


Template Options

Option Choices Description
author string Your name
email string Your email address
author_github_handle string Your GitHub username
project_name string Project directory name
project_slug auto Python module name (slugified)
project_description string Short project description
layout flat, src Package layout style
include_github_actions y, n Generate CI/CD workflows
publish_to_pypi y, n Add PyPI publish workflow
deptry y, n Enable dependency audit
mkdocs y, n Add MkDocs documentation
codecov y, n Enable Codecov coverage tracking
dockerfile y, n Add Dockerfile / Containerfile
type_checker mypy, ty Static type checker
open_source_license MIT, BSD, ISC, Apache 2.0, GPL v3, None License type

Generated Project Structure

your-project/
β”œβ”€β”€ your_project/              ← Your code goes here (starts empty)
β”‚   └── __init__.py
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ test_foo.py            ← Example test (replace with your own)
β”‚   β”œβ”€β”€ test_properties.py     ← Hypothesis property-based tests (starter examples)
β”‚   └── integration/
β”‚       └── test_integration.py
β”œβ”€β”€ .claude/                   ← OpenCode agent context
β”‚   β”œβ”€β”€ CLAUDE.md              ← Project overview and quick-start for the agent
β”‚   β”œβ”€β”€ rules/                 ← Best-practice rules loaded by the agent
β”‚   β”‚   β”œβ”€β”€ code-style.md
β”‚   β”‚   β”œβ”€β”€ testing.md
β”‚   β”‚   β”œβ”€β”€ best-practices.md
β”‚   β”‚   β”œβ”€β”€ deployment.md
β”‚   β”‚   β”œβ”€β”€ commit-guidelines.md
β”‚   β”‚   β”œβ”€β”€ agent-interaction.md
β”‚   β”‚   β”œβ”€β”€ implementation-strategy.md
β”‚   β”‚   └── error-handling.md
β”‚   └── skills/                ← Reusable workflow skills
β”‚       β”œβ”€β”€ lint-project/
β”‚       β”œβ”€β”€ test-project/
β”‚       β”œβ”€β”€ check-project/
β”‚       β”œβ”€β”€ post-change-validation/
β”‚       β”œβ”€β”€ coding-standards/
β”‚       β”œβ”€β”€ implementation-approach/
β”‚       └── subagents-orchestration-guide/
β”œβ”€β”€ .copilot/                  ← GitHub Copilot agent context (mirrors .claude/)
β”œβ”€β”€ .github/workflows/         ← CI/CD pipelines (if enabled)
β”‚   β”œβ”€β”€ main.yml               ← Quality, security, and test jobs
β”‚   β”œβ”€β”€ on-release-main.yml    ← PyPI publish on release (if enabled)
β”‚   └── security-audit.yml     ← Weekly bandit + pip-audit scan
β”œβ”€β”€ docs/                      ← MkDocs documentation (if enabled)
β”œβ”€β”€ Dockerfile                 ← Container setup (if enabled)
β”œβ”€β”€ pyproject.toml             ← Full quality stack configured
β”œβ”€β”€ Makefile                   ← Developer convenience targets
β”œβ”€β”€ tox.ini                    ← Multi-version test matrix
└── README.md

Makefile Targets

Target What it runs
make install Create virtualenv, install deps, install pre-commit hooks
make check Ruff, type checker, pre-commit, deptry (if enabled)
make test pytest with coverage
make test-coverage pytest with HTML coverage report
make test-parallel pytest with -n auto (parallel)
make test-integration Integration tests only (tests/integration/)
make test-property Hypothesis property-based tests only
make test-mutation Mutation tests with mutmut
make audit bandit + pip-audit security scan
make build Build wheel
make docs Serve MkDocs locally (if enabled)

Contributing

See CONTRIBUTING.md for development setup and contribution guidelines.

To test the template locally:

cookiecutter . --no-input
cd example-project
make install && make check && make test

Acknowledgements

This project is based on cookiecutter-uv by Florian Maas, which itself drew inspiration from Audrey Feldroy's cookiecutter-pypackage.

agentic-uv extends the original with agent-based development support, stricter quality tooling, enhanced security scanning, property-based and mutation testing, and a dual .claude/ / .copilot/ configuration for AI-assisted workflows.


License

MIT License β€” see LICENSE for details.

About

Opinionated uv starter for disciplined, agent-assisted Python development with enforced structure, typing, testing, and reproducibility.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors