@phi-code-admin/phi-code 0.58.5 → 0.58.6
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/extensions/phi/orchestrator.ts +51 -31
- package/package.json +1 -1
|
@@ -399,33 +399,35 @@ export default function orchestratorExtension(pi: ExtensionAPI) {
|
|
|
399
399
|
name: "orchestrate",
|
|
400
400
|
label: "Project Orchestrator",
|
|
401
401
|
description: "Create a project plan AND automatically execute all tasks with sub-agents in parallel. Each agent gets its own isolated context, model, and system prompt. Tasks without dependencies run simultaneously.",
|
|
402
|
-
promptSnippet: "Plan + execute projects.
|
|
402
|
+
promptSnippet: "Plan + execute projects in parallel waves. Each sub-agent gets isolated context + model. Use prompt-architect patterns for structured task descriptions.",
|
|
403
403
|
promptGuidelines: [
|
|
404
|
-
"When asked to plan or build a project: analyze the request, then call orchestrate. It
|
|
405
|
-
"
|
|
406
|
-
"
|
|
407
|
-
"
|
|
408
|
-
"
|
|
404
|
+
"When asked to plan or build a project: analyze the request thoroughly, then call the orchestrate tool. It plans AND executes automatically.",
|
|
405
|
+
"CRITICAL: Each task description must be SELF-CONTAINED. The sub-agent has NO shared history, NO access to the conversation, NO memory of previous tasks. Include ALL context it needs: file paths, expected behavior, relevant code patterns, and success criteria.",
|
|
406
|
+
"Structure each task description using the prompt-architect pattern: [CONTEXT] what exists and why → [TASK] what to do specifically → [FORMAT] expected output → [CONSTRAINTS] rules and limitations.",
|
|
407
|
+
"Assign agent types strategically: 'explore' (read-only analysis, codebase understanding), 'plan' (architecture, design decisions), 'code' (implementation, file creation/modification), 'test' (write + run tests, validate behavior), 'review' (security audit, quality check, read-only).",
|
|
408
|
+
"Set dependencies to maximize parallelism: tasks without dependencies run simultaneously in the same wave. Only add dependencies when a task truly needs another task's output.",
|
|
409
|
+
"Order tasks logically: explore → plan → code → test → review. But allow independent tasks at each stage to run in parallel.",
|
|
410
|
+
"Set priority=high for critical-path tasks, medium for standard work, low for nice-to-haves.",
|
|
409
411
|
],
|
|
410
412
|
parameters: Type.Object({
|
|
411
|
-
title: Type.String({ description: "
|
|
412
|
-
description: Type.String({ description: "Full project description
|
|
413
|
-
goals: Type.Array(Type.String(), { description: "
|
|
413
|
+
title: Type.String({ description: "Concise project title" }),
|
|
414
|
+
description: Type.String({ description: "Full project description: what to build, why, and any relevant context" }),
|
|
415
|
+
goals: Type.Array(Type.String(), { description: "Measurable project goals (what success looks like)" }),
|
|
414
416
|
requirements: Type.Array(Type.String(), { description: "Technical and functional requirements" }),
|
|
415
|
-
architecture: Type.Optional(Type.Array(Type.String(), { description: "Architecture decisions" })),
|
|
417
|
+
architecture: Type.Optional(Type.Array(Type.String(), { description: "Architecture decisions, tech stack choices, trade-offs" })),
|
|
416
418
|
tasks: Type.Array(
|
|
417
419
|
Type.Object({
|
|
418
|
-
title: Type.String({ description: "
|
|
419
|
-
description: Type.String({ description: "
|
|
420
|
-
agent: Type.Optional(Type.String({ description: "Agent type: explore, plan, code, test,
|
|
421
|
-
priority: Type.Optional(Type.String({ description: "high, medium,
|
|
422
|
-
dependencies: Type.Optional(Type.Array(Type.Number(), { description: "
|
|
423
|
-
subtasks: Type.Optional(Type.Array(Type.String(), { description: "
|
|
420
|
+
title: Type.String({ description: "Clear, action-oriented task title" }),
|
|
421
|
+
description: Type.String({ description: "SELF-CONTAINED task description. Include ALL context the sub-agent needs: file paths, expected behavior, code patterns, conventions. The agent has NO shared history." }),
|
|
422
|
+
agent: Type.Optional(Type.String({ description: "Agent type: explore (read-only analysis), plan (architecture), code (implementation), test (write+run tests), review (quality audit)" })),
|
|
423
|
+
priority: Type.Optional(Type.String({ description: "high (critical path), medium (standard), low (nice-to-have)" })),
|
|
424
|
+
dependencies: Type.Optional(Type.Array(Type.Number(), { description: "Task numbers this depends on (1-indexed). Only add when truly needed — fewer dependencies = more parallelism" })),
|
|
425
|
+
subtasks: Type.Optional(Type.Array(Type.String(), { description: "Specific sub-steps within this task" })),
|
|
424
426
|
}),
|
|
425
|
-
{ description: "Ordered list of tasks
|
|
427
|
+
{ description: "Ordered list of tasks. Independent tasks run in parallel. Dependent tasks wait for prerequisites." }
|
|
426
428
|
),
|
|
427
|
-
constraints: Type.Optional(Type.Array(Type.String(), { description: "
|
|
428
|
-
successCriteria: Type.Optional(Type.Array(Type.String(), { description: "
|
|
429
|
+
constraints: Type.Optional(Type.Array(Type.String(), { description: "Hard constraints: frameworks, patterns, rules, things to avoid" })),
|
|
430
|
+
successCriteria: Type.Optional(Type.Array(Type.String(), { description: "How to verify the project is complete and correct" })),
|
|
429
431
|
}),
|
|
430
432
|
|
|
431
433
|
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
@@ -527,18 +529,36 @@ All files in \`.phi/plans/\``;
|
|
|
527
529
|
}
|
|
528
530
|
|
|
529
531
|
ctx.sendUserMessage(
|
|
530
|
-
`Analyze this project
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
Instructions
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
-
|
|
541
|
-
-
|
|
532
|
+
`Analyze this project and call the orchestrate tool. It will create the plan AND execute all tasks automatically with parallel sub-agents.
|
|
533
|
+
|
|
534
|
+
## Project
|
|
535
|
+
${description}
|
|
536
|
+
|
|
537
|
+
## Instructions
|
|
538
|
+
|
|
539
|
+
1. **Analyze** the project: identify goals, requirements, technical constraints, and architecture decisions.
|
|
540
|
+
|
|
541
|
+
2. **Decompose** into tasks. Each task will be executed by an isolated sub-agent that has:
|
|
542
|
+
- NO access to this conversation
|
|
543
|
+
- NO shared memory or context
|
|
544
|
+
- Its own model and system prompt
|
|
545
|
+
- Full tool access (read, write, edit, bash, grep, find, ls)
|
|
546
|
+
|
|
547
|
+
3. **Write self-contained task descriptions** using this pattern:
|
|
548
|
+
- CONTEXT: What exists, relevant file paths, current state
|
|
549
|
+
- TASK: Exactly what to implement/analyze/test
|
|
550
|
+
- FORMAT: Expected output (files created, test results, etc.)
|
|
551
|
+
- CONSTRAINTS: Rules, conventions, things to avoid
|
|
552
|
+
|
|
553
|
+
4. **Assign agents**: explore (read-only analysis), plan (design), code (implementation), test (write+run tests), review (quality audit)
|
|
554
|
+
|
|
555
|
+
5. **Set dependencies** to maximize parallelism:
|
|
556
|
+
- Tasks without dependencies → same wave → run simultaneously
|
|
557
|
+
- Only add a dependency when a task truly needs another's output
|
|
558
|
+
- Typical flow: explore(wave 1) → plan(wave 2) → code(wave 3) → test(wave 4) → review(wave 5)
|
|
559
|
+
- But independent code tasks can run in parallel within the same wave
|
|
560
|
+
|
|
561
|
+
6. **Call the orchestrate tool** with all structured data. It handles execution automatically.`
|
|
542
562
|
);
|
|
543
563
|
},
|
|
544
564
|
});
|