@harness-engineering/cli 1.7.0 → 1.8.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 (187) hide show
  1. package/dist/agents/personas/documentation-maintainer.yaml +3 -1
  2. package/dist/agents/personas/performance-guardian.yaml +23 -0
  3. package/dist/agents/skills/claude-code/align-documentation/SKILL.md +13 -0
  4. package/dist/agents/skills/claude-code/cleanup-dead-code/SKILL.md +25 -1
  5. package/dist/agents/skills/claude-code/cleanup-dead-code/skill.yaml +5 -2
  6. package/dist/agents/skills/claude-code/detect-doc-drift/SKILL.md +12 -0
  7. package/dist/agents/skills/claude-code/enforce-architecture/SKILL.md +48 -1
  8. package/dist/agents/skills/claude-code/enforce-architecture/skill.yaml +5 -2
  9. package/dist/agents/skills/claude-code/harness-accessibility/SKILL.md +7 -0
  10. package/dist/agents/skills/claude-code/harness-autopilot/SKILL.md +11 -3
  11. package/dist/agents/skills/claude-code/harness-brainstorming/SKILL.md +81 -11
  12. package/dist/agents/skills/claude-code/harness-brainstorming/skill.yaml +2 -0
  13. package/dist/agents/skills/claude-code/harness-code-review/SKILL.md +487 -234
  14. package/dist/agents/skills/claude-code/harness-code-review/skill.yaml +15 -2
  15. package/dist/agents/skills/claude-code/harness-codebase-cleanup/SKILL.md +226 -0
  16. package/dist/agents/skills/claude-code/harness-codebase-cleanup/skill.yaml +64 -0
  17. package/dist/agents/skills/claude-code/harness-dependency-health/SKILL.md +35 -6
  18. package/dist/agents/skills/claude-code/harness-docs-pipeline/SKILL.md +460 -0
  19. package/dist/agents/skills/claude-code/harness-docs-pipeline/skill.yaml +69 -0
  20. package/dist/agents/skills/claude-code/harness-execution/SKILL.md +73 -8
  21. package/dist/agents/skills/claude-code/harness-execution/skill.yaml +1 -0
  22. package/dist/agents/skills/claude-code/harness-hotspot-detector/SKILL.md +32 -6
  23. package/dist/agents/skills/claude-code/harness-i18n/SKILL.md +484 -0
  24. package/dist/agents/skills/claude-code/harness-i18n/skill.yaml +54 -0
  25. package/dist/agents/skills/claude-code/harness-i18n-process/SKILL.md +388 -0
  26. package/dist/agents/skills/claude-code/harness-i18n-process/skill.yaml +43 -0
  27. package/dist/agents/skills/claude-code/harness-i18n-workflow/SKILL.md +512 -0
  28. package/dist/agents/skills/claude-code/harness-i18n-workflow/skill.yaml +53 -0
  29. package/dist/agents/skills/claude-code/harness-impact-analysis/SKILL.md +35 -6
  30. package/dist/agents/skills/claude-code/harness-integrity/SKILL.md +17 -1
  31. package/dist/agents/skills/claude-code/harness-knowledge-mapper/SKILL.md +46 -5
  32. package/dist/agents/skills/claude-code/harness-perf/SKILL.md +37 -8
  33. package/dist/agents/skills/claude-code/harness-perf/skill.yaml +3 -0
  34. package/dist/agents/skills/claude-code/harness-perf-tdd/SKILL.md +17 -4
  35. package/dist/agents/skills/claude-code/harness-planning/SKILL.md +59 -5
  36. package/dist/agents/skills/claude-code/harness-planning/skill.yaml +2 -0
  37. package/dist/agents/skills/claude-code/harness-release-readiness/SKILL.md +16 -0
  38. package/dist/agents/skills/claude-code/harness-roadmap/SKILL.md +561 -0
  39. package/dist/agents/skills/claude-code/harness-roadmap/skill.yaml +43 -0
  40. package/dist/agents/skills/claude-code/harness-security-review/SKILL.md +36 -2
  41. package/dist/agents/skills/claude-code/harness-security-review/skill.yaml +8 -6
  42. package/dist/agents/skills/claude-code/harness-soundness-review/SKILL.md +1267 -0
  43. package/dist/agents/skills/claude-code/harness-soundness-review/skill.yaml +48 -0
  44. package/dist/agents/skills/claude-code/harness-test-advisor/SKILL.md +35 -6
  45. package/dist/agents/skills/claude-code/harness-verification/SKILL.md +66 -0
  46. package/dist/agents/skills/claude-code/harness-verification/skill.yaml +1 -0
  47. package/dist/agents/skills/claude-code/harness-verify/SKILL.md +11 -0
  48. package/dist/agents/skills/claude-code/initialize-harness-project/SKILL.md +15 -1
  49. package/dist/agents/skills/claude-code/validate-context-engineering/SKILL.md +12 -0
  50. package/dist/agents/skills/gemini-cli/add-harness-component/SKILL.md +192 -0
  51. package/dist/agents/skills/gemini-cli/add-harness-component/skill.yaml +32 -0
  52. package/dist/agents/skills/gemini-cli/align-documentation/SKILL.md +213 -0
  53. package/dist/agents/skills/gemini-cli/align-documentation/skill.yaml +31 -0
  54. package/dist/agents/skills/gemini-cli/check-mechanical-constraints/SKILL.md +191 -0
  55. package/dist/agents/skills/gemini-cli/check-mechanical-constraints/skill.yaml +32 -0
  56. package/dist/agents/skills/gemini-cli/cleanup-dead-code/SKILL.md +245 -0
  57. package/dist/agents/skills/gemini-cli/cleanup-dead-code/skill.yaml +33 -0
  58. package/dist/agents/skills/gemini-cli/detect-doc-drift/SKILL.md +179 -0
  59. package/dist/agents/skills/gemini-cli/detect-doc-drift/skill.yaml +30 -0
  60. package/dist/agents/skills/gemini-cli/enforce-architecture/SKILL.md +240 -0
  61. package/dist/agents/skills/gemini-cli/enforce-architecture/skill.yaml +34 -0
  62. package/dist/agents/skills/gemini-cli/harness-accessibility/SKILL.md +7 -0
  63. package/dist/agents/skills/gemini-cli/harness-architecture-advisor/SKILL.md +397 -0
  64. package/dist/agents/skills/gemini-cli/harness-architecture-advisor/skill.yaml +48 -0
  65. package/dist/agents/skills/gemini-cli/harness-autopilot/SKILL.md +11 -3
  66. package/dist/agents/skills/gemini-cli/harness-brainstorming/SKILL.md +317 -0
  67. package/dist/agents/skills/gemini-cli/harness-brainstorming/skill.yaml +49 -0
  68. package/dist/agents/skills/gemini-cli/harness-code-review/SKILL.md +681 -0
  69. package/dist/agents/skills/gemini-cli/harness-code-review/skill.yaml +45 -0
  70. package/dist/agents/skills/gemini-cli/harness-codebase-cleanup/SKILL.md +226 -0
  71. package/dist/agents/skills/gemini-cli/harness-codebase-cleanup/skill.yaml +64 -0
  72. package/dist/agents/skills/gemini-cli/harness-debugging/SKILL.md +366 -0
  73. package/dist/agents/skills/gemini-cli/harness-debugging/skill.yaml +47 -0
  74. package/dist/agents/skills/gemini-cli/harness-dependency-health/SKILL.md +35 -6
  75. package/dist/agents/skills/gemini-cli/harness-diagnostics/SKILL.md +318 -0
  76. package/dist/agents/skills/gemini-cli/harness-diagnostics/skill.yaml +50 -0
  77. package/dist/agents/skills/gemini-cli/harness-docs-pipeline/SKILL.md +460 -0
  78. package/dist/agents/skills/gemini-cli/harness-docs-pipeline/skill.yaml +69 -0
  79. package/dist/agents/skills/gemini-cli/harness-execution/SKILL.md +382 -0
  80. package/dist/agents/skills/gemini-cli/harness-execution/skill.yaml +51 -0
  81. package/dist/agents/skills/gemini-cli/harness-git-workflow/SKILL.md +268 -0
  82. package/dist/agents/skills/gemini-cli/harness-git-workflow/skill.yaml +31 -0
  83. package/dist/agents/skills/gemini-cli/harness-hotspot-detector/SKILL.md +32 -6
  84. package/dist/agents/skills/gemini-cli/harness-i18n/SKILL.md +484 -0
  85. package/dist/agents/skills/gemini-cli/harness-i18n/skill.yaml +54 -0
  86. package/dist/agents/skills/gemini-cli/harness-i18n-process/SKILL.md +388 -0
  87. package/dist/agents/skills/gemini-cli/harness-i18n-process/skill.yaml +43 -0
  88. package/dist/agents/skills/gemini-cli/harness-i18n-workflow/SKILL.md +512 -0
  89. package/dist/agents/skills/gemini-cli/harness-i18n-workflow/skill.yaml +53 -0
  90. package/dist/agents/skills/gemini-cli/harness-impact-analysis/SKILL.md +35 -6
  91. package/dist/agents/skills/gemini-cli/harness-integrity/SKILL.md +167 -0
  92. package/dist/agents/skills/gemini-cli/harness-integrity/skill.yaml +47 -0
  93. package/dist/agents/skills/gemini-cli/harness-knowledge-mapper/SKILL.md +46 -5
  94. package/dist/agents/skills/gemini-cli/harness-onboarding/SKILL.md +288 -0
  95. package/dist/agents/skills/gemini-cli/harness-onboarding/skill.yaml +30 -0
  96. package/dist/agents/skills/gemini-cli/harness-parallel-agents/SKILL.md +171 -0
  97. package/dist/agents/skills/gemini-cli/harness-parallel-agents/skill.yaml +33 -0
  98. package/dist/agents/skills/gemini-cli/harness-perf/SKILL.md +37 -8
  99. package/dist/agents/skills/gemini-cli/harness-perf/skill.yaml +3 -0
  100. package/dist/agents/skills/gemini-cli/harness-perf-tdd/SKILL.md +17 -4
  101. package/dist/agents/skills/gemini-cli/harness-planning/SKILL.md +389 -0
  102. package/dist/agents/skills/gemini-cli/harness-planning/skill.yaml +49 -0
  103. package/dist/agents/skills/gemini-cli/harness-pre-commit-review/SKILL.md +262 -0
  104. package/dist/agents/skills/gemini-cli/harness-pre-commit-review/skill.yaml +33 -0
  105. package/dist/agents/skills/gemini-cli/harness-refactoring/SKILL.md +169 -0
  106. package/dist/agents/skills/gemini-cli/harness-refactoring/skill.yaml +33 -0
  107. package/dist/agents/skills/gemini-cli/harness-release-readiness/SKILL.md +16 -0
  108. package/dist/agents/skills/gemini-cli/harness-roadmap/SKILL.md +561 -0
  109. package/dist/agents/skills/gemini-cli/harness-roadmap/skill.yaml +43 -0
  110. package/dist/agents/skills/gemini-cli/harness-security-review/skill.yaml +8 -6
  111. package/dist/agents/skills/gemini-cli/harness-skill-authoring/SKILL.md +292 -0
  112. package/dist/agents/skills/gemini-cli/harness-skill-authoring/skill.yaml +32 -0
  113. package/dist/agents/skills/gemini-cli/harness-soundness-review/SKILL.md +1267 -0
  114. package/dist/agents/skills/gemini-cli/harness-soundness-review/skill.yaml +48 -0
  115. package/dist/agents/skills/gemini-cli/harness-state-management/SKILL.md +309 -0
  116. package/dist/agents/skills/gemini-cli/harness-state-management/skill.yaml +32 -0
  117. package/dist/agents/skills/gemini-cli/harness-tdd/SKILL.md +177 -0
  118. package/dist/agents/skills/gemini-cli/harness-tdd/skill.yaml +48 -0
  119. package/dist/agents/skills/gemini-cli/harness-test-advisor/SKILL.md +35 -6
  120. package/dist/agents/skills/gemini-cli/harness-verification/SKILL.md +328 -0
  121. package/dist/agents/skills/gemini-cli/harness-verification/skill.yaml +42 -0
  122. package/dist/agents/skills/gemini-cli/harness-verify/SKILL.md +159 -0
  123. package/dist/agents/skills/gemini-cli/harness-verify/skill.yaml +40 -0
  124. package/dist/agents/skills/gemini-cli/initialize-harness-project/SKILL.md +224 -0
  125. package/dist/agents/skills/gemini-cli/initialize-harness-project/skill.yaml +31 -0
  126. package/dist/agents/skills/gemini-cli/validate-context-engineering/SKILL.md +150 -0
  127. package/dist/agents/skills/gemini-cli/validate-context-engineering/skill.yaml +31 -0
  128. package/dist/agents/skills/shared/i18n-knowledge/accessibility/intersection.yaml +142 -0
  129. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/encoding.yaml +67 -0
  130. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/formatting.yaml +106 -0
  131. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/layout.yaml +80 -0
  132. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/pluralization.yaml +80 -0
  133. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/string-handling.yaml +106 -0
  134. package/dist/agents/skills/shared/i18n-knowledge/frameworks/android-resources.yaml +47 -0
  135. package/dist/agents/skills/shared/i18n-knowledge/frameworks/apple-strings.yaml +47 -0
  136. package/dist/agents/skills/shared/i18n-knowledge/frameworks/backend-patterns.yaml +50 -0
  137. package/dist/agents/skills/shared/i18n-knowledge/frameworks/flutter-intl.yaml +47 -0
  138. package/dist/agents/skills/shared/i18n-knowledge/frameworks/i18next.yaml +47 -0
  139. package/dist/agents/skills/shared/i18n-knowledge/frameworks/react-intl.yaml +47 -0
  140. package/dist/agents/skills/shared/i18n-knowledge/frameworks/vue-i18n.yaml +47 -0
  141. package/dist/agents/skills/shared/i18n-knowledge/industries/ecommerce.yaml +66 -0
  142. package/dist/agents/skills/shared/i18n-knowledge/industries/fintech.yaml +66 -0
  143. package/dist/agents/skills/shared/i18n-knowledge/industries/gaming.yaml +69 -0
  144. package/dist/agents/skills/shared/i18n-knowledge/industries/healthcare.yaml +66 -0
  145. package/dist/agents/skills/shared/i18n-knowledge/industries/legal.yaml +66 -0
  146. package/dist/agents/skills/shared/i18n-knowledge/locales/ar.yaml +41 -0
  147. package/dist/agents/skills/shared/i18n-knowledge/locales/de.yaml +35 -0
  148. package/dist/agents/skills/shared/i18n-knowledge/locales/en.yaml +32 -0
  149. package/dist/agents/skills/shared/i18n-knowledge/locales/es.yaml +35 -0
  150. package/dist/agents/skills/shared/i18n-knowledge/locales/fi.yaml +35 -0
  151. package/dist/agents/skills/shared/i18n-knowledge/locales/fr.yaml +35 -0
  152. package/dist/agents/skills/shared/i18n-knowledge/locales/he.yaml +41 -0
  153. package/dist/agents/skills/shared/i18n-knowledge/locales/hi.yaml +35 -0
  154. package/dist/agents/skills/shared/i18n-knowledge/locales/it.yaml +32 -0
  155. package/dist/agents/skills/shared/i18n-knowledge/locales/ja.yaml +38 -0
  156. package/dist/agents/skills/shared/i18n-knowledge/locales/ko.yaml +38 -0
  157. package/dist/agents/skills/shared/i18n-knowledge/locales/nl.yaml +32 -0
  158. package/dist/agents/skills/shared/i18n-knowledge/locales/pl.yaml +35 -0
  159. package/dist/agents/skills/shared/i18n-knowledge/locales/pt.yaml +32 -0
  160. package/dist/agents/skills/shared/i18n-knowledge/locales/ru.yaml +35 -0
  161. package/dist/agents/skills/shared/i18n-knowledge/locales/sv.yaml +32 -0
  162. package/dist/agents/skills/shared/i18n-knowledge/locales/th.yaml +35 -0
  163. package/dist/agents/skills/shared/i18n-knowledge/locales/tr.yaml +35 -0
  164. package/dist/agents/skills/shared/i18n-knowledge/locales/zh-Hans.yaml +38 -0
  165. package/dist/agents/skills/shared/i18n-knowledge/locales/zh-Hant.yaml +35 -0
  166. package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/i18next-mcp.yaml +56 -0
  167. package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/lingo-dev.yaml +56 -0
  168. package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/lokalise.yaml +60 -0
  169. package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/tolgee.yaml +60 -0
  170. package/dist/agents/skills/shared/i18n-knowledge/testing/locale-testing.yaml +107 -0
  171. package/dist/agents/skills/shared/i18n-knowledge/testing/pseudo-localization.yaml +86 -0
  172. package/dist/bin/harness.js +64 -4
  173. package/dist/{chunk-GA6GN5J2.js → chunk-E2RTDBMG.js} +2263 -41
  174. package/dist/{chunk-FFIX3QVG.js → chunk-KJANDVVC.js} +141 -49
  175. package/dist/{chunk-4WUGOJQ7.js → chunk-RT2LYQHF.js} +1 -1
  176. package/dist/{dist-C4J67MPP.js → dist-CCM3L3UE.js} +95 -1
  177. package/dist/{dist-N4D4QWFV.js → dist-K6KTTN3I.js} +4 -4
  178. package/dist/index.d.ts +187 -7
  179. package/dist/index.js +7 -3
  180. package/dist/validate-cross-check-ZGKFQY57.js +7 -0
  181. package/package.json +9 -9
  182. package/dist/agents/skills/node_modules/.bin/glob +0 -17
  183. package/dist/agents/skills/node_modules/.bin/vitest +0 -17
  184. package/dist/agents/skills/node_modules/.bin/yaml +0 -17
  185. package/dist/templates/advanced/docs/specs/.gitkeep +0 -0
  186. package/dist/templates/intermediate/docs/specs/.gitkeep +0 -0
  187. package/dist/validate-cross-check-WGXQ7K62.js +0 -7
