@harness-engineering/cli 1.25.7 → 1.26.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 (189) hide show
  1. package/dist/agents/skills/README.md +1 -0
  2. package/dist/agents/skills/claude-code/harness-brainstorming/SKILL.md +33 -5
  3. package/dist/agents/skills/claude-code/harness-execution/SKILL.md +6 -0
  4. package/dist/agents/skills/claude-code/harness-knowledge-pipeline/SKILL.md +277 -0
  5. package/dist/agents/skills/claude-code/harness-knowledge-pipeline/skill.yaml +60 -0
  6. package/dist/agents/skills/claude-code/harness-planning/SKILL.md +25 -1
  7. package/dist/agents/skills/claude-code/initialize-harness-project/SKILL.md +22 -6
  8. package/dist/agents/skills/claude-code/initialize-harness-project/skill.yaml +2 -1
  9. package/dist/agents/skills/claude-code/initialize-test-suite-project/SKILL.md +415 -0
  10. package/dist/agents/skills/claude-code/initialize-test-suite-project/skill.yaml +35 -0
  11. package/dist/agents/skills/codex/harness-brainstorming/SKILL.md +33 -5
  12. package/dist/agents/skills/codex/harness-execution/SKILL.md +6 -0
  13. package/dist/agents/skills/codex/harness-knowledge-pipeline/SKILL.md +277 -0
  14. package/dist/agents/skills/codex/harness-knowledge-pipeline/skill.yaml +60 -0
  15. package/dist/agents/skills/codex/harness-planning/SKILL.md +25 -1
  16. package/dist/agents/skills/codex/initialize-harness-project/SKILL.md +22 -6
  17. package/dist/agents/skills/codex/initialize-harness-project/skill.yaml +2 -1
  18. package/dist/agents/skills/codex/initialize-test-suite-project/SKILL.md +415 -0
  19. package/dist/agents/skills/codex/initialize-test-suite-project/skill.yaml +35 -0
  20. package/dist/agents/skills/cursor/harness-brainstorming/SKILL.md +33 -5
  21. package/dist/agents/skills/cursor/harness-execution/SKILL.md +6 -0
  22. package/dist/agents/skills/cursor/harness-knowledge-pipeline/SKILL.md +277 -0
  23. package/dist/agents/skills/cursor/harness-knowledge-pipeline/skill.yaml +60 -0
  24. package/dist/agents/skills/cursor/harness-planning/SKILL.md +25 -1
  25. package/dist/agents/skills/cursor/initialize-harness-project/SKILL.md +22 -6
  26. package/dist/agents/skills/cursor/initialize-harness-project/skill.yaml +2 -1
  27. package/dist/agents/skills/cursor/initialize-test-suite-project/SKILL.md +415 -0
  28. package/dist/agents/skills/cursor/initialize-test-suite-project/skill.yaml +35 -0
  29. package/dist/agents/skills/gemini-cli/harness-brainstorming/SKILL.md +33 -5
  30. package/dist/agents/skills/gemini-cli/harness-execution/SKILL.md +6 -0
  31. package/dist/agents/skills/gemini-cli/harness-knowledge-pipeline/SKILL.md +277 -0
  32. package/dist/agents/skills/gemini-cli/harness-knowledge-pipeline/skill.yaml +60 -0
  33. package/dist/agents/skills/gemini-cli/harness-planning/SKILL.md +25 -1
  34. package/dist/agents/skills/gemini-cli/initialize-harness-project/SKILL.md +22 -6
  35. package/dist/agents/skills/gemini-cli/initialize-harness-project/skill.yaml +2 -1
  36. package/dist/agents/skills/gemini-cli/initialize-test-suite-project/SKILL.md +415 -0
  37. package/dist/agents/skills/gemini-cli/initialize-test-suite-project/skill.yaml +35 -0
  38. package/dist/agents/skills/package.json +2 -2
  39. package/dist/agents/skills/tests/initialize-test-suite-project.test.ts +152 -0
  40. package/dist/{agents-md-QPO3H5HX.js → agents-md-VI3HLR7E.js} +3 -3
  41. package/dist/{architecture-IJLXRHZA.js → architecture-ZDDKEVID.js} +4 -4
  42. package/dist/{assess-project-QU6XIVJK.js → assess-project-Y6W7YDUA.js} +1 -1
  43. package/dist/bin/harness-mcp.js +16 -15
  44. package/dist/bin/harness.js +27 -27
  45. package/dist/{check-phase-gate-TNY64AOS.js → check-phase-gate-CXR3VM22.js} +4 -4
  46. package/dist/{chunk-JJQ3TW2E.js → chunk-2BPPS6YQ.js} +804 -93
  47. package/dist/{chunk-NKQEMWGT.js → chunk-2FPUPRCY.js} +3419 -126
  48. package/dist/{chunk-MLOGYWLY.js → chunk-3AMQYWGT.js} +2 -2
  49. package/dist/{chunk-AS5DQT4S.js → chunk-56A6OXVA.js} +9 -9
  50. package/dist/{chunk-G5SNXUIK.js → chunk-7GY6WNEI.js} +1 -1
  51. package/dist/{chunk-SZ3Q4XEO.js → chunk-AMRC4FU2.js} +441 -288
  52. package/dist/{chunk-K533WNZG.js → chunk-B66LRB5M.js} +1 -1
  53. package/dist/{chunk-YRBNAHH4.js → chunk-BK4DJIIY.js} +4 -4
  54. package/dist/{chunk-2DF6OZLG.js → chunk-DBIX3X4H.js} +2 -2
  55. package/dist/{chunk-LXPRO2FH.js → chunk-FUND5WJR.js} +2 -2
  56. package/dist/{chunk-FRDS4XGD.js → chunk-JV4Y2U5F.js} +1 -1
  57. package/dist/{chunk-XVJRFP7W.js → chunk-K56DTX7G.js} +6 -6
  58. package/dist/{chunk-K35D7HF3.js → chunk-N6B6RKQQ.js} +1 -1
  59. package/dist/{chunk-LTCEV7VF.js → chunk-NY7DTZ6K.js} +3 -3
  60. package/dist/{chunk-JPZY7ZQX.js → chunk-OLW7BJ5N.js} +1 -1
  61. package/dist/{chunk-KVJZQ2MV.js → chunk-ORNEK65Y.js} +1 -1
  62. package/dist/{chunk-D3XL2FLX.js → chunk-PNNFCVW4.js} +5 -5
  63. package/dist/{chunk-E5Z6NTTQ.js → chunk-Q3ZLVMQM.js} +1 -1
  64. package/dist/{chunk-PCOU2UXU.js → chunk-RAVD7QLY.js} +8 -8
  65. package/dist/{chunk-IQO7IINR.js → chunk-TSVYBDDE.js} +1 -1
  66. package/dist/{chunk-MCDCZMKN.js → chunk-TY2ESLVL.js} +1 -1
  67. package/dist/{chunk-TQRCODRJ.js → chunk-VKS3F46M.js} +1 -1
  68. package/dist/{chunk-GVNT2YC7.js → chunk-WZ7UHPT3.js} +9 -9
  69. package/dist/{chunk-ZIYLIYN4.js → chunk-YC4EYIER.js} +8 -2
  70. package/dist/{chunk-IT2KORSK.js → chunk-ZN6ROTYP.js} +1 -1
  71. package/dist/{ci-workflow-FJYRFZYQ.js → ci-workflow-EW37KVPS.js} +3 -3
  72. package/dist/{create-skill-6QWJHQYS.js → create-skill-4T5CBSJ2.js} +2 -2
  73. package/dist/{dist-ZV6GO6FA.js → dist-CJDGASPP.js} +2 -2
  74. package/dist/{dist-HPWNWCT6.js → dist-NCNAXUFD.js} +41 -1
  75. package/dist/{docs-7DW3DI4Z.js → docs-4XI2FQW2.js} +4 -4
  76. package/dist/{engine-P7EE2IWO.js → engine-4L4CDTHU.js} +3 -3
  77. package/dist/{entropy-HCXRTDFU.js → entropy-PBYSIQYS.js} +3 -3
  78. package/dist/{feedback-Y4FYN3NR.js → feedback-OTIFW5MK.js} +1 -1
  79. package/dist/{generate-agent-definitions-3EHPIWBO.js → generate-agent-definitions-CZGUXIIN.js} +4 -4
  80. package/dist/{graph-loader-KXVS3YK3.js → graph-loader-RDXSEBD7.js} +1 -1
  81. package/dist/index.d.ts +8 -8
  82. package/dist/index.js +27 -27
  83. package/dist/{loader-SKHF3JVV.js → loader-UZOXCWFC.js} +3 -3
  84. package/dist/{mcp-MWYIPDQU.js → mcp-GWVVV6LH.js} +16 -15
  85. package/dist/{performance-ADWH5NJY.js → performance-5UQPP3XX.js} +4 -4
  86. package/dist/{review-pipeline-TLKE5OQD.js → review-pipeline-65V4EO6O.js} +3 -3
  87. package/dist/{runtime-7LYAW7GU.js → runtime-PXX7HNB3.js} +3 -3
  88. package/dist/{scan-BGJ7TLLV.js → scan-WM7XDUF7.js} +1 -1
  89. package/dist/{security-5XWINYVB.js → security-CAYDRZIZ.js} +1 -1
  90. package/dist/{validate-BFFHYHY7.js → validate-CWGXR7QM.js} +4 -4
  91. package/dist/{validate-cross-check-GQX7OVCR.js → validate-cross-check-BKCNLZYG.js} +3 -3
  92. package/package.json +10 -10
  93. package/dist/agents/commands/claude-code/harness/harness.md +0 -36
  94. package/dist/agents/commands/codex/AGENTS.md +0 -39
  95. package/dist/agents/commands/codex/harness/add-harness-component/SKILL.md +0 -204
  96. package/dist/agents/commands/codex/harness/add-harness-component/agents/openai.yaml +0 -3
  97. package/dist/agents/commands/codex/harness/cleanup-dead-code/SKILL.md +0 -257
  98. package/dist/agents/commands/codex/harness/cleanup-dead-code/agents/openai.yaml +0 -3
  99. package/dist/agents/commands/codex/harness/detect-doc-drift/SKILL.md +0 -191
  100. package/dist/agents/commands/codex/harness/detect-doc-drift/agents/openai.yaml +0 -3
  101. package/dist/agents/commands/codex/harness/enforce-architecture/SKILL.md +0 -289
  102. package/dist/agents/commands/codex/harness/enforce-architecture/agents/openai.yaml +0 -3
  103. package/dist/agents/commands/codex/harness/harness-architecture-advisor/SKILL.md +0 -442
  104. package/dist/agents/commands/codex/harness/harness-architecture-advisor/agents/openai.yaml +0 -3
  105. package/dist/agents/commands/codex/harness/harness-autopilot/SKILL.md +0 -929
  106. package/dist/agents/commands/codex/harness/harness-autopilot/agents/openai.yaml +0 -3
  107. package/dist/agents/commands/codex/harness/harness-brainstorming/SKILL.md +0 -418
  108. package/dist/agents/commands/codex/harness/harness-brainstorming/agents/openai.yaml +0 -3
  109. package/dist/agents/commands/codex/harness/harness-code-review/SKILL.md +0 -850
  110. package/dist/agents/commands/codex/harness/harness-code-review/agents/openai.yaml +0 -3
  111. package/dist/agents/commands/codex/harness/harness-codebase-cleanup/SKILL.md +0 -236
  112. package/dist/agents/commands/codex/harness/harness-codebase-cleanup/agents/openai.yaml +0 -3
  113. package/dist/agents/commands/codex/harness/harness-debugging/SKILL.md +0 -378
  114. package/dist/agents/commands/codex/harness/harness-debugging/agents/openai.yaml +0 -3
  115. package/dist/agents/commands/codex/harness/harness-dependency-health/SKILL.md +0 -190
  116. package/dist/agents/commands/codex/harness/harness-dependency-health/agents/openai.yaml +0 -3
  117. package/dist/agents/commands/codex/harness/harness-docs-pipeline/SKILL.md +0 -472
  118. package/dist/agents/commands/codex/harness/harness-docs-pipeline/agents/openai.yaml +0 -3
  119. package/dist/agents/commands/codex/harness/harness-execution/SKILL.md +0 -522
  120. package/dist/agents/commands/codex/harness/harness-execution/agents/openai.yaml +0 -3
  121. package/dist/agents/commands/codex/harness/harness-hotspot-detector/SKILL.md +0 -172
  122. package/dist/agents/commands/codex/harness/harness-hotspot-detector/agents/openai.yaml +0 -3
  123. package/dist/agents/commands/codex/harness/harness-impact-analysis/SKILL.md +0 -195
  124. package/dist/agents/commands/codex/harness/harness-impact-analysis/agents/openai.yaml +0 -3
  125. package/dist/agents/commands/codex/harness/harness-integrity/SKILL.md +0 -178
  126. package/dist/agents/commands/codex/harness/harness-integrity/agents/openai.yaml +0 -3
  127. package/dist/agents/commands/codex/harness/harness-onboarding/SKILL.md +0 -299
  128. package/dist/agents/commands/codex/harness/harness-onboarding/agents/openai.yaml +0 -3
  129. package/dist/agents/commands/codex/harness/harness-perf/SKILL.md +0 -272
  130. package/dist/agents/commands/codex/harness/harness-perf/agents/openai.yaml +0 -3
  131. package/dist/agents/commands/codex/harness/harness-planning/SKILL.md +0 -592
  132. package/dist/agents/commands/codex/harness/harness-planning/agents/openai.yaml +0 -3
  133. package/dist/agents/commands/codex/harness/harness-refactoring/SKILL.md +0 -181
  134. package/dist/agents/commands/codex/harness/harness-refactoring/agents/openai.yaml +0 -3
  135. package/dist/agents/commands/codex/harness/harness-release-readiness/SKILL.md +0 -701
  136. package/dist/agents/commands/codex/harness/harness-release-readiness/agents/openai.yaml +0 -3
  137. package/dist/agents/commands/codex/harness/harness-roadmap/SKILL.md +0 -607
  138. package/dist/agents/commands/codex/harness/harness-roadmap/agents/openai.yaml +0 -3
  139. package/dist/agents/commands/codex/harness/harness-security-scan/SKILL.md +0 -147
  140. package/dist/agents/commands/codex/harness/harness-security-scan/agents/openai.yaml +0 -3
  141. package/dist/agents/commands/codex/harness/harness-skill-authoring/SKILL.md +0 -314
  142. package/dist/agents/commands/codex/harness/harness-skill-authoring/agents/openai.yaml +0 -3
  143. package/dist/agents/commands/codex/harness/harness-soundness-review/SKILL.md +0 -1280
  144. package/dist/agents/commands/codex/harness/harness-soundness-review/agents/openai.yaml +0 -3
  145. package/dist/agents/commands/codex/harness/harness-supply-chain-audit/SKILL.md +0 -255
  146. package/dist/agents/commands/codex/harness/harness-supply-chain-audit/agents/openai.yaml +0 -3
  147. package/dist/agents/commands/codex/harness/harness-tdd/SKILL.md +0 -189
  148. package/dist/agents/commands/codex/harness/harness-tdd/agents/openai.yaml +0 -3
  149. package/dist/agents/commands/codex/harness/harness-test-advisor/SKILL.md +0 -171
  150. package/dist/agents/commands/codex/harness/harness-test-advisor/agents/openai.yaml +0 -3
  151. package/dist/agents/commands/codex/harness/harness-verification/SKILL.md +0 -433
  152. package/dist/agents/commands/codex/harness/harness-verification/agents/openai.yaml +0 -3
  153. package/dist/agents/commands/codex/harness/harness-verify/SKILL.md +0 -170
  154. package/dist/agents/commands/codex/harness/harness-verify/agents/openai.yaml +0 -3
  155. package/dist/agents/commands/codex/harness/initialize-harness-project/SKILL.md +0 -244
  156. package/dist/agents/commands/codex/harness/initialize-harness-project/agents/openai.yaml +0 -3
  157. package/dist/agents/commands/cursor/harness/add-harness-component.mdc +0 -200
  158. package/dist/agents/commands/cursor/harness/cleanup-dead-code.mdc +0 -253
  159. package/dist/agents/commands/cursor/harness/detect-doc-drift.mdc +0 -187
  160. package/dist/agents/commands/cursor/harness/enforce-architecture.mdc +0 -304
  161. package/dist/agents/commands/cursor/harness/harness-architecture-advisor.mdc +0 -457
  162. package/dist/agents/commands/cursor/harness/harness-autopilot.mdc +0 -924
  163. package/dist/agents/commands/cursor/harness/harness-brainstorming.mdc +0 -414
  164. package/dist/agents/commands/cursor/harness/harness-code-review.mdc +0 -865
  165. package/dist/agents/commands/cursor/harness/harness-codebase-cleanup.mdc +0 -232
  166. package/dist/agents/commands/cursor/harness/harness-debugging.mdc +0 -374
  167. package/dist/agents/commands/cursor/harness/harness-dependency-health.mdc +0 -187
  168. package/dist/agents/commands/cursor/harness/harness-docs-pipeline.mdc +0 -468
  169. package/dist/agents/commands/cursor/harness/harness-execution.mdc +0 -518
  170. package/dist/agents/commands/cursor/harness/harness-hotspot-detector.mdc +0 -169
  171. package/dist/agents/commands/cursor/harness/harness-impact-analysis.mdc +0 -192
  172. package/dist/agents/commands/cursor/harness/harness-integrity.mdc +0 -175
  173. package/dist/agents/commands/cursor/harness/harness-onboarding.mdc +0 -296
  174. package/dist/agents/commands/cursor/harness/harness-perf.mdc +0 -268
  175. package/dist/agents/commands/cursor/harness/harness-planning.mdc +0 -587
  176. package/dist/agents/commands/cursor/harness/harness-refactoring.mdc +0 -177
  177. package/dist/agents/commands/cursor/harness/harness-release-readiness.mdc +0 -697
  178. package/dist/agents/commands/cursor/harness/harness-roadmap.mdc +0 -603
  179. package/dist/agents/commands/cursor/harness/harness-security-scan.mdc +0 -162
  180. package/dist/agents/commands/cursor/harness/harness-skill-authoring.mdc +0 -300
  181. package/dist/agents/commands/cursor/harness/harness-soundness-review.mdc +0 -1275
  182. package/dist/agents/commands/cursor/harness/harness-supply-chain-audit.mdc +0 -252
  183. package/dist/agents/commands/cursor/harness/harness-tdd.mdc +0 -185
  184. package/dist/agents/commands/cursor/harness/harness-test-advisor.mdc +0 -168
  185. package/dist/agents/commands/cursor/harness/harness-verification.mdc +0 -429
  186. package/dist/agents/commands/cursor/harness/harness-verify.mdc +0 -167
  187. package/dist/agents/commands/cursor/harness/initialize-harness-project.mdc +0 -240
  188. package/dist/agents/commands/gemini-cli/harness/harness.toml +0 -277
  189. package/dist/{chunk-RRHUCDRD.js → chunk-ZP5E7YET.js} +3 -3
