@harness-engineering/cli 1.6.2 → 1.8.0

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 (180) 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/personas/planner.yaml +27 -0
  4. package/dist/agents/personas/verifier.yaml +30 -0
  5. package/dist/agents/skills/claude-code/align-documentation/SKILL.md +13 -0
  6. package/dist/agents/skills/claude-code/cleanup-dead-code/SKILL.md +25 -1
  7. package/dist/agents/skills/claude-code/cleanup-dead-code/skill.yaml +5 -2
  8. package/dist/agents/skills/claude-code/detect-doc-drift/SKILL.md +12 -0
  9. package/dist/agents/skills/claude-code/enforce-architecture/SKILL.md +67 -1
  10. package/dist/agents/skills/claude-code/enforce-architecture/skill.yaml +5 -2
  11. package/dist/agents/skills/claude-code/harness-accessibility/SKILL.md +281 -0
  12. package/dist/agents/skills/claude-code/harness-accessibility/skill.yaml +51 -0
  13. package/dist/agents/skills/claude-code/harness-autopilot/SKILL.md +119 -72
  14. package/dist/agents/skills/claude-code/harness-autopilot/skill.yaml +4 -2
  15. package/dist/agents/skills/claude-code/harness-brainstorming/SKILL.md +76 -4
  16. package/dist/agents/skills/claude-code/harness-brainstorming/skill.yaml +2 -0
  17. package/dist/agents/skills/claude-code/harness-code-review/SKILL.md +487 -234
  18. package/dist/agents/skills/claude-code/harness-code-review/skill.yaml +15 -2
  19. package/dist/agents/skills/claude-code/harness-codebase-cleanup/SKILL.md +226 -0
  20. package/dist/agents/skills/claude-code/harness-codebase-cleanup/skill.yaml +64 -0
  21. package/dist/agents/skills/claude-code/harness-dependency-health/SKILL.md +35 -6
  22. package/dist/agents/skills/claude-code/harness-dependency-health/skill.yaml +1 -1
  23. package/dist/agents/skills/claude-code/harness-design/SKILL.md +265 -0
  24. package/dist/agents/skills/claude-code/harness-design/skill.yaml +53 -0
  25. package/dist/agents/skills/claude-code/harness-design-mobile/SKILL.md +336 -0
  26. package/dist/agents/skills/claude-code/harness-design-mobile/skill.yaml +49 -0
  27. package/dist/agents/skills/claude-code/harness-design-system/SKILL.md +282 -0
  28. package/dist/agents/skills/claude-code/harness-design-system/skill.yaml +50 -0
  29. package/dist/agents/skills/claude-code/harness-design-web/SKILL.md +360 -0
  30. package/dist/agents/skills/claude-code/harness-design-web/skill.yaml +52 -0
  31. package/dist/agents/skills/claude-code/harness-docs-pipeline/SKILL.md +460 -0
  32. package/dist/agents/skills/claude-code/harness-docs-pipeline/skill.yaml +69 -0
  33. package/dist/agents/skills/claude-code/harness-execution/SKILL.md +73 -8
  34. package/dist/agents/skills/claude-code/harness-execution/skill.yaml +1 -0
  35. package/dist/agents/skills/claude-code/harness-hotspot-detector/SKILL.md +32 -6
  36. package/dist/agents/skills/claude-code/harness-hotspot-detector/skill.yaml +1 -1
  37. package/dist/agents/skills/claude-code/harness-i18n/SKILL.md +484 -0
  38. package/dist/agents/skills/claude-code/harness-i18n/skill.yaml +54 -0
  39. package/dist/agents/skills/claude-code/harness-i18n-process/SKILL.md +388 -0
  40. package/dist/agents/skills/claude-code/harness-i18n-process/skill.yaml +43 -0
  41. package/dist/agents/skills/claude-code/harness-i18n-workflow/SKILL.md +512 -0
  42. package/dist/agents/skills/claude-code/harness-i18n-workflow/skill.yaml +53 -0
  43. package/dist/agents/skills/claude-code/harness-impact-analysis/SKILL.md +51 -6
  44. package/dist/agents/skills/claude-code/harness-integrity/SKILL.md +35 -1
  45. package/dist/agents/skills/claude-code/harness-knowledge-mapper/SKILL.md +46 -5
  46. package/dist/agents/skills/claude-code/harness-knowledge-mapper/skill.yaml +1 -1
  47. package/dist/agents/skills/claude-code/harness-onboarding/SKILL.md +19 -1
  48. package/dist/agents/skills/claude-code/harness-perf/SKILL.md +37 -8
  49. package/dist/agents/skills/claude-code/harness-perf/skill.yaml +3 -0
  50. package/dist/agents/skills/claude-code/harness-perf-tdd/SKILL.md +17 -4
  51. package/dist/agents/skills/claude-code/harness-planning/SKILL.md +57 -3
  52. package/dist/agents/skills/claude-code/harness-planning/skill.yaml +2 -0
  53. package/dist/agents/skills/claude-code/harness-release-readiness/SKILL.md +29 -9
  54. package/dist/agents/skills/claude-code/harness-roadmap/SKILL.md +562 -0
  55. package/dist/agents/skills/claude-code/harness-roadmap/skill.yaml +43 -0
  56. package/dist/agents/skills/claude-code/harness-security-review/SKILL.md +36 -2
  57. package/dist/agents/skills/claude-code/harness-security-review/skill.yaml +8 -6
  58. package/dist/agents/skills/claude-code/harness-security-scan/skill.yaml +1 -1
  59. package/dist/agents/skills/claude-code/harness-soundness-review/SKILL.md +1267 -0
  60. package/dist/agents/skills/claude-code/harness-soundness-review/skill.yaml +48 -0
  61. package/dist/agents/skills/claude-code/harness-test-advisor/SKILL.md +35 -6
  62. package/dist/agents/skills/claude-code/harness-verification/SKILL.md +66 -0
  63. package/dist/agents/skills/claude-code/harness-verification/skill.yaml +1 -0
  64. package/dist/agents/skills/claude-code/harness-verify/SKILL.md +37 -0
  65. package/dist/agents/skills/claude-code/initialize-harness-project/SKILL.md +15 -1
  66. package/dist/agents/skills/claude-code/validate-context-engineering/SKILL.md +12 -0
  67. package/dist/agents/skills/gemini-cli/harness-accessibility/SKILL.md +281 -0
  68. package/dist/agents/skills/gemini-cli/harness-accessibility/skill.yaml +51 -0
  69. package/dist/agents/skills/gemini-cli/harness-autopilot/SKILL.md +119 -72
  70. package/dist/agents/skills/gemini-cli/harness-autopilot/skill.yaml +4 -2
  71. package/dist/agents/skills/gemini-cli/harness-codebase-cleanup/SKILL.md +226 -0
  72. package/dist/agents/skills/gemini-cli/harness-codebase-cleanup/skill.yaml +64 -0
  73. package/dist/agents/skills/gemini-cli/harness-dependency-health/SKILL.md +35 -6
  74. package/dist/agents/skills/gemini-cli/harness-dependency-health/skill.yaml +1 -1
  75. package/dist/agents/skills/gemini-cli/harness-design/SKILL.md +265 -0
  76. package/dist/agents/skills/gemini-cli/harness-design/skill.yaml +53 -0
  77. package/dist/agents/skills/gemini-cli/harness-design-mobile/SKILL.md +336 -0
  78. package/dist/agents/skills/gemini-cli/harness-design-mobile/skill.yaml +49 -0
  79. package/dist/agents/skills/gemini-cli/harness-design-system/SKILL.md +282 -0
  80. package/dist/agents/skills/gemini-cli/harness-design-system/skill.yaml +50 -0
  81. package/dist/agents/skills/gemini-cli/harness-design-web/SKILL.md +360 -0
  82. package/dist/agents/skills/gemini-cli/harness-design-web/skill.yaml +52 -0
  83. package/dist/agents/skills/gemini-cli/harness-docs-pipeline/SKILL.md +460 -0
  84. package/dist/agents/skills/gemini-cli/harness-docs-pipeline/skill.yaml +69 -0
  85. package/dist/agents/skills/gemini-cli/harness-hotspot-detector/SKILL.md +32 -6
  86. package/dist/agents/skills/gemini-cli/harness-hotspot-detector/skill.yaml +1 -1
  87. package/dist/agents/skills/gemini-cli/harness-i18n/SKILL.md +484 -0
  88. package/dist/agents/skills/gemini-cli/harness-i18n/skill.yaml +54 -0
  89. package/dist/agents/skills/gemini-cli/harness-i18n-process/SKILL.md +388 -0
  90. package/dist/agents/skills/gemini-cli/harness-i18n-process/skill.yaml +43 -0
  91. package/dist/agents/skills/gemini-cli/harness-i18n-workflow/SKILL.md +512 -0
  92. package/dist/agents/skills/gemini-cli/harness-i18n-workflow/skill.yaml +53 -0
  93. package/dist/agents/skills/gemini-cli/harness-impact-analysis/SKILL.md +51 -6
  94. package/dist/agents/skills/gemini-cli/harness-knowledge-mapper/SKILL.md +46 -5
  95. package/dist/agents/skills/gemini-cli/harness-knowledge-mapper/skill.yaml +1 -1
  96. package/dist/agents/skills/gemini-cli/harness-perf/SKILL.md +37 -8
  97. package/dist/agents/skills/gemini-cli/harness-perf/skill.yaml +3 -0
  98. package/dist/agents/skills/gemini-cli/harness-perf-tdd/SKILL.md +17 -4
  99. package/dist/agents/skills/gemini-cli/harness-release-readiness/SKILL.md +29 -9
  100. package/dist/agents/skills/gemini-cli/harness-roadmap/SKILL.md +562 -0
  101. package/dist/agents/skills/gemini-cli/harness-roadmap/skill.yaml +43 -0
  102. package/dist/agents/skills/gemini-cli/harness-security-review/skill.yaml +8 -6
  103. package/dist/agents/skills/gemini-cli/harness-security-scan/skill.yaml +1 -1
  104. package/dist/agents/skills/gemini-cli/harness-soundness-review/SKILL.md +1267 -0
  105. package/dist/agents/skills/gemini-cli/harness-soundness-review/skill.yaml +48 -0
  106. package/dist/agents/skills/gemini-cli/harness-test-advisor/SKILL.md +35 -6
  107. package/dist/agents/skills/node_modules/.bin/vitest +2 -2
  108. package/dist/agents/skills/shared/design-knowledge/anti-patterns/color.yaml +106 -0
  109. package/dist/agents/skills/shared/design-knowledge/anti-patterns/layout.yaml +109 -0
  110. package/dist/agents/skills/shared/design-knowledge/anti-patterns/motion.yaml +109 -0
  111. package/dist/agents/skills/shared/design-knowledge/anti-patterns/typography.yaml +112 -0
  112. package/dist/agents/skills/shared/design-knowledge/industries/creative.yaml +80 -0
  113. package/dist/agents/skills/shared/design-knowledge/industries/ecommerce.yaml +80 -0
  114. package/dist/agents/skills/shared/design-knowledge/industries/emerging-tech.yaml +83 -0
  115. package/dist/agents/skills/shared/design-knowledge/industries/fintech.yaml +80 -0
  116. package/dist/agents/skills/shared/design-knowledge/industries/healthcare.yaml +80 -0
  117. package/dist/agents/skills/shared/design-knowledge/industries/lifestyle.yaml +80 -0
  118. package/dist/agents/skills/shared/design-knowledge/industries/saas.yaml +80 -0
  119. package/dist/agents/skills/shared/design-knowledge/industries/services.yaml +80 -0
  120. package/dist/agents/skills/shared/design-knowledge/palettes/curated.yaml +234 -0
  121. package/dist/agents/skills/shared/design-knowledge/platform-rules/android.yaml +125 -0
  122. package/dist/agents/skills/shared/design-knowledge/platform-rules/flutter.yaml +144 -0
  123. package/dist/agents/skills/shared/design-knowledge/platform-rules/ios.yaml +106 -0
  124. package/dist/agents/skills/shared/design-knowledge/platform-rules/web.yaml +102 -0
  125. package/dist/agents/skills/shared/design-knowledge/typography/pairings.yaml +274 -0
  126. package/dist/agents/skills/shared/i18n-knowledge/accessibility/intersection.yaml +142 -0
  127. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/encoding.yaml +67 -0
  128. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/formatting.yaml +106 -0
  129. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/layout.yaml +80 -0
  130. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/pluralization.yaml +80 -0
  131. package/dist/agents/skills/shared/i18n-knowledge/anti-patterns/string-handling.yaml +106 -0
  132. package/dist/agents/skills/shared/i18n-knowledge/frameworks/android-resources.yaml +47 -0
  133. package/dist/agents/skills/shared/i18n-knowledge/frameworks/apple-strings.yaml +47 -0
  134. package/dist/agents/skills/shared/i18n-knowledge/frameworks/backend-patterns.yaml +50 -0
  135. package/dist/agents/skills/shared/i18n-knowledge/frameworks/flutter-intl.yaml +47 -0
  136. package/dist/agents/skills/shared/i18n-knowledge/frameworks/i18next.yaml +47 -0
  137. package/dist/agents/skills/shared/i18n-knowledge/frameworks/react-intl.yaml +47 -0
  138. package/dist/agents/skills/shared/i18n-knowledge/frameworks/vue-i18n.yaml +47 -0
  139. package/dist/agents/skills/shared/i18n-knowledge/industries/ecommerce.yaml +66 -0
  140. package/dist/agents/skills/shared/i18n-knowledge/industries/fintech.yaml +66 -0
  141. package/dist/agents/skills/shared/i18n-knowledge/industries/gaming.yaml +69 -0
  142. package/dist/agents/skills/shared/i18n-knowledge/industries/healthcare.yaml +66 -0
  143. package/dist/agents/skills/shared/i18n-knowledge/industries/legal.yaml +66 -0
  144. package/dist/agents/skills/shared/i18n-knowledge/locales/ar.yaml +41 -0
  145. package/dist/agents/skills/shared/i18n-knowledge/locales/de.yaml +35 -0
  146. package/dist/agents/skills/shared/i18n-knowledge/locales/en.yaml +32 -0
  147. package/dist/agents/skills/shared/i18n-knowledge/locales/es.yaml +35 -0
  148. package/dist/agents/skills/shared/i18n-knowledge/locales/fi.yaml +35 -0
  149. package/dist/agents/skills/shared/i18n-knowledge/locales/fr.yaml +35 -0
  150. package/dist/agents/skills/shared/i18n-knowledge/locales/he.yaml +41 -0
  151. package/dist/agents/skills/shared/i18n-knowledge/locales/hi.yaml +35 -0
  152. package/dist/agents/skills/shared/i18n-knowledge/locales/it.yaml +32 -0
  153. package/dist/agents/skills/shared/i18n-knowledge/locales/ja.yaml +38 -0
  154. package/dist/agents/skills/shared/i18n-knowledge/locales/ko.yaml +38 -0
  155. package/dist/agents/skills/shared/i18n-knowledge/locales/nl.yaml +32 -0
  156. package/dist/agents/skills/shared/i18n-knowledge/locales/pl.yaml +35 -0
  157. package/dist/agents/skills/shared/i18n-knowledge/locales/pt.yaml +32 -0
  158. package/dist/agents/skills/shared/i18n-knowledge/locales/ru.yaml +35 -0
  159. package/dist/agents/skills/shared/i18n-knowledge/locales/sv.yaml +32 -0
  160. package/dist/agents/skills/shared/i18n-knowledge/locales/th.yaml +35 -0
  161. package/dist/agents/skills/shared/i18n-knowledge/locales/tr.yaml +35 -0
  162. package/dist/agents/skills/shared/i18n-knowledge/locales/zh-Hans.yaml +38 -0
  163. package/dist/agents/skills/shared/i18n-knowledge/locales/zh-Hant.yaml +35 -0
  164. package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/i18next-mcp.yaml +56 -0
  165. package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/lingo-dev.yaml +56 -0
  166. package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/lokalise.yaml +60 -0
  167. package/dist/agents/skills/shared/i18n-knowledge/mcp-interop/tolgee.yaml +60 -0
  168. package/dist/agents/skills/shared/i18n-knowledge/testing/locale-testing.yaml +107 -0
  169. package/dist/agents/skills/shared/i18n-knowledge/testing/pseudo-localization.yaml +86 -0
  170. package/dist/bin/harness.js +64 -4
  171. package/dist/{chunk-UDWGSL3T.js → chunk-3JWCBVUZ.js} +3 -3
  172. package/dist/{chunk-IUFFBBYV.js → chunk-LNI4T7R6.js} +179 -61
  173. package/dist/{chunk-USEYPS7F.js → chunk-SJECMKSS.js} +2250 -40
  174. package/dist/{dist-4MYPT3OE.js → dist-BDO5GFEM.js} +295 -14
  175. package/dist/{dist-RBZXXJHG.js → dist-NT3GXHQZ.js} +95 -1
  176. package/dist/index.d.ts +266 -7
  177. package/dist/index.js +7 -3
  178. package/dist/validate-cross-check-2OPGCGGU.js +7 -0
  179. package/package.json +7 -7
  180. package/dist/validate-cross-check-CPEPNLOD.js +0 -7
