@pi-agents/orchid 0.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/LICENSE +21 -0
  3. package/README.md +246 -0
  4. package/agents/AGENTS-MANIFEST.md +42 -0
  5. package/agents/brain.md +42 -0
  6. package/agents/context-builder.md +46 -0
  7. package/agents/delegate.md +12 -0
  8. package/agents/dev-1.md +42 -0
  9. package/agents/oracle.md +73 -0
  10. package/agents/planner.md +55 -0
  11. package/agents/researcher.md +52 -0
  12. package/agents/reviewer.md +79 -0
  13. package/agents/scout.md +50 -0
  14. package/agents/tester.md +45 -0
  15. package/agents/worker.md +55 -0
  16. package/extensions/ralph.ts +1 -0
  17. package/extensions/reviewer-extension.ts +125 -0
  18. package/extensions/task-orchestrator.ts +28 -0
  19. package/package.json +63 -0
  20. package/prompts/gather-context-and-clarify.md +13 -0
  21. package/prompts/parallel-cleanup.md +59 -0
  22. package/prompts/parallel-context-build.md +53 -0
  23. package/prompts/parallel-handoff-plan.md +59 -0
  24. package/prompts/parallel-research.md +50 -0
  25. package/prompts/parallel-review.md +54 -0
  26. package/prompts/review-loop.md +41 -0
  27. package/skills/orchid/SKILL.md +214 -0
  28. package/skills/orchid/orchid-cleanup/SKILL.md +122 -0
  29. package/skills/orchid/orchid-converge/SKILL.md +124 -0
  30. package/skills/orchid/orchid-decompose/SKILL.md +201 -0
  31. package/skills/orchid/orchid-doctor/SKILL.md +162 -0
  32. package/skills/orchid/orchid-investigate/SKILL.md +102 -0
  33. package/skills/orchid/orchid-launch/SKILL.md +147 -0
  34. package/skills/ralph/SKILL.md +73 -0
  35. package/skills/subagents/pi-subagents/SKILL.md +813 -0
  36. package/src/index.ts +7 -0
  37. package/src/orchestrator/abort.ts +534 -0
  38. package/src/orchestrator/agent-bridge-extension.ts +1020 -0
  39. package/src/orchestrator/agent-host.ts +954 -0
  40. package/src/orchestrator/cleanup.ts +776 -0
  41. package/src/orchestrator/config-loader.ts +1412 -0
  42. package/src/orchestrator/config-schema.ts +690 -0
  43. package/src/orchestrator/config.ts +81 -0
  44. package/src/orchestrator/context-window.ts +66 -0
  45. package/src/orchestrator/diagnostic-reports.ts +475 -0
  46. package/src/orchestrator/diagnostics.ts +394 -0
  47. package/src/orchestrator/discovery.ts +1833 -0
  48. package/src/orchestrator/engine-worker.ts +415 -0
  49. package/src/orchestrator/engine.ts +5940 -0
  50. package/src/orchestrator/execution.ts +3104 -0
  51. package/src/orchestrator/extension.ts +5934 -0
  52. package/src/orchestrator/formatting.ts +785 -0
  53. package/src/orchestrator/git.ts +88 -0
  54. package/src/orchestrator/index.ts +28 -0
  55. package/src/orchestrator/lane-runner.ts +1787 -0
  56. package/src/orchestrator/mailbox.ts +780 -0
  57. package/src/orchestrator/merge.ts +3414 -0
  58. package/src/orchestrator/messages.ts +1062 -0
  59. package/src/orchestrator/migrations.ts +278 -0
  60. package/src/orchestrator/naming.ts +117 -0
  61. package/src/orchestrator/path-resolver.ts +275 -0
  62. package/src/orchestrator/persistence.ts +2625 -0
  63. package/src/orchestrator/process-registry.ts +452 -0
  64. package/src/orchestrator/quality-gate.ts +1085 -0
  65. package/src/orchestrator/resume.ts +3488 -0
  66. package/src/orchestrator/sessions.ts +57 -0
  67. package/src/orchestrator/settings-loader.ts +136 -0
  68. package/src/orchestrator/settings-tui.ts +2208 -0
  69. package/src/orchestrator/sidecar-telemetry.ts +267 -0
  70. package/src/orchestrator/supervisor.ts +4548 -0
  71. package/src/orchestrator/task-executor-core.ts +675 -0
  72. package/src/orchestrator/tmux-compat.ts +37 -0
  73. package/src/orchestrator/tool-allowlist-constants.ts +37 -0
  74. package/src/orchestrator/types.ts +4465 -0
  75. package/src/orchestrator/verification.ts +547 -0
  76. package/src/orchestrator/waves.ts +1564 -0
  77. package/src/orchestrator/workspace.ts +707 -0
  78. package/src/orchestrator/worktree.ts +2725 -0
  79. package/src/ralph/index.ts +825 -0
  80. package/src/subagents/agents/agent-management.ts +648 -0
  81. package/src/subagents/agents/agent-scope.ts +6 -0
  82. package/src/subagents/agents/agent-selection.ts +23 -0
  83. package/src/subagents/agents/agent-serializer.ts +86 -0
  84. package/src/subagents/agents/agents.ts +832 -0
  85. package/src/subagents/agents/chain-serializer.ts +137 -0
  86. package/src/subagents/agents/frontmatter.ts +29 -0
  87. package/src/subagents/agents/identity.ts +30 -0
  88. package/src/subagents/agents/skills.ts +632 -0
  89. package/src/subagents/extension/config.ts +16 -0
  90. package/src/subagents/extension/control-notices.ts +92 -0
  91. package/src/subagents/extension/doctor.ts +199 -0
  92. package/src/subagents/extension/fanout-child.ts +170 -0
  93. package/src/subagents/extension/index.ts +573 -0
  94. package/src/subagents/extension/schemas.ts +168 -0
  95. package/src/subagents/intercom/intercom-bridge.ts +379 -0
  96. package/src/subagents/intercom/result-intercom.ts +377 -0
  97. package/src/subagents/runs/background/async-execution.ts +712 -0
  98. package/src/subagents/runs/background/async-job-tracker.ts +310 -0
  99. package/src/subagents/runs/background/async-resume.ts +345 -0
  100. package/src/subagents/runs/background/async-status.ts +325 -0
  101. package/src/subagents/runs/background/completion-dedupe.ts +63 -0
  102. package/src/subagents/runs/background/notify.ts +108 -0
  103. package/src/subagents/runs/background/parallel-groups.ts +45 -0
  104. package/src/subagents/runs/background/result-watcher.ts +307 -0
  105. package/src/subagents/runs/background/run-id-resolver.ts +83 -0
  106. package/src/subagents/runs/background/run-status.ts +269 -0
  107. package/src/subagents/runs/background/stale-run-reconciler.ts +336 -0
  108. package/src/subagents/runs/background/subagent-runner.ts +1808 -0
  109. package/src/subagents/runs/background/top-level-async.ts +13 -0
  110. package/src/subagents/runs/foreground/chain-clarify.ts +1333 -0
  111. package/src/subagents/runs/foreground/chain-execution.ts +938 -0
  112. package/src/subagents/runs/foreground/execution.ts +918 -0
  113. package/src/subagents/runs/foreground/subagent-executor.ts +2527 -0
  114. package/src/subagents/runs/shared/completion-guard.ts +147 -0
  115. package/src/subagents/runs/shared/long-running-guard.ts +175 -0
  116. package/src/subagents/runs/shared/mcp-direct-tool-allowlist.ts +365 -0
  117. package/src/subagents/runs/shared/model-fallback.ts +103 -0
  118. package/src/subagents/runs/shared/nested-events.ts +819 -0
  119. package/src/subagents/runs/shared/nested-path.ts +52 -0
  120. package/src/subagents/runs/shared/nested-render.ts +115 -0
  121. package/src/subagents/runs/shared/parallel-utils.ts +109 -0
  122. package/src/subagents/runs/shared/pi-args.ts +220 -0
  123. package/src/subagents/runs/shared/pi-spawn.ts +115 -0
  124. package/src/subagents/runs/shared/run-history.ts +60 -0
  125. package/src/subagents/runs/shared/single-output.ts +164 -0
  126. package/src/subagents/runs/shared/subagent-control.ts +226 -0
  127. package/src/subagents/runs/shared/subagent-prompt-runtime.ts +170 -0
  128. package/src/subagents/runs/shared/worktree.ts +577 -0
  129. package/src/subagents/shared/artifacts.ts +98 -0
  130. package/src/subagents/shared/atomic-json.ts +16 -0
  131. package/src/subagents/shared/file-coalescer.ts +40 -0
  132. package/src/subagents/shared/fork-context.ts +76 -0
  133. package/src/subagents/shared/formatters.ts +133 -0
  134. package/src/subagents/shared/jsonl-writer.ts +81 -0
  135. package/src/subagents/shared/model-info.ts +78 -0
  136. package/src/subagents/shared/post-exit-stdio-guard.ts +85 -0
  137. package/src/subagents/shared/session-identity.ts +10 -0
  138. package/src/subagents/shared/session-tokens.ts +44 -0
  139. package/src/subagents/shared/settings.ts +397 -0
  140. package/src/subagents/shared/status-format.ts +49 -0
  141. package/src/subagents/shared/types.ts +822 -0
  142. package/src/subagents/shared/utils.ts +450 -0
  143. package/src/subagents/slash/prompt-template-bridge.ts +397 -0
  144. package/src/subagents/slash/slash-bridge.ts +174 -0
  145. package/src/subagents/slash/slash-commands.ts +528 -0
  146. package/src/subagents/slash/slash-live-state.ts +292 -0
  147. package/src/subagents/tui/render-helpers.ts +80 -0
  148. package/src/subagents/tui/render.ts +1358 -0
  149. package/templates/agents/local/supervisor.md +33 -0
  150. package/templates/agents/local/task-merger.md +27 -0
  151. package/templates/agents/local/task-reviewer.md +30 -0
  152. package/templates/agents/local/task-worker.md +34 -0
  153. package/templates/agents/supervisor-routing.md +92 -0
  154. package/templates/agents/supervisor.md +229 -0
  155. package/templates/agents/task-merger.md +214 -0
  156. package/templates/agents/task-reviewer.md +260 -0
  157. package/templates/agents/task-worker-segment.md +44 -0
  158. package/templates/agents/task-worker.md +557 -0
  159. package/templates/tasks/CONTEXT.md +30 -0
  160. package/templates/tasks/EXAMPLE-001-hello-world/PROMPT.md +98 -0
  161. package/templates/tasks/EXAMPLE-001-hello-world/STATUS.md +73 -0
  162. package/templates/tasks/EXAMPLE-002-parallel-smoke/PROMPT.md +97 -0
  163. package/templates/tasks/EXAMPLE-002-parallel-smoke/STATUS.md +73 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,41 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0-beta.0 (2026-05-31)
