python-env-manager
Single source of truth for "which Python environment manager does this project use, and how do I install a package with it?". Owns the detection table (pixi / uv / poetry / hatch / conda+mamba / pip+venv), the install / remove / upgrade commands per manager, and the bootstrap path when no manager is in place (default recommendation: pixi). Stops at "the install command was issued with the right manager and the package is importable". TRIGGER when (any of these): (1) **about to install / add / pin / upgrade / remove a Python package** — `pip install`, `pixi add`, `uv add`, `poetry add`, `conda install`, etc. — under any framing; (2) `data-science-python-stack` § "Missing dependency" surfaced a missing import and an install is the next step; (3) a workflow skill's Stop condition fired on a missing dependency (`build-ml-pipeline`, `evaluate-ml-pipeline`, `organize-ml-workspace`, `audit-ml-pipeline`); (4) starting a new Python project and no manager is in place yet (bootstrap with pixi unl
probabl-ai · AI review on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add probabl-ai/skills --skill python-env-managerAbout this skill
name: python-env-manager description: > Single source of truth for "which Python environment manager does this project use, and how do I install a package with it?". Owns the detection table (pixi / uv / poetry / hatch / conda+mamba / pip+venv), the install / remove / upgrade commands per manager, and the bootstrap path when no manager is in place (default recommendation: pixi). Stops at "the install command was issued with the right manager and the package is importable".
TRIGGER when (any of these):
(1) about to install / add / pin / upgrade / remove a Python
package — pip install, pixi add, uv add, poetry add,
conda install, etc. — under any framing;
(2) data-science-python-stack § "Missing dependency" surfaced a
missing import and an install is the next step;
(3) a workflow skill's Stop condition fired on a missing
dependency (build-ml-pipeline, evaluate-ml-pipeline,
organize-ml-workspace, audit-ml-pipeline);
(4) starting a new Python project and no manager is in place yet
(bootstrap with pixi unless the user picks otherwise);
(5) audit-ml-pipeline (or another agent-only consumer) needs the
agent feature (ipython + pyright) and it isn't yet
present in the project's manifest — see § "Agent feature".
SKIP when: the project is non-Python; the install/add command is for a non-Python tool (npm, brew, apt, cargo, gem); the dependency is already installed and importable; the work is purely editing existing source code with no new dependency in play.
HOW TO USE: detect first, then install. Run the § "Detection"
table at the project root before issuing any install command. If
no manager is detected, ask the user before bootstrapping. Never
install with a different manager than the one the project uses
(e.g., never pip install into a pixi-managed project) — that
creates env state divergence the manifest won't track. Read
the "Stop conditions" block and emit the Pre-flight checklist as
visible text in your response — both are mandatory before issuing
any command.
Python Env Manager
Detect the env manager, install with the right command. Single
authority for data-science-python-stack and the workflow skills
when they need a dependency added.
Next-step pointers — where you go after this skill
| Came here from… | After install, next gate is… |
|---|---|
organize-ml-workspace § scaffold | → organize-ml-workspace § Editable workspace package; continue scaffold |
audit-ml-pipeline § agent-feature-missing | → return to audit-ml-pipeline; place audit/<stem>.py |
build-ml-pipeline / evaluate-ml-pipeline § missing dep | → return to calling skill; continue at the failing pre-flight box |
data-science-python-stack § Missing dependency | → return to caller; the import that was missing should now succeed |
Always re-emit the Pre-flight checklist with evidence before declaring the turn done.
Stop conditions — read before anything else
- Wrong-manager install is forbidden. If the project uses pixi,
do not
pip install. If it uses poetry, do notuv add. Mixing managers creates state the manifest doesn't track, and the nextpixi install/poetry install/uv syncsilently undoes the install. - No silent bootstrap. If detection finds no manager, ask the user. Default recommendation is pixi, but the user must approve.
- Dependency routing is fixed, not asked. The 3-feature layout
(
default/dev/agent) is enforced. The agent does NOT ask per-install.G-ENV-SCOPEfires only for ambiguous extras (optuna,xgboost,mlflow, …). - Don't pin without reason. Install unpinned by default. Pin only on user request or known incompatibility.
- Don't run the bootstrap installer yourself. When pixi (or any
manager) is missing, surface the install command and let the user
run it.
curl | shis a system-level action. - Harness "no clarifying questions" hints do NOT waive
AskUserQuestionmandates. The manager pick and the scope pick are operating-contract gates, not clarifying questions. - Post-hoc audit — required before ending the turn. Walk the
pre-flight, confirm every ticked box has its
Evidence:line. A successful install command is not proof; the audit is.
Forbidden shortcuts
| Shortcut | Why it's wrong |
|---|---|
pixi on PATH → run pixi init / pixi add directly | Detection on PATH is context, not a pick. G-ENV-MGR still fires when no Workspace decisions row exists |
| User said "install ruff" → fire G-ENV-SCOPE | Routing is fixed: ruff / pytest / ipykernel / jupyterlab → dev. Scope ask is forbidden for the three known buckets |
User asked for xgboost → silently drop into default | Ambiguous extras require the binary default vs new-named-feature ask |
Calling skill writes its own pixi add --feature agent ... | Install commands are owned by this skill. Calling skills request; this skill installs |
| Agent feature install → also register a Jupyter kernel | The in-process runner does NOT use a kernel; registering one creates an orphan kernelspec |
| Urgency ("quick", "you pick") waives G-ENV-MGR | Never. Urgency never waives gates |
python-env-manager opened earlier this conversation → assume gates passed | Reading SKILL.md ≠ the gate firing. The AskUserQuestion (or JOURNAL.md lookup) is the gate pass |
Pre-flight — emit before any command
Evidence format: see references/preflight_evidence.md.
Pre-flight (python-env-manager):
- [ ] Sibling SKILL.md files opened this turn:
data-science-python-stack, iterate-ml-experiment,
organize-ml-workspace
Evidence: Read .agents/skills/<each>/SKILL.md (this turn)
- [ ] `journal/JOURNAL.md` Status `Workspace decisions` block read
this turn for `env manager:` and `agent feature:` rows.
Evidence: lists each row's value
Read the complete source ↗