@punks/cli 2.1.5 → 2.1.6

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
@@ -11,7 +11,7 @@ At runtime, scaffold content resolves from the latest stable GitHub release base
11
11
  - `punks scaffold`
12
12
  show the scaffold lifecycle index
13
13
  - `punks scaffold init`
14
- scaffold requirements/backlog skills and seed the initial wiki tree
14
+ choose a backlog provider, scaffold requirements/backlog skills, and seed the initial wiki tree
15
15
  - `punks scaffold setup`
16
16
  detect the target repo, confirm or auto-accept pack selection, and write repo-aware scaffold output
17
17
  - `punks report`
@@ -34,7 +34,7 @@ bun run baseline:build
34
34
 
35
35
  `bun run sync:skills` updates a local cache clone of `wearedevpunks/skills` and then replaces only `skills/`, overwriting any local changes there.
36
36
 
37
- `punks scaffold init` copies `.agents/skills/requirements-grill` and `.agents/skills/write-backlog`, seeds an initial wiki tree at `apps/wiki` for monorepos or `wiki` for single-repo layouts, and then prints a fixed post-command prompt. Agents should activate `$dp-cli`, reconcile generated init output with the real repo layout, and only start requirements/backlog generation when the user asks for that workflow.
37
+ `punks scaffold init` asks for the backlog provider, defaults to GitHub Projects/Issues, copies `.agents/skills/requirements-grill` and `.agents/skills/write-backlog`, seeds an initial Mermaid-enabled wiki tree at `apps/wiki` for monorepos or `wiki` for single-repo layouts, writes `<wiki-root>/backlog-provider.md`, and then prints a fixed post-command prompt. Agents should activate `$dp-cli`, reconcile generated init output with the real repo layout, keep the pinned backlog provider unless the user changes it, and only start requirements/backlog generation when the user asks for that workflow.
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
 
