# Nimrod Subagents Extension

Project-local Pi extension for running Nimrod/QRSPI role agents in isolated child `pi` processes.

This is forked/adapted from Pi's example:

```text
/usr/local/lib/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/
```

## Tool

Registers:

```text
nimrod_subagent
```

Supported modes:

- single: one `{ agent, task }`
- parallel: multiple `{ agent, task }` entries
- chain: sequential steps with `{previous}` handoff

## Nimrod Defaults

- Default agent scope: `project`
- Project agents directory: `.pi/agents/`
- Project-agent confirmation: disabled by default in this trusted repo
- Safety model: narrow prompts, QRSPI artifacts, git status/diff review, rollback by git

## Usage Pattern

Ask the parent assistant to delegate context-heavy work, for example:

```text
Use nimrod_subagent with nimrod-researcher to answer the questions in tickets/artifacts/<id>/01-questions.md and write tickets/artifacts/<id>/02-research.md.
```

For chains:

```text
Use nimrod_subagent in chain mode:
1. nimrod-locator finds relevant files
2. nimrod-researcher writes 02-research.md using {previous}
3. nimrod-planner writes 05-plan.md using {previous}
```

## Reload

After adding or changing this extension or `.pi/agents/*.md`, run:

```text
/reload
```

## Rollback

Because subagents may write files, use git workflow:

```sh
git status --short
git diff -- .pi/extensions/nimrod-subagents .pi/agents docs/qrspi-adaptation.md AGENTS.md
```

Rollback this extension:

```sh
rm -rf .pi/extensions/nimrod-subagents
rm -f .pi/agents/nimrod-*.md
```
