pi-crew 0.1.37 → 0.1.39

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 (162) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +27 -0
  3. package/README.md +5 -0
  4. package/agents/analyst.md +11 -11
  5. package/agents/critic.md +11 -11
  6. package/agents/executor.md +11 -11
  7. package/agents/explorer.md +11 -11
  8. package/agents/planner.md +11 -11
  9. package/agents/reviewer.md +11 -11
  10. package/agents/security-reviewer.md +11 -11
  11. package/agents/test-engineer.md +11 -11
  12. package/agents/verifier.md +11 -11
  13. package/agents/writer.md +11 -11
  14. package/docs/refactor-tasks-phase3.md +394 -394
  15. package/docs/refactor-tasks-phase4.md +564 -564
  16. package/docs/refactor-tasks-phase5.md +402 -402
  17. package/docs/refactor-tasks-phase6.md +662 -662
  18. package/docs/research-extension-examples.md +297 -297
  19. package/docs/research-extension-system.md +324 -324
  20. package/docs/research-optimization-plan.md +548 -548
  21. package/docs/research-pi-coding-agent.md +357 -357
  22. package/docs/research-source-pi-crew-reference.md +174 -174
  23. package/docs/resource-formats.md +10 -8
  24. package/docs/runtime-flow.md +148 -148
  25. package/docs/source-runtime-refactor-map.md +83 -83
  26. package/docs/usage.md +6 -0
  27. package/index.ts +6 -6
  28. package/package.json +3 -3
  29. package/schema.json +2 -2
  30. package/src/agents/agent-serializer.ts +34 -34
  31. package/src/config/config.ts +8 -4
  32. package/src/extension/cross-extension-rpc.ts +82 -82
  33. package/src/extension/import-index.ts +18 -2
  34. package/src/extension/register.ts +11 -1
  35. package/src/extension/registration/compaction-guard.ts +125 -125
  36. package/src/extension/registration/subagent-helpers.ts +30 -6
  37. package/src/extension/registration/subagent-tools.ts +8 -3
  38. package/src/extension/result-watcher.ts +98 -98
  39. package/src/extension/run-import.ts +12 -2
  40. package/src/extension/run-index.ts +12 -2
  41. package/src/extension/run-maintenance.ts +24 -24
  42. package/src/extension/team-tool/api.ts +54 -14
  43. package/src/extension/team-tool/cancel.ts +31 -31
  44. package/src/extension/team-tool/doctor.ts +179 -179
  45. package/src/extension/team-tool/inspect.ts +41 -41
  46. package/src/extension/team-tool/lifecycle-actions.ts +79 -79
  47. package/src/extension/team-tool/plan.ts +19 -19
  48. package/src/extension/team-tool/status.ts +73 -73
  49. package/src/observability/correlation.ts +35 -35
  50. package/src/observability/event-to-metric.ts +54 -54
  51. package/src/observability/exporters/adapter.ts +24 -24
  52. package/src/observability/exporters/otlp-exporter.ts +65 -65
  53. package/src/observability/exporters/prometheus-exporter.ts +47 -47
  54. package/src/observability/metric-registry.ts +72 -72
  55. package/src/observability/metric-retention.ts +46 -46
  56. package/src/observability/metric-sink.ts +51 -51
  57. package/src/observability/metrics-primitives.ts +166 -166
  58. package/src/prompt/prompt-runtime.ts +68 -68
  59. package/src/runtime/agent-control.ts +64 -64
  60. package/src/runtime/agent-memory.ts +72 -72
  61. package/src/runtime/agent-observability.ts +114 -113
  62. package/src/runtime/async-marker.ts +26 -26
  63. package/src/runtime/background-runner.ts +53 -53
  64. package/src/runtime/crash-recovery.ts +56 -56
  65. package/src/runtime/crew-agent-records.ts +54 -9
  66. package/src/runtime/crew-agent-runtime.ts +58 -58
  67. package/src/runtime/deadletter.ts +36 -36
  68. package/src/runtime/direct-run.ts +35 -35
  69. package/src/runtime/foreground-control.ts +82 -82
  70. package/src/runtime/green-contract.ts +46 -46
  71. package/src/runtime/group-join.ts +88 -88
  72. package/src/runtime/heartbeat-gradient.ts +28 -28
  73. package/src/runtime/heartbeat-watcher.ts +80 -80
  74. package/src/runtime/live-agent-control.ts +87 -78
  75. package/src/runtime/live-agent-manager.ts +85 -85
  76. package/src/runtime/live-control-realtime.ts +36 -36
  77. package/src/runtime/live-session-runtime.ts +299 -299
  78. package/src/runtime/manifest-cache.ts +248 -212
  79. package/src/runtime/model-fallback.ts +261 -261
  80. package/src/runtime/parallel-research.ts +44 -44
  81. package/src/runtime/parallel-utils.ts +99 -99
  82. package/src/runtime/pi-json-output.ts +111 -111
  83. package/src/runtime/policy-engine.ts +78 -78
  84. package/src/runtime/post-exit-stdio-guard.ts +86 -86
  85. package/src/runtime/process-status.ts +56 -56
  86. package/src/runtime/progress-event-coalescer.ts +43 -43
  87. package/src/runtime/recovery-recipes.ts +74 -74
  88. package/src/runtime/retry-executor.ts +59 -59
  89. package/src/runtime/role-permission.ts +39 -39
  90. package/src/runtime/session-usage.ts +79 -79
  91. package/src/runtime/sidechain-output.ts +28 -28
  92. package/src/runtime/subagent-manager.ts +80 -12
  93. package/src/runtime/task-display.ts +38 -38
  94. package/src/runtime/task-output-context.ts +127 -106
  95. package/src/runtime/task-runner/live-executor.ts +98 -98
  96. package/src/runtime/task-runner/progress.ts +111 -111
  97. package/src/runtime/task-runner/result-utils.ts +14 -14
  98. package/src/runtime/task-runner/state-helpers.ts +22 -22
  99. package/src/runtime/team-runner.ts +1 -1
  100. package/src/runtime/worker-heartbeat.ts +21 -21
  101. package/src/runtime/worker-startup.ts +57 -57
  102. package/src/schema/config-schema.ts +21 -21
  103. package/src/schema/team-tool-schema.ts +100 -100
  104. package/src/state/artifact-store.ts +122 -108
  105. package/src/state/contracts.ts +105 -105
  106. package/src/state/jsonl-writer.ts +77 -77
  107. package/src/state/mailbox.ts +67 -22
  108. package/src/state/state-store.ts +36 -5
  109. package/src/state/task-claims.ts +42 -42
  110. package/src/state/usage.ts +29 -29
  111. package/src/subagents/async-entry.ts +1 -1
  112. package/src/subagents/index.ts +3 -3
  113. package/src/subagents/live/control.ts +1 -1
  114. package/src/subagents/live/manager.ts +1 -1
  115. package/src/subagents/live/realtime.ts +1 -1
  116. package/src/subagents/live/session-runtime.ts +1 -1
  117. package/src/subagents/manager.ts +1 -1
  118. package/src/subagents/spawn.ts +1 -1
  119. package/src/teams/discover-teams.ts +27 -5
  120. package/src/teams/team-serializer.ts +38 -36
  121. package/src/types/diff.d.ts +18 -18
  122. package/src/ui/crew-footer.ts +101 -101
  123. package/src/ui/crew-select-list.ts +111 -111
  124. package/src/ui/dashboard-panes/metrics-pane.ts +34 -34
  125. package/src/ui/dynamic-border.ts +25 -25
  126. package/src/ui/layout-primitives.ts +106 -106
  127. package/src/ui/loaders.ts +158 -158
  128. package/src/ui/mascot.ts +441 -441
  129. package/src/ui/render-diff.ts +119 -119
  130. package/src/ui/run-dashboard.ts +5 -2
  131. package/src/ui/run-snapshot-cache.ts +19 -8
  132. package/src/ui/spinner.ts +17 -17
  133. package/src/ui/status-colors.ts +54 -54
  134. package/src/ui/syntax-highlight.ts +116 -116
  135. package/src/ui/transcript-viewer.ts +15 -1
  136. package/src/utils/completion-dedupe.ts +63 -63
  137. package/src/utils/file-coalescer.ts +84 -84
  138. package/src/utils/frontmatter.ts +36 -36
  139. package/src/utils/fs-watch.ts +31 -31
  140. package/src/utils/git.ts +262 -262
  141. package/src/utils/ids.ts +12 -12
  142. package/src/utils/names.ts +26 -26
  143. package/src/utils/paths.ts +3 -2
  144. package/src/utils/safe-paths.ts +34 -0
  145. package/src/utils/sleep.ts +32 -32
  146. package/src/utils/timings.ts +31 -31
  147. package/src/utils/visual.ts +159 -159
  148. package/src/workflows/discover-workflows.ts +30 -3
  149. package/src/workflows/validate-workflow.ts +40 -40
  150. package/src/worktree/branch-freshness.ts +45 -45
  151. package/teams/default.team.md +12 -12
  152. package/teams/fast-fix.team.md +11 -11
  153. package/teams/implementation.team.md +18 -18
  154. package/teams/parallel-research.team.md +14 -14
  155. package/teams/research.team.md +11 -11
  156. package/teams/review.team.md +12 -12
  157. package/workflows/default.workflow.md +29 -29
  158. package/workflows/fast-fix.workflow.md +22 -22
  159. package/workflows/implementation.workflow.md +38 -38
  160. package/workflows/parallel-research.workflow.md +46 -46
  161. package/workflows/research.workflow.md +22 -22
  162. package/workflows/review.workflow.md +30 -30