@@ -0,0 +1,51 @@
1
+ name: harness-accessibility
2
+ version: "1.0.0"
3
+ description: WCAG accessibility scanning, contrast checking, ARIA validation, and remediation
4
+ cognitive_mode: meticulous-verifier
5
+ triggers:
6
+ - manual
7
+ - on_new_feature
8
+ - on_project_init
9
+ platforms:
10
+ - claude-code
11
+ - gemini-cli
12
+ tools:
13
+ - Bash
14
+ - Read
15
+ - Write
16
+ - Edit
17
+ - Glob
18
+ - Grep
19
+ cli:
20
+ command: harness skill run harness-accessibility
21
+ args:
22
+ - name: path
23
+ description: Project root path
24
+ required: false
25
+ - name: scope
26
+ description: Scope of scan (full, component, page)
27
+ required: false
28
+ mcp:
29
+ tool: run_skill
30
+ input:
31
+ skill: harness-accessibility
32
+ path: string
33
+ type: rigid
34
+ phases:
35
+ - name: scan
36
+ description: Scan codebase for accessibility issues (WCAG AA baseline)
37
+ required: true
38
+ - name: evaluate
39
+ description: Evaluate severity and categorize findings
40
+ required: true
41
+ - name: report
42
+ description: Generate structured accessibility report
43
+ required: true
44
+ - name: fix
45
+ description: Apply automated fixes for mechanical issues
46
+ required: false
47
+ state:
48
+ persistent: false
49
+ files: []
50
+ depends_on:
51
+ - harness-design-system
@@ -13,18 +13,23 @@
13
13
 
