@fro.bot/systematic 2.27.0 → 2.28.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.
package/dist/cli.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  findCommandsInDir,
7
7
  findSkillsInDir,
8
8
  getConfigPaths
9
- } from "./index-3q3ns1xh.js";
9
+ } from "./index-ybqr13k7.js";
10
10
 
11
11
  // src/cli.ts
12
12
  import fs from "fs";
@@ -15839,6 +15839,7 @@ var BUNDLED_SKILL_NAMES = [
15839
15839
  "git-worktree",
15840
15840
  "lfg",
15841
15841
  "onboarding",
15842
+ "orchestrating-subagents",
15842
15843
  "orchestrating-swarms",
15843
15844
  "proof",
15844
15845
  "rclone",
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  loadConfig,
14
14
  loadConfigWithSources,
15
15
  parseFrontmatter
16
- } from "./index-3q3ns1xh.js";
16
+ } from "./index-ybqr13k7.js";
17
17
 
18
18
  // src/index.ts
19
19
  import fs5 from "fs";
@@ -1,5 +1,5 @@
1
1
  export declare const BUNDLED_AGENT_NAMES: readonly ["adversarial-document-reviewer", "adversarial-reviewer", "agent-native-reviewer", "ankane-readme-writer", "api-contract-reviewer", "architecture-strategist", "best-practices-researcher", "bug-reproduction-validator", "cli-agent-readiness-reviewer", "cli-readiness-reviewer", "code-simplicity-reviewer", "coherence-reviewer", "correctness-reviewer", "data-integrity-guardian", "data-migration-expert", "data-migrations-reviewer", "deployment-verification-agent", "design-implementation-reviewer", "design-iterator", "design-lens-reviewer", "dhh-rails-reviewer", "feasibility-reviewer", "figma-design-sync", "framework-docs-researcher", "git-history-analyzer", "issue-intelligence-analyst", "julik-frontend-races-reviewer", "kieran-python-reviewer", "kieran-rails-reviewer", "kieran-typescript-reviewer", "learnings-researcher", "lint", "maintainability-reviewer", "pattern-recognition-specialist", "performance-oracle", "performance-reviewer", "pr-comment-resolver", "previous-comments-reviewer", "product-lens-reviewer", "project-standards-reviewer", "reliability-reviewer", "repo-research-analyst", "schema-drift-detector", "scope-guardian-reviewer", "security-lens-reviewer", "security-reviewer", "security-sentinel", "slack-researcher", "spec-flow-analyzer", "systematic-implementer", "testing-reviewer"];
2
2
  export declare const BUNDLED_AGENT_QUALIFIED_IDS: readonly ["design/design-implementation-reviewer", "design/design-iterator", "design/figma-design-sync", "docs/ankane-readme-writer", "document-review/adversarial-document-reviewer", "document-review/coherence-reviewer", "document-review/design-lens-reviewer", "document-review/feasibility-reviewer", "document-review/product-lens-reviewer", "document-review/scope-guardian-reviewer", "document-review/security-lens-reviewer", "research/best-practices-researcher", "research/framework-docs-researcher", "research/git-history-analyzer", "research/issue-intelligence-analyst", "research/learnings-researcher", "research/repo-research-analyst", "research/slack-researcher", "review/adversarial-reviewer", "review/agent-native-reviewer", "review/api-contract-reviewer", "review/architecture-strategist", "review/cli-agent-readiness-reviewer", "review/cli-readiness-reviewer", "review/code-simplicity-reviewer", "review/correctness-reviewer", "review/data-integrity-guardian", "review/data-migration-expert", "review/data-migrations-reviewer", "review/deployment-verification-agent", "review/dhh-rails-reviewer", "review/julik-frontend-races-reviewer", "review/kieran-python-reviewer", "review/kieran-rails-reviewer", "review/kieran-typescript-reviewer", "review/maintainability-reviewer", "review/pattern-recognition-specialist", "review/performance-oracle", "review/performance-reviewer", "review/previous-comments-reviewer", "review/project-standards-reviewer", "review/reliability-reviewer", "review/schema-drift-detector", "review/security-reviewer", "review/security-sentinel", "review/testing-reviewer", "workflow/bug-reproduction-validator", "workflow/lint", "workflow/pr-comment-resolver", "workflow/spec-flow-analyzer", "workflow/systematic-implementer"];
