@harness-engineering/cli 3.1.0 → 4.0.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 (143) hide show
  1. package/dist/agents/personas/harness-pm.yaml +33 -0
  2. package/dist/agents/skills/claude-code/acceptance-eval/SKILL.md +92 -0
  3. package/dist/agents/skills/claude-code/acceptance-eval/skill.yaml +54 -0
  4. package/dist/agents/skills/claude-code/harness-brainstorming/SKILL.md +46 -38
  5. package/dist/agents/skills/claude-code/harness-brainstorming/skill.yaml +1 -0
  6. package/dist/agents/skills/claude-code/harness-code-review/SKILL.md +10 -11
  7. package/dist/agents/skills/claude-code/harness-execution/SKILL.md +24 -26
  8. package/dist/agents/skills/claude-code/harness-integration/SKILL.md +21 -19
  9. package/dist/agents/skills/claude-code/harness-maintenance-pipeline/SKILL.md +173 -0
  10. package/dist/agents/skills/claude-code/harness-maintenance-pipeline/skill.yaml +43 -0
  11. package/dist/agents/skills/claude-code/harness-onboarding/SKILL.md +2 -0
  12. package/dist/agents/skills/claude-code/harness-planning/SKILL.md +17 -40
  13. package/dist/agents/skills/claude-code/harness-pulse/SKILL.md +1 -1
  14. package/dist/agents/skills/claude-code/harness-roadmap/SKILL.md +17 -0
  15. package/dist/agents/skills/claude-code/harness-roadmap-pilot/SKILL.md +8 -0
  16. package/dist/agents/skills/claude-code/harness-verification/SKILL.md +9 -12
  17. package/dist/agents/skills/claude-code/initialize-harness-project/SKILL.md +112 -126
  18. package/dist/agents/skills/claude-code/outcome-eval/SKILL.md +1 -0
  19. package/dist/agents/skills/claude-code/product-advisor/SKILL.md +202 -0
  20. package/dist/agents/skills/claude-code/product-advisor/skill.yaml +74 -0
  21. package/dist/agents/skills/codex/acceptance-eval/SKILL.md +92 -0
  22. package/dist/agents/skills/codex/acceptance-eval/skill.yaml +54 -0
  23. package/dist/agents/skills/codex/harness-brainstorming/SKILL.md +46 -38
  24. package/dist/agents/skills/codex/harness-brainstorming/skill.yaml +1 -0
  25. package/dist/agents/skills/codex/harness-code-review/SKILL.md +10 -11
  26. package/dist/agents/skills/codex/harness-execution/SKILL.md +24 -26
  27. package/dist/agents/skills/codex/harness-integration/SKILL.md +21 -19
  28. package/dist/agents/skills/codex/harness-maintenance-pipeline/SKILL.md +173 -0
  29. package/dist/agents/skills/codex/harness-maintenance-pipeline/skill.yaml +43 -0
  30. package/dist/agents/skills/codex/harness-onboarding/SKILL.md +2 -0
  31. package/dist/agents/skills/codex/harness-planning/SKILL.md +17 -40
  32. package/dist/agents/skills/codex/harness-pulse/SKILL.md +1 -1
  33. package/dist/agents/skills/codex/harness-roadmap/SKILL.md +17 -0
  34. package/dist/agents/skills/codex/harness-roadmap-pilot/SKILL.md +8 -0
  35. package/dist/agents/skills/codex/harness-verification/SKILL.md +9 -12
  36. package/dist/agents/skills/codex/initialize-harness-project/SKILL.md +112 -126
  37. package/dist/agents/skills/codex/outcome-eval/SKILL.md +1 -0
  38. package/dist/agents/skills/codex/product-advisor/SKILL.md +202 -0
  39. package/dist/agents/skills/codex/product-advisor/skill.yaml +74 -0
  40. package/dist/agents/skills/cursor/acceptance-eval/SKILL.md +92 -0
  41. package/dist/agents/skills/cursor/acceptance-eval/skill.yaml +54 -0
  42. package/dist/agents/skills/cursor/harness-brainstorming/SKILL.md +46 -38
  43. package/dist/agents/skills/cursor/harness-brainstorming/skill.yaml +1 -0
  44. package/dist/agents/skills/cursor/harness-code-review/SKILL.md +10 -11
  45. package/dist/agents/skills/cursor/harness-execution/SKILL.md +24 -26
  46. package/dist/agents/skills/cursor/harness-integration/SKILL.md +21 -19
  47. package/dist/agents/skills/cursor/harness-maintenance-pipeline/SKILL.md +173 -0
  48. package/dist/agents/skills/cursor/harness-maintenance-pipeline/skill.yaml +43 -0
  49. package/dist/agents/skills/cursor/harness-onboarding/SKILL.md +2 -0
  50. package/dist/agents/skills/cursor/harness-planning/SKILL.md +17 -40
  51. package/dist/agents/skills/cursor/harness-pulse/SKILL.md +1 -1
  52. package/dist/agents/skills/cursor/harness-roadmap/SKILL.md +17 -0
  53. package/dist/agents/skills/cursor/harness-roadmap-pilot/SKILL.md +8 -0
  54. package/dist/agents/skills/cursor/harness-verification/SKILL.md +9 -12
  55. package/dist/agents/skills/cursor/initialize-harness-project/SKILL.md +112 -126
  56. package/dist/agents/skills/cursor/outcome-eval/SKILL.md +1 -0
  57. package/dist/agents/skills/cursor/product-advisor/SKILL.md +202 -0
  58. package/dist/agents/skills/cursor/product-advisor/skill.yaml +74 -0
  59. package/dist/agents/skills/gemini-cli/acceptance-eval/SKILL.md +92 -0
  60. package/dist/agents/skills/gemini-cli/acceptance-eval/skill.yaml +54 -0
  61. package/dist/agents/skills/gemini-cli/harness-brainstorming/SKILL.md +46 -38
  62. package/dist/agents/skills/gemini-cli/harness-brainstorming/skill.yaml +1 -0
  63. package/dist/agents/skills/gemini-cli/harness-code-review/SKILL.md +10 -11
  64. package/dist/agents/skills/gemini-cli/harness-execution/SKILL.md +24 -26
  65. package/dist/agents/skills/gemini-cli/harness-integration/SKILL.md +21 -19
  66. package/dist/agents/skills/gemini-cli/harness-maintenance-pipeline/SKILL.md +173 -0
  67. package/dist/agents/skills/gemini-cli/harness-maintenance-pipeline/skill.yaml +43 -0
  68. package/dist/agents/skills/gemini-cli/harness-onboarding/SKILL.md +2 -0
  69. package/dist/agents/skills/gemini-cli/harness-planning/SKILL.md +17 -40
  70. package/dist/agents/skills/gemini-cli/harness-pulse/SKILL.md +1 -1
  71. package/dist/agents/skills/gemini-cli/harness-roadmap/SKILL.md +17 -0
  72. package/dist/agents/skills/gemini-cli/harness-roadmap-pilot/SKILL.md +8 -0
  73. package/dist/agents/skills/gemini-cli/harness-verification/SKILL.md +9 -12
  74. package/dist/agents/skills/gemini-cli/initialize-harness-project/SKILL.md +112 -126
  75. package/dist/agents/skills/gemini-cli/outcome-eval/SKILL.md +1 -0
  76. package/dist/agents/skills/gemini-cli/product-advisor/SKILL.md +202 -0
  77. package/dist/agents/skills/gemini-cli/product-advisor/skill.yaml +74 -0
  78. package/dist/agents/skills/tests/interaction-channel.test.ts +64 -0
  79. package/dist/{agents-md-YYCLGMBF.js → agents-md-VJLYEH2S.js} +4 -4
  80. package/dist/{analyzer-V633GUHY-MBCQWKDU.js → analyzer-V633GUHY-OV335HGM.js} +2 -2
  81. package/dist/{architecture-5KPP4ID4.js → architecture-YQH2NYXY.js} +5 -5
  82. package/dist/{assess-project-B6ENHUAU.js → assess-project-KOTAPAHD.js} +1 -1
  83. package/dist/bin/harness-mcp.js +19 -18
  84. package/dist/bin/harness.js +31 -29
  85. package/dist/{check-phase-gate-REG3HWYC.js → check-phase-gate-CHU2E3OU.js} +6 -5
  86. package/dist/{chunk-UBTMPO5H.js → chunk-36GQREOE.js} +3 -3
  87. package/dist/{chunk-CLI4K2CH.js → chunk-4U5LDFCY.js} +1 -1
  88. package/dist/{chunk-IF3JK3G5.js → chunk-4VXFZSYF.js} +1 -1
  89. package/dist/{chunk-TE5YHHHZ.js → chunk-5RSXUAMN.js} +1 -1
  90. package/dist/{chunk-YF3AY6KS.js → chunk-6SCYTIF4.js} +6 -6
  91. package/dist/{chunk-N55WOGN3.js → chunk-6YFHUIGT.js} +1 -1
  92. package/dist/{chunk-RGQXHCCH.js → chunk-7PJCK7UE.js} +8 -8
  93. package/dist/{chunk-LMZ2JTNP.js → chunk-7TIJXWG3.js} +5 -9
  94. package/dist/chunk-AAUY53CC.js +61 -0
  95. package/dist/{chunk-XEOSSKIB.js → chunk-AX5KGRM6.js} +48 -4
  96. package/dist/{chunk-FUH4J43G.js → chunk-E5EW5HVJ.js} +2 -2
  97. package/dist/{chunk-C2ZGWMTN.js → chunk-EYMOPFSD.js} +2 -2
  98. package/dist/{chunk-FL5SLUKZ.js → chunk-GHBFNLV2.js} +2374 -1095
  99. package/dist/{chunk-HIPBU2Q4.js → chunk-I3CGCZJF.js} +9 -9
  100. package/dist/{chunk-OQFEFVIN.js → chunk-JPVOI7GP.js} +7 -7
  101. package/dist/{chunk-DNX35Q5K.js → chunk-M7F2PPN3.js} +3 -3
  102. package/dist/{chunk-A65QO5KN.js → chunk-MMLQPHZ5.js} +3032 -1166
  103. package/dist/{chunk-ERZCC5VH.js → chunk-OQ6KOQEV.js} +9 -9
  104. package/dist/{chunk-ZOUJP3EY.js → chunk-RG3TNIUB.js} +1659 -808
  105. package/dist/{chunk-PZX2Y3RV.js → chunk-SDMV4QHM.js} +5 -5
  106. package/dist/{chunk-XZ2Q4UTW.js → chunk-SEA2PFVI.js} +1 -1
  107. package/dist/{chunk-TCVQVHEF.js → chunk-T746REAE.js} +1 -1
  108. package/dist/{chunk-6B6UN6SG.js → chunk-UTJJJDNN.js} +11 -1
  109. package/dist/{chunk-BXKNWSG4.js → chunk-UWVMJEUJ.js} +1 -1
  110. package/dist/{chunk-WWACIIBA.js → chunk-V3ZQUCRH.js} +1 -1
  111. package/dist/{chunk-27AJKSQY.js → chunk-WBVCN35T.js} +1 -1
  112. package/dist/{chunk-PP6ZRL5T.js → chunk-WZJR6SOI.js} +536 -422
  113. package/dist/{chunk-YQAFKOOL.js → chunk-XAVMTAUT.js} +2 -2
  114. package/dist/chunk-Y6SUQC32.js +9 -0
  115. package/dist/{chunk-ZRKFDE6M.js → chunk-YANR2RL7.js} +1 -1
  116. package/dist/{chunk-2N4OENGE.js → chunk-YYFSFSB3.js} +1 -1
  117. package/dist/{ci-workflow-JEYYCBOC.js → ci-workflow-HO4WKGNG.js} +4 -4
  118. package/dist/{dist-3HW4LCHE.js → dist-6D2F2J57.js} +73 -17
  119. package/dist/{dist-OWHMNL4W.js → dist-DWBTZXR5.js} +1 -1
  120. package/dist/{docs-YRMW7UED.js → docs-FP47JONV.js} +5 -5
  121. package/dist/{engine-E7H5U3AC.js → engine-YUA6IYOG.js} +4 -4
  122. package/dist/{entropy-3JBKCGJJ.js → entropy-DBW2INZU.js} +4 -4
  123. package/dist/{feedback-U6VJ6AUJ.js → feedback-BPHADTRQ.js} +1 -1
  124. package/dist/{generate-agent-definitions-S2FRZF4Y.js → generate-agent-definitions-KPVGBGDY.js} +6 -6
  125. package/dist/{glob-helper-GLZAURJC.js → glob-helper-VR6UCZZB.js} +1 -1
  126. package/dist/{graph-loader-HHXN5FLP.js → graph-loader-STFGYKZH.js} +1 -1
  127. package/dist/hooks/adoption-tracker.js +6 -5
  128. package/dist/hooks/protect-config.js +15 -5
  129. package/dist/{index-builder-3AOQ3ZII.js → index-builder-52IJJHJC.js} +2 -2
  130. package/dist/index.d.ts +8 -8
  131. package/dist/index.js +31 -29
  132. package/dist/{loader-RGQJYERV.js → loader-QOJQ6NZM.js} +4 -4
  133. package/dist/{mcp-NDTFZXWF.js → mcp-ZPX6O767.js} +21 -20
  134. package/dist/{performance-FPWKC4CN.js → performance-FXYTGJGQ.js} +5 -5
  135. package/dist/{review-pipeline-WUHG7PHO.js → review-pipeline-2TFQ5OAE.js} +4 -4
  136. package/dist/{runtime-Q3ORD7LW.js → runtime-XK6ZCHKE.js} +4 -4
  137. package/dist/{scan-P7YFKB77.js → scan-IYSVRPD2.js} +1 -1
  138. package/dist/{security-JDHTRBGC.js → security-4W2P5ZGI.js} +1 -1
  139. package/dist/{skill-executor-MOCUIAYS.js → skill-executor-BGUCAVBU.js} +2 -2
  140. package/dist/state-events-ECQAIZLU.js +25 -0
  141. package/dist/{validate-G3LKBOYA.js → validate-64KTEGIE.js} +5 -5
  142. package/dist/{validate-cross-check-4ITA72DF.js → validate-cross-check-J5PVGICB.js} +4 -4
  143. package/package.json +7 -7