@@ -0,0 +1,382 @@
1
+ # Harness Execution
2
+
3
+ > Execute a plan task by task with atomic commits, checkpoint protocol, and persistent knowledge capture. Stop on blockers. Do not guess.
4
+
5
+ ## When to Use
6
+
7
+ - When an approved plan exists (output of harness-planning) and implementation should begin
8
+ - When resuming execution of a previously started plan after a context reset
9
+ - When `on_new_feature` or `on_bug_fix` triggers fire and a plan is already in place
10
+ - NOT when no plan exists (use harness-planning first)
11
+ - NOT when the plan needs revision (update the plan first, then resume execution)
12
+ - NOT when exploring or brainstorming (use harness-brainstorming)
13
+ - NOT for ad-hoc single-task work that does not follow a plan
14
+
15
+ ## Process
16
+
17
+ ### Iron Law
18
+
19
+ **Execute the plan as written. If the plan is wrong, stop and fix the plan — do not improvise.**
20
+
21
+ 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.
22
+
23
+ ---
24
+
25
+ ### Phase 1: PREPARE — Load State and Verify Prerequisites
26
+
27
+ 1. **Load the plan.** Read the plan document from `docs/plans/`. Identify the total task count and any checkpoints.
28
+
29
+ 2. **Load state.** Read `.harness/state.json` to determine current position. If the file does not exist, this is a fresh start — position is Task 1.
30
+
31
+ 3. **Load learnings.** Read `.harness/learnings.md` for context from previous sessions. These are hard-won insights — do not ignore them.
32
+
33
+ 4. **Load failures.** Read `.harness/failures.md` for known dead ends. If any entries match approaches in the current plan, surface warnings before proceeding.
34
+
35
+ 5. **Load handoff.** Read `.harness/handoff.json` if it exists. Contains structured context from the previous skill (e.g., harness-planning passing context to harness-execution). Use this to prime session state.
36
+
37
+ 6. **Verify prerequisites.** For the current task:
38
+ - Are dependency tasks marked complete in state?
39
+ - Do the files referenced in the task exist as expected?
40
+ - Does the test suite pass? Run `harness validate` to confirm a clean baseline.
41
+
42
+ 7. **If prerequisites fail,** do not proceed. Report what is missing and which task is blocked.
43
+
44
+ ### Graph-Enhanced Context (when available)
45
+
46
+ When a knowledge graph exists at `.harness/graph/`, use graph queries for faster, more accurate context:
47
+
48
+ - `query_graph` — check file overlap between current and next task for conflict detection
49
+ - `get_impact` — understand blast radius before executing a task
50
+
51
+ Enables smarter execution ordering and blockage detection. Fall back to file-based commands if no graph is available.
52
+
53
+ ---
54
+
55
+ ### Phase 2: EXECUTE — Implement Tasks Atomically
56
+
57
+ When reporting task progress, use progress markers:
58
+
59
+ ```
60
+ **[Phase N/M]** Task N — <task description>
61
+ ```
62
+
63
+ For each task, starting from the current position:
64
+
65
+ 1. **Read the task instructions completely** before writing any code. Understand what files to touch, what tests to write, what the expected outcome is.
66
+
67
+ 2. **Follow the task instructions exactly.** The plan contains exact file paths, exact code, and exact commands. Execute them as written.
68
+
69
+ 3. **TDD rhythm within each task:**
70
+ - Write the test as specified in the task
71
+ - Run the test — observe it fail (for the right reason)
72
+ - Write the implementation as specified in the task
73
+ - Run the test — observe it pass
74
+ - Run `harness validate`
75
+
76
+ 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.
77
+
78
+ 5. **Run mechanical gate.** After each task commit, run the full gate check: test suite, linter, type checker, build, and `harness validate`. This is binary pass/fail.
79
+ - **All pass →** proceed to the next task.
80
+ - **Any fail →** retry with error context (max 2 attempts).
81
+ - **Still failing after retries →** record the failure in `.harness/failures.md`, escalate, and stop.
82
+
83
+ 6. **Update state after each task.** Write to `.harness/state.json`:
84
+
85
+ ```json
86
+ {
87
+ "schemaVersion": 1,
88
+ "position": { "phase": "execute", "task": "Task N" },
89
+ "progress": { "Task 1": "complete", "Task 2": "complete", "Task 3": "in_progress" },
90
+ "lastSession": { "date": "YYYY-MM-DD", "summary": "Completed Tasks 1-2, starting Task 3" }
91
+ }
92
+ ```
93
+
94
+ 7. **Handle checkpoints** according to the checkpoint protocol (see below).
95
+
96
+ ---
97
+
98
+ ### Checkpoint Protocol
99
+
100
+ Plans contain three types of checkpoints. Each requires pausing execution.
101
+
102
+ **`[checkpoint:human-verify]` — Show and Confirm**
103
+
104
+ 1. Stop execution.
105
+ 2. Use `emit_interaction` to present the checkpoint:
106
+ ```json
107
+ emit_interaction({
108
+ path: "<project-root>",
109
+ type: "confirmation",
110
+ confirmation: {
111
+ text: "Task N complete. Output: <summary>. Continue to Task N+1?",
112
+ context: "<test output or file diff summary>"
113
+ }
114
+ })
115
+ ```
116
+ 3. Wait for the human to confirm before proceeding.
117
+
118
+ **`[checkpoint:decision]` — Present Options and Wait**
119
+
120
+ 1. Stop execution.
121
+ 2. Use `emit_interaction` to present the decision:
122
+ ```json
123
+ emit_interaction({
124
+ path: "<project-root>",
125
+ type: "question",
126
+ question: {
127
+ text: "Task N requires a decision: <description>",
128
+ options: ["<option A>", "<option B>"]
129
+ }
130
+ })
131
+ ```
132
+ 3. Wait for the human to choose.
133
+
134
+ **`[checkpoint:human-action]` — Instruct and Wait**
135
+
136
+ 1. Stop execution.
137
+ 2. Tell the human exactly what they need to do (e.g., "Create an API key at [URL] and paste it here").
138
+ 3. State: "Task N requires your action: [instructions]. Let me know when done."
139
+ 4. Wait for the human to complete the action and confirm.
140
+
141
+ ---
142
+
143
+ ### Phase 3: VERIFY — Two-Tier Validation
144
+
145
+ **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.
146
+
147
+ **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:
148
+
149
+ 1. **EXISTS** — Do the artifacts the task claims to produce actually exist?
150
+ 2. **SUBSTANTIVE** — Do those artifacts contain meaningful, correct content (not stubs or placeholders)?
151
+ 3. **WIRED** — Are those artifacts integrated into the system (imported, routed, tested, reachable)?
152
+
153
+ If the deep audit fails at any level, treat it as a blocker. Record it and stop.
154
+
155
+ After all tasks pass verification:
156
+
157
+ ```json
158
+ emit_interaction({
159
+ path: "<project-root>",
160
+ type: "transition",
161
+ transition: {
162
+ completedPhase: "execution",
163
+ suggestedNext: "verification",
164
+ reason: "All plan tasks executed and verified",
165
+ artifacts: ["<list of created/modified files>"]
166
+ }
167
+ })
168
+ ```
169
+
170
+ ---
171
+
172
+ ### Phase 4: PERSIST — Save Progress and Learnings
173
+
174
+ Between tasks (especially between sessions):
175
+
176
+ 1. **Update `.harness/state.json`** with current position, progress, and `lastSession` context:
177
+
178
+ ```json
179
+ {
180
+ "lastSession": {
181
+ "lastSkill": "harness-execution",
182
+ "pendingTasks": ["Task 4", "Task 5"]
183
+ }
184
+ }
185
+ ```
186
+
187
+ ### Graph Refresh
188
+
189
+ If a knowledge graph exists at `.harness/graph/`, refresh it after code changes to keep graph queries accurate:
190
+
191
+ ```
192
+ harness scan [path]
193
+ ```
194
+
195
+ Skipping this step means subsequent graph queries (impact analysis, dependency health, test advisor) may return stale results.
196
+
197
+ 2. **Append tagged learnings to `.harness/learnings.md`.** Tag every entry with skill and outcome:
198
+
199
+ ```markdown
200
+ ## YYYY-MM-DD — Task N: <task name>
201
+
202
+ - [skill:harness-execution] [outcome:success] What was accomplished
203
+ - [skill:harness-execution] [outcome:gotcha] What was surprising or non-obvious
204
+ - [skill:harness-execution] [outcome:decision] What was decided and why
205
+ ```
206
+
207
+ 3. **Record failures in `.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.
208
+
209
+ 4. **Write `.harness/handoff.json`** with structured context for the next skill or session:
210
+
211
+ ```json
212
+ {
213
+ "fromSkill": "harness-execution",
214
+ "timestamp": "YYYY-MM-DDTHH:MM:SSZ",
215
+ "summary": "Completed Tasks 1-3. Task 4 blocked on missing API endpoint.",
216
+ "pendingTasks": ["Task 4", "Task 5"],
217
+ "blockers": ["Task 4: /api/notifications endpoint not implemented"],
218
+ "learnings": ["Date comparison needs UTC normalization"]
219
+ }
220
+ ```
221
+
222
+ 5. **Sync roadmap (if present).** If `docs/roadmap.md` exists, trigger a roadmap sync to update linked feature statuses based on the just-completed execution state. Use the `manage_roadmap` MCP tool with `sync` action if available, or invoke `/harness:roadmap --sync`. This keeps the roadmap current as plans are executed. If no roadmap exists, skip this step silently.
223
+
224
+ 6. **Learnings are append-only.** Never edit or delete previous learnings. They are a chronological record.
225
+
226
+ 7. **Auto-transition to verification.** When ALL tasks in the plan are complete (not when stopping mid-plan):
227
+
228
+ Call `emit_interaction`:
229
+
230
+ ```json
231
+ {
232
+ "type": "transition",
233
+ "transition": {
234
+ "completedPhase": "execution",
235
+ "suggestedNext": "verification",
236
+ "reason": "All tasks complete",
237
+ "artifacts": ["<list of created/modified files>"],
238
+ "requiresConfirmation": false,
239
+ "summary": "Completed <N> tasks. <N> files created, <N> modified. All quick gates passed."
240
+ }
241
+ }
242
+ ```
243
+
244
+ The response will include `nextAction: "Invoke harness-verification skill now"`.
245
+ Immediately invoke harness-verification without waiting for user input.
246
+
247
+ **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.
248
+
249
+ ---
250
+
251
+ ### Stopping Conditions
252
+
253
+ These are non-negotiable. When any condition is met, stop immediately.
254
+
255
+ - **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."
256
+
257
+ - **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.
258
+
259
+ - **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?"
260
+
261
+ - **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.
262
+
263
+ - **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."
264
+
265
+ ## Harness Integration
266
+
267
+ - **`harness validate`** — Run after every task completion. Mandatory. No task is complete without a passing validation.
268
+ - **`harness check-deps`** — Run when tasks add new imports or modules. Catches boundary violations early.
269
+ - **`harness state show`** — View current execution position and progress.
270
+ - **`harness state learn "<message>"`** — Append a learning from the command line.
271
+ - **`.harness/state.json`** — Read at session start to resume position. Updated after every task.
272
+ - **`.harness/learnings.md`** — Append-only knowledge capture. Read at session start for prior context.
273
+ - **Roadmap sync** — After completing plan execution, sync roadmap status via `manage_roadmap sync` if `docs/roadmap.md` exists. Keeps roadmap current with execution progress.
274
+ - **`emit_interaction`** -- Call at plan completion to auto-transition to harness-verification. Uses auto-transition (proceeds immediately without user confirmation).
275
+
276
+ ## Success Criteria
277
+
278
+ - Every task in the plan is executed in order, atomically, with one commit per task
279
+ - `.harness/state.json` accurately reflects current position and progress
280
+ - `.harness/learnings.md` contains entries for every session with non-trivial discoveries
281
+ - `harness validate` passes after every task
282
+ - Checkpoints were honored: execution paused at every `[checkpoint:*]` marker
283
+ - No improvisation: tasks were executed as written, or execution was stopped and the blocker was reported
284
+ - All stopping conditions were respected (no guessing past blockers, no blind retries)
285
+
286
+ ## Examples
287
+
288
+ ### Example: Executing a 5-Task Notification Plan
289
+
290
+ **Session Start (fresh):**
291
+
292
+ ```
293
+ Read plan: docs/plans/2026-03-14-notifications-plan.md (5 tasks)
294
+ Read state: .harness/state.json — file not found (fresh start, position: Task 1)
295
+ Read learnings: .harness/learnings.md — file not found (no prior context)
296
+ Run: harness validate — passes. Clean baseline confirmed.
297
+ ```
298
+
299
+ **Task 1: Define notification types**
300
+
301
+ ```
302
+ 1. Create src/types/notification.ts with Notification interface
303
+ 2. Run: harness validate — passes
304
+ 3. Commit: "feat(notifications): define Notification type"
305
+ 4. Update state: { position: Task 2, progress: { "Task 1": "complete" } }
306
+ ```
307
+
308
+ **Task 2: Create notification service (TDD)**
309
+
310
+ ```
311
+ 1. Write test: src/services/notification-service.test.ts
312
+ 2. Run test: FAIL — NotificationService is not defined (correct failure)
313
+ 3. Implement: src/services/notification-service.ts
314
+ 4. Run test: PASS
315
+ 5. Run: harness validate — passes
316
+ 6. Commit: "feat(notifications): add NotificationService.create"
317
+ 7. Update state: { position: Task 3, progress: { "Task 1": "complete", "Task 2": "complete" } }
318
+ ```
319
+
320
+ **Task 3: Add list and expiry (TDD) — has checkpoint**
321
+
322
+ ```
323
+ [checkpoint:human-verify] — "Tasks 1-2 complete. NotificationService can create
324
+ notifications. Tests pass. Continue to Task 3 (list and expiry methods)?"
325
+ Human: "Continue."
326
+
327
+ 1. Write tests: list by userId, filter expired
328
+ 2. Run tests: FAIL (methods not implemented)
329
+ 3. Implement list() and isExpired()
330
+ 4. Run tests: PASS
331
+ 5. Run: harness validate — passes
332
+ 6. Commit: "feat(notifications): add list and expiry to NotificationService"
333
+ 7. Update state, append learning:
334
+ "## 2026-03-14 — Task 3: list and expiry
335
+ - [gotcha]: Date comparison needed UTC normalization — used Date.now() not new Date()"
336
+ ```
337
+
338
+ **Context reset mid-plan (resume at Task 4):**
339
+
340
+ ```
341
+ Read plan: docs/plans/2026-03-14-notifications-plan.md
342
+ Read state: .harness/state.json — position: Task 4, Tasks 1-3 complete
343
+ Read learnings: .harness/learnings.md — "Date comparison needed UTC normalization"
344
+ Run: harness validate — passes. Resume from Task 4.
345
+ ```
346
+
347
+ ## Gates
348
+
349
+ These are hard stops. Violating any gate means the process has broken down.
350
+
351
+ - **No execution without a plan.** If no plan document exists, do not start. Use harness-planning to create one.
352
+ - **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.
353
+ - **No skipping tasks.** Tasks are ordered by dependency. Skipping a task means later tasks may fail. Execute in order.
354
+ - **No skipping validation.** `harness validate` runs after every task. No exceptions. A task that passes its tests but fails validation is not complete.
355
+ - **No ignoring checkpoints.** If a task has a `[checkpoint:*]` marker, execution must pause. Do not auto-continue past checkpoints.
356
+ - **No guessing past blockers.** If a task cannot be completed as written, stop. Report the blocker. Do not invent a workaround.
357
+ - **State must be updated.** After every task, `.harness/state.json` must reflect the new position. Skipping state updates makes resume impossible.
358
+
359
+ ## Escalation
360
+
361
+ - **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."
362
+ - **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."
363
+ - **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?"
364
+ - **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.
365
+ - **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.
366
+
367
+ ## Trace Output (Optional)
368
+
369
+ When `.harness/gate.json` has `"trace": true` or `--verbose` is passed, append one-sentence reasoning at each phase boundary to `.harness/trace.md`.
370
+
371
+ **Format:** `**[PHASE HH:MM:SS]** summary`
372
+
373
+ Example:
374
+
375
+ ```markdown
376
+ **[PREPARE 14:32:07]** Loaded plan with 5 tasks, resuming from Task 3 per state.json.
377
+ **[EXECUTE 14:32:15]** Task 3 committed; mechanical gate passed on first attempt.
378
+ **[VERIFY 14:35:42]** Deep audit requested at milestone; all 3 levels passed.
379
+ **[PERSIST 14:35:50]** State updated, handoff.json written with 2 pending tasks.
380
+ ```
381
+
382
+ This is for human debugging only. Not required for normal execution.
@@ -0,0 +1,51 @@
1
+ name: harness-execution
2
+ version: "1.0.0"
3
+ description: Execute a planned set of tasks with harness validation and state tracking
4
+ cognitive_mode: meticulous-implementer
5
+ triggers:
6
+ - manual
7
+ - on_new_feature
8
+ - on_bug_fix
9
+ platforms:
10
+ - claude-code
11
+ - gemini-cli
12
+ tools:
13
+ - Bash
14
+ - Read
15
+ - Write
16
+ - Edit
17
+ - Glob
18
+ - Grep
19
+ - emit_interaction
20
+ cli:
21
+ command: harness skill run harness-execution
22
+ args:
23
+ - name: path
24
+ description: Project root path
25
+ required: false
26
+ mcp:
27
+ tool: run_skill
28
+ input:
29
+ skill: harness-execution
30
+ path: string
31
+ type: rigid
32
+ phases:
33
+ - name: prepare
34
+ description: Load state and verify prerequisites
35
+ required: true
36
+ - name: execute
37
+ description: Implement planned tasks
38
+ required: true
39
+ - name: verify
40
+ description: Validate each completed task
41
+ required: true
42
+ - name: persist
43
+ description: Save progress to state files
44
+ required: true
45
+ state:
46
+ persistent: true
47
+ files:
48
+ - .harness/state.json
49
+ - .harness/learnings.md
50
+ depends_on:
51
+ - harness-verification