forgedock 1.0.21 → 1.1.1

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 (76) hide show
  1. package/README.md +227 -174
  2. package/bin/cinema.mjs +320 -0
  3. package/bin/demo.mjs +386 -0
  4. package/bin/engine/phases.mjs +148 -0
  5. package/bin/engine/projector.mjs +32 -0
  6. package/bin/engine/reconcile.mjs +11 -0
  7. package/bin/engine/runlog.mjs +79 -0
  8. package/bin/engine/state.mjs +27 -0
  9. package/bin/engine-cli.mjs +50 -0
  10. package/bin/engine.mjs +138 -0
  11. package/bin/forgedock.mjs +693 -1393
  12. package/bin/init-detect.mjs +95 -0
  13. package/bin/journey.mjs +783 -0
  14. package/bin/runner.mjs +847 -0
  15. package/bin/settings-hook.mjs +112 -0
  16. package/bin/tui.mjs +6 -3
  17. package/commands/autopilot.md +4 -4
  18. package/commands/cleanup.md +85 -39
  19. package/commands/deploy-info.md +11 -5
  20. package/commands/design-bench.md +1 -0
  21. package/commands/design-render-critique-loop.md +1 -0
  22. package/commands/design.md +1 -0
  23. package/commands/forge-stats.md +2 -1
  24. package/commands/issue.md +1 -1
  25. package/commands/optimize.md +1 -1
  26. package/commands/orchestrate.md +346 -34
  27. package/commands/quality-gate.md +168 -80
  28. package/commands/review-pr-agents.md +69 -45
  29. package/commands/review-pr.md +54 -6
  30. package/commands/scope.md +11 -3
  31. package/commands/security-audit.md +24 -16
  32. package/commands/sync-ecosystem.md +2 -2
  33. package/commands/work-on/build/architect.md +47 -3
  34. package/commands/work-on/build/context.md +36 -5
  35. package/commands/work-on/build/implement.md +16 -4
  36. package/commands/work-on/build/validate.md +54 -8
  37. package/commands/work-on/build.md +27 -9
  38. package/commands/work-on/close.md +131 -3
  39. package/commands/work-on/investigate.md +24 -1
  40. package/commands/work-on/review.md +24 -0
  41. package/commands/work-on-monolithic.md +1 -0
  42. package/commands/work-on.md +271 -11
  43. package/docs/BRAND.md +6 -2
  44. package/docs/CONFIG.md +39 -34
  45. package/docs/site/.vitepress/config.mjs +85 -0
  46. package/docs/site/annotations-explained.md +55 -0
  47. package/docs/site/command-learning-path.md +104 -0
  48. package/docs/site/command-reference.md +3 -0
  49. package/docs/site/getting-started.md +42 -13
  50. package/docs/site/index.md +1 -1
  51. package/docs/site/troubleshooting.md +208 -0
  52. package/docs/spec/forge-protocol-v1.md +768 -0
  53. package/docs/superpowers/plans/2026-07-03-cinematic-onboarding-tui.md +2339 -0
  54. package/docs/superpowers/plans/2026-07-03-durable-execution-engine.md +1223 -0
  55. package/docs/superpowers/specs/2026-07-03-cinematic-onboarding-tui-design.md +157 -0
  56. package/docs/superpowers/specs/2026-07-03-durable-execution-engine-design.md +194 -0
  57. package/examples/forgedock-demo/README.md +113 -0
  58. package/examples/forgedock-demo/bootstrap.sh +125 -0
  59. package/examples/forgedock-demo/issues/01-bug-delete-missing-auth.md +37 -0
  60. package/examples/forgedock-demo/issues/02-feature-filter-notes.md +37 -0
  61. package/examples/forgedock-demo/issues/03-refactor-router-table.md +33 -0
  62. package/examples/forgedock-demo/issues/04-perf-index-lookup.md +35 -0
  63. package/examples/forgedock-demo/issues/05-docs-api-reference.md +39 -0
  64. package/examples/forgedock-demo/labels.json +21 -0
  65. package/examples/forgedock-demo/package.json +16 -0
  66. package/examples/forgedock-demo/scripts/smoke.js +61 -0
  67. package/examples/forgedock-demo/src/auth.js +28 -0
  68. package/examples/forgedock-demo/src/db.js +66 -0
  69. package/examples/forgedock-demo/src/routes/notes.js +64 -0
  70. package/examples/forgedock-demo/src/server.js +79 -0
  71. package/package.json +13 -3
  72. package/scripts/verify-env-vars.sh +18 -2
  73. package/scripts/verify-host-headers.sh +4 -4
  74. package/scripts/verify-route-registration.sh +2 -2
  75. package/scripts/worktree-lifecycle.sh +202 -0
  76. package/templates/forge.yaml.minimal +44 -0