package/dist/index.js CHANGED
@@ -52337,7 +52337,8 @@ class ProjectUsageSummary extends exports_Schema.Class("ProjectUsageSummary")({
52337
52337
  }
52338
52338
 
52339
52339
  class ProjectUsageList extends exports_Schema.Class("ProjectUsageList")({
52340
- projects: exports_Schema.Array(ProjectUsageSummary)
52340
+ projects: exports_Schema.Array(ProjectUsageSummary),
52341
+ reports: exports_Schema.Array(HarnessReportSummary)
52341
52342
  }) {
52342
52343
  }
52343
52344
 
@@ -52406,7 +52407,7 @@ var recordProductTelemetryEvent = (options9) => exports_Effect.gen(function* ()
52406
52407
 
52407
52408
  // package.json
52408
52409
  var name = "@punks/cli";
52409
- var version = "2.1.5";
52410
+ var version = "2.1.6";
52410
52411
  // src/telemetry/product.ts
52411
52412
  var git = (cwd, args2) => {
52412
52413
  try {
@@ -52670,7 +52671,7 @@ var renderCommandGuide = () => [
52670
52671
  "usage:",
52671
52672
  " \u2022 agents should activate `$dp-cli` before acting on `.devpunks` output",
52672
52673
  " \u2022 start with `punks scaffold` to inspect the lifecycle",
52673
- " \u2022 use `punks scaffold init` for requirements grilling, backlog authoring, and wiki schema seeding",
52674
+ " \u2022 use `punks scaffold init` to choose the backlog provider and seed requirements/wiki output",
52674
52675
  " \u2022 reconcile the seeded wiki into the real repo layout before writing durable docs",
52675
52676
  " \u2022 use `punks scaffold setup` for repo-aware pack detection after repo boilerplate is ready",
52676
52677
  " \u2022 use `punks update` after setup to pull newer scaffolded skills/prompts/manifests/hooks",
@@ -52678,7 +52679,7 @@ var renderCommandGuide = () => [
52678
52679
  " \u2022 reports open GitHub issues; authenticate with `gh auth login` or `GITHUB_TOKEN`",
52679
52680
  "",
52680
52681
  "operator notes:",
52681
- " \u2022 init copies only requirements/backlog skills and the initial wiki structure",
52682
+ " \u2022 init copies only requirements/backlog skills, backlog-provider pin, and the initial wiki structure",
52682
52683
  " \u2022 `setup` remains the repo-aware pack-driven scaffold flow",
52683
52684
  " \u2022 each command prints an operator-facing next-step prompt"
52684
52685
  ].join(`
@@ -52699,7 +52700,7 @@ var renderStageIntro = ({
52699
52700
  "",
52700
52701
  "usage:",
52701
52702
  " \u2022 agents should activate `$dp-cli` before following generated output",
52702
- " \u2022 use this to scaffold requirements grill/backlog skills and seed the initial wiki tree",
52703
+ " \u2022 use this to choose the backlog provider, scaffold requirements/backlog skills, and seed the initial wiki tree",
52703
52704
  " \u2022 reconcile the wiki into the real repo layout, such as `apps/wiki` in a monorepo",
52704
52705
  " \u2022 rerunning this command overwrites only the files for this stage",
52705
52706
  " \u2022 read the generated prompt/output and follow it before running repo-aware setup"
@@ -52733,14 +52734,14 @@ var renderScaffoldGuide = () => [
52733
52734
  "",
52734
52735
  "commands:",
52735
52736
  " \u203A punks scaffold init",
52736
- " \u2514 requirements gate: scaffold `requirements-grill`, `write-backlog`, and seed the wiki tree",
52737
+ " \u2514 requirements gate: pick backlog provider, scaffold `requirements-grill`/`write-backlog`, seed wiki",
52737
52738
  " \u203A punks scaffold setup",
52738
52739
  " \u2514 repo-aware setup: detect packs, scaffold prompts/manifests/hooks",
52739
52740
  "",
52740
52741
  "operator notes:",
52741
52742
  " \u2022 agents should activate `$dp-cli` before acting on generated scaffold output",
52742
52743
  " \u2022 `init` overwrites only its scaffolded skill files on rerun",
52743
- " \u2022 `init` seeds a wiki root that agents must reconcile with the real repo layout",
52744
+ " \u2022 `init` pins the backlog provider and seeds a wiki root agents must reconcile with the real repo layout",
52744
52745
  " \u2022 `setup` is the first repo-aware command in the lifecycle",
52745
52746
  " \u2022 setup output must be followed from `.devpunks`, not summarized from terminal text alone"
52746
52747
  ].join(`
@@ -56697,34 +56698,50 @@ var writeAgentSystemPrompt = ({
56697
56698
  var tryClipboardCommand = ({
56698
56699
  command,
56699
56700
  args: args2,
56700
- text: text12
56701
+ text: text12,
56702
+ runtime: runtime5
56701
56703
  }) => {
56702
- if (!commandExistsOnPath(command)) {
56704
+ if (!runtime5.commandExists(command)) {
56703
56705
  return { ok: false };
56704
56706
  }
56705
56707
  try {
56706
- execFileSync6(command, args2, {
56708
+ runtime5.execFile(command, args2, {
56707
56709
  cwd: clipboardWorkingDirectory,
56708
- input: text12,
56709
- stdio: ["pipe", "ignore", "ignore"]
56710
+ input: text12
56710
56711
  });
56711
56712
  return { ok: true, command };
56712
56713
  } catch {
56713
56714
  return { ok: false };
56714
56715
  }
56715
56716
  };
56716
- var copyToClipboard = (text12) => {
56717
- if (process.platform === "darwin") {
56718
- return tryClipboardCommand({ command: "pbcopy", args: [], text: text12 });
56717
+ var defaultClipboardExecFile = (command, args2, options9) => {
56718
+ execFileSync6(command, [...args2], {
56719
+ cwd: options9.cwd,
56720
+ input: options9.input,
56721
+ stdio: ["pipe", "ignore", "ignore"]
56722
+ });
56723
+ };
56724
+ var copyToClipboard = (text12, runtime5 = {}) => {
56725
+ const env2 = runtime5.env ?? process.env;
56726
+ if (env2.VITEST === "true" || env2.NODE_ENV === "test" || env2.DP_NO_CLIPBOARD === "1") {
56727
+ return { ok: false };
56728
+ }
56729
+ const commandRuntime = {
56730
+ commandExists: runtime5.commandExists ?? commandExistsOnPath,
56731
+ execFile: runtime5.execFile ?? defaultClipboardExecFile
56732
+ };
56733
+ const platform = runtime5.platform ?? process.platform;
56734
+ if (platform === "darwin") {
56735
+ return tryClipboardCommand({ command: "pbcopy", args: [], text: text12, runtime: commandRuntime });
56719
56736
  }
56720
- if (process.platform === "win32") {
56721
- return tryClipboardCommand({ command: "clip", args: [], text: text12 });
56737
+ if (platform === "win32") {
56738
+ return tryClipboardCommand({ command: "clip", args: [], text: text12, runtime: commandRuntime });
56722
56739
  }
56723
56740
  return [
56724
56741
  { command: "wl-copy", args: [] },
56725
56742
  { command: "xclip", args: ["-selection", "clipboard"] },
56726
56743
  { command: "xsel", args: ["--clipboard", "--input"] }
56727
- ].reduce((result, candidate) => result.ok ? result : tryClipboardCommand({ ...candidate, text: text12 }), { ok: false });
56744
+ ].reduce((result, candidate) => result.ok ? result : tryClipboardCommand({ ...candidate, text: text12, runtime: commandRuntime }), { ok: false });
56728
56745
  };
56729
56746
  var selectedSkills2 = (finalPacks, baseline) => [
56730
56747
  ...new Set(finalPacks.flatMap((packId) => skillsForPack(packId, baseline)))
@@ -56759,7 +56776,8 @@ var runScaffold = ({
56759
56776
  ensureTools = true,
56760
56777
  baseline = bundledBaseline,
56761
56778
  assumeYes = false,
56762
- toolRuntime
56779
+ toolRuntime,
56780
+ clipboardRuntime
56763
56781
  }) => exports_Effect.gen(function* () {
56764
56782
  const baseRequiredTools = requiredToolsForSkills([], baseline);
56765
56783
  let toolBootstrapStatuses = [];
@@ -56948,7 +56966,7 @@ var runScaffold = ({
56948
56966
  subagentManifestSpec: scaffoldOutput.subagentManifestSpec,
56949
56967
  generatedFiles: [...scaffoldOutput.generatedFiles, writtenAgentSystemPromptFile]
56950
56968
  };
56951
- const clipboardResult = copyToClipboard(renderedAgentSystemPrompt);
56969
+ const clipboardResult = copyToClipboard(renderedAgentSystemPrompt, clipboardRuntime);
56952
56970
  yield* prompt4.writeLine("");
56953
56971
  yield* prompt4.writeLine(renderCommandSection("Scaffold Complete", [
56954
56972
  "Scaffold files were written successfully.",
@@ -57016,6 +57034,7 @@ Primary skills here: \`create-spec\`, \`create-plan\`, \`implement-spec\`, \`sim
57016
57034
  - Use \`implement-spec\` to execute an approved spec folder. Choose the execution mode inside the skill: \`sequential\` or \`parallel\`.
57017
57035
  - Write canonical project operations under \`content/docs/project/\`.
57018
57036
  - Keep \`content/docs/project/\` as the default scaffolded route tree. Product/domain routes belong to the individual project and should be added only when the repo deliberately defines them.
57037
+ - Keep project-owned domain source indexes under \`content/docs/project/domains/\` when the repo defines routed domain surfaces.
57019
57038
  - Do not create or maintain a separate \`domains/\` article tree.
57020
57039
  - \`SPEC.md\` and \`IMPLEMENTATION-NOTES.md\` remain source material, but the ingest orchestrator may update their frontmatter/link bookkeeping (\`ingested\`, \`last_ingested\`, backlinks) as part of the pipeline.
57021
57040
 
@@ -57155,7 +57174,9 @@ When processing source material into routed domain knowledge:
57155
57174
  "fumadocs-mdx": "14.3.2",
57156
57175
  "fumadocs-ui": "16.8.7",
57157
57176
  "lucide-react": "^1.14.0",
57177
+ "mermaid": "11.15.0",
57158
57178
  "next": "16.2.4",
57179
+ "next-themes": "0.4.6",
57159
57180
  "react": "^19.2.5",
57160
57181
  "react-dom": "^19.2.5",
57161
57182
  "tailwind-merge": "^3.5.0",
@@ -57205,25 +57226,37 @@ import { fileURLToPath } from "node:url";
57205
57226
  const wikiRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
57206
57227
  const contentRoot = path.join(wikiRoot, "content", "docs");
57207
57228
 
57208
- const possibleRepoRoots = [
57209
- path.resolve(wikiRoot, "..", ".."),
57210
- path.resolve(wikiRoot, ".."),
57211
- ];
57229
+ const possibleRepoRoots = [path.resolve(wikiRoot, "..", ".."), path.resolve(wikiRoot, "..")];
57212
57230
 
57213
57231
  const repoRoot = possibleRepoRoots.find(
57214
- (candidate) => existsSync(path.join(candidate, "docs")) || existsSync(path.join(candidate, "package.json")),
57232
+ (candidate) =>
57233
+ existsSync(path.join(candidate, "docs")) || existsSync(path.join(candidate, "package.json")),
57215
57234
  );
57216
57235
 
57217
57236
  const copiedTopLevelPages = new Set(["project"]);
57218
57237
 
57219
57238
  syncTree(path.join(wikiRoot, "specs"), path.join(contentRoot, "project", "specs"), "Specs");
57220
- syncTree(path.join(wikiRoot, "domains"), path.join(contentRoot, "wiki"), "Wiki");
57221
57239
 
57222
57240
  if (repoRoot) {
57223
- syncTree(path.join(repoRoot, "docs", "requirements"), path.join(contentRoot, "project", "requirements"), "Requirements");
57224
- syncTree(path.join(repoRoot, "docs", "reference"), path.join(contentRoot, "project", "reference"), "Reference");
57225
- syncTree(path.join(repoRoot, "docs", "runbooks"), path.join(contentRoot, "project", "runbooks"), "Runbooks");
57226
- syncFile(path.join(repoRoot, "docs", "tech-decisions.md"), path.join(contentRoot, "project", "decisions", "tech-decisions.mdx"));
57241
+ syncTree(
57242
+ path.join(repoRoot, "docs", "requirements"),
57243
+ path.join(contentRoot, "project", "requirements"),
57244
+ "Requirements",
57245
+ );
57246
+ syncTree(
57247
+ path.join(repoRoot, "docs", "reference"),
57248
+ path.join(contentRoot, "project", "reference"),
57249
+ "Reference",
57250
+ );
57251
+ syncTree(
57252
+ path.join(repoRoot, "docs", "runbooks"),
57253
+ path.join(contentRoot, "project", "runbooks"),
57254
+ "Runbooks",
57255
+ );
57256
+ syncFile(
57257
+ path.join(repoRoot, "docs", "tech-decisions.md"),
57258
+ path.join(contentRoot, "project", "decisions", "tech-decisions.mdx"),
57259
+ );
57227
57260
  }
57228
57261
 
57229
57262
  mergeMeta(contentRoot, {
@@ -57236,6 +57269,7 @@ mergeMeta(path.join(contentRoot, "project"), {
57236
57269
  description: "Internal project operations",
57237
57270
  pages: [
57238
57271
  "index",
57272
+ "domains",
57239
57273
  "grilling",
57240
57274
  "specs",
57241
57275
  "tech-debt",
@@ -57293,9 +57327,13 @@ function hasFrontmatter(content) {
57293
57327
  function writeMetaTree(directory, title) {
57294
57328
  if (!existsSync(directory)) return;
57295
57329
 
57296
- const entries = readdirSync(directory, { withFileTypes: true }).filter((entry) => !entry.name.startsWith("."));
57330
+ const entries = readdirSync(directory, { withFileTypes: true }).filter(
57331
+ (entry) => !entry.name.startsWith("."),
57332
+ );
57297
57333
  const files = entries
57298
- .filter((entry) => entry.isFile() && (entry.name.endsWith(".md") || entry.name.endsWith(".mdx")))
57334
+ .filter(
57335
+ (entry) => entry.isFile() && (entry.name.endsWith(".md") || entry.name.endsWith(".mdx")),
57336
+ )
57299
57337
  .map((entry) => stripMarkdownExtension(entry.name))
57300
57338
  .filter((name) => name !== "meta");
57301
57339
  const folders = entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
@@ -57327,7 +57365,7 @@ function mergeMeta(directory, nextMeta) {
57327
57365
 
57328
57366
  function formatMetaJson(meta) {
57329
57367
  const lines = Object.entries(meta).map(
57330
- ([key, value]) => " \\"" + key + "\\": " + JSON.stringify(value),
57368
+ ([key, value]) => ' "' + key + '": ' + JSON.stringify(value),
57331
57369
  );
57332
57370
 
57333
57371
  return "{\\n" + lines.join(",\\n") + "\\n}\\n";
@@ -57376,7 +57414,7 @@ function sanitizeMdx(content, targetPath) {
57376
57414
 
57377
57415
  return [
57378
57416
  "---",
57379
- "title: \\"" + titleFromDocument(sanitized, targetPath) + "\\"",
57417
+ 'title: "' + titleFromDocument(sanitized, targetPath) + '"',
57380
57418
  "surface: project",
57381
57419
  "permission: project",
57382
57420
  "---",
@@ -57387,9 +57425,9 @@ function sanitizeMdx(content, targetPath) {
57387
57425
 
57388
57426
  function titleFromDocument(content, targetPath) {
57389
57427
  const heading = content.match(/^#\\s+(.+)$/m)?.[1]?.trim();
57390
- if (heading) return heading.replace(/"/g, "\\\\\\"");
57428
+ if (heading) return heading.replace(/"/g, '\\\\"');
57391
57429
 
57392
- return titleFromSegment(stripMarkdownExtension(path.basename(targetPath))).replace(/"/g, "\\\\\\"");
57430
+ return titleFromSegment(stripMarkdownExtension(path.basename(targetPath))).replace(/"/g, '\\\\"');
57393
57431
  }
57394
57432
 
57395
57433
  if (repoRoot) {
@@ -57414,6 +57452,7 @@ export default config;
57414
57452
  {
57415
57453
  path: "source.config.ts",
57416
57454
  content: `import { metaSchema, pageSchema } from "fumadocs-core/source/schema";
57455
+ import { remarkMdxMermaid } from "fumadocs-core/mdx-plugins";
57417
57456
  import { defineConfig, defineDocs } from "fumadocs-mdx/config";
57418
57457
  import { z } from "zod";
57419
57458
 
@@ -57435,7 +57474,11 @@ export const docs = defineDocs({
57435
57474
  },
57436
57475
  });
57437
57476
 
57438
- export default defineConfig({});
57477
+ export default defineConfig({
57478
+ mdxOptions: {
57479
+ remarkPlugins: [remarkMdxMermaid],
57480
+ },
57481
+ });
57439
57482
  `
57440
57483
  },
57441
57484
  {
@@ -57641,9 +57684,12 @@ export const { GET } = createFromSource(source, {
57641
57684
  content: `import defaultMdxComponents from "fumadocs-ui/mdx";
57642
57685
  import type { MDXComponents } from "mdx/types";
57643
57686
 
57687
+ import { Mermaid } from "@/components/mdx/mermaid";
57688
+
57644
57689
  export function getMDXComponents(components?: MDXComponents) {
57645
57690
  return {
57646
57691
  ...defaultMdxComponents,
57692
+ Mermaid,
57647
57693
  ...components,
57648
57694
  } satisfies MDXComponents;
57649
57695
  }
@@ -57653,6 +57699,63 @@ export const useMDXComponents = getMDXComponents;
57653
57699
  declare global {
57654
57700
  type MDXProvidedComponents = ReturnType<typeof getMDXComponents>;
57655
57701
  }
57702
+ `
57703
+ },
57704
+ {
57705
+ path: "src/components/mdx/mermaid.tsx",
57706
+ content: `"use client";
57707
+
57708
+ import { use, useEffect, useId, useState } from "react";
57709
+ import { useTheme } from "next-themes";
57710
+
57711
+ const cache = new Map<string, Promise<unknown>>();
57712
+
57713
+ function cachePromise<T>(key: string, setPromise: () => Promise<T>): Promise<T> {
57714
+ const cached = cache.get(key);
57715
+ if (cached) return cached as Promise<T>;
57716
+
57717
+ const promise = setPromise();
57718
+ cache.set(key, promise);
57719
+ return promise;
57720
+ }
57721
+
57722
+ export function Mermaid({ chart }: { chart: string }) {
57723
+ const [mounted, setMounted] = useState(false);
57724
+
57725
+ useEffect(() => {
57726
+ setMounted(true);
57727
+ }, []);
57728
+
57729
+ if (!mounted) return null;
57730
+ return <MermaidContent chart={chart} />;
57731
+ }
57732
+
57733
+ function MermaidContent({ chart }: { chart: string }) {
57734
+ const id = \`mermaid-\${useId().replaceAll(":", "")}\`;
57735
+ const { resolvedTheme } = useTheme();
57736
+ const { default: mermaid } = use(cachePromise("mermaid", () => import("mermaid")));
57737
+
57738
+ mermaid.initialize({
57739
+ startOnLoad: false,
57740
+ securityLevel: "loose",
57741
+ fontFamily: "inherit",
57742
+ themeCSS: "margin: 1.5rem auto 0;",
57743
+ theme: resolvedTheme === "dark" ? "dark" : "default",
57744
+ });
57745
+
57746
+ const { svg, bindFunctions } = use(
57747
+ cachePromise(\`\${chart}-\${resolvedTheme}\`, () => mermaid.render(id, chart)),
57748
+ );
57749
+
57750
+ return (
57751
+ <div
57752
+ ref={(container) => {
57753
+ if (container) bindFunctions?.(container);
57754
+ }}
57755
+ dangerouslySetInnerHTML={{ __html: svg }}
57756
+ />
57757
+ );
57758
+ }
57656
57759
  `
57657
57760
  },
57658
57761
  {
@@ -57769,7 +57872,17 @@ export function getPageMarkdownUrl(page: (typeof source)["$inferPage"]) {
57769
57872
  content: `{
57770
57873
  "title": "Project",
57771
57874
  "description": "Internal project operations",
57772
- "pages": ["index", "grilling", "specs", "tech-debt", "maintenance", "runbooks", "decisions", "repo-guidance"]
57875
+ "pages": [
57876
+ "index",
57877
+ "domains",
57878
+ "grilling",
57879
+ "specs",
57880
+ "tech-debt",
57881
+ "maintenance",
57882
+ "runbooks",
57883
+ "decisions",
57884
+ "repo-guidance"
57885
+ ]
57773
57886
  }
57774
57887
  `
57775
57888
  },
@@ -57783,6 +57896,30 @@ permission: project
57783
57896
  ---
57784
57897
 
57785
57898
  This surface is for specs, implementation notes, maintenance logs, decisions, repo guidance, runbooks, and durable project context.
57899
+ `
57900
+ },
57901
+ {
57902
+ path: "content/docs/project/domains/meta.json",
57903
+ content: `{
57904
+ "title": "Domains",
57905
+ "pages": [
57906
+ "index"
57907
+ ]
57908
+ }
57909
+ `
57910
+ },
57911
+ {
57912
+ path: "content/docs/project/domains/index.mdx",
57913
+ content: `---
57914
+ title: Domains
57915
+ description: Project-owned domain source index
57916
+ surface: project
57917
+ permission: project
57918
+ ---
57919
+
57920
+ Use this section for project-side domain source indexes when the repo defines durable routed domain surfaces.
57921
+
57922
+ Readable domain articles should live at the project-owned routes the repo defines, such as \`/docs/cli\` or \`/docs/harness\`. Do not create \`${wikiRoot}/domains\`; domain source indexes belong here under \`${wikiRoot}/content/docs/project/domains\`.
57786
57923
  `
57787
57924
  },
57788
57925
  {
@@ -57946,13 +58083,20 @@ Append ingest activity here. Keep only the most recent 50 entries.
57946
58083
  });
57947
58084
 
57948
58085
  // src/content/stage-scaffold.ts
58086
+ var backlogProviderLabels = {
58087
+ "azure-devops": "Azure DevOps",
58088
+ github: "GitHub Projects and Issues",
58089
+ linear: "Linear",
58090
+ monday: "monday.com"
58091
+ };
57949
58092
  var stageScaffoldCatalog = [
57950
58093
  {
57951
58094
  id: "init",
57952
58095
  summary: "Requirements grill, backlog authoring, and wiki docs seed.",
57953
58096
  skills: ["requirements-grill", "write-backlog"],
57954
58097
  renderPrompt: ({
57955
- wikiRoot
58098
+ wikiRoot,
58099
+ backlogProvider
57956
58100
  }) => `You are the operator agent continuing a \`punks scaffold init\` run.
57957
58101
 
57958
58102
  Do not start requirements discovery by default. First reconcile the generated output with this repository.
@@ -57968,6 +58112,11 @@ Generated skills:
57968
58112
  - \`.agents/skills/requirements-grill\`
57969
58113
  - \`.agents/skills/write-backlog\`
57970
58114
 
58115
+ Backlog provider:
58116
+ - selected provider: ${backlogProviderLabels[backlogProvider]} (\`${backlogProvider}\`)
58117
+ - keep this provider pinned unless the user explicitly changes it
58118
+ - when backlog writing starts, use the matching \`write-backlog\` provider payload guidance
58119
+
57971
58120
  Post-command guidance:
57972
58121
  1. Read the repository guidance and inspect the generated files.
57973
58122
  2. Move, rename, or refactor the generated wiki and skill output when needed so it matches the actual repo layout.
@@ -57982,6 +58131,47 @@ When the generated init output matches the repo, the next CLI step is:
57982
58131
  var stageScaffoldById = Object.fromEntries(stageScaffoldCatalog.map((stage) => [stage.id, stage]));
57983
58132
 
57984
58133
  // src/scaffold/stage.ts
58134
+ var backlogProviderLabels2 = {
58135
+ "azure-devops": "Azure DevOps",
58136
+ github: "GitHub Projects and Issues",
58137
+ linear: "Linear",
58138
+ monday: "monday.com"
58139
+ };
58140
+ var backlogProviderAliases = {
58141
+ "1": "github",
58142
+ "2": "linear",
58143
+ "3": "azure-devops",
58144
+ "4": "monday",
58145
+ ado: "azure-devops",
58146
+ azure: "azure-devops",
58147
+ "azure devops": "azure-devops",
58148
+ "azure-devops": "azure-devops",
58149
+ gh: "github",
58150
+ github: "github",
58151
+ "github projects": "github",
58152
+ linear: "linear",
58153
+ monday: "monday",
58154
+ "monday.com": "monday"
58155
+ };
58156
+ var parseBacklogProvider = (value6) => backlogProviderAliases[value6.trim().toLowerCase()] ?? null;
58157
+ var promptBacklogProvider = ({
58158
+ prompt: prompt4
58159
+ }) => exports_Effect.gen(function* () {
58160
+ const answer = yield* prompt4.readLine("Backlog provider? [1 github/projects, 2 linear, 3 azure-devops, 4 monday] (default: 1): ");
58161
+ const parsed = parseBacklogProvider(answer);
58162
+ if (parsed !== null)
58163
+ return parsed;
58164
+ if (answer.trim() !== "") {
58165
+ yield* prompt4.writeLine("Unknown backlog provider. Defaulting to GitHub Projects and Issues.");
58166
+ }
58167
+ return "github";
58168
+ });
58169
+ var renderBacklogProviderMarkdown = (provider) => `# Backlog Provider
58170
+
58171
+ Selected backlog provider: ${backlogProviderLabels2[provider]} (\`${provider}\`).
58172
+
58173
+ Keep this provider pinned unless the user explicitly changes it. When requirements are ready for backlog writing, use \`write-backlog\` with the matching provider payload guidance.
58174
+ `;
57985
58175
  var copySkillDirectory = ({
57986
58176
  outputDirectory,
57987
58177
  skillId,
@@ -58041,20 +58231,27 @@ var updateExistingWikiPackage = ({
58041
58231
  return null;
58042
58232
  const packageJson = JSON.parse(readFileSync7(packagePath, "utf8"));
58043
58233
  const scripts = packageJson.scripts;
58044
- if (!scripts)
58045
- return null;
58046
- const nextScripts = {
58234
+ const dependencies = packageJson.dependencies ?? {};
58235
+ const nextDependencies = {
58236
+ ...dependencies,
58237
+ mermaid: dependencies.mermaid ?? "11.15.0",
58238
+ "next-themes": dependencies["next-themes"] ?? "0.4.6"
58239
+ };
58240
+ const nextScripts = scripts && {
58047
58241
  ...scripts,
58048
58242
  build: withSyncContentPrefix(scripts.build),
58049
58243
  "check-types": withSyncContentPrefix(scripts["check-types"]),
58050
58244
  "types:check": withSyncContentPrefix(scripts["types:check"])
58051
58245
  };
58052
- const changed = Object.entries(nextScripts).some(([key, value6]) => scripts[key] !== value6);
58246
+ const dependenciesChanged = Object.entries(nextDependencies).some(([key, value6]) => dependencies[key] !== value6);
58247
+ const scriptsChanged = nextScripts !== undefined && Object.entries(nextScripts).some(([key, value6]) => scripts?.[key] !== value6);
58248
+ const changed = dependenciesChanged || scriptsChanged;
58053
58249
  if (!changed)
58054
58250
  return null;
58055
58251
  writeFileSync5(packagePath, JSON.stringify({
58056
58252
  ...packageJson,
58057
- scripts: nextScripts
58253
+ dependencies: nextDependencies,
58254
+ ...nextScripts === undefined ? {} : { scripts: nextScripts }
58058
58255
  }, null, 2) + `
58059
58256
  `);
58060
58257
  return relativePosixPath2(outputDirectory, packagePath);
@@ -58073,7 +58270,8 @@ var isNestedRouteSeedBlockedByFlatPage = ({
58073
58270
  var scaffoldWiki = ({
58074
58271
  outputDirectory,
58075
58272
  wikiRoot,
58076
- targetRoot
58273
+ targetRoot,
58274
+ backlogProvider
58077
58275
  }) => {
58078
58276
  const template = makeWikiScaffoldTemplate(wikiRoot);
58079
58277
  const createdFiles = [];
@@ -58160,6 +58358,14 @@ var scaffoldWiki = ({
58160
58358
  if (logFile !== null) {
58161
58359
  createdFiles.push(logFile);
58162
58360
  }
58361
+ const backlogProviderFile = writeMissingFile({
58362
+ outputDirectory,
58363
+ targetPath: path12.join(wikiDirectory, "backlog-provider.md"),
58364
+ content: renderBacklogProviderMarkdown(backlogProvider)
58365
+ });
58366
+ if (backlogProviderFile !== null) {
58367
+ createdFiles.push(backlogProviderFile);
58368
+ }
58163
58369
  return createdFiles.toSorted();
58164
58370
  };
58165
58371
  var scaffoldWikiForDirectory = ({
@@ -58173,7 +58379,8 @@ var scaffoldWikiForDirectory = ({
58173
58379
  return scaffoldWiki({
58174
58380
  outputDirectory,
58175
58381
  wikiRoot: wikiTarget.wikiRoot,
58176
- targetRoot: wikiTarget.targetRoot
58382
+ targetRoot: wikiTarget.targetRoot,
58383
+ backlogProvider: "github"
58177
58384
  });
58178
58385
  };
58179
58386
  var isWikiOutputDirectory = (outputDirectory) => {
@@ -58203,6 +58410,7 @@ var runStageScaffold = ({
58203
58410
  baseline = bundledBaseline
58204
58411
  }) => exports_Effect.gen(function* () {
58205
58412
  const stage = stageScaffoldById[commandId];
58413
+ const backlogProvider = yield* promptBacklogProvider({ prompt: prompt4 });
58206
58414
  const detection = yield* detectRepository(outputDirectory).pipe(exports_Effect.catchAll(() => exports_Effect.succeed(null)));
58207
58415
  const skillFiles = stage.skills.map((skillId) => copySkillDirectory({
58208
58416
  outputDirectory,
@@ -58215,10 +58423,11 @@ var runStageScaffold = ({
58215
58423
  });
58216
58424
  const wikiFiles = scaffoldWiki({
58217
58425
  outputDirectory,
58218
- ...wikiTarget
58426
+ ...wikiTarget,
58427
+ backlogProvider
58219
58428
  });
58220
58429
  removeHarnessDirectoriesFromGitignore(outputDirectory);
58221
- const operatorPrompt = stage.renderPrompt({ wikiRoot: wikiTarget.wikiRoot });
58430
+ const operatorPrompt = stage.renderPrompt({ wikiRoot: wikiTarget.wikiRoot, backlogProvider });
58222
58431
  yield* prompt4.writeLine(renderScaffoldTitle());
58223
58432
  yield* prompt4.writeLine("");
58224
58433
  yield* prompt4.writeLine(renderStageIntro({
@@ -58237,6 +58446,8 @@ var runStageScaffold = ({
58237
58446
  yield* prompt4.writeLine("");
58238
58447
  yield* prompt4.writeLine(renderNotes([`Output directory: ${outputDirectory}`, "Hidden output directories: .agents"]));
58239
58448
  yield* prompt4.writeLine("");
58449
+ yield* prompt4.writeLine(renderCommandSection("Backlog provider", `${backlogProviderLabels2[backlogProvider]} (${backlogProvider})`));
58450
+ yield* prompt4.writeLine("");
58240
58451
  yield* prompt4.writeLine(renderCommandSection("Operator prompt", operatorPrompt));
58241
58452
  yield* submitCliEventEffect("cli.scaffold.init.completed", {
58242
58453
  cwd: outputDirectory,
@@ -58247,7 +58458,8 @@ var runStageScaffold = ({
58247
58458
  return {
58248
58459
  outputDirectory,
58249
58460
  skillFiles,
58250
- wikiFiles
58461
+ wikiFiles,
58462
+ backlogProvider
58251
58463
  };
58252
58464
  });
58253
58465
 
@@ -58269,7 +58481,12 @@ var stageCommand = (id2, description) => exports_Command.make(id2, { output: out
58269
58481
  prompt: prompt4,
58270
58482
  baseline: resolvedBaseline
58271
58483
  });
58272
- }))).pipe(exports_Command.withDescription(description));
58484
+ }).pipe(exports_Effect.catchTag("CliPromptError", (error4) => isPromptQuitSignal(error4.cause) ? exports_Effect.sync(() => {
58485
+ console.log(renderHint("Scaffold cancelled."));
58486
+ }) : exports_Effect.fail(new CliPromptError({
58487
+ cause: error4.cause,
58488
+ message: error4.message
58489
+ })))))).pipe(exports_Command.withDescription(description));
58273
58490
  var setupCommand = exports_Command.make("setup", {
58274
58491
  input: inputOption,
58275
58492
  output: outputOption,
@@ -59294,6 +59511,13 @@ var contentForDiff = (rootDirectory, relativePath) => {
59294
59511
  }
59295
59512
  return readFileSync8(absolutePath, "utf8");
59296
59513
  };
59514
+ var jsonContentEquals = (left3, right3) => {
59515
+ try {
59516
+ return JSON.stringify(JSON.parse(left3)) === JSON.stringify(JSON.parse(right3));
59517
+ } catch {
59518
+ return false;
59519
+ }
59520
+ };
59297
59521
  var hashPath = (rootDirectory, relativePath) => {
59298
59522
  const absolutePath = path14.join(rootDirectory, relativePath);
59299
59523
  if (!existsSync7(absolutePath)) {
@@ -59313,6 +59537,9 @@ var collectRelativeFiles2 = (rootDirectory, relativeDirectory) => {
59313
59537
  for (const entry of readdirSync4(currentDirectory, { withFileTypes: true })) {
59314
59538
  const absolutePath = path14.join(currentDirectory, entry.name);
59315
59539
  const relativePath = path14.relative(rootDirectory, absolutePath).split(path14.sep).join("/");
59540
+ if (relativePath.split("/").includes("node_modules")) {
59541
+ continue;
59542
+ }
59316
59543
  if (entry.isDirectory()) {
59317
59544
  visit2(absolutePath);
59318
59545
  continue;
@@ -59410,6 +59637,9 @@ var buildChanges = ({
59410
59637
  if (currentHash === expected.sha256) {
59411
59638
  return [];
59412
59639
  }
59640
+ if (currentHash !== null && expected.path.endsWith("meta.json") && jsonContentEquals(contentForDiff(rootDirectory, expected.path), contentForDiff(expectedDirectory, expected.path))) {
59641
+ return [];
59642
+ }
59413
59643
  const previous = previousByPath.get(expected.path);
59414
59644
  const status2 = currentHash === null ? "missing" : previous !== undefined && currentHash !== previous.sha256 ? "local-edited" : "changed";
59415
59645
  return [
@@ -88,6 +88,13 @@ Provider mapping:
88
88
  - epic -> parent issue/work item/capability record
89
89
  - story -> child issue/sub-issue/work item
90
90
 
91
+ monday.com mapping:
92
+
93
+ - module/milestone -> board group
94
+ - epic/capability -> parent item
95
+ - story -> subitem
96
+ - story ordering -> dependency column when present
97
+
91
98
  Rules:
92
99
 
93
100
  - every story must be independently understandable
@@ -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 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.
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, Azure DevOps, or monday.com creation payloads.
4
4
  ---
5
5
 
6
6
  # Write Backlog
@@ -56,6 +56,7 @@ description: Turns a large requirements discussion into a canonical backlog hier
56
56
  - [Linear](assets/providers/linear-create-payload.md)
57
57
  - [GitHub Projects and Issues](assets/providers/github-projects-create-payload.md)
58
58
  - [Azure DevOps](assets/providers/azure-devops-create-payload.md)
59
+ - [monday.com](assets/providers/monday-create-payload.md)
59
60
  2. Use the raw provider request shape documented there.
60
61
  3. Do not invent provider fields from memory when the asset already defines them.
61
62
 
@@ -0,0 +1,146 @@
1
+ # monday.com Create Payload
2
+
3
+ Connector source:
4
+
5
+ - monday.com MCP tools exposed through `@monday-com`
6
+
7
+ ## Intent
8
+
9
+ Use monday.com boards, groups, items, subitems, and dependency columns together.
10
+
11
+ Canonical mapping:
12
+
13
+ - module/milestone -> board group
14
+ - epic/capability -> parent item
15
+ - story -> subitem under the epic item
16
+ - story ordering -> dependency column when present
17
+
18
+ Do not flatten epics and stories into sibling items when subitems are available.
19
+
20
+ ## Required bootstrap
21
+
22
+ Resolve the target board before creating backlog items.
23
+
24
+ Before creating or updating items on a board, inspect board metadata with the connector's board info tool so column IDs, column types, status labels, subitem support, and dependency columns are known. Do not invent column IDs.
25
+
26
+ Expected board shape:
27
+
28
+ - one group per module/milestone
29
+ - parent items for epics/capabilities
30
+ - subitems for stories
31
+ - optional `Level` status or dropdown values `Epic` and `Story`
32
+ - optional `Module/Milestone` text/dropdown when groups alone are not enough
33
+ - optional dependency column for story blockers
34
+
35
+ If the target group for a module is missing, create it before creating epic items.
36
+
37
+ ## Create a module group
38
+
39
+ Tool:
40
+
41
+ ```json
42
+ {
43
+ "tool": "@monday-com.create_group",
44
+ "arguments": {
45
+ "boardId": "123456789",
46
+ "groupName": "M1 - Intake and Review"
47
+ }
48
+ }
49
+ ```
50
+
51
+ Required fields:
52
+
53
+ - `boardId`
54
+ - `groupName`
55
+
56
+ Use stable module names. Do not create implementation-phase groups such as backend, frontend, or polish unless those are true product modules.
57
+
58
+ ## Create an epic item
59
+
60
+ Create one parent item per epic/capability in the matching module group.
61
+
62
+ Tool:
63
+
64
+ ```json
65
+ {
66
+ "tool": "@monday-com.create_item",
67
+ "arguments": {
68
+ "boardId": 123456789,
69
+ "groupId": "topics",
70
+ "name": "Submission lifecycle management",
71
+ "columnValues": "{\"long_text\":\"Outcome: ...\\n\\nScope: ...\\n\\nCross-story constraints: ...\",\"status\":{\"label\":\"Epic\"}}"
72
+ }
73
+ }
74
+ ```
75
+
76
+ Epic body ownership:
77
+
78
+ - outcome
79
+ - scope
80
+ - cross-story constraints
81
+ - child story list
82
+ - links to source grill/status artifacts when relevant
83
+
84
+ Keep `columnValues` limited to known board columns from board metadata.
85
+
86
+ ## Create story subitems
87
+
88
+ Create each story as a subitem under its epic item.
89
+
90
+ Tool:
91
+
92
+ ```json
93
+ {
94
+ "tool": "@monday-com.create_item",
95
+ "arguments": {
96
+ "boardId": 123456789,
97
+ "parentItemId": 987654321,
98
+ "name": "Lead reassigns ownership to another reviewer",
99
+ "columnValues": "{\"long_text\":\"Outcome: ...\\n\\nAcceptance signals: ...\\n\\nNon-goals: ...\",\"status\":{\"label\":\"Story\"}}"
100
+ }
101
+ }
102
+ ```
103
+
104
+ Story body ownership:
105
+
106
+ - outcome
107
+ - acceptance signals
108
+ - non-goals
109
+ - links
110
+
111
+ If a board does not support subitems, stop and ask whether to add subitem support or use a different monday.com board. Do not silently degrade into flat story items.
112
+
113
+ ## Add story blockers
114
+
115
+ Use the board's dependency column when present. The exact column ID comes from board metadata.
116
+
117
+ Tool:
118
+
119
+ ```json
120
+ {
121
+ "tool": "@monday-com.change_item_column_values",
122
+ "arguments": {
123
+ "boardId": 123456789,
124
+ "itemId": 1122334455,
125
+ "columnValues": "{\"dependency\":{\"item_ids\":[5566778899]}}"
126
+ }
127
+ }
128
+ ```
129
+
130
+ `itemId` is the blocked story subitem. The dependency value references prerequisite story subitem IDs. If the connector requires a board-relation workflow before linking items, follow that workflow first.
131
+
132
+ ## Minimal creation order
133
+
134
+ 1. Resolve board ID.
135
+ 2. Inspect board metadata.
136
+ 3. Resolve or create groups for modules/milestones.
137
+ 4. Create epic parent items in the matching groups.
138
+ 5. Create story subitems with `parentItemId`.
139
+ 6. Set known board columns for level/module/epic metadata when available.
140
+ 7. Add dependency-column values for real story blockers.
141
+
142
+ ## Notes
143
+
144
+ - monday.com column IDs and label names are board-specific. Always inspect the board before emitting final create payloads.
145
+ - Groups are the primary milestone/module container. Use extra module columns only when the board already needs cross-group reporting.
146
+ - Keep product backlog content in item/subitem bodies. Do not put plan tasks, file paths, validation commands, or implementation handoffs in monday.com backlog records.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punks/cli",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "Harness Intelligence scaffolding CLI",
5
5
  "bin": {
6
6
  "devpunks": "dist/index.js",