@@ -35,6 +35,7 @@ agents/skills/
35
35
  ### Setup
36
36
 
37
37
  - `initialize-harness-project` - Scaffold new project
38
+ - `initialize-test-suite-project` - Scaffold a test-suite project (API / E2E-UI / shared library)
38
39
  - `add-harness-component` - Add components
39
40
 
40
41
  ### Skill Catalog
@@ -114,9 +114,31 @@ These flow into `handoff.json` `contextKeywords` field. Select keywords that hel
114
114
 
115
115
  3. **Write the spec** to `docs/changes/<feature>/proposal.md`.
116
116
 
117
- 4. **Run `harness validate`** to verify proper placement and project health.
117
+ 4. **Run skill advisor scan.** After writing the spec, extract signals from its content and scan the skill index for relevant skills. Write results to `docs/changes/<feature>/SKILLS.md` alongside the spec.
118
118
 
119
- 5. **Request sign-off via `emit_interaction`:**
119
+ Use the `advise_skills` MCP tool:
120
+
121
+ ```json
122
+ advise_skills({
123
+ "path": "<project-root>",
124
+ "specPath": "docs/changes/<feature>/proposal.md"
125
+ })
126
+ ```
127
+
128
+ Announce findings in a brief summary (skip announcement in `--fast` mode):
129
+
130
+ ```
131
+ Skill Advisor: Found N relevant skills for '<feature>'
132
+ Apply: N (skill-a, skill-b, ...)
133
+ Reference: N | Consider: N
134
+ Full list: docs/changes/<feature>/SKILLS.md
135
+ ```
136
+
137
+ In `--thorough` mode, show the full skill list for human review before proceeding.
138
+
139
+ 5. **Run `harness validate`** to verify proper placement and project health.
140
+
141
+ 6. **Request sign-off via `emit_interaction`:**
120
142
 
