@punks/cli 2.1.9 → 2.1.10

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 (38) hide show
  1. package/README.md +1 -1
  2. package/dist/data/catalog/hooks.ts +8 -0
  3. package/dist/data/catalog/packs.ts +4 -3
  4. package/dist/data/catalog/skills.ts +40 -0
  5. package/dist/data/catalog/tools.ts +9 -1
  6. package/dist/data/hooks/scaffold-update-check.mjs +181 -0
  7. package/dist/data/hooks.test.ts +17 -0
  8. package/dist/data/scripts/sync-subagents.mjs +70 -31
  9. package/dist/data/subagents/manifest.mjs +120 -0
  10. package/dist/index.js +455 -49
  11. package/dist/skills/agnostic/cli/dp-cli/SKILL.md +3 -3
  12. package/dist/skills/agnostic/cli/dp-cli/references/commands.md +1 -1
  13. package/dist/skills/agnostic/cli/dp-cli/references/post-command-flow.md +1 -1
  14. package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +46 -0
  15. package/dist/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +4 -0
  16. package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +67 -0
  17. package/dist/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +41 -0
  18. package/dist/skills/agnostic/docs/writing-beats/SKILL.md +69 -0
  19. package/dist/skills/agnostic/docs/writing-fragments/SKILL.md +76 -0
  20. package/dist/skills/agnostic/docs/writing-shape/SKILL.md +75 -0
  21. package/dist/skills/agnostic/planning/create-plan/SKILL.md +17 -2
  22. package/dist/skills/agnostic/planning/create-plan/references/planner-phase.md +1 -1
  23. package/dist/skills/agnostic/planning/create-spec/SKILL.md +55 -10
  24. package/dist/skills/agnostic/planning/create-spec/references/discovery.md +24 -16
  25. package/dist/skills/agnostic/planning/create-spec/references/folder-naming.md +6 -2
  26. package/dist/skills/agnostic/planning/create-spec/references/wiki-bookkeeping.md +29 -5
  27. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +18 -0
  28. package/dist/skills/agnostic/planning/stack/SKILL.md +89 -0
  29. package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +7 -5
  30. package/dist/skills/frameworks/tanstack-query/tanstack-query/SKILL.md +621 -830
  31. package/dist/skills/frameworks/tanstack-start/tanstack-start/SKILL.md +250 -0
  32. package/dist/skills/phases/delivery-phase/SKILL.md +6 -1
  33. package/dist/skills/phases/docs-ingest-phase/SKILL.md +28 -20
  34. package/dist/skills/phases/docs-ingest-phase/references/fumadocs-routing.md +8 -5
  35. package/dist/skills/phases/docs-ingest-phase/references/public-docs.md +82 -0
  36. package/dist/skills/phases/requirements-phase/SKILL.md +2 -0
  37. package/dist/skills/phases/review-phase/SKILL.md +3 -0
  38. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -52324,7 +52324,7 @@ import { execFileSync } from "child_process";
52324
52324
 
52325
52325
  // package.json
52326
52326
  var name = "@punks/cli";
52327
- var version = "2.1.9";
52327
+ var version = "2.1.10";
52328
52328
  // src/telemetry/product.ts