14
14
  ## Relationship to Other Skills
15
15
 
16
- | Skill | Role in Autopilot |
17
- | -------------------- | -------------------------------------------- |
18
- | harness-planning | Delegated to for phase plan creation |
19
- | harness-execution | Delegated to for task-by-task implementation |
20
- | harness-verification | Delegated to for post-execution validation |
21
- | harness-code-review | Delegated to for post-verification review |
16
+ | Skill | Persona Agent (`subagent_type`) | Role in Autopilot |
17
+ | -------------------- | ------------------------------- | -------------------------------------------- |
18
+ | harness-planning | `harness-planner` | Delegated to for phase plan creation |
19
+ | harness-execution | `harness-task-executor` | Delegated to for task-by-task implementation |
20
+ | harness-verification | `harness-verifier` | Delegated to for post-execution validation |
21
+ | harness-code-review | `harness-code-reviewer` | Delegated to for post-verification review |
22
22
 
23
- Autopilot orchestrates these skills — it never reimplements their logic.
23
+ Autopilot orchestrates these persona agents — it never reimplements their logic. Each agent is dispatched via the Agent tool with the corresponding `subagent_type`, which isolates it to the harness methodology and prevents it from using unrelated skills.
24
24
 
25
25
  ## Iron Law
26
26
 
