Goal
Convert OpenCode markdown slash commands to Pi TypeScript handlers with programmatic subagent orchestration.
Migrated from pi-an#6.
Commands to implement
/start — session bootstrap (memory search, project context)
/research — multi-pronged parallel research with @explore
/plan — structured GitHub issue creation with type-specific templates
/work — full 9-step issue execution workflow
/work workflow (the heart of this issue)
Encode the steps from pi-permissions' AGENTS.md /work slash command:
Read issue + project context (parallel: @explore for AGENTS.md/codebase/memory)
Decompose and plan; decide worktree strategy
Setup branch + worktrees if needed
Execute in parallel (@developer + @explore + @ops where independent)
Adversarial review (mandatory gate) — dispatch @adversarial-developer with diff; APPROVED required before commit
Commit + PR (cherry-pick from worktrees if multi-task; one PR per issue)
Six-pass code review — six parallel @code-review-specialist tasks (SECURITY, ERROR_HANDLING, TYPE_SAFETY, PERFORMANCE, ARCHITECTURE, SIMPLICITY); deduplicate by (path, line, title); precedence ladder SECURITY > ERROR_HANDLING > TYPE_SAFETY > PERFORMANCE > ARCHITECTURE > SIMPLICITY
CI watch + merge (per AGENTS.md merge policy; gh pr merge --squash --delete-branch)
Store learnings in vipune
Hard-enforced loop limits (in TypeScript, not just docs)
Max 3 adversarial re-dispatches per round
Max 3 review cycles total (developer-fix → adversarial → six-pass)
Max 90 minutes wall-clock for entire Step 7
On limit hit: STOP, emit user-escalation event, do NOT proceed silently
Required PR-creation guardrails
Always pass --base main to gh pr create (lesson from pi-permissions PR chore: AGENTS.md with worktree-safety section #6 )
Fixes #N on its own line at top of PR body (pre-merge auto-close)
After merge: verify auto-close via gh issue view N --json state after ~60s wait
Synthesis logic for six-pass review
Verdict ladder (first match wins):
ANY CRITICAL → CRITICAL_ISSUES_FOUND
ANY HIGH → ISSUES_FOUND
ANY MEDIUM → ISSUES_FOUND (user can override)
Only LOW or none → APPROVED
Deduplication: group findings by (normalized_path, line, title); on conflict keep highest-precedence lens.
Acceptance criteria
Functional
Quality gates
Documentation
Dependencies
Out of scope (file separately if needed)
Additional slash commands beyond the four listed (/lint, /test, /deploy, etc.)
Slash command auto-discovery / extension registry
Conversational continuation between commands (each invocation is stateless)
Goal
Convert OpenCode markdown slash commands to Pi TypeScript handlers with programmatic subagent orchestration.
Migrated from pi-an#6.
Commands to implement
/start— session bootstrap (memory search, project context)/research— multi-pronged parallel research with @explore/plan— structured GitHub issue creation with type-specific templates/work— full 9-step issue execution workflow/work workflow (the heart of this issue)
Encode the steps from pi-permissions' AGENTS.md
/workslash command:gh pr merge --squash --delete-branch)Hard-enforced loop limits (in TypeScript, not just docs)
Required PR-creation guardrails
--base maintogh pr create(lesson from pi-permissions PR chore: AGENTS.md with worktree-safety section #6)Fixes #Non its own line at top of PR body (pre-merge auto-close)gh issue view N --json stateafter ~60s waitSynthesis logic for six-pass review
Verdict ladder (first match wins):
Deduplication: group findings by
(normalized_path, line, title); on conflict keep highest-precedence lens.Acceptance criteria
Functional
--base mainandFixes #Nin bodyQuality gates
any,@ts-ignore,biome-ignoreDocumentation
Dependencies
Out of scope (file separately if needed)