121
143
  ```json
122
144
  emit_interaction({
@@ -133,14 +155,14 @@ These flow into `handoff.json` `contextKeywords` field. Select keywords that hel
133
155
 
134
156
  The human must explicitly approve before this skill is complete.
135
157
 
136
- 6. **Add feature to roadmap.** If `docs/roadmap.md` exists:
158
+ 7. **Add feature to roadmap.** If `docs/roadmap.md` exists:
137
159
  - Derive feature name from the spec title (the H1 heading).
138
160
  - Call `manage_roadmap` with action `add`, `status: "planned"`, `milestone: "Current Work"`, and the spec path.
139
161
  - If the feature already exists, skip silently.
140
162
  - If `manage_roadmap` is unavailable, fall back to `parseRoadmap`/`serializeRoadmap` from core. Warn: "External sync skipped (MCP unavailable). Run `manage_roadmap sync` when MCP is restored."
141
163
  - If no roadmap exists, skip silently.
142
164
 
143
- 7. **Write handoff and suggest transition.** After approval:
165
+ 8. **Write handoff and suggest transition.** After approval:
144
166
 
145
167
  Write handoff to the session-scoped path when a session slug is known, otherwise fall back to the global path:
146
168
  - Session-scoped (preferred): `.harness/sessions/<session-slug>/handoff.json`
@@ -155,7 +177,13 @@ These flow into `handoff.json` `contextKeywords` field. Select keywords that hel
155
177
  "summary": "<1-sentence summary>",
156
178
  "artifacts": ["<spec path>"],
157
179
  "decisions": [{ "what": "<decision>", "why": "<rationale>" }],
158
- "contextKeywords": ["<keywords from Phase 2>"]
180
+ "contextKeywords": ["<keywords from Phase 2>"],
181
+ "recommendedSkills": {
182
+ "apply": ["<skill-names>"],
183
+ "reference": ["<skill-names>"],
184
+ "consider": ["<skill-names>"],
185
+ "skillsPath": "docs/changes/<feature>/SKILLS.md"
186
+ }
159
187
  }
160
188
  ```
