claude-kanban 0.2.1 → 0.3.1

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.
@@ -471,13 +471,30 @@ ${summary}
471
471
  /**
472
472
  * Build the prompt for a specific task
473
473
  */
474
- buildTaskPrompt(task, config) {
474
+ buildTaskPrompt(task, config, worktreeInfo) {
475
475
  const kanbanDir = join4(this.projectPath, KANBAN_DIR4);
476
476
  const prdPath = join4(kanbanDir, "prd.json");
477
477
  const progressPath = join4(kanbanDir, "progress.txt");
478
478
  const stepsText = task.steps.length > 0 ? `
479
479
  Verification steps:
480
480
  ${task.steps.map((s, i) => `${i + 1}. ${s}`).join("\n")}` : "";
481
+ const verifySteps = [];
482
+ if (config.project.typecheckCommand) {
483
+ verifySteps.push(`Run typecheck: ${config.project.typecheckCommand}`);
484
+ }
485
+ if (config.project.testCommand) {
486
+ verifySteps.push(`Run tests: ${config.project.testCommand}`);
487
+ }
488
+ const verifySection = verifySteps.length > 0 ? `3. Verify your work:
489
+ ${verifySteps.map((s) => ` - ${s}`).join("\n")}
490
+
491
+ ` : "";
492
+ const worktreeSection = worktreeInfo ? `## ENVIRONMENT
493
+ You are running in an isolated git worktree on branch "${worktreeInfo.branchName}".
494
+ This is a fresh checkout - dependencies (node_modules, vendor, etc.) are NOT installed.
495
+ Before running any build/test commands, install dependencies first (e.g., npm install, composer install, pip install).
496
+
497
+ ` : "";
481
498
  return `You are an AI coding agent. Complete the following task:
482
499
 
483
500
  ## TASK
@@ -488,26 +505,24 @@ Priority: ${task.priority}
488
505
  ${task.description}
489
506
  ${stepsText}
490
507
 
491
- ## INSTRUCTIONS
492
- 1. Implement this task as described above.
508
+ ${worktreeSection}## INSTRUCTIONS
509
+ 1. If dependencies are not installed, install them first.
493
510
 
494
- 2. Verify your work:
495
- - Run typecheck: ${config.project.typecheckCommand}
496
- - Run tests: ${config.project.testCommand}
511
+ 2. Implement this task as described above.
497
512
 
498
- 3. When complete, update the task in ${prdPath}:
513
+ ${verifySection}${verifySteps.length > 0 ? "4" : "3"}. When complete, update the task in ${prdPath}:
499
514
  - Find the task with id "${task.id}"
500
515
  - Set "passes": true
501
516
  - Set "status": "completed"
502
517
 
503
- 4. Document your work in ${progressPath}:
518
+ ${verifySteps.length > 0 ? "5" : "4"}. Document your work in ${progressPath}:
504
519
  - What you implemented and files changed
505
520
  - Key decisions made and why
506
521
  - Gotchas, edge cases, or tricky parts discovered
507
522
  - Useful patterns or approaches that worked well
508
523
  - Anything a future agent should know about this area of the codebase
509
524
 
510
- 5. Make a git commit with a descriptive message.
525
+ ${verifySteps.length > 0 ? "6" : "5"}. Make a git commit with a descriptive message.
511
526
 
512
527
  Focus only on this task. When successfully complete, output: <promise>COMPLETE</promise>`;
513
528
  }
@@ -531,7 +546,7 @@ Focus only on this task. When successfully complete, output: <promise>COMPLETE</
531
546
  const startedAt = /* @__PURE__ */ new Date();
532
547
  const worktreeInfo = this.createWorktree(taskId);
533
548
  const executionPath = worktreeInfo?.worktreePath || this.projectPath;
534
- const prompt = this.buildTaskPrompt(task, config);
549
+ const prompt = this.buildTaskPrompt(task, config, worktreeInfo);
535
550
  const kanbanDir = join4(this.projectPath, KANBAN_DIR4);
536
551
  const promptFile = join4(kanbanDir, `prompt-${taskId}.txt`);
537
552
  writeFileSync4(promptFile, prompt);