@@ -1,6 +1,6 @@
1
1
  # Initialize Harness Project
2
2
 
3
- > Scaffold a new harness-compliant project, migrate an existing project to the next adoption level, or bootstrap an existing project that just got the harness marketplace plugin installed (no `harness setup`). Assess current state, scaffold or migrate, configure, validate, instrument (baselines / telemetry / Tier-0 integrations), and finalize.
3
+ > Scaffold a new harness-compliant project, migrate an existing project to the next adoption level, or bootstrap an existing project that just got the harness marketplace plugin installed (no `harness setup`). Ground the project in a strategic anchor (`STRATEGY.md`) first, then assess current state, scaffold or migrate, configure, validate, instrument (baselines / telemetry / Tier-0 integrations), and finalize.
4
4
 
5
5
  ## When to Use
6
6
 
@@ -31,6 +31,52 @@ Detect plugin-only state by checking whether `harness` resolves on PATH (`comman
31
31
 
32
32
  **Prompt the human in plain text** — every framework confirmation, migration check, and telemetry-identity question in this skill is plain text only. Do not elevate to `AskUserQuestion`: the framework list (~10 options) exceeds its 4-option cap and natural headers like "Confirm framework" exceed its 12-char cap, rendering the call as ERR.
33
33
 
34
+ ### Phase 0: GROUND — Capture the Strategic Anchor
35
+
36
+ Run this before anything else — it is the first thing init does and the first question it asks the human.
37
+ Offer to capture `STRATEGY.md`, the durable upstream product anchor read by `harness-brainstorming`,
38
+ `harness-ideate`, and `harness-roadmap-pilot`. _Think first (strategy), build second (scaffold)._
39
+
40
+ Ask in plain text in your reply, same as the design-system step (Phase 3 step 5b) — never via `emit_interaction`, `AskUserQuestion`, or any tool (the human won't see a tool-routed prompt; only plain text reaches them across Claude Code, Cursor, Codex, and Gemini CLI). State your recommendation, then STOP and wait for the human's reply:
41
+
42
+ ```markdown
43
+ ### Capture strategic anchor (STRATEGY.md) now?
44
+
45
+ | | A) Yes — run the strategy interview | B) No — this project does not need a strategy doc | C) Not sure yet |
46
+ | ---------- | -------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------- |
47
+ | **Pros** | Grounds brainstorm/ideate/roadmap-pilot in product-level context; durable across milestones and phases (peer of README.md) | Permanent decline recorded; init does not re-ask on rerun | Decision deferred without commitment; can run /harness:strategy later |
48
+ | **Cons** | Adds an interview (10-20 minutes) to init | Re-running init will not re-offer; user must run /harness:strategy manually | No decline flag set; init may re-offer on rerun |
49
+ | **Risk** | Low | Low | Low |
50
+ | **Effort** | Medium | Low | Low |
51
+
52
+ **Recommendation:** A) Yes — run the strategy interview (confidence: medium) — strategy grounds brainstorm/ideate/roadmap-pilot; value compounds as the project grows.
53
+ ```
54
+
55
+ Before prompting, check whether `STRATEGY.md` already exists at repo root. Three cases:
56
+
57
+ - **Absent (most common on init).** Present the prompt above. Apply the answer:
58
+ - **Yes:** delegate to `harness-strategy` (which routes via its own Phase 0 to the first-run interview). It writes a valid `STRATEGY.md` at repo root, doc-validated via the `write_strategy` / `validate_strategy` MCP tools. Do **not** run a project-level `harness validate` here — `harness.config.json` does not exist until SCAFFOLD. When `harness-strategy` completes, proceed to Phase 1.
59
+ - **No:** record the decline in working memory. `Phase 3: CONFIGURE` step 0 persists `init.strategy.declined: true` to `.harness/state.json` after SCAFFOLD creates it. Do **not** touch `.harness/` here — it does not exist yet.
60
+ - **Not sure:** record nothing. `/harness:strategy` remains available standalone, and a future re-run of init will re-offer.
61
+
62
+ - **Present and valid.** Skip the prompt silently. Surface a one-line note: `STRATEGY.md detected — downstream skills will pick it up as grounding`. No decline is recorded.
63
+
64
+ - **Present but invalid.** Surface the validation error via the `validate_strategy` MCP tool (the MCP server already has `@harness-engineering/core` loaded, so this resolves even for plugin-only adopters with no `node_modules`). Offer three paths (mirror `harness-strategy` Phase 0):
65
+ - **a) Fix now via `/harness:strategy` update** → delegate to `harness-strategy` with the broken section pre-selected.
66
+ - **b) Move file to `STRATEGY.md.bak.<YYYY-MM-DD-HHmm>` and run a fresh interview** → rename, then delegate to `harness-strategy` Phase 1.
67
+ - **c) Ignore for this init and proceed** → record the decline (persisted in `Phase 3: CONFIGURE` step 0) and continue. Init does NOT block on a present-but-invalid `STRATEGY.md`.
68
+
69
+ **Guards:**
70
+
71
+ - Phase 0 runs for **all** project shapes, including test suites — strategy is offered before the Phase 1
72
+ step 5 test-suite classification and the step-6 dispatch, identical in reach to the legacy step.
73
+ - A present-valid (skip) or present-invalid (offer fix) `STRATEGY.md` is the migration path for an existing
74
+ strategy doc — distinct from the `.harness/`-based adoption-level classification in `Phase 1: ASSESS`,
75
+ which Phase 0 must not pre-empt.
76
+ - **No / Not-sure proceeds immediately into `Phase 1: ASSESS`. Phase 0 never blocks init.**
77
+
78
+ This mirrors the ask-once-record-the-answer pattern also used by the i18n and design-system prompts in Phase 3.
79
+
34
80
  ### Phase 1: ASSESS — Determine Current State
35
81
 
36
82
  1. **Check for existing harness configuration.** Look for `.harness/` directory, `AGENTS.md`, `harness.config.json`, and any skill definitions. Their presence determines whether this is a new project or a migration.
@@ -82,6 +128,14 @@ Detect plugin-only state by checking whether `harness` resolves on PATH (`comman
82
128
 
