@punks/cli 2.1.4 → 2.1.5

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/README.md CHANGED
@@ -38,15 +38,17 @@ bun run baseline:build
38
38
 
39
39
  `punks scaffold setup` scans the target repo from `cwd` or `-i`, resolves the active scaffold baseline, writes scaffold output into the scan root or `-o`, copies the selected baseline skills, resolves pack-owned lint assets into `.devpunks/specs/lint/`, and ensures required global tool prerequisites for those skills. Use `--yes` in non-interactive harnesses to accept the resolved default pack selection without prompts.
40
40
 
41
+ Before refreshing generated skills, setup migrates legacy per-agent skill folders from `.claude/skills`, `.codex/skills`, `.cursor/skills`, and `.opencode/skills` into shared `.agents/skills`. Colliding local skill names are kept with a `-local` suffix.
42
+
41
43
  `punks update --yes` applies managed scaffold updates without prompting. It is the non-interactive alias for the apply behavior of `--write`.
42
44
 
43
45
  `punks report` opens a GitHub issue in `wearedevpunks/harness-intelligence` for reusable Harness docs, workflow, tooling, CLI, skill-pack, or wiki friction. It uses `gh auth token`, `GH_TOKEN`, or `GITHUB_TOKEN` for GitHub auth and applies report labels such as `harness-report`, `area:wiki`, `surface:cli`, `pack:dp-cli`, and `command:dp-report`.
44
46
 
45
- `punks upgrade` checks the npm dist-tag and reinstalls the CLI through the package manager detected from the current global install path: Bun, pnpm, npm, or Yarn. The reinstall bypasses minimum-release-age gates for the CLI package by passing Bun/npm zero-age flags and pnpm/Yarn zero-age environment overrides. Use `--tag next` for prerelease channels or `--force` to reinstall the selected tag even when the current version is fresh.
47
+ Interactive commands check the selected npm dist-tag before running. When a newer CLI is available, `punks` asks for confirmation, reinstalls through the detected global package manager, and exits so the command can be rerun on the upgraded binary. `punks upgrade` keeps the same installer path as an explicit manual command. Use `--tag next` for prerelease channels or `--force` to reinstall the selected tag even when the current version is fresh.
46
48
 
47
49
  Use `--baseline bundled` to force the npm-shipped baseline, or `--refresh-baseline` to refetch the stable remote baseline.
48
50
 
49
- Language packs are detected separately from framework packs. TypeScript is selected when scanned manifests depend on `typescript` or when nested source files include `.ts` / `.tsx`; Python is selected from nested `.py` files. Root-level config files and vendor, virtualenv, generated, scaffold, docs, examples, `scripts`, `opensrc`, cache, and build output directories are ignored.
51
+ Language packs are detected separately from framework packs. TypeScript is selected when scanned manifests depend on `typescript` or when nested source files include `.ts` / `.tsx`; Python is selected from nested `.py` files. Root-level config files and vendor, virtualenv, generated, scaffold, docs, examples, `scripts`, `opensrc`, agent/cache/worktree, and build output directories are ignored.
50
52
 
51
53
  The generated subagent manifest is repo-shaped from selected packs and prompt specs. Python specialists are generated only when the Python language pack is selected.
52
54
 
@@ -77,7 +79,7 @@ Current scaffold-managed global tools:
77
79
  - `portless`
78
80
  - `skills`
79
81
 
80
- On startup, `punks` may start a detached best-effort worker for a newer CLI version and the presence of the `dp-cli` operator skill. The requested command renders immediately; startup checks are advisory, run at most once per 12 hours by default, and never install/update packages or skills while another CLI command is starting. Set `DP_NO_UPDATE_CHECK=1` or `DP_NO_SKILL_UPDATE_CHECK=1` to skip those checks, or `DP_STARTUP_CHECK_INTERVAL_MS=0` to force the worker during local testing.
82
+ On startup, `punks` checks interactive TTY commands for a newer CLI and asks before installing. `--help`, `--version`, CI, non-interactive commands, and `DP_NO_UPDATE_CHECK=1` skip the prompt. The `dp-cli` operator skill check stays detached and advisory, runs at most once per 12 hours by default, and never updates skills while another CLI command is starting. Set `DP_NO_SKILL_UPDATE_CHECK=1` to skip that check or `DP_STARTUP_CHECK_INTERVAL_MS=0` to force the worker during local testing.
81
83
 
82
84
  ## Publishing
83
85
 
package/dist/index.js CHANGED
@@ -10894,6 +10894,7 @@ import { spawn as spawn2 } from "child_process";
10894
10894
  import { existsSync as existsSync8, mkdirSync as mkdirSync6, readFileSync as readFileSync9, writeFileSync as writeFileSync6 } from "fs";
10895
10895
  import { homedir as homedir3 } from "os";
10896
10896
  import path16 from "path";
10897
+ import { createInterface as createInterface3 } from "readline/promises";
10897
10898
 
10898
10899
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Array.js
10899
10900
  var exports_Array = {};
