chiefwiggum 1.3.14 → 1.3.17

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 +115 -11
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -626,6 +626,17 @@ async function cmdLoop() {
626
626
  var __dirname = (0, import_node_path2.dirname)((0, import_node_url.fileURLToPath)(importMetaUrl));
627
627
  var LOCAL_TEMPLATES_DIR = ".chiefwiggum/templates";
628
628
  var CONFIG_FILE = ".chiefwiggum/CLAUDE.md";
629
+ function getProjectTracker() {
630
+ if (!(0, import_node_fs3.existsSync)(CONFIG_FILE)) {
631
+ return "todo";
632
+ }
633
+ try {
634
+ const config2 = JSON.parse((0, import_node_fs3.readFileSync)(CONFIG_FILE, "utf-8"));
635
+ return config2.projectTracker || "todo";
636
+ } catch {
637
+ return "todo";
638
+ }
639
+ }
629
640
  var BUNDLED_TEMPLATES_DIR = (0, import_node_path2.join)(__dirname, "..", "templates");
630
641
  var SKIP_DIRS = /* @__PURE__ */ new Set([
631
642
  "node_modules",
@@ -935,14 +946,101 @@ Write directly to CLAUDE.md.`;
935
946
  await runClaude({ prompt: claudePrompt });
936
947
  console.log(import_picocolors7.default.green(" \u2713 CLAUDE.md"));
937
948
  }
938
- console.log();
939
- console.log(import_picocolors7.default.yellow(`[4/4] Generating ${todoFile}...`));
949
+ const tracker = getProjectTracker();
940
950
  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
- }
945
- const todoPrompt = `You are filling in a TODO template based on specs.
951
+ if (tracker === "github") {
952
+ console.log();
953
+ let repoName = "";
954
+ try {
955
+ repoName = (0, import_node_child_process6.execSync)("gh repo view --json nameWithOwner -q .nameWithOwner", {
956
+ encoding: "utf-8",
957
+ stdio: ["pipe", "pipe", "pipe"]
958
+ }).trim();
959
+ } catch {
960
+ console.log(import_picocolors7.default.red("Could not detect GitHub repo. Make sure you're in a git repo with a GitHub remote."));
961
+ process.exit(1);
962
+ }
963
+ let existingProjects = [];
964
+ try {
965
+ const projectsOutput = (0, import_node_child_process6.execSync)(`gh project list --owner ${repoName.split("/")[0]} --format json`, {
966
+ encoding: "utf-8",
967
+ stdio: ["pipe", "pipe", "pipe"]
968
+ });
969
+ const projects = JSON.parse(projectsOutput);
970
+ existingProjects = projects.projects?.map((p2) => p2.title) || [];
971
+ } catch {
972
+ }
973
+ console.log(import_picocolors7.default.bold(`GitHub Project Board`));
974
+ console.log(import_picocolors7.default.dim(`Organize issues in a Kanban-style board for ${repoName}`));
975
+ console.log();
976
+ const projectOptions = [
977
+ ...existingProjects.map((name) => ({ value: name, label: name })),
978
+ { value: "__new__", label: "Create new board..." },
979
+ { value: "__none__", label: "Skip (just create issues without a board)" }
980
+ ];
981
+ const selectedProject = await select2({
982
+ message: "Add issues to a project board?",
983
+ options: projectOptions
984
+ });
985
+ let projectName = null;
986
+ if (selectedProject === "__new__") {
987
+ projectName = await text2({
988
+ message: "Board name",
989
+ placeholder: "e.g., SVG Icon Generator v2"
990
+ });
991
+ console.log(import_picocolors7.default.cyan(`Creating board "${projectName}"...`));
992
+ try {
993
+ (0, import_node_child_process6.execSync)(`gh project create --owner ${repoName.split("/")[0]} --title "${projectName}"`, {
994
+ stdio: "inherit"
995
+ });
996
+ console.log(import_picocolors7.default.green(`\u2713 Board "${projectName}" created`));
997
+ } catch {
998
+ console.log(import_picocolors7.default.yellow("Could not create board. Issues will be created without one."));
999
+ projectName = null;
1000
+ }
1001
+ } else if (selectedProject !== "__none__") {
1002
+ projectName = selectedProject;
1003
+ }
1004
+ console.log();
1005
+ console.log(import_picocolors7.default.yellow("[4/4] Creating GitHub Issues..."));
1006
+ const projectInstruction = projectName ? `After creating each issue, add it to the project "${projectName}" using:
1007
+ gh project item-add <PROJECT_NUMBER> --owner ${repoName.split("/")[0]} --url <ISSUE_URL>` : "";
1008
+ const issuesPrompt = `You are creating GitHub Issues based on specs.
1009
+
1010
+ Here is the PRD:
1011
+ <prd>
1012
+ ${prdGenerated}
1013
+ </prd>
1014
+
1015
+ Here is the Technical Specification:
1016
+ <technical>
1017
+ ${techGenerated}
1018
+ </technical>
1019
+
1020
+ Create GitHub Issues for this project using the gh CLI.
1021
+ Break down the work into granular issues (1-2 hours each).
1022
+ Group related issues with labels like "phase-1", "phase-2", etc.
1023
+
1024
+ For each issue, run a command like:
1025
+ gh issue create --title "Issue title" --body "Description of the task" --label "phase-1"
1026
+
1027
+ ${projectInstruction}
1028
+
1029
+ Create 5-15 issues covering the full implementation.
1030
+ Do NOT create a TODO.md file - only create GitHub Issues.`;
1031
+ await runClaude({ prompt: issuesPrompt });
1032
+ console.log(import_picocolors7.default.green(" \u2713 GitHub Issues created"));
1033
+ if (projectName) {
1034
+ console.log(import_picocolors7.default.green(` \u2713 Added to board "${projectName}"`));
1035
+ }
1036
+ } else {
1037
+ console.log();
1038
+ console.log(import_picocolors7.default.yellow(`[4/4] Generating ${todoFile}...`));
1039
+ const todoDir = (0, import_node_path2.dirname)(todoFile);
1040
+ if (todoDir !== ".") {
1041
+ (0, import_node_fs3.mkdirSync)(todoDir, { recursive: true });
1042
+ }
1043
+ const todoPrompt = `You are filling in a TODO template based on specs.
946
1044
 
947
1045
  Here is the PRD:
948
1046
  <prd>
@@ -964,8 +1062,9 @@ Use checkbox format: - [ ] Task description
964
1062
  Keep tasks granular (1-2 hours max each).
965
1063
  End each phase with: - [ ] Phase N review
966
1064
  Write directly to ${todoFile}.`;
967
- await runClaude({ prompt: todoPrompt });
968
- console.log(import_picocolors7.default.green(` \u2713 ${todoFile}`));
1065
+ await runClaude({ prompt: todoPrompt });
1066
+ console.log(import_picocolors7.default.green(` \u2713 ${todoFile}`));
1067
+ }
969
1068
  console.log();
970
1069
  console.log(import_picocolors7.default.green("Specs generated:"));
971
1070
  console.log(` - ${prdPath}`);
@@ -973,10 +1072,15 @@ Write directly to ${todoFile}.`;
973
1072
  if (!(0, import_node_fs3.existsSync)("CLAUDE.md")) {
974
1073
  console.log(" - CLAUDE.md");
975
1074
  }
976
- console.log(` - ${todoFile}`);
1075
+ if (tracker === "github") {
1076
+ console.log(" - GitHub Issues");
1077
+ } else {
1078
+ console.log(` - ${todoFile}`);
1079
+ }
977
1080
  try {
978
1081
  (0, import_node_child_process6.execSync)("git rev-parse --git-dir", { stdio: "pipe" });
979
- (0, import_node_child_process6.execSync)(`git add ${specsDir}/ ${todoFile} CLAUDE.md 2>/dev/null || true`, { stdio: "pipe" });
1082
+ const filesToAdd = tracker === "github" ? `${specsDir}/ CLAUDE.md` : `${specsDir}/ ${todoFile} CLAUDE.md`;
1083
+ (0, import_node_child_process6.execSync)(`git add ${filesToAdd} 2>/dev/null || true`, { stdio: "pipe" });
980
1084
  (0, import_node_child_process6.execSync)('git commit -m "chore: generate specs from plan" 2>/dev/null || true', {
981
1085
  stdio: "pipe"
982
1086
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chiefwiggum",
3
- "version": "1.3.14",
3
+ "version": "1.3.17",
4
4
  "description": "Autonomous coding agent CLI. Point it at a plan, watch it build.",
5
5
  "type": "module",
6
6
  "bin": {