@melihmucuk/pi-crew 1.0.16 → 1.0.17
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/README.md +8 -8
- package/agents/code-reviewer.md +2 -2
- package/agents/oracle.md +1 -1
- package/agents/planner.md +5 -1
- package/agents/quality-reviewer.md +2 -2
- package/agents/scout.md +2 -2
- package/agents/worker.md +3 -3
- package/extension/agent-catalog.ts +369 -0
- package/extension/agent-config-fields.ts +359 -0
- package/extension/agent-discovery.ts +49 -717
- package/extension/index.ts +4 -2
- package/extension/integration/crew-tool-actions.ts +306 -0
- package/extension/integration/crew-tool-executor.ts +109 -0
- package/extension/integration/register-tools.ts +10 -2
- package/extension/integration/tool-presentation.ts +0 -20
- package/extension/integration/tools/crew-abort.ts +14 -84
- package/extension/integration/tools/crew-done.ts +7 -26
- package/extension/integration/tools/crew-list.ts +4 -60
- package/extension/integration/tools/crew-respond.ts +8 -29
- package/extension/integration/tools/crew-spawn.ts +15 -56
- package/extension/message-delivery-policy.ts +22 -0
- package/extension/runtime/crew-runtime.ts +60 -223
- package/extension/runtime/{delivery-coordinator.ts → owner-session-coordinator.ts} +44 -37
- package/extension/runtime/subagent-lifecycle.ts +203 -0
- package/extension/runtime/subagent-registry.ts +50 -6
- package/extension/runtime/subagent-transitions.ts +100 -0
- package/extension/subagent-messages.ts +9 -17
- package/package.json +8 -6
- package/prompts/pi-crew-plan.md +14 -13
- package/prompts/pi-crew-review.md +20 -16
- package/skills/pi-crew/REFERENCE.md +32 -20
- package/skills/pi-crew/SKILL.md +13 -10
- package/extension/integration/tools/tool-deps.ts +0 -16
- package/extension/integration.ts +0 -13
- package/extension/runtime/subagent-state.ts +0 -59
|
@@ -6,31 +6,36 @@ description: Orchestrate parallel code and quality reviews with reviewer subagen
|
|
|
6
6
|
|
|
7
7
|
Additional instructions: `$ARGUMENTS`
|
|
8
8
|
|
|
9
|
-
You are a review orchestrator, not a reviewer. Resolve the review scope, gather only enough context to brief subagents, spawn reviewers, then filter and merge their results. Do not perform an independent review
|
|
9
|
+
You are a review orchestrator, not a reviewer. Resolve the review scope, gather only enough task-specific context to brief subagents, spawn reviewers, then filter and merge their results. Do not perform an independent review or inspect raw diffs except for minimal scope clarification or spot-checking ambiguous findings.
|
|
10
10
|
|
|
11
11
|
## Scope
|
|
12
12
|
|
|
13
|
-
Use the user's scope when provided. Otherwise
|
|
13
|
+
Use the user's scope when provided. Otherwise rely on each reviewer’s default scope. If “latest” or “recent” is requested, review the last 5 commits unless a count is given.
|
|
14
14
|
|
|
15
|
-
Gather minimal context:
|
|
15
|
+
Gather minimal review context: why the changes were made, expected behavior/outcome, feature or bug intent, notable fixes since any prior review, verification already run, and user instructions that are specific to this review.
|
|
16
|
+
|
|
17
|
+
If the user provides a plan, spec, issue, doc, or design file as the source of intent, read it and summarize the behavior the implementation should satisfy. This is allowed context gathering, not independent code review.
|
|
18
|
+
|
|
19
|
+
Keep the brief focused on task-specific intent and outcome, not repository mechanics or reviewer boilerplate. Do not paste full changed-file, staged/unstaged, untracked, branch, cwd, or project-constraint inventories for default reviews; reviewers run in the same repo cwd and can inspect Git state and repo guidance themselves. Include file paths or entry points only when they define scope, identify an intent source, prevent ambiguity, or highlight non-obvious areas.
|
|
16
20
|
|
|
17
21
|
## Subagents
|
|
18
22
|
|
|
19
23
|
Call `crew_list` first and check for `code-reviewer` and `quality-reviewer`. Spawn available reviewers in parallel. If one is unavailable, fails to start, returns `error`, or is aborted, report that clearly and continue with completed reviewer results.
|
|
20
24
|
|
|
21
|
-
Send each reviewer a
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
- commit range or
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
Send each reviewer a compact, task-specific brief. Include only information that helps this specific review beyond the selected reviewer’s obvious role:
|
|
26
|
+
- user-provided intent source, e.g. plan/spec/doc path, plus a concise summary after reading it;
|
|
27
|
+
- why the changes were made and what outcome is expected;
|
|
28
|
+
- notable prior-review fixes and verification already run, when known;
|
|
29
|
+
- non-default scope, commit range, file paths, or entry-point hints only when they define or clarify scope;
|
|
30
|
+
- additional user instructions that are specific to this review.
|
|
31
|
+
|
|
32
|
+
If you include a Goal, make it specific to the change intent, not the reviewer role or default scope. Prefer omitting Goal when Context/Intent already states the task clearly.
|
|
33
|
+
|
|
34
|
+
For default reviews, do not include a Scope section or mention uncommitted/current repo changes in the subagent brief unless needed to disambiguate scope. If you need to state task-specific emphasis, use `Review focus:` instead of `Scope:`.
|
|
35
|
+
|
|
36
|
+
Do not echo the raw user instruction if it is already represented in the intent summary; quote it only when exact wording matters.
|
|
30
37
|
|
|
31
|
-
|
|
32
|
-
- `code-reviewer`: review realistic actionable bugs; do not do maintainability/style review.
|
|
33
|
-
- `quality-reviewer`: review maintainability structure; do not hunt for bugs.
|
|
38
|
+
Do not restate reviewer-role boilerplate implied by the selected reviewer, such as telling `code-reviewer` to find actionable bugs or telling `quality-reviewer` to review maintainability. Do not include default scope, generic non-goals, acceptance criteria, output format, edit permissions, or severity rules unless the user explicitly overrides them.
|
|
34
39
|
|
|
35
40
|
Do not poll. Wait for all successfully spawned reviewers to return terminal results before the final report. Never fabricate subagent output.
|
|
36
41
|
|
|
@@ -67,4 +72,3 @@ Rules:
|
|
|
67
72
|
- Do not repeat overlapping findings.
|
|
68
73
|
- Do not present a single-reviewer finding as consensus.
|
|
69
74
|
- If both reviewers report no accepted findings, say so clearly.
|
|
70
|
-
- Review only; do not change code.
|
|
@@ -2,30 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
## Delegation Checklist
|
|
4
4
|
|
|
5
|
-
Before `crew_spawn`, ensure the brief
|
|
5
|
+
Before `crew_spawn`, ensure the brief is self-contained but not mechanically templated. Include only information that helps this specific subagent do this specific task:
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
- Expected output format.
|
|
13
|
-
- Acceptance criteria.
|
|
14
|
-
- Verification command, if known.
|
|
7
|
+
- Intent, expected outcome, and relevant user decisions.
|
|
8
|
+
- User-provided references, plus a concise summary after reading them when practical.
|
|
9
|
+
- File paths, symbols, entry points, commands, errors, or logs only when they genuinely clarify the task.
|
|
10
|
+
- Non-default scope, constraints, assumptions, or verification context only when they matter.
|
|
11
|
+
- Gaps or unresolved questions the subagent should account for.
|
|
15
12
|
|
|
16
|
-
Do not
|
|
13
|
+
Do not restate boilerplate implied by the selected subagent’s role, name, or description. Avoid repeating default scope, edit permissions, output format, generic repo guidance, cwd/branch details, or mechanical Git state the subagent can inspect itself.
|
|
14
|
+
|
|
15
|
+
Do not rely on hidden active-session context. If the subagent needs a decision, conclusion, user intent, or prior result that is not discoverable from files/tools, include it.
|
|
17
16
|
|
|
18
17
|
## Good Brief
|
|
19
18
|
|
|
20
19
|
```md
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
Intent / context:
|
|
21
|
+
Password reset emails should expire after 30 minutes. Users report that old reset links still work several hours later.
|
|
22
|
+
|
|
23
|
+
Relevant inputs / entry points:
|
|
24
|
+
- The password reset request handler.
|
|
25
|
+
- The token validation path used by the reset form.
|
|
26
|
+
- Any configuration or database fields that store token expiry.
|
|
27
|
+
|
|
28
|
+
Constraints / decisions:
|
|
29
|
+
- Preserve the existing email template and reset URL format.
|
|
30
|
+
- Do not change login or account creation behavior.
|
|
31
|
+
|
|
32
|
+
Deliverable:
|
|
33
|
+
Identify the likely root cause and the smallest safe fix direction.
|
|
29
34
|
```
|
|
30
35
|
|
|
31
36
|
## Bad Briefs
|
|
@@ -42,7 +47,14 @@ Investigate the bug we discussed.
|
|
|
42
47
|
Implement the plan.
|
|
43
48
|
```
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
```md
|
|
51
|
+
Goal: Review the current uncommitted changes for actionable bugs.
|
|
52
|
+
Scope: Current repo changes, staged/unstaged/untracked files.
|
|
53
|
+
Non-goals: Do not modify files.
|
|
54
|
+
Expected output: Findings with severity and fix direction.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
These depend on hidden conversation state, restate subagent boilerplate, or carry mechanical repository state instead of task-specific intent.
|
|
46
58
|
|
|
47
59
|
## Parallel Delegation
|
|
48
60
|
|
|
@@ -57,7 +69,7 @@ If ownership overlaps, serialize the work.
|
|
|
57
69
|
## Failure and Conflict Handling
|
|
58
70
|
|
|
59
71
|
- If a subagent errors or aborts, report that status clearly and continue only if remaining results are sufficient.
|
|
60
|
-
- If a result misses
|
|
72
|
+
- If a result misses the task-specific deliverable, ask a focused follow-up or spawn a new subagent with a corrected brief.
|
|
61
73
|
- If results conflict, do not average them or pick silently. State the conflict, compare evidence, and resolve only with available facts or a targeted follow-up.
|
|
62
74
|
- If a task becomes obsolete, abort the relevant active subagent.
|
|
63
75
|
|
package/skills/pi-crew/SKILL.md
CHANGED
|
@@ -21,20 +21,23 @@ See [REFERENCE.md](REFERENCE.md) for examples and detailed handling patterns.
|
|
|
21
21
|
|
|
22
22
|
## Spawn Brief
|
|
23
23
|
|
|
24
|
-
Send a self-contained task.
|
|
24
|
+
Send a self-contained task, but do not fill a template mechanically. Use only sections that add task-specific value, for example:
|
|
25
25
|
|
|
26
26
|
```md
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Acceptance criteria:
|
|
33
|
-
Expected output:
|
|
34
|
-
Verification:
|
|
27
|
+
Intent / context:
|
|
28
|
+
Relevant inputs / entry points:
|
|
29
|
+
Constraints / decisions:
|
|
30
|
+
Deliverable / expected outcome:
|
|
31
|
+
Verification / checks:
|
|
35
32
|
```
|
|
36
33
|
|
|
37
|
-
|
|
34
|
+
Omit sections that would only restate the selected subagent’s role, default scope, edit permissions, output format, or obvious next steps.
|
|
35
|
+
|
|
36
|
+
Include only information that helps this specific subagent do this specific task: intent, expected outcome, relevant decisions, exact errors/output, unusual constraints, and file paths or entry points that genuinely clarify the task. Use short Markdown sections and bullets when they improve scanability, especially for multi-part intent, constraints, observations, requirements, or acceptance criteria; avoid dense paragraphs.
|
|
37
|
+
|
|
38
|
+
Do not restate boilerplate implied by the selected subagent’s role, name, or description. Avoid repeating default scope, output format, edit permissions, or repo guidance. Subagents run in the same cwd as the orchestrator, so do not include mechanical Git state they can inspect themselves, such as full changed-file lists, staged/unstaged/untracked inventories, branch/cwd details, or generic project constraints, unless those details define a non-default scope or prevent ambiguity.
|
|
39
|
+
|
|
40
|
+
If the user points to a plan, spec, issue, design, or doc as task intent, read it when practical and summarize the relevant intent instead of merely passing the path. Prefer explaining why the work matters and what outcome is expected over restating repository state.
|
|
38
41
|
|
|
39
42
|
## Result Handling
|
|
40
43
|
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ExtensionAPI,
|
|
3
|
-
ExtensionContext,
|
|
4
|
-
} from "@earendil-works/pi-coding-agent";
|
|
5
|
-
import type { AgentDiscoveryWarning } from "../../agent-discovery.js";
|
|
6
|
-
import type { CrewRuntime } from "../../runtime/crew-runtime.js";
|
|
7
|
-
|
|
8
|
-
export interface CrewToolDeps {
|
|
9
|
-
pi: ExtensionAPI;
|
|
10
|
-
crew: CrewRuntime;
|
|
11
|
-
extensionDir: string;
|
|
12
|
-
notifyDiscoveryWarnings: (
|
|
13
|
-
ctx: ExtensionContext,
|
|
14
|
-
warnings: AgentDiscoveryWarning[],
|
|
15
|
-
) => void;
|
|
16
|
-
}
|
package/extension/integration.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import type { CrewRuntime } from "./runtime/crew-runtime.js";
|
|
3
|
-
import { registerCrewMessageRenderers } from "./integration/register-renderers.js";
|
|
4
|
-
import { registerCrewTools } from "./integration/register-tools.js";
|
|
5
|
-
|
|
6
|
-
export function registerCrewIntegration(
|
|
7
|
-
pi: ExtensionAPI,
|
|
8
|
-
crew: CrewRuntime,
|
|
9
|
-
extensionDir: string,
|
|
10
|
-
): void {
|
|
11
|
-
registerCrewTools(pi, crew, extensionDir);
|
|
12
|
-
registerCrewMessageRenderers(pi);
|
|
13
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { randomBytes } from "node:crypto";
|
|
2
|
-
import type { AgentSession } from "@earendil-works/pi-coding-agent";
|
|
3
|
-
import type { AgentConfig } from "../agent-discovery.js";
|
|
4
|
-
import type { SubagentStatus } from "../subagent-messages.js";
|
|
5
|
-
|
|
6
|
-
export interface SubagentState {
|
|
7
|
-
id: string;
|
|
8
|
-
agentConfig: AgentConfig;
|
|
9
|
-
task: string;
|
|
10
|
-
status: SubagentStatus;
|
|
11
|
-
ownerSessionId: string;
|
|
12
|
-
session: AgentSession | null;
|
|
13
|
-
turns: number;
|
|
14
|
-
contextTokens: number;
|
|
15
|
-
model: string | undefined;
|
|
16
|
-
error?: string;
|
|
17
|
-
result?: string;
|
|
18
|
-
promptAbortController?: AbortController;
|
|
19
|
-
unsubscribe?: () => void;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface ActiveAgentSummary {
|
|
23
|
-
id: string;
|
|
24
|
-
agentName: string;
|
|
25
|
-
status: SubagentStatus;
|
|
26
|
-
turns: number;
|
|
27
|
-
contextTokens: number;
|
|
28
|
-
model: string | undefined;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function generateId(name: string, existingIds: Set<string>): string {
|
|
32
|
-
for (let i = 0; i < 10; i++) {
|
|
33
|
-
const id = `${name}-${randomBytes(4).toString("hex")}`;
|
|
34
|
-
if (!existingIds.has(id)) return id;
|
|
35
|
-
}
|
|
36
|
-
return `${name}-${randomBytes(8).toString("hex")}`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Status may change externally via abort(). Standalone function avoids TS narrowing.
|
|
40
|
-
export function isAborted(state: SubagentState): boolean {
|
|
41
|
-
return state.status === "aborted";
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function isAbortableStatus(status: SubagentStatus): boolean {
|
|
45
|
-
return status === "running" || status === "waiting";
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function buildActiveAgentSummary(
|
|
49
|
-
state: SubagentState,
|
|
50
|
-
): ActiveAgentSummary {
|
|
51
|
-
return {
|
|
52
|
-
id: state.id,
|
|
53
|
-
agentName: state.agentConfig.name,
|
|
54
|
-
status: state.status,
|
|
55
|
-
turns: state.turns,
|
|
56
|
-
contextTokens: state.contextTokens,
|
|
57
|
-
model: state.model,
|
|
58
|
-
};
|
|
59
|
-
}
|