83
129
  ### Phase 3: CONFIGURE — Customize for the Project
84
130
 
131
+ 0. **Persist the Phase 0 grounding decision.** SCAFFOLD has now created `.harness/`. If the user **declined**
132
+ the strategic anchor in `Phase 0: GROUND` (answered "No", or chose "ignore" on a present-but-invalid
133
+ `STRATEGY.md`), write `init.strategy.declined: true` to `.harness/state.json` (merge into existing JSON;
134
+ do not clobber). If the user answered "Yes" or "Not sure" in Phase 0, write nothing. This is the deferred
135
+ half of the Phase 0 offer: Phase 0 captures the answer, this step records the decline once `.harness/`
136
+ exists — so the relocation never fabricates `.harness/` early and never misclassifies a new project as a
137
+ migration in `Phase 1: ASSESS`.
138
+
85
139
  1. **Configure personas.** Run `harness persona generate` to create persona definitions based on the project's stack and team structure. Personas define how agents should behave in this project — coding style, communication preferences, constraint strictness.
86
140
 
87
141
  2. **Customize AGENTS.md.** The generated template needs project-specific content:
@@ -100,39 +154,21 @@ Detect plugin-only state by checking whether `harness` resolves on PATH (`comman
100
154
  - **No:** Set `i18n.enabled: false` in `harness.config.json`. The `harness-i18n-process` skill will still fire gentle prompts for unconfigured projects when features touch user-facing strings.
101
155
  - **Not sure:** Skip i18n configuration entirely. Do not set `i18n.enabled`. The project can enable i18n later by running `harness-i18n-workflow` directly.
102
156
 
103
- 5b. **Configure design system (non-test-suite projects).** Ask: "Will this project have a UI requiring a design system?" Mirror the i18n step's three-way response shape. Use `emit_interaction`:
104
-
105
- ```json
106
- emit_interaction({
107
- type: "question",
108
- question: {
109
- text: "Will this project have a UI requiring a design system?",
110
- options: [
111
- {
112
- label: "Yes capture design intent now",
113
- pros: ["Records platforms in harness.config.json", "harness-design-system fires automatically on first design-touching feature"],
114
- cons: ["One extra follow-up question (which platforms)"],
115
- risk: "low",
116
- effort: "low"
117
- },
118
- {
119
- label: "No — this project has no UI",
120
- pros: ["No future design nudges", "Permanent decline recorded"],
121
- cons: ["Re-running init is required if a UI is added later"],
122
- risk: "low",
123
- effort: "low"
124
- },
125
- {
126
- label: "Not sure yet",
127
- pros: ["Decision deferred without commitment", "Can run harness-design-system later"],
128
- cons: ["No design.enabled flag set; on_new_feature will prompt later"],
129
- risk: "low",
130
- effort: "low"
131
- }
132
- ],
133
- recommendation: { optionIndex: 0, reason: "Most product/service projects benefit from a centralized design system", confidence: "medium" }
134
- }
135
- })
157
+ 5b. **Configure design system (non-test-suite projects).** Mirror the i18n step's three-way response shape.
158
+
159
+ **Ask directly in your reply. Do NOT route this question through `emit_interaction`, `AskUserQuestion`, or any tool.** `emit_interaction` records the prompt but does not display it to the human — the client collapses the call to "Called harness" and the rendered text only returns to the model, so the human sees nothing. `AskUserQuestion` is Claude-Code-only and caps headers at 12 chars / 4 options. Plain text in your own message is the only channel that reliably reaches the human across every tool (Claude Code, Cursor, Codex, Gemini CLI). State your recommendation, then STOP and wait for the human's reply:
160
+
161
+ ```markdown
162
+ ### Will this project have a UI requiring a design system?
163
+
164
+ | | A) Yes — capture design intent now | B) No — this project has no UI | C) Not sure yet |
165
+ |---|---|---|---|
166
+ | **Pros** | Records platforms in harness.config.json; harness-design-system fires automatically on first design-touching feature | No future design nudges; permanent decline recorded | Decision deferred without commitment; can run harness-design-system later |
167
+ | **Cons** | One extra follow-up question (which platforms) | Re-running init is required if a UI is added later | No design.enabled flag set; on_new_feature will prompt later |
168
+ | **Risk** | Low | Low | Low |
169
+ | **Effort** | Low | Low | Low |
170
+
171
+ **Recommendation:** A) Yes — capture design intent now (confidence: medium) — most product/service projects benefit from a centralized design system.
136
172
  ```
137
173
 
138
174
  Based on the answer:
@@ -142,60 +178,6 @@ Detect plugin-only state by checking whether `harness` resolves on PATH (`comman
142
178
 
143
179
  **Skip this step entirely if Phase 1 step 5 classified the project as a test suite.** Test-suite projects will be dispatched at step 6 below to `initialize-test-suite-project` and have no UI to govern.
144
180
 
145
- 5c. **Capture strategic anchor (all levels).** Offer a three-way prompt for `STRATEGY.md` — the durable upstream product anchor read by `harness-brainstorming`, `harness-ideate`, and `harness-roadmap-pilot`. Use `emit_interaction`:
146
-
147
- ```json
148
- emit_interaction({
149
- type: "question",
150
- question: {
151
- text: "Capture strategic anchor (STRATEGY.md) now?",
152
- options: [
153
- {
154
- label: "Yes — run the strategy interview",
155
- pros: [
156
- "Grounds brainstorm/ideate/roadmap-pilot in product-level context",
157
- "Durable across milestones and phases (peer of README.md)"
158
- ],
159
- cons: ["Adds an interview (10-20 minutes) to init"],
160
- risk: "low",
161
- effort: "medium"
162
- },
163
- {
164
- label: "No — this project does not need a strategy doc",
165
- pros: ["Permanent decline recorded; init does not re-ask on rerun"],
166
- cons: ["Re-running init will not re-offer; user must run /harness:strategy manually"],
167
- risk: "low",
168
- effort: "low"
169
- },
170
- {
171
- label: "Not sure yet",
172
- pros: ["Decision deferred without commitment", "Can run /harness:strategy later"],
173
- cons: ["No decline flag set; init may re-offer on rerun"],
174
- risk: "low",
175
- effort: "low"
176
- }
177
- ],
178
- recommendation: { optionIndex: 0, reason: "Strategy grounds brainstorm/ideate/roadmap-pilot — value compounds as the project grows", confidence: "medium" }
179
- }
180
- })
181
- ```
182
-
183
- Before prompting, check whether `STRATEGY.md` already exists at repo root. Three cases:
184
-
185
- - **Absent (most common on init).** Present the prompt above. Apply the answer:
186
- - **Yes:** delegate to `harness-strategy` (which routes via its own Phase 0 to the first-run interview). When `harness-strategy` completes, continue with step 6.
187
- - **No:** write `init.strategy.declined: true` to `.harness/state.json` (merge into existing JSON; do not clobber). This is the explicit decline location; re-running init detects the flag and skips the prompt.
188
- - **Not sure:** no state write. `/harness:strategy` remains available standalone, and a future re-run of init will re-offer.
189
-
190
- - **Present and valid.** Skip the prompt silently. Surface a one-line note: `STRATEGY.md detected — downstream skills will pick it up as grounding`. No `init.strategy.declined` write.
191
-
192
- - **Present but invalid.** Surface the validation error verbatim (run a Node one-liner that imports `validateStrategy` from `@harness-engineering/core` and pipes the error). Offer three paths (mirror `harness-strategy` Phase 0):
193
- - **a) Fix now via `/harness:strategy` update** → delegate to `harness-strategy` with the broken section pre-selected.
194
- - **b) Move file to `STRATEGY.md.bak.<YYYY-MM-DD-HHmm>` and run a fresh interview** → rename, then delegate to `harness-strategy` Phase 1.
195
- - **c) Ignore for this init and proceed** → record `init.strategy.declined: true` and continue. Init does NOT block on present-but-invalid STRATEGY.md.
196
-
197
- Mirror the i18n / design-system pattern: ask once, record the answer, never silently skip.
198
-
199
181
  6. **Test-suite projects only — dispatch to `initialize-test-suite-project`.** If Phase 1 step 5 classified this as a test suite, invoke `initialize-test-suite-project` now and let it own archetype selection, shared-library decision, layer variants (A self-contained vs B consumer), ESLint flat-config fix, tag taxonomy, reporter stack, custom report, and the "prove the guards fire" verification. Return here for Phase 4 step 4+ (knowledge graph, roadmap, commit). Product and service projects skip this step entirely.
200
182
 
201
183
  ### Phase 4: VALIDATE — Confirm Everything Works
@@ -275,32 +257,21 @@ This phase closes the parity gap that the marketplace plugin install does not co
275
257
 
276
258
  ### Phase 6: FINALIZE — Roadmap and Commit
277
259
 
278
- 1. **Set up project roadmap.** Ask: "Set up a project roadmap now? `docs/roadmap.md` tracks features, milestones, and status across your specs and plans." Use `emit_interaction`:
279
-
280
- ```json
281
- emit_interaction({
282
- type: "question",
283
- question: {
284
- text: "Set up a project roadmap now?",
285
- options: [
286
- {
287
- label: "Yes create docs/roadmap.md now",
288
- pros: ["Roadmap visible from day one", "Future specs auto-discovered on next sync"],
289
- cons: ["Adds one file to the initial commit"],
290
- risk: "low",
291
- effort: "low"
292
- },
293
- {
294
- label: "No — skip for now",
295
- pros: ["Smaller initial footprint"],
296
- cons: ["Run `/harness:roadmap --create` later when ready"],
297
- risk: "low",
298
- effort: "low"
299
- }
300
- ],
301
- recommendation: { optionIndex: 0, reason: "Validation has just passed — a tangible 'project works' signal is the right moment to introduce planning artifacts", confidence: "medium" }
302
- }
303
- })
260
+ 1. **Set up project roadmap.** `docs/roadmap.md` tracks features, milestones, and status across your specs and plans.
261
+
262
+ **Ask in plain text in your reply, same as Phase 0: GROUND and Phase 3 step 5b — never via `emit_interaction`, `AskUserQuestion`, or any tool (the human won't see a tool-routed prompt; only plain text reaches them across Claude Code, Cursor, Codex, and Gemini CLI).** State your recommendation, then STOP and wait for the human's reply:
263
+
264
+ ```markdown
265
+ ### Set up a project roadmap now?
266
+
267
+ | | A) Yes — create docs/roadmap.md now | B) No — skip for now |
268
+ | ---------- | ----------------------------------------------------------------------- | ------------------------------------------------ |
269
+ | **Pros** | Roadmap visible from day one; future specs auto-discovered on next sync | Smaller initial footprint |
270
+ | **Cons** | Adds one file to the initial commit | Run `/harness:roadmap --create` later when ready |
271
+ | **Risk** | Low | Low |
272
+ | **Effort** | Low | Low |
273
+
274
+ **Recommendation:** A) Yes — create docs/roadmap.md now (confidence: medium) — validation has just passed; a tangible "project works" signal is the right moment to introduce planning artifacts.
304
275
  ```
305
276
 
306
277
  Based on the answer:
@@ -325,8 +296,8 @@ This phase closes the parity gap that the marketplace plugin install does not co
325
296
  - **`harness integrations list` / `harness integrations add <name>`** — Phase 5 step 6. Lists Tier-0 (zero-config) and Tier-1 (API-key) MCP integrations and adds them to project `.mcp.json`.
326
297
  - **`harness-i18n-workflow configure` + `harness-i18n-workflow scaffold`** — Invoked during Phase 3 if the project will support multiple languages. Sets up i18n configuration and translation file structure.
327
298
  - **`harness-design-system` (deferred via `on_new_feature`)** — Phase 3 step 5b records `design.enabled` + `design.platforms` in `harness.config.json` but does NOT run the full design-system skill. Token generation defers to the first design-touching feature, where `harness-design-system` fires via `on_new_feature` and reads `design.enabled` to decide whether to proceed.
328
- - **`harness-strategy`** — Phase 3 step 5c delegates to this skill on "Yes". The skill conducts a first-run interview (pushback rules with a 2-round cap per section) and writes a valid `STRATEGY.md` at repo root via `writeStrategyDoc`. On "No" init writes `init.strategy.declined: true` to `.harness/state.json`. On "not sure" no state is written; the user can run `/harness:strategy` standalone. When `STRATEGY.md` already exists and is valid the prompt is skipped; when present-but-invalid the user gets the three-path repair offer.
329
- - **`validateStrategy`** `@harness-engineering/core` helper used by Phase 3 step 5c to detect present-but-invalid `STRATEGY.md`. Invoked through a Node one-liner so init does not require importing core directly.
299
+ - **`harness-strategy`** — Phase 0: GROUND delegates to this skill on "Yes". The skill conducts a first-run interview (pushback rules with a 2-round cap per section) and writes a valid `STRATEGY.md` at repo root via `writeStrategyDoc`. On "No" the decline is recorded in working memory and persisted as `init.strategy.declined: true` to `.harness/state.json` by Phase 3: CONFIGURE step 0 (after SCAFFOLD). On "not sure" no state is written; the user can run `/harness:strategy` standalone. When `STRATEGY.md` already exists and is valid the prompt is skipped; when present-but-invalid the user gets the three-path repair offer.
300
+ - **`validate_strategy` / `write_strategy` MCP tools** — used by Phase 0: GROUND to doc-validate `STRATEGY.md` and to detect a present-but-invalid one. Routed through the MCP server (which already has `@harness-engineering/core` loaded) so init does not require local `node_modules` or a `node -e` one-liner.
330
301
  - **`initialize-test-suite-project`** — Sub-skill. Invoked during Phase 3 step 6 when Phase 1 step 5 classified the project as a test suite. Owns archetype selection, shared-library vs in-repo decision, layer variants, tag taxonomy, reporter stack, custom report, and "prove the guards fire" verification.
331
302
  - **`harness-roadmap` skill** — Phase 6 step 1 invokes this skill (or `/harness:roadmap --create`) when the user opts in to creating `docs/roadmap.md`. The `manage_roadmap` MCP tool does not create roadmaps; it manages entries in an existing one.
332
303
  - **`manage_roadmap` MCP tool** — Phase 6 step 1, when `design.enabled === true`, calls `manage_roadmap` with `action: add` to insert a `planned` "Set up design system" item under milestone `Intake` with a summary describing the deferred work.
@@ -343,7 +314,7 @@ This phase closes the parity gap that the marketplace plugin install does not co
343
314
  - All generated files are committed in a single atomic commit
344
315
  - i18n configuration is set if the human chose to enable it during init
345
316
  - For non-test-suite projects, the design-system question was asked and `harness.config.json` reflects the answer: `design.enabled: true` (with `design.platforms` populated) for yes, `design.enabled: false` for no, or absent for not sure.
346
- - The strategy question (Phase 3 step 5c) was asked unless `STRATEGY.md` already existed and was valid (in which case the prompt was skipped silently with a one-line detection note). The answer was recorded according to the documented semantics: Yes → `STRATEGY.md` exists and `harness validate` passes against `StrategyDocSchema`; No → `.harness/state.json` contains `init.strategy.declined: true`; Not sure → no `STRATEGY.md` and no `init.strategy.declined` flag.
317
+ - The strategy question (Phase 0: GROUND) was asked unless `STRATEGY.md` already existed and was valid (in which case the prompt was skipped silently with a one-line detection note). The answer was recorded according to the documented semantics: Yes → `STRATEGY.md` exists, doc-validated via `validate_strategy` against `StrategyDocSchema` (no project-level `harness validate` is run in Phase 0); No → `.harness/state.json` contains `init.strategy.declined: true`; Not sure → no `STRATEGY.md` and no `init.strategy.declined` flag.
347
318
  - **Phase 5 (INSTRUMENT) outputs:** `.harness/graph/` is populated; `.harness/arch/baselines.json` exists; `harness check-perf` ran without errors (intermediate and above); `.harness/telemetry.json` exists if the human opted into identity tagging; legacy layout warnings were surfaced via `harness migrate --dry-run` and either resolved or explicitly deferred; Tier-0 MCP integrations (context7, sequential-thinking, playwright) are present in the project's `.mcp.json` (or the human declined and that decision is recorded).
348
319
  - The roadmap question was asked. If the user answered yes, `docs/roadmap.md` exists and was created via `harness-roadmap` (or the documented `/harness:roadmap --create` fallback).
349
320
  - When `design.enabled === true` AND the user answered yes to the roadmap question, `docs/roadmap.md` contains a `planned` entry titled "Set up design system" under milestone `Intake` with a summary describing the deferred work. The entry is absent in all other answer combinations.
@@ -358,9 +329,9 @@ This phase closes the parity gap that the marketplace plugin install does not co
358
329
  | "We should start at the advanced level since we want full coverage" | The skill recommends basic for new projects. Each level builds on the previous. Jumping to advanced creates misconfigured rules. |
359
330
  | "I will skip the i18n question to keep setup fast" | Phase 3 requires asking about i18n and recording the decision. Skipping creates ambiguity about whether the omission was intentional. |
360
331
  | "I will skip the design-system question to keep setup fast" | Phase 3 step 5b requires asking about design and recording the answer in `design.enabled`. Skipping creates ambiguity about whether the omission was intentional and bypasses the linkage between init and the deferred `harness-design-system` invocation on `on_new_feature`. |
361
- | "I will skip the strategy question — it's just paperwork" | Phase 3 step 5c is the only point in the workflow where init asks the user to capture the strategic anchor. Skipping bypasses the grounding signal that brainstorming, ideate, and roadmap-pilot read; downstream skill output degrades silently. Even a "no" or "not sure" answer is better than no answer because it locks in the decision (or absence of one). |
362
- | "STRATEGY.md exists already, so I should re-run the interview to refresh it" | When `STRATEGY.md` is present and valid, Phase 3 step 5c skips the prompt silently. Refreshing strategy mid-init is out of scope — that is what the standalone `/harness:strategy` update flow is for. Surface a one-line detection note and continue. |
363
- | "STRATEGY.md is present but invalid, so I should block init" | Phase 3 step 5c explicitly does NOT block. It surfaces the validation error, offers three repair paths (fix now / move-to-bak / ignore), and continues based on the user's choice. Init is the wrong place to gate on strategy correctness. |
332
+ | "I will skip the strategy question — it's just paperwork" | Phase 0: GROUND is the only point in the workflow where init asks the user to capture the strategic anchor. Skipping bypasses the grounding signal that brainstorming, ideate, and roadmap-pilot read; downstream skill output degrades silently. Even a "no" or "not sure" answer is better than no answer because it locks in the decision (or absence of one). |
333
+ | "STRATEGY.md exists already, so I should re-run the interview to refresh it" | When `STRATEGY.md` is present and valid, Phase 0: GROUND skips the prompt silently. Refreshing strategy mid-init is out of scope — that is what the standalone `/harness:strategy` update flow is for. Surface a one-line detection note and continue. |
334
+ | "STRATEGY.md is present but invalid, so I should block init" | Phase 0: GROUND explicitly does NOT block. It surfaces the validation error, offers three repair paths (fix now / move-to-bak / ignore), and continues based on the user's choice. Init is the wrong place to gate on strategy correctness. |
364
335
  | "Validation passed, so the project is ready" | Phase 5 captures baselines, configures telemetry identity, surfaces legacy warnings, and wires Tier-0 integrations. Validation alone is not sufficient. |
365
336
  | "Plugin install means setup is done" | The marketplace plugin ships skills, slash commands, subagents, hooks, and MCP — but it cannot mutate the user's project state. `harness.config.json`, baselines, telemetry identity, and Tier-0 integrations require running this skill once per project. |
366
337
  | "Skip Phase 5 if we already ran `harness setup`" | Phase 5 is idempotent. It safely no-ops where setup already wired things and fills gaps where it didn't (common case: setup ran once, then a new Tier-0 integration was added or a layout was migrated). Re-running is the right behavior. |
@@ -410,6 +381,16 @@ git commit -m "feat: initialize harness project at basic level"
410
381
 
411
382
  ### Example: New TypeScript Web App with Design and Roadmap
412
383
 
384
+ **GROUND (Phase 0 — asked first, before ASSESS/SCAFFOLD):**
385
+
386
+ ```
387
+ Phase 0 (strategy): "Capture strategic anchor (STRATEGY.md) now?"
388
+ Human: "Yes."
389
+ Delegate to harness-strategy → first-run interview → STRATEGY.md written.
390
+ Result: STRATEGY.md exists at repo root, doc-validated via validate_strategy (StrategyDocSchema);
391
+ no project-level harness validate runs in Phase 0.
392
+ ```
393
+
413
394
  **ASSESS:**
414
395
 
415
396
  ```
@@ -427,6 +408,8 @@ harness init --level basic --framework nextjs
427
408
  **CONFIGURE (Phase 3):**
428
409
 
429
410
  ```
411
+ Step 0 (persist grounding): user answered "Yes" in Phase 0 → STRATEGY.md already written; nothing to persist.
412
+
430
413
  Step 5 (i18n): "Will this project support multiple languages?"
431
414
  Human: "No, English only."
432
415
  Result: i18n.enabled = false in harness.config.json.
@@ -439,11 +422,6 @@ Step 5b (design): "Will this project have a UI requiring a design system?"
439
422
  Inform: "Design tokens will be generated when you start your first design-touching
440
423
  feature — harness-design-system fires automatically via on_new_feature."
441
424
 
442
- Step 5c (strategy): "Capture strategic anchor (STRATEGY.md) now?"
443
- Human: "Yes."
444
- Delegate to harness-strategy → first-run interview → STRATEGY.md written.
445
- Result: STRATEGY.md exists at repo root; harness validate passes against StrategyDocSchema.
446
-
447
425
  Step 6 (test-suite dispatch): skipped (not a test suite).
448
426
  ```
449
427
 
@@ -524,6 +502,14 @@ git commit -m "feat: migrate harness project to intermediate level with layers"
524
502
 
525
503
  The user installed `harness-claude` from the marketplace. They have an existing TypeScript repo with no `.harness/` directory. Goal: get them to a working harness install without asking them to `npm install -g`.
526
504
 
505
+ **GROUND (Phase 0 — asked first, before ASSESS/SCAFFOLD):**
506
+
507
+ ```
508
+ Phase 0 (strategy): "Capture strategic anchor (STRATEGY.md) now?"
509
+ Human: "Not sure."
510
+ Result: no STRATEGY.md written, no init.strategy.declined flag; /harness:strategy stays available later.
511
+ ```
512
+
527
513
  **ASSESS:**
528
514
 
529
515
  ```
@@ -546,10 +532,10 @@ npx @harness-engineering/cli init # auto-detects framework
546
532
  **CONFIGURE:**
547
533
 
548
534
  ```
535
+ Phase 3 step 0 (persist grounding): user was "Not sure" in Phase 0 → nothing to persist.
549
536
  Customize AGENTS.md with project-specific content.
550
537
  Phase 3 step 5 (i18n): "No, English only." → i18n.enabled = false.
551
538
  Phase 3 step 5b (design): "No, this is a backend service." → design.enabled = false.
552
- Phase 3 step 5c (strategy): "not sure." → no STRATEGY.md, no init.strategy.declined flag; user can run /harness:strategy later.
553
539
  Phase 3 step 6 (test-suite dispatch): not a test suite, skipped.
554
540
  ```
555
541
 
@@ -44,6 +44,7 @@ The evaluator resolves the section internally via the fallback chain `## Success
44
44
  - **Provider path (v1 supported):** the anthropic analysis provider (`ANTHROPIC_API_KEY`). When no provider is configured the call degrades to INCONCLUSIVE/advisory. The openai-compatible _strict_ structured-output path is a known follow-up (see Known Limitations).
45
45
  - **Orchestrator:** runs as step 6.5 between Code Review and Ship in `harness.orchestrator.md`.
46
46
  - **Persistence:** each `evaluate()` writes one `execution_outcome` node via `ExecutionOutcomeConnector`, consumable by `effectiveness/scorer.ts`.
47
+ - **Relationship to `acceptance-eval`:** `acceptance-eval` is the upstream twin — it gates spec measurability before execution; `outcome-eval` judges implementation satisfaction after. The "authority is never read from the LLM" discipline spans both.
47
48
 
48
49
  ## Known Limitations
49
50
 
@@ -0,0 +1,202 @@
1
+ # Product Advisor
2
+
3
+ > Turn a client diagram + conversation into a Business Requirements Document and a resolved gap-list, then seed the harness pipeline. The pre-inception front door: gather requirements with AI, feed them in, and let the existing flow continue as it does today.
4
+
5
+ ## When to Use
6
+
7
+ - At the **inception** of a client engagement, when a solution architect / pre-sales engineer has a rough idea, a diagram, and conversation notes but no structured requirements yet.
8
+ - When you want to turn "a diagram and some notes" into a client-legible BRD plus an explicit list of what is still unknown.
9
+ - When the output should **seed the roadmap** (many work items) and ground the engagement's strategy — not produce a single spec.
10
+ - NOT for authoring a spec/proposal — that is `harness-brainstorming`'s job. Product Advisor stops at BRD + roadmap seeding.
11
+ - NOT for writing or updating `STRATEGY.md` directly — that is `harness-strategy`'s job. This skill only reads strategy and _offers_ to seed it.
12
+ - NOT for internal feature work where the requirements already live in the codebase or an existing spec — go straight to `harness-brainstorming` or `harness-planning`.
13
+
14
+ ## Process
15
+
16
+ ### Iron Law
17
+
18
+ **Every gap is either resolved in the interview or shipped as an explicit client-facing question — never silently dropped.** A BRD that hides what it does not know is worse than no BRD: it launders assumptions into requirements. If you cannot answer a gap and did not surface it in `gaps.md`, STOP and add it.
19
+
20
+ ---
21
+
22
+ ### Phase 1: INGEST — Gather the Raw Material
23
+
24
+ 1. **Resolve the engagement slug.** From the `engagement` argument, or ask the SA for a short name. This sets `docs/inception/<engagement>/` and the roadmap milestone `Inception: <engagement>`.
25
+ 2. **Ingest the diagram.** If a `diagram` argument (or a discoverable diagram) is present, parse it by calling `ingest_source({ path, source: "diagrams" })` (harness MCP) — the shipped diagram path handles diagram-as-code (Mermaid/D2/PlantUML) and image attachments (vision analysis). Then read the extracted entities and flows back via `gather_context` / `query_graph`. **Do not build a new parser** — reuse `ingest_source`.
26
+ 3. **Soft-degrade when parsing is unavailable.** If diagram parsing is unavailable or the diagram is unreadable, continue with **notes-only intake** and record a gap: `"diagram not machine-read; confirm entities and flows manually."` Do not fail.
27
+ 4. **Ingest the notes.** Load the client conversation notes / transcript from the `notes` argument or as provided. Call `gather_context` to pull any existing project/business knowledge that grounds the domain.
28
+ 5. **Normalize into intake.** Produce a structured intake: `{ entities[], flows[], notes }`. State the entities and flows back to the SA in one short summary and confirm before drafting.
29
+
30
+ ---
31
+
32
+ ### Phase 2: DRAFT-BRD — Synthesize the First Draft
33
+
34
+ 1. **Write the BRD** to `docs/inception/<engagement>/brd.md` with these sections, each present even if thin: _Context, Business Objectives, Scope, Functional Requirements, Non-Functional Requirements, Assumptions, Constraints, Out-of-Scope, Open Questions._
35
+ 2. **Phrase behavioral requirements with EARS patterns:**
36
+ - Event-driven: "When [trigger], the system shall [response]."
37
+ - Unwanted: "If [condition], then the system shall not [behavior]."
38
+ 3. **Tag gaps against the fixed BRD completeness rubric** (see below). Every rubric miss becomes a gap with `{ id, brdSection, question, severity: blocker|important|nice, status: open }`. Do not invent facts to fill a section — an empty-because-unknown section is a gap, not a place to guess.
39
+ 4. **Cite the source** of each requirement (`diagram`, `notes`, or later `interview`) so the SA can trace it.
40
+
41
+ #### BRD completeness rubric
42
+
43
+ - Each BRD section is non-empty and internally consistent.
44
+ - Every diagram entity and flow maps to ≥1 functional requirement (or to an explicit gap).
45
+ - Every functional requirement has an **actor + trigger + response**.
46
+ - Every non-functional requirement is measurable (a number or a testable condition), else it is a gap.
47
+ - Scope and Out-of-Scope do not contradict each other.
48
+
49
+ ---
50
+
51
+ ### Phase 3: GAP-INTERVIEW — Resolve What You Can
52
+
53
+ 1. **Ask ONE question at a time, in plain text.** Order the gap queue by severity (`blocker` → `important` → `nice`). Ask the highest-severity open gap first, wait for the answer, then continue.
54
+
55
+ **Ask directly in your reply. Do NOT route questions through `emit_interaction`, `AskUserQuestion`, or any tool** — those do not reliably surface the question to the human. Plain text in your own message is the only channel that reaches the SA across every client (Claude Code, Cursor, Codex, Gemini CLI).
56
+
57
+ Present each gap as a scannable multiple-choice table where options exist, and state a recommendation:
58
+
59
+ ```markdown
60
+ ### Gap G3 (blocker): What authenticates end users?
61
+
62
+ | | A) Client SSO (SAML/OIDC) | B) Local accounts | C) Unknown — ask client |
63
+ | ----------- | ------------------------- | ----------------- | ----------------------- |
64
+ | **Implies** | IdP integration work | Password storage | Blocks scoping |
65
+ | **Risk** | Depends on client IdP | Security burden | — |
66
+
67
+ **Recommendation:** likely A given the enterprise diagram — confirm the IdP.
68
+ ```
69
+
70
+ 2. **Fold each answer back into the BRD.** Update the relevant section, add the requirement (source: `interview`), and move the gap `open → resolved` with the captured answer.
71
+ 3. **Mark unresolvable gaps client-facing.** If the SA cannot answer (only the client can), keep the gap `open` and phrase it as a question to ask the client.
72
+ 4. **Stop when the queue is drained** — every gap is either `resolved` or `open` (client-facing). Do not loop past a drained queue inventing new questions.
73
+
74
+ ---
75
+
76
+ ### Phase 4: FINALIZE — Ship and Hand Off
77
+
78
+ 1. **Write `gaps.md`** to `docs/inception/<engagement>/gaps.md` with two sections: **Resolved** (gap + captured answer) and **Open / chase-with-client** (each phrased as a question to ask the client).
79
+ 2. **Offer a STRATEGY.md seed.** In plain text, offer to seed the engagement's strategy via `/harness:strategy`, using the BRD's Business Objectives + Scope as grounding. **Never write `STRATEGY.md` yourself** — dispatch `harness-strategy` if the SA accepts.
80
+ 3. **Fan out into roadmap candidates.** Decompose the BRD scope into N candidate work items — each `{ title, summary, brdRefs[], rationale }`. Present them to the SA for a quick confirm/prune, then write each accepted item via `manage_roadmap` action `add`, `status: backlog`, `milestone: "Inception: <engagement>"`, with the BRD section reference in the summary. One BRD produces many rows — do not collapse the engagement into a single item.
81
+ 4. **Emit the handoff.** Record the transition to the roadmap/brainstorming flow via `emit_interaction`. State plainly that each roadmap item now enters the existing `roadmap-pilot → brainstorming → spec → plan → execute` pipeline. **Do not author a spec** — hand off to `harness-brainstorming` per item when the SA is ready.
82
+
83
+ ---
84
+
85
+ ## Harness Integration
86
+
87
+ - **`gather_context`** — Phase 1: pull existing project/business knowledge to ground the domain.
88
+ - **`ingest_source` (`source: "diagrams"`)** — Phase 1: parse diagrams (diagram-as-code + image vision) into the knowledge graph; read the extracted entities/flows back via `gather_context` / `query_graph`. Never reimplement the parser.
89
+ - **`read_strategy`** — Phase 4: read `STRATEGY.md` (if present) to align the BRD; never write it.
90
+ - **`manage_roadmap` (action `add`)** — Phase 4: create backlog roadmap rows from the BRD fan-out.
91
+ - **`emit_interaction`** — Phase 4: record the handoff transition to the roadmap/brainstorming flow.
92
+ - **`harness validate`** — After finalize: verify artifact placement and project health.
93
+
94
+ ## Success Criteria
95
+
96
+ - Running the skill with a diagram + notes produces `docs/inception/<engagement>/brd.md` with all required sections, none empty.
97
+ - Every diagram entity/flow maps to ≥1 BRD requirement or to an explicit gap.
98
+ - `gaps.md` exists and separates **Resolved** from **Open/client-facing**; every open gap is phrased as a question.
99
+ - The gap interview asked one question at a time and folded each answer into the BRD (resolved gaps moved `open → resolved`).
100
+ - `finalize` created ≥1 candidate roadmap row via `manage_roadmap`, each linking back to a BRD section.
101
+ - `finalize` offered a `STRATEGY.md` seed via `/harness:strategy` and did not write `STRATEGY.md` directly.
102
+ - Behavioral functional requirements use EARS phrasing.
103
+ - When diagram parsing was unavailable, the skill degraded to notes-only and recorded a gap rather than failing.
104
+ - No spec/proposal was authored by this skill.
105
+
106
+ ## Examples
107
+
108
+ ### Example: retail loyalty engagement from a diagram + call notes
109
+
110
+ **INGEST:**
111
+
112
+ ```
113
+ engagement: acme-loyalty
114
+ diagram: architecture.mmd (Mermaid) → parsed: entities [POS, Loyalty API, CRM, Rewards Engine], flows [POS→Loyalty API→CRM]
115
+ notes: kickoff-call.md → loaded. gather_context: existing "loyalty" business facts surfaced.
116
+ Confirmed entities/flows with SA. Proceed.
117
+ ```
118
+
119
+ **DRAFT-BRD:** Wrote `docs/inception/acme-loyalty/brd.md`. 9 sections. Tagged 6 gaps:
120
+ G1 (blocker) no auth model; G2 (blocker) Rewards Engine has no defined trigger; G3 (important) no NFR for POS latency; G4 (important) CRM data residency unknown; G5 (nice) reporting cadence; G6 (blocker) "Rewards Engine" entity maps to no requirement.
121
+
122
+ **GAP-INTERVIEW:**
123
+
124
+ ```
125
+ G1: "What authenticates end users? A) Client SSO B) Local C) Unknown" → SA: "A, Okta OIDC." → folded in.
126
+ G2: "When does the Rewards Engine fire? A) On transaction B) Batch nightly C) Unknown" → SA: "A." → EARS: "When a qualifying transaction is recorded, the system shall evaluate reward eligibility."
127
+ G3: "POS latency budget?" → SA: "client must confirm." → kept open, client-facing.
128
+ G4: "CRM data residency?" → SA: "client must confirm." → kept open, client-facing.
129
+ G6: resolved by G2. G5: SA: "monthly." → folded in.
130
+ ```
131
+
132
+ **FINALIZE:**
133
+
134
+ ```
135
+ Wrote gaps.md → Resolved: G1,G2,G5,G6 | Open/client-facing: G3 (latency), G4 (residency).
136
+ Offered STRATEGY.md seed → SA accepted → dispatched /harness:strategy.
137
+ Roadmap fan-out (milestone "Inception: acme-loyalty", backlog):
138
+ - "POS ↔ Loyalty API integration" (brd: Scope, FR-1)
139
+ - "Rewards Engine eligibility rules" (brd: FR-4)
140
+ - "Okta OIDC authentication" (brd: FR-2)
141
+ - "CRM sync + residency compliance" (brd: FR-5, NFR-2)
142
+ Emitted handoff → each item enters roadmap-pilot → brainstorming. No spec authored.
143
+ ```
144
+
145
+ ## Gates
146
+
147
+ - **No dropped gaps.** Every gap is `resolved` or shipped as an `open` client-facing question in `gaps.md`. A gap that is neither = Iron Law violation; stop and fix.
148
+ - **No guessed requirements.** A BRD section that is unknown is a gap, not a place to invent facts. Fabricating a requirement to fill a section is a hard stop.
149
+ - **No writing `STRATEGY.md`.** This skill reads strategy and offers to seed it via `/harness:strategy`. Writing `STRATEGY.md` directly = gate violation.
150
+ - **No authoring specs.** This skill stops at BRD + roadmap seeding. Writing a `proposal.md` = gate violation; hand off to `harness-brainstorming`.
151
+ - **No single-item collapse.** If the BRD scope contains multiple independent capabilities, `finalize` must produce multiple roadmap rows. Collapsing an engagement into one row defeats the fan-out.
152
+ - **No hard failure on missing diagram.** Absent/unreadable diagram → notes-only + recorded gap. Aborting the run because a diagram would not parse = gate violation.
153
+
154
+ ## Escalation
155
+
156
+ - **Diagram parses but entities contradict the notes:** Do not silently pick one. Surface the contradiction as a `blocker` gap and ask the SA which source is authoritative.
157
+ - **The SA cannot answer any blocker gap:** The engagement is too early for a BRD. Report: "N blocker gaps are all client-facing; this needs a client conversation before a BRD is meaningful. Ship the gap-list as a client questionnaire and pause."
158
+ - **Scope keeps expanding during the interview:** Stop. Report: "Scope has grown beyond the ingested material. Should we (A) bound the BRD to the original diagram/notes and log the rest as follow-up, or (B) re-ingest expanded material first?"
159
+ - **`manage_roadmap` is unavailable:** Write the candidate items into `gaps.md` under a "Proposed roadmap items" heading and report: "Roadmap seeding skipped (manage_roadmap unavailable). Re-run finalize when MCP is restored."
160
+ - **More than ~15 gaps after drafting:** The intake is too raw. Report and propose narrowing the engagement scope before interviewing, rather than running a 15-question interview.
161
+
162
+ ## Rationalizations to Reject
163
+
164
+ | Rationalization | Reality |
165
+ | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
166
+ | "The diagram implies the auth model, so I'll just write it as a requirement" | An implication is not a confirmation. Diagram-implied facts that the client has not stated are gaps — surface them, don't launder them into requirements. |
167
+ | "This gap is minor, I'll leave it out of gaps.md to keep it clean" | The Iron Law is explicit: every gap is resolved or shipped. A gap you drop is an assumption the client discovers in production. `nice`-severity still ships. |
168
+ | "I have enough to draft a proposal, I'll just write the spec too" | Product Advisor stops at BRD + roadmap seeding. Authoring a spec skips `harness-brainstorming`'s design exploration, which is exactly where the gaps get weighed against approaches. |
169
+ | "The BRD's objectives are clear, I'll seed STRATEGY.md directly to save a step" | This skill never writes `STRATEGY.md`. The `harness-strategy` boundary exists so strategy stays a deliberate, pushback-gated human commitment — not a side effect of inception. |
170
+ | "The engagement is really one big project, I'll make one roadmap row" | A BRD describes a solution scope that fans out into many work items. One row defeats the whole handoff — each capability needs its own brainstorming → spec cycle. |
171
+ | "The diagram won't parse, so I can't run — I'll abort" | Notes-only intake is a first-class path. Degrade, record the diagram as a gap, and continue. Aborting throws away the requirements the notes already contain. |
172
+
173
+ ## Red Flags
174
+
175
+ | Flag | Corrective Action |
176
+ | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
177
+ | "I'll fill the empty NFR section with reasonable defaults" | STOP. Unknown NFRs are gaps. Defaults you invent become requirements no one agreed to. Tag it as a gap and ask. |
178
+ | "The interview is dragging; I'll batch the remaining questions into one message" | STOP. One question at a time is prescribed — batched questions get partial answers and lose the fold-back loop. Ask the next single highest-severity gap. |
179
+ | "The SA said 'just make sensible assumptions'" | STOP. Assumptions belong in the BRD's **Assumptions** section, labeled as assumptions, and the underlying unknowns stay in `gaps.md` as client-facing. Do not convert assumptions into silent requirements. |
180
+ | `// TODO: confirm with client` left inside brd.md functional requirements | STOP. Confirmation-needed items are gaps, not requirements. Move them to `gaps.md` (Open/client-facing) and keep the BRD's requirements limited to what is actually known. |
181
+
182
+ ---
183
+
184
+ <!--
185
+ ## Skill Test Scenarios
186
+
187
+ ### Scenario 1: Gate — "No dropped gaps"
188
+ Input: Drafting produces a `nice`-severity gap (reporting cadence) the SA never answers and cannot be bothered to log.
189
+ Expected: Agent keeps the gap and writes it to gaps.md under Open/client-facing rather than dropping it; cites the Iron Law / "No dropped gaps" gate.
190
+
191
+ ### Scenario 2: Rationalization — "I have enough to draft a proposal, I'll just write the spec too"
192
+ Input: After a clean interview the agent is tempted to write docs/changes/<x>/proposal.md.
193
+ Expected: Agent refuses, finalizes BRD + roadmap fan-out, and hands off to harness-brainstorming per item — no spec authored (gate: "No authoring specs").
194
+
195
+ ### Scenario 3: Gate/Escalation — soft-degrade on unreadable diagram
196
+ Input: The provided diagram is a binary image the environment cannot vision-parse.
197
+ Expected: Agent does not abort; runs notes-only intake and records "diagram not machine-read; confirm entities manually" as a gap (gate: "No hard failure on missing diagram").
198
+
199
+ ### Scenario 4: Rationalization — "This is really one big project, I'll make one roadmap row"
200
+ Input: A BRD with 4 independent capabilities; agent tempted to add a single "Acme engagement" roadmap row.
201
+ Expected: Agent fans out into one row per capability with BRD backrefs (gate: "No single-item collapse").
202
+ -->