@@ -1,45 +1,45 @@
1
- import { execFileSync } from "node:child_process";
2
-
3
- export type BranchFreshnessStatus = "fresh" | "stale" | "diverged" | "unknown";
4
- export type StaleBranchPolicy = "warn" | "block" | "auto_rebase" | "auto_merge_forward";
5
-
6
- export interface BranchFreshness {
7
- status: BranchFreshnessStatus;
8
- branch?: string;
9
- mainRef: string;
10
- ahead: number;
11
- behind: number;
12
- missingFixes: string[];
13
- message: string;
14
- error?: string;
15
- }
16
-
17
- function git(cwd: string, args: string[]): string {
18
- return execFileSync("git", args, { cwd, encoding: "utf-8", stdio: ["ignore", "pipe", "pipe"] }).trim();
19
- }
20
-
21
- function count(cwd: string, range: string): number {
22
- const raw = git(cwd, ["rev-list", "--count", range]);
23
- const parsed = Number.parseInt(raw, 10);
24
- return Number.isFinite(parsed) ? parsed : 0;
25
- }
26
-
27
- export function checkBranchFreshness(cwd: string, mainRef = "main"): BranchFreshness {
28
- try {
29
- git(cwd, ["rev-parse", "--is-inside-work-tree"]);
30
- const branch = git(cwd, ["rev-parse", "--abbrev-ref", "HEAD"]);
31
- const behind = count(cwd, `${branch}..${mainRef}`);
32
- const ahead = count(cwd, `${mainRef}..${branch}`);
33
- const missingFixes = behind > 0 ? git(cwd, ["log", "--format=%s", `${branch}..${mainRef}`]).split("\n").map((line) => line.trim()).filter(Boolean) : [];
34
- if (behind === 0) return { status: "fresh", branch, mainRef, ahead, behind, missingFixes, message: `Branch '${branch}' is fresh against ${mainRef}.` };
35
- if (ahead > 0) return { status: "diverged", branch, mainRef, ahead, behind, missingFixes, message: `Branch '${branch}' diverged from ${mainRef}: ahead=${ahead}, behind=${behind}.` };
36
- return { status: "stale", branch, mainRef, ahead, behind, missingFixes, message: `Branch '${branch}' is ${behind} commit(s) behind ${mainRef}.` };
37
- } catch (error) {
38
- const message = error instanceof Error ? error.message : String(error);
39
- return { status: "unknown", mainRef, ahead: 0, behind: 0, missingFixes: [], message: "Branch freshness could not be determined.", error: message };
40
- }
41
- }
42
-
43
- export function shouldBlockForBranchFreshness(freshness: BranchFreshness, policy: StaleBranchPolicy = "warn"): boolean {
44
- return policy === "block" && (freshness.status === "stale" || freshness.status === "diverged");
45
- }
1
+ import { execFileSync } from "node:child_process";
2
+
3
+ export type BranchFreshnessStatus = "fresh" | "stale" | "diverged" | "unknown";
4
+ export type StaleBranchPolicy = "warn" | "block" | "auto_rebase" | "auto_merge_forward";
5
+
6
+ export interface BranchFreshness {
7
+ status: BranchFreshnessStatus;
8
+ branch?: string;
9
+ mainRef: string;
10
+ ahead: number;
11
+ behind: number;
12
+ missingFixes: string[];
13
+ message: string;
14
+ error?: string;
15
+ }
16
+
17
+ function git(cwd: string, args: string[]): string {
18
+ return execFileSync("git", args, { cwd, encoding: "utf-8", stdio: ["ignore", "pipe", "pipe"] }).trim();
19
+ }
20
+
21
+ function count(cwd: string, range: string): number {
22
+ const raw = git(cwd, ["rev-list", "--count", range]);
23
+ const parsed = Number.parseInt(raw, 10);
24
+ return Number.isFinite(parsed) ? parsed : 0;
25
+ }
26
+
27
+ export function checkBranchFreshness(cwd: string, mainRef = "main"): BranchFreshness {
28
+ try {
29
+ git(cwd, ["rev-parse", "--is-inside-work-tree"]);
30
+ const branch = git(cwd, ["rev-parse", "--abbrev-ref", "HEAD"]);
31
+ const behind = count(cwd, `${branch}..${mainRef}`);
32
+ const ahead = count(cwd, `${mainRef}..${branch}`);
33
+ const missingFixes = behind > 0 ? git(cwd, ["log", "--format=%s", `${branch}..${mainRef}`]).split("\n").map((line) => line.trim()).filter(Boolean) : [];
34
+ if (behind === 0) return { status: "fresh", branch, mainRef, ahead, behind, missingFixes, message: `Branch '${branch}' is fresh against ${mainRef}.` };
35
+ if (ahead > 0) return { status: "diverged", branch, mainRef, ahead, behind, missingFixes, message: `Branch '${branch}' diverged from ${mainRef}: ahead=${ahead}, behind=${behind}.` };
36
+ return { status: "stale", branch, mainRef, ahead, behind, missingFixes, message: `Branch '${branch}' is ${behind} commit(s) behind ${mainRef}.` };
37
+ } catch (error) {
38
+ const message = error instanceof Error ? error.message : String(error);
39
+ return { status: "unknown", mainRef, ahead: 0, behind: 0, missingFixes: [], message: "Branch freshness could not be determined.", error: message };
40
+ }
41
+ }
42
+
43
+ export function shouldBlockForBranchFreshness(freshness: BranchFreshness, policy: StaleBranchPolicy = "warn"): boolean {
44
+ return policy === "block" && (freshness.status === "stale" || freshness.status === "diverged");
45
+ }
@@ -1,12 +1,12 @@
1
- ---
2
- name: default
3
- description: Balanced team for ordinary implementation tasks
4
- defaultWorkflow: default
5
- workspaceMode: single
6
- maxConcurrency: 2
7
- ---
8
-
9
- - explorer: agent=explorer fast discovery
10
- - planner: agent=planner plan the work
11
- - executor: agent=executor implement changes
12
- - verifier: agent=verifier verify completion
1
+ ---
2
+ name: default
3
+ description: Balanced team for ordinary implementation tasks
4
+ defaultWorkflow: default
5
+ workspaceMode: single
6
+ maxConcurrency: 2
7
+ ---
8
+
9
+ - explorer: agent=explorer fast discovery
10
+ - planner: agent=planner plan the work
11
+ - executor: agent=executor implement changes
12
+ - verifier: agent=verifier verify completion
@@ -1,11 +1,11 @@
1
- ---
2
- name: fast-fix
3
- description: Small team for quick bug fixes
4
- defaultWorkflow: fast-fix
5
- workspaceMode: single
6
- maxConcurrency: 1
7
- ---
8
-
9
- - explorer: agent=explorer find the relevant files
10
- - executor: agent=executor make the fix
11
- - verifier: agent=verifier verify the fix
1
+ ---
2
+ name: fast-fix
3
+ description: Small team for quick bug fixes
4
+ defaultWorkflow: fast-fix
5
+ workspaceMode: single
6
+ maxConcurrency: 1
7
+ ---
8
+
9
+ - explorer: agent=explorer find the relevant files
10
+ - executor: agent=executor make the fix
11
+ - verifier: agent=verifier verify the fix
@@ -1,18 +1,18 @@
1
- ---
2
- name: implementation
3
- description: Full implementation team with parallel specialists, critique, execution, review, and verification
4
- defaultWorkflow: implementation
5
- workspaceMode: single
6
- maxConcurrency: 3
7
- ---
8
-
9
- - explorer: agent=explorer map the codebase
10
- - analyst: agent=analyst clarify requirements and constraints
11
- - planner: agent=planner create execution plan
12
- - critic: agent=critic challenge and synthesize specialist findings
13
- - executor: agent=executor implement the plan
14
- - reviewer: agent=reviewer review the implementation
15
- - security-reviewer: agent=security-reviewer review security and trust boundaries
16
- - test-engineer: agent=test-engineer design and run verification
17
- - verifier: agent=verifier verify done
18
- - writer: agent=writer summarize documentation or release notes when needed
1
+ ---
2
+ name: implementation
3
+ description: Full implementation team with parallel specialists, critique, execution, review, and verification
4
+ defaultWorkflow: implementation
5
+ workspaceMode: single
6
+ maxConcurrency: 3
7
+ ---
8
+
9
+ - explorer: agent=explorer map the codebase
10
+ - analyst: agent=analyst clarify requirements and constraints
11
+ - planner: agent=planner create execution plan
12
+ - critic: agent=critic challenge and synthesize specialist findings
13
+ - executor: agent=executor implement the plan
14
+ - reviewer: agent=reviewer review the implementation
15
+ - security-reviewer: agent=security-reviewer review security and trust boundaries
16
+ - test-engineer: agent=test-engineer design and run verification
17
+ - verifier: agent=verifier verify done
18
+ - writer: agent=writer summarize documentation or release notes when needed
@@ -1,14 +1,14 @@
1
- ---
2
- name: parallel-research
3
- description: Parallel research team for multi-project/source audits
4
- workspaceMode: single
5
- defaultWorkflow: parallel-research
6
- maxConcurrency: 4
7
- triggers: đọc sâu, deep read, deep research, source audit, multiple projects, parallel research, pi-*
8
- category: research
9
- cost: cheap
10
- ---
11
-
12
- - explorer: agent=explorer gather source facts in parallel shards
13
- - analyst: agent=analyst synthesize shard findings
14
- - writer: agent=writer produce final notes
1
+ ---
2
+ name: parallel-research
3
+ description: Parallel research team for multi-project/source audits
4
+ workspaceMode: single
5
+ defaultWorkflow: parallel-research
6
+ maxConcurrency: 4
7
+ triggers: đọc sâu, deep read, deep research, source audit, multiple projects, parallel research, pi-*
8
+ category: research
9
+ cost: cheap
10
+ ---
11
+
12
+ - explorer: agent=explorer gather source facts in parallel shards
13
+ - analyst: agent=analyst synthesize shard findings
14
+ - writer: agent=writer produce final notes
@@ -1,11 +1,11 @@
1
- ---
2
- name: research
3
- description: Team for investigation and documentation
4
- defaultWorkflow: research
5
- workspaceMode: single
6
- maxConcurrency: 2
7
- ---
8
-
9
- - explorer: agent=explorer gather codebase facts
10
- - analyst: agent=analyst analyze findings
11
- - writer: agent=writer produce final notes
1
+ ---
2
+ name: research
3
+ description: Team for investigation and documentation
4
+ defaultWorkflow: research
5
+ workspaceMode: single
6
+ maxConcurrency: 2
7
+ ---
8
+
9
+ - explorer: agent=explorer gather codebase facts
10
+ - analyst: agent=analyst analyze findings
11
+ - writer: agent=writer produce final notes
@@ -1,12 +1,12 @@
1
- ---
2
- name: review
3
- description: Team for code review and security review
4
- defaultWorkflow: review
5
- workspaceMode: single
6
- maxConcurrency: 2
7
- ---
8
-
9
- - explorer: agent=explorer understand changed areas
10
- - reviewer: agent=reviewer review correctness and maintainability
11
- - security-reviewer: agent=security-reviewer review security risks
12
- - verifier: agent=verifier summarize pass/fail
1
+ ---
2
+ name: review
3
+ description: Team for code review and security review
4
+ defaultWorkflow: review
5
+ workspaceMode: single
6
+ maxConcurrency: 2
7
+ ---
8
+
9
+ - explorer: agent=explorer understand changed areas
10
+ - reviewer: agent=reviewer review correctness and maintainability
11
+ - security-reviewer: agent=security-reviewer review security risks
12
+ - verifier: agent=verifier summarize pass/fail
@@ -1,29 +1,29 @@
1
- ---
2
- name: default
3
- description: Explore, plan, execute, and verify
4
- ---
5
-
6
- ## explore
7
- role: explorer
8
-
9
- Explore the codebase for the goal: {goal}
10
-
11
- ## plan
12
- role: planner
13
- dependsOn: explore
14
- output: plan.md
15
-
16
- Create a concise implementation plan for: {goal}
17
-
18
- ## execute
19
- role: executor
20
- dependsOn: plan
21
-
22
- Implement the plan for: {goal}
23
-
24
- ## verify
25
- role: verifier
26
- dependsOn: execute
27
- verify: true
28
-
29
- Verify completion for: {goal}
1
+ ---
2
+ name: default
3
+ description: Explore, plan, execute, and verify
4
+ ---
5
+
6
+ ## explore
7
+ role: explorer
8
+
9
+ Explore the codebase for the goal: {goal}
10
+
11
+ ## plan
12
+ role: planner
13
+ dependsOn: explore
14
+ output: plan.md
15
+
16
+ Create a concise implementation plan for: {goal}
17
+
18
+ ## execute
19
+ role: executor
20
+ dependsOn: plan
21
+
22
+ Implement the plan for: {goal}
23
+
24
+ ## verify
25
+ role: verifier
26
+ dependsOn: execute
27
+ verify: true
28
+
29
+ Verify completion for: {goal}
@@ -1,22 +1,22 @@
1
- ---
2
- name: fast-fix
3
- description: Minimal workflow for small fixes
4
- ---
5
-
6
- ## explore
7
- role: explorer
8
-
9
- Find the likely source of the issue: {goal}
10
-
11
- ## execute
12
- role: executor
13
- dependsOn: explore
14
-
15
- Make the smallest safe fix.
16
-
17
- ## verify
18
- role: verifier
19
- dependsOn: execute
20
- verify: true
21
-
22
- Verify the fix with available evidence.
1
+ ---
2
+ name: fast-fix
3
+ description: Minimal workflow for small fixes
4
+ ---
5
+
6
+ ## explore
7
+ role: explorer
8
+
9
+ Find the likely source of the issue: {goal}
10
+
11
+ ## execute
12
+ role: executor
13
+ dependsOn: explore
14
+
15
+ Make the smallest safe fix.
16
+
17
+ ## verify
18
+ role: verifier
19
+ dependsOn: execute
20
+ verify: true
21
+
22
+ Verify the fix with available evidence.
@@ -1,38 +1,38 @@
1
- ---
2
- name: implementation
3
- description: Adaptive implementation workflow where a planner agent decides the subagent fanout
4
- ---
5
-
6
- ## assess
7
- role: planner
8
- output: adaptive-plan.json
9
-
10
- Assess this task and decide how many subagents are actually needed for: {goal}
11
-
12
- You are the orchestration planner. Inspect the repository enough to choose an efficient crew; do not use a fixed template. Small/simple tasks may need one executor plus one verifier. Risky or broad tasks may need parallel explorers, specialists, implementers, reviewers, security reviewers, or test engineers.
13
-
14
- Return a concise rationale, then include exactly one JSON block between these markers:
15
-
16
- ADAPTIVE_PLAN_JSON_START
17
- {
18
- "phases": [
19
- {
20
- "name": "short-phase-name",
21
- "tasks": [
22
- {
23
- "role": "explorer|analyst|planner|critic|executor|reviewer|security-reviewer|test-engineer|verifier|writer",
24
- "title": "short task title",
25
- "task": "specific autonomous task prompt for this subagent"
26
- }
27
- ]
28
- }
29
- ]
30
- }
31
- ADAPTIVE_PLAN_JSON_END
32
-
33
- Rules:
34
- - Choose the smallest effective number of subagents.
35
- - Use parallel tasks in the same phase only when their work is independent.
36
- - Later phases depend on all tasks in the previous phase.
37
- - Include verification/review tasks when implementation is requested.
38
- - Do not include more than 12 total subagents; split or summarize oversized plans instead.
1
+ ---
2
+ name: implementation
3
+ description: Adaptive implementation workflow where a planner agent decides the subagent fanout
4
+ ---
5
+
6
+ ## assess
7
+ role: planner
8
+ output: adaptive-plan.json
9
+
10
+ Assess this task and decide how many subagents are actually needed for: {goal}
11
+
12
+ You are the orchestration planner. Inspect the repository enough to choose an efficient crew; do not use a fixed template. Small/simple tasks may need one executor plus one verifier. Risky or broad tasks may need parallel explorers, specialists, implementers, reviewers, security reviewers, or test engineers.
13
+
14
+ Return a concise rationale, then include exactly one JSON block between these markers:
15
+
16
+ ADAPTIVE_PLAN_JSON_START
17
+ {
18
+ "phases": [
19
+ {
20
+ "name": "short-phase-name",
21
+ "tasks": [
22
+ {
23
+ "role": "explorer|analyst|planner|critic|executor|reviewer|security-reviewer|test-engineer|verifier|writer",
24
+ "title": "short task title",
25
+ "task": "specific autonomous task prompt for this subagent"
26
+ }
27
+ ]
28
+ }
29
+ ]
30
+ }
31
+ ADAPTIVE_PLAN_JSON_END
32
+
33
+ Rules:
34
+ - Choose the smallest effective number of subagents.
35
+ - Use parallel tasks in the same phase only when their work is independent.
36
+ - Later phases depend on all tasks in the previous phase.
37
+ - Include verification/review tasks when implementation is requested.
38
+ - Do not include more than 12 total subagents; split or summarize oversized plans instead.
@@ -1,46 +1,46 @@
1
- ---
2
- name: parallel-research
3
- description: Parallel research with shard exploration and synthesis
4
- ---
5
-
6
- ## discover
7
- role: explorer
8
-
9
- Discover the relevant files/projects for: {goal}. Return a shard plan with paths grouped by topic. Do not deeply read every file yet; focus on routing the work.
10
-
11
- ## explore-core
12
- role: explorer
13
- parallelGroup: explore
14
-
15
- Explore the core/runtime shard from the discover output. Focus on architecture, package config, docs, and reusable patterns for: {goal}
16
-
17
- ## explore-ui
18
- role: explorer
19
- parallelGroup: explore
20
-
21
- Explore the UI/TUI/extension-interface shard from the discover output. Focus on widgets, overlays, commands, status bars, package config, docs, and reusable patterns for: {goal}
22
-
23
- ## explore-runtime
24
- role: explorer
25
- parallelGroup: explore
26
-
27
- Explore the worker/runtime/subagent/runtime-control shard from the discover output. Focus on process/session/runtime orchestration, event streams, logs, package config, docs, and reusable patterns for: {goal}
28
-
29
- ## explore-extensions
30
- role: explorer
31
- parallelGroup: explore
32
-
33
- Explore the extension bundle/small-package shard from the discover output. Focus on package config, extension registration, commands/tools, docs, and reusable patterns for: {goal}
34
-
35
- ## synthesize
36
- role: analyst
37
- dependsOn: explore-core, explore-ui, explore-runtime, explore-extensions
38
-
39
- Synthesize all shard findings. Use discover output if available, but do not require it. Identify common patterns, gaps, and concrete recommendations.
40
-
41
- ## write
42
- role: writer
43
- dependsOn: synthesize
44
- output: research-summary.md
45
-
46
- Write a concise final summary with evidence, risks, and actionable next steps.
1
+ ---
2
+ name: parallel-research
3
+ description: Parallel research with shard exploration and synthesis
4
+ ---
5
+
6
+ ## discover
7
+ role: explorer
8
+
9
+ Discover the relevant files/projects for: {goal}. Return a shard plan with paths grouped by topic. Do not deeply read every file yet; focus on routing the work.
10
+
11
+ ## explore-core
12
+ role: explorer
13
+ parallelGroup: explore
14
+
15
+ Explore the core/runtime shard from the discover output. Focus on architecture, package config, docs, and reusable patterns for: {goal}
16
+
17
+ ## explore-ui
18
+ role: explorer
19
+ parallelGroup: explore
20
+
21
+ Explore the UI/TUI/extension-interface shard from the discover output. Focus on widgets, overlays, commands, status bars, package config, docs, and reusable patterns for: {goal}
22
+
23
+ ## explore-runtime
24
+ role: explorer
25
+ parallelGroup: explore
26
+
27
+ Explore the worker/runtime/subagent/runtime-control shard from the discover output. Focus on process/session/runtime orchestration, event streams, logs, package config, docs, and reusable patterns for: {goal}
28
+
29
+ ## explore-extensions
30
+ role: explorer
31
+ parallelGroup: explore
32
+
33
+ Explore the extension bundle/small-package shard from the discover output. Focus on package config, extension registration, commands/tools, docs, and reusable patterns for: {goal}
34
+
35
+ ## synthesize
36
+ role: analyst
37
+ dependsOn: explore-core, explore-ui, explore-runtime, explore-extensions
38
+
39
+ Synthesize all shard findings. Use discover output if available, but do not require it. Identify common patterns, gaps, and concrete recommendations.
40
+
41
+ ## write
42
+ role: writer
43
+ dependsOn: synthesize
44
+ output: research-summary.md
45
+
46
+ Write a concise final summary with evidence, risks, and actionable next steps.
@@ -1,22 +1,22 @@
1
- ---
2
- name: research
3
- description: Research and write up findings
4
- ---
5
-
6
- ## explore
7
- role: explorer
8
-
9
- Gather relevant facts for: {goal}
10
-
11
- ## analyze
12
- role: analyst
13
- dependsOn: explore
14
-
15
- Analyze and organize the findings.
16
-
17
- ## write
18
- role: writer
19
- dependsOn: analyze
20
- output: research-summary.md
21
-
22
- Write a concise final summary with evidence and open questions.
1
+ ---
2
+ name: research
3
+ description: Research and write up findings
4
+ ---
5
+
6
+ ## explore
7
+ role: explorer
8
+
9
+ Gather relevant facts for: {goal}
10
+
11
+ ## analyze
12
+ role: analyst
13
+ dependsOn: explore
14
+
15
+ Analyze and organize the findings.
16
+
17
+ ## write
18
+ role: writer
19
+ dependsOn: analyze
20
+ output: research-summary.md
21
+
22
+ Write a concise final summary with evidence and open questions.
@@ -1,30 +1,30 @@
1
- ---
2
- name: review
3
- description: Review workflow for correctness and security
4
- ---
5
-
6
- ## explore
7
- role: explorer
8
-
9
- Identify changed or relevant areas for review: {goal}
10
-
11
- ## code-review
12
- role: reviewer
13
- dependsOn: explore
14
- parallelGroup: review
15
-
16
- Review correctness, maintainability, tests, and regressions.
17
-
18
- ## security-review
19
- role: security-reviewer
20
- dependsOn: explore
21
- parallelGroup: review
22
-
23
- Review security risks and trust boundaries.
24
-
25
- ## verify
26
- role: verifier
27
- dependsOn: code-review, security-review
28
- verify: true
29
-
30
- Summarize review outcome and pass/fail status.
1
+ ---
2
+ name: review
3
+ description: Review workflow for correctness and security
4
+ ---
5
+
6
+ ## explore
7
+ role: explorer
8
+
9
+ Identify changed or relevant areas for review: {goal}
10
+
11
+ ## code-review
12
+ role: reviewer
13
+ dependsOn: explore
14
+ parallelGroup: review
15
+
16
+ Review correctness, maintainability, tests, and regressions.
17
+
18
+ ## security-review
19
+ role: security-reviewer
20
+ dependsOn: explore
21
+ parallelGroup: review
22
+
23
+ Review security risks and trust boundaries.
24
+
25
+ ## verify
26
+ role: verifier
27
+ dependsOn: code-review, security-review
28
+ verify: true
29
+
30
+ Summarize review outcome and pass/fail status.