161
189
 
@@ -96,6 +96,12 @@ For each task, starting from current position:
96
96
 
97
97
  1. **Read task instructions completely** before writing any code.
98
98
 
99
+ 1b. **Load skill context for annotated tasks.** If the task has a `**Skills:**` annotation:
100
+
101
+ - For `apply` tier skills: note the skill name in the task context. The skill may provide patterns or approaches to follow during implementation.
102
+ - For `reference` tier skills (type: `knowledge`): load the skill's SKILL.md content as supplementary context. Cap at 3 reference skills per task to manage context budget.
103
+ - Use the skill content to inform implementation decisions but follow the plan's exact instructions as written. Skill context provides background knowledge, not overriding instructions.
104
+
99
105
  2. **Follow instructions exactly.** The plan contains exact file paths, code, and commands. Execute as written.
100
106
 
101
107
  3. **TDD rhythm:**
@@ -0,0 +1,277 @@
1
+ # Harness Knowledge Pipeline
2
+
3
+ > 4-phase knowledge extraction, reconciliation, drift detection, and remediation with convergence loop. Keeps the business knowledge graph current and identifies coverage gaps.
4
+
5
+ ## When to Use
6
+
7
+ - When you want a full knowledge health check: extract signals, detect drift, find gaps
8
+ - After adding new code, connectors, or diagram files that contain business knowledge
9
+ - As a periodic hygiene check to ensure the knowledge graph reflects the codebase
10
+ - When `--drift-check` is needed in CI to gate on knowledge freshness
11
+ - NOT for manually authoring knowledge files (write to `docs/knowledge/` directly)
12
+ - NOT for ingesting a single source (use `ingest_source` MCP tool directly)
13
+ - NOT for graph queries or exploration (use `ask_graph` or `query_graph`)
14
+
15
+ ## Process
16
+
17
+ 1. **EXTRACT:** Run code signal extractors, diagram parsers, BusinessKnowledgeIngestor, and KnowledgeLinker against the project
18
+ 2. **RECONCILE:** Build pre-extraction snapshot (current graph state) and post-extraction snapshot, then run StructuralDriftDetector
19
+ 3. **DETECT:** Partition findings by classification (new/stale/drifted/contradicting), generate gap report
20
+ 4. **REMEDIATE (only with `--fix`):** Apply safe remediations, convergence loop up to 5 iterations
21
+
22
+ ## Iron Law
23
+
24
+ **Auto-remediate stale findings only. Prompt for drifted and contradicting.** Never auto-resolve a `contradicting` finding — the human must decide which source is authoritative.
25
+
26
+ ## Flags
27
+
28
+ | Flag | Effect |
29
+ | ----------------- | ---------------------------------------------------------------- |
30
+ | `--fix` | Enable convergence-based auto-remediation (default: detect-only) |
31
+ | `--ci` | Non-interactive: apply safe fixes only, report everything else |
32
+ | `--domain <name>` | Limit pipeline to specific knowledge domain |
33
+
34
+ ## Shared Context Object
35
+
36
+ All phases read from and write to a shared `KnowledgePipelineContext`:
37
+
38
+ ```typescript
39
+ interface KnowledgePipelineContext {
40
+ extractionSnapshot: KnowledgeSnapshot;
41
+ currentSnapshot: KnowledgeSnapshot;
42
+ driftResult: DriftResult;
43
+ gapReport: GapReport;
44
+ remediationsApplied: string[];
45
+ iteration: number;
46
+ verdict: 'pass' | 'warn' | 'fail';
47
+ }
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Phase 1: EXTRACT
53
+
54
+ Extract business knowledge from all available sources into a fresh snapshot.
55
+
56
+ 1. **Code Signal Extractors:** Run `ExtractionRunner` against the project directory.
57
+ - Test description extractor
58
+ - Enum/constant extractor
59
+ - Validation rule extractor
60
+ - API path extractor
61
+ - Output goes to `.harness/knowledge/extracted/`
62
+
63
+ 2. **Diagram Parsers:** Run `DiagramParser.ingest()` for diagram-as-code files.
64
+ - Scans for `.mmd`, `.mermaid`, `.d2`, `.puml`, `.plantuml` files
65
+ - Extracts entities and relationships into `business_concept` nodes
66
+
67
+ 3. **Connector Sync** (if configured): Trigger connector sync for Jira, Slack, Confluence.
68
+ - Only runs if connectors are configured in `harness.config.json`
69
+ - Skip silently if no connectors
70
+
71
+ 4. **Build Fresh Snapshot:** Collect all extraction results into a `KnowledgeSnapshot`.
72
+ - Each entry has: `id`, `type`, `contentHash`, `source`, `name`
73
+
74
+ **Output:** `context.extractionSnapshot` populated.
75
+
76
+ ---
77
+
78
+ ## Phase 2: RECONCILE
79
+
80
+ Compare the fresh extraction against the current graph state.
81
+
82
+ 1. **Build Current Snapshot:** Read all `business_*` nodes from GraphStore.
83
+ - Map each node to a `KnowledgeSnapshotEntry`
84
+ - Use node ID as entry ID, compute contentHash from node content
85
+
86
+ 2. **Run Drift Detection:** Call `StructuralDriftDetector.detect(current, fresh)`.
87
+ - Produces `DriftResult` with findings classified as `new`, `drifted`, `stale`, `contradicting`
88
+ - Produces `driftScore` (0.0 - 1.0)
89
+
90
+ **Output:** `context.currentSnapshot` and `context.driftResult` populated.
91
+
92
+ ---
93
+
94
+ ## Phase 3: DETECT
95
+
96
+ Partition drift findings and classify safety.
97
+
98
+ 1. **Partition by classification:**
99
+
100
+ | Classification | Severity | Safety | Action |
101
+ | --------------- | -------- | ------------- | ------------------------- |
102
+ | `new` | low | safe | Stage automatically |
103
+ | `stale` | high | probably-safe | Auto-remove (source gone) |
104
+ | `drifted` | medium | probably-safe | Prompt for confirmation |
105
+ | `contradicting` | critical | unsafe | Never auto-resolve |
106
+
107
+ 2. **Generate Drift Report:** Present findings grouped by classification:
108
+
109
+ ```
110
+ KNOWLEDGE PIPELINE -- Drift Detection
111
+
112
+ Drift Score: 0.23 (12 findings / 52 entries)
113
+
114
+ NEW (4 findings, safe):
115
+ - business_rule:payments:refund-window [extractor]
116
+ - business_concept:auth:session-timeout [diagram]
117
+ ...
118
+
119
+ STALE (3 findings, probably-safe):
120
+ - business_fact:billing:old-rate-limit [extractor] — source file deleted
121
+ ...
122
+
123
+ DRIFTED (4 findings, requires confirmation):
124
+ - business_rule:checkout:tax-calculation [extractor] — content changed
125
+ ...
126
+
127
+ CONTRADICTING (1 finding, requires human decision):
128
+ - business_term:Settlement SLA — extractor says 24h, linker says 48h
129
+ ```
130
+
131
+ 3. **Generate Gap Report:** Run `KnowledgeStagingAggregator.generateGapReport()`.
132
+ - Lists domains with entry counts
133
+ - Write to `.harness/knowledge/gaps.md`
134
+
135
+ **Output:** Drift report and gap report written. `context.gapReport` populated.
136
+
137
+ ---
138
+
139
+ ## Phase 4: REMEDIATE (only with `--fix`)
140
+
141
+ Apply safe fixes and converge.
142
+
143
+ 1. **Stage `new` findings:** Write to `.harness/knowledge/staged/pipeline-staged.jsonl` via `KnowledgeStagingAggregator`.
144
+
145
+ 2. **Auto-remove `stale` findings:** Remove nodes from graph where source file no longer exists.
146
+ - Log each removal
147
+
148
+ 3. **Present `drifted` findings:** Ask the human to confirm each update.
149
+ - In `--ci` mode: skip, report as unresolved
150
+ - If confirmed: update the graph node with fresh content
151
+
152
+ 4. **Surface `contradicting` findings:** Never auto-resolve.
153
+ - Present both sources and ask the human which is authoritative
154
+ - In `--ci` mode: report as unresolved
155
+
156
+ 5. **Convergence Check:** After remediation:
157
+ - Re-run EXTRACT + RECONCILE + DETECT
158
+ - Count remaining findings
159
+ - If `newCount >= previousCount`: STOP (converged or no progress)
160
+ - If `newCount < previousCount`: continue (max 5 iterations)
161
+
162
+ ### Convergence Loop
163
+
164
+ ```
165
+ maxIterations = 5
166
+ previousCount = findings.length
167
+
168
+ while iteration < maxIterations:
169
+ 1. Apply safe remediations (new → stage, stale → remove)
170
+ 2. Present probably-safe remediations (skip in --ci)
171
+ 3. Log unsafe findings (never auto-apply)
172
+ 4. Re-run EXTRACT + RECONCILE + DETECT
173
+ 5. newCount = remaining findings
174
+ 6. if newCount >= previousCount: STOP (converged)
175
+ 7. previousCount = newCount; iteration++
176
+ ```
177
+
178
+ ---
179
+
180
+ ## Verdict Rules
181
+
182
+ After all phases complete, compute verdict:
183
+
184
+ | Verdict | Condition |
185
+ | ------- | ------------------------------------------------- |
186
+ | `pass` | Zero unresolved findings after pipeline |
187
+ | `warn` | Only `new` findings remain (low severity) |
188
+ | `fail` | Any `contradicting`, `stale`, or `drifted` remain |
189
+
190
+ Present verdict summary:
191
+
192
+ ```
193
+ KNOWLEDGE PIPELINE -- Verdict: WARN
194
+
195
+ Findings: 2 new (staged), 0 stale, 0 drifted, 0 contradicting
196
+ Gap Report: 3 domains, 12 total entries
197
+ Drift Score: 0.04
198
+ ```
199
+
200
+ ## Harness Integration
201
+
202
+ - **`ingest_source`** -- MCP tool for ingesting diagram sources (`source: 'diagrams'`)
203
+ - **`ExtractionRunner`** -- Code signal extraction from `@harness-engineering/graph`
204
+ - **`DiagramParser`** -- Diagram-as-code parsing from `@harness-engineering/graph`
205
+ - **`StructuralDriftDetector`** -- Drift detection from `@harness-engineering/graph`
206
+ - **`KnowledgeStagingAggregator`** -- Staging and gap reporting from `@harness-engineering/graph`
207
+ - **`harness validate`** -- Run after remediation to verify project health
208
+
209
+ ## Success Criteria
210
+
211
+ 1. All 4 phases execute in sequence (EXTRACT, RECONCILE, DETECT, REMEDIATE)
212
+ 2. Drift detection correctly classifies findings into 4 categories
213
+ 3. Auto-remediation only applies to safe/probably-safe findings
214
+ 4. Contradicting findings are never auto-resolved
215
+ 5. Convergence loop terminates when finding count stops decreasing (max 5 iterations)
216
+ 6. Gap report lists domains with entry counts
217
+ 7. Verdict accurately reflects remaining finding state
218
+ 8. `--ci` mode is fully non-interactive
219
+
220
+ ## Examples
221
+
222
+ ### Example: Running detect-only pipeline
223
+
224
+ ```
225
+ $ harness knowledge-pipeline
226
+
227
+ KNOWLEDGE PIPELINE -- Verdict: WARN
228
+
229
+ Drift Score: 0.12
230
+ Findings: 3 new, 0 stale, 0 drifted, 0 contradicting
231
+ Extraction: 12 code signals, 5 diagrams, 2 linker facts, 4 business knowledge
232
+ Gaps: 2 domains, 16 total entries
233
+ ```
234
+
235
+ ### Example: Running with fix mode
236
+
237
+ ```
238
+ $ harness knowledge-pipeline --fix
239
+
240
+ KNOWLEDGE PIPELINE -- Verdict: PASS
241
+
242
+ Drift Score: 0.00
243
+ Findings: 0 new, 0 stale, 0 drifted, 0 contradicting
244
+ Extraction: 12 code signals, 5 diagrams, 2 linker facts, 4 business knowledge
245
+ Gaps: 2 domains, 19 total entries
246
+ Convergence: 2 iterations
247
+ Remediations: 3 applied
248
+ ```
249
+
250
+ ### Example: CI gate mode
251
+
252
+ ```
253
+ $ harness knowledge-pipeline --ci --drift-check
254
+ # Exits 1 if unresolved drift exists
255
+ ```
256
+
257
+ ## Rationalizations to Reject
258
+
259
+ | Rationalization | Reality |
260
+ | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
261
+ | "The contradicting findings have an obvious resolution, so I can auto-fix them" | The Iron Law: contradicting findings require human decision. Different sources may have different authority levels that only the human understands. |
262
+ | "Drift score is low (0.05), so I can skip the DETECT phase and go straight to PASS" | Every finding must be classified regardless of drift score. A low score with one critical contradiction is still a FAIL. |
263
+ | "The stale entries might come back if the source is restored, so I should keep them" | Stale means the source is gone now. If it comes back, the next extraction will find it as NEW. Keeping stale entries pollutes the graph. |
264
+ | "I can run the convergence loop more than 5 times to get to zero findings" | The 5-iteration cap is a safety bound. If findings aren't decreasing, more iterations won't help — the remaining issues need human intervention. |
265
+
266
+ ## Gates
267
+
268
+ - **No auto-resolution of contradicting findings.** EVER. Present both sources, ask the human.
269
+ - **No skipping DETECT.** Even in `--fix` mode, DETECT must run before REMEDIATE.
270
+ - **No convergence beyond 5 iterations.** If findings aren't decreasing, stop and report.
271
+ - **No REMEDIATE without `--fix`.** Default mode is detect-and-report only.
272
+
273
+ ## Escalation
274
+
275
+ - **When no graph is available:** Run extractors and diagram parsers only. Skip reconciliation (no current snapshot). Report extraction results as gap analysis.
276
+ - **When connectors fail:** Log the error, continue with available sources. Note which connectors were skipped in the report.
277
+ - **When convergence stalls at iteration 1:** All remaining findings require human intervention. Present them and stop.
@@ -0,0 +1,60 @@
1
+ name: harness-knowledge-pipeline
2
+ version: "1.0.0"
3
+ description: 4-phase knowledge extraction, reconciliation, drift detection, and remediation with convergence loop
4
+ stability: static
5
+ cognitive_mode: constructive-architect
6
+ triggers:
7
+ - manual
8
+ platforms:
9
+ - claude-code
10
+ - gemini-cli
11
+ - cursor
12
+ - codex
13
+ tools:
14
+ - Bash
15
+ - Read
16
+ - Write
17
+ - Edit
18
+ - Glob
19
+ - Grep
20
+ cli:
21
+ command: harness skill run harness-knowledge-pipeline
22
+ args:
23
+ - name: path
24
+ description: Project root path
25
+ required: false
26
+ - name: fix
27
+ description: Enable auto-remediation of safe findings (default detect-only)
28
+ required: false
29
+ - name: ci
30
+ description: Non-interactive mode, skip probably-safe fixes
31
+ required: false
32
+ - name: domain
33
+ description: Limit pipeline to specific knowledge domain
34
+ required: false
35
+ mcp:
36
+ tool: run_skill
37
+ input:
38
+ skill: harness-knowledge-pipeline
39
+ path: string
40
+ type: rigid
41
+ tier: 2
42
+ phases:
43
+ - name: extract
44
+ description: Run code signal extractors, diagram parsers, and connector sync
45
+ required: true
46
+ - name: reconcile
47
+ description: Build snapshots and run structural drift detection
48
+ required: true
49
+ - name: detect
50
+ description: Partition findings by severity and safety classification
51
+ required: true
52
+ - name: remediate
53
+ description: Apply safe fixes, prompt for unsafe, convergence loop
54
+ required: false
55
+ state:
56
+ persistent: false
57
+ files:
58
+ - .harness/knowledge/staged/pipeline-staged.jsonl
59
+ - .harness/knowledge/gaps.md
60
+ depends_on: []
@@ -54,6 +54,21 @@ When no arguments are provided (standalone invocation), discover spec from conte
54
54
  Work backward from the goal. Start with "what must be true when we are done?"
55
55
 
56
56
  1. **State the goal.** One sentence. What does the system do when this plan is complete?
57
+
58
+ 1b. **Load skill recommendations.** After loading the spec, check for skill recommendations:
59
+
60
+ - If `docs/changes/<feature>/SKILLS.md` exists alongside the spec: parse the Apply and Reference tiers. These inform task annotation in Phase 2.
61
+ - If SKILLS.md is missing but a spec exists: run the advisor inline using `advise_skills` MCP tool to generate SKILLS.md.
62
+ - If neither SKILLS.md nor a spec exists: emit a one-line note:
63
+
64
+ ```
65
+ Note: No skill recommendations found. Run the advisor to discover
66
+ relevant design, framework, and knowledge skills:
67
+ harness advise-skills --spec-path <path>
68
+ ```
69
+
70
+ Store the parsed skill list for use in Phase 2 task annotation.
71
+
57
72
  2. **Derive observable truths.** What can be observed (running a command, opening a browser, reading a file) that proves the goal is met? Be specific:
58
73
  - BAD: "The API handles errors"
59
74
  - GOOD: "GET /api/users/nonexistent returns 404 with `{ error: 'User not found' }` body"
@@ -190,7 +205,16 @@ Report progress: `**[Phase 2/4]** DECOMPOSE — mapping file structure and creat
190
205
  - **Exact commit message**
