Files

2.8 KiB

pi-subagent

Pi extension that delegates work to named agents in isolated child sessions, synchronously or as background jobs.

Language

Delegation

Agent: A named worker configuration (model, tools, system prompt) defined in a markdown file, run in an isolated child session. Avoid: persona, bot

Invocation: One request to the subagent tool — single, parallel, or chain. Avoid: call

Task: One delegated brief within an invocation; one child process. Avoid: job, run (both reserved)

Job: An invocation started asynchronously and managed by id. Avoid: run (reserved for workflows)

Chain: Sequential mode; each brief interpolates the previous result via {previous}.

Parallel: Fan-out mode; every task admitted at once, max eight.

Workflows

Workflow: A declarative multi-step plan in a markdown file, executed as a DAG of agents. Avoid: script, pipeline

Run: A workflow executing as a job. Invariant: a run fails if any step or item failed, even when every step completed. Avoid: execution

Step: One node of a workflow's DAG; resolves to one agent brief, or many when it fans out. Avoid: task (reserved)

Needs: The steps a step depends on; all must succeed before it starts. Avoid: depends-on, requires

Skipped: Terminal status of a step whose needs did not all succeed. Invariant: skips propagate — a step needing a skipped step is itself skipped. Avoid: dropped, abandoned

Each-step: A step that fans out over the lines of a needed step's output, one child per line. Avoid: map-step, pipeline

Item: One line of an each-step's source; one child and one {item}. Invariants: zero items fail the step; failed items leave empty slots without failing the step while at least one item succeeds.

Fan-in: A step consuming the outputs of several steps by name.

Journal: The persisted per-run record: plan, per-step records, per-item records for each-step fan-out, and bounded outputs. Avoid: log, history

Start plan: The run's plan as admitted: arguments interpolated into step briefs, each-steps still pending their item fan-out. Avoid: expanded plan (item fan-out resolves at release, not at start)

Ultra

Ultra mode: The per-session policy that injects planning guidance and acts as consent for inline plans; in memory, toggled with /ultra, defaulted by PI_SUBAGENT_ULTRACODE. Avoid: ultracode mode

Inline plan: A model-authored plan passed at start time in the same schema as a workflow file, run through the same validation. Avoid: script, dynamic workflow

Size guideline: Advisory child-count target — small, medium, large, or unrestricted — injected into planning guidance and shown at start; never enforced. Caps remain separate and hard. Avoid: limit, cap (both reserved for enforced bounds)