3
- export declare const BUNDLED_SKILL_NAMES: readonly ["agent-browser", "agent-native-architecture", "agent-native-audit", "andrew-kane-gem-writer", "ce:brainstorm", "ce:compound", "ce:compound-refresh", "ce:ideate", "ce:plan", "ce:review", "ce:work", "changelog", "claude-permissions-optimizer", "compound-docs", "deepen-plan", "deploy-docs", "dhh-rails-style", "document-review", "dspy-ruby", "every-style-editor", "feature-video", "frontend-design", "gemini-imagegen", "generate_command", "git-clean-gone-branches", "git-commit", "git-commit-push-pr", "git-worktree", "lfg", "onboarding", "orchestrating-swarms", "proof", "rclone", "report-bug-ce", "reproduce-bug", "resolve-pr-feedback", "setup", "slfg", "test-browser", "test-driven-development", "test-xcode", "todo-create", "todo-resolve", "todo-triage", "using-systematic", "writing-skills", "writing-systematic-skills"];
3
+ export declare const BUNDLED_SKILL_NAMES: readonly ["agent-browser", "agent-native-architecture", "agent-native-audit", "andrew-kane-gem-writer", "ce:brainstorm", "ce:compound", "ce:compound-refresh", "ce:ideate", "ce:plan", "ce:review", "ce:work", "changelog", "claude-permissions-optimizer", "compound-docs", "deepen-plan", "deploy-docs", "dhh-rails-style", "document-review", "dspy-ruby", "every-style-editor", "feature-video", "frontend-design", "gemini-imagegen", "generate_command", "git-clean-gone-branches", "git-commit", "git-commit-push-pr", "git-worktree", "lfg", "onboarding", "orchestrating-subagents", "orchestrating-swarms", "proof", "rclone", "report-bug-ce", "reproduce-bug", "resolve-pr-feedback", "setup", "slfg", "test-browser", "test-driven-development", "test-xcode", "todo-create", "todo-resolve", "todo-triage", "using-systematic", "writing-skills", "writing-systematic-skills"];
4
4
  export type BundledAgentName = (typeof BUNDLED_AGENT_NAMES)[number];
5
5
  export type BundledSkillName = (typeof BUNDLED_SKILL_NAMES)[number];
@@ -1280,6 +1280,7 @@
1280
1280
  "git-worktree",
1281
1281
  "lfg",
1282
1282
  "onboarding",
1283
+ "orchestrating-subagents",
1283
1284
  "orchestrating-swarms",
1284
1285
  "proof",
1285
1286
  "rclone",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fro.bot/systematic",
3
- "version": "2.27.0",
3
+ "version": "2.28.0",
4
4
  "description": "Structured engineering workflows for OpenCode",
5
5
  "type": "module",