191
206
  - **`harness validate`** as the final step
192
207
 
193
- 5. **Include checkpoints.** Mark tasks requiring human input:
208
+ 5. **Skill annotations.** If skill recommendations were loaded in Phase 1, annotate each task with relevant skills from the Apply and Reference tiers:
209
+
210
+ ```
211
+ ### Task 3: Implement dark mode toggle
212
+ **Skills:** `design-dark-mode` (apply), `a11y-color-contrast` (reference)
213
+ ```
214
+
215
+ Match skills to tasks based on keyword and domain overlap between the task description and the skill's purpose/keywords. Only annotate when the match is relevant to the specific task.
216
+
217
+ 6. **Include checkpoints.** Mark tasks requiring human input:
194
218
  - `[checkpoint:human-verify]` — Pause, show result, wait for confirmation
195
219
  - `[checkpoint:decision]` — Pause, present options, wait for choice
196
220
  - `[checkpoint:human-action]` — Pause, instruct human on required action
@@ -29,6 +29,17 @@
29
29
 
30
30
  4. **Recommend the target adoption level.** For new projects, start with basic unless the team has harness experience. For existing projects, recommend one level up from current. Present the recommendation and wait for confirmation.
31
31
 
32
+ 5. **Classify the project shape — product/service or test-suite?** Check these signals; if any match, the project is a test suite and the rest of this skill's flow changes:
33
+ - Repo or package name matches `*test*`, `*-e2e*`, `*-qa*`, `*-automation*`
34
+ - `package.json` has `@playwright/test`, `cypress`, `webdriverio`, `mocha`, or `testcafe` as a direct dep
35
+ - Top-level `tests/`, `e2e/`, `specs/`, or `playwright/` directories are the primary source tree
36
+ - Config files like `playwright.config.*`, `cypress.config.*`, `wdio.conf.*`
37
+ - No production runtime — build output consumed only by other test repos (shared library)
38
+
39
+ **If a test suite:** complete Phase 2 (scaffolding) here, then dispatch to `initialize-test-suite-project` for Phase 3 configuration and Phase 4 verification, then return here for Phase 4 step 4+ (knowledge graph, roadmap nudge, final commit). The test-suite skill owns archetype selection, layer variants, tags, reporters, and the custom report.
40
+
41
+ **If a product/service:** continue with the rest of this skill as written.
42
+
32
43
  ### Phase 2: SCAFFOLD — Generate Project Structure