4
+
5
+ First beta release of `@pi-agents/orchid` on npm.
6
+
7
+ ### Changed
8
+ - Renamed package from `@claude-code-swe/orchid` → `@pi-agents/orchid`
9
+ - All user-facing "taskplane" branding replaced with "OrchID"
10
+ - All user-facing "taskplane-config.json" paths → "orchid-config.json"
11
+ - `/taskplane-settings` command → `/orchid-settings`
12
+ - Supervisor greeting: "Welcome to OrchID!"
13
+ - README updated: workspace tree, skill table, roadmap
14
+ - Removed old `bin/taskplane.mjs` (120KB taskplane CLI binary)
15
+ - Added CHANGELOG.md to npm distribution
16
+
17
+ ### Fixed
18
+ - Migration file parse error (missing opening quote)
19
+ - Stale `create-taskplane-task` and `multi-lane-orchestration` skill refs in docs
20
+
21
+ ### Published
22
+ - npm: `@pi-agents/orchid@0.1.0-beta.0` (tag: beta)
23
+ - 162 files, 799.9 kB tarball, 3.2 MB unpacked
24
+
25
+ ## 0.1.0-alpha (2026-05-30)
26
+
27
+ ### Added
28
+ - Unified package combining taskplane v0.30.1 + pi-ralph-wiggum v0.2.1 + pi-subagents v0.25.0
29
+ - 113 TypeScript source files across 3 modules (orchestrator, ralph, subagents)
30
+ - 206 test files (unit + integration + smoke)
31
+ - 12 agent definitions (9 required + 3 bonus)
32
+ - 7 sub-skill SKILL.md files with complete pipeline instructions
33
+ - 18 slash commands (/orch, /ralph, /run, /chain, /parallel, etc.)
34
+ - 23 unique tools (orch_start, ralph_start, subagent, etc.)
35
+ - E2E validation: 46/46 checks pass
36
+ - MIT License
37
+
38
+ ### Source Packages
39
+ - **taskplane** v0.30.1 — Batch orchestration engine (HenryLach)
40
+ - **pi-ralph-wiggum** v0.2.1 — Iterative Ralph loop engine (tmustier)
41
+ - **pi-subagents** v0.25.0 — Subagent dispatch + chains + parallel (nicobailon)
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ArtemisAI / claude-code-swe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,246 @@
1
+ # OrchID — Orchestration Identification Pipeline
2
+
3
+ > **orch** = Orchestration · **ID** = Identification — like the flower: structured, modular, beautiful when in bloom.
4
+
5
+ ## Philosophy
6
+
7
+ OrchID is a **modular orchestration meta-skill** for AI agent swarms. It decomposes complex multi-agent development into discrete, composable phases — each encapsulating its own agents, skills, and Ralph loops.
8
+
9
+ ### Core Principles
10
+
11
+ 1. **The Orchestrator Does Not Code.** Ever. Investigate, plan, delegate, review.
12
+ 2. **Skills in Skills.** Each phase is a self-contained sub-skill with its own agent assignments, Ralph loop config, and dependency declarations. Load only what you need.
13
+ 3. **Ralph Loops Are the Execution Wrapper.** Every delegation goes through a Ralph loop for pacing, progress tracking, and iteration control — not raw subagent fire-and-forget.
14
+ 4. **Subagents Only.** `interactive_shell` is PROHIBITED for work. It is exclusively for external engine evals (Claude Code, Gemini CLI, Codex, Cursor). All internal delegation uses `subagent()`.
15
+ 5. **Model-Agnostic.** No hardcoded models. Inherit the orchestrator's model by default. Ask the user if cost optimization is desired. Respect agent-defined model preferences.
16
+ 6. **Doctor First.** Before any pipeline runs, verify all dependencies exist. Fail fast, fail clear.
17
+ 7. **Zero File Overlap.** Lanes never share files. The file ownership matrix is law.
18
+
19
+ ### The 9-Phase Pipeline
20
+
21
+ ```
22
+ PHASE 1: INVESTIGATE → PHASE 2: DOCUMENT → PHASE 3: ISSUES
23
+
24
+ PHASE 4: DECOMPOSE → PHASE 5: .ralph/ FILES → PHASE 6: LAUNCH
25
+
26
+ PHASE 7: CONVERGE → PHASE 8: REVIEW
27
+
28
+ PHASE 9: GAP CLOSURE + CLEANUP
29
+ ```
30
+
31
+ ### Sub-Skill Architecture
32
+
33
+ ```
34
+ orchID/
35
+ ├── SKILL.md ← Master: overview, dependency table, triggers
36
+ ├── orchID-doctor/SKILL.md ← Health check / dependency verification
37
+ ├── orchID-investigate/SKILL.md ← Phases 1-2: Scout, map, document
38
+ ├── orchID-decompose/SKILL.md ← Phases 3-5: Issues, ownership, .ralph/ files
39
+ ├── orchID-launch/SKILL.md ← Phase 6: Subagent dispatch via Ralph loops
40
+ ├── orchID-converge/SKILL.md ← Phases 7-8: Pull, wire, review gate
41
+ └── orchID-cleanup/SKILL.md ← Phase 9: Gap closure, .ralph/ archive
42
+ ```
43
+
44
+ Each sub-skill declares:
45
+ - **Which agents** it uses (from `references/agents/`)
46
+ - **Which skills** it depends on (from `references/`)
47
+ - **Ralph loop configuration** (iterations, pacing, reflection)
48
+ - **Model policy** (inherit / ask / agent-defined)
49
+
50
+ ### Delegation Architecture
51
+
52
+ ```
53
+ ┌──────────────────────────────────────────────────────────┐
54
+ │ ORCHESTRATOR │
55
+ │ (YOU — the brain) │
56
+ │ │
57
+ │ Loads orchID master skill │
58
+ │ Runs orchID-doctor first │
59
+ │ Steps through phases, loading sub-skills as needed │
60
+ │ │
61
+ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
62
+ │ │ orchID- │ │ orchID- │ │ orchID- │ │
63
+ │ │ investigate │ │ decompose │ │ launch │ │
64
+ │ │ │ │ │ │ │ │
65
+ │ │ Agent: scout │ │ Agent: planner│ │ Agent: worker│ │
66
+ │ │ Ralph: no │ │ Ralph: no │ │ Ralph: YES │ │
67
+ │ └─────────────┘ └─────────────┘ └─────────────┘ │
68
+ │ │
69
+ │ Each sub-skill is a "skill in a skill" — │
70
+ │ encapsulating agent + loop + project skills │
71
+ │ as a single composable unit. │
72
+ └──────────────────────────────────────────────────────────┘
73
+ ```
74
+
75
+ ## Delegation Rules (Non-Negotiable)
76
+
77
+ ### subagent() — Internal Work (USE THIS)
78
+
79
+ For ALL coding, investigation, review, and testing delegation:
80
+
81
+ ```
82
+ subagent({
83
+ agent: "worker",
84
+ task: "Implement X...",
85
+ async: true,
86
+ skill: "ms-rust" // project-specific skills injected here
87
+ })
88
+ ```
89
+
90
+ ### interactive_shell — External Eval ONLY (DO NOT USE for work)
91
+
92
+ ```
93
+ interactive_shell is PROHIBITED for any implementation, debugging,
94
+ review, or testing task. It is EXCLUSIVELY for launching external
95
+ coding agent CLIs for evaluation/benchmarking:
96
+
97
+ interactive_shell({
98
+ command: 'claude "Review the diffs"',
99
+ mode: "dispatch"
100
+ })
101
+
102
+ Allowed CLIs: claude, gemini, codex, cursor
103
+ Purpose: engine comparison, benchmark, eval — NEVER production work.
104
+ ```
105
+
106
+ | Dimension | subagent() | interactive_shell |
107
+ |-----------|-----------|-------------------|
108
+ | Token cost | One agent | Two agents (you + child) |
109
+ | Model control | Explicit per-task | Whatever pi launches with |
110
+ | Context | Clean fork | TUI overlay burns context |
111
+ | Progress | Structured output | Must poll/parse terminal |
112
+ | Parallelism | Unlimited async | One per terminal tab |
113
+ | Chaining | chain/parallel support | Manual glue |
114
+ | Skills | Inject per-task | Inherit from parent |
115
+
116
+ ## Dependencies
117
+
118
+ ### Required Agents (must exist in .agents/ or subagent registry)
119
+
120
+ | Agent | Role | Model | Used By Phase |
121
+ |-------|------|-------|---------------|
122
+ | scout | Codebase recon | glm-5.1-claude | orchID-investigate |
123
+ | researcher | Web research | glm-5.1-claude | orchID-investigate |
124
+ | planner | Implementation planning | deepseek-v4-pro | orchID-decompose |
125
+ | worker | Implementation execution | deepseek-v4-flash | orchID-launch, orchID-cleanup |
126
+ | dev-1 | Focused coding | deepseek-v4-flash | orchID-launch |
127
+ | reviewer | Code review | glm-5.1-claude | orchID-converge |
128
+ | tester | Test verification | deepseek-v4-flash | orchID-converge |
129
+ | brain | Architecture reasoning | (inherit) | Any phase (escalation) |
130
+ | delegate | Lightweight passthrough | (inherit) | Any phase (simple tasks) |
131
+
132
+ ### Required Skills
133
+
134
+ | Skill | Source | Package | Used By |
135
+ |-------|--------|---------|---------|
136
+ | ralph | src/ | orchid (bundled) | orchID-launch, orchID-cleanup |
137
+ | subagents | src/ | orchid (bundled) | orchID-launch (all delegation) |
138
+ | orchID-decompose | src/ | orchid (bundled) | Task authoring + issue decomposition |
139
+
140
+ ### Project-Specific Skills (loaded per language)
141
+
142
+ | Skill | When | Source |
143
+ |-------|------|--------|
144
+ | ms-rust | Rust projects | ~/.pi/agent/skills/ms-rust-guidelines |
145
+ | rustic-prompt | Rust projects | ~/.pi/agent/skills/rustic-prompt |
146
+
147
+ ### Required Tools
148
+
149
+ | Tool | Check Command | Used By |
150
+ |------|---------------|---------|
151
+ | git | `git --version` | All phases |
152
+ | gh | `gh auth status` | orchID-decompose (issue creation) |
153
+ | cargo | `cargo --version` | Rust projects, orchID-converge |
154
+ | Telepathine bus | `agent_memory_telepath_list()` | orchID-launch, orchID-converge |
155
+
156
+ ## Model Policy
157
+
158
+ OrchID does NOT hardcode models. Instead:
159
+
160
+ 1. **Default**: Omit `model` param → subagent inherits orchestrator's model
161
+ 2. **User-specified**: Use exactly what the user requested
162
+ 3. **Capacity-based**: If user says "optimize cost", ASK which model to use for workers
163
+ 4. **Agent-defined**: `.agents/*.md` files declare model preferences — respect those
164
+ 5. **Doctor verifies**: orchID-doctor checks that declared agents have valid model configs
165
+
166
+ ## orchID-doctor — Health Check
167
+
168
+ Run before ANY pipeline execution. Verifies:
169
+
170
+ - All required agents exist and are reachable
171
+ - All required skills are loadable
172
+ - Project-specific skills are installed for the detected language
173
+ - Tools (git, gh, cargo) are available and authenticated
174
+ - Telepathine bus has connectivity
175
+ - Git repo is clean and on the correct branch
176
+ - Build is green
177
+
178
+ Reports: ✅ Ready / ⚠️ Warnings / ❌ Missing (with fix suggestions)
179
+
180
+ ## Workspace Contents
181
+
182
+ ```
183
+ OrchID/
184
+ ├── README.md ← This file
185
+ ├── CHANGELOG.md ← Release history
186
+ ├── LICENSE ← MIT
187
+ ├── package.json ← npm package manifest
188
+ ├── ARCHITECTURE.html ← Visual architecture guide
189
+ ├── src/ ← Unified source (113 .ts files)
190
+ │ ├── index.ts ← Barrel exports
191
+ │ ├── orchestrator/ ← Batch orchestration engine (42 files)
192
+ │ ├── ralph/ ← Iterative Ralph loop (1 file)
193
+ │ └── subagents/ ← Subagent dispatch + chains (69 files)
194
+ ├── extensions/ ← Pi extension entry points
195
+ │ ├── task-orchestrator.ts ← /orch commands + supervisor
196
+ │ ├── reviewer-extension.ts ← /run review commands
197
+ │ └── ralph.ts ← /ralph loop commands
198
+ ├── skills/orchid/ ← 7 sub-skill pipeline
199
+ │ ├── SKILL.md ← Master entry point
200
+ │ ├── orchID-doctor/SKILL.md ← Health check
201
+ │ ├── orchID-investigate/SKILL.md ← Phases 1-2
202
+ │ ├── orchID-decompose/SKILL.md ← Phases 3-5
203
+ │ ├── orchID-launch/SKILL.md ← Phase 6
204
+ │ ├── orchID-converge/SKILL.md ← Phases 7-8
205
+ │ └── orchID-cleanup/SKILL.md ← Phase 9
206
+ ├── agents/ ← Agent definitions (12)
207
+ ├── templates/ ← Agent prompt templates
208
+ ├── prompts/ ← Orchestration prompts
209
+ ├── dashboard/ ← Web dashboard
210
+ ├── bin/ ← Utility scripts (excluded from npm)
211
+ ├── sources/ ← Git submodules (excluded from npm)
212
+ └── references/ ← Design docs (excluded from npm)
213
+ ```
214
+
215
+ ## Development Roadmap
216
+
217
+ ### v0.1 (Current — Published) — Unified Package
218
+ - [x] All 3 source repos merged (taskplane v0.30.1 + ralph-wiggum v0.2.1 + pi-subagents v0.25.0)
219
+ - [x] 113 .ts source files across 3 modules
220
+ - [x] 20 tools, 18 commands, 4 extensions, 7 sub-skills, 12 agent defs
221
+ - [x] Master SKILL.md + all 7 sub-skill SKILL.md files
222
+ - [x] orchID-doctor health check with full dependency verification
223
+ - [x] orchID-investigate (phases 1-2: investigate + document)
224
+ - [x] orchID-decompose (phases 3-5: issues + decompose + ralph files)
225
+ - [x] orchID-launch (phase 6: launch + converge + review + cleanup)
226
+ - [x] orchID-converge (phases 7-8: converge + review)
227
+ - [x] orchID-cleanup (phase 9: cleanup)
228
+ - [x] Model policy (inherit/ask/agent-defined)
229
+ - [x] interactive_shell prohibition enforced in all sub-skills
230
+ - [x] Published as npm-installable pi package
231
+ - [x] Per-project `.orchid-config.json` configuration
232
+ - [x] Configurable agent model overrides
233
+ - [x] Auto-detect project language and load appropriate skills
234
+
235
+ ### v1.0 — Production Hardening
236
+ - [ ] Comprehensive test suite
237
+ - [ ] Recovery from failed phases (resume where you left off)
238
+ - [ ] Telemetry / cost tracking integration
239
+ - [ ] Cross-project templates (Rust, TypeScript, Python, etc.)
240
+
241
+ ## Provenance
242
+
243
+ Born from the RustAPI project (May 2026) where 3 parallel lanes closed 26 issues
244
+ in a single session with full reviewer gates, clippy verification, and Go→Rust fidelity audits.
245
+
246
+ The patterns that worked are captured here. The patterns that failed are documented as pitfalls.
@@ -0,0 +1,42 @@
1
+ # OrchID Agent Manifest
2
+
3
+ **Last updated**: 2026-05-30
4
+ **Total agents**: 11 (9 OrchID-required + 2 subagent extras)
5
+
6
+ ## OrchID Pipeline Agents (Required)
7
+
8
+ | Agent | Role | Used By Phases | Source | Model Hint |
9
+ |-------|------|---------------|--------|------------|
10
+ | scout | Fast codebase recon — returns compressed context for handoff | investigate | references + subagents | inherit |
11
+ | researcher | Autonomous web researcher — searches, evaluates, synthesizes brief | investigate | references + subagents | inherit |
12
+ | planner | Creates implementation plans from context and requirements | decompose | subagents | inherit |
13
+ | worker | Implementation agent for normal tasks and approved oracle handoffs | launch, cleanup | subagents | inherit |
14
+ | dev-1 | Focused implementation agent for coding and technical execution | launch | references | deepseek-v4-flash |
15
+ | reviewer | Versatile review specialist for code diffs, plans, health, PR validation | converge | references + subagents | inherit |
16
+ | tester | Testing and validation — runs tests, verifies fixes, reports regressions | converge | references | deepseek-v4-flash |
17
+ | brain | Strategic orchestration and architectural reasoning | any (escalation) | references | glm-5.1-claude |
18
+ | delegate | Lightweight subagent that inherits parent model, no default reads | any (simple tasks) | subagents | inherit |
19
+
20
+ ## Additional Agents (from pi-subagents)
21
+
22
+ | Agent | Role | Notes |
23
+ |-------|------|-------|
24
+ | context-builder | Analyzes requirements and codebase, generates context and meta-prompt | Used by chain execution |
25
+ | oracle | High-context decision-consistency oracle — protects inherited state, prevents drift | Used for validation gates |
26
+
27
+ ## Agent Discovery
28
+
29
+ Agents are discovered by the pi-subagents extension from the `agents/` directory. Each `.md` file must have valid YAML frontmatter with at minimum a `name` field.
30
+
31
+ ## Model Policy
32
+
33
+ OrchID does NOT hardcode models. Agent definitions may include `model` hints, but the orchestrator can override them. Default behavior is to inherit the orchestrator's model unless:
34
+ 1. The user specifies a model explicitly
35
+ 2. The agent definition declares a specific model preference
36
+ 3. Cost optimization is requested and the user chooses which model to use
37
+
38
+ ## Adding New Agents
39
+
40
+ 1. Create `agents/<name>.md` with YAML frontmatter (see existing files for format)
41
+ 2. Add entry to this manifest
42
+ 3. Run orchID-doctor to verify the new agent is discoverable
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: brain
3
+ description: High-level orchestration and architectural reasoning agent
4
+ tools: read, grep, find, ls, bash, memory_recall
5
+ model: api-proxy/glm-5.1-claude
6
+ fallbackModels: api-proxy/deepseek-v4-flash, api-proxy/glm-5-zai
7
+ thinking: high
8
+ systemPromptMode: replace
9
+ inheritProjectContext: true
10
+ inheritSkills: true
11
+ defaultContext: fork
12
+ ---
13
+
14
+ You are `brain`: the strategic orchestration and architectural reasoning subagent.
15
+
16
+ Your role is to tackle complex, multi-faceted problems that require deep analysis, architectural thinking, and coordination of multiple workstreams. You operate above the tactical implementation level — you design the approach, evaluate tradeoffs, and produce clear, actionable direction for other agents or the parent session.
17
+
18
+ ## Core Responsibilities
19
+
20
+ - **Analyze deeply**: Break down ambiguous or complex requests into first principles. Identify hidden constraints, dependencies, and risks.
21
+ - **Architect solutions**: Propose system designs, data flows, module boundaries, and integration patterns. Favor simplicity unless performance or scale demands complexity.
22
+ - **Orchestrate work**: When a task spans multiple domains or files, produce a decomposition that can be handed off to `worker`, `dev-1`, `scout`, or `planner` agents.
23
+ - **Challenge assumptions**: Act as a forcing function for clarity. Ask hard questions about requirements, timelines, and edge cases before work begins.
24
+ - **Produce direction, not edits**: You may read code and write scaffolding documentation (e.g., `ARCHITECTURE.md`, `plan.md`), but you do not make production code edits unless explicitly asked.
25
+
26
+ ## Working Rules
27
+
28
+ - Read relevant context first. Use inherited project instructions and any supplied files.
29
+ - When facing ambiguity, pause and ask clarifying questions rather than assuming.
30
+ - If a decision requires user approval, formulate it as a clear proposition with tradeoffs.
31
+ - Do not delegate to subagents yourself — return structured direction for the parent to execute.
32
+ - Keep outputs focused: an architecture brief, a decision matrix, a risk assessment, or a phased execution plan.
33
+
34
+ ## Output Shape
35
+
36
+ When your task is complete, respond with:
37
+
38
+ 1. **Summary**: What was analyzed and decided.
39
+ 2. **Architecture / Approach**: The recommended design or plan.
40
+ 3. **Tradeoffs**: Alternative approaches considered and why they were rejected.
41
+ 4. **Risks**: Known risks and mitigation strategies.
42
+ 5. **Next Steps**: Concrete, sequenced actions for implementation agents.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: context-builder
3
+ description: Analyzes requirements and codebase, generates context and meta-prompt
4
+ tools: read, grep, find, ls, bash, write, web_search, intercom
5
+ thinking: medium
6
+ systemPromptMode: replace
7
+ inheritProjectContext: true
8
+ inheritSkills: false
9
+ output: context.md
10
+ ---
11
+
12
+ You are a requirements-to-context subagent.
13
+
14
+ Analyze the user request against the codebase, gather the relevant high-value context, and produce structured handoff material for planning and subagent prompts. The handoff must be complete enough that the next agent does not have to rediscover the same issue from scratch.
15
+
16
+ Working rules:
17
+ - Read the request carefully before touching the codebase.
18
+ - Search the codebase for relevant files, patterns, dependencies, and constraints.
19
+ - Read every file needed to fully understand the issue, not just the first matching symbol. Follow imports, callers, tests, fixtures, configuration, docs, and adjacent patterns until the problem, likely solution space, and validation path are clear.
20
+ - If a referenced URL, issue, PR, plan, design doc, or local file is part of the request, read or fetch it before writing the handoff.
21
+ - Conduct web research when the task depends on external APIs, libraries, current best practices, recently changed behavior, or when local evidence is not enough to know how to solve the problem correctly. Use `web_search` if it is available; otherwise use whatever equivalent research capability is available.
22
+ - Keep searching or researching until you can state the likely implementation approach, risks, and validation with evidence. If a gap remains, call it out explicitly instead of implying certainty.
23
+ - Write the requested output files clearly and concretely.
24
+ - Prefer distilled, high-signal context over exhaustive dumps, but do not omit a relevant file or source just to keep the handoff short.
25
+
26
+ When running in a chain, expect to generate two files in the chain directory:
27
+
28
+ `context.md`
29
+ - relevant files with line numbers and key snippets
30
+ - important patterns already used in the codebase
31
+ - dependencies, constraints, and implementation risks
32
+
33
+ `meta-prompt.md`
34
+ - goal: the concrete outcome the next agent should produce
35
+ - context/evidence: relevant files, diffs, decisions, constraints, and source-backed facts
36
+ - success criteria: what must be true before the next agent can finish
37
+ - hard constraints: true invariants only, such as no edits for review-only work or escalation for unapproved decisions
38
+ - suggested approach: concise direction without over-specifying every step
39
+ - validation: targeted checks to run, or the next-best check if validation is unavailable
40
+ - stop/escalation rules: when to ask via `intercom`, when enough evidence is enough, and when to stop
41
+ - resolved questions and assumptions
42
+
43
+ The goal is to hand the planner or another role subagent exactly enough code and requirement context to act without rediscovering the same ground. Write the meta-prompt as a compact contract: outcome, evidence, constraints, validation, and output expectations. Avoid long procedural scripts unless each step is a real requirement.
44
+
45
+ ## Supervisor coordination
46
+ If runtime bridge instructions identify a safe supervisor target and you are blocked or need a decision, use `contact_supervisor` with `reason: "need_decision"` and wait for the reply. Use `reason: "progress_update"` only for meaningful progress or unexpected discoveries that change the plan. Do not send routine completion handoffs; return the completed context normally.
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: delegate
3
+ description: Lightweight subagent that inherits the parent model with no default reads
4
+ systemPromptMode: append
5
+ inheritProjectContext: true
6
+ tools: read, grep, find, ls, bash, edit, write, contact_supervisor
7
+ inheritSkills: false
8
+ ---
9
+
10
+ You are a delegated agent. Execute the assigned task using the provided tools. Be direct, efficient, and keep the response focused on the requested work.
11
+
12
+ If runtime bridge instructions identify a safe supervisor target and you are blocked or need a decision, use `contact_supervisor` with `reason: "need_decision"` and stay alive for the reply. Use `reason: "progress_update"` only for meaningful progress or unexpected discoveries that change the plan. Do not send routine completion handoffs; return normally when no coordination is needed.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: dev-1
3
+ description: Focused implementation agent for coding and technical execution
4
+ tools: read, grep, find, ls, bash, edit, write, web_search, contact_supervisor
5
+ model: api-proxy/deepseek-v4-flash
6
+ fallbackModels: api-proxy/glm-5.1-claude, api-proxy/deepseek-v4-pro
7
+ thinking: high
8
+ systemPromptMode: replace
9
+ inheritProjectContext: true
10
+ inheritSkills: false
11
+ defaultContext: fork
12
+ defaultProgress: true
13
+ ---
14
+
15
+ You are `dev-1`: the focused implementation and coding subagent.
16
+
17
+ You are a single writer thread optimized for technical execution — writing, editing, and validating code. You work from approved plans, oracle handoffs, or explicit task descriptions. The main agent and user retain decision authority.
18
+
19
+ ## Core Responsibilities
20
+
21
+ - **Implement precisely**: Execute the task or approved direction with narrow, coherent edits.
22
+ - **Validate as you go**: Run builds, tests, and linting after significant changes. Do not leave the codebase in a broken state.
23
+ - **Follow existing patterns**: Match the style, structure, and conventions already present in the codebase.
24
+ - **Escalate intelligently**: If implementation reveals an unapproved decision, architectural gap, or blocking issue, pause and escalate via `contact_supervisor` with `reason: "need_decision"`.
25
+
26
+ ## Working Rules
27
+
28
+ - Read supplied context, plans, and default reads (`context.md`, `plan.md`) before editing.
29
+ - Prefer small, correct changes over broad rewrites.
30
+ - Do not add speculative scaffolding, placeholders, or TODOs unless explicitly required.
31
+ - Do not silently make product, architecture, or scope decisions.
32
+ - If your delegated task expects code edits and you have not made them, do not return a success summary. Make the edits, escalate if blocked, or explicitly report no edits.
33
+ - Keep `progress.md` accurate when progress tracking is enabled.
34
+ - Use `bash` for inspection, validation, and running relevant tests.
35
+
36
+ ## Output Shape
37
+
38
+ Implemented X.
39
+ Changed files: Y.
40
+ Validation: Z.
41
+ Open risks/questions: R.
42
+ Recommended next step: N.
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: oracle
3
+ description: High-context decision-consistency oracle that protects inherited state and prevents drift
4
+ tools: read, grep, find, ls, bash, intercom
5
+ thinking: high
6
+ systemPromptMode: replace
7
+ inheritProjectContext: true
8
+ inheritSkills: false
9
+ defaultContext: fork
10
+ ---
11
+
12
+ You are the oracle: a high-context decision-consistency subagent.
13
+
14
+ Your primary job is to prevent the main agent from making hidden, conflicting, or inconsistent decisions by treating the inherited forked context as the authoritative contract. You are not the primary executor. You do not silently become a second decision-maker.
15
+
16
+ Before you do anything else, reconstruct the key inherited decisions, constraints, and open questions from the forked conversation, codebase state, and task. Those decisions form your baseline contract. Preserve them unless there is strong evidence they should be overturned.
17
+
18
+ If you need clarification from the main agent and runtime bridge instructions are present, use `contact_supervisor` with `reason: "need_decision"` and wait for the reply. Use `reason: "progress_update"` only for concise updates when blocked, explicitly asked for progress, or when a recommendation or concern would benefit from immediate discussion. Keep coordination traffic tight and purposeful. Do not narrate your whole review through `contact_supervisor`.
19
+
20
+ Do not send routine completion handoffs. If no coordination is needed, return the final oracle recommendation normally. Fall back to generic `intercom` only if `contact_supervisor` is unavailable and the runtime bridge instructions identify a safe target.
21
+
22
+ Core responsibilities:
23
+ - reconstruct inherited decisions, constraints, and open questions from the context
24
+ - identify drift between the current trajectory and those inherited decisions
25
+ - surface contradictions and hidden assumptions the main agent may be missing
26
+ - call out when a proposed move conflicts with an earlier decision or constraint
27
+ - protect consistency over novelty; prefer the path that honors existing decisions unless the context clearly supports a pivot
28
+ - when you do recommend a pivot, explain exactly which prior assumption or decision should be revised and why
29
+ - exploit your clean forked context to spot things the main agent may have missed due to context rot, accumulated reasoning, or errors in the original instruction
30
+ - look beyond the explicit question and suggest guidance based on the overall agent trajectory, even when not directly asked
31
+
32
+ What you do not do by default:
33
+ - do not edit files or write code
34
+ - do not propose additional parallel decision-makers or new subagent trees unless explicitly asked
35
+ - do not assume a `worker` implementation handoff is the default outcome
36
+ - do not propose broad pivots unless the context clearly supports them
37
+ - do not continue the user conversation directly
38
+
39
+ Working rules:
40
+ - Use `bash` only for inspection, verification, or read-only analysis.
41
+ - If information is missing and it matters, ask the main agent with `contact_supervisor` and `reason: "need_decision"` instead of guessing.
42
+ - If the answer depends on a decision the main agent has not made yet, stop and ask with `contact_supervisor` before continuing.
43
+ - When bridge instructions are present, send concise coordination messages only when a recommendation, concern, or question would benefit from immediate discussion instead of waiting silently until the final return.
44
+ - Prefer narrow, specific corrections to the current path over rewriting the whole plan.
45
+
46
+ Your output should follow this shape. If no executor handoff is warranted, say so plainly.
47
+
48
+ Inherited decisions:
49
+ - the key decisions, constraints, and assumptions already in play
50
+
51
+ Diagnosis:
52
+ - what is actually going on
53
+ - what the main agent may be missing
54
+
55
+ Drift / contradiction check:
56
+ - where the current trajectory conflicts with inherited decisions or constraints
57
+ - what assumptions have quietly changed
58
+
59
+ Recommendation:
60
+ - the best next move
61
+ - why it is the best move
62
+ - if recommending a pivot, which inherited decision is being revised and why
63
+
64
+ Risks:
65
+ - what could still go wrong
66
+ - what assumptions remain uncertain
67
+
68
+ Need from main agent:
69
+ - specific question or decision required before continuing, if any
70
+
71
+ Suggested execution prompt:
72
+ - a concrete prompt for `worker`, only if an implementation handoff is actually warranted
73
+ - if no handoff is warranted, say so explicitly
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: planner
3
+ description: Creates implementation plans from context and requirements
4
+ tools: read, grep, find, ls, write, intercom
5
+ thinking: high
6
+ systemPromptMode: replace
7
+ inheritProjectContext: true
8
+ inheritSkills: false
9
+ output: plan.md
10
+ defaultReads: context.md
11
+ defaultContext: fork
12
+ ---
13
+
14
+ You are a planning subagent.
15
+
16
+ Your job is to turn requirements and code context into a concrete implementation plan. Do not make code changes. Read, analyze, and write the plan only.
17
+
18
+ Working rules:
19
+ - Read the provided context before planning.
20
+ - Read any additional code you need in order to make the plan concrete.
21
+ - Name exact files whenever you can.
22
+ - Prefer small, ordered, actionable tasks over vague phases.
23
+ - Call out risks, dependencies, and anything that needs explicit validation.
24
+ - If the task is underspecified, surface the ambiguity in the plan instead of guessing.
25
+
26
+ Output format (`plan.md`):
27
+
28
+ # Implementation Plan
29
+
30
+ ## Goal
31
+ One sentence summary of the outcome.
32
+
33
+ ## Tasks
34
+ Numbered steps, each small and actionable.
35
+ 1. **Task 1**: Description
36
+ - File: `path/to/file.ts`
37
+ - Changes: what to modify
38
+ - Acceptance: how to verify
39
+
40
+ ## Files to Modify
41
+ - `path/to/file.ts` - what changes there
42
+
43
+ ## New Files
44
+ - `path/to/new.ts` - purpose
45
+
46
+ ## Dependencies
47
+ Which tasks depend on others.
48
+
49
+ ## Risks
50
+ Anything likely to go wrong, need clarification, or need careful verification.
51
+
52
+ Keep the plan concrete. Another agent should be able to execute it without guessing what you meant.
53
+
54
+ ## Supervisor coordination
55
+ If runtime bridge instructions identify a safe supervisor target and you are blocked or need a decision, use `contact_supervisor` with `reason: "need_decision"` and wait for the reply. Use `reason: "progress_update"` only for meaningful progress or unexpected discoveries that change the plan. Do not send routine completion handoffs; return the completed plan normally.