@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
@@ -1,522 +0,0 @@
1
- <!-- Generated by harness generate-slash-commands. Do not edit. -->
2
-
3
- # Harness Execution
4
-
5
- > Execute a plan task by task with atomic commits, checkpoint protocol, and persistent knowledge capture. Stop on blockers. Do not guess.
6
-
7
- ## When to Use
8
-
9
- - When an approved plan exists (output of harness-planning) and implementation should begin
10
- - When resuming execution of a previously started plan after a context reset
11
- - When `on_new_feature` or `on_bug_fix` triggers fire and a plan is already in place
12
- - NOT when no plan exists (use harness-planning first)
13
- - NOT when the plan needs revision (update the plan first, then resume execution)
14
- - NOT when exploring or brainstorming (use harness-brainstorming)
15
- - NOT for ad-hoc single-task work that does not follow a plan
16
-
17
- ## Process
18
-
19
- ### Iron Law
20
-
21
- **Execute the plan as written. If the plan is wrong, stop and fix the plan — do not improvise.**
22
-
23
- Deviating from the plan mid-execution introduces untested assumptions, breaks task atomicity, and makes progress untraceable. If a task cannot be completed as written, that is a blocker. Record it and stop.
24
-
25
- ---
26
-
27
- ### Phase 1: PREPARE — Load State and Verify Prerequisites
28
-
29
- 1. **Load the plan.** Read the plan document from `docs/plans/`. Identify the total task count and any checkpoints.
30
-
31
- 2. **Gather context in one call.** Use the `gather_context` MCP tool to load all working context at once:
32
-
33
- ```json
34
- gather_context({
35
- path: "<project-root>",
36
- intent: "Execute plan tasks starting from current position",
37
- skill: "harness-execution",
38
- session: "<session-slug-if-known>",
39
- include: ["state", "learnings", "handoff", "validation"]
40
- })
41
- ```
42
-
43
- **Session resolution:** If a session directory is known (passed via autopilot dispatch or available from a previous handoff), include the `session` parameter. This scopes all state reads/writes to `.harness/sessions/<slug>/`. If no session is known, omit it — `gather_context` falls back to global files at `.harness/`.
44
-
45
- This returns `state` (current position — if null, this is a fresh start at Task 1), `learnings` (hard-won insights from previous sessions — do not ignore them), `handoff` (structured context from the previous skill), and `validation` (current project health). If any constituent fails, its field is null and the error is reported in `meta.errors`.
46
-
47
- 3. **Load session summary for cold start.** If resuming a session (session slug is known), read the session summary for quick orientation:
48
- - Call `listActiveSessions()` to read the session index (~100 tokens).
49
- - If the target session is known, call `loadSessionSummary()` for that session (~200 tokens).
50
- - If ambiguous (multiple active sessions, no clear target), present the index to the user and ask which session to resume.
51
- - The summary provides skill, phase, status, key context, and next step — enough to orient without re-reading full state + learnings + plan.
52
-
53
- 4. **Check for known dead ends.** Review `learnings` entries tagged `[outcome:failure]`. If any match approaches in the current plan, surface warnings before proceeding.
54
-
55
- 5. **Verify prerequisites.** For the current task:
56
- - Are dependency tasks marked complete in state?
57
- - Do the files referenced in the task exist as expected?
58
- - Does the test suite pass? Run `harness validate` to confirm a clean baseline.
59
-
60
- 6. **If prerequisites fail,** do not proceed. Report what is missing and which task is blocked.
61
-
62
- ### Graph-Enhanced Context (when available)
63
-
64
- When a knowledge graph exists at `.harness/graph/`, use graph queries for faster, more accurate context:
65
-
66
- - `query_graph` — check file overlap between current and next task for conflict detection
67
- - `get_impact` — understand blast radius before executing a task
68
-
69
- Enables smarter execution ordering and blockage detection. Fall back to file-based commands if no graph is available.
70
-
71
- ---
72
-
73
- ### Phase 2: EXECUTE — Implement Tasks Atomically
74
-
75
- When reporting task progress, use progress markers:
76
-
77
- ```
78
- **[Phase N/M]** Task N — <task description>
79
- ```
80
-
81
- For each task, starting from the current position:
82
-
83
- 1. **Read the task instructions completely** before writing any code. Understand what files to touch, what tests to write, what the expected outcome is.
84
-
85
- 2. **Follow the task instructions exactly.** The plan contains exact file paths, exact code, and exact commands. Execute them as written.
86
-
87
- 3. **TDD rhythm within each task:**
88
- - Write the test as specified in the task
89
- - Run the test — observe it fail (for the right reason)
90
- - Write the implementation as specified in the task
91
- - Run the test — observe it pass
92
- - Run `harness validate`
93
-
94
- 4. **Commit atomically.** Each task produces exactly one commit. Use the commit message specified in the plan. If no message is specified, write a descriptive message in the project's convention.
95
-
96
- 5. **Run mechanical gate.** After each task commit, run the full gate check. Use `assess_project` to run harness checks (including lint) in parallel, then run the test suite:
97
-
98
- ```json
99
- assess_project({
100
- path: "<project-root>",
101
- checks: ["validate", "deps", "lint"],
102
- mode: "summary"
103
- })
104
- ```
105
-
106
- Then run the project's test suite (`npx turbo run test` or equivalent). This is binary pass/fail.
107
- - **All pass →** proceed to the next task.
108
- - **Any fail →** retry with error context (max 2 attempts).
109
- - **Still failing after retries →** record the failure in `.harness/failures.md`, escalate, and stop.
110
-
111
- 6. **Update state after each task.** Write to `.harness/state.json`:
112
-
113
- ```json
114
- {
115
- "schemaVersion": 1,
116
- "position": { "phase": "execute", "task": "Task N" },
117
- "progress": { "Task 1": "complete", "Task 2": "complete", "Task 3": "in_progress" },
118
- "lastSession": { "date": "YYYY-MM-DD", "summary": "Completed Tasks 1-2, starting Task 3" }
119
- }
120
- ```
121
-
122
- 7. **Handle checkpoints** according to the checkpoint protocol (see below).
123
-
124
- ---
125
-
126
- ### Checkpoint Protocol
127
-
128
- Plans contain three types of checkpoints. Each requires pausing execution.
129
-
130
- **`[checkpoint:human-verify]` — Show and Confirm**
131
-
132
- 1. Stop execution.
133
- 2. Use `emit_interaction` to present the checkpoint:
134
- ```json
135
- emit_interaction({
136
- path: "<project-root>",
137
- type: "confirmation",
138
- confirmation: {
139
- text: "Task N complete. Output: <summary>. Continue to Task N+1?",
140
- context: "<test output or file diff summary>",
141
- impact: "Continuing proceeds to the next task. Declining pauses execution for review.",
142
- risk: "low"
143
- }
144
- })
145
- ```
146
- 3. Wait for the human to confirm before proceeding.
147
-
148
- **`[checkpoint:decision]` — Present Options and Wait**
149
-
150
- 1. Stop execution.
151
- 2. Use `emit_interaction` to present the decision:
152
- ```json
153
- emit_interaction({
154
- path: "<project-root>",
155
- type: "question",
156
- question: {
157
- text: "Task N requires a decision: <description>",
158
- options: [
159
- {
160
- label: "<option A>",
161
- pros: ["<pro 1>", "<pro 2>"],
162
- cons: ["<con 1>"],
163
- risk: "low",
164
- effort: "low"
165
- },
166
- {
167
- label: "<option B>",
168
- pros: ["<pro 1>"],
169
- cons: ["<con 1>", "<con 2>"],
170
- risk: "medium",
171
- effort: "medium"
172
- }
173
- ],
174
- recommendation: {
175
- optionIndex: 0,
176
- reason: "<why this option is recommended>",
177
- confidence: "medium"
178
- }
179
- }
180
- })
181
- ```
182
- 3. Wait for the human to choose.
183
-
184
- **`[checkpoint:human-action]` — Instruct and Wait**
185
-
186
- 1. Stop execution.
187
- 2. Tell the human exactly what they need to do (e.g., "Create an API key at [URL] and paste it here").
188
- 3. State: "Task N requires your action: [instructions]. Let me know when done."
189
- 4. Wait for the human to complete the action and confirm.
190
-
191
- ---
192
-
193
- ### Phase 3: VERIFY — Two-Tier Validation
194
-
195
- **Quick gate (default):** The mechanical gate in Phase 2 Step 5 IS the standard verification. Every task commit must pass it before proceeding. No additional verification step is needed for normal execution.
196
-
197
- **Deep audit (on-demand):** When `--deep` is passed or at milestone boundaries (e.g., end of a phase, final task), invoke the full `harness-verification` skill for 3-level audit:
198
-
199
- 1. **EXISTS** — Do the artifacts the task claims to produce actually exist?
200
- 2. **SUBSTANTIVE** — Do those artifacts contain meaningful, correct content (not stubs or placeholders)?
201
- 3. **WIRED** — Are those artifacts integrated into the system (imported, routed, tested, reachable)?
202
-
203
- If the deep audit fails at any level, treat it as a blocker. Record it and stop.
204
-
205
- After all tasks pass verification:
206
-
207
- ```json
208
- emit_interaction({
209
- path: "<project-root>",
210
- type: "transition",
211
- transition: {
212
- completedPhase: "execution",
213
- suggestedNext: "verification",
214
- reason: "All plan tasks executed and verified",
215
- artifacts: ["<list of created/modified files>"],
216
- qualityGate: {
217
- checks: [
218
- { name: "all-tasks-complete", passed: true, detail: "<N>/<N> tasks" },
219
- { name: "harness-validate", passed: true },
220
- { name: "tests-pass", passed: true }
221
- ],
222
- allPassed: true
223
- }
224
- }
225
- })
226
- ```
227
-
228
- ---
229
-
230
- ### Phase 4: PERSIST — Save Progress and Learnings
231
-
232
- Between tasks (especially between sessions):
233
-
234
- 1. **Update state (session-scoped `{sessionDir}/state.json` if session is known, otherwise `.harness/state.json`)** with current position, progress, and `lastSession` context:
235
-
236
- ```json
237
- {
238
- "lastSession": {
239
- "lastSkill": "harness-execution",
240
- "pendingTasks": ["Task 4", "Task 5"]
241
- }
242
- }
243
- ```
244
-
245
- ### Graph Refresh
246
-
247
- If a knowledge graph exists at `.harness/graph/`, refresh it after code changes to keep graph queries accurate:
248
-
249
- ```
250
- harness scan [path]
251
- ```
252
-
253
- Skipping this step means subsequent graph queries (impact analysis, dependency health, test advisor) may return stale results.
254
-
255
- 2. **Append tagged learnings to the session-scoped learnings file (`{sessionDir}/learnings.md` if session is known, otherwise `.harness/learnings.md`).** Tag every entry with skill and outcome:
256
-
257
- ```markdown
258
- ## YYYY-MM-DD — Task N: <task name>
259
-
260
- - [skill:harness-execution] [outcome:success] What was accomplished
261
- - [skill:harness-execution] [outcome:gotcha] What was surprising or non-obvious
262
- - [skill:harness-execution] [outcome:decision] What was decided and why
263
- ```
264
-
265
- 3. **Record failures in the session-scoped failures file (`{sessionDir}/failures.md` if session is known, otherwise `.harness/failures.md`)** if any task was escalated after retry exhaustion (from Phase 2 Step 5). Include the approach attempted and why it failed, so future sessions avoid the same dead end.
266
-
267
- 4. **Write the session-scoped handoff (`{sessionDir}/handoff.json` if session is known, otherwise `.harness/handoff.json`)** with structured context for the next skill or session:
268
-
269
- ```json
270
- {
271
- "fromSkill": "harness-execution",
272
- "timestamp": "YYYY-MM-DDTHH:MM:SSZ",
273
- "summary": "Completed Tasks 1-3. Task 4 blocked on missing API endpoint.",
274
- "pendingTasks": ["Task 4", "Task 5"],
275
- "blockers": ["Task 4: /api/notifications endpoint not implemented"],
276
- "learnings": ["Date comparison needs UTC normalization"]
277
- }
278
- ```
279
-
280
- 5. **Write session summary.** Write/update the session summary for cold-start context restoration:
281
-
282
- ```json
283
- writeSessionSummary(projectPath, sessionSlug, {
284
- session: "<session-slug>",
285
- lastActive: "<ISO timestamp>",
286
- skill: "harness-execution",
287
- phase: "<current phase of plan>",
288
- status: "<e.g., Task 4/6 complete, paused at CHECKPOINT>",
289
- spec: "<spec path if known>",
290
- plan: "<plan path>",
291
- keyContext: "<1-2 sentences: what was accomplished, key decisions made>",
292
- nextStep: "<what to do next when resuming>"
293
- })
294
- ```
295
-
296
- This overwrites any previous summary for this session. The index.md is updated automatically.
297
-
298
- 6. **Sync roadmap (mandatory when present).** If `docs/roadmap.md` exists, call `manage_roadmap` with action `sync` and `apply: true` to update linked feature statuses from the just-completed execution state. Do not use `force_sync: true` — the human-always-wins rule applies. If `manage_roadmap` is unavailable, fall back to direct file manipulation using `syncRoadmap()` from core. If no roadmap exists, skip silently.
299
-
300
- 7. **Learnings are append-only.** Never edit or delete previous learnings. They are a chronological record.
301
-
302
- 8. **Auto-transition to verification.** When ALL tasks in the plan are complete (not when stopping mid-plan):
303
-
304
- Call `emit_interaction`:
305
-
306
- ```json
307
- {
308
- "type": "transition",
309
- "transition": {
310
- "completedPhase": "execution",
311
- "suggestedNext": "verification",
312
- "reason": "All tasks complete",
313
- "artifacts": ["<list of created/modified files>"],
314
- "requiresConfirmation": false,
315
- "summary": "Completed <N> tasks. <N> files created, <N> modified. All quick gates passed.",
316
- "qualityGate": {
317
- "checks": [
318
- { "name": "all-tasks-complete", "passed": true, "detail": "<N>/<N> tasks" },
319
- { "name": "harness-validate", "passed": true },
320
- { "name": "tests-pass", "passed": true },
321
- { "name": "no-blockers", "passed": true }
322
- ],
323
- "allPassed": true
324
- }
325
- }
326
- }
327
- ```
328
-
329
- The response will include `nextAction: "Invoke harness-verification skill now"`.
330
- Immediately invoke harness-verification without waiting for user input.
331
-
332
- **Important:** Only emit this transition when all tasks are complete. If execution stopped due to a blocker, checkpoint, or partial completion, do NOT emit a transition -- write the handoff and stop.
333
-
334
- ---
335
-
336
- ### Stopping Conditions
337
-
338
- These are non-negotiable. When any condition is met, stop immediately.
339
-
340
- - **Hit a blocker.** The task cannot be completed as written. Something is missing, broken, or wrong. Do not guess at a fix. Do not improvise. Record the blocker in state and report it: "Blocked on Task N: [specific issue]. The plan needs to be updated."
341
-
342
- - **Test failure after implementation.** The test was supposed to pass but does not. Do not retry blindly. Read the failure. Diagnose the root cause. If the fix is within the current task scope, fix it. If not, stop — the plan may be wrong.
343
-
344
- - **Unclear instruction.** The task says something ambiguous or contradictory. Do not interpret it. Ask: "Task N says [quote]. I interpret this as [interpretation]. Is that correct?"
345
-
346
- - **Harness validation failure.** `harness validate` fails after a task. Do not proceed. The task introduced an architectural violation or constraint breach. Fix it before moving on.
347
-
348
- - **Three consecutive failures on the same task.** After 3 attempts, the task design is likely wrong. Stop. Report: "Task N has failed 3 times. Root cause: [analysis]. The plan may need revision."
349
-
350
- ## Session State
351
-
352
- This skill reads and writes to the following session sections via `manage_state`:
353
-
354
- | Section | Read | Write | Purpose |
355
- | ------------- | ---- | ----- | ------------------------------------------------------------------------------------- |
356
- | terminology | yes | yes | Reads domain terms for consistent naming; adds terms discovered during implementation |
357
- | decisions | yes | yes | Reads planning decisions for context; records implementation decisions |
358
- | constraints | yes | yes | Reads constraints to respect boundaries; adds constraints discovered during coding |
359
- | risks | yes | yes | Reads risks for awareness; updates risk status as mitigated or realized |
360
- | openQuestions | yes | yes | Reads questions for context; resolves questions answered by implementation |
361
- | evidence | yes | yes | Reads prior evidence; writes file:line citations, test outputs, and diff references |
362
-
363
- **When to write:** After each task completion, append relevant entries. Evidence entries should be written for every significant technical assertion (test result, file reference, performance measurement). Mark openQuestions as resolved when implementation answers them.
364
-
365
- **When to read:** During Phase 1 (PREPARE), read all sections via `gather_context` with `include: ["sessions"]` to inherit full accumulated context from brainstorming and planning.
366
-
367
- ## Evidence Requirements
368
-
369
- When this skill makes claims about task completion, test results, or code behavior, it MUST cite evidence using one of:
370
-
371
- 1. **File reference:** `file:line` format (e.g., `src/services/notification-service.ts:42` -- "create method implemented with validation")
372
- 2. **Test output:** Include the actual test command and its output:
373
- ```
374
- $ npx vitest run src/services/notification-service.test.ts
375
- PASS src/services/notification-service.test.ts (8 tests)
376
- ```
377
- 3. **Diff evidence:** Before/after with file path for modifications to existing files
378
- 4. **Harness output:** Include `harness validate` output as evidence of project health
379
- 5. **Session evidence:** Write to the `evidence` session section after each task:
380
- ```json
381
- manage_state({
382
- action: "append_entry",
383
- session: "<current-session>",
384
- section: "evidence",
385
- authorSkill: "harness-execution",
386
- content: "src/services/notification-service.ts:42 -- create method returns Notification with all required fields"
387
- })
388
- ```
389
-
390
- **When to cite:** After every task completion in Phase 2 (EXECUTE). Every commit message claim ("added X", "fixed Y") must be backed by test output or file reference. During Phase 4 (PERSIST) when writing learnings that reference specific code behavior.
391
-
392
- **Uncited claims:** Technical assertions without citations MUST be prefixed with `[UNVERIFIED]`. Example: `[UNVERIFIED] The notification service handles duplicate entries`. Uncited claims are flagged during review (Wave 2.2).
393
-
394
- ## Harness Integration
395
-
396
- - **`harness validate`** — Run after every task completion. Mandatory. No task is complete without a passing validation.
397
- - **`gather_context`** — Used in PREPARE phase to load state, learnings, handoff, and validation in a single call instead of 4+ separate reads.
398
- - **`harness check-deps`** — Run when tasks add new imports or modules. Catches boundary violations early.
399
- - **`harness state show`** — View current execution position and progress.
400
- - **`harness state learn "<message>"`** — Append a learning from the command line.
401
- - **State file** — Session-scoped at `{sessionDir}/state.json` when session is known, otherwise `.harness/state.json`. Read at session start to resume position. Updated after every task.
402
- - **Learnings file** — Session-scoped at `{sessionDir}/learnings.md` when session is known, otherwise `.harness/learnings.md`. Append-only knowledge capture. Read at session start for prior context.
403
- - **Roadmap sync** — After completing plan execution, call `manage_roadmap` with action `sync` and `apply: true` to update roadmap status. Mandatory when `docs/roadmap.md` exists. Do not use `force_sync: true`. Falls back to `syncRoadmap()` from core if MCP tool is unavailable.
404
- - **`emit_interaction`** -- Call at plan completion to auto-transition to harness-verification. Uses auto-transition (proceeds immediately without user confirmation).
405
-
406
- ## Success Criteria
407
-
408
- - Every task in the plan is executed in order, atomically, with one commit per task
409
- - `.harness/state.json` accurately reflects current position and progress
410
- - `.harness/learnings.md` contains entries for every session with non-trivial discoveries
411
- - `harness validate` passes after every task
412
- - Checkpoints were honored: execution paused at every `[checkpoint:*]` marker
413
- - No improvisation: tasks were executed as written, or execution was stopped and the blocker was reported
414
- - All stopping conditions were respected (no guessing past blockers, no blind retries)
415
-
416
- ## Examples
417
-
418
- ### Example: Executing a 5-Task Notification Plan
419
-
420
- **Session Start (fresh):**
421
-
422
- ```
423
- Read plan: docs/plans/2026-03-14-notifications-plan.md (5 tasks)
424
- Read state: .harness/state.json — file not found (fresh start, position: Task 1)
425
- Read learnings: .harness/learnings.md — file not found (no prior context)
426
- Run: harness validate — passes. Clean baseline confirmed.
427
- ```
428
-
429
- **Task 1: Define notification types**
430
-
431
- ```
432
- 1. Create src/types/notification.ts with Notification interface
433
- 2. Run: harness validate — passes
434
- 3. Commit: "feat(notifications): define Notification type"
435
- 4. Update state: { position: Task 2, progress: { "Task 1": "complete" } }
436
- ```
437
-
438
- **Task 2: Create notification service (TDD)**
439
-
440
- ```
441
- 1. Write test: src/services/notification-service.test.ts
442
- 2. Run test: FAIL — NotificationService is not defined (correct failure)
443
- 3. Implement: src/services/notification-service.ts
444
- 4. Run test: PASS
445
- 5. Run: harness validate — passes
446
- 6. Commit: "feat(notifications): add NotificationService.create"
447
- 7. Update state: { position: Task 3, progress: { "Task 1": "complete", "Task 2": "complete" } }
448
- ```
449
-
450
- **Task 3: Add list and expiry (TDD) — has checkpoint**
451
-
452
- ```
453
- [checkpoint:human-verify] — "Tasks 1-2 complete. NotificationService can create
454
- notifications. Tests pass. Continue to Task 3 (list and expiry methods)?"
455
- Human: "Continue."
456
-
457
- 1. Write tests: list by userId, filter expired
458
- 2. Run tests: FAIL (methods not implemented)
459
- 3. Implement list() and isExpired()
460
- 4. Run tests: PASS
461
- 5. Run: harness validate — passes
462
- 6. Commit: "feat(notifications): add list and expiry to NotificationService"
463
- 7. Update state, append learning:
464
- "## 2026-03-14 — Task 3: list and expiry
465
- - [gotcha]: Date comparison needed UTC normalization — used Date.now() not new Date()"
466
- ```
467
-
468
- **Context reset mid-plan (resume at Task 4):**
469
-
470
- ```
471
- Read plan: docs/plans/2026-03-14-notifications-plan.md
472
- Read state: .harness/state.json — position: Task 4, Tasks 1-3 complete
473
- Read learnings: .harness/learnings.md — "Date comparison needed UTC normalization"
474
- Run: harness validate — passes. Resume from Task 4.
475
- ```
476
-
477
- ## Rationalizations to Reject
478
-
479
- | Rationalization | Reality |
480
- | --- | --- |
481
- | "The plan says to do X, but doing Y would be cleaner -- I will improvise" | The Iron Law states: execute the plan as written. If the plan is wrong, stop and fix the plan. Improvising mid-execution introduces untested assumptions. |
482
- | "This task depends on Task 3 which I know is done, so I can skip verifying prerequisites" | Prerequisites must be verified mechanically, not from memory. Check that dependency tasks are marked complete in state and that referenced files exist. |
483
- | "The checkpoint is just a confirmation step and the output looks correct, so I will auto-continue" | Checkpoints are non-negotiable pause points. If a task has a checkpoint marker, execution must pause. |
484
- | "Harness validate passed on the previous task and nothing changed structurally, so I can skip it for this one" | Validation runs after every task with no exceptions. Each task may introduce subtle architectural drift that only harness validate catches. |
485
-
486
- ## Gates
487
-
488
- These are hard stops. Violating any gate means the process has broken down.
489
-
490
- - **No execution without a plan.** If no plan document exists, do not start. Use harness-planning to create one.
491
- - **No improvisation.** Execute the plan as written. If the plan says "create file X with code Y," create file X with code Y. Do not add "improvements" or "optimizations" that are not in the plan.
492
- - **No skipping tasks.** Tasks are ordered by dependency. Skipping a task means later tasks may fail. Execute in order.
493
- - **No skipping validation.** `harness validate` runs after every task. No exceptions. A task that passes its tests but fails validation is not complete.
494
- - **No ignoring checkpoints.** If a task has a `[checkpoint:*]` marker, execution must pause. Do not auto-continue past checkpoints.
495
- - **No guessing past blockers.** If a task cannot be completed as written, stop. Report the blocker. Do not invent a workaround.
496
- - **State must be updated.** After every task, `.harness/state.json` must reflect the new position. Skipping state updates makes resume impossible.
497
-
498
- ## Escalation
499
-
500
- - **When a task fails and the fix is outside task scope:** Report: "Task N failed because [reason]. The fix requires changes to [files/tasks outside scope]. The plan needs to be updated at Tasks [X, Y] before I can continue."
501
- - **When the plan references files that do not exist:** The plan is out of date or was written against a different branch. Report: "Task N references [file] which does not exist. Plan may need regeneration."
502
- - **When tests pass but behavior seems wrong:** Do not ignore your instinct, but also do not act on it unilaterally. Report: "Task N passes all tests, but I notice [observation]. Should I investigate before proceeding?"
503
- - **When state is corrupted or inconsistent:** If `.harness/state.json` says Task 5 is complete but the code for Task 5 does not exist, the state is wrong. Report the inconsistency. Do not trust corrupted state — re-verify from Task 1 if needed.
504
- - **When the human wants to skip ahead:** Explain the risk: "Skipping Task N means Tasks [X, Y] that depend on it may fail. If you want to skip, we should update the plan to remove the dependency." Get explicit approval before skipping.
505
-
506
- ## Trace Output (Optional)
507
-
508
- When `.harness/gate.json` has `"trace": true` or `--verbose` is passed, append one-sentence reasoning at each phase boundary to `.harness/trace.md`.
509
-
510
- **Format:** `**[PHASE HH:MM:SS]** summary`
511
-
512
- Example:
513
-
514
- ```markdown
515
- **[PREPARE 14:32:07]** Loaded plan with 5 tasks, resuming from Task 3 per state.json.
516
- **[EXECUTE 14:32:15]** Task 3 committed; mechanical gate passed on first attempt.
517
- **[VERIFY 14:35:42]** Deep audit requested at milestone; all 3 levels passed.
518
- **[PERSIST 14:35:50]** State updated, handoff.json written with 2 pending tasks.
519
- ```
520
-
521
- This is for human debugging only. Not required for normal execution.
522
-
@@ -1,3 +0,0 @@
1
- # Reserved for Phase B native integration
2
- name: harness-execution
3
- version: "1.0.0"