33
44
 
34
45
  1. **Run `harness init` with the appropriate flags:**
@@ -72,6 +83,8 @@
72
83
  - **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.
73
84
  - **Not sure yet:** Skip i18n configuration entirely. Do not set `i18n.enabled`. The project can enable i18n later by running `harness-i18n-workflow` directly.
74
85
 
86
+ 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.
87
+
75
88
  ### Phase 4: VALIDATE — Confirm Everything Works
76
89
 
77
90
  1. **Run `harness validate`** to verify the full configuration. This checks:
@@ -107,6 +120,7 @@ This creates the `.harness/graph/` directory and populates it with the project's
107
120
  - **`harness validate`** — Verify the full project configuration is valid and complete.
108
121
  - **`harness check-deps`** — Verify dependency constraints match the actual codebase (intermediate and above).
109
122
  - **`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.
123
+ - **`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.
110
124
  - **Roadmap nudge** — After successful initialization, inform the user about `/harness:roadmap --create` for setting up project-level feature tracking. Informational only; does not create the roadmap.
111
125
 
112
126
  ## Success Criteria
@@ -120,15 +134,17 @@ This creates the `.harness/graph/` directory and populates it with the project's
120
134
  - The adoption level matches what was agreed upon with the human
121
135
  - All generated files are committed in a single atomic commit