@@ -323,3 +323,98 @@ export async function detectConfig(cwd = process.cwd()) {
323
323
  meta: { remoteDetected },
324
324
  };
325
325
  }
326
+
327
+ // ---------------------------------------------------------------------------
328
+ // Minimal forge.yaml template builder
329
+ // ---------------------------------------------------------------------------
330
+
331
+ /**
332
+ * Escape a value for embedding inside a YAML double-quoted scalar.
333
+ *
334
+ * Backslash MUST be escaped first to avoid double-escaping an already-escaped
335
+ * quote. This mirrors the escaping applied by the full-config generator in
336
+ * forgedock.mjs and prevents Windows paths (which contain `\`) from corrupting
337
+ * the emitted YAML. (Ref: forge#810 — init() did not escape backslashes.)
338
+ *
339
+ * @param {string} value
340
+ * @returns {string}
341
+ */
342
+ function escapeYamlScalar(value) {
343
+ return String(value).replace(/\\/g, "\\\\").replace(/"/g, '\\"');
344
+ }
345
+
346
+ /**
347
+ * Build a minimal forge.yaml document containing ONLY the three required
348
+ * sections — project, paths, branches — with no commented optional blocks.
349
+ *
350
+ * This is the `npx forgedock init --minimal` output. It is intentionally
351
+ * complete enough to pass `npx forgedock doctor` (which requires project,
352
+ * paths, AND branches) and to drive `/work-on` (which needs
353
+ * paths.worktree_base for git worktrees) — while staying ~20 lines instead of
354
+ * the ~200-line full template. Optional sections (repos, project_board,
355
+ * review, verification, …) fall back to sensible defaults and can be added
356
+ * later from forge.yaml.example / docs/CONFIG.md.
357
+ *
358
+ * Pure: returns a string, performs no I/O.
359
+ *
360
+ * @param {object} opts
361
+ * @param {string} opts.projectName - Human-readable project name.
362
+ * @param {string} opts.owner - GitHub org/user that owns the repo.
363
+ * @param {string} opts.repo - Repository name (no owner prefix).
364
+ * @param {string} [opts.description] - One-line project description (omitted if empty).
365
+ * @param {string} opts.root - Absolute path to the project root.
366
+ * @param {string} opts.worktreeBase - Directory where git worktrees are created.
367
+ * @param {string} opts.defaultBranch - Default branch (e.g. main).
368
+ * @param {string} opts.stagingBranch - Staging branch for fast-lane PRs.
369
+ * @returns {string} The minimal forge.yaml content.
370
+ */
371
+ export function buildMinimalForgeYaml({
372
+ projectName,
373
+ owner,
374
+ repo,
375
+ description = "",
376
+ root,
377
+ worktreeBase,
378
+ defaultBranch,
379
+ stagingBranch,
380
+ }) {
381
+ const e = escapeYamlScalar;
382
+ const descLine = description
383
+ ? `\n description: "${e(description)}"`
384
+ : "";
385
+
386
+ return `# forge.yaml — ForgeDock Configuration (minimal)
387
+ #
388
+ # Generated by: npx forgedock init --minimal
389
+ #
390
+ # Only project, paths, and branches are required — everything else is optional
391
+ # and falls back to sensible defaults. Start here and add sections as you need
392
+ # them. See forge.yaml.example and docs/CONFIG.md for the full reference.
393
+
394
+ # =============================================================================
395
+ # PROJECT (REQUIRED)
396
+ # =============================================================================
397
+
398
+ project:
399
+ name: "${e(projectName)}"
400
+ owner: "${e(owner)}"
401
+ repo: "${e(repo)}"${descLine}
402
+
403
+ # =============================================================================
404
+ # PATHS (REQUIRED)
405
+ # =============================================================================
406
+
407
+ paths:
408
+ root: "${e(root)}"
409
+ worktree_base: "${e(worktreeBase)}"
410
+
411
+ # =============================================================================
412
+ # BRANCHES (REQUIRED)
413
+ # =============================================================================
414
+
415
+ branches:
416
+ default: "${e(defaultBranch)}"
417
+ staging: "${e(stagingBranch)}"
418
+ feature_pattern: "milestone/{slug}"
419
+ `;
420
+ }