mcpField
S
shunk031-python-uv-workflow

shunk031-python-uv-workflow

github.com/shunk031Development071 installsUpdated 5d ago
Repository

About shunk031-python-uv-workflow

A uv-based workflow skill for developers implementing or refactoring Python projects. It also sets guidance for path construction, dependency resolution settings, and tests aligned with repository policy.

Key features

  1. 01Use uv as the default toolchain
  2. 02Run scripts with uv run
  3. 03Test behavior changes
  4. 04Follow project setup and quality gates
  5. 05Anchor paths to source files

Use cases

  1. 01Run scripts and tests in Python projects
  2. 02Check behavior and output parity during refactors
  3. 03Review uv lockfile and configuration
  4. 04Inspect path code for portability

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/shunk031/skills --skill shunk031-python-uv-workflow

After installing, type/shunk031-python-uv-workflowin Claude Code to confirm it loaded.

Bundled filesagents/openai.yamlreferences/python-uv-rules.md

Details

From the project README

Note

After reading this SKILL.md, say: 🐍 I read shunk031-python-uv-workflow.

Python UV Workflow

Overview

Use this workflow to keep Python implementation and refactoring aligned with repository policy.

Workflow

  1. Use uv as the default toolchain for Python projects.
  2. Run scripts with uv run <script>.
  3. Write tests when behavior changes and verify expected behavior.
  4. Add standard dev dependencies with uv.
  5. Follow the existing project's setup and quality gates. Install pre-commit hooks after dependency setup when the project or repository requires them.
  6. For a new project or an explicit setup request, add only the project configuration the request or repository policy needs; do not create .pre-commit-config.yaml or a Makefile for an isolated script edit.
  7. Keep resolver-affecting uv settings such as exclude-newer out of a user's global uv configuration: uv lock records them in the lockfile's [options] block, so every environment without the same setting re-resolves and rewrites the lockfile on each non-frozen uv run, uv sync, or uv-lock hook. A project that needs such a setting must declare it under [tool.uv] in its own pyproject.toml; a committed lockfile with an undeclared [options] block is defective and must be fixed by regenerating the lock.
  8. For refactoring from non-uv originals, align dependencies and verify output parity. Match the repository's coverage target; raise coverage toward 90% only when the refactor or repository requires that target.
  9. Construct Python paths from a source-file anchor, and keep every path component in its own operand:
    • Forbidden: Path("/path/to") / "hoge" and REPO_ROOT / "home/dot_codex/hooks/session_start_gateway.py"
    • Required: Path(__file__).parents[N] / "path" / "to" / "hoge" Never put multiple path components separated by / or \ in a string literal passed to Path or used as an operand to /. Anchoring paths to the source file keeps them working after relocation and across worktrees without coupling them to a host layout. Explicit roots supplied through a CLI argument or environment variable are allowed; hard-coded absolute path strings remain forbidden. Before finalizing Python changes, inspect every changed Path(...) and / expression for path-separator-containing string operands.
  10. Name variables for their semantic role. When the same concept has multiple representations, add a qualifier such as _path, _text, or _data only to distinguish them; do not add type suffixes mechanically when the role is already clear.

Testing Expectations

  • Add tests before refactoring when behavior changes.
  • Prefer real data over mocks and monkeypatches when feasible.
  • Follow the project's stated coverage target; do not impose a universal percentage.

Use python-uv-rules.md for exact commands and canonical hook configuration.

Comments

Markdown supported