27
- **Autopilot delegates, never reimplements.** If you find yourself writing planning logic, execution logic, or review logic inside the autopilot loop, STOP. Delegate to the appropriate skill via subagent.
27
+ **Autopilot delegates, never reimplements.** If you find yourself writing planning logic, execution logic, or review logic inside the autopilot loop, STOP. Delegate to the dedicated persona agent.
28
+
29
+ **Always use dedicated persona agents, never general-purpose agents.** Every dispatch MUST target the specific harness persona (`harness-planner`, `harness-task-executor`, `harness-verifier`, `harness-code-reviewer`). General-purpose agents see all globally registered skills and may use unrelated workflows instead of the harness methodology.
30
+
31
+ - **Claude Code:** Use the Agent tool with `subagent_type` set to the persona name.
32
+ - **Gemini CLI:** Use the `run_agent` tool targeting the persona by name, or dispatch via `harness persona run <name>`.
28
33
 
29
34
  **Human always approves plans.** No plan executes without explicit human sign-off, regardless of complexity level. The difference is whether autopilot generates the plan automatically or asks the human to drive planning interactively.
30
35
 
@@ -44,20 +49,32 @@ INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → REVIEW →
44
49
 
45
50
  ### Phase 1: INIT — Load Spec and Restore State
46
51
 
47
- 1. **Check for existing state.** Read `.harness/autopilot-state.json`. If it exists and `currentState` is not `DONE`:
52
+ 1. **Resolve spec path.** The spec file is provided as an argument, or ask the user for the spec path.
53
+
54
+ 2. **Derive session slug and directory:**
55
+ - Derive the session slug from the spec path:
56
+ 1. If the path starts with `docs/`, strip the `docs/` prefix. Otherwise, use the full relative path.
57
+ 2. Drop the trailing `.md` extension
58
+ 3. Replace all `/` and `.` characters with `--`
59
+ 4. Lowercase the result
60
+ - Set `sessionDir = .harness/sessions/<slug>/`
61
+ - Create the session directory if it does not exist
62
+
63
+ 3. **Check for existing state.** Read `{sessionDir}/autopilot-state.json`. If it exists and `currentState` is not `DONE`:
48
64
  - Report: "Resuming autopilot from state `{currentState}`, phase {currentPhase}: {phaseName}."
49
65
  - Skip to the recorded `currentState` and continue from there.
50
66
 
51
- 2. **If no existing state (fresh start):**
52
- - Read the spec file (provided as argument or found via `.harness/handoff.json`). If neither is available, ask the user for the spec path.
67
+ 4. **If no existing state (fresh start):**
68
+ - Read the spec file.
53
69
  - Parse the `## Implementation Order` section to extract phases.
54
70
  - For each phase heading (`### Phase N: Name`), extract:
55
71
  - Phase name
56
72
  - Complexity annotation (`<!-- complexity: low|medium|high -->`, default: `medium`)
57
- - Create `.harness/autopilot-state.json`:
73
+ - Create `{sessionDir}/autopilot-state.json`:
58
74
  ```json
59
75
  {
60
- "schemaVersion": 1,
76
+ "schemaVersion": 2,
77
+ "sessionDir": ".harness/sessions/<slug>",
61
78
  "specPath": "<path to spec>",
62
79
  "currentState": "ASSESS",
63
80
  "currentPhase": 0,
@@ -78,15 +95,22 @@ INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → REVIEW →
78
95
  }
79
96
  ```
80
97
 
