Stages: offer every operator Claude Code skill without an import step

Claude stages always get the Skill tool (bare Skill allow rule) and no
longer pass --disable-slash-commands or the disableBundledSkills settings
layer, so Claude Code's bundled skills are available. --setting-sources ""
stays, so the operator's personal (~/.claude/skills), claude.ai synced and
enabled-plugin skill folders are discovered per visit and passed as
generated skills-only session plugins (plugin.json plus skills/<name>
symlinks; no hooks, MCP servers or commands) after the skills block's own
plugin. The ambient-skill stream guard is removed.

Pi stages keep --no-skills (Pi's own discovery) and add --skill for each
block skill, then each operator skill folder, with read access to those
folders. OpenCode tool-using stages allow OpenCode's own skill tool for
exactly the personal and synced Claude skill names it discovers, plus
external_directory reads of their folders. Bundled Claude Code skills have
no folder and stay unavailable to Pi and OpenCode (documented).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 20:52:09 +00:00
parent 4d91720849
commit 81d6af04c2
13 changed files with 771 additions and 277 deletions
+60 -25
View File
@@ -161,11 +161,22 @@ default model with `opencode api get /api/model/default`.
turn runs is stored in the server's durable queue (up to 8 per chat) and sent
in order when the turn ends, also after a server restart.
**Skills in stages:** the stage service is shared and discovers skills per
location, not per session, so a stage cannot be given private skills through
OpenCode's skill discovery; its own `skill` tool stays denied by the stage's
deny-all permission rules, which keeps ambient skills unusable. A stage's
`skills` block is attached to each new session before its prompt as one
**Skills in stages:** OpenCode (2.4.1) discovers the operator's Claude Code
skills itself: `~/.claude/skills/<name>/` and the synced
`~/.claude/skills/synced/<bucket>/<name>/` folders (unless the service runs
with `OPENCODE_DISABLE_CLAUDE_CODE` or `OPENCODE_DISABLE_CLAUDE_CODE_SKILLS`).
A tool-using stage session allows OpenCode's `skill` tool for exactly those
skill names (one `skill` allow rule per name, discovered afresh for each
visit), plus `external_directory` reads of their folders (link and resolved
path) when the stage declares `read`/`glob`/`grep`. Every other skill OpenCode
finds (its built-in ones, `~/.agents/skills`, `~/.config/opencode/skills`,
project folders in the run directory) stays denied by the deny-all rules. A
live V2 session (free `opencode/big-pickle`) with these rules loaded
`omarchy` through the `skill` tool; the same session without them had no skill
tool, and asking for the built-in `opencode` skill was refused. Claude Code's
bundled skills and Claude plugin skills are not available (OpenCode does not
discover them), and a text-only stage (empty `tools` block) has no skill tool.
Skills are not inlined into instructions. A stage's `skills` block is attached to each new session before its prompt as one
`PUT /api/experimental/session/<id>/instructions/entries/pipelines-skill-<name>`
entry carrying the skill's `SKILL.md` and the read-only directory of its
bundled files (readable when the stage declares `read`/`glob`/`grep`). This needs
@@ -183,11 +194,20 @@ refused unless that profile exists on the server.
**Launched as:** `pi --mode rpc --provider P --model M --session-dir <run dir>
--no-approve --no-extensions --no-skills --no-context-files
--no-prompt-templates --no-themes --extension policy.js`, plus one `--skill
<dir>` per skill in the stage's `skills` block (Pi documents that explicit
`--skill` paths still load under `--no-skills`; a skills stage must declare
`read`, which the policy also allows inside the visit's skills directory). The
policy extension enforces the stage's tool and edit permissions. `reasoning_effort` maps to Pi's
thinking level and is verified before the task is sent.
<dir>` per skill in the stage's `skills` block and then one per folder-based
Claude Code skill of the operator (personal, synced and enabled-plugin skills,
found as for Claude stages). Pi documents that explicit `--skill` paths still
load under `--no-skills`, which keeps Pi's own skill discovery (`~/.pi`,
`~/.agents/skills`, project `.pi`/`.agents` folders in the run directory) out;
on a name clash Pi keeps the first, so a `skills` block entry wins. Pi loads
`SKILL.md` folders natively (Agent Skills format; Pi 1.6.0 listed all 24 of the
operator's skills through `get_commands`). The model reads a skill's
`SKILL.md` by path, so a stage needs `read` to use one (a `skills` block
requires it); the policy allows reads inside the visit's skills directory and
each operator skill folder (by resolved path). Claude Code's bundled skills
have no folder and are not available to Pi. The policy extension enforces the
stage's tool and edit permissions. `reasoning_effort` maps to Pi's thinking
level and is verified before the task is sent.
**Install and sign in:**
@@ -254,21 +274,36 @@ directory that chooses its own account keeps it).
- **Not supported; the stage or run is refused, never widened:** a
`permissions` block, a run launched with `--write-path`, `delivery=true`
(landing stays on OpenCode), and `reasoning_effort` `none` or `minimal`.
- **Isolation.** User, project and local Claude Code settings, hooks, MCP
servers, plugins and slash commands are not loaded. A `CLAUDE.md` in the run
directory is still read by the CLI.
- **Skills.** With a `skills` block the visit's private copy is loaded as a
session-only plugin (`--plugin-dir`, skills named `pipelines-stage:<name>`),
`Skill` is added to `--tools` with one `Skill(pipelines-stage:<name>)` allow
rule per skill, and `--disable-slash-commands` (which also disables plugin
skills) is replaced by `--settings
'{"disableBundledSkills":true,"enabledPlugins":{"cc-plugin-plugin-authoring@builtin":false}}'`.
Claude Code 2.1.332 then lists only the configured skills plus the
user-only `design` and `doctor` commands, which the model cannot invoke (a
live haiku session saw only `pipelines-stage:<name>`; `dataviz` and
`plugin-authoring` were "Unknown skill"). If a Skill call nevertheless loads
any other skill, the visit fails; a refused call is harmless. Without a
`skills` block the arguments are unchanged.
- **Isolation.** User, project and local Claude Code settings are not loaded
(`--setting-sources ""`): no hooks, permission rules, env, MCP servers or
plugins from them. A `CLAUDE.md` in the run directory is still read by the
CLI.
- **Skills.** Every stage gets the `Skill` tool (added to `--tools` and
approved with a bare `Skill` rule) and can load any skill it sees:
- Claude Code's bundled skills (`code-review`, `dataviz`, `simplify`,
`claude-api`, ...), which ship with the CLI.
- The operator's own skills, found afresh for each visit (no import step) in
the CLI's configuration directory (`CLAUDE_CONFIG_DIR`, else
`~/.claude`): `skills/<name>/` (symlinked folders included) as
`user:<name>`, claude.ai synced skills `skills/synced/<bucket>/<name>/` as
`anthropic-skills:<name>`, and the skills of each plugin enabled in
`settings.json` and installed per `plugins/installed_plugins.json` (its
`skills/` folder and manifest `skills` paths) as `<plugin>:<name>`.
Because user settings stay unloaded, each source becomes a generated
session-only plugin under the visit's evidence directory
(`operator-skills/<plugin>/`: a `plugin.json` plus `skills/<name>`
symlinks to the skill folders, nothing else), passed with `--plugin-dir`;
a plugin's hooks, MCP servers, agents and commands are never loaded.
- A `skills` block's private copy, loaded first as the session-only plugin
`pipelines-stage` (skills named `pipelines-stage:<name>`).
`--disable-slash-commands` is no longer passed (it also disables skills).
Live check with Claude Code 2.1.332 (haiku, the exact stage flags): the
init event listed 44 skills including `code-review`, `dataviz`,
`user:omarchy`, `user:diagnose-crash` and `anthropic-skills:docx`, and
`code-review` and `user:diagnose-crash` both loaded via the Skill tool. A
skill with `context: fork` (for example `code-review`) runs as a forked
sub-session limited to the same tools.
- **Usage.** Cost and tokens come from the CLI's final result and count toward
stage and run budgets; a result without usage fails a budgeted stage.
- **Failures.** Diagnostics are fixed text. A billing, quota or rate-limit
+19 -2
View File
@@ -16,9 +16,26 @@ starts (`stage_skills` on the run, `skills` on each step) and `retry` reuses
those versions, so importing a newer version never changes a run or its
retries. Each visit copies exactly the resolved bundles, read-only, into
`<artifacts>/<run>/skills/<NN>-<stage>/skills/<name>/` (outside the workspace
and the inventoried turn directory) and gives the harness only those skills:
see the Skills section of `internal/author/skill/references/format.md` and the
and the inventoried turn directory) and gives them to the harness: see the
Skills section of `internal/author/skill/references/format.md` and the
per-harness notes in [harnesses.md](harnesses.md).
Library skills are not the only ones a stage sees. Without any import or
`skills` block, every model stage can also use the execution user's own Claude
Code skills, found afresh for each visit in `CLAUDE_CONFIG_DIR` (else
`~/.claude`): personal `skills/<name>/` folders (symlinks included), claude.ai
synced `skills/synced/<bucket>/<name>/` folders, and the skill folders of
plugins enabled in `settings.json`. Only skill folders are offered, never a
plugin's hooks, MCP servers or commands, and user settings stay unloaded.
| Harness | Bundled Claude Code skills | Operator skills | Library (`skills` block) |
| --- | --- | --- | --- |
| claude | yes (`code-review`, `dataviz`, ...) | personal `user:<name>`, synced `anthropic-skills:<name>`, plugin `<plugin>:<name>` | `pipelines-stage:<name>` |
| pi | no (no folder) | `--skill <dir>` each; needs `read` | `--skill <dir>`, listed first |
| opencode | no (no folder) | personal and synced, via OpenCode's own `skill` tool; not plugin skills; not text-only stages | instruction entries (V2) |
A library skill with the same name as an operator skill wins on Pi; on Claude
both are listed under their own plugin names.
Use `pipelines skills list` and `pipelines skills show NAME [--version N]` to
inspect imported versions.