chiefwiggum 1.3.13 → 1.3.14

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.
Files changed (2) hide show
  1. package/dist/cli.cjs +29 -20
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -297,7 +297,8 @@ var config = {
297
297
  get templatesDir() {
298
298
  return (0, import_node_path.join)(this.chiefwiggumHome, "templates");
299
299
  },
300
- todoFile: process.env.TODO_FILE || "TODO.md",
300
+ todoFile: process.env.TODO_FILE || "docs/chiefwiggum/TODO.md",
301
+ specsDir: "docs/chiefwiggum/specs",
301
302
  // Timing
302
303
  cooldownSeconds: parseInt(process.env.COOLDOWN_SECONDS || "5", 10),
303
304
  iterationTimeoutMinutes: parseInt(process.env.ITERATION_TIMEOUT_MINUTES || "60", 10),
@@ -737,8 +738,8 @@ async function cmdNew(planFile) {
737
738
  }
738
739
  async function checkExistingFiles() {
739
740
  const existingFiles = [];
740
- if ((0, import_node_fs3.existsSync)(config.todoFile)) existingFiles.push("TODO.md");
741
- if ((0, import_node_fs3.existsSync)("specs")) existingFiles.push("specs/");
741
+ if ((0, import_node_fs3.existsSync)(config.todoFile)) existingFiles.push(config.todoFile);
742
+ if ((0, import_node_fs3.existsSync)(config.specsDir)) existingFiles.push(`${config.specsDir}/`);
742
743
  if (existingFiles.length === 0) {
743
744
  return true;
744
745
  }
@@ -844,6 +845,10 @@ ${features}
844
845
  }
845
846
  async function generateFromPlan(planFile) {
846
847
  const planContent = (0, import_node_fs3.readFileSync)(planFile, "utf-8");
848
+ const specsDir = config.specsDir;
849
+ const todoFile = config.todoFile;
850
+ const prdPath = `${specsDir}/prd.md`;
851
+ const techPath = `${specsDir}/technical.md`;
847
852
  console.log();
848
853
  console.log(import_picocolors7.default.green("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"));
849
854
  console.log(import_picocolors7.default.green(` Generating specs from: ${planFile}`));
@@ -854,13 +859,13 @@ async function generateFromPlan(planFile) {
854
859
  console.log("Run 'chiefwiggum new' to set up templates first.");
855
860
  process.exit(1);
856
861
  }
857
- (0, import_node_fs3.mkdirSync)("specs", { recursive: true });
862
+ (0, import_node_fs3.mkdirSync)(specsDir, { recursive: true });
858
863
  const prdTemplate = (0, import_node_fs3.readFileSync)(`${LOCAL_TEMPLATES_DIR}/prd-template.md`, "utf-8");
859
864
  const techTemplate = (0, import_node_fs3.readFileSync)(`${LOCAL_TEMPLATES_DIR}/technical-template.md`, "utf-8");
860
865
  const todoTemplate = (0, import_node_fs3.readFileSync)(`${LOCAL_TEMPLATES_DIR}/TODO-template.md`, "utf-8");
861
866
  const claudeTemplate = (0, import_node_fs3.readFileSync)(`${LOCAL_TEMPLATES_DIR}/CLAUDE-template.md`, "utf-8");
862
867
  console.log();
863
- console.log(import_picocolors7.default.yellow("[1/4] Generating specs/prd.md..."));
868
+ console.log(import_picocolors7.default.yellow(`[1/4] Generating ${prdPath}...`));
864
869
  const prdPrompt = `You are filling in a PRD template based on a project plan.
865
870
 
866
871
  Here is the plan:
@@ -875,13 +880,13 @@ ${prdTemplate}
875
880
 
876
881
  Fill in the template with specific details from the plan.
877
882
  Replace all placeholder text in [brackets] with real content.
878
- Write the completed PRD directly to specs/prd.md.
883
+ Write the completed PRD directly to ${prdPath}.
879
884
  Do NOT ask questions \u2014 infer everything from the plan.`;
880
885
  await runClaude({ prompt: prdPrompt });
881
- console.log(import_picocolors7.default.green(" \u2713 specs/prd.md"));
886
+ console.log(import_picocolors7.default.green(` \u2713 ${prdPath}`));
882
887
  console.log();
883
- console.log(import_picocolors7.default.yellow("[2/4] Generating specs/technical.md..."));
884
- const prdGenerated = (0, import_node_fs3.existsSync)("specs/prd.md") ? (0, import_node_fs3.readFileSync)("specs/prd.md", "utf-8") : "";
888
+ console.log(import_picocolors7.default.yellow(`[2/4] Generating ${techPath}...`));
889
+ const prdGenerated = (0, import_node_fs3.existsSync)(prdPath) ? (0, import_node_fs3.readFileSync)(prdPath, "utf-8") : "";
885
890
  const techPrompt = `You are filling in a Technical Specification template based on a PRD.
886
891
 
887
892
  Here is the PRD:
@@ -896,16 +901,16 @@ ${techTemplate}
896
901
 
897
902
  Fill in the template with specific technical details.
898
903
  Replace all placeholder text in [brackets] with real content.
899
- Write the completed spec directly to specs/technical.md.
904
+ Write the completed spec directly to ${techPath}.
900
905
  Do NOT ask questions \u2014 infer everything from the PRD.`;
901
906
  await runClaude({ prompt: techPrompt });
902
- console.log(import_picocolors7.default.green(" \u2713 specs/technical.md"));
907
+ console.log(import_picocolors7.default.green(` \u2713 ${techPath}`));
903
908
  console.log();
904
909
  if ((0, import_node_fs3.existsSync)("CLAUDE.md")) {
905
910
  console.log(import_picocolors7.default.yellow("[3/4] Skipping CLAUDE.md (already exists)"));
906
911
  } else {
907
912
  console.log(import_picocolors7.default.yellow("[3/4] Generating CLAUDE.md..."));
908
- const techGenerated2 = (0, import_node_fs3.existsSync)("specs/technical.md") ? (0, import_node_fs3.readFileSync)("specs/technical.md", "utf-8") : "";
913
+ const techGenerated2 = (0, import_node_fs3.existsSync)(techPath) ? (0, import_node_fs3.readFileSync)(techPath, "utf-8") : "";
909
914
  const claudePrompt = `You are filling in a CLAUDE.md template for a project.
910
915
 
911
916
  Here is the PRD:
@@ -931,8 +936,12 @@ Write directly to CLAUDE.md.`;
931
936
  console.log(import_picocolors7.default.green(" \u2713 CLAUDE.md"));
932
937
  }
933
938
  console.log();
934
- console.log(import_picocolors7.default.yellow("[4/4] Generating TODO.md..."));
935
- const techGenerated = (0, import_node_fs3.existsSync)("specs/technical.md") ? (0, import_node_fs3.readFileSync)("specs/technical.md", "utf-8") : "";
939
+ console.log(import_picocolors7.default.yellow(`[4/4] Generating ${todoFile}...`));
940
+ const techGenerated = (0, import_node_fs3.existsSync)(techPath) ? (0, import_node_fs3.readFileSync)(techPath, "utf-8") : "";
941
+ const todoDir = (0, import_node_path2.dirname)(todoFile);
942
+ if (todoDir !== ".") {
943
+ (0, import_node_fs3.mkdirSync)(todoDir, { recursive: true });
944
+ }
936
945
  const todoPrompt = `You are filling in a TODO template based on specs.
937
946
 
938
947
  Here is the PRD:
@@ -954,20 +963,20 @@ Create a phased TODO.md following the template structure.
954
963
  Use checkbox format: - [ ] Task description
955
964
  Keep tasks granular (1-2 hours max each).
956
965
  End each phase with: - [ ] Phase N review
957
- Write directly to TODO.md.`;
966
+ Write directly to ${todoFile}.`;
958
967
  await runClaude({ prompt: todoPrompt });
959
- console.log(import_picocolors7.default.green(" \u2713 TODO.md"));
968
+ console.log(import_picocolors7.default.green(` \u2713 ${todoFile}`));
960
969
  console.log();
961
970
  console.log(import_picocolors7.default.green("Specs generated:"));
962
- console.log(" - specs/prd.md");
963
- console.log(" - specs/technical.md");
971
+ console.log(` - ${prdPath}`);
972
+ console.log(` - ${techPath}`);
964
973
  if (!(0, import_node_fs3.existsSync)("CLAUDE.md")) {
965
974
  console.log(" - CLAUDE.md");
966
975
  }
967
- console.log(" - TODO.md");
976
+ console.log(` - ${todoFile}`);
968
977
  try {
969
978
  (0, import_node_child_process6.execSync)("git rev-parse --git-dir", { stdio: "pipe" });
970
- (0, import_node_child_process6.execSync)("git add specs/ TODO.md CLAUDE.md 2>/dev/null || true", { stdio: "pipe" });
979
+ (0, import_node_child_process6.execSync)(`git add ${specsDir}/ ${todoFile} CLAUDE.md 2>/dev/null || true`, { stdio: "pipe" });
971
980
  (0, import_node_child_process6.execSync)('git commit -m "chore: generate specs from plan" 2>/dev/null || true', {
972
981
  stdio: "pipe"
973
982
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chiefwiggum",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "Autonomous coding agent CLI. Point it at a plan, watch it build.",
5
5
  "type": "module",
6
6
  "bin": {