52329
52329
  var git = (cwd, args2) => {
52330
52330
  try {
@@ -52588,15 +52588,15 @@ var renderCommandGuide = () => [
52588
52588
  "usage:",
52589
52589
  " \u2022 agents should activate `$dp-cli` before acting on `.devpunks` output",
52590
52590
  " \u2022 start with `punks scaffold` to inspect the lifecycle",
52591
- " \u2022 use `punks scaffold init` to choose the backlog provider and seed requirements/wiki output",
52591
+ " \u2022 use `punks scaffold init` to choose the backlog provider and start docs onboarding/wiki output",
52592
52592
  " \u2022 reconcile the seeded wiki into the real repo layout before writing durable docs",
52593
52593
  " \u2022 use `punks scaffold setup` for repo-aware pack detection after repo boilerplate is ready",
52594
52594
  " \u2022 use `punks update` after setup to pull newer scaffolded skills/prompts/manifests/hooks",
52595
- " \u2022 use `punks report` when reusable Harness friction should enter backoffice triage",
52596
- " \u2022 public reports are stored internally; GitHub issues require authenticated backoffice triage",
52595
+ " \u2022 use `punks report` when reusable Harness friction should open GitHub-backed triage",
52596
+ " \u2022 accepted reports return a GitHub issue URL; missing server GitHub credentials fail the command",
52597
52597
  "",
52598
52598
  "operator notes:",
52599
- " \u2022 init copies only requirements/backlog skills, backlog-provider pin, and the initial wiki structure",
52599
+ " \u2022 init copies docs-onboarding, requirements/backlog/spec skills, backlog-provider pin, and the initial wiki structure",
52600
52600
  " \u2022 `setup` remains the repo-aware pack-driven scaffold flow",
52601
52601
  " \u2022 each command prints an operator-facing next-step prompt"
52602
52602
  ].join(`
@@ -52617,7 +52617,7 @@ var renderStageIntro = ({
52617
52617
  "",
52618
52618
  "usage:",
52619
52619
  " \u2022 agents should activate `$dp-cli` before following generated output",
52620
- " \u2022 use this to choose the backlog provider, scaffold requirements/backlog skills, and seed the initial wiki tree",
52620
+ " \u2022 use this to choose the backlog provider, scaffold docs-onboarding plus requirements/backlog/spec skills, and seed the initial wiki tree",
52621
52621
  " \u2022 reconcile the wiki into the real repo layout, such as `apps/wiki` in a monorepo",
52622
52622
  " \u2022 rerunning this command overwrites only the files for this stage",
52623
52623
  " \u2022 read the generated prompt/output and follow it before running repo-aware setup"
@@ -52651,7 +52651,7 @@ var renderScaffoldGuide = () => [
52651
52651
  "",
52652
52652
  "commands:",
52653
52653
  " \u203A punks scaffold init",
52654
- " \u2514 requirements gate: pick backlog provider, scaffold `requirements-grill`/`write-backlog`, seed wiki",
52654
+ " \u2514 onboarding gate: pick backlog provider, scaffold `docs-onboarding`, reconstruct wiki/spec context",
52655
52655
  " \u203A punks scaffold setup",
52656
52656
  " \u2514 repo-aware setup: detect packs, scaffold prompts/manifests/hooks",
52657
52657
  "",
@@ -52864,6 +52864,9 @@ var reportCommand = exports_Command.make("report", {
52864
52864
  throw new Error("Harness report API URL is not configured.");
52865
52865
  }
52866
52866
  const submitted = await exports_Effect.runPromise(submitHarnessReport({ baseUrl: baseUrl2, report }));
52867
+ if (submitted.githubUrl === undefined) {
52868
+ throw new Error("Harness report API did not return a GitHub issue URL.");
52869
+ }
52867
52870
  await exports_Effect.runPromise(submitCliEventEffect("cli.harness.report.submitted", {
52868
52871
  cwd: repoRoot
52869
52872
  }));
@@ -52873,14 +52876,14 @@ var reportCommand = exports_Command.make("report", {
52873
52876
  return;
52874
52877
  }
52875
52878
  console.log(renderCommandSection(submitted.deduplicated === true ? "Harness report matched existing issue" : "Harness report submitted", [
52876
- submitted.githubUrl === undefined ? "Stored: Internal backoffice triage" : `Issue: ${submitted.githubUrl}`,
52879
+ `Issue: ${submitted.githubUrl}`,
52877
52880
  submitted.title === undefined ? undefined : `Title: ${submitted.title}`,
52878
52881
  `Status: ${submitted.status}`
52879
52882
  ].filter((line4) => line4 !== undefined).join(`
52880
52883
  `)));
52881
52884
  },
52882
52885
  catch: (cause3) => cause3 instanceof Error ? cause3 : new Error("Harness report submission failed.")
52883
- })).pipe(exports_Command.withDescription("Submit reusable Harness friction to the report API for internal backoffice triage."));
52886
+ })).pipe(exports_Command.withDescription("Submit reusable Harness friction to GitHub-backed maintainer triage."));
52884
52887
 
52885
52888
  // src/cli/scaffold-command.ts
52886
52889
  import path13 from "path";
@@ -52897,6 +52900,13 @@ import path3 from "path";
52897
52900
 
52898
52901
  // src/data/catalog/hooks.ts
52899
52902
  var hookCatalog = [
52903
+ {
52904
+ id: "scaffold-update-check",
52905
+ harness: "shared",
52906
+ outputPath: ".agents/hooks/scaffold-update-check.mjs",
52907
+ description: "Shared session-start hook that reports whether managed Harness scaffold output is current.",
52908
+ sourcePath: "hooks/scaffold-update-check.mjs"
52909
+ },
52900
52910
  {
52901
52911
  id: "format-edited-file",
52902
52912
  harness: "shared",
@@ -53166,12 +53176,12 @@ var packCatalog = [
53166
53176
  id: "docs",
53167
53177
  category: "default",
53168
53178
  triggerPackages: [],
53169
- description: "Default docs pack: docs-ingest-phase.",
53170
- skills: ["docs-ingest-phase"],
53179
+ description: "Default docs pack: docs ingest plus public-doc writing primitives.",
53180
+ skills: ["docs-ingest-phase", "writing-fragments", "writing-beats", "writing-shape"],
53171
53181
  lintAssets: [],
53172
53182
  hooks: [],
53173
53183
  promptSurfaces: ["shared-agents", "root-prompt-spec", "docs-prompt-spec"],
53174
- promptDetails: ["shared docs baseline", "docs scope spec"]
53184
+ promptDetails: ["shared docs baseline", "public-doc writing flow", "docs scope spec"]
53175
53185
  },
53176
53186
  {
53177
53187
  id: "drizzle",
@@ -53276,6 +53286,7 @@ var packCatalog = [
53276
53286
  "create-spec",
53277
53287
  "create-plan",
53278
53288
  "implement-spec",
53289
+ "stack",
53279
53290
  "resolve-debt-phase"
53280
53291
  ],
53281
53292
  lintAssets: [],
@@ -53524,6 +53535,38 @@ var skillCatalog = [
53524
53535
  framework: null,
53525
53536
  requiresTools: []
53526
53537
  },
53538
+ {
53539
+ id: "docs-onboarding",
53540
+ sourceDirectory: "skills/agnostic/docs/docs-onboarding",
53541
+ tier: "agnostic",
53542
+ language: null,
53543
+ framework: null,
53544
+ requiresTools: []
53545
+ },
53546
+ {
53547
+ id: "writing-fragments",
53548
+ sourceDirectory: "skills/agnostic/docs/writing-fragments",
53549
+ tier: "agnostic",
53550
+ language: null,
53551
+ framework: null,
53552
+ requiresTools: []
53553
+ },
53554
+ {
53555
+ id: "writing-beats",
53556
+ sourceDirectory: "skills/agnostic/docs/writing-beats",
53557
+ tier: "agnostic",
53558
+ language: null,
53559
+ framework: null,
53560
+ requiresTools: []
53561
+ },
53562
+ {
53563
+ id: "writing-shape",
53564
+ sourceDirectory: "skills/agnostic/docs/writing-shape",
53565
+ tier: "agnostic",
53566
+ language: null,
53567
+ framework: null,
53568
+ requiresTools: []
53569
+ },
53527
53570
  {
53528
53571
  id: "effect-authoring",
53529
53572
  sourceDirectory: "skills/frameworks/effect/effect-authoring",
@@ -53612,6 +53655,14 @@ var skillCatalog = [
53612
53655
  framework: null,
53613
53656
  requiresTools: []
53614
53657
  },
53658
+ {
53659
+ id: "stack",
53660
+ sourceDirectory: "skills/agnostic/planning/stack",
53661
+ tier: "agnostic",
53662
+ language: null,
53663
+ framework: null,
53664
+ requiresTools: ["stack"]
53665
+ },
53615
53666
  {
53616
53667
  id: "next-best-practices",
53617
53668
  sourceDirectory: "skills/frameworks/nextjs/next-best-practices",
@@ -53820,9 +53871,11 @@ var toolCatalog = [
53820
53871
  },
53821
53872
  {
53822
53873
  id: "opensrc",
53823
- packageName: "opensrc",
53874
+ packageName: "opensrc@^0.7.2",
53824
53875
  requiredBins: ["node"],
53825
- ensureCommands: []
53876
+ ensureCommands: [],
53877
+ versionCommand: ["opensrc", "--version"],
53878
+ minimumVersion: "0.7.2"
53826
53879
  },
53827
53880
  {
53828
53881
  id: "portless",
@@ -53835,6 +53888,12 @@ var toolCatalog = [
53835
53888
  packageName: "skills",
53836
53889
  requiredBins: ["node"],
53837
53890
  ensureCommands: []
53891
+ },
53892
+ {
53893
+ id: "stack",
53894
+ packageName: "@kitlangton/stack",
53895
+ requiredBins: ["node"],
53896
+ ensureCommands: []
53838
53897
  }
53839
53898
  ];
53840
53899
 
@@ -54955,7 +55014,11 @@ var defaultRuntime3 = {
54955
55014
  cwd: options9?.cwd,
54956
55015
  stdio: options9?.stdio === "inherit" ? ["ignore", "inherit", "inherit"] : "ignore"
54957
55016
  });
54958
- }
55017
+ },
55018
+ execFileOutput: (command, args2, options9) => execFileSync3(command, [...args2], {
55019
+ cwd: options9?.cwd,
55020
+ encoding: "utf8"
55021
+ })
54959
55022
  };
54960
55023
  var detectGlobalPackageManager = (runtime5) => {
54961
55024
  if (runtime5.commandExists("bun")) {
@@ -54979,6 +55042,39 @@ var globalInstallCommandFor = (packageManager, packageName) => {
54979
55042
  return ["npm", "install", "-g", packageName];
54980
55043
  }
54981
55044
  };
55045
+ var parseVersionParts = (value6) => {
55046
+ const match19 = value6.match(/\d+(?:\.\d+){0,2}/u);
55047
+ if (match19 === null)
55048
+ return null;
55049
+ return match19[0].split(".").map((part) => Number.parseInt(part, 10));
55050
+ };
55051
+ var compareVersions = (actual, minimum) => {
55052
+ const length5 = Math.max(actual.length, minimum.length);
55053
+ for (let index = 0;index < length5; index += 1) {
55054
+ const actualPart = actual[index] ?? 0;
55055
+ const minimumPart = minimum[index] ?? 0;
55056
+ if (actualPart > minimumPart)
55057
+ return 1;
55058
+ if (actualPart < minimumPart)
55059
+ return -1;
55060
+ }
55061
+ return 0;
55062
+ };
55063
+ var isMinimumVersionSatisfied = (tool, runtime5, cwd) => {
55064
+ if (tool.minimumVersion === undefined || tool.versionCommand === undefined) {
55065
+ return true;
55066
+ }
55067
+ const [command, ...args2] = tool.versionCommand;
55068
+ if (command === undefined || runtime5.execFileOutput === undefined) {
55069
+ return true;
55070
+ }
55071
+ const actual = parseVersionParts(runtime5.execFileOutput(command, args2, { cwd }));
55072
+ const minimum = parseVersionParts(tool.minimumVersion);
55073
+ if (actual === null || minimum === null) {
55074
+ throw new Error(`Cannot verify required tool version from \`${tool.versionCommand.join(" ")}\`.`);
55075
+ }
55076
+ return compareVersions(actual, minimum) >= 0;
55077
+ };
54982
55078
  var ensureToolsInstalled = (toolIds, baseline = bundledBaseline, runtime5 = defaultRuntime3) => {
54983
55079
  const packageManager = detectGlobalPackageManager(runtime5);
54984
55080
  const statuses = [];
@@ -54997,7 +55093,8 @@ var ensureToolsInstalled = (toolIds, baseline = bundledBaseline, runtime5 = defa
54997
55093
  if (missingPrerequisites.length > 0) {
54998
55094
  throw new Error(`Cannot install required tool \`${toolId}\` because ${missingPrerequisites.join(", ")} is not available on PATH.`);
54999
55095
  }
55000
- const alreadyPresent = runtime5.commandExists(toolId);
55096
+ const versionContract = tool;
55097
+ const alreadyPresent = runtime5.commandExists(toolId) && isMinimumVersionSatisfied(versionContract, runtime5, cwd);
55001
55098
  if (!alreadyPresent) {
55002
55099
  const [command, ...args2] = globalInstallCommandFor(globalPackageManager, tool.packageName);
55003
55100
  runtime5.execFile(command, args2, {
@@ -55007,6 +55104,9 @@ var ensureToolsInstalled = (toolIds, baseline = bundledBaseline, runtime5 = defa
55007
55104
  if (!runtime5.commandExists(toolId)) {
55008
55105
  throw new Error(`Tried to install required tool \`${toolId}\`, but the binary is still not available on PATH afterwards.`);
55009
55106
  }
55107
+ if (!isMinimumVersionSatisfied(versionContract, runtime5, cwd)) {
55108
+ throw new Error(`Tried to install required tool \`${toolId}\`, but the installed version does not satisfy ${versionContract.minimumVersion}.`);
55109
+ }
55010
55110
  }
55011
55111
  for (const [command, ...args2] of tool.ensureCommands) {
55012
55112
  runtime5.execFile(command, args2, {
@@ -55160,6 +55260,7 @@ var formatConfirmationSummary = (result, baseline = bundledBaseline) => [
55160
55260
  `output directory: ${result.outputDirectory}`,
55161
55261
  ...section("shared core files:", formatList(result.promptOutputs)),
55162
55262
  ...section("lint spec files:", formatList(result.lintSpecFiles)),
55263
+ ...section("source guide files:", formatList(result.sourceGuideFiles)),
55163
55264
  ...section("skill files:", formatList(result.skillFiles)),
55164
55265
  ...section("prompt spec files:", formatList(result.promptSpecFiles)),
55165
55266
  ...section("subagent scaffold files:", formatList(result.subagentFiles)),
@@ -55199,6 +55300,7 @@ var formatAgentHandoffSummary = (result) => [
55199
55300
  ...formatList([
55200
55301
  ...result.promptOutputs,
55201
55302
  ...result.lintSpecFiles,
55303
+ ...result.sourceGuideFiles,
55202
55304
  ...result.skillFiles,
55203
55305
  ...result.promptSpecFiles,
55204
55306
  ...result.subagentFiles,
@@ -55222,7 +55324,8 @@ var formatAgentHandoffSummary = (result) => [
55222
55324
  " 11. Use `portless` as the local-dev URL baseline. Prefer stable subdomains over raw `localhost:<port>` values in env examples, endpoint defaults, callback URLs, allowed origins, CORS, and app-to-app proxies.",
55223
55325
  " 12. If adopting Oxlint or Oxfmt, replace existing lint/format setup deliberately: package scripts, task pipelines, CI, editor/docs references, and hooks should agree on the new tools.",
55224
55326
  " 13. Before authoring final prompts or implementation plans, identify the core detected libraries whose source behavior matters.",
55225
- " 14. Run `opensrc path <package>` or `opensrc path owner/repo` for those core libraries, then inspect the returned checkout paths. Clone the major framework/runtime libraries you will reason about; do not clone every dependency mechanically."
55327
+ " 14. If an `opensrc/<package>.md` guide exists for a package, read that card first, then run its `opensrc path --cwd . <package>` command or fallback repository lookup.",
55328
+ " 15. Inspect the returned checkout paths. Clone the major framework/runtime libraries you will reason about; do not clone every dependency mechanically."
55226
55329
  ].join(`
55227
55330
  `);
55228
55331
  var formatSelectionPreview = (options9) => [
@@ -55426,7 +55529,7 @@ Use \`parallel-research\` for readonly repo orientation when the work can be spl
55426
55529
 
55427
55530
  Before delegating to subagents, verify the active harness global/project settings actually enable subagent execution, then verify repo-local routing. For Codex, \`.codex/config.toml\` should have an \`[agents]\` section with usable thread/depth limits. For Claude Code, OpenCode, Cursor, or other harnesses, check their equivalent global/project agent settings before trusting repo-local mirrors. Then confirm \`.agents/subagents/manifest.mjs\` exists and the selected specialist has matching owned paths, guidance files, and skills. If that guard fails, repair settings or execute locally; do not claim worker coverage from an inactive harness.
55428
55531
 
55429
- When inspecting external library internals, prefer official docs first. If source context is needed, resolve cached read-only sources with \`opensrc path <package>\` for packages or \`opensrc path owner/repo\` for repositories, then inspect the returned absolute path. This applies broadly to third-party dependencies used here.
55532
+ When inspecting external library internals, prefer official docs first. If \`opensrc/<package>.md\` exists, read that guide card before resolving cached source. Then use \`opensrc path --cwd . <package>\` for packages or \`opensrc path owner/repo\` for repositories, and inspect the returned absolute path.
55430
55533
 
55431
55534
  Use \`portless\` for local development URLs instead of baking raw \`localhost:<port>\` values into docs, env examples, endpoint defaults, callback URLs, allowed origins, CORS lists, or app-to-app proxy targets.
55432
55535
 
@@ -55613,7 +55716,7 @@ var renderPromptSpecMarkdown = (spec) => [
55613
55716
  "## Source inspection",
55614
55717
  "",
55615
55718
  "- No arbitrary concrete `opensrc` repositories are invented by scaffold.",
55616
- "- During post-scaffold setup, decide which detected core libraries materially affect prompt or lint authoring, then run `opensrc path <package>` or `opensrc path owner/repo` for those libraries before relying on source behavior.",
55719
+ "- During post-scaffold setup, decide which detected core libraries materially affect prompt or lint authoring, then read any matching `opensrc/<package>.md` guide before running `opensrc path --cwd . <package>` or `opensrc path owner/repo`.",
55617
55720
  ...spec.opensrcReferences.length === 0 ? [] : [
55618
55721
  "",
55619
55722
  "## Curated opensrc examples",
@@ -55642,6 +55745,7 @@ var renderAgentHandoffMarkdown = ({
55642
55745
  promptOutputs,
55643
55746
  promptSpecFiles,
55644
55747
  lintSpecFiles,
55748
+ sourceGuideFiles,
55645
55749
  skillFiles,
55646
55750
  subagentFiles,
55647
55751
  scriptFiles,
@@ -55661,6 +55765,7 @@ var renderAgentHandoffMarkdown = ({
55661
55765
  "- Shared global prompt scaffolding under `.agents/`.",
55662
55766
  "- Prompt specs under `.devpunks/specs/prompts/`.",
55663
55767
  "- Selected lint asset specs under `.devpunks/specs/lint/`.",
55768
+ "- Source guide cards under `opensrc/` when detected packages need `opensrc` context.",
55664
55769
  "- Subagent manifest scaffolding/specs under `.agents/subagents/` and `.devpunks/specs/subagents/`.",
55665
55770
  `- Scaffold manifest at \`${scaffoldManifestFile}\`.`,
55666
55771
  `- Required tools manifest at \`${requiredToolsFile}\`.`,
@@ -55693,7 +55798,8 @@ var renderAgentHandoffMarkdown = ({
55693
55798
  "11. Use `.agents/scripts/sync-subagents.mjs` to regenerate harness-native agents, hook mirrors, shared prompt mirrors, and the `.claude/skills` compatibility mirror when the neutral manifest changes.",
55694
55799
  "12. Populate or reconcile `.agents/subagents/manifest.mjs` using both the manifest spec JSON and the manifest prompt markdown.",
55695
55800
  "13. Adjust owned paths and guidance file references in the subagent manifest to match the real repo layout. Monorepo vs single-repo shape affects these paths.",
55696
- "14. Before authoring final prompts or implementation plans, identify the core detected libraries whose source behavior matters, run `opensrc path <package>` or `opensrc path owner/repo` for those libraries, then inspect the returned checkout paths. Clone the major framework/runtime libraries you will reason about; do not clone every dependency mechanically.",
55801
+ "14. Before authoring final prompts or implementation plans, identify the core detected libraries whose source behavior matters. If an `opensrc/<package>.md` guide exists for a package, read that card first, then run its `opensrc path --cwd . <package>` command or fallback repository lookup.",
55802
+ "15. Inspect the returned checkout paths. Clone the major framework/runtime libraries you will reason about; do not clone every dependency mechanically.",
55697
55803
  "",
55698
55804
  "## Shared core files",
55699
55805
  "",
@@ -55711,6 +55817,10 @@ var renderAgentHandoffMarkdown = ({
55711
55817
  "",
55712
55818
  ...lintSpecFiles.map((file6) => `- \`${file6}\``),
55713
55819
  "",
55820
+ "## Source guide files",
55821
+ "",
55822
+ ...sourceGuideFiles.map((file6) => `- \`${file6}\``),
55823
+ "",
55714
55824
  "## Subagent files",
55715
55825
  "",
55716
55826
  ...subagentFiles.map((file6) => `- \`${file6}\``),
@@ -55767,6 +55877,179 @@ var renderLintSpecMarkdown = ({
55767
55877
  ].join(`
55768
55878
  `);
55769
55879
 
55880
+ // src/content/source-guides.ts
55881
+ var sourceGuideCatalog = [
55882
+ {
55883
+ id: "effect",
55884
+ title: "Effect Source Guide",
55885
+ packageSpec: "effect",
55886
+ fallbackSpec: "Effect-TS/effect",
55887
+ technologies: ["effect"],
55888
+ packs: ["effect"],
55889
+ useWhen: [
55890
+ "Effect runtime, Schema, Layer, Stream, or service behavior affects implementation.",
55891
+ "Official docs are not specific enough for the call path being changed."
55892
+ ],
55893
+ inspectFirst: ["packages/effect/src", "packages/effect/test", "packages/platform/src"]
55894
+ },
55895
+ {
55896
+ id: "nextjs",
55897
+ title: "Next.js Source Guide",
55898
+ packageSpec: "next",
55899
+ fallbackSpec: "vercel/next.js",
55900
+ technologies: ["nextjs"],
55901
+ packs: ["nextjs"],
55902
+ useWhen: [
55903
+ "App Router, cache, middleware, route-handler, or build behavior affects implementation.",
55904
+ "Framework behavior differs across installed Next.js versions."
55905
+ ],
55906
+ inspectFirst: ["packages/next/src", "test/e2e", "test/integration"]
55907
+ },
55908
+ {
55909
+ id: "react",
55910
+ title: "React Source Guide",
55911
+ packageSpec: "react",
55912
+ fallbackSpec: "facebook/react",
55913
+ technologies: ["react"],
55914
+ packs: ["react"],
55915
+ useWhen: [
55916
+ "React rendering, hooks, suspense, or client/server integration behavior affects implementation.",
55917
+ "Docs explain the API but not the runtime edge case being debugged."
55918
+ ],
55919
+ inspectFirst: ["packages/react/src", "packages/react-reconciler/src"]
55920
+ },
55921
+ {
55922
+ id: "tanstack-query",
55923
+ title: "TanStack Query Source Guide",
55924
+ packageSpec: "@tanstack/react-query",
55925
+ fallbackSpec: "TanStack/query",
55926
+ technologies: ["tanstack-query"],
55927
+ packs: ["tanstack-query"],
55928
+ useWhen: [
55929
+ "Query invalidation, mutation, cache, hydration, or observer behavior affects implementation.",
55930
+ "A usage pattern depends on library internals or version-specific behavior."
55931
+ ],
55932
+ inspectFirst: ["packages/react-query/src", "packages/query-core/src"]
55933
+ },
55934
+ {
55935
+ id: "better-auth",
55936
+ title: "Better Auth Source Guide",
55937
+ packageSpec: "better-auth",
55938
+ fallbackSpec: "better-auth/better-auth",
55939
+ technologies: ["better-auth"],
55940
+ packs: ["better-auth"],
55941
+ useWhen: [
55942
+ "Session, adapter, plugin, OAuth, OTP, or cookie behavior affects implementation.",
55943
+ "Security-sensitive auth behavior needs source-backed verification."
55944
+ ],
55945
+ inspectFirst: ["packages/better-auth/src", "packages/cli/src"]
55946
+ },
55947
+ {
55948
+ id: "drizzle",
55949
+ title: "Drizzle Source Guide",
55950
+ packageSpec: "drizzle-orm",
55951
+ fallbackSpec: "drizzle-team/drizzle-orm",
55952
+ technologies: ["drizzle"],
55953
+ packs: ["drizzle"],
55954
+ useWhen: [
55955
+ "Query builder, migration, relation, or dialect behavior affects implementation.",
55956
+ "Database behavior depends on generated SQL or package-specific edge cases."
55957
+ ],
55958
+ inspectFirst: ["drizzle-orm/src", "drizzle-kit/src"]
55959
+ },
55960
+ {
55961
+ id: "trpc",
55962
+ title: "tRPC Source Guide",
55963
+ packageSpec: "@trpc/server",
55964
+ fallbackSpec: "trpc/trpc",
55965
+ technologies: ["trpc"],
55966
+ packs: ["trpc"],
55967
+ useWhen: [
55968
+ "Router, procedure, transformer, client, or middleware behavior affects implementation.",
55969
+ "Type-level contracts need source-backed verification."
55970
+ ],
55971
+ inspectFirst: ["packages/server/src", "packages/client/src", "packages/react-query/src"]
55972
+ },
55973
+ {
55974
+ id: "elysia",
55975
+ title: "Elysia Source Guide",
55976
+ packageSpec: "elysia",
55977
+ fallbackSpec: "elysiajs/elysia",
55978
+ technologies: ["elysia"],
55979
+ packs: ["elysia"],
55980
+ useWhen: [
55981
+ "Route, plugin, schema, context, or lifecycle behavior affects implementation.",
55982
+ "Runtime behavior needs verification beyond API docs."
55983
+ ],
55984
+ inspectFirst: ["src", "test"]
55985
+ }
55986
+ ];
55987
+ var sourceGuideFile = (guide) => `opensrc/${guide.id}.md`;
55988
+ var sourceGuidesForSelection = ({
55989
+ detectedTechnologies,
55990
+ finalPacks
55991
+ }) => {
55992
+ const technologies = new Set(detectedTechnologies);
55993
+ const packs = new Set(finalPacks);
55994
+ return sourceGuideCatalog.filter((guide) => guide.technologies.some((technology) => technologies.has(technology)) || guide.packs.some((pack2) => packs.has(pack2)));
55995
+ };
55996
+ var summarizeSourceGuide = (guide) => ({
55997
+ id: guide.id,
55998
+ title: guide.title,
55999
+ file: sourceGuideFile(guide),
56000
+ packageSpec: guide.packageSpec,
56001
+ ...guide.fallbackSpec === undefined ? {} : { fallbackSpec: guide.fallbackSpec }
56002
+ });
56003
+ var renderSourceGuideReadme = (guides) => [
56004
+ "# opensrc",
56005
+ "",
56006
+ "This directory is an index for source code inspected through the global `opensrc` cache.",
56007
+ "",
56008
+ "It does not contain cloned package source. Each guide card points agents to the right `opensrc path` command, why the source matters, and where to start reading.",
56009
+ "",
56010
+ "Use these cards before inspecting package internals. Prefer official docs first, then resolve live source with `opensrc path --cwd . <package>` or the fallback repository command.",
56011
+ "",
56012
+ "## Guides",
56013
+ "",
56014
+ ...guides.map((guide) => `- [${guide.title}](./${guide.id}.md)`)
56015
+ ].join(`
56016
+ `);
56017
+ var renderSourceGuide = (guide) => [
56018
+ `# ${guide.title}`,
56019
+ "",
56020
+ "This is an index card for the global `opensrc` cache. Do not commit cloned source here.",
56021
+ "",
56022
+ "## Resolve Source",
56023
+ "",
56024
+ "```bash",
56025
+ `opensrc path --cwd . ${guide.packageSpec}`,
56026
+ "```",
56027
+ ...guide.fallbackSpec === undefined ? [] : [
56028
+ "",
56029
+ "Fallback repository lookup:",
56030
+ "",
56031
+ "```bash",
56032
+ `opensrc path ${guide.fallbackSpec}`,
56033
+ "```"
56034
+ ],
56035
+ "",
56036
+ "## Use When",
56037
+ "",
56038
+ ...guide.useWhen.map((item) => `- ${item}`),
56039
+ "",
56040
+ "## Inspect First",
56041
+ "",
56042
+ ...guide.inspectFirst.map((item) => `- \`${item}\``),
56043
+ "",
56044
+ "## Rules",
56045
+ "",
56046
+ "- Prefer official docs first when they answer the question.",
56047
+ "- Use `opensrc path --cwd .` so npm package resolution can use this repo's lockfile.",
56048
+ "- Keep the cloned source in the global `~/.opensrc` cache unless the user explicitly asks for a different cache root.",
56049
+ "- Do not copy upstream source into this directory."
56050
+ ].join(`
56051
+ `);
56052
+
55770
56053
  // src/content/hooks.ts
55771
56054
  var hookRegistryForBaseline = (baseline = bundledBaseline) => baseline.hooks;
55772
56055
 
@@ -55827,6 +56110,70 @@ var subagentSpecialistNote = ({
55827
56110
  workspacePath,
55828
56111
  targetFile
55829
56112
  }) => scope5 === "docs" ? "Own docs maintenance and keep durable repo docs aligned with implemented reality." : `Own changes under ${workspacePath ?? targetFile} and defer cross-workspace orchestration to the root agent.`;
56113
+ var workflowCapabilityPacks = {
56114
+ "workflow-planning": {
56115
+ description: "Default workflow planning pack for spec discovery, spec review, and plan review.",
56116
+ skills: [
56117
+ "create-spec",
56118
+ "create-plan",
56119
+ "parallel-research",
56120
+ "swarm-planner",
56121
+ "tdd",
56122
+ "simplify",
56123
+ "stack"
56124
+ ]
56125
+ },
56126
+ "workflow-requirements": {
56127
+ description: "Default workflow requirements pack for grill synthesis and backlog shaping.",
56128
+ skills: ["requirements-phase", "requirements-grill", "write-backlog"]
56129
+ },
56130
+ "workflow-review": {
56131
+ description: "Default workflow review pack for readonly artifact checks.",
56132
+ skills: ["review-phase", "simplify"]
56133
+ }
56134
+ };
56135
+ var workflowSpecialists = [
56136
+ {
56137
+ id: "planning-discovery",
56138
+ ownedPaths: ["."],
56139
+ guidanceFiles: ["AGENTS.md"],
56140
+ packs: ["workflow-planning"],
56141
+ skills: ["parallel-research", "create-spec"],
56142
+ notes: "Use for bounded readonly orientation before spec or plan writing: gather evidence, contradictions, overlapping work, and open questions without solution design."
56143
+ },
56144
+ {
56145
+ id: "requirements-synthesizer",
56146
+ ownedPaths: ["."],
56147
+ guidanceFiles: ["AGENTS.md"],
56148
+ packs: ["workflow-requirements"],
56149
+ skills: ["requirements-phase", "requirements-grill", "write-backlog"],
56150
+ notes: "Use for readonly compression of grill/status/log artifacts into accepted, rejected, superseded, parked, and unresolved decisions."
56151
+ },
56152
+ {
56153
+ id: "backlog-shaper",
56154
+ ownedPaths: ["."],
56155
+ guidanceFiles: ["AGENTS.md"],
56156
+ packs: ["workflow-requirements"],
56157
+ skills: ["requirements-phase", "write-backlog"],
56158
+ notes: "Use for draft-only module, epic, and story shaping from closed requirements; provider sync and final backlog decisions stay with the parent."
56159
+ },
56160
+ {
56161
+ id: "spec-reviewer",
56162
+ ownedPaths: ["."],
56163
+ guidanceFiles: ["AGENTS.md"],
56164
+ packs: ["workflow-planning", "workflow-review"],
56165
+ skills: ["create-spec", "review-phase", "simplify"],
56166
+ notes: "Use for readonly review of drafted specs before user review, checking invented requirements, contradictions, missing constraints, and vague acceptance criteria."
56167
+ },
56168
+ {
56169
+ id: "plan-reviewer",
56170
+ ownedPaths: ["."],
56171
+ guidanceFiles: ["AGENTS.md"],
56172
+ packs: ["workflow-planning", "workflow-review"],
56173
+ skills: ["create-plan", "swarm-planner", "tdd", "simplify"],
56174
+ notes: "Use for readonly review of plans before yielding, checking dependencies, ordering, invalid parallelism, unsafe write overlap, RED targets, validation, and assigned skills."
56175
+ }
56176
+ ];
55830
56177
  var renderSubagentManifestPrompt = ({
55831
56178
  workspaces,
55832
56179
  finalPacks
@@ -55846,6 +56193,7 @@ var renderSubagentManifestPrompt = ({
55846
56193
  "## Requirements",
55847
56194
  "",
55848
56195
  "- Keep capability packs narrow and reusable.",
56196
+ "- Include default workflow archetypes for planning and requirements inner steps: `planning-discovery`, `requirements-synthesizer`, `backlog-shaper`, `spec-reviewer`, and `plan-reviewer`.",
55849
56197
  "- Keep specialist agents scoped by owned paths and guidance files.",
55850
56198
  "- Include `simplify` in every implementation-focused specialist.",
55851
56199
  "- Keep docs ownership in a dedicated docs specialist when `docs/` exists.",
@@ -55860,26 +56208,33 @@ var renderSubagentManifestModule = ({
55860
56208
  if (spec.specialists.length === 0) {
55861
56209
  return fallback;
55862
56210
  }
55863
- const baseSpecialists = spec.finalPacks.includes("research") && !spec.specialists.some((specialist) => specialist.id === "code-review") ? [
55864
- {
55865
- id: "code-review",
55866
- ownedPaths: ["."],
55867
- guidanceFiles: ["AGENTS.md"],
55868
- packs: ["research"],
55869
- skills: ["simplify", "improve-codebase-architecture"],
55870
- notes: "Use for findings-first review across changed code, simplification opportunities, and grounded architecture-friction findings."
55871
- }
55872
- ] : [];
56211
+ const baseWorkflowSpecialists = spec.finalPacks.includes("subagents") ? workflowSpecialists.filter((workflowSpecialist) => !spec.specialists.some((specialist) => specialist.id === workflowSpecialist.id)) : [];
56212
+ const baseSpecialists = [
56213
+ ...baseWorkflowSpecialists,
56214
+ ...spec.finalPacks.includes("research") && !spec.specialists.some((specialist) => specialist.id === "code-review") ? [
56215
+ {
56216
+ id: "code-review",
56217
+ ownedPaths: ["."],
56218
+ guidanceFiles: ["AGENTS.md"],
56219
+ packs: ["research"],
56220
+ skills: ["simplify", "improve-codebase-architecture"],
56221
+ notes: "Use for findings-first review across changed code, simplification opportunities, and grounded architecture-friction findings."
56222
+ }
56223
+ ] : []
56224
+ ];
55873
56225
  const specialists = [...baseSpecialists, ...spec.specialists];
55874
56226
  const selectedPacks = [...new Set(specialists.flatMap((specialist) => specialist.packs))];
55875
56227
  const packDescriptions = new Map(baseline.packs.map((pack2) => [pack2.id, pack2.description]));
55876
- const capabilityPacks = Object.fromEntries(selectedPacks.map((packId) => [
55877
- packId,
55878
- {
55879
- description: packDescriptions.get(packId) ?? `${packId} guidance pack.`,
55880
- skills: skillsForPack(packId, baseline)
55881
- }
55882
- ]));
56228
+ const capabilityPacks = Object.fromEntries(selectedPacks.map((packId) => {
56229
+ const workflowPack = workflowCapabilityPacks[packId];
56230
+ return [
56231
+ packId,
56232
+ workflowPack ?? {
56233
+ description: packDescriptions.get(packId) ?? `${packId} guidance pack.`,
56234
+ skills: skillsForPack(packId, baseline)
56235
+ }
56236
+ ];
56237
+ }));
55883
56238
  const agents = specialists.map((specialist) => ({
55884
56239
  name: specialist.id,
55885
56240
  description: specialist.notes,
@@ -55990,7 +56345,10 @@ var migrateLegacySkillDirectories = ({
55990
56345
  rmSync2(absoluteDirectory, { recursive: true, force: true });
55991
56346
  }
55992
56347
  };
55993
- var selectedHookIds = (finalPacks, baseline) => uniqueSorted(finalPacks.flatMap((packId) => hooksForPack(packId, baseline)));
56348
+ var selectedHookIds = (finalPacks, baseline) => uniqueSorted([
56349
+ "scaffold-update-check",
56350
+ ...finalPacks.flatMap((packId) => hooksForPack(packId, baseline))
56351
+ ]);
55994
56352
  var oxlintConfigCandidates = ["oxlint.config.ts", ".oxlintrc.json", ".oxlintrc.jsonc"];
55995
56353
  var existingOxlintConfigFiles = (scanDirectory) => oxlintConfigCandidates.filter((candidate) => existsSync5(path10.join(scanDirectory, candidate)));
55996
56354
  var oxlintStarterConfig = {
@@ -56620,6 +56978,9 @@ var managedKindForPath = (relativePath) => {
56620
56978
  if (relativePath.startsWith(".devpunks/specs/lint/")) {
56621
56979
  return "lint-spec";
56622
56980
  }
56981
+ if (relativePath.startsWith("opensrc/")) {
56982
+ return "source-guide";
56983
+ }
56623
56984
  if (relativePath.startsWith(".agents/skills/")) {
56624
56985
  return "skill";
56625
56986
  }
@@ -56704,6 +57065,7 @@ var writeScaffoldOutput = ({
56704
57065
  const promptOutputs = [];
56705
57066
  const promptSpecFiles = [];
56706
57067
  const lintSpecFiles = [];
57068
+ const sourceGuideFiles = [];
56707
57069
  const skillFiles = [];
56708
57070
  const subagentFiles = [];
56709
57071
  const scriptFiles = [];
@@ -56737,6 +57099,11 @@ var writeScaffoldOutput = ({
56737
57099
  baseline
56738
57100
  }));
56739
57101
  const opensrcReferences = collectOpensrcReferences(promptSpecs);
57102
+ const sourceGuides = sourceGuidesForSelection({
57103
+ detectedTechnologies: detection.detectedTechnologies,
57104
+ finalPacks
57105
+ });
57106
+ const sourceGuideSummaries = sourceGuides.map(summarizeSourceGuide);
56740
57107
  generatedFiles.push(writeArtifact({
56741
57108
  outputDirectory,
56742
57109
  relativePath: ".agents/AGENTS.md",
@@ -56758,6 +57125,24 @@ var writeScaffoldOutput = ({
56758
57125
  }));
56759
57126
  promptSpecFiles.push(promptSpec.specFile);
56760
57127
  }
57128
+ if (sourceGuides.length > 0) {
57129
+ const readmeFile = "opensrc/README.md";
57130
+ generatedFiles.push(writeArtifact({
57131
+ outputDirectory,
57132
+ relativePath: readmeFile,
57133
+ content: renderSourceGuideReadme(sourceGuides)
57134
+ }));
57135
+ sourceGuideFiles.push(readmeFile);
57136
+ for (const guide of sourceGuides) {
57137
+ const guideFile = sourceGuideFile(guide);
57138
+ generatedFiles.push(writeArtifact({
57139
+ outputDirectory,
57140
+ relativePath: guideFile,
57141
+ content: renderSourceGuide(guide)
57142
+ }));
57143
+ sourceGuideFiles.push(guideFile);
57144
+ }
57145
+ }
56761
57146
  if (lintAssets.length > 0) {
56762
57147
  const lintAssetsFile = ".devpunks/specs/lint/assets.json";
56763
57148
  generatedFiles.push(writeArtifact({
@@ -56878,12 +57263,14 @@ var writeScaffoldOutput = ({
56878
57263
  }
56879
57264
  generatedFiles.push(...harnessFiles);
56880
57265
  const requiredToolsFile = ".devpunks/required-tools.json";
57266
+ const requiredToolIds = requiredToolsForSkills(finalSkills, baseline);
56881
57267
  generatedFiles.push(writeArtifact({
56882
57268
  outputDirectory,
56883
57269
  relativePath: requiredToolsFile,
56884
57270
  content: encodeJson({
56885
57271
  skills: finalSkills,
56886
- tools: requiredToolsForSkills(finalSkills, baseline)
57272
+ tools: requiredToolIds,
57273
+ toolContracts: baseline.tools.filter((tool) => requiredToolIds.includes(tool.id))
56887
57274
  })
56888
57275
  }));
56889
57276
  const agentHandoffFile = ".devpunks/AGENT-HANDOFF.md";
@@ -56899,6 +57286,7 @@ var writeScaffoldOutput = ({
56899
57286
  promptOutputs: promptOutputs.toSorted(),
56900
57287
  promptSpecFiles: promptSpecFiles.toSorted(),
56901
57288
  lintSpecFiles: lintSpecFiles.toSorted(),
57289
+ sourceGuideFiles: sourceGuideFiles.toSorted(),
56902
57290
  skillFiles: skillFiles.toSorted(),
56903
57291
  scaffoldManifestFile: ".devpunks/scaffold-manifest.json",
56904
57292
  requiredToolsFile,
@@ -56932,6 +57320,7 @@ var writeScaffoldOutput = ({
56932
57320
  promptOutputs,
56933
57321
  promptSpecFiles,
56934
57322
  lintSpecFiles,
57323
+ sourceGuideFiles,
56935
57324
  skillFiles,
56936
57325
  subagentFiles,
56937
57326
  scriptFiles,
@@ -56941,6 +57330,7 @@ var writeScaffoldOutput = ({
56941
57330
  requiredToolsFile,
56942
57331
  promptSpecs,
56943
57332
  opensrcReferences,
57333
+ sourceGuides: sourceGuideSummaries,
56944
57334
  lintAssets,
56945
57335
  appliedLintConfigs,
56946
57336
  subagentManifestSpec,
@@ -56964,6 +57354,7 @@ var writeScaffoldOutput = ({
56964
57354
  promptOutputs: promptOutputs.toSorted(),
56965
57355
  promptSpecFiles: promptSpecFiles.toSorted(),
56966
57356
  lintSpecFiles: lintSpecFiles.toSorted(),
57357
+ sourceGuideFiles: sourceGuideFiles.toSorted(),
56967
57358
  skillFiles: skillFiles.toSorted(),
56968
57359
  subagentFiles: subagentFiles.toSorted(),
56969
57360
  scriptFiles: scriptFiles.toSorted(),
@@ -56976,6 +57367,7 @@ var writeScaffoldOutput = ({
56976
57367
  managedFiles: managedFilesWithManifest,
56977
57368
  promptSpecs,
56978
57369
  opensrcReferences,
57370
+ sourceGuides: sourceGuideSummaries,
56979
57371
  lintAssets,
56980
57372
  subagentManifestSpec,
56981
57373
  generatedFiles: generatedFiles.toSorted()
@@ -57208,6 +57600,7 @@ var runScaffold = ({
57208
57600
  promptOutputs: scaffoldOutput.promptOutputs,
57209
57601
  promptSpecFiles: scaffoldOutput.promptSpecFiles,
57210
57602
  lintSpecFiles: scaffoldOutput.lintSpecFiles,
57603
+ sourceGuideFiles: scaffoldOutput.sourceGuideFiles,
57211
57604
  skillFiles: scaffoldOutput.skillFiles,
57212
57605
  subagentFiles: scaffoldOutput.subagentFiles,
57213
57606
  scriptFiles: scaffoldOutput.scriptFiles,
@@ -57222,6 +57615,7 @@ var runScaffold = ({
57222
57615
  managedFiles: scaffoldOutput.managedFiles,
57223
57616
  promptSpecs: scaffoldOutput.promptSpecs,
57224
57617
  opensrcReferences: scaffoldOutput.opensrcReferences,
57618
+ sourceGuides: scaffoldOutput.sourceGuides,
57225
57619
  lintAssets: scaffoldOutput.lintAssets,
57226
57620
  subagentManifestSpec: scaffoldOutput.subagentManifestSpec,
57227
57621
  generatedFiles: [...scaffoldOutput.generatedFiles, agentSystemPromptFile],
@@ -57251,6 +57645,7 @@ var runScaffold = ({
57251
57645
  promptOutputs: scaffoldOutput.promptOutputs,
57252
57646
  promptSpecFiles: scaffoldOutput.promptSpecFiles,
57253
57647
  lintSpecFiles: scaffoldOutput.lintSpecFiles,
57648
+ sourceGuideFiles: scaffoldOutput.sourceGuideFiles,
57254
57649
  skillFiles: scaffoldOutput.skillFiles,
57255
57650
  subagentFiles: scaffoldOutput.subagentFiles,
57256
57651
  scriptFiles: scaffoldOutput.scriptFiles,
@@ -57265,6 +57660,7 @@ var runScaffold = ({
57265
57660
  managedFiles: scaffoldOutput.managedFiles,
57266
57661
  promptSpecs: scaffoldOutput.promptSpecs,
57267
57662
  opensrcReferences: scaffoldOutput.opensrcReferences,
57663
+ sourceGuides: scaffoldOutput.sourceGuides,
57268
57664
  lintAssets: scaffoldOutput.lintAssets,
57269
57665
  subagentManifestSpec: scaffoldOutput.subagentManifestSpec,
57270
57666
  generatedFiles: [...scaffoldOutput.generatedFiles, writtenAgentSystemPromptFile]
@@ -58826,15 +59222,15 @@ var wikiFrameworkLabels = {
58826
59222
  var stageScaffoldCatalog = [
58827
59223
  {
58828
59224
  id: "init",
58829
- summary: "Requirements grill, backlog authoring, and wiki docs seed.",
58830
- skills: ["requirements-grill", "write-backlog"],
59225
+ summary: "Docs onboarding, requirements grill, spec reconstruction, backlog authoring, and wiki docs seed.",
59226
+ skills: ["docs-onboarding", "requirements-grill", "write-backlog", "create-spec"],
58831
59227
  renderPrompt: ({
58832
59228
  wikiRoot,
58833
59229
  backlogProvider,
58834
59230
  wikiFramework
58835
59231
  }) => `You are the operator agent continuing a \`punks scaffold init\` run.
58836
59232
 
58837
- Do not start requirements discovery by default. First reconcile the generated output with this repository.
59233
+ Activate \`$docs-onboarding\` now. Inspect the codebase, existing docs, and the selected backlog provider. Build the Project Map, run the targeted requirements grill, then call \`create-spec\` to reconstruct evidence-backed specs into the scaffolded wiki.
58838
59234
 
58839
59235
  Scaffolded wiki base:
58840
59236
  - treat \`${wikiRoot}\` as the dedicated wiki root for specs, raw inputs, routed project docs, and ingest bookkeeping
@@ -58844,8 +59240,10 @@ Scaffolded wiki base:
58844
59240
  - keep using the reconciled wiki root when later steps create specs, plans, or ingest domain knowledge
58845
59241
 
58846
59242
  Generated skills:
59243
+ - \`.agents/skills/docs-onboarding\`
58847
59244
  - \`.agents/skills/requirements-grill\`
58848
59245
  - \`.agents/skills/write-backlog\`
59246
+ - \`.agents/skills/create-spec\`
58849
59247
 
58850
59248
  Backlog provider:
58851
59249
  - selected provider: ${backlogProviderLabels[backlogProvider]} (\`${backlogProvider}\`)
@@ -58861,8 +59259,10 @@ Post-command guidance:
58861
59259
  1. Read the repository guidance and inspect the generated files.
58862
59260
  2. Move, rename, or refactor the generated wiki and skill output when needed so it matches the actual repo layout.
58863
59261
  3. Report what changed and what remains unresolved.
58864
- 4. Use \`requirements-grill\` and then \`write-backlog\` only when the user actually asks for requirements or backlog generation.
58865
- 5. Use \`punks scaffold setup\` only after the repo shape is ready for repo-aware AI setup.
59262
+ 4. Activate \`$docs-onboarding\` immediately and let it inspect code, docs, and backlog context before writing onboarding artifacts.
59263
+ 5. Let \`docs-onboarding\` run the targeted requirements grill and call \`create-spec\` after grill closure.
59264
+ 6. Use \`write-backlog\` only after accepted requirements are ready for backlog mutation.
59265
+ 7. Use \`punks scaffold setup\` only after the repo shape is ready for repo-aware AI setup.
58866
59266
 
58867
59267
  When the generated init output matches the repo, the next CLI step is:
58868
59268
  - \`punks scaffold setup\``
@@ -58946,15 +59346,21 @@ var copySkillDirectory = ({
58946
59346
  skillId,
58947
59347
  baseline
58948
59348
  }) => {
58949
- const sourceDirectory = skillRegistryByIdForBaseline(baseline)[skillId].sourceDirectory;
59349
+ const baselineSkill = skillRegistryByIdForBaseline(baseline)[skillId];
59350
+ const bundledSkill = skillRegistryByIdForBaseline(bundledBaseline)[skillId];
59351
+ const skill = baselineSkill ?? bundledSkill;
59352
+ if (skill === undefined) {
59353
+ throw new Error(`Unknown scaffold skill: ${skillId}`);
59354
+ }
59355
+ const skillBaseline = baselineSkill === undefined ? bundledBaseline : baseline;
58950
59356
  const targetDirectory = path12.posix.join(".agents/skills", skillId);
58951
59357
  const absoluteTargetDirectory = path12.join(outputDirectory, targetDirectory);
58952
59358
  mkdirSync4(path12.join(outputDirectory, ".agents/skills"), { recursive: true });
58953
59359
  rmSync3(absoluteTargetDirectory, { recursive: true, force: true });
58954
59360
  cpSync2(resolveBaselinePath({
58955
- baselineRoot: baseline.root,
58956
- baselineSkillsRoot: baseline.skillsRoot,
58957
- relativePath: sourceDirectory
59361
+ baselineRoot: skillBaseline.root,
59362
+ baselineSkillsRoot: skillBaseline.skillsRoot,
59363
+ relativePath: skill.sourceDirectory
58958
59364
  }), absoluteTargetDirectory, { recursive: true });
58959
59365
  return targetDirectory;
58960
59366
  };
@@ -59412,7 +59818,7 @@ var setupCommand = exports_Command.make("setup", {
59412
59818
  message: error4.message
59413
59819
  })))))).pipe(exports_Command.withDescription("Repo-aware AI setup. Agents: activate $dp-cli, then reconcile .devpunks output with the real repo layout."));
59414
59820
  var scaffoldCommand = exports_Command.make("scaffold", {}, () => exports_Effect.sync(() => console.log(renderScaffoldGuide()))).pipe(exports_Command.withDescription("Scaffold init or setup. Agents: activate $dp-cli before following generated handoffs."), exports_Command.withSubcommands([
59415
- stageCommand("init", "Seed requirements/backlog skills and wiki structure. Agents: activate $dp-cli and reconcile wiki layout."),
59821
+ stageCommand("init", "Seed docs onboarding, requirements/backlog/spec skills, and wiki structure. Agents: activate $dp-cli, then $docs-onboarding."),
59416
59822
  setupCommand
59417
59823
  ]));
59418
59824