81
- 3. **Load context.** Read `.harness/learnings.md` and `.harness/failures.md` if they exist. Note any relevant learnings or known dead ends for the current phase.
98
+ 5. **Load context.** Read `.harness/learnings.md` and `.harness/failures.md` (global, at `.harness/` root) if they exist. Note any relevant learnings or known dead ends for the current phase.
99
+
100
+ 6. **Load roadmap context.** If `docs/roadmap.md` exists, read it to understand:
101
+ - Current project priorities (which features are `in-progress`)
102
+ - Blockers that may affect the upcoming phases
103
+ - Overall project status and milestone progress
104
+
105
+ This provides the autopilot with project-level context beyond the individual spec being executed. If the roadmap does not exist, skip this step — the autopilot operates normally without it.
82
106
 
83
- 4. **Transition to ASSESS.**
107
+ 7. **Transition to ASSESS.**
84
108
 
85
109
  ---
86
110
 
87
111
  ### ASSESS — Determine Phase Approach
88
112
 
89
- 1. **Read the current phase** from `autopilot-state.json` at index `currentPhase`.
113
+ 1. **Read the current phase** from `{sessionDir}/autopilot-state.json` at index `currentPhase`.
90
114
 
91
115
  2. **Check if plan already exists.** If `planPath` is set and the file exists, skip to `APPROVE_PLAN`.
92
116
 
@@ -97,8 +121,8 @@ INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → REVIEW →
97
121
 
98
122
  | Effective Complexity | Action |
99
123
  | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
100
- | `low` | Auto-plan via subagent. Proceed to PLAN. |
101
- | `medium` | Auto-plan via subagent. Proceed to PLAN. Present with extra scrutiny note. |
124
+ | `low` | Auto-plan via `harness-planner` agent. Proceed to PLAN. |
125
+ | `medium` | Auto-plan via `harness-planner` agent. Proceed to PLAN. Present with extra scrutiny note. |
102
126
  | `high` | Pause. Tell the user: "Phase {N}: {name} is marked high-complexity. Run `/harness:planning` interactively for this phase, then re-invoke `/harness:autopilot` to continue." Transition to PLAN with `awaitingInteractivePlan: true`. |
103
127
 
104
128
  4. **Update state** with `currentState: "PLAN"` and save.
@@ -109,22 +133,27 @@ INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → REVIEW →
109
133
 
110
134
  **If auto-planning (low/medium complexity):**
111
135
 
112
- 1. Dispatch a subagent with the following prompt:
136
+ 1. Dispatch a planning agent using the Agent tool:
113
137
 
114
138
  ```
115
- You are running harness-planning for phase {N}: {name}.
116
-
117
- Spec: {specPath}
118
- Phase description: {phase description from spec}
119
- Previous phase learnings: {relevant learnings from .harness/learnings.md}
120
- Known failures to avoid: {relevant entries from .harness/failures.md}
121
-
122
- Follow the harness-planning skill process exactly. Write the plan to
123
- docs/plans/{date}-{phase-name}-plan.md. Write .harness/handoff.json when done.
139
+ Agent tool parameters:
140
+ subagent_type: "harness-planner"
141
+ description: "Plan phase {N}: {name}"
142
+ prompt: |
143
+ You are running harness-planning for phase {N}: {name}.
144
+
145
+ Spec: {specPath}
146
+ Session directory: {sessionDir}
147
+ Phase description: {phase description from spec}
148
+ Previous phase learnings (global): {relevant learnings from .harness/learnings.md}
149
+ Known failures to avoid (global): {relevant entries from .harness/failures.md}
150
+
151
+ Follow the harness-planning skill process exactly. Write the plan to
152
+ docs/plans/{date}-{phase-name}-plan.md. Write {sessionDir}/handoff.json when done.
124
153
  ```
125
154
 
126
- 2. When the subagent returns:
127
- - Read the generated plan path from `.harness/handoff.json`.
155
+ 2. When the agent returns:
156
+ - Read the generated plan path from `{sessionDir}/handoff.json`.
128
157
  - **Apply complexity override check:**
129
158
  - Count tasks in the plan.
130
159
  - Count `[checkpoint:*]` markers.
@@ -138,7 +167,7 @@ INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → REVIEW →
138
167
  **If awaiting interactive plan (high complexity):**
139
168
 
140
169
  1. Check if a plan file now exists for this phase (user ran planning separately).
141
- - Look for files matching `docs/plans/*{phase-name}*` or check `.harness/handoff.json` for a planning handoff.
170
+ - Look for files matching `docs/plans/*{phase-name}*` or check `{sessionDir}/handoff.json` for a planning handoff.
142
171
  2. If found: update `planPath` in state, transition to `APPROVE_PLAN`.
143
172
  3. If not found: remind the user and wait.
144
173
 
@@ -170,27 +199,32 @@ INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → REVIEW →
170
199
 
171
200
  ### EXECUTE — Run the Plan
172
201
 
173
- 1. **Dispatch execution subagent:**
202
+ 1. **Dispatch execution agent using the Agent tool:**
174
203
 
175
204
  ```
176
- You are running harness-execution for phase {N}: {name}.
177
-
178
- Plan: {planPath}
179
- State: .harness/state.json
180
- Learnings: .harness/learnings.md
181
- Failures: .harness/failures.md
182
-
183
- Follow the harness-execution skill process exactly.
184
- Update .harness/state.json after each task.
185
- Write .harness/handoff.json when done or when blocked.
205
+ Agent tool parameters:
206
+ subagent_type: "harness-task-executor"
207
+ description: "Execute phase {N}: {name}"
208
+ prompt: |
209
+ You are running harness-execution for phase {N}: {name}.
210
+
211
+ Plan: {planPath}
212
+ Session directory: {sessionDir}
213
+ State: {sessionDir}/state.json
214
+ Learnings (global): .harness/learnings.md
215
+ Failures (global): .harness/failures.md
216
+
217
+ Follow the harness-execution skill process exactly.
218
+ Update {sessionDir}/state.json after each task.
219
+ Write {sessionDir}/handoff.json when done or when blocked.
186
220
  ```
187
221
 
188
- 2. **When the subagent returns, check the outcome:**
222
+ 2. **When the agent returns, check the outcome:**
189
223
  - **All tasks complete:** Transition to VERIFY.
190
224
  - **Checkpoint reached:** Surface the checkpoint to the user in the main conversation. Handle the checkpoint type:
