بنقرة واحدة
poetry
Manage Python dependencies, lock files, and project environments using Poetry.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Manage Python dependencies, lock files, and project environments using Poetry.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | poetry |
| description | Manage Python dependencies, lock files, and project environments using Poetry. |
| license | MIT |
| compatibility | claude cursor opencode |
| metadata | {"version":"1.0.0","languages":"python","audience":"developers","workflow":"automation","since":"2026-02-25"} |
I handle the full Poetry dependency-management lifecycle:
pyproject.toml and poetry.lock in one steppyproject.toml, safely re-resolve without unintended upgradespoetry.lock exists, or the team standard is Poetry).pyproject.toml directly and need the lock file regenerateduv when the project is uv-managed (for example, uv.lock is the lockfile of record).ci-fix when your primary goal is diagnosing/remediating a failing CI run instead of general dependency work./poetry add requests
/poetry add --dev pytest
/poetry remove httpx
/poetry install
/poetry lock
/poetry run pytest
/poetry init
Add a runtime dependency (goes into [tool.poetry.dependencies] in pyproject.toml):
poetry add <package> # e.g. poetry add requests
poetry add "<package>>=2.0" # with version constraint
Add a dev dependency (goes into [tool.poetry.group.dev.dependencies] — Poetry 1.2+ group syntax):
poetry add --group dev <package> # e.g. poetry add --group dev pytest ruff
Dev dependencies are installed in the development environment only and excluded from production installs (poetry install --no-dev or poetry install --without dev). Use --group dev for test runners, linters, and formatters.
Remove a dependency:
poetry remove <package> # removes from pyproject.toml and updates poetry.lock
poetry remove --group dev <package> # remove a dev dependency
After every add or remove, Poetry automatically:
pyproject.tomlpoetry.lockVersion resolution summary: Poetry prints the resolved version and any transitive changes. If a conflict is detected, it reports the conflicting constraints — fix the version bounds in pyproject.toml and retry.
poetry install installs exactly what poetry.lock specifies — no more, no less. It is the canonical way to bring an environment into alignment with the lock file.
poetry install
When to use it:
git pull when teammates updated poetry.lockpyproject.toml followed by poetry lockAlready in sync: If the environment already matches the lock file, poetry install exits cleanly. It is safe to run on every git pull.
Dev vs production install:
poetry install --without dev # skip dev dependency groups (production-like)
poetry install --only dev # install only dev dependencies
Use poetry lock after editing pyproject.toml directly — for example, changing a version constraint, adding a dependency entry by hand, or removing one.
Version-aware safe regeneration:
| Poetry version | Safe command | Notes |
|---|---|---|
| 2.x (current) | poetry lock | Safe by default — existing resolved versions preserved; --no-update flag removed |
| 1.x (legacy) | poetry lock --no-update | Required to prevent upgrading all deps; plain poetry lock in 1.x upgrades everything |
Check your Poetry version: poetry --version
Detect which command to use:
# Poetry 2.x — safe by default:
poetry lock
# Poetry 1.x — must pass --no-update for safe regen:
poetry lock --no-update
If --no-update is not recognised (Poetry 2.x), use plain poetry lock.
Upgrade all dependencies to latest compatible versions:
# Poetry 2.x:
poetry update --lock # regenerate lock with all deps upgraded (no env install)
# or:
poetry lock --regenerate # full re-resolution from scratch
# Poetry 1.x:
poetry update # upgrades and installs
Upgrade a single package:
poetry update <package> # upgrade one package (both versions)
When to use each variant:
| Scenario | Poetry 2.x | Poetry 1.x |
|---|---|---|
Edited constraint in pyproject.toml | poetry lock | poetry lock --no-update |
| Removed a dependency | poetry lock | poetry lock --no-update |
| Upgrade one package | poetry update <pkg> | poetry update <pkg> |
| Periodic refresh of all deps | poetry update --lock | poetry update |
After regenerating the lock file, run poetry install to apply the changes to your environment.
Critical: The skill will never run a command that silently upgrades unrelated packages. Always use the safe-default command for your Poetry version.
poetry run executes any command inside the project's virtual environment — without manual activation.
poetry run <command>
Examples:
poetry run pytest # run tests
poetry run pytest tests/unit/ -v # with arguments
poetry run python src/main.py # run a script
poetry run ruff check . # run a tool
poetry run python -m mypackage # module invocation
Replaces manual venv activation: Use poetry run <cmd> instead of:
source $(poetry env info --path)/bin/activate
poetry run works consistently across platforms and CI environments without shell state side-effects.
Tip: To open a shell inside the venv: poetry shell (Poetry 1.x) or poetry run bash (Poetry 2.x removed poetry shell in favour of explicit activation).
Scaffold a new Poetry project (creates a directory with pyproject.toml and src layout):
poetry new my-project
Initialise in an existing directory (interactive pyproject.toml wizard):
poetry init
This prompts for project name, version, description, Python version constraint, and initial dependencies.
Set Python version:
poetry env use python3.12 # pin to a specific Python for this project
Poetry stores the selected Python in the virtualenv metadata.
Migrate from requirements.txt:
poetry init if no pyproject.toml exists# Add each dependency from requirements.txt:
poetry add requests click flask
# Or read from file:
cat requirements.txt | xargs poetry add
poetry add --group dev pytest ruff mypy
poetry.lock is correct: poetry installrequirements.txt once migration is verifiedAlways use poetry run instead of venv activation — it works in CI without any setup steps and eliminates the risk of running commands in the wrong environment.
poetry lock is safe by default in Poetry 2.x — but in Poetry 1.x you must use poetry lock --no-update to avoid upgrading unrelated packages. Check poetry --version if you're unsure.
Always review the lock diff after poetry update — poetry update can pull in breaking changes. Check git diff poetry.lock before committing and run your test suite.
Use --group dev for test and lint tools — keeping pytest, ruff, mypy, and similar tools in the dev group ensures they are never installed in production (poetry install --without dev).
Run poetry install after every git pull — or make it the first step in your dev environment setup script. This ensures your environment always matches the committed lock file.
Check Poetry is installed: poetry --version. Install with curl -sSL https://install.python-poetry.org | python3 - or brew install poetry.
Commit poetry.lock to version control — the lock file is the source of truth for reproducible environments. Never add it to .gitignore.
ALWAYS use this skill whenever you would otherwise ask the user a question in free-form chat -- for clarifications, confirmations (especially destructive actions), missing parameters, multiple-choice decisions, or structured form input. Elicitations are routed through the Unique AI Platform UI via `unique-cli elicit create` + `elicit wait` (or `elicit ask` outside an agent harness) so the user gets a proper structured prompt and you get a structured answer back. Do NOT ask the user in plain chat when you can use this skill instead.
Read Agentic Table (magic table / due-diligence) sheets through the unique-cli agentic-table command. Use when the user or task involves inspecting an Agentic Table: a sheet's state and metadata, a specific cell's value or lock state, a cell's edit/answer history, or the sheet's generated export artifacts (reports, question exports). These are read-only (Tier 0) commands — they never modify the sheet and never require confirmation. Access to each sheet is enforced by the platform; a denial is reported as `agentic-table: permission denied`.
Call MCP (Model Context Protocol) server tools on the Unique AI Platform using the unique-cli mcp command. Use when the user asks to invoke, call, or execute an MCP tool, or when they need to send a JSON payload to an MCP server through the CLI. The JSON payload is forwarded 1:1 to the platform's MCP call-tool API.
Invoke connected Unique spaces/subagents through the unique-cli subagent command. Use when the workspace exposes connected-space tools and you need to delegate a question or task to one of those configured assistants.
Search the Unique AI Platform knowledge base using the unique-cli search command, with automatic per-turn citation tracking so cited facts render as clickable reference chips and `<sup>N</sup>` footnotes on the Unique platform. Use whenever the user asks to find, search, or query documents or content on Unique, including filtering by folder or metadata. Also covers `unique-cli read <cont_id>` for reading the full indexed text of a document when its content ID is already known. NOTE: This search uses combined vector + full-text indexing. Excel (.xlsx/.xls), CSV (.csv), and image files are NOT full-text indexed, so they will not appear in search results. To locate these file types, use the unique-cli-file-management skill instead (browse folders with `unique-cli ls` to find them by name).
Search the documents uploaded for the CURRENT task/row (e.g. an Agentic Table row's attached files) via the `unique-cli uploaded-search "<query>"` command, with the same per-turn citation tracking as `unique-cli search` so cited facts render as `<sup>N</sup>` footnotes and clickable reference chips on the Unique platform. ALWAYS use this skill when the user refers to documents they uploaded/attached to this task, or when you need facts from the task's own attached files. These uploaded files are scoped to the chat, NOT to a knowledge-base folder, so they will NEVER appear in `unique-cli search` results no matter the folder or metadata filters. Use `unique-cli search` for the knowledge base and this command for the task's uploaded documents; the two are complementary and citation numbering is shared across them within a turn.