본문으로 건너뛰기
cccskills
무료GitHub에 공개

poetry

Manage Python dependencies, lock files, and project environments using Poetry.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md8.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

What I do

I handle the full Poetry dependency-management lifecycle:

  • Add or remove packages — update pyproject.toml and poetry.lock in one step
  • Sync the environment — install exactly what the lock file specifies
  • Regenerate the lock file — after you edit pyproject.toml, safely re-resolve without unintended upgrades
  • Run commands in the project environment — no manual venv activation needed
  • Initialise a new project — scaffold a new Poetry-managed project or migrate from pip/requirements.txt

When to use me

  • Use this skill when the project is Poetry-managed (for example, poetry.lock exists, or the team standard is Poetry).
  • You want to add, update, or remove a dependency
  • You pulled a branch and need the environment to match the updated lock file
  • You edited pyproject.toml directly and need the lock file regenerated
  • You want to run a script, test suite, or tool inside the project's virtual environment
  • You are starting a new Python project with Poetry, or migrating from pip/requirements.txt

Use Instead [if available]

  • Use uv when the project is uv-managed (for example, uv.lock is the lockfile of record).
  • Use ci-fix when your primary goal is diagnosing/remediating a failing CI run instead of general dependency work.

Example usage

/poetry add requests
/poetry add --dev pytest
/poetry remove httpx
/poetry install
/poetry lock
/poetry run pytest
/poetry init

Workflow

Adding and removing dependencies

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:

  1. Updates pyproject.toml
  2. Resolves all constraints and regenerates poetry.lock
  3. Installs or uninstalls the package in the active virtual environment

Version 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.


Syncing the environment

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:

  • After git pull when teammates updated poetry.lock
  • After checking out a branch with different lock file state
  • After cloning a repository for the first time
  • After manually editing pyproject.toml followed by poetry lock

Already 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

Regenerating the lock file

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 versionSafe commandNotes
2.x (current)poetry lockSafe by default — existing resolved versions preserved; --no-update flag removed
1.x (legacy)poetry lock --no-updateRequired 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:

ScenarioPoetry 2.xPoetry 1.x
Edited constraint in pyproject.tomlpoetry lockpoetry lock --no-update
Removed a dependencypoetry lockpoetry lock --no-update
Upgrade one packagepoetry update <pkg>poetry update <pkg>
Periodic refresh of all depspoetry update --lockpoetry 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.


Running commands in the project environment

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).


Initialising a new project

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:

  1. Run poetry init if no pyproject.toml exists
  2. Add runtime dependencies:
    # Add each dependency from requirements.txt:
    poetry add requests click flask
    # Or read from file:
    cat requirements.txt | xargs poetry add
    
  3. Add dev dependencies:
    poetry add --group dev pytest ruff mypy
    
  4. Verify the generated poetry.lock is correct: poetry install
  5. Delete requirements.txt once migration is verified

Tips for Success

  1. Always 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.

  2. 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.

  3. 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.

  4. 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).

  5. 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.

  6. Check Poetry is installed: poetry --version. Install with curl -sSL https://install.python-poetry.org | python3 - or brew install poetry.

  7. Commit poetry.lock to version control — the lock file is the source of truth for reproducible environments. Never add it to .gitignore.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Implement comprehensive error handling for Python code paths to keep services resilient and user-friendly. Use when failures are currently silent or exceptions leak through.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Unique-AG/ai52026년 10월 19일 업데이트

Tabular and numerical data analysis with descriptive statistics and insights. Use when the user provides data, tables, CSVs, or numbers and wants analysis.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Unique-AG/ai52026년 10월 19일 업데이트

Financial factsheet analysis with key metrics extraction and investment rationale

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Unique-AG/ai52026년 10월 19일 업데이트

ci-fix

무료

Diagnose and fix CI failures without leaving your editor.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Unique-AG/ai52026년 10월 19일 업데이트

Reproduce ai-repo PR checks locally with Poe and CI scripts, including per-package typecheck and coverage behavior. Use when validating changes before push or when user asks which local commands match CI.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Unique-AG/ai52026년 10월 19일 업데이트

Ask clarifying questions before implementing to ensure Python requirements are understood. Use when a task lacks detail, dependencies are unclear, or multiple interpretations are possible.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Unique-AG/ai52026년 10월 19일 업데이트

Unique-AG의 스킬 모두 보기

이 스킬의 문제 신고