6
6
  "homepage": "https://fro.bot/systematic",
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: orchestrating-subagents
3
+ description: Use when dispatching parallel or serial subagents in OpenCode, coordinating multi-unit plan execution, synthesizing results from independent subagent runs, or handling subagent failure and retry. Triggers on requests to run tasks in parallel, divide work across subagents, orchestrate a pipeline of dependent steps, or coordinate multiple agents without shared-file conflicts.
4
+ ---
5
+
6
+ # Orchestrating Subagents
7
+
8
+ Dispatch, coordinate, and synthesize results from OpenCode subagents using the `task()` primitive.
9
+
10
+ ## The Portable Primitive
11
+
12
+ Every subagent dispatch goes through `task()`:
13
+
14
+ ```typescript
15
+ task({
16
+ subagent_type: "systematic-implementer",
17
+ description: "Implement auth module",
18
+ prompt: "...",
19
+ })
20
+ ```
21
+
22
+ **Required parameters:**
23
+ - `subagent_type` — the registered agent name (e.g., `systematic-implementer`, `best-practices-researcher`)
24
+ - `description` — 3–5 word label shown in the UI
25
+ - `prompt` — full instructions for the subagent
26
+
27
+ **Optional:**
28
+ - `task_id` — resume a prior subagent session instead of creating a new one
29
+ - `command` — the slash command that triggered this task
30
+
31
+ Foreground dispatch (no `background` parameter) blocks until the subagent returns its result. **This is the default and works on all OpenCode versions.**
32
+
33
+ ## Background Dispatch (Experimental)
34
+
35
+ Background dispatch is gated by a runtime flag. It is **not available by default**.
36
+
37
+ ```typescript
38
+ // Only use when the runtime exposes background support
39
+ task({
40
+ subagent_type: "systematic-implementer",
41
+ description: "Implement auth module",
42
+ prompt: "...",
43
+ background: true, // experimental — see below
44
+ })
45
+ ```
46
+
47
+ **When background is available:** OpenCode exposes `task_status` in the tool list and the `task()` tool description includes background mode instructions. This requires `OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true` or the umbrella `OPENCODE_EXPERIMENTAL=true` flag.
48
+
49
+ **When background is unavailable:** `task_status` is not registered. Passing `background: true` returns an error. Fall back to foreground dispatch — dispatch subagents serially or in small foreground batches instead.
50
+
51
+ **Check before assuming:** If you see `task_status` in your available tools, background dispatch is enabled. If you do not see it, use foreground dispatch only.
52
+
53
+ ## Serial vs Parallel Dispatch
54
+
55
+ ### Serial (default, always safe)
56
+
57
+ Dispatch one subagent, wait for its result, then dispatch the next. Use when:
58
+ - Units have dependencies (unit B needs unit A's output)
59
+ - Units touch overlapping files
60
+ - You need to verify each result before proceeding
61
+
62
+ ```typescript
63
+ const researchResult = task({
64
+ subagent_type: "best-practices-researcher",
65
+ description: "Research caching patterns",
66
+ prompt: "Research Redis caching best practices for Rails APIs...",
67
+ })
68
+
69
+ // Use research output to guide implementation
70
+ task({
71
+ subagent_type: "systematic-implementer",
72
+ description: "Implement caching",
73
+ prompt: `Implement caching based on this research:\n\n${researchResult}`,
74
+ })
75
+ ```
76
+
77
+ ### Parallel (foreground batches)
78
+
79
+ Dispatch multiple foreground subagents in the same turn. OpenCode runs them concurrently when dispatched together. Use when:
80
+ - Units are fully independent (no shared files, no dependency on each other's output)
81
+ - You have passed the Parallel Safety Check (see below)
82
+
83
+ ```typescript
84
+ // Dispatch independent review subagents together
85
+ task({ subagent_type: "security-sentinel", description: "Security review", prompt: "..." })
86
+ task({ subagent_type: "performance-oracle", description: "Performance review", prompt: "..." })
87
+ task({ subagent_type: "correctness-reviewer", description: "Correctness review", prompt: "..." })
88
+ // All three run; orchestrator synthesizes results after all complete
89
+ ```
90
+
91
+ ## Parallel Safety Check
92
+
93
+ Before dispatching units in parallel, verify:
94
+
95
+ 1. **No file overlap** — build a file-to-unit map from each unit's declared files. Any file appearing in 2+ units means overlap → use serial dispatch instead.
96
+ 2. **No git index contention** — parallel subagents must not stage files (`git add`), create commits, or run the full test suite. If the current workflow owns git operations, the orchestrator handles staging and committing after all parallel units complete; otherwise, synthesize results and file lists and leave staging/committing to the caller or user.
97
+ 3. **No test interference** — concurrent test runs pick up each other's in-progress changes. Instruct parallel subagents not to run the project test suite.
98
+
99
+ If any check fails, downgrade to serial dispatch. Log the reason (e.g., "Units 2 and 4 share `config/routes.rb` — using serial dispatch").
100
+
101
+ ## Subagent Constraints for Parallel Work
102
+
103
+ When dispatching units in parallel, include these instructions in each subagent's prompt:
104
+
105
+ > Do not stage files (`git add`), create commits, or run the project test suite. Leave staging and committing to the orchestrator or caller.
106
+
107
+ ## Result Synthesis
108
+
109
+ After subagents complete, the orchestrator synthesizes results:
110
+
111
+ 1. **Wait for all** — in a parallel batch, wait for every subagent to finish before acting on any result.
112
+ 2. **Check for file collisions** — compare actual files modified by all subagents in the batch (not just declared files). If 2+ subagents modified the same file, only the last writer's version survives. If the workflow owns git operations, resolve by staging non-colliding files first, then re-running the affected units serially; otherwise, report the collision list to the caller.
113
+ 3. **Review each diff** — verify changes match the unit's declared scope.
114
+ 4. **Run targeted tests** — run the narrowest test command relevant to the changed files.
115
+ 5. **Stage and commit per unit (if the workflow owns git operations)** — in dependency order, stage only that unit's files and commit with a conventional message. If git operations belong to the caller or user, synthesize the result list and file inventory instead.
116
+
117
+ ## Failure and Retry
118
+
119
+ - If a subagent returns an error or its output is incomplete, diagnose before dispatching dependent units.
120
+ - Do not dispatch dependent units on a broken tree.
121
+ - Retry a failed unit by dispatching a new `task()` call with a corrected prompt, or resume the prior session with `task_id`.
122
+ - For background tasks (when available): use `task_status` to poll or wait for terminal state before retrying.
123
+
124
+ ## Quick Reference
125
+
126
+ | Scenario | Approach |
127
+ |---|---|
128
+ | Units have dependencies | Serial foreground dispatch |
129
+ | Units share files | Serial foreground dispatch |
130
+ | Units are independent, no file overlap | Parallel foreground dispatch |
131
+ | Background available + long-running work | Parallel background dispatch with `task_status` |
132
+ | Background unavailable | Foreground only — serial or batched |
133
+ | Subagent fails | Diagnose, fix prompt, retry with new `task()` or resume with `task_id` |
134
+ | File collision detected post-parallel | Stage non-colliding files (if workflow owns git ops), re-run colliding units serially |
135
+
136
+ ## Common Mistakes
137
+
138
+ | Mistake | Fix |
139
+ |---|---|
140
+ | Assuming `task_status` is always available | Check tool list first; fall back to foreground if absent |
141
+ | Parallel subagents staging or committing | Instruct subagents not to stage/commit; the current workflow owner handles git ops when applicable, otherwise synthesize file inventory and results for the caller or user |
142
+ | Dispatching dependent units without waiting | Always wait for prerequisites to complete and verify their output |
143
+ | Ignoring file overlap in parallel batches | Run the Parallel Safety Check before every parallel dispatch |
144
+ | Using `background: true` without checking the flag | Only use when `task_status` appears in available tools |