122
136
  - i18n configuration is set if the human chose to enable it during init
137
+ - For test suites: `initialize-test-suite-project` ran to completion and its Success Criteria are also met
123
138
 
124
139
  ## Rationalizations to Reject
125
140
 
126
- | Rationalization | Why It Is Wrong |
127
- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
128
- | "The generated AGENTS.md template looks fine -- no need to customize it" | Phase 3 says do not blindly accept generated content. Without project-specific descriptions, agents receive generic instructions. |
129
- | "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. |
130
- | "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. |
131
- | "Validation passed, so the project is ready" | Phase 4 includes harness check-deps for intermediate+ projects and knowledge graph initialization. Validation alone is not sufficient. |
141
+ | Rationalization | Why It Is Wrong |
142
+ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
143
+ | "The generated AGENTS.md template looks fine -- no need to customize it" | Phase 3 says do not blindly accept generated content. Without project-specific descriptions, agents receive generic instructions. |
144
+ | "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. |
145
+ | "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. |
146
+ | "Validation passed, so the project is ready" | Phase 4 includes harness check-deps for intermediate+ projects and knowledge graph initialization. Validation alone is not sufficient. |
147
+ | "This is a test suite, we'll configure layers in this skill" | Phase 3 step 6 dispatches to `initialize-test-suite-project` for archetype selection, layer variants, and the rest. Do not inline test-suite-specific configuration here — the sub-skill owns it and carries the gotchas. |
132
148
 
133
149
  ## Examples
134
150
 
@@ -32,4 +32,5 @@ tier: 1
32
32
  state:
33
33
  persistent: false
34
34
  files: []
35
- depends_on: []
35
+ depends_on:
36
+ - initialize-test-suite-project