191
- - `[checkpoint:human-verify]` — Show output, ask for confirmation, then resume execution subagent.
192
- - `[checkpoint:decision]` — Present options, record choice, resume execution subagent.
193
- - `[checkpoint:human-action]` — Instruct user, wait for confirmation, resume execution subagent.
225
+ - `[checkpoint:human-verify]` — Show output, ask for confirmation, then resume execution agent.
226
+ - `[checkpoint:decision]` — Present options, record choice, resume execution agent.
227
+ - `[checkpoint:human-action]` — Instruct user, wait for confirmation, resume execution agent.
194
228
  - **Task failed:** Enter retry logic (see below).
195
229
 
196
230
  3. **Retry logic on failure:**
@@ -198,7 +232,7 @@ INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → REVIEW →
198
232
  - If `attemptsUsed < maxAttempts`:
199
233
  - Increment `attemptsUsed`.
200
234
  - Record the attempt (timestamp, error, fix attempted, result).
201
- - **Attempt 1:** Read error output, apply obvious fix, re-dispatch execution subagent for the failed task only.
235
+ - **Attempt 1:** Read error output, apply obvious fix, re-dispatch execution agent for the failed task only.
202
236
  - **Attempt 2:** Expand context — read related files, check `learnings.md` for similar failures, re-dispatch with additional context.
203
237
  - **Attempt 3:** Full context gather — read test output, imports, plan instructions for ambiguity. Re-dispatch with maximum context.
204
238
  - If budget exhausted:
@@ -213,16 +247,22 @@ INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → REVIEW →
213
247
 
214
248
  ### VERIFY — Post-Execution Validation
215
249
 
216
- 1. **Dispatch verification subagent:**
250
+ 1. **Dispatch verification agent using the Agent tool:**
217
251
 
218
252
  ```
219
- You are running harness-verification for phase {N}: {name}.
253
+ Agent tool parameters:
254
+ subagent_type: "harness-verifier"
255
+ description: "Verify phase {N}: {name}"
256
+ prompt: |
257
+ You are running harness-verification for phase {N}: {name}.
258
+
259
+ Session directory: {sessionDir}
220
260
 
221
- Follow the harness-verification skill process exactly.
222
- Report pass/fail with findings.
261
+ Follow the harness-verification skill process exactly.
262
+ Report pass/fail with findings.
223
263
  ```
224
264
 
225
- 2. **When the subagent returns:**
265
+ 2. **When the agent returns:**
226
266
  - **All checks pass:** Transition to REVIEW.
227
267
  - **Failures found:** Surface findings to the user. Ask: "Fix these issues before review? (yes / skip verification / stop)"
228
268
  - **yes** — Re-enter EXECUTE with targeted fixes (retry budget resets for verification fixes).
@@ -235,16 +275,22 @@ INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → REVIEW →
235
275
 
236
276
  ### REVIEW — Code Review
237
277
 
238
- 1. **Dispatch review subagent:**
278
+ 1. **Dispatch review agent using the Agent tool:**
239
279
 
240
280
  ```
241
- You are running harness-code-review for phase {N}: {name}.
281
+ Agent tool parameters:
282
+ subagent_type: "harness-code-reviewer"
283
+ description: "Review phase {N}: {name}"
284
+ prompt: |
285
+ You are running harness-code-review for phase {N}: {name}.
286
+
287
+ Session directory: {sessionDir}
242
288
 
243
- Follow the harness-code-review skill process exactly.
244
- Report findings with severity (blocking / warning / note).
289
+ Follow the harness-code-review skill process exactly.
290
+ Report findings with severity (blocking / warning / note).
245
291
  ```
246
292
 
247
- 2. **When the subagent returns:**
293
+ 2. **When the agent returns:**
248
294
  - **No blocking findings:** Report summary, transition to PHASE_COMPLETE.
249
295
  - **Blocking findings:** Surface to user. Ask: "Address blocking findings before completing this phase? (yes / override / stop)"
250
296
  - **yes** — Re-enter EXECUTE with review fixes.
@@ -303,7 +349,7 @@ INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → REVIEW →
303
349
  - "Create a PR? (yes / no)"
304
350
  - If yes: assemble commit history, suggest PR title and description.
305
351
 
306
- 3. **Write final handoff:**
352
+ 3. **Write final handoff** to `{sessionDir}/handoff.json`:
307
353
 
308
354
  ```json
309
355
  {
@@ -326,20 +372,21 @@ INIT → ASSESS → PLAN → APPROVE_PLAN → EXECUTE → VERIFY → REVIEW →
326
372
  - [skill:harness-autopilot] [outcome:observation] {any notable patterns from the run}
327
373
  ```
328
374
 
329
- 5. **Clean up state:** Set `currentState: "DONE"` in `autopilot-state.json`. Do not delete the file — it serves as a record.
375
+ 5. **Clean up state:** Set `currentState: "DONE"` in `{sessionDir}/autopilot-state.json`. Do not delete the file — it serves as a record.
330
376
 
331
377
  ## Harness Integration
332
378
 
333
379
  - **`harness validate`** — Run during INIT to verify project health. Included in every execution task via harness-execution delegation.
334
380
  - **`harness check-deps`** — Delegated to harness-execution (included in task steps).
335
- - **State file** — `.harness/autopilot-state.json` tracks the orchestration state machine. `.harness/state.json` tracks task-level execution state (managed by harness-execution).
336
- - **Handoff** — `.harness/handoff.json` is written by each delegated skill and read by the next. Autopilot writes a final handoff on DONE.
337
- - **Learnings** — `.harness/learnings.md` is appended by both delegated skills and autopilot itself.
381
+ - **State file** — `.harness/sessions/<slug>/autopilot-state.json` tracks the orchestration state machine. `.harness/sessions/<slug>/state.json` tracks task-level execution state (managed by harness-execution). The slug is derived from the spec path during INIT.
382
+ - **Handoff** — `.harness/sessions/<slug>/handoff.json` is written by each delegated skill and read by the next. Autopilot writes a final handoff on DONE.
383
+ - **Learnings** — `.harness/learnings.md` (global) is appended by both delegated skills and autopilot itself.
384
+ - **Roadmap context** — During INIT, reads `docs/roadmap.md` (if present) for project-level priorities, blockers, and milestone status. Provides broader context for phase execution decisions.
338
385
 
