Skip to content

milanglacier/pi-multi-agent-skill / skills/multi-agent

multi-agent

Verified

Start other pi agents and delegate work to them. Use it when a task benefits from a multi-agent workflow, such as splitting work across agents, running it in parallel or in the background, or keeping a side task out of your own context.

FileKindSize
SKILL.mdskill md5.3 KB
profiles/Explore.mdmarkdown1.8 KB
profiles/general-purpose.mdmarkdown134 B
references/commands.mdmarkdown9.1 KB
references/lifecycle.mdmarkdown4.6 KB
references/profiles.mdmarkdown3.1 KB
references/state.mdmarkdown2.6 KB
references/troubleshooting.mdmarkdown3.2 KB
references/usage.mdmarkdown1.7 KB
scripts/multi_agent.pyexecutablescript71.5 KB
scripts/usage.pyexecutablescript40.9 KB

references/state.md

View on GitHub
# State

## Locations

Job directories are in
`$XDG_STATE_HOME/pi-multi-agent/<project>/jobs/<name>/` (default
`~/.local/state`). `<project>` is the project's directory with every character
other than a letter or digit replaced by `-` and the leading `-` removed, so
`/home/me/app` becomes `home-me-app`.

A running job's runner listens on a Unix socket in
`$XDG_STATE_HOME/pi-multi-agent/sockets/`, which `steer`, `abort` and `kill`
connect to. Conversations are pi session files in
`$PI_CODING_AGENT_DIR/multi-agent-sessions/<project>/` (default
`~/.pi/agent/`), so they stay out of pi's `/resume` list.

## Job files

| File | Content |
|---|---|
| `job.json` | Launch settings: profile, pi arguments, cwd, parent job, depth, run mode, timeout. |
| `prompt.txt` | Prompt of the latest run. |
| `system-prompt.md` | The profile's prompt, when it replaces pi's system prompt. |
| `append-prompt.md` | Text added to pi's system prompt: the profile's prompt in append mode, then the multi-agent block. |
| `status` | Status of the latest run; final once `exit_code` exists. |
| `lock` | Held by the job's runner for as long as it runs. The job is running exactly while this lock is held. |
| `started_at`, `ended_at` | UTC timestamps of the latest run. |
| `runs` | Number of runs. |
| `exit_code` | Exit code of the latest run, written last. A run without it that is no longer running has `died`. |
| `output.txt` | Result text of the latest run; empty if that run produced none. |
| `model` | Model that wrote the latest message. |
| `stderr.txt` | pi's stderr for the latest run. |
| `progress.log` | The lines `peek` prints, across runs. |
| `usage.json` | Token and cost totals across runs. |
| `runner.log` | Traceback when the runner itself fails. |

Starting a run clears the previous run's result, end time and model, so these
files always describe the latest run.

## Reading a conversation

To read a finished job's whole conversation in interactive pi, run the
`session_cmd` that `status` prints. Do not open it while the job is running,
because two processes would then write the same session file.

## The agent's environment

The script starts the program in `PI_MULTI_AGENT_PI_BIN` (default `pi`). An
agent inherits the environment of the command that started it, plus:

| Variable | Value |
|---|---|
| `PI_MULTI_AGENT_JOB` | The agent's job directory. |
| `PI_MULTI_AGENT_DEPTH` | The agent's nesting depth; see `lifecycle.md`. |
| `PI_MINIMAL_PERMISSION_SYSTEM_NONINTERACTIVE` | `1`, so that extension never waits for an approval. |
| `PI_REQUEST_USER_INPUT_NONINTERACTIVE` | `1`, so that extension never asks the user a question. |
| `PWD` | The agent's working directory. |
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall