@melihmucuk/pi-crew 1.0.8 → 1.0.10

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.
@@ -15,26 +15,16 @@ export function registerCrewListTool({ pi, crew, notifyDiscoveryWarnings, }) {
15
15
  const callerSessionId = ctx.sessionManager.getSessionId();
16
16
  const running = crew.getActiveSummariesForOwner(callerSessionId);
17
17
  const lines = [];
18
- lines.push("## Available subagents");
18
+ lines.push("## Available Subagents");
19
19
  if (agents.length === 0) {
20
20
  lines.push("No valid subagent definitions found. Add `.md` files to `<cwd>/.pi/agents/` or `~/.pi/agent/agents/`.");
21
21
  }
22
22
  else {
23
23
  for (const agent of agents) {
24
24
  lines.push("");
25
- lines.push(`**${agent.name}**`);
26
- if (agent.description)
27
- lines.push(` ${agent.description}`);
28
- if (agent.model)
29
- lines.push(` model: ${agent.model}`);
30
- if (agent.interactive)
31
- lines.push(" interactive: true");
32
- if (agent.tools !== undefined) {
33
- lines.push(` tools: ${agent.tools.length > 0 ? agent.tools.join(", ") : "none"}`);
34
- }
35
- if (agent.skills !== undefined) {
36
- lines.push(` skills: ${agent.skills.length > 0 ? agent.skills.join(", ") : "none"}`);
37
- }
25
+ lines.push(`name: ${agent.name}`);
26
+ lines.push(`description: ${agent.description}`);
27
+ lines.push(`interactive: ${agent.interactive ? "true" : "false"}`);
38
28
  }
39
29
  }
40
30
  if (warnings.length > 0) {
@@ -45,7 +35,7 @@ export function registerCrewListTool({ pi, crew, notifyDiscoveryWarnings, }) {
45
35
  }
46
36
  }
47
37
  lines.push("");
48
- lines.push("## Active subagents");
38
+ lines.push("## Active Subagents");
49
39
  if (running.length === 0) {
50
40
  lines.push("No subagents currently active.");
51
41
  }
@@ -53,9 +43,11 @@ export function registerCrewListTool({ pi, crew, notifyDiscoveryWarnings, }) {
53
43
  for (const agent of running) {
54
44
  const icon = STATUS_ICON[agent.status] ?? "❓";
55
45
  lines.push("");
56
- lines.push(`**${agent.id}** (${agent.agentName}) — ${icon} ${agent.status}`);
57
- lines.push(` task: ${agent.taskPreview}`);
58
- lines.push(` turns: ${agent.turns}`);
46
+ lines.push(`id: ${agent.id}`);
47
+ lines.push(`name: ${agent.agentName}`);
48
+ lines.push(`status: ${icon} ${agent.status}`);
49
+ lines.push(`task: ${agent.taskPreview}`);
50
+ lines.push(`turns: ${agent.turns}`);
59
51
  }
60
52
  }
61
53
  const text = lines.join("\n");
@@ -12,6 +12,9 @@ export function registerCrewRespondTool({ pi, crew }) {
12
12
  message: Type.String({ description: "Message to send to the subagent" }),
13
13
  }),
14
14
  promptSnippet: "Send a follow-up message to a waiting interactive subagent.",
15
+ promptGuidelines: [
16
+ "crew_respond: Response is delivered asynchronously as a steering message. Do not poll crew_list.",
17
+ ],
15
18
  async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
16
19
  const callerSessionId = ctx.sessionManager.getSessionId();
17
20
  const { error } = crew.respond(params.subagent_id, params.message, callerSessionId);
@@ -14,9 +14,10 @@ export function registerCrewSpawnTool({ pi, crew, extensionDir, notifyDiscoveryW
14
14
  promptGuidelines: [
15
15
  "Use crew_list first to see available subagents before spawning.",
16
16
  "crew_spawn: The subagent runs in isolation with no access to your session. Include file paths, requirements, and known locations directly in the task parameter.",
17
- "crew_spawn: DELEGATE means STOP. After spawning, either work on an UNRELATED task or end your turn. Never continue the delegated task yourself.",
17
+ "crew_spawn: DELEGATE means OWNERSHIP TRANSFER. Once you spawn a subagent for a task, that task is exclusively theirs. If you also work on it, you waste the subagent's effort and create conflicting results. After spawning, work on an UNRELATED task or end your turn.",
18
18
  "crew_spawn: To avoid duplication, gather only enough context to write a useful task (key files, entry points). Do not pre-investigate the full problem.",
19
19
  "crew_spawn: Results arrive asynchronously as steering messages. Do not predict or fabricate results. Wait for all crew-result messages before acting on them.",
20
+ "crew_spawn: Never use crew_list as a completion polling loop. Wait for the steering message.",
20
21
  "crew_spawn: Interactive subagents stay alive after responding. Use crew_respond to continue and crew_done to close when finished.",
21
22
  ],
22
23
  async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melihmucuk/pi-crew",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "type": "module",
5
5
  "description": "Non-blocking subagent orchestration for pi coding agent",
6
6
  "files": [
@@ -11,171 +11,147 @@ description: Run parallel subagents to investigate a codebase and produce an imp
11
11
  ## Role
12
12
 
13
13
  This is an orchestration prompt.
14
- Your job is to understand the task, delegate discovery to scout subagents, collect their findings, delegate planning to a planner subagent, and relay the planner's output to the user.
14
+ Understand the task, gather minimal orientation context, delegate discovery to scout subagents, collect their findings, delegate planning to a planner subagent, and relay the planner's result to the user.
15
15
 
16
- Do not perform deep code investigation yourself.
16
+ Do not perform deep investigation yourself.
17
17
  Do not write the plan yourself.
18
- Do not modify any files.
18
+ Do not modify files.
19
19
 
20
- ## Operating Boundaries
21
-
22
- - Do not read full source files before spawning scouts.
23
- - Do not perform broad codebase searches yourself.
24
- - Gather only enough context to understand what the task is and how to split the discovery work across scouts.
25
- - Detailed file reading, pattern analysis, and dependency tracing belong to the scouts.
26
- - Plan creation belongs to the planner.
27
-
28
- ## Required Workflow
29
-
30
- ### 1) Understand the task
20
+ ## Task Resolution
31
21
 
32
22
  Determine the task from:
33
23
 
34
- - the additional instructions provided above, if any
35
- - the current conversation context if no additional instructions were provided
24
+ - additional instructions, if provided
25
+ - otherwise the current conversation context
36
26
 
37
- If the task is still unclear after both sources, ask the user to clarify before proceeding.
27
+ If the task is still unclear, ask the user to clarify before proceeding.
38
28
 
39
- Identify all external references the user provided: file paths, image paths, URLs, documents, screenshots, or any other attachments. These must be passed to the relevant subagents (scouts and/or planner) as explicit file paths with instructions to read/inspect them. Do not assume subagents will have access to context from this conversation; anything they need must be included in their task description.
29
+ Identify any user-provided references that subagents may need, including file paths, images, documents, screenshots, or URLs. Include them explicitly in subagent tasks. Do not assume subagents can access this conversation context unless you pass it along.
40
30
 
41
- ### 2) Gather minimal orientation context
31
+ ## Orientation Context
42
32
 
43
- Collect only what you need to write focused, actionable scout tasks. Start with:
33
+ Gather only enough context to assign focused scout tasks.
44
34
 
45
- - project root structure (`ls` top-level)
46
- - key config files (package.json, go.mod, Cargo.toml, etc.) to identify language, framework, dependencies
47
- - README or AGENTS.md if present, for project conventions
35
+ Start with:
48
36
 
49
- If this is enough to identify which areas of the codebase the task touches, stop and proceed to spawning scouts.
37
+ - top-level project structure
38
+ - key config files to identify language, framework, and dependencies
39
+ - README or AGENTS.md if present
50
40
 
51
- If not, you may do lightweight exploration to locate the right areas:
41
+ If needed, do lightweight exploration to find the relevant areas:
52
42
 
53
- - browse directory trees (`ls`, `find`) to understand module/package layout
54
- - read a few lines of entry points or index files to understand how the project is organized
55
- - run targeted searches (`grep`, `rg`) for task-related terms to find which directories or files are relevant
43
+ - browse directories
44
+ - read a few lines of entry points or index files
45
+ - run targeted searches for task-related terms
56
46
 
57
- The goal is to know **where** to send scouts, not to understand **how** the code works. Stop as soon as you can write scout tasks that point to specific areas. Do not trace call chains, analyze implementations, or read full files.
47
+ Stop once you can assign specific scout scopes. Watch for diminishing returns: if the last few files or directories you browsed produced no new insight relevant to scoping, you have enough orientation—proceed to assign scouts.
48
+ Do not trace call chains, analyze implementations, or read full files.
58
49
 
59
- ### 3) Spawn scouts
50
+ ### Scope Extraction
60
51
 
61
- Call `crew_list` first and verify `scout` is available.
52
+ Before assigning any scout tasks, extract the scope boundary from the user's task:
62
53
 
63
- Spawn one or more scout subagents in parallel (maximum 4). Each scout must receive:
54
+ - **What the task requires** (in scope)
55
+ - **What the task does NOT require** (out of scope)
56
+ - **Scope assumptions** (if any)
64
57
 
65
- - the project root path
66
- - the specific area or question to investigate
67
- - enough framing so the scout knows what to look for
58
+ Pass this scope boundary explicitly to every scout and to the planner. This gives subagents an explicit contract to check against, rather than having them infer scope from the task description alone.
68
59
 
69
- Strategic scout allocation:
60
+ ## Scout Execution
70
61
 
71
- - If the task touches a single area, one scout may suffice.
72
- - If the task spans multiple areas (e.g., API + database + frontend), spawn a separate scout per area.
73
- - If the task requires understanding an existing pattern before proposing changes, dedicate a scout to "find existing patterns/conventions for X".
74
- - Do not spawn more than 4 scouts. Each scout should have a distinct, non-overlapping investigation focus.
62
+ Call `crew_list` first and verify `scout` is available.
75
63
 
76
- Each scout task must include:
64
+ Spawn up to 4 scouts in parallel. Each scout must have a distinct, non-overlapping focus.
77
65
 
78
- - the user's original task (so the scout understands **why** it is investigating)
79
- - project root path
80
- - the orientation context you already gathered (language, framework, key dependencies, project structure, conventions) so the scout does not repeat this work
81
- - clear investigation scope (which directories, files, or concepts to explore)
82
- - what specific information to return (types, interfaces, data flow, dependencies, etc.)
83
- - any external references from the user (file paths, image paths, documents) that are relevant to this scout's scope, with instructions to inspect them
84
- - explicit instruction that it is read-only
66
+ Each scout task should include:
85
67
 
86
- The task description is critical. A scout that knows it is investigating "webhook retry refactoring" will focus on retry logic, error handling, and interfaces. A scout that only knows "look at src/payments/" will produce a generic summary that may miss what the planner actually needs.
68
+ - the user's task
69
+ - project root
70
+ - minimal orientation context already gathered
71
+ - **explicit scope boundary** (what's in scope and out of scope for this scout)
72
+ - explicit investigation scope
73
+ - the specific information to return
74
+ - any relevant user-provided references
75
+ - explicit read-only instruction
87
76
 
88
- ### 4) Wait for all scouts
77
+ Keep scout scopes narrow and non-overlapping. A scout that is asked to "investigate the auth system" will explore broadly. A scout that is asked to "find how login tokens are generated and which function validates them" will stay focused. Prefer the latter.
89
78
 
90
- Do not proceed until every spawned scout has returned.
91
- Do not synthesize partial results.
92
- Do not predict or fabricate scout findings.
93
- Wait for all `crew-result` messages.
79
+ If the task touches one area, one scout may be enough.
80
+ If it spans multiple areas, split scouts by area or question.
94
81
 
95
- Scout results also arrive as steering messages visible in the conversation. Once all scouts have returned, briefly tell the user that discovery is complete and you are preparing context for the planner. Do not repeat or summarize the scout findings to the user.
82
+ ## Scout Waiting and Recovery
96
83
 
97
- **Handling scout failures:**
84
+ Wait for all spawned scouts to return.
85
+ Do not synthesize partial findings.
86
+ Do not fabricate scout results.
87
+ Do not poll repeatedly while waiting; results arrive asynchronously.
98
88
 
99
- - If a scout returns an error or times out, retry it once with the same task.
100
- - If a scout returns but says it could not find relevant information, reassess the task you gave it. Reformulate a more targeted task and spawn a replacement scout. Do not retry with the identical task.
101
- - If a retried scout still fails or returns empty, proceed with the findings from the other scouts. Note the gap when passing context to the planner so it can account for incomplete information.
89
+ If a scout fails or times out, retry once.
90
+ If a scout returns without useful findings, reformulate the task and spawn a replacement scout.
91
+ If a retried or replacement scout still fails, proceed with the findings you have and note the gap for the planner.
102
92
 
103
- ### 5) Spawn planner
93
+ ## Planner Execution
104
94
 
105
95
  Call `crew_list` first and verify `planner` is available.
106
96
 
107
- Before spawning the planner, process the scout findings:
108
-
109
- - Remove duplicate information that multiple scouts reported.
110
- - Drop generic observations that are not relevant to the task.
111
- - Keep all specific findings: file paths, function signatures, type definitions, data flows, constraints, and patterns.
112
- - Organize by area, not by scout. If two scouts reported on overlapping areas, merge their findings under one heading.
113
- - If scouts reported conflicting information, include both and flag the contradiction.
114
-
115
- Then spawn the planner subagent with:
116
-
117
- - the user's original task description (verbatim)
118
- - any additional user instructions or constraints
119
- - all external references from the user (file paths, image paths, screenshots, documents, URLs) with instructions to inspect them directly
120
- - the processed scout findings, organized by area
121
- - project root path
122
- - language, framework, key dependencies
123
- - relevant conventions or constraints discovered by scouts
124
- - any gaps in discovery (scouts that failed or returned empty) so the planner knows what was not investigated
125
- - explicit instruction that comprehensive context has been pre-gathered by scouts, and the planner should rely on the provided findings first; it should only perform its own discovery if the provided context is insufficient for a specific aspect
126
-
127
- The planner is an interactive subagent. It will respond with one of:
128
-
129
- - **Blocking Questions**: questions that need user input before a plan can be made
130
- - **Implementation Plan**: the complete plan
131
- - **No plan needed**: the task is trivial enough that a plan adds no value
132
-
133
- ### 6) Relay planner output
134
-
135
- When the planner responds:
97
+ Before spawning the planner:
136
98
 
137
- Subagent results arrive as steering messages and are already visible in the conversation context. Do not repeat or rewrite the planner's output. Instead, respond with a short actionable prompt to the user.
99
+ - remove duplicate scout findings
100
+ - drop irrelevant generic observations
101
+ - drop findings outside the scope boundary (scouts sometimes drift)
102
+ - organize findings by area
103
+ - preserve specific facts, constraints, paths, interfaces, and conflicts
104
+ - watch for diminishing returns: if later findings repeat or add no new specifics, you have enough—proceed to the planner rather than processing further
138
105
 
139
- **If Blocking Questions:**
106
+ Spawn the planner with:
140
107
 
141
- - Tell the user that the planner has questions that need answering before it can produce a plan.
142
- - Ask the user to answer them.
143
- - When the user answers, relay the answers to the planner using `crew_respond`.
144
- - Wait for the planner's next response and repeat this step.
108
+ - the user's task
109
+ - additional instructions or constraints
110
+ - relevant user-provided references
111
+ - **explicit scope boundary** (in-scope / out-of-scope as extracted from the task)
112
+ - processed scout findings
113
+ - project root
114
+ - language, framework, dependencies
115
+ - relevant conventions
116
+ - any discovery gaps
145
117
 
146
- **If Implementation Plan:**
118
+ The planner is interactive. It may return:
147
119
 
148
- - Tell the user the plan is ready and ask if they approve or want changes.
149
- - If the user requests changes, relay the feedback to the planner using `crew_respond`.
150
- - Wait for the planner's updated plan and repeat this step.
120
+ - Blocking Questions
121
+ - Implementation Plan
122
+ - No plan needed
151
123
 
152
- **If No plan needed:**
124
+ ## Relay
153
125
 
154
- - Close the planner session with `crew_done`.
155
- - Briefly explain why no plan is needed.
156
- - Using the scout findings, suggest that the task can be implemented directly and summarize the relevant context the scouts gathered that would help with implementation.
126
+ Do not rewrite subagent output that is already visible as a steering message.
157
127
 
158
- **If the user approves the plan:**
128
+ If the planner returns blocking questions:
129
+ - ask the user to answer them
130
+ - relay the user's response with `crew_respond`
131
+ - wait for the next planner response
159
132
 
160
- - Call `crew_done` to close the planner session.
161
- - Confirm that the plan is finalized.
133
+ If the planner returns an implementation plan:
134
+ - tell the user the plan is ready and ask for approval or feedback
135
+ - relay any feedback with `crew_respond`
136
+ - wait for the updated planner response
162
137
 
163
- ## Relay Rules
138
+ If the planner returns no plan needed:
139
+ - close the planner with `crew_done`
140
+ - briefly tell the user no plan is needed and that the task can be implemented directly
164
141
 
165
- - Do not rewrite or duplicate the planner's output. It is already visible to the user as a steering message in the conversation. Respond with one or two sentences: state whether the planner returned a plan, blocking questions, or a no-plan-needed verdict, then ask the user for the next action (approve, answer, or provide feedback).
166
- - Never answer the planner's blocking questions on behalf of the user.
167
- - Never modify the plan based on your own judgment. All feedback goes through the user.
168
- - When relaying user feedback to the planner via `crew_respond`, include the user's words verbatim plus any necessary context from the conversation.
142
+ If the user approves the plan:
143
+ - close the planner with `crew_done`
144
+ - confirm that the plan is finalized
169
145
 
170
146
  ## Language
171
147
 
172
- All output to the user must be in the same language as the user's prompt.
173
- When spawning scouts and the planner, instruct them to respond in the same language as the user's prompt.
148
+ Respond to the user in the same language as the user's request.
174
149
 
175
- ## IMPORTANT
150
+ ## Rules
176
151
 
177
- - DO NOT perform deep codebase investigation yourself. Delegate to scouts.
178
- - DO NOT write or modify the plan yourself. Delegate to the planner.
179
- - NEVER PREDICT or FABRICATE results for subagents that have not yet reported back to you.
180
- - Do NOT rewrite or duplicate subagent output that is already visible as a steering message.
181
- - ALWAYS wait for explicit user approval before finalizing the plan.
152
+ - Do not investigate deeply yourself; delegate to scouts.
153
+ - Do not write, modify, or finalize the plan yourself; use the planner.
154
+ - Never answer planner questions on behalf of the user.
155
+ - Never fabricate subagent results.
156
+ - Always wait for explicit user approval before finalizing the plan.
157
+ - Do not expand scope beyond what the user asked. If scouts return findings outside the task scope, drop them before passing to the planner.
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Run parallel code and quality reviews to ensure high standards and catch issues early.
2
+ description: Run parallel code and quality reviews by gathering minimal context and orchestrating reviewer subagents.
3
3
  ---
4
4
 
5
5
  # Parallel Review
@@ -11,29 +11,23 @@ description: Run parallel code and quality reviews to ensure high standards and
11
11
  ## Role
12
12
 
13
13
  This is an orchestration prompt.
14
- Your job is to determine review scope with minimal context gathering, prepare a short review brief, spawn the reviewer subagents, wait for both results, and merge them into one final report.
14
+ Determine review scope with minimal context gathering, prepare a short neutral brief, spawn the reviewer subagents, wait for their results, and merge them into one final report.
15
15
 
16
- Do not do the reviewers' job.
16
+ Do not perform the review yourself.
17
+ Do not perform a broad second review or re-investigate the whole repository. Your job is orchestration, filtering, and merging. If a reviewer finding is ambiguous, high-impact, or appears out of scope, you may do a minimal spot-check to clarify whether it is concrete enough to include.
17
18
 
18
- ## Operating Boundaries
19
+ ## Scope Rules
19
20
 
20
- - Do not read full files before spawning subagents.
21
- - Do not dump raw diffs into the prompt.
22
- - Do not inspect every changed file manually.
23
- - Collect only enough git context to determine scope and produce a short summary.
24
- - Detailed diff reading, file reading, and issue analysis belong to the subagents.
25
- - Use targeted extra reads only when file names and diff stats are insufficient.
26
-
27
- ## Required Workflow
21
+ - If the user specifies a scope (commit, branch, files, PR, or focus area), that scope overrides the default scope.
22
+ - Otherwise, default scope includes:
23
+ - recent commits
24
+ - staged changes
25
+ - unstaged changes
26
+ - untracked files
28
27
 
29
- ### 1) Determine scope
28
+ ## Context Gathering
30
29
 
31
- Default scope, unless the user specifies otherwise:
32
-
33
- - recent commits
34
- - staged changes
35
- - unstaged changes
36
- - untracked files
30
+ Collect only enough context to define scope and prepare a short brief.
37
31
 
38
32
  Collect:
39
33
 
@@ -45,130 +39,110 @@ Collect:
45
39
  - `git diff --stat`
46
40
  - untracked file list
47
41
 
48
- Do not collect full diffs by default.
49
- Use `git diff --cached` or `git diff` only if diff stats and file names are insufficient.
50
-
51
- Recent commit range:
42
+ For recent commits:
52
43
 
53
44
  - use `HEAD~3..HEAD` if at least 3 commits exist
54
45
  - otherwise use the widest reachable history range
55
46
 
56
- For that range, collect:
47
+ Collect for that range:
57
48
 
58
49
  - `git diff --stat <range>`
59
50
  - `git diff --name-only <range>`
60
51
 
61
- Use `git diff <range>` only if needed for a short summary.
52
+ Rules:
62
53
 
63
- If the user gives a commit, branch, file, or extra focus area, include it as additional context.
54
+ - Do not read full files before spawning subagents.
55
+ - Do not dump raw diffs into the prompt.
56
+ - Do not inspect every changed file manually.
57
+ - Use full diffs or targeted reads only when file names and diff stats are insufficient to produce a short neutral summary.
58
+ - Keep the brief short and descriptive, not analytical.
59
+ - Watch for diminishing returns: if you have enough to define scope and write the brief, stop gathering context. More git commands or file reads at this stage add noise, not clarity.
64
60
 
65
- ### 2) Prepare subagent context
61
+ ## Subagent Preparation
66
62
 
67
- Prepare a short brief with:
63
+ Call `crew_list` first and verify that both are available:
68
64
 
69
- - review scope
70
- - commit range
71
- - staged/unstaged/untracked state
65
+ - `code-reviewer`
66
+ - `quality-reviewer`
67
+
68
+ Prepare one short brief for both reviewers including:
69
+
70
+ - repo root
71
+ - resolved review scope
72
+ - commit range if any
73
+ - staged / unstaged / untracked status
72
74
  - changed files
73
- - one-line summary per file or file group
75
+ - short summary per file or file group
74
76
  - additional user instructions
77
+ - **explicit scope boundary**: what is being reviewed (in scope) and what is not being reviewed (out of scope). For example: "Only the auth module changes are in scope. The unrelated CSS refactor in the same PR is out of scope for this review."
75
78
 
76
- Summary rules:
79
+ ## Execution
77
80
 
78
- - infer first from file paths, status codes, and diff stats
79
- - read only specific files or hunks if needed
80
- - keep it short
81
- - do not perform review analysis here
81
+ Spawn `code-reviewer` and `quality-reviewer` in parallel.
82
82
 
83
- ### 3) Spawn reviewers
83
+ If one reviewer is unavailable or fails to start, report that clearly and continue with the reviewer that is available.
84
84
 
85
- Call `crew_list` first and verify:
85
+ Do not produce a final report until all successfully spawned reviewers have returned a result.
86
+ Do not poll or repeatedly check active subagents while waiting; results will be delivered asynchronously.
86
87
 
87
- - `code-reviewer`
88
- - `quality-reviewer`
88
+ ## Findings Acceptance Gate
89
89
 
90
- Spawn both in parallel.
91
- Each task must include:
90
+ Before including a reviewer finding in the final report, apply these filters:
92
91
 
93
- - repo root
94
- - review scope
95
- - commit range
96
- - staged/unstaged/untracked info
97
- - changed files
98
- - short change summary
99
- - user instructions
100
- - explicit instruction to inspect diffs and files itself
101
- - explicit instruction to follow its own output format strictly
92
+ Include a finding only if:
93
+ - it is actionable now
94
+ - it describes a realistic scenario for this project
95
+ - it includes a concrete trigger or maintenance impact
96
+ - it includes evidence or a clear rationale from the reviewer
97
+ - its severity matches the described likelihood and impact
98
+
99
+ Exclude findings that are:
100
+ - speculative or theory-driven (no realistic trigger)
101
+ - based on broken invariants or unsupported usage
102
+ - style preferences or optional refactors without concrete bug risk
103
+ - vague suggestions without concrete trigger, impact, or evidence
104
+
105
+ Do not exclude a legitimate Minor finding that has a concrete trigger and realistic near-term impact. Minor findings with evidence pass the gate; Minor findings without evidence do not.
102
106
 
103
- ### 4) Wait
107
+ If a finding clearly fails the gate, omit it rather than forwarding reviewer noise to the user. Prefer omission for weak or optional findings, but do not discard a potentially important finding solely because the reviewer wrote it imperfectly. The merged report should be shorter and more impactful than the raw reviewer outputs, not a concatenation of them.
104
108
 
105
- Do not produce a final response until both subagents return.
106
- Do not synthesize partial results.
107
- Wait for two separate `crew-result` messages.
109
+ ## Merge
108
110
 
109
- ### 5) Merge reports
111
+ Write the final response in the same language as the user's request.
110
112
 
111
- Final output must be in the same language as the user's prompt.
112
- Use the structure below directly. Do not read any subagent definition files just to reconstruct the format.
113
+ Structure:
113
114
 
114
- Order:
115
+ ### Consensus Findings
115
116
 
116
- #### A. Consensus Findings
117
+ Merge only findings that are clearly the same issue reported by both reviewers.
117
118
 
118
- **[SEVERITY] Category: Brief title**
119
- File: `path/to/file.ts:123` or `path/to/file.ts` (section)
120
- Issue: Clear merged explanation
121
- Context/Impact: Runtime or maintenance impact
122
- Suggestion: Clear fix direction
123
- Reported by: `code-reviewer`, `quality-reviewer`
119
+ ### Code Review Findings
120
+
121
+ Include findings reported only by `code-reviewer`.
122
+
123
+ ### Quality Review Findings
124
+
125
+ Include findings reported only by `quality-reviewer`.
126
+
127
+ ### Final Summary
128
+
129
+ Include:
130
+
131
+ - review scope
132
+ - which reviewers ran
133
+ - consensus findings count
134
+ - code review findings count
135
+ - quality review findings count
136
+ - overall assessment
124
137
 
125
138
  Rules:
126
139
 
127
- - do not repeat the same issue
128
- - merge equivalent findings
129
- - if needed, use the stronger justified severity
130
-
131
- #### B. Code Review Findings
132
-
133
- **[SEVERITY] Category: Brief title**
134
- File: `path/to/file.ts:123`
135
- Issue: ...
136
- Context: ...
137
- Suggestion: ...
138
- Reported by: `code-reviewer`
139
-
140
- #### C. Quality Review Findings
141
-
142
- **[SEVERITY] Category: Brief title**
143
- File: `path/to/file.ts` (functionName or section, line range if identifiable)
144
- Issue: ...
145
- Impact: ...
146
- Suggestion: ...
147
- Reported by: `quality-reviewer`
148
-
149
- #### D. Final Summary
150
-
151
- **Combined Review Summary**
152
- Files reviewed: [count or list]
153
- Consensus findings: [count]
154
- Code review findings: [count by severity]
155
- Quality review findings: [count by severity]
156
- Strong signals: [titles found by both reviewers or `none`]
157
- Overall assessment: [short clear assessment]
158
-
159
- ## Synthesis Rules
160
-
161
- - do not repeat overlapping issues
162
- - merge close variants into one item
163
- - do not invent resolution for reviewer conflicts
164
- - if both say `No issues found.`, say so explicitly
165
- - if only one reviewer reports an issue, do not present it as consensus
166
- - sort by severity
167
- - no unnecessary introduction
168
- - review only, no code changes
169
-
170
- ## IMPORTANT
171
-
172
- - DO NOT perform any code review or quality review analysis yourself.
173
- - SPAWN the subagents with the review context and WAIT for their results.
174
- - NEVER PREDICT or FABRICATE results for subagents that have not yet reported back to you.
140
+ - Do not repeat overlapping findings.
141
+ - Do not invent reviewer output, evidence, or counts.
142
+ - Do not present a single-reviewer finding as consensus.
143
+ - Apply the Findings Acceptance Gate before merging. Do not forward weak, speculative, or optional findings; if a single-reviewer finding appears important but ambiguous, do a minimal spot-check before deciding.
144
+ - If both reviewers report no issues, say so explicitly.
145
+ - If one reviewer failed or was unavailable, say so explicitly.
146
+ - Review only. Do not make code changes.
147
+ - Do not perform independent review beyond minimal scope and validity checks on reviewer findings. Only orchestrate reviewers and merge their reported results.
148
+ - Never fabricate subagent results. Wait for all successfully spawned reviewers to return.
@@ -1,8 +0,0 @@
1
- import type { AgentConfig } from "./agent-discovery.js";
2
- /**
3
- * Format discovered agent definitions for inclusion in the system prompt.
4
- * Uses XML format consistent with pi's skill injection.
5
- *
6
- * Returns an empty string when no agents are available.
7
- */
8
- export declare function formatAgentsForPrompt(agents: AgentConfig[]): string;