claude-kanban 0.3.0 → 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.
@@ -9,7 +9,7 @@ import { existsSync as existsSync3 } from "fs";
9
9
  // src/server/services/executor.ts
10
10
  import { spawn, execSync } from "child_process";
11
11
  import { join as join4 } from "path";
12
- import { writeFileSync as writeFileSync4, unlinkSync, mkdirSync as mkdirSync2, existsSync as existsSync2, appendFileSync as appendFileSync2, readFileSync as readFileSync4, rmSync, symlinkSync } from "fs";
12
+ import { writeFileSync as writeFileSync4, unlinkSync, mkdirSync as mkdirSync2, existsSync as existsSync2, appendFileSync as appendFileSync2, readFileSync as readFileSync4, rmSync } from "fs";
13
13
  import { EventEmitter } from "events";
14
14
 
15
15
  // src/server/services/project.ts
@@ -379,7 +379,6 @@ ${summary}
379
379
  cwd: this.projectPath,
380
380
  stdio: "pipe"
381
381
  });
382
- this.symlinkDependencies(worktreePath);
383
382
  console.log(`[executor] Created worktree at ${worktreePath} on branch ${branchName}`);
384
383
  return { worktreePath, branchName };
385
384
  } catch (error) {
@@ -387,38 +386,6 @@ ${summary}
387
386
  return null;
388
387
  }
389
388
  }
390
- /**
391
- * Symlink dependency directories from main project to worktree
392
- */
393
- symlinkDependencies(worktreePath) {
394
- const depDirs = [
395
- "node_modules",
396
- ".pnpm",
397
- // pnpm store
398
- ".yarn",
399
- // yarn cache
400
- "vendor",
401
- // PHP/Ruby deps
402
- "__pycache__",
403
- // Python cache
404
- ".venv",
405
- // Python virtual env
406
- "venv"
407
- // Python virtual env
408
- ];
409
- for (const dir of depDirs) {
410
- const sourcePath = join4(this.projectPath, dir);
411
- const targetPath = join4(worktreePath, dir);
412
- if (existsSync2(sourcePath) && !existsSync2(targetPath)) {
413
- try {
414
- symlinkSync(sourcePath, targetPath, "junction");
415
- console.log(`[executor] Symlinked ${dir} to worktree`);
416
- } catch (error) {
417
- console.log(`[executor] Could not symlink ${dir}:`, error);
418
- }
419
- }
420
- }
421
- }
422
389
  /**
423
390
  * Remove a git worktree
424
391
  */
@@ -504,7 +471,7 @@ ${summary}
504
471
  /**
505
472
  * Build the prompt for a specific task
506
473
  */
507
- buildTaskPrompt(task, config) {
474
+ buildTaskPrompt(task, config, worktreeInfo) {
508
475
  const kanbanDir = join4(this.projectPath, KANBAN_DIR4);
509
476
  const prdPath = join4(kanbanDir, "prd.json");
510
477
  const progressPath = join4(kanbanDir, "progress.txt");
@@ -518,9 +485,15 @@ ${task.steps.map((s, i) => `${i + 1}. ${s}`).join("\n")}` : "";
518
485
  if (config.project.testCommand) {
519
486
  verifySteps.push(`Run tests: ${config.project.testCommand}`);
520
487
  }
521
- const verifySection = verifySteps.length > 0 ? `2. Verify your work:
488
+ const verifySection = verifySteps.length > 0 ? `3. Verify your work:
522
489
  ${verifySteps.map((s) => ` - ${s}`).join("\n")}
523
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
+
524
497
  ` : "";
525
498
  return `You are an AI coding agent. Complete the following task:
526
499
 
@@ -532,22 +505,24 @@ Priority: ${task.priority}
532
505
  ${task.description}
533
506
  ${stepsText}
534
507
 
535
- ## INSTRUCTIONS
536
- 1. Implement this task as described above.
508
+ ${worktreeSection}## INSTRUCTIONS
509
+ 1. If dependencies are not installed, install them first.
510
+
511
+ 2. Implement this task as described above.
537
512
 
538
- ${verifySection}${verifySteps.length > 0 ? "3" : "2"}. When complete, update the task in ${prdPath}:
513
+ ${verifySection}${verifySteps.length > 0 ? "4" : "3"}. When complete, update the task in ${prdPath}:
539
514
  - Find the task with id "${task.id}"
540
515
  - Set "passes": true
541
516
  - Set "status": "completed"
542
517
 
543
- ${verifySteps.length > 0 ? "4" : "3"}. Document your work in ${progressPath}:
518
+ ${verifySteps.length > 0 ? "5" : "4"}. Document your work in ${progressPath}:
544
519
  - What you implemented and files changed
545
520
  - Key decisions made and why
546
521
  - Gotchas, edge cases, or tricky parts discovered
547
522
  - Useful patterns or approaches that worked well
548
523
  - Anything a future agent should know about this area of the codebase
549
524
 
550
- ${verifySteps.length > 0 ? "5" : "4"}. Make a git commit with a descriptive message.
525
+ ${verifySteps.length > 0 ? "6" : "5"}. Make a git commit with a descriptive message.
551
526
 
552
527
  Focus only on this task. When successfully complete, output: <promise>COMPLETE</promise>`;
553
528
  }
@@ -571,7 +546,7 @@ Focus only on this task. When successfully complete, output: <promise>COMPLETE</
571
546
  const startedAt = /* @__PURE__ */ new Date();
572
547
  const worktreeInfo = this.createWorktree(taskId);
573
548
  const executionPath = worktreeInfo?.worktreePath || this.projectPath;
574
- const prompt = this.buildTaskPrompt(task, config);
549
+ const prompt = this.buildTaskPrompt(task, config, worktreeInfo);
575
550
  const kanbanDir = join4(this.projectPath, KANBAN_DIR4);
576
551
  const promptFile = join4(kanbanDir, `prompt-${taskId}.txt`);
577
552
  writeFileSync4(promptFile, prompt);