Add Python Package
The only skill that knows python -m skore_skills env add. Callers
must not splice manager commands themselves.
Human-facing prose
Details: setup-workspace references/human_facing_prose.md.
Run python -m skore_skills … yourself. In questions and replies,
show the manager command from print-only stdout (pixi add …,
uv add …, pip install …) or a plain-language intent. Never
paste python -m skore_skills, env add, env add-skore, or
--feature / --group as something the user should run or choose.
Never paste env graphviz either; quote that command's
instructions or printed manager line.
Pre-flight
Tick, then immediately run the matching sequence step. Do not stop
after listing the boxes.
- [ ] status + env detect
- [ ] env.managed: null and setup-ml-project installed → load it and stop | null → say unresolved and stop | false and setup already chose unmanaged → name package and manager, return | false → ask, no --execute | true → continue
- [ ] classify: editable | add-skore | env route then env add
- [ ] skrub → env graphviz (install conda Graphviz and verify SVG when allowed)
Sequence
python -m skore_skills status and env detect.
If policy.env.managed is null: env is unresolved. If
status.skills.setup-ml-project is true, load
setup-ml-project and stop. Do not ask whether to set up an
environment. Do not load setup-python-env. If that skill is
not installed, say the environment is unresolved and stop.
Do not bootstrap here.
Classify this turn before adding anything:
- Editable only if the user asked to install the workspace
package, or
setup-ml-project selected that box. has_src
true is not enough.
- Skore if the package is Skore.
- Named package otherwise (
skrub, pandas, …). Never
--editable for a named dependency.
If managed is false and setup-ml-project dispatched this
turn: the opening question already chose user-managed. Name
the package and the manager in words, then return. Do not run
env add — print-only refuses while managed is false. Do not
invent pixi add / uv add / pip install. Do not ask. Do
not wait. Do not say the turn continues after the user
confirms. Stop this sequence. Do not continue at step 5 or
step 6.
If managed is false on a standalone turn: do not
--execute. Run print-only env add (or env add --editable,
or env add-skore --mode <mode>) to obtain the manager line.
Every ask in this skill carries its context inline: name the
package(s), the manager and env the command would touch, and
what each option does.
Do not name the calling skill. A file link is an addition,
never the context. Ask with two options:
- I will handle it (default) — name the package(s) and
show that stdout (e.g.
pixi add pandas). Do not wait;
return.
- Please install this now — show the same manager line,
wait until the user confirms it is done, then return.
Show exactly one manager command. Do not list agent extras,
optional extras, ask, or refuse unless env route JSON
this turn returned that scope. If print-only did not run,
name the package and the manager in words. Do not invent a
wrapper command.
If this turn is editable and has_src is true:
python -m skore_skills env add --editable --execute
Never pip install -e . in a pixi project. If has_src is
false, stop. Name setup-workspace only if it is installed.
A non-zero exit is not a successful install. Do not describe
it as done.
If the package is Skore, read the persisted policy.skore_mode
and run:
python -m skore_skills env add-skore --mode <mode> --execute
If the mode is unset, return to evaluate-ml-pipeline. Do not
spell skore[...] or pick conda vs PyPI yourself. See
add-python-package/references/skore_variant.md.
Else python -m skore_skills env route <pkg>. Use only the
scope returned this turn. Do not list other branches. Do
not guess default.
- No JSON this turn → name
env route <pkg> and stop. Do not
env add --execute.
refuse → stop. Quote message. Do not install.
default → env add --execute <pkg>
agent → env add --feature agent --execute <pkg>
ask → One question, then stop. Two options only: the
project runtime, or a named optional extra / agent tools.
Do not add a context line, a manager command, or a flag to
either option. Do not preview pixi add. Record only
python -m skore_skills env route <pkg>. The install
command waits until the next turn, after they answer.
When managed is true and scope is not refuse, pass
--execute on that one command. Never paste pixi add /
uv add / pip install from memory.
If this turn is skrub, Graphviz is required for DataOp HTML
graphs. An already-importable skrub still runs this step. Do
not return before it because import skrub succeeds. After
the add, run python -m skore_skills env graphviz. Then:
dot is set, or action is conda and managed →
python -m skore_skills env graphviz --execute (installs
conda Graphviz when needed, then verifies pydot can render
SVG in the composed env).
action is system and dot is null → AskUserQuestion
with two options, quoting JSON instructions only:
- I will install Graphviz (default) — do not wait;
return.
- Please wait until I confirm — wait, then re-run
env graphviz --execute to verify SVG rendering.
- Unmanaged → do not
--execute. Show command (conda) or
instructions (system) from print-only JSON.
If --execute fails, quote its repair diagnostic and end this
install sequence. Return that diagnostic to the caller. Do not
discard analysis the caller already finished. When this turn's
only job was adding the package, that return ends the turn.
Never prescribe dot -c, admin rights, or a package-manager
repair from memory. Never invent brew / apt / dnf /
pacman / zypper / winget from memory. Do not pip-install
Graphviz or add it as a Python package on uv / poetry / hatch /
pip-venv. Refuse that in prose; do not paste
env add graphviz or uv add graphviz as a command fence.
Return when the import is available, when the user confirmed they
installed it, when they chose to handle it themselves, or when
this setup turn already chose user-managed and the package was
named. That last return does not wait.
References
references/skore_variant.md
1---2name: add-python-package3description: >4 Add a dependency through the project env manager, or ask the user when the5 environment is user-managed. Trigger when a workflow needs a missing import,6 after choose-python-library picks a library, or for editable install of7 src/<pkg>/.89 SKIP choosing between competing libraries (choose-python-library owns that).10 SKIP bootstrapping a missing manager directly (setup-python-env). When11 env.managed is null, load setup-ml-project if it is installed.1213 HOW TO USE: read status.policy.env.managed, env detect, and env route.14 Classify this turn first (editable | add-skore | named package). If managed15 is null, load setup-ml-project and stop. If managed, env add --execute (or16 --editable). If unmanaged, ask; default is the user handles it — do not17 wait. When setup-ml-project already chose user-managed this turn, name the18 package and the manager, then return. Do not ask and do not wait. Never19 --execute while managed is false.20metadata:21 source: https://skillmd.com/skills/probabl-ai/add-python-package22 role: helper23 modelTier: small24---2526# Add Python Package2728The only skill that knows `python -m skore_skills env add`. Callers29must not splice manager commands themselves.3031## Human-facing prose3233Details: `setup-workspace` `references/human_facing_prose.md`.34Run `python -m skore_skills …` yourself. In questions and replies,35show the manager command from print-only stdout (`pixi add …`,36`uv add …`, `pip install …`) or a plain-language intent. Never37paste `python -m skore_skills`, `env add`, `env add-skore`, or38`--feature` / `--group` as something the user should run or choose.39Never paste `env graphviz` either; quote that command's40`instructions` or printed manager line.4142## Pre-flight4344Tick, then immediately run the matching sequence step. Do not stop45after listing the boxes.4647```48- [ ] status + env detect49- [ ] env.managed: null and setup-ml-project installed → load it and stop | null → say unresolved and stop | false and setup already chose unmanaged → name package and manager, return | false → ask, no --execute | true → continue50- [ ] classify: editable | add-skore | env route then env add51- [ ] skrub → env graphviz (install conda Graphviz and verify SVG when allowed)52```5354## Sequence55561. `python -m skore_skills status` and `env detect`.572. If `policy.env.managed` is null: env is unresolved. If58 `status.skills.setup-ml-project` is true, load59 `setup-ml-project` and stop. Do not ask whether to set up an60 environment. Do not load `setup-python-env`. If that skill is61 not installed, say the environment is unresolved and stop.62 Do not bootstrap here.633. Classify this turn **before** adding anything:6465 - **Editable** only if the user asked to install the workspace66 package, or `setup-ml-project` selected that box. `has_src`67 true is not enough.68 - **Skore** if the package is Skore.69 - **Named package** otherwise (`skrub`, pandas, …). Never70 `--editable` for a named dependency.71724. If `managed` is false and `setup-ml-project` dispatched this73 turn: the opening question already chose user-managed. Name74 the package and the manager in words, then return. Do not run75 `env add` — print-only refuses while managed is false. Do not76 invent `pixi add` / `uv add` / `pip install`. Do not ask. Do77 not wait. Do not say the turn continues after the user78 confirms. Stop this sequence. Do not continue at step 5 or79 step 6.805. If `managed` is false on a standalone turn: **do not**81 `--execute`. Run print-only `env add` (or `env add --editable`,82 or `env add-skore --mode <mode>`) to obtain the manager line.83 Every ask in this skill carries its context inline: name the84 package(s), the manager and env the command would touch, and85 what each option does.86 Do not name the calling skill. A file link is an addition,87 never the context. Ask with two options:8889 1. **I will handle it** (default) — name the package(s) and90 **show that stdout** (e.g. `pixi add pandas`). Do not wait;91 return.92 2. **Please install this now** — show the same manager line,93 wait until the user confirms it is done, then return.9495 Show **exactly one** manager command. Do not list agent extras,96 optional extras, `ask`, or refuse unless `env route` JSON97 **this turn** returned that `scope`. If print-only did not run,98 name the package and the manager in words. Do not invent a99 wrapper command.1001016. If this turn is editable and `has_src` is true:102103 ```bash104 python -m skore_skills env add --editable --execute105 ```106107 Never `pip install -e .` in a pixi project. If `has_src` is108 false, stop. Name `setup-workspace` only if it is installed.109 A non-zero exit is not a successful install. Do not describe110 it as done.1117. If the package is Skore, read the persisted `policy.skore_mode`112 and run:113114 ```bash115 python -m skore_skills env add-skore --mode <mode> --execute116 ```117118 If the mode is unset, return to `evaluate-ml-pipeline`. Do not119 spell `skore[...]` or pick conda vs PyPI yourself. See120 `add-python-package/references/skore_variant.md`.1218. Else `python -m skore_skills env route <pkg>`. Use **only** the122 `scope` returned **this turn**. Do not list other branches. Do123 not guess `default`.124125 - No JSON this turn → name `env route <pkg>` and stop. Do not126 `env add --execute`.127 - `refuse` → stop. Quote `message`. Do not install.128 - `default` → `env add --execute <pkg>`129 - `agent` → `env add --feature agent --execute <pkg>`130 - `ask` → One question, then stop. Two options only: the131 project runtime, or a named optional extra / agent tools.132 Do not add a context line, a manager command, or a flag to133 either option. Do not preview `pixi add`. Record only134 `python -m skore_skills env route <pkg>`. The install135 command waits until the next turn, after they answer.136137 When `managed` is true and `scope` is not `refuse`, pass138 `--execute` on that one command. Never paste `pixi add` /139 `uv add` / `pip install` from memory.1401419. If this turn is `skrub`, Graphviz is required for DataOp HTML142 graphs. An already-importable skrub still runs this step. Do143 not return before it because `import skrub` succeeds. After144 the add, run `python -m skore_skills env graphviz`. Then:145146 - `dot` is set, or `action` is `conda` and managed →147 `python -m skore_skills env graphviz --execute` (installs148 conda Graphviz when needed, then verifies pydot can render149 SVG in the composed env).150 - `action` is `system` and `dot` is null → AskUserQuestion151 with two options, quoting JSON `instructions` only:152 1. **I will install Graphviz** (default) — do not wait;153 return.154 2. **Please wait until I confirm** — wait, then re-run155 `env graphviz --execute` to verify SVG rendering.156 - Unmanaged → do not `--execute`. Show `command` (conda) or157 `instructions` (system) from print-only JSON.158159 If `--execute` fails, quote its repair diagnostic and end this160 install sequence. Return that diagnostic to the caller. Do not161 discard analysis the caller already finished. When this turn's162 only job was adding the package, that return ends the turn.163 Never prescribe `dot -c`, admin rights, or a package-manager164 repair from memory. Never invent `brew` / `apt` / `dnf` /165 `pacman` / `zypper` / `winget` from memory. Do not pip-install166 Graphviz or add it as a Python package on uv / poetry / hatch /167 pip-venv. Refuse that in prose; do not paste168 `env add graphviz` or `uv add graphviz` as a command fence.169170Return when the import is available, when the user confirmed they171installed it, when they chose to handle it themselves, or when172this setup turn already chose user-managed and the package was173named. That last return does not wait.174175## References176177- `references/skore_variant.md`