@@ -52405,7 +52406,7 @@ var recordProductTelemetryEvent = (options9) => exports_Effect.gen(function* ()
52405
52406
 
52406
52407
  // package.json
52407
52408
  var name = "@punks/cli";
52408
- var version = "2.1.4";
52409
+ var version = "2.1.5";
52409
52410
  // src/telemetry/product.ts
52410
52411
  var git = (cwd, args2) => {
52411
52412
  try {
@@ -54364,6 +54365,44 @@ var renderChoices3 = (state, options9) => {
54364
54365
  }
54365
54366
  return vsep2(documents);
54366
54367
  };
54368
+ var visiblePromptLines = (message) => {
54369
+ const lines3 = message.split(/\r?\n/u);
54370
+ const [firstLine, ...rest] = lines3;
54371
+ return [`\u25C7 ${firstLine ?? ""}`, ...rest.map((line4) => `\u2502 ${line4}`), "\u2502 "];
54372
+ };
54373
+ var visibleChoiceLines = (state, options9) => {
54374
+ const allSelected = state.selectedIndices.size === options9.choices.length;
54375
+ const metaOptions = [
54376
+ { title: allSelected ? "Clear all selected packs" : options9.selectAll }
54377
+ ];
54378
+ const allChoices = [...metaOptions, ...options9.choices];
54379
+ const toDisplay = entriesToDisplay2(state.index, allChoices.length, options9.maxPerPage);
54380
+ const lines3 = [];
54381
+ for (let index = toDisplay.startIndex;index < toDisplay.endIndex; index++) {
54382
+ const choice4 = allChoices[index];
54383
+ let prefix = " ";
54384
+ if (index === toDisplay.startIndex && toDisplay.startIndex > 0) {
54385
+ prefix = "\u2191";
54386
+ } else if (index === toDisplay.endIndex - 1 && toDisplay.endIndex < allChoices.length) {
54387
+ prefix = "\u2193";
54388
+ } else {
54389
+ prefix = "\u2502";
54390
+ }
54391
+ if (index < metaOptionsCount2) {
54392
+ lines3.push(`${prefix} ${choice4.title}`);
54393
+ continue;
54394
+ }
54395
+ const choiceIndex = index - metaOptionsCount2;
54396
+ const packChoice = choice4;
54397
+ const selected = state.selectedIndices.has(choiceIndex);
54398
+ const checkbox = selected ? "\u2612" : "\u2610";
54399
+ const description = packChoice.description && state.index === index ? ` - ${packChoice.description}` : "";
54400
+ lines3.push(`${prefix} ${checkbox} ${packChoice.title} ${description}`);
54401
+ }
54402
+ return lines3;
54403
+ };
54404
+ var visibleFrameText = (state, options9) => [...visiblePromptLines(options9.message), ...visibleChoiceLines(state, options9)].join(`
54405
+ `);
54367
54406
  var renderNextFrame9 = (state, options9) => exports_Effect.gen(function* () {
54368
54407
  const terminal = yield* Terminal;
54369
54408
  const columns = yield* terminal.columns;
@@ -54378,11 +54417,10 @@ var renderSubmission9 = (state, options9) => exports_Effect.gen(function* () {
54378
54417
  const selectedChoices = Array.from(state.selectedIndices).sort(Order2).map((index) => options9.choices[index].title).join(", ");
54379
54418
  return renderOutput8(options9.message).pipe(cat2(annotate2(figures2.tick, green3)), cat2(space2), cat2(annotate2(text3(selectedChoices), white3)), cat2(hardLine2), render3({ style: "pretty", options: { lineWidth: columns } }));
54380
54419
  });
54381
- var clearPrompt = (options9) => exports_Effect.gen(function* () {
54420
+ var clearPrompt = (state, options9) => exports_Effect.gen(function* () {
54382
54421
  const terminal = yield* Terminal;
54383
54422
  const columns = yield* terminal.columns;
54384
- const text12 = `
54385
- `.repeat(Math.min(options9.choices.length + 1, options9.maxPerPage)) + options9.message;
54423
+ const text12 = visibleFrameText(state, options9);
54386
54424
  return eraseText2(text12, columns).pipe(cat2(eraseLine3), cat2(cursorLeft3), optimize3(Deep), render3({ style: "pretty", options: { lineWidth: columns } }));
54387
54425
  });
54388
54426
  var processSpace2 = (state, options9) => {
@@ -54454,26 +54492,36 @@ var localMultiSelect = (options9) => {
54454
54492
  return exports_Effect.succeed(Action2.Beep());
54455
54493
  }
54456
54494
  },
54457
- clear: () => clearPrompt(resolvedOptions)
54495
+ clear: (state) => clearPrompt(state, resolvedOptions)
54458
54496
  });
54459
54497
  return exports_Prompt.run(prompt4).pipe(exports_Effect.map((values4) => values4.toSorted()));
54460
54498
  };
54461
54499
 
54462
54500
  // src/scaffold/prompt.ts
54463
54501
  var isPromptQuitSignal = (cause3) => typeof cause3 === "object" && cause3 !== null && ("name" in cause3) && cause3.name === "QuitException";
54502
+ var restoreLineInput = (readline2) => {
54503
+ if (input.isTTY) {
54504
+ input.setRawMode(false);
54505
+ }
54506
+ input.resume();
54507
+ readline2.resume();
54508
+ };
54464
54509
  var PromptLive = exports_Effect.acquireRelease(exports_Effect.sync(() => createInterface2({ input, output })), (readline2) => exports_Effect.sync(() => readline2.close())).pipe(exports_Effect.map((readline2) => ({
54465
54510
  readLine: (question) => exports_Effect.tryPromise({
54466
- try: () => readline2.question(question),
54511
+ try: () => {
54512
+ restoreLineInput(readline2);
54513
+ return readline2.question(question);
54514
+ },
54467
54515
  catch: (cause3) => new CliPromptError({
54468
54516
  cause: cause3,
54469
54517
  message: "Failed to read CLI input."
54470
54518
  })
54471
54519
  }),
54472
- multiSelect: ({ message, choices, selectAll }) => localMultiSelect({
54520
+ multiSelect: ({ message, choices, selectAll }) => exports_Effect.sync(() => readline2.pause()).pipe(exports_Effect.zipRight(localMultiSelect({
54473
54521
  message,
54474
54522
  choices,
54475
54523
  ...selectAll ? { selectAll } : {}
54476
- }).pipe(exports_Effect.map((values4) => values4.toSorted()), exports_Effect.mapError((cause3) => new CliPromptError({
54524
+ })), exports_Effect.ensuring(exports_Effect.sync(() => restoreLineInput(readline2))), exports_Effect.map((values4) => values4.toSorted()), exports_Effect.mapError((cause3) => new CliPromptError({
54477
54525
  cause: cause3,
54478
54526
  message: "Failed to read checklist input."
54479
54527
  }))),
@@ -54535,9 +54583,13 @@ import path6 from "path";
54535
54583
  var ignoredDirectoryNames = new Set([
54536
54584
  ".git",
54537
54585
  ".agents",
54586
+ ".claude",
54587
+ ".codex",
54588
+ ".cursor",
54538
54589
  ".devpunks",
54539
54590
  ".devpunks-cache",
54540
54591
  ".next",
54592
+ ".opencode",
54541
54593
  ".source",
54542
54594
  ".turbo",
54543
54595
  "coverage",
@@ -54551,6 +54603,7 @@ var ignoredDirectoryNames = new Set([
54551
54603
  "skills",
54552
54604
  "test-fixtures",
54553
54605
  "tmp",
54606
+ "worktrees",
54554
54607
  ".venv",
54555
54608
  "venv",
54556
54609
  "__pycache__"
@@ -54901,7 +54954,7 @@ var defaultRuntime3 = {
54901
54954
  execFile: (command, args2, options9) => {
54902
54955
  execFileSync4(command, [...args2], {
54903
54956
  cwd: options9?.cwd,
54904
- stdio: options9?.stdio ?? "inherit"
54957
+ stdio: options9?.stdio === "inherit" ? ["ignore", "inherit", "inherit"] : "ignore"
54905
54958
  });
54906
54959
  }
54907
54960
  };
@@ -55884,6 +55937,54 @@ var collectOpensrcReferences = (promptSpecs) => uniqueSorted(promptSpecs.flatMap
55884
55937
  var opensrcReferencesForPacks = (packs) => uniqueSorted(packs.flatMap((packId) => exampleRepositoriesForPack(packId).map((repo) => repo.repo)));
55885
55938
  var detectionHasPackage = (detection, packageName) => detection.manifests.some((manifest) => manifest.dependencies.includes(packageName));
55886
55939
  var selectedSkills = (finalPacks, baseline) => uniqueSorted(finalPacks.flatMap((packId) => skillsForPack(packId, baseline)));
55940
+ var legacySkillDirectories = [
55941
+ ".claude/skills",
55942
+ ".codex/skills",
55943
+ ".cursor/skills",
55944
+ ".opencode/skills"
55945
+ ];
55946
+ var nextAvailableSkillDirectory = (sharedSkillsDirectory, skillName, reservedSkillNames) => {
55947
+ if (!reservedSkillNames.has(skillName) && !existsSync5(path10.join(sharedSkillsDirectory, skillName))) {
55948
+ return skillName;
55949
+ }
55950
+ let suffix = 1;
55951
+ while (true) {
55952
+ const candidate = suffix === 1 ? `${skillName}-local` : `${skillName}-local-${suffix}`;
55953
+ if (!reservedSkillNames.has(candidate) && !existsSync5(path10.join(sharedSkillsDirectory, candidate))) {
55954
+ return candidate;
55955
+ }
55956
+ suffix += 1;
55957
+ }
55958
+ };
55959
+ var migrateLegacySkillDirectories = ({
55960
+ outputDirectory,
55961
+ finalSkills
55962
+ }) => {
55963
+ const sharedSkillsDirectory = path10.join(outputDirectory, ".agents/skills");
55964
+ const reservedSkillNames = new Set(finalSkills);
55965
+ mkdirSync2(sharedSkillsDirectory, { recursive: true });
55966
+ for (const relativeDirectory of legacySkillDirectories) {
55967
+ const absoluteDirectory = path10.join(outputDirectory, relativeDirectory);
55968
+ if (!existsSync5(absoluteDirectory)) {
55969
+ continue;
55970
+ }
55971
+ const stat3 = lstatSync(absoluteDirectory);
55972
+ if (stat3.isSymbolicLink() || !stat3.isDirectory()) {
55973
+ continue;
55974
+ }
55975
+ for (const entry of readdirSync2(absoluteDirectory, { withFileTypes: true })) {
55976
+ if (!entry.isDirectory()) {
55977
+ continue;
55978
+ }
55979
+ const sourceDirectory = path10.join(absoluteDirectory, entry.name);
55980
+ const migratedName = nextAvailableSkillDirectory(sharedSkillsDirectory, entry.name, reservedSkillNames);
55981
+ const targetDirectory = path10.join(sharedSkillsDirectory, migratedName);
55982
+ cpSync(sourceDirectory, targetDirectory, { recursive: true });
55983
+ rmSync2(sourceDirectory, { recursive: true, force: true });
55984
+ }
55985
+ rmSync2(absoluteDirectory, { recursive: true, force: true });
55986
+ }
55987
+ };
55887
55988
  var selectedHookIds = (finalPacks, baseline) => uniqueSorted(finalPacks.flatMap((packId) => hooksForPack(packId, baseline)));
55888
55989
  var oxlintConfigCandidates = [".oxlintrc.json", ".oxlintrc.jsonc", "oxlint.config.ts"];
55889
55990
  var existingOxlintConfigFiles = (scanDirectory) => oxlintConfigCandidates.filter((candidate) => existsSync5(path10.join(scanDirectory, candidate)));
@@ -56405,6 +56506,7 @@ var writeScaffoldOutput = ({
56405
56506
  lintSpecFiles.push(lintStarterConfigFile);
56406
56507
  }
56407
56508
  }
56509
+ migrateLegacySkillDirectories({ outputDirectory, finalSkills });
56408
56510
  for (const skillId of finalSkills) {
56409
56511
  const sourceDirectory = skillRegistryByIdForBaseline(baseline)[skillId].sourceDirectory;
56410
56512
  const targetDirectory = path10.posix.join(".agents/skills", skillId);
@@ -59801,6 +59903,19 @@ var minimumReleaseAgeEnvironmentForPackageManager = (packageManager) => {
59801
59903
  return {};
59802
59904
  }
59803
59905
  };
59906
+ var runCliInstallCommand = ({
59907
+ command,
59908
+ environment: environment2
59909
+ }) => {
59910
+ const result = spawnSync(command[0], command.slice(1), {
59911
+ env: {
59912
+ ...process.env,
59913
+ ...environment2
59914
+ },
59915
+ stdio: "inherit"
59916
+ });
59917
+ return result.status === 0;
59918
+ };
59804
59919
  var autoUpdateCliIfStale = async ({
59805
59920
  currentVersion,
59806
59921
  packageName,
@@ -59868,14 +59983,7 @@ var upgradeCli = async ({
59868
59983
  tag: tag6
59869
59984
  });
59870
59985
  const environment2 = minimumReleaseAgeEnvironmentForPackageManager(packageManager);
59871
- const result = spawnSync(command[0], command.slice(1), {
59872
- env: {
59873
- ...process.env,
59874
- ...environment2
59875
- },
59876
- stdio: "inherit"
59877
- });
59878
- if (result.status === 0) {
59986
+ if (runCliInstallCommand({ command, environment: environment2 })) {
59879
59987
  return {
59880
59988
  status: "upgraded",
59881
59989
  check: check2,
@@ -60044,6 +60152,72 @@ var cli = exports_Command.run(app, {
60044
60152
  });
60045
60153
  var shouldCheckSelfUpdate = () => process.env.DP_NO_UPDATE_CHECK !== "1" && process.env.CI === undefined && process.argv.includes("--help") === false && process.argv.includes("-h") === false && process.argv.includes("--version") === false && process.argv.includes("-v") === false;
60046
60154
  var shouldCheckDpCliSkillUpdate = () => process.env.DP_NO_SKILL_UPDATE_CHECK !== "1" && process.env.CI === undefined && process.argv.includes("--help") === false && process.argv.includes("-h") === false && process.argv.includes("--version") === false && process.argv.includes("-v") === false;
60155
+ var shouldAskForSelfUpdate = () => shouldCheckSelfUpdate() && process.argv.slice(2).includes("upgrade") === false && process.stdin.isTTY === true && process.stdout.isTTY === true;
60156
+ var formatCommand2 = ({
60157
+ command,
60158
+ environment: environment2
60159
+ }) => {
60160
+ const envPrefix = environment2 === undefined ? [] : Object.entries(environment2).map(([key, value6]) => `${key}=${value6}`);
60161
+ return [...envPrefix, ...command].join(" ");
60162
+ };
60163
+ var askYesNo = async (question) => {
60164
+ const readline2 = createInterface3({ input: process.stdin, output: process.stdout });
60165
+ try {
60166
+ const answer = (await readline2.question(renderQuestion(`${question} [y/N]: `))).trim();
60167
+ return answer.toLowerCase() === "y" || answer.toLowerCase() === "yes";
60168
+ } finally {
60169
+ readline2.close();
60170
+ }
60171
+ };
60172
+ var runInteractiveCliUpdate = async () => {
60173
+ if (!shouldAskForSelfUpdate()) {
60174
+ return false;
60175
+ }
60176
+ const result = await autoUpdateCliIfStale({
60177
+ currentVersion: version,
60178
+ packageName: name,
60179
+ tag: process.env.DP_UPDATE_TAG ?? "latest",
60180
+ timeoutMs: 5000
60181
+ });
60182
+ if (result.status === "current" || result.status === "unavailable") {
60183
+ return false;
60184
+ }
60185
+ if (result.check === null) {
60186
+ return false;
60187
+ }
60188
+ if (result.status !== "available") {
60189
+ const command = "command" in result ? result.command : null;
60190
+ console.error(renderSelfUpdateNotice({
60191
+ currentVersion: result.check.currentVersion,
60192
+ latestVersion: result.check.latestVersion,
60193
+ packageName: result.check.packageName,
60194
+ command
60195
+ }));
60196
+ return false;
60197
+ }
60198
+ console.error(renderSelfUpdateNotice({
60199
+ currentVersion: result.check.currentVersion,
60200
+ latestVersion: result.check.latestVersion,
60201
+ packageName: result.check.packageName,
60202
+ command: result.command
60203
+ }));
60204
+ if (!await askYesNo("Update CLI before running this command?")) {
60205
+ return false;
60206
+ }
60207
+ if (runCliInstallCommand({ command: result.command, environment: result.environment })) {
60208
+ console.log(renderCommandSection("CLI upgraded", [
60209
+ `${result.check.packageName} ${result.check.currentVersion} -> ${result.check.latestVersion}`,
60210
+ `Installer: ${result.packageManager}`,
60211
+ `Command: ${formatCommand2(result)}`,
60212
+ "Re-run your command to use the upgraded CLI."
60213
+ ].join(`
60214
+ `)));
60215
+ return true;
60216
+ }
60217
+ console.error(renderCommandSection("CLI upgrade failed", `Command failed: ${formatCommand2({ command: result.command })}`));
60218
+ process.exitCode = 1;
60219
+ return true;
60220
+ };
60047
60221
  var runCliUpdateCheck = async () => {
60048
60222
  const result = await autoUpdateCliIfStale({
60049
60223
  currentVersion: version,
@@ -60095,7 +60269,7 @@ var markStartupCheckStarted = () => {
60095
60269
  writeFileSync6(startupCheckCacheFile, JSON.stringify({ checkedAt: Date.now() }, null, 2));
60096
60270
  };
60097
60271
  var startBackgroundStartupChecks = () => {
60098
- const checkCli = shouldCheckSelfUpdate();
60272
+ const checkCli = shouldCheckSelfUpdate() && !shouldAskForSelfUpdate();
60099
60273
  const checkSkill = shouldCheckDpCliSkillUpdate();
60100
60274
  if (!checkCli && !checkSkill || hasFreshStartupCheck()) {
60101
60275
  return;
@@ -60127,7 +60301,12 @@ if (process.env[startupCheckWorkerEnv] === "1") {
60127
60301
  });
60128
60302
  } else {
60129
60303
  try {
60130
- startBackgroundStartupChecks();
60131
- } catch {}
60132
- cli(process.argv).pipe(exports_Effect.provide(exports_Layer.mergeAll(exports_BunContext.layer)), exports_BunRuntime.runMain);
60304
+ const updated = await runInteractiveCliUpdate();
60305
+ if (!updated) {
60306
+ startBackgroundStartupChecks();
60307
+ cli(process.argv).pipe(exports_Effect.provide(exports_Layer.mergeAll(exports_BunContext.layer)), exports_BunRuntime.runMain);
60308
+ }
60309
+ } catch {
60310
+ cli(process.argv).pipe(exports_Effect.provide(exports_Layer.mergeAll(exports_BunContext.layer)), exports_BunRuntime.runMain);
60311
+ }
60133
60312
  }
@@ -17,12 +17,12 @@ This skill has three scoped references:
17
17
 
18
18
  Use active grilling when the user is still iterating on requirements, terminology, tradeoffs, branch closure, or status percentages. During a serious grilling session, load both `grilling-flow` and `artifact-output`; the interview and durable artifacts move together.
19
19
 
20
- Use wiki synthesis when the user asks to persist closed grill decisions into `apps/wiki`, extract high-level flows/concepts, or sync domain knowledge from grill artifacts.
20
+ Use wiki synthesis when the user asks to turn closed grill decisions into high-level routed wiki flows/concepts, or sync domain knowledge from grill artifacts.
21
21
 
22
22
  Both workflows can happen in one long session, but keep the responsibilities distinct:
23
23
 
24
- - `docs/<topic>-grill-log.md` and `docs/<topic>-grill-status.md` are the detailed requirements and glossary record
25
- - routed `apps/wiki/content/docs/project/` pages are the synthesized project knowledge surface
24
+ - `<wiki-root>/content/docs/project/grilling/<topic>-grill-log.md` and `<topic>-grill-status.md` are the detailed requirements and glossary record
25
+ - other routed `<wiki-root>/content/docs/project/` pages are the synthesized project knowledge surface
26
26
  - backlog/user-story creation is the next phase after the grill gate, outside this skill's scope
27
27
 
28
28
  ## Core Behavior
@@ -8,12 +8,42 @@ This workflow is always paired with [grilling-flow.md](grilling-flow.md) during
8
8
 
9
9
  At the start of a serious grilling session, create or reuse:
10
10
 
11
- - `docs/<topic>-grill-log.md`
12
- - `docs/<topic>-grill-status.md`
11
+ - `<wiki-root>/content/docs/project/grilling/<topic>-grill-log.md`
12
+ - `<wiki-root>/content/docs/project/grilling/<topic>-grill-status.md`
13
+
14
+ Resolve `<wiki-root>` the same way as `docs-ingest-phase`:
15
+
16
+ - monorepo: `apps/wiki`
17
+ - single-repo: `wiki`
18
+
19
+ Before writing, read `<wiki-root>/AGENTS.md`. The grilling artifacts live in the routed project wiki because `/docs/project` owns useful grill context and maintenance/project records.
20
+
21
+ If a legacy `docs/<topic>-grill-log.md` or `docs/<topic>-grill-status.md` exists, treat it as input to move or merge into the routed grilling section. Do not keep updating both locations.
13
22
 
14
23
  The log is the durable decision record.
15
24
  The status file is the current branch dashboard plus the current glossary snapshot.
16
25
 
26
+ ## Routed Wiki Contract
27
+
28
+ Grill artifacts are human-facing routed pages. Include frontmatter on new files:
29
+
30
+ ```yaml
31
+ ---
32
+ title: "<Topic> Grill Log"
33
+ surface: project
34
+ permission: project
35
+ ---
36
+ ```
37
+
38
+ Use `"<Topic> Grill Status"` for the status file title.
39
+
40
+ After adding or renaming a grill artifact:
41
+
42
+ - update `<wiki-root>/content/docs/project/grilling/meta.json`
43
+ - create `grilling/index.mdx` if the section is missing
44
+ - append a concise entry to `<wiki-root>/log.md` when the repo maintains one
45
+ - preserve existing frontmatter on existing files
46
+
17
47
  ## Grill Log Contract
18
48
 
19
49
  The log is structured, not a raw transcript.
@@ -113,7 +143,7 @@ When a branch closes:
113
143
  1. Update the grill log with final accepted decisions.
114
144
  2. Update the status file percentage, open items, glossary snapshot, axioms, and ambiguities.
115
145
  3. If the branch changes durable domain/product knowledge, run the wiki-output workflow.
116
- 4. Say exactly what changed and which artifacts were updated.
146
+ 4. Say exactly what changed, which routed artifacts were updated, and whether `meta.json` or wiki log bookkeeping changed.
117
147
 
118
148
  ## Final Handoff
119
149
 
@@ -6,8 +6,8 @@ Use this reference when closed grill branches should be reflected in `apps/wiki`
6
6
 
7
7
  Use the grill artifacts as source:
8
8
 
9
- - `docs/<topic>-grill-status.md`
10
- - `docs/<topic>-grill-log.md`
9
+ - `<wiki-root>/content/docs/project/grilling/<topic>-grill-status.md`
10
+ - `<wiki-root>/content/docs/project/grilling/<topic>-grill-log.md`
11
11
 
12
12
  Read status first to understand:
13
13
 
@@ -78,13 +78,14 @@ Create or update decision pages only when:
78
78
 
79
79
  ## Boundary
80
80
 
81
- Keep `docs/` as the detailed design record.
81
+ Keep the routed grilling log/status files as the detailed requirements record.
82
82
 
83
- Use routed `apps/wiki/content/docs/project/` pages for synthesized project knowledge.
83
+ Use other routed `<wiki-root>/content/docs/project/` pages for synthesized project knowledge.
84
+ For the default scaffold, that routed project surface is `apps/wiki/content/docs/project/`.
84
85
 
85
86
  Do not create a separate `apps/wiki/domains/` article tree. That duplicates the routed Fumadocs surface and makes later docs ingest choose between competing homes.
86
87
 
87
- Do not duplicate the full grill log in wiki pages.
88
+ Do not duplicate the full grill log into concept, flow, or decision pages.
88
89
  Summarize stable meaning, glossary, and axioms; link back to source docs when useful.
89
90
 
90
91
  ## Bookkeeping
@@ -226,24 +226,26 @@ When `create-spec` is given a backlog-backed epic:
226
226
 
227
227
  ## Provider policy
228
228
 
229
- This skill documents raw provider create payloads only.
229
+ This skill documents raw provider create/setup payloads only.
230
230
 
231
231
  In scope:
232
232
 
233
233
  - create issue/work item payload shapes
234
+ - create provider containers needed for the canonical hierarchy
234
235
  - required vs optional fields
235
236
  - how module/epic/story intent appears at creation time
236
237
 
237
238
  Out of scope:
238
239
 
239
- - update payloads
240
- - comment payloads
241
240
  - completion-time execution sync
241
+ - comment payloads
242
+ - status churn after backlog creation
242
243
 
243
- If a provider cannot express part of the canonical model in the create payload alone:
244
+ If a provider cannot express part of the canonical model in one create call:
244
245
 
245
246
  - document the limitation explicitly
246
- - do not silently reshape the model
247
+ - include the minimal native follow-up call needed to preserve module -> epic -> story
248
+ - do not silently flatten or reshape the model
247
249
 
248
250
  ## Anti-patterns
249
251
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: write-backlog
3
- description: Turns a large requirements discussion into a canonical backlog hierarchy of module/milestone -> epic/capability -> story and documents provider-specific issue creation payloads. Use when structuring backlog from discovery, breaking requirements into milestones/epics/stories, consuming `requirements-grill` artifacts like `*-grill-log.md` and `*-grill-status.md`, or preparing Linear, GitHub Issues, or Azure DevOps issue creation payloads.
3
+ description: Turns a large requirements discussion into a canonical backlog hierarchy of module/milestone -> epic/capability -> story and documents provider-specific backlog creation payloads. Use when structuring backlog from discovery, breaking requirements into milestones/epics/stories, consuming `requirements-grill` artifacts like `*-grill-log.md` and `*-grill-status.md`, or preparing Linear, GitHub Projects/Issues, or Azure DevOps creation payloads.
4
4
  ---
5
5
 
6
6
  # Write Backlog
@@ -54,7 +54,7 @@ description: Turns a large requirements discussion into a canonical backlog hier
54
54
 
55
55
  1. Read the provider payload asset:
56
56
  - [Linear](assets/providers/linear-create-payload.md)
57
- - [GitHub Issues](assets/providers/github-issues-create-payload.md)
57
+ - [GitHub Projects and Issues](assets/providers/github-projects-create-payload.md)
58
58
  - [Azure DevOps](assets/providers/azure-devops-create-payload.md)
59
59
  2. Use the raw provider request shape documented there.
60
60
  3. Do not invent provider fields from memory when the asset already defines them.
@@ -0,0 +1,224 @@
1
+ # GitHub Projects and Issues Create Payload
2
+
3
+ Official sources:
4
+
5
+ - GraphQL mutations: [docs.github.com/en/graphql/reference/mutations](https://docs.github.com/en/graphql/reference/mutations)
6
+ - GraphQL input objects: [docs.github.com/en/graphql/reference/input-objects](https://docs.github.com/en/graphql/reference/input-objects)
7
+ - REST issues API: [docs.github.com/en/rest/issues/issues](https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28)
8
+ - REST milestones API: [docs.github.com/en/rest/issues/milestones](https://docs.github.com/en/rest/issues/milestones?apiVersion=2022-11-28)
9
+
10
+ ## Intent
11
+
12
+ Use GitHub Projects V2 and GitHub Issues together.
13
+
14
+ Canonical mapping:
15
+
16
+ - module/milestone -> repository milestone plus a Project V2 grouping field
17
+ - epic/capability -> parent GitHub issue in the Project
18
+ - story -> child issue/sub-issue in the Project
19
+ - story ordering -> native issue dependency
20
+
21
+ Do not use an issues-only path for GitHub backlog sync when Projects V2 is available.
22
+
23
+ ## Required bootstrap
24
+
25
+ Resolve these IDs before creating backlog items:
26
+
27
+ - `ownerId`
28
+ - `repositoryId`
29
+ - existing `projectV2.id` by title, if present
30
+ - existing repository milestone IDs/numbers by title
31
+
32
+ If the target Project V2 does not exist, create it:
33
+
34
+ ```graphql
35
+ mutation CreateBacklogProject($ownerId: ID!, $repositoryId: ID!, $title: String!) {
36
+ createProjectV2(input: {
37
+ ownerId: $ownerId
38
+ repositoryId: $repositoryId
39
+ title: $title
40
+ }) {
41
+ projectV2 {
42
+ id
43
+ title
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ Expected Project fields:
50
+
51
+ - `Level`: single-select values `Epic`, `Story`
52
+ - `Module/Milestone`: text or single-select
53
+ - `Epic`: text, storing the epic issue number/title for story rows
54
+
55
+ Create missing fields with `createProjectV2Field`; set values with `updateProjectV2ItemFieldValue`.
56
+
57
+ ## Create missing milestones
58
+
59
+ Use repository milestones for the module/milestone container.
60
+
61
+ Endpoint:
62
+
63
+ `POST https://api.github.com/repos/{owner}/{repo}/milestones`
64
+
65
+ Headers:
66
+
67
+ - `Accept: application/vnd.github+json`
68
+ - `Authorization: Bearer <TOKEN>`
69
+ - `X-GitHub-Api-Version: 2022-11-28`
70
+
71
+ Body:
72
+
73
+ ```json
74
+ {
75
+ "title": "M1 - Intake and Review",
76
+ "state": "open",
77
+ "description": "Module container for intake and review backlog.",
78
+ "due_on": "2026-09-30T23:59:59Z"
79
+ }
80
+ ```
81
+
82
+ Required field:
83
+
84
+ - `title`
85
+
86
+ For GraphQL issue creation, use the returned milestone node ID as `milestoneId`.
87
+ For REST issue creation, use the returned milestone number as `milestone`.
88
+
89
+ ## Create an epic issue
90
+
91
+ Use a parent issue for each epic/capability. Add it to the Project V2 at creation time.
92
+
93
+ ```graphql
94
+ mutation CreateEpic(
95
+ $repositoryId: ID!
96
+ $projectV2Ids: [ID!]
97
+ $milestoneId: ID
98
+ $title: String!
99
+ $body: String!
100
+ ) {
101
+ createIssue(input: {
102
+ repositoryId: $repositoryId
103
+ projectV2Ids: $projectV2Ids
104
+ milestoneId: $milestoneId
105
+ title: $title
106
+ body: $body
107
+ labelIds: []
108
+ }) {
109
+ issue {
110
+ id
111
+ number
112
+ title
113
+ }
114
+ }
115
+ }
116
+ ```
117
+
118
+ Epic body ownership:
119
+
120
+ - outcome
121
+ - scope
122
+ - cross-story constraints
123
+ - child story list
124
+ - links to source grill/status artifacts when relevant
125
+
126
+ After creation, set Project fields:
127
+
128
+ - `Level = Epic`
129
+ - `Module/Milestone = <module title>`
130
+
131
+ ## Create story issues
132
+
133
+ Use child issues/sub-issues for stories. Prefer `parentIssueId` at story creation time.
134
+
135
+ ```graphql
136
+ mutation CreateStory(
137
+ $repositoryId: ID!
138
+ $projectV2Ids: [ID!]
139
+ $milestoneId: ID
140
+ $parentIssueId: ID!
141
+ $title: String!
142
+ $body: String!
143
+ ) {
144
+ createIssue(input: {
145
+ repositoryId: $repositoryId
146
+ projectV2Ids: $projectV2Ids
147
+ milestoneId: $milestoneId
148
+ parentIssueId: $parentIssueId
149
+ title: $title
150
+ body: $body
151
+ labelIds: []
152
+ }) {
153
+ issue {
154
+ id
155
+ number
156
+ title
157
+ parent {
158
+ id
159
+ }
160
+ }
161
+ }
162
+ }
163
+ ```
164
+
165
+ Story body ownership:
166
+
167
+ - outcome
168
+ - acceptance signals
169
+ - non-goals
170
+ - links
171
+
172
+ After creation, set Project fields:
173
+
174
+ - `Level = Story`
175
+ - `Module/Milestone = <module title>`
176
+ - `Epic = <epic issue number/title>`
177
+
178
+ If a story was created before the epic parent was known, attach it with `addSubIssue`:
179
+
180
+ ```graphql
181
+ mutation AddStoryToEpic($issueId: ID!, $subIssueId: ID!) {
182
+ addSubIssue(input: {
183
+ issueId: $issueId
184
+ subIssueId: $subIssueId
185
+ }) {
186
+ issue { id }
187
+ subIssue { id }
188
+ }
189
+ }
190
+ ```
191
+
192
+ ## Add story blockers
193
+
194
+ Use native issue dependencies for story ordering.
195
+
196
+ ```graphql
197
+ mutation AddBlockedBy($issueId: ID!, $blockingIssueId: ID!) {
198
+ addBlockedBy(input: {
199
+ issueId: $issueId
200
+ blockingIssueId: $blockingIssueId
201
+ }) {
202
+ issue { id }
203
+ }
204
+ }
205
+ ```
206
+
207
+ `issueId` is the blocked story. `blockingIssueId` is the prerequisite story.
208
+
209
+ ## Minimal creation order
210
+
211
+ 1. Resolve repository/owner IDs.
212
+ 2. Resolve Project V2 by title; create it if absent.
213
+ 3. Resolve or create Project fields.
214
+ 4. Resolve or create repository milestones for modules.
215
+ 5. Create epic parent issues with `projectV2Ids` and `milestoneId`.
216
+ 6. Create story child issues with `parentIssueId`, `projectV2Ids`, and `milestoneId`.
217
+ 7. Set Project field values for level/module/epic grouping.
218
+ 8. Add native issue dependencies for real story blockers.
219
+
220
+ ## Notes
221
+
222
+ - GitHub REST issue creation is still acceptable for plain issue creation, but GraphQL is preferred for backlog sync because it can attach Project V2 IDs, parent issues, and dependency relations.
223
+ - Project fields mirror planning/grouping metadata. Issue hierarchy remains the source for epic -> story.
224
+ - Repository milestones remain the source for module/milestone grouping when GitHub is the provider.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punks/cli",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "Harness Intelligence scaffolding CLI",
5
5
  "bin": {
6
6
  "devpunks": "dist/index.js",
@@ -1,48 +0,0 @@
1
- # GitHub Issues Create Payload
2
-
3
- Official source:
4
-
5
- - REST issues API: [docs.github.com/en/rest/issues/issues](https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28)
6
-
7
- ## Transport
8
-
9
- - endpoint: `POST https://api.github.com/repos/{owner}/{repo}/issues`
10
- - headers:
11
- - `Accept: application/vnd.github+json`
12
- - `Authorization: Bearer <TOKEN>`
13
- - `X-GitHub-Api-Version: 2022-11-28`
14
-
15
- ## Raw request body
16
-
17
- ```json
18
- {
19
- "title": "Lead manages unassigned submissions",
20
- "body": "## Outcome\n\n...\n\n## Acceptance signals\n\n- [ ] ...",
21
- "assignees": ["octocat"],
22
- "milestone": 1,
23
- "labels": ["workflow", "review"]
24
- }
25
- ```
26
-
27
- ## Required fields
28
-
29
- - `title`
30
-
31
- ## Common optional fields
32
-
33
- - `body`
34
- - `assignees`
35
- - `milestone`
36
- - `labels`
37
-
38
- ## Repo mapping
39
-
40
- - module -> repository milestone
41
- - epic -> GitHub issue
42
- - story -> GitHub issue
43
-
44
- ## Notes
45
-
46
- - GitHub’s create-issue payload does not natively express parent/sub-issue or blocker relations in the same create body documented here.
47
- - If you use GitHub as the provider, treat hierarchy and dependency setup as follow-up work outside this create-only asset.
48
- - Because of that limitation, keep the canonical module -> epic -> story model explicit in your own backlog logic instead of silently flattening it.