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.
package/dist/bin/cli.js CHANGED
@@ -16,7 +16,7 @@ import { existsSync as existsSync3 } from "fs";
16
16
  // src/server/services/executor.ts
17
17
  import { spawn, execSync } from "child_process";
18
18
  import { join as join4 } from "path";
19
- import { writeFileSync as writeFileSync4, unlinkSync, mkdirSync as mkdirSync2, existsSync as existsSync2, appendFileSync as appendFileSync2, readFileSync as readFileSync4, rmSync, symlinkSync } from "fs";
19
+ import { writeFileSync as writeFileSync4, unlinkSync, mkdirSync as mkdirSync2, existsSync as existsSync2, appendFileSync as appendFileSync2, readFileSync as readFileSync4, rmSync } from "fs";
20
20
  import { EventEmitter } from "events";
21
21
 
22
22
  // src/server/services/project.ts
@@ -699,7 +699,6 @@ ${summary}
699
699
  cwd: this.projectPath,
700
700
  stdio: "pipe"
701
701
  });
702
- this.symlinkDependencies(worktreePath);
703
702
  console.log(`[executor] Created worktree at ${worktreePath} on branch ${branchName}`);
704
703
  return { worktreePath, branchName };
705
704
  } catch (error) {
@@ -707,38 +706,6 @@ ${summary}
707
706
  return null;
708
707
  }
709
708
  }
710
- /**
711
- * Symlink dependency directories from main project to worktree
712
- */
713
- symlinkDependencies(worktreePath) {
714
- const depDirs = [
715
- "node_modules",
716
- ".pnpm",
717
- // pnpm store
718
- ".yarn",
719
- // yarn cache
720
- "vendor",
721
- // PHP/Ruby deps
722
- "__pycache__",
723
- // Python cache
724
- ".venv",
725
- // Python virtual env
726
- "venv"
727
- // Python virtual env
728
- ];
729
- for (const dir of depDirs) {
730
- const sourcePath = join4(this.projectPath, dir);
731
- const targetPath = join4(worktreePath, dir);
732
- if (existsSync2(sourcePath) && !existsSync2(targetPath)) {
733
- try {
734
- symlinkSync(sourcePath, targetPath, "junction");
735
- console.log(`[executor] Symlinked ${dir} to worktree`);
736
- } catch (error) {
737
- console.log(`[executor] Could not symlink ${dir}:`, error);
738
- }
739
- }
740
- }
741
- }
742
709
  /**
743
710
  * Remove a git worktree
744
711
  */
@@ -824,7 +791,7 @@ ${summary}
824
791
  /**
825
792
  * Build the prompt for a specific task
826
793
  */
827
- buildTaskPrompt(task, config) {
794
+ buildTaskPrompt(task, config, worktreeInfo) {
828
795
  const kanbanDir = join4(this.projectPath, KANBAN_DIR4);
829
796
  const prdPath = join4(kanbanDir, "prd.json");
830
797
  const progressPath = join4(kanbanDir, "progress.txt");
@@ -838,9 +805,15 @@ ${task.steps.map((s, i) => `${i + 1}. ${s}`).join("\n")}` : "";
838
805
  if (config.project.testCommand) {
839
806
  verifySteps.push(`Run tests: ${config.project.testCommand}`);
840
807
  }
841
- const verifySection = verifySteps.length > 0 ? `2. Verify your work:
808
+ const verifySection = verifySteps.length > 0 ? `3. Verify your work:
842
809
  ${verifySteps.map((s) => ` - ${s}`).join("\n")}
843
810
 
811
+ ` : "";
812
+ const worktreeSection = worktreeInfo ? `## ENVIRONMENT
813
+ You are running in an isolated git worktree on branch "${worktreeInfo.branchName}".
814
+ This is a fresh checkout - dependencies (node_modules, vendor, etc.) are NOT installed.
815
+ Before running any build/test commands, install dependencies first (e.g., npm install, composer install, pip install).
816
+
844
817
  ` : "";
845
818
  return `You are an AI coding agent. Complete the following task:
846
819
 
@@ -852,22 +825,24 @@ Priority: ${task.priority}
852
825
  ${task.description}
853
826
  ${stepsText}
854
827
 
855
- ## INSTRUCTIONS
856
- 1. Implement this task as described above.
828
+ ${worktreeSection}## INSTRUCTIONS
829
+ 1. If dependencies are not installed, install them first.
830
+
831
+ 2. Implement this task as described above.
857
832
 
858
- ${verifySection}${verifySteps.length > 0 ? "3" : "2"}. When complete, update the task in ${prdPath}:
833
+ ${verifySection}${verifySteps.length > 0 ? "4" : "3"}. When complete, update the task in ${prdPath}:
859
834
  - Find the task with id "${task.id}"
860
835
  - Set "passes": true
861
836
  - Set "status": "completed"
862
837
 
863
- ${verifySteps.length > 0 ? "4" : "3"}. Document your work in ${progressPath}:
838
+ ${verifySteps.length > 0 ? "5" : "4"}. Document your work in ${progressPath}:
864
839
  - What you implemented and files changed
865
840
  - Key decisions made and why
866
841
  - Gotchas, edge cases, or tricky parts discovered
867
842
  - Useful patterns or approaches that worked well
868
843
  - Anything a future agent should know about this area of the codebase
869
844
 
870
- ${verifySteps.length > 0 ? "5" : "4"}. Make a git commit with a descriptive message.
845
+ ${verifySteps.length > 0 ? "6" : "5"}. Make a git commit with a descriptive message.
871
846
 
872
847
  Focus only on this task. When successfully complete, output: <promise>COMPLETE</promise>`;
873
848
  }
@@ -891,7 +866,7 @@ Focus only on this task. When successfully complete, output: <promise>COMPLETE</
891
866
  const startedAt = /* @__PURE__ */ new Date();
892
867
  const worktreeInfo = this.createWorktree(taskId);
893
868
  const executionPath = worktreeInfo?.worktreePath || this.projectPath;
894
- const prompt = this.buildTaskPrompt(task, config);
869
+ const prompt = this.buildTaskPrompt(task, config, worktreeInfo);
895
870
  const kanbanDir = join4(this.projectPath, KANBAN_DIR4);
896
871
  const promptFile = join4(kanbanDir, `prompt-${taskId}.txt`);
897
872
  writeFileSync4(promptFile, prompt);