339
386
  ## Success Criteria
340
387
 
341
388
  - Single `/harness:autopilot` invocation executes all phases through to completion
342
- - Resume from any state after context reset via `.harness/autopilot-state.json`
389
+ - Resume from any state after context reset via session-scoped `autopilot-state.json`
343
390
  - Low-complexity phases auto-plan; high-complexity phases pause for interactive planning
344
391
  - Planning override bumps complexity upward when task signals disagree
345
392
  - Retry budget (3 attempts) with escalating context before surfacing failures
@@ -360,7 +407,7 @@ Read spec — found 3 phases:
360
407
  Phase 1: Core Scanner (complexity: low)
361
408
  Phase 2: Rule Engine (complexity: high)
362
409
  Phase 3: CLI Integration (complexity: low)
363
- Created .harness/autopilot-state.json. Starting Phase 1.
410
+ Created .harness/sessions/specs--2026-03-19-security-scanner/autopilot-state.json. Starting Phase 1.
364
411
  ```
365
412
 
366
413
  **Phase 1 — ASSESS:**
@@ -372,7 +419,7 @@ Phase 1: Core Scanner — complexity: low. Auto-planning.
372
419
  **Phase 1 — PLAN:**
373
420
 
374
421
  ```
375
- [Subagent runs harness-planning]
422
+ [harness-planner agent runs harness-planning]
376
423
  Plan generated: docs/plans/2026-03-19-core-scanner-plan.md (8 tasks, ~24 min)
377
424
  ```
378
425
 
@@ -388,9 +435,9 @@ Approve this plan and begin execution? (yes / revise / skip / stop)
388
435
  **Phase 1 — EXECUTE → VERIFY → REVIEW:**
389
436
 
390
437
  ```
391
- [Subagent executes 8 tasks... all pass]
392
- [Subagent runs verification... pass]
393
- [Subagent runs code review... 0 blocking, 2 notes]
438
+ [harness-task-executor agent executes 8 tasks... all pass]
439
+ [harness-verifier agent runs verification... pass]
440
+ [harness-code-reviewer agent runs code review... 0 blocking, 2 notes]
394
441
  ```
395
442
 
396
443
  **Phase 1 — PHASE_COMPLETE:**
@@ -479,16 +526,16 @@ How should we proceed? (fix manually and continue / revise plan / stop)
479
526
 
480
527
  ## Gates
481
528
 
482
- - **No reimplementing delegated skills.** Autopilot orchestrates. If you are writing planning logic, execution logic, verification logic, or review logic, STOP. Delegate to the appropriate skill.
529
+ - **No reimplementing delegated skills.** Autopilot orchestrates. If you are writing planning logic, execution logic, verification logic, or review logic, STOP. Delegate to the appropriate persona agent via `subagent_type`.
483
530
  - **No executing without plan approval.** Every plan must be explicitly approved by the human before execution begins. No exceptions, regardless of complexity level.
484
531
  - **No skipping VERIFY or REVIEW.** Every phase goes through verification and review. The human can override findings, but the steps cannot be skipped.
485
532
  - **No infinite retries.** The retry budget is 3 attempts. If exhausted, STOP and surface to the human. Do not extend the budget without explicit human instruction.
486
- - **No modifying autopilot-state.json manually.** The state file is managed by the skill. If the state appears corrupted, start fresh rather than patching it.
533
+ - **No modifying session state files manually.** The session state files are managed by the skill. If the state appears corrupted, start fresh rather than patching it.
487
534
 
488
535
  ## Escalation
489
536
 
490
537
  - **When the spec has no Implementation Order section:** Cannot identify phases. Ask the user to add phase annotations to the spec or provide a roadmap file.
491
- - **When a delegated skill fails to produce expected output:** Check that handoff.json was written correctly. If the subagent failed, report the failure and ask the user whether to retry the entire phase step or stop.
492
- - **When the user wants to reorder phases mid-run:** Update the phases array in autopilot-state.json (mark skipped phases, adjust currentPhase). Do not re-run completed phases.
538
+ - **When a delegated skill fails to produce expected output:** Check that `{sessionDir}/handoff.json` was written correctly. If the agent failed, report the failure and ask the user whether to retry the entire phase step or stop.
539
+ - **When the user wants to reorder phases mid-run:** Update the phases array in the session-scoped `autopilot-state.json` (mark skipped phases, adjust currentPhase). Do not re-run completed phases.
493
540
  - **When context limits are approaching:** Persist state immediately and inform the user: "Context limit approaching. State saved. Re-invoke /harness:autopilot to continue from this point."
494
541
  - **When multiple phases fail in sequence:** After 2 consecutive phase failures (retry budget exhausted in both), suggest the user review the spec for systemic issues rather than continuing.
@@ -42,9 +42,11 @@ phases:
42
42
  state:
43
43
  persistent: true
44
44
  files:
45
- - .harness/autopilot-state.json
46
- - .harness/state.json
45
+ - .harness/sessions/*/autopilot-state.json
46
+ - .harness/sessions/*/state.json
47
+ - .harness/sessions/*/handoff.json
47
48
  - .harness/learnings.md
49
+ - .harness/failures.md
48
50
  depends_on:
49
51
  - harness-planning
50
52
  - harness-execution
@@ -38,6 +38,21 @@ If you find yourself writing production code, tests, or scaffolding before the h
38
38
 
39
39
  1. **Ask ONE question at a time.** Do not dump a list of 10 questions on the human. Ask the most important question first. Wait for the answer. Let the answer inform the next question.
40
40
 
41
+ When asking a clarifying question, use `emit_interaction` with `type: 'question'`:
42
+
43
+ ```json
44
+ emit_interaction({
45
+ path: "<project-root>",
46
+ type: "question",
47
+ question: {
48
+ text: "For auth, should we use:",
49
+ options: ["A) existing JWT middleware", "B) OAuth2 via provider X", "C) external service"]
50
+ }
51
+ })
52
+ ```
53
+
54
+ This records the question in state and returns a formatted prompt to present.
55
+
41
56
  2. **Prefer multiple choice.** Instead of "How should we handle auth?", ask "For auth, should we: (A) use existing JWT middleware, (B) add OAuth2 via provider X, or (C) delegate to an external service?" Give 2-4 concrete options with brief tradeoff notes.
42
57
 
43
58
  3. **When the human answers, acknowledge and build on it.** Do not re-ask clarified points. Track decisions as they accumulate.
@@ -67,6 +82,13 @@ These keywords flow into the `handoff.json` `contextKeywords` field when the spe
67
82
  - **Estimated complexity:** Low / Medium / High, with a brief justification
68
83
  - **Risk:** What could go wrong, what assumptions might be wrong
69
84
 
85
+ When presenting approach tradeoffs, use conventional markdown patterns:
86
+
87
+ ```
88
+ **[IMPORTANT]** Approach 1 trades simplicity for extensibility
89
+ **[SUGGESTION]** Consider Approach 2 if real-time requirements emerge later
90
+ ```
91
+
70
92
  2. **Be honest about tradeoffs.** Do not soft-sell a preferred approach. If approach A is simpler but less extensible, say so plainly.
71
93
 
72
94
  3. **State your recommendation** and why, but defer to the human's decision.
@@ -84,13 +106,62 @@ These keywords flow into the `handoff.json` `contextKeywords` field when the spe
84
106
  - Success criteria (observable, testable outcomes)
85
107
  - Implementation order (high-level phases, not detailed tasks — that is harness-planning's job)
86
108
 
87
- 2. **After all sections are reviewed, write the spec to `docs/`.** Use the project's existing spec naming convention. If none exists, use `docs/specs/YYYY-MM-DD-<feature-name>.md`.
109
+ 2. **Run soundness review.** After all sections are reviewed and the spec is drafted, invoke `harness-soundness-review --mode spec` against the draft. Do not proceed to write the spec to `docs/` until the soundness review converges with no remaining issues.
88
110
 
89
- When the project has `docs/specs/`, write proposals to `docs/changes/<feature>/proposal.md` instead. This keeps change proposals separate from established specs. Fall back to the existing behavior (`docs/specs/`) when no `docs/specs/` directory exists yet.
111
+ 3. **Write the spec to `docs/`.** Use the project's existing spec naming convention. If none exists, use `docs/specs/YYYY-MM-DD-<feature-name>.md`.
90
112
 
91
- 3. **Run `harness validate`** to verify the spec file is properly placed and the project remains healthy.
113
+ When the project has `docs/specs/`, write proposals to `docs/changes/<feature>/proposal.md` instead. This keeps change proposals separate from established specs. Fall back to the existing behavior (`docs/specs/`) when no `docs/specs/` directory exists yet.
92
114
 
93
- 4. **Ask for final sign-off.** Present the complete spec file path and a one-paragraph summary. The human must explicitly approve before this skill is complete.
115
+ 4. **Run `harness validate`** to verify the spec file is properly placed and the project remains healthy.
116
+
117
+ 5. **Request sign-off via `emit_interaction`:**
118
+
119
+ ```json
120
+ emit_interaction({
121
+ path: "<project-root>",
122
+ type: "confirmation",
123
+ confirmation: {
124
+ text: "Approve spec at <file-path>?",
125
+ context: "<one-paragraph summary of the design>"
126
+ }
127
+ })
128
+ ```
129
+
130
+ The human must explicitly approve before this skill is complete.
131
+
132
+ 6. **Write handoff and suggest transition.** After the human approves the spec:
133
+
134
+ Write `.harness/handoff.json`:
135
+
136
+ ```json
137
+ {
138
+ "fromSkill": "harness-brainstorming",
139
+ "phase": "VALIDATE",
140
+ "summary": "<1-sentence spec summary>",
141
+ "artifacts": ["<spec file path>"],
142
+ "decisions": [{ "what": "<decision>", "why": "<rationale>" }],
143
+ "contextKeywords": ["<domain keywords from Phase 2>"]
144
+ }
145
+ ```
146
+
147
+ Call `emit_interaction`:
148
+
149
+ ```json
150
+ {
151
+ "type": "transition",
152
+ "transition": {
153
+ "completedPhase": "brainstorming",
154
+ "suggestedNext": "planning",
155
+ "reason": "Spec approved and written to docs/",
156
+ "artifacts": ["<spec file path>"],
157
+ "requiresConfirmation": true,
158
+ "summary": "<Spec title> -- <key design choices>. <N> success criteria, <N> implementation phases."
159
+ }
160
+ }
161
+ ```
162
+
163
+ If the user confirms: invoke harness-planning with the spec path.
164
+ If the user declines: stop. The handoff is written for future invocation.
94
165
 
95
166
  ---
96
167
 
@@ -147,6 +218,7 @@ Converge on a recommendation that addresses all concerns before presenting the d
147
218
  - **`harness check-docs`** — Run to verify the spec does not conflict with existing documentation.
148
219
  - **Spec location** — Specs go to `docs/` (or `docs/specs/` if the project uses that convention). Follow existing naming patterns.
149
220
  - **Handoff to harness-planning** — Once the spec is approved, invoke harness-planning to create the implementation plan from the spec.
221
+ - **`emit_interaction`** -- Call at the end of Phase 4 to suggest transitioning to harness-planning. Uses confirmed transition (waits for user approval).
150
222
 
151
223
  #### Requirement Phrasing
152
224
 
@@ -15,6 +15,7 @@ tools:
15
15
  - Edit
16
16
  - Glob
17
17
  - Grep
18
+ - emit_interaction
18
19
  cli:
19
20
  command: harness skill run harness-brainstorming
20
21
  args:
@@ -45,3 +46,4 @@ state:
45
46
  files: []
46
47
  depends_on:
47
48
  - harness-planning
49
+ - harness-soundness-review