@phi-code-admin/phi-code 0.61.6 → 0.61.7

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.
@@ -438,67 +438,49 @@ export default function orchestratorExtension(pi: ExtensionAPI) {
438
438
  // ─── /plan Command — Full workflow ───────────────────────────────
439
439
 
440
440
  pi.registerCommand("plan", {
441
- description: "Plan AND execute a project: creates spec + todo, then runs each task with isolated sub-agents",
441
+ description: "Plan AND execute a project describe what to build and the LLM does it all",
442
442
  handler: async (args, ctx) => {
443
443
  const description = args.trim();
444
444
 
445
445
  if (!description) {
446
446
  ctx.ui.notify(`**Usage:** \`/plan <project description>\`
447
447
 
448
- **Full workflow in one command:**
449
- 1. LLM analyzes your description
450
- 2. Creates spec.md + todo.md
451
- 3. Executes each task with an isolated sub-agent
452
- 4. Each agent has its own context, model, and system prompt
453
- 5. Results saved to progress.md
454
-
455
448
  **Examples:**
456
449
  /plan Build a REST API for user authentication with JWT
450
+ /plan Create a cyberpunk Pong browser game
457
451
  /plan Add test coverage to the payment module
458
- /plan Refactor the frontend to use TypeScript
459
452
 
460
453
  **Other commands:**
461
- /run Re-execute an existing plan
462
- /plans — List all plans and status`, "info");
454
+ /plans List all plans`, "info");
463
455
  return;
464
456
  }
465
457
 
466
- pi.sendUserMessage(
467
- `Analyze this project and call the orchestrate tool. It will create the plan AND execute all tasks automatically with parallel sub-agents.
468
-
469
- ## Project
470
- ${description}
471
-
472
- ## Instructions
458
+ // Create plan files
459
+ await ensurePlansDir();
460
+ const ts = timestamp();
461
+ const specFile = `spec-${ts}.md`;
462
+ const todoFile = `todo-${ts}.md`;
473
463
 
474
- 1. **Analyze** the project: identify goals, requirements, technical constraints, and architecture decisions.
464
+ const spec = `# Project Plan\n\n**Created:** ${new Date().toLocaleString()}\n\n## Description\n\n${description}\n`;
465
+ await writeFile(join(plansDir, specFile), spec, "utf-8");
466
+ await writeFile(join(plansDir, todoFile), `# Todo\n\n(LLM will execute directly)\n`, "utf-8");
475
467
 
476
- 2. **Decompose** into tasks. Each task will be executed by an isolated sub-agent that has:
477
- - NO access to this conversation
478
- - NO shared memory or context
479
- - Its own model and system prompt
480
- - Full tool access (read, write, edit, bash, grep, find, ls)
468
+ ctx.ui.notify(`📋 Plan created: \`${specFile}\`\n🚀 Executing project now...`, "info");
481
469
 
482
- 3. **Write self-contained task descriptions** using this pattern:
483
- - CONTEXT: What exists, relevant file paths, current state
484
- - TASK: Exactly what to implement/analyze/test
485
- - FORMAT: Expected output (files created, test results, etc.)
486
- - CONSTRAINTS: Rules, conventions, things to avoid
470
+ // Paste the structured prompt into the editor so the user just presses Enter
471
+ // This avoids sendUserMessage which fails with "Agent is already processing"
472
+ const prompt = `Build this project completely. Create all necessary files, implement all features, test everything.
487
473
 
488
- 4. **Assign agents**: explore (read-only analysis), plan (design), code (implementation), test (write+run tests), review (quality audit)
474
+ ## Project
475
+ ${description}
489
476
 
490
- 5. **Set dependencies** to maximize parallelism:
491
- - Tasks without dependencies same wave run simultaneously
492
- - Only add a dependency when a task truly needs another's output
493
- - Typical flow: explore(wave 1) → plan(wave 2) code(wave 3) → test(wave 4) → review(wave 5)
494
- - But independent code tasks can run in parallel within the same wave
477
+ ## Rules
478
+ - Create ALL files needed for a complete, working project
479
+ - Use best practices and clean code
480
+ - Test that everything works (run the code if possible)
481
+ - Report what you created when done`;
495
482
 
496
- 6. **Call the orchestrate tool** with ALL fields in a SINGLE call:
497
- - title, description, goals, requirements, constraints (project metadata)
498
- - tasks (array of ALL task objects with title, description, agent, dependencies)
499
-
500
- ⚠️ CRITICAL: Include the \`tasks\` array in the SAME tool call as the project metadata. Do NOT make separate calls. All data must be in ONE orchestrate() invocation.`
501
- );
483
+ ctx.ui.pasteToEditor(prompt);
502
484
  },
503
485
  });
504
486
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phi-code-admin/phi-code",
3
- "version": "0.61.6",
3
+ "version": "0.61.7",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "piConfig": {