---
name: "poetry-python-dependency-management"
description: "Manage Python virtual environments, dependency trees, and package publishing with Poetry."
metadata:
  author: "Poetry"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "manage dependencies poetry"
  - "poetry add dependency group"
  - "build and publish package poetry"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Poetry Python Dependency Management & Packaging

Configures Poetry: defining dependencies and dependency groups in pyproject.toml, lockfile resolution (poetry.lock), building sdist/wheel distributions (poetry build), and publishing to PyPI / private repositories.

## When to Invoke
Invoke this skill whenever you need to:
- manage dependencies poetry
- poetry add dependency group
- build and publish package poetry

## Execution SOP & Rules
1. Initialize project: poetry init or poetry new my-package.
2. Add dependencies: poetry add fastapi and dev group: poetry add --group dev pytest ruff.
3. Install exact locked versions: poetry install --no-root.
4. Run commands within virtualenv: poetry run python script.py or poetry run pytest.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
