# Ticket: Robust Pi subagent workflow for Nimrod

## Metadata
- Type: Ticket
- Status: Waiting
- Project: Nimrod / Pi workflow
- Created: 2026-06-03
- Updated: 2026-06-03
- Priority: High

## Goal

Build a more robust subagent-based workflow for Nimrod so complex work can be delegated to isolated context windows instead of accumulating context rot in the main conversation.

## Why

The current role-pass/artifact approach improves discipline but does not create true context isolation. The user observed context filling quickly in normal conversation and wants a stronger mechanism.

## Scope

Included:
- Evaluate Pi's existing extension and subagent example capabilities
- Design a project-local subagent system for Nimrod/QRSPI work
- Prefer project-local `.pi/extensions/` and `.pi/agents/` where practical
- Preserve QRSPI artifacts as durable handoff files
- Include safety controls for project-local agent prompts and tool permissions

Not included:
- Replacing Pi internals
- Building a full multi-agent orchestration platform before an MVP
- Remote infrastructure changes

## Acceptance Criteria

This ticket is done when:
- A design exists for robust Nimrod subagents
- The design explains whether to copy/adapt Pi's example subagent extension or build from scratch
- A phased implementation plan exists
- An MVP can run scout/research/planner/reviewer-style agents in isolated Pi subprocesses or an equivalent robust isolation mechanism

## Questions

- Should the MVP use Pi's existing example `subagent` extension as the base?
- Which Nimrod-specific agents are needed first?
- Should project-local agents be enabled by default or require explicit confirmation each run?
- Should implementation agents be allowed write access in MVP, or should the first version be research/plan/review only?

## Plan / Next Actions

- [x] Create QRSPI context artifact
- [x] Write neutral research questions
- [x] Research Pi subagent extension and related examples
- [x] Design Nimrod-specific robust subagent workflow
- [x] Create implementation structure and plan
- [x] Implement MVP after design approval
- [ ] User runs `/reload` and confirms `nimrod_subagent` is available
- [ ] User runs a simple `nimrod-locator` smoke test

## Notes

- Pi documentation states Pi does not ship with subagents by default, but its extension examples include a `subagent/` extension that spawns isolated `pi` subprocesses.
