@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,167 @@
1
+ # Harness Integrity
2
+
3
+ > Unified integrity gate — single invocation chains mechanical verification with AI-powered code review and produces a consolidated pass/fail report.
4
+
5
+ ## When to Use
6
+
7
+ - Before opening or merging a pull request
8
+ - At project milestones as a comprehensive quality check
9
+ - When you need a single authoritative answer: "is this code ready to ship?"
10
+ - NOT after every task (use `harness-verify` for quick post-task checks)
11
+ - NOT for deep architectural audits (use `harness-verification` for that)
12
+
13
+ ## Relationship to Other Skills
14
+
15
+ | Skill | What It Does | Scope | Time |
16
+ | ---------------------------- | ---------------------------------------------- | ---------------------- | ----- |
17
+ | **harness-verify** | Mechanical only: typecheck, lint, test | Exit codes | ~30s |
18
+ | **harness-code-review** | AI only: change-type-aware review | LLM analysis | ~2min |
19
+ | **harness-integrity** (this) | Both: verify + code-review unified | Full pipeline | ~3min |
20
+ | **harness-verification** | Deep audit: architecture, patterns, edge cases | Thorough investigation | ~5min |
21
+
22
+ `harness-integrity` is the standard pre-PR gate. It runs the fast mechanical checks first, then layers on AI review, and produces a single consolidated report.
23
+
24
+ ## Process
25
+
26
+ ### Phase 1: VERIFY
27
+
28
+ Invoke `harness-verify` to run the mechanical quick gate.
29
+
30
+ 1. Delegate entirely to `harness-verify` — typecheck, lint, test.
31
+ 2. Capture the structured result (PASS/FAIL per check).
32
+ 3. **If ALL three checks FAIL**, stop here. Do not proceed to Phase 2. The code is not in a reviewable state.
33
+ 4. If at least one check passes (or some are skipped), proceed to Phase 2.
34
+
35
+ ### Phase 1.5: SECURITY SCAN
36
+
37
+ Run the built-in security scanner as a mechanical check between verification and AI review.
38
+
39
+ 1. Use `run_security_scan` MCP tool against the project root (or changed files if available).
40
+ 2. Capture findings by severity: errors, warnings, info.
41
+ 3. **Error-severity security findings are blocking** — they cause the overall integrity check to FAIL, same as a test failure.
42
+ 4. Warning/info findings are included in the report but do not block.
43
+
44
+ ### Phase 1.7: DESIGN HEALTH (conditional)
45
+
46
+ When the project has `design` configured in `harness.config.json`:
47
+
48
+ 1. Run `harness-design` in review mode to check existing components against design intent and anti-patterns.
49
+ 2. Run `harness-accessibility` in scan+evaluate mode to check WCAG compliance.
50
+ 3. Combine findings into a design health summary:
51
+ - Error count (blocking, based on strictness)
52
+ - Warning count (non-blocking)
53
+ - Info count (advisory)
54
+ 4. **Error-severity design findings are blocking** in `strict` mode only. In `standard` and `permissive` modes, design findings do not block.
55
+ 5. If no `design` block exists, skip this phase entirely.
56
+
57
+ ### Phase 1.8: I18N SCAN (conditional)
58
+
59
+ When the project has `i18n.enabled: true` in `harness.config.json`:
60
+
61
+ 1. Run `harness-i18n` in scan mode to detect hardcoded strings, missing translations, locale-sensitive formatting issues, and RTL violations.
62
+ 2. Combine findings into an i18n health summary:
63
+ - Error count (blocking, based on `i18n.strictness`)
64
+ - Warning count (non-blocking)
65
+ - Info count (advisory)
66
+ 3. **Error-severity i18n findings are blocking** in `strict` mode only. In `standard` and `permissive` modes, i18n findings do not block.
67
+ 4. If no `i18n` block exists or `i18n.enabled` is false, skip this phase entirely.
68
+
69
+ ### Phase 2: REVIEW
70
+
71
+ Run change-type-aware AI review using `harness-code-review`.
72
+
73
+ 1. Detect the change type if not provided: `feature`, `bugfix`, `refactor`, or `docs`.
74
+ 2. Invoke `harness-code-review` with the detected change type.
75
+ 3. Capture the review findings: suggestions, blocking issues, and notes.
76
+ 4. A review finding is "blocking" only if it would cause a runtime error, data loss, or security vulnerability.
77
+ 5. The AI review includes a security-focused pass that complements the mechanical scanner — checking for semantic issues like user input flowing to dangerous sinks across function boundaries.
78
+
79
+ ### Phase 3: REPORT
80
+
81
+ Produce a unified integrity report in this exact format:
82
+
83
+ ```
84
+ Integrity Check: [PASS/FAIL]
85
+ - Tests: [PASS/FAIL/SKIPPED]
86
+ - Lint: [PASS/FAIL/SKIPPED]
87
+ - Types: [PASS/FAIL/SKIPPED]
88
+ - Security: [PASS/WARN/FAIL] ([count] errors, [count] warnings)
89
+ - Design: [PASS/WARN/FAIL/SKIPPED] ([count] errors, [count] warnings)
90
+ - i18n: [PASS/WARN/FAIL/SKIPPED] ([count] errors, [count] warnings)
91
+ - Review: [PASS/FAIL] ([count] suggestions, [count] blocking)
92
+
93
+ Overall: [PASS/FAIL]
94
+ ```
95
+
96
+ Rules:
97
+
98
+ - Overall `PASS` requires: all non-skipped mechanical checks pass AND zero blocking review findings AND zero blocking design findings (strict mode only) AND zero blocking i18n findings (strict mode only).
99
+ - Any mechanical failure OR any blocking review finding means `FAIL`.
100
+ - On FAIL, include a summary section listing each failure reason.
101
+ - Non-blocking review suggestions are noted but do not cause FAIL.
102
+
103
+ ## Deterministic Checks
104
+
105
+ - **Phase 1 is fully deterministic.** Exit codes determine pass/fail with no interpretation.
106
+ - **Phase 2 involves LLM judgment.** The AI review may produce different results on repeated runs. Only "blocking" findings (runtime errors, data loss, security) affect the overall result.
107
+
108
+ ## Harness Integration
109
+
110
+ - Chains harness-verify (mechanical) and harness-code-review (AI) into a unified pipeline
111
+ - Follows Principle 7 — deterministic checks always run first
112
+ - Consumes change-type detection from harness-code-review for per-type checklists
113
+ - Output can be written to `.harness/integrity-report.md` for CI integration
114
+ - Invokes `harness-design` and `harness-accessibility` for design health when `design` config exists
115
+ - Design strictness from config controls whether design findings block the overall result
116
+ - Invokes `harness-i18n` for i18n compliance when `i18n.enabled` is true in config. i18n strictness controls whether findings block the overall result.
117
+
118
+ ## Success Criteria
119
+
120
+ - [ ] Mechanical verification ran and produced structured results
121
+ - [ ] AI review ran with change-type awareness
122
+ - [ ] Unified report follows the exact format
123
+ - [ ] Overall verdict correctly reflects both mechanical and review results
124
+
125
+ ## Examples
126
+
127
+ ### Example: All Clear
128
+
129
+ ```
130
+ Integrity Check: PASS
131
+ - Tests: PASS (42/42)
132
+ - Lint: PASS (0 warnings)
133
+ - Types: PASS
134
+ - Security: PASS (0 errors, 0 warnings)
135
+ - Design: PASS (0 errors, 0 warnings)
136
+ - i18n: PASS (0 errors, 0 warnings)
137
+ - Review: 1 suggestion (0 blocking)
138
+ ```
139
+
140
+ ### Example: Security Blocking Issue
141
+
142
+ ```
143
+ Integrity Check: FAIL
144
+ - Tests: PASS (42/42)
145
+ - Lint: PASS
146
+ - Types: PASS
147
+ - Security: FAIL (1 error, 0 warnings)
148
+ - [SEC-INJ-002] src/auth/login.ts:42 — SQL query built with string concatenation
149
+ - Design: WARN (0 errors, 2 warnings)
150
+ - i18n: SKIPPED
151
+ - Review: 3 findings (1 blocking)
152
+
153
+ Blocking: [SEC-INJ-002] SQL injection — user input passed directly to query without parameterization.
154
+ ```
155
+
156
+ ## Gates
157
+
158
+ - **Mechanical first.** Always run Phase 1 before Phase 2. If the code does not compile or pass basic checks, AI review is wasted effort (unless partial results exist).
159
+ - **No partial reports.** The report must include results from all phases that were executed. Do not output Phase 1 results without attempting Phase 2 (unless the all-fail early stop triggers).
160
+ - **Fresh execution only.** Do not reuse cached results. Run everything from scratch each time.
161
+
162
+ ## Escalation
163
+
164
+ - **All checks fail:** If typecheck, lint, and test all fail in Phase 1, stop immediately. Report the failures and skip Phase 2. The code needs basic fixes before review is worthwhile.
165
+ - **Architectural concerns:** If the AI review identifies architectural concerns, note them in the report but do not mark them as blocking. Architectural decisions require human judgment.
166
+ - **Timeout:** Phase 1 inherits the 120-second per-command timeout from `harness-verify`. Phase 2 has a 180-second timeout for the AI review.
167
+ - **Missing dependencies:** If `harness-verify` or `harness-code-review` skills are unavailable, report the missing dependency and mark the corresponding phase as `ERROR`.
@@ -0,0 +1,47 @@
1
+ name: harness-integrity
2
+ version: "1.0.0"
3
+ description: Unified integrity gate — chains verify (quick gate) with AI review into a single report
4
+ triggers:
5
+ - manual
6
+ - on_pr
7
+ - on_milestone
8
+ platforms:
9
+ - claude-code
10
+ - gemini-cli
11
+ tools:
12
+ - Bash
13
+ - Read
14
+ - Glob
15
+ - Grep
16
+ cli:
17
+ command: harness skill run harness-integrity
18
+ args:
19
+ - name: path
20
+ description: Project root path
21
+ required: false
22
+ - name: change-type
23
+ description: "Type of change: feature, bugfix, refactor, docs"
24
+ required: false
25
+ mcp:
26
+ tool: run_skill
27
+ input:
28
+ skill: harness-integrity
29
+ path: string
30
+ type: rigid
31
+ cognitive_mode: meticulous-verifier
32
+ phases:
33
+ - name: verify
34
+ description: Run harness-verify quick gate (test, lint, typecheck)
35
+ required: true
36
+ - name: review
37
+ description: Run change-type-aware AI review
38
+ required: true
39
+ - name: report
40
+ description: Produce unified integrity report
41
+ required: true
42
+ state:
43
+ persistent: false
44
+ files: []
45
+ depends_on:
46
+ - harness-verify
47
+ - harness-code-review
@@ -13,8 +13,35 @@
13
13
 
14
14
  ## Prerequisites
15
15
 
16
- A knowledge graph must exist at `.harness/graph/`. Run `harness scan` if no graph is available.
17
- If the graph exists but code has changed since the last scan, re-run `harness scan` first — stale graph data leads to inaccurate results.
16
+ A knowledge graph at `.harness/graph/` enables full analysis. If no graph exists,
17
+ the skill uses static analysis fallbacks (see Graph Availability section).
18
+ Run `harness scan` to enable graph-enhanced analysis.
19
+
20
+ ### Graph Availability
21
+
22
+ Before starting, check if `.harness/graph/graph.json` exists.
23
+
24
+ **If graph exists:** Check staleness — compare `.harness/graph/metadata.json`
25
+ scanTimestamp against `git log -1 --format=%ct` (latest commit timestamp).
26
+ If graph is more than 10 commits behind (`git log --oneline <scanTimestamp>..HEAD | wc -l`),
27
+ run `harness scan` to refresh before proceeding. (Staleness sensitivity: **Medium**)
28
+
29
+ **If graph exists and is fresh (or refreshed):** Use graph tools as primary strategy.
30
+
31
+ **If no graph exists:** Output "Running without graph (run `harness scan` to
32
+ enable full analysis)" and use fallback strategies for all subsequent steps.
33
+
34
+ ### Pipeline Context (when orchestrated)
35
+
36
+ When invoked by `harness-docs-pipeline`, check for a `pipeline` field in `.harness/handoff.json`:
37
+
38
+ - If `pipeline` field exists: read `DocPipelineContext` from it
39
+ - If `pipeline.bootstrapped === true`, this is a bootstrap invocation — generate full AGENTS.md without confirmation prompt
40
+ - Write any generated documentation back as `DocFix[]` to `pipeline.fillsApplied`
41
+ - This enables the orchestrator to track what was generated and verify it
42
+ - If `pipeline` field does not exist: behave exactly as today (standalone mode)
43
+
44
+ No changes to the skill's interface or output format — the pipeline field is purely additive.
18
45
 
19
46
  ## Process
20
47
 
@@ -40,6 +67,20 @@ If the graph exists but code has changed since the last scan, re-run `harness sc
40
67
  get_relationships(nodeId=<module>, direction="outbound", depth=1)
41
68
  ```
42
69
 
70
+ #### Fallback (without graph)
71
+
72
+ When no graph is available, use directory structure and file analysis:
73
+
74
+ 1. **Module hierarchy from directories**: Use the directory structure as the module hierarchy — each directory represents a module. Glob for all source files to build the tree.
75
+ 2. **Entry points**: Check `package.json` for `main` and `exports` fields. Glob for `src/index.*` and `index.*` patterns. These are the entry points.
76
+ 3. **Source file inventory**: Glob for all source files (`**/*.ts`, `**/*.tsx`, `**/*.js`, `**/*.jsx`, etc.).
77
+ 4. **Documentation inventory**: Glob for all doc files (`**/*.md`, `docs/**/*`).
78
+ 5. **Undocumented module detection**: Diff the source directory set against the doc directory set. Source directories with no corresponding docs (no README.md, no matching doc file) are undocumented.
79
+ 6. **Existing knowledge map**: Read existing AGENTS.md if present for current knowledge map state.
80
+ 7. **Dependency flow (approximate)**: Parse import statements in each module's files to determine which modules depend on which others.
81
+
82
+ > Fallback completeness: ~50% — no semantic grouping; modules grouped by directory only; no cross-cutting concern detection.
83
+
43
84
  ### Phase 2: GENERATE — Build Knowledge Map
44
85
 
45
86
  Generate markdown sections following AGENTS.md conventions:
@@ -109,7 +150,7 @@ This ensures subsequent graph queries (impact analysis, drift detection) include
109
150
 
110
151
  ## Harness Integration
111
152
 
112
- - **`harness scan`** — Must run before this skill to ensure graph is current.
153
+ - **`harness scan`** — Recommended before this skill for full graph-enhanced analysis. If graph is missing, skill uses directory structure fallbacks.
113
154
  - **`harness validate`** — Run after acting on findings to verify project health.
114
155
  - **Graph tools** — This skill uses `query_graph`, `get_relationships`, and `check_docs` MCP tools.
115
156
 
@@ -119,7 +160,7 @@ This ensures subsequent graph queries (impact analysis, drift detection) include
119
160
  - Coverage gaps identified (undocumented modules, missing descriptions, stale references)
120
161
  - Output written to AGENTS.md (or specified path) in proper markdown format
121
162
  - Report follows the structured output format
122
- - All findings are backed by graph query evidence, not heuristics
163
+ - All findings are backed by graph query evidence (with graph) or directory/file analysis (without graph)
123
164
 
124
165
  ## Examples
125
166
 
@@ -145,7 +186,7 @@ Output:
145
186
 
146
187
  ## Gates
147
188
 
148
- - **No generation without graph.** If no graph exists, stop and instruct to run `harness scan`.
189
+ - **Graph preferred, fallback available.** If no graph exists, use directory structure and file analysis to build the knowledge map. Do not stop — produce the best map possible.
149
190
  - **Never overwrite without confirmation.** If AGENTS.md exists, show the diff and ask before replacing.
150
191
 
151
192
  ## Escalation
@@ -0,0 +1,288 @@
1
+ # Harness Onboarding
2
+
3
+ > Navigate an existing harness-managed project and generate a structured orientation for new team members. Map the codebase, understand constraints, identify the adoption level, and produce a summary that gets someone productive fast.
4
+
5
+ ## When to Use
6
+
7
+ - A new developer (human or agent) is joining a harness-managed project for the first time
8
+ - Resuming work on a project after extended time away and needing to re-orient
9
+ - When `on_project_init` triggers fire in an existing project (agent starting a new session)
10
+ - When someone asks "how does this project work?" or "where do I start?"
11
+ - NOT when initializing a new project (use initialize-harness-project)
12
+ - NOT when the project has no harness configuration (onboard to harness first with initialize-harness-project)
13
+ - NOT when deep-diving into a specific module (use standard code exploration — onboarding gives the big picture)
14
+
15
+ ## Process
16
+
17
+ ### Phase 1: READ — Load Project Configuration
18
+
19
+ 1. **Read `AGENTS.md`.** This is the primary source of truth for agent behavior in the project. Note:
20
+ - Project description and purpose
21
+ - Architecture overview
22
+ - Conventions and coding standards
23
+ - Constraints and forbidden patterns
24
+ - Any special instructions or warnings
25
+
26
+ 2. **Read `harness.yaml`.** Extract:
27
+ - Project name and stack
28
+ - Adoption level (basic, intermediate, advanced)
29
+ - Layer definitions and their directory mappings
30
+ - Dependency constraints between layers
31
+ - Registered skills and their triggers
32
+ - Persona configuration (if present)
33
+
34
+ 3. **Read `.harness/learnings.md`** if it exists. This contains hard-won insights from previous sessions — decisions made, gotchas discovered, patterns that worked or failed. Summarize the most recent and most important entries.
35
+
36
+ 4. **Read `.harness/state.json`** if it exists. This reveals what was happening in the last session — current phase, active task, any blockers that were recorded.
37
+
38
+ ### Phase 2: MAP — Understand the Codebase Structure
39
+
40
+ 1. **Map the technology stack.** Identify from package files, configuration, and code:
41
+ - Language(s) and version(s)
42
+ - Framework(s) and major libraries
43
+ - Test framework and test runner command
44
+ - Build tool and build command
45
+ - Package manager
46
+ - Database or data stores (if applicable)
47
+
48
+ 2. **Map the architecture.** Walk the directory structure and identify:
49
+ - Top-level organization pattern (monorepo, single package, workspace)
50
+ - Source code location and entry points
51
+ - Layer boundaries (from `harness.yaml` and actual directory structure)
52
+ - Shared utilities or common modules
53
+ - Configuration files and their purposes
54
+
55
+ 3. **Map the conventions.** Look for patterns in existing code:
56
+ - File naming conventions (kebab-case, camelCase, PascalCase)
57
+ - Test file location and naming (co-located, separate directory, `.test.ts` vs `.spec.ts`)
58
+ - Import style (relative, aliases, barrel files)
59
+ - Error handling patterns
60
+ - Logging patterns
61
+ - Code formatting (detect from config files: `.prettierrc`, `.eslintrc`, `biome.json`)
62
+
63
+ 4. **Map the constraints.** Identify what is restricted:
64
+ - Forbidden imports (from `harness.yaml` dependency constraints)
65
+ - Layer boundary rules (which layers can import from which)
66
+ - Linting rules that encode architectural decisions
67
+ - Any constraints documented in `AGENTS.md` that are not yet automated
68
+
69
+ 5. **Map the design system** (when present). Look for:
70
+ - `design-system/tokens.json` — W3C DTCG design tokens (colors, typography, spacing)
71
+ - `design-system/DESIGN.md` — Aesthetic intent, anti-patterns, platform notes
72
+ - `harness.config.json` `design` block — strictness level, enabled platforms, token path
73
+ - Active design skills — check if `harness-design-system`, `harness-accessibility`, `harness-design`, `harness-design-web`, `harness-design-mobile` are available
74
+ - Design constraint violations — run a quick `harness-accessibility` scan to surface any existing issues
75
+ - Token coverage — how many components reference tokens vs. hardcoded values
76
+
77
+ If no design system exists, note this as a potential improvement area.
78
+
79
+ 6. **Map the concerns.** Identify areas that need attention:
80
+ - Are there TODOs or FIXMEs in the code?
81
+ - Does `harness validate` pass cleanly, or are there warnings?
82
+ - Are there known blockers in `.harness/state.json`?
83
+ - Is documentation up to date with the code?
84
+ - Are there tests? What is the approximate coverage?
85
+
86
+ ### Graph-Enhanced Context (when available)
87
+
88
+ When a knowledge graph exists at `.harness/graph/`, use graph queries for faster, more accurate codebase mapping:
89
+
90
+ - `query_graph` — map architecture automatically from module and layer nodes, replacing manual directory walking
91
+ - `search_similar` — find entry points and key files by querying for high-connectivity nodes
92
+ - `get_relationships` — show layer dependencies and module structure as a traversable graph
93
+
94
+ Graph queries produce a complete architecture map in seconds, including transitive relationships that directory inspection misses. Fall back to file-based commands if no graph is available.
95
+
96
+ ### Phase 3: ORIENT — Identify Adoption Level and Maturity
97
+
98
+ 1. **Confirm the adoption level** matches what `harness.yaml` declares:
99
+ - Basic: `AGENTS.md` and `harness.yaml` exist but no layers or constraints
100
+ - Intermediate: Layers defined, dependency constraints enforced, at least one custom skill
101
+ - Advanced: Personas, state management, learnings, CI integration
102
+
103
+ 2. **Assess harness health.** Run `harness validate` and note any issues. A project that declares intermediate but fails validation is not truly intermediate.
104
+
105
+ 3. **Identify available skills.** List the skills configured for the project. Note which are custom (project-specific) vs. standard (harness-provided). Each skill represents a workflow the team has formalized.
106
+
107
+ ### Phase 4: SUMMARIZE — Generate Orientation Output
108
+
109
+ 1. **Produce a structured orientation summary.** This is the deliverable. Format:
110
+
111
+ ```markdown
112
+ # Project Orientation: <project-name>
113
+
114
+ ## Overview
115
+
116
+ <1-2 sentence project description from AGENTS.md>
117
+
118
+ ## Stack
119
+
120
+ - Language: <language> <version>
121
+ - Framework: <framework>
122
+ - Tests: <test framework> (`<test command>`)
123
+ - Build: <build tool> (`<build command>`)
124
+ - Package manager: <pm>
125
+
126
+ ## Architecture
127
+
128
+ <Brief description of top-level organization>
129
+
130
+ ### Layers
131
+
132
+ | Layer | Directories | Can Import From |
133
+ | ------- | ----------- | ----------------- |
134
+ | <layer> | <dirs> | <allowed imports> |
135
+
136
+ ### Key Components
137
+
138
+ - <component>: <purpose> (<location>)
139
+
140
+ ## Constraints
141
+
142
+ - <constraint 1>
143
+ - <constraint 2>
144
+
145
+ ## Conventions
146
+
147
+ - <convention 1>
148
+ - <convention 2>
149
+
150
+ ## Design System
151
+
152
+ - **Tokens:** [present/absent] ([token count] tokens in [group count] groups)
153
+ - **Aesthetic Intent:** [present/absent] (style: [style], strictness: [level])
154
+ - **Platforms:** [web, mobile, or none configured]
155
+ - **Accessibility:** [baseline scan result — e.g., "3 warnings, 0 errors"]
156
+ - **Design Skills:** [list of available design skills]
157
+
158
+ ## Harness Status
159
+
160
+ - Adoption level: <level>
161
+ - Validation: <pass/fail with summary>
162
+ - Available skills: <list>
163
+ - State: <current phase/task if applicable>
164
+
165
+ ## Recent Learnings
166
+
167
+ - <most relevant learnings from .harness/learnings.md>
168
+
169
+ ## Getting Started
170
+
171
+ 1. <first thing to do>
172
+ 2. <second thing to do>
173
+ 3. <third thing to do>
174
+ ```
175
+
176
+ 2. **Tailor "Getting Started" to the audience.** For a new developer: how to set up the dev environment and run tests. For an agent resuming work: what the current task is and what to do next. For a reviewer: where to look and what constraints to check.
177
+
178
+ 3. **Present the summary to the human.** Do not write it to a file unless asked. The orientation is a conversation artifact, not a project artifact.
179
+
180
+ ## Harness Integration
181
+
182
+ - **`harness validate`** — Run during onboarding to assess project health and identify any configuration issues.
183
+ - **`harness skill list`** — List available skills to understand what workflows the team has formalized.
184
+ - **`harness check-deps`** — Run to verify dependency constraints are passing, which confirms layer boundaries are respected.
185
+ - **`harness state show`** — View current state to understand where the last session left off.
186
+ - **`AGENTS.md`** — Primary source of project context and agent instructions.
187
+ - **`harness.yaml`** — Source of structural configuration (layers, constraints, skills).
188
+ - **`.harness/learnings.md`** — Historical context and institutional knowledge.
189
+
190
+ ## Success Criteria
191
+
192
+ - All four configuration sources were read (`AGENTS.md`, `harness.yaml`, `.harness/learnings.md`, `.harness/state.json`)
193
+ - Technology stack is accurately identified (language, framework, test runner, build tool)
194
+ - Architecture is mapped with correct layer boundaries and dependency directions
195
+ - Conventions are identified from actual code patterns, not assumed
196
+ - Constraints are enumerated from both `harness.yaml` and `AGENTS.md`
197
+ - Adoption level is confirmed (not just declared — validated)
198
+ - A structured orientation summary is produced with all sections filled
199
+ - The "Getting Started" section is actionable and tailored to the audience
200
+ - `harness validate` was run and results are reported
201
+
202
+ ## Examples
203
+
204
+ ### Example: Onboarding to an Intermediate TypeScript Project
205
+
206
+ **READ:**
207
+
208
+ ```
209
+ Read AGENTS.md:
210
+ - Project: Widget API — REST service for widget lifecycle management
211
+ - Stack: TypeScript, Express, Vitest, PostgreSQL
212
+ - Conventions: zod validation, repository pattern, kebab-case files
213
+
214
+ Read harness.yaml:
215
+ - Level: intermediate
216
+ - Layers: presentation (src/routes/), business (src/services/), data (src/repositories/)
217
+ - Constraints: presentation → business OK, business → data OK, data → presentation FORBIDDEN
218
+
219
+ Read .harness/learnings.md:
220
+ - "Date comparison needs UTC normalization — use Date.now()"
221
+ - "The notifications table has a unique constraint on (userId, type) — upsert, don't insert"
222
+
223
+ Read .harness/state.json:
224
+ - Position: Phase execute, Task 4 of 6
225
+ - Blocker: none
226
+ ```
227
+
228
+ **MAP:**
229
+
230
+ ```
231
+ Stack: TypeScript 5.3, Express 4, Vitest 1.2, pg (node-postgres)
232
+ Architecture: Single package, 3 layers, entry point src/index.ts
233
+ Conventions: kebab-case files, co-located tests (.test.ts), barrel exports
234
+ Constraints: 3 layers with strict downward-only imports
235
+ Concerns: harness validate passes, 47 tests all passing
236
+ ```
237
+
238
+ **ORIENT:**
239
+
240
+ ```
241
+ Adoption level: intermediate (confirmed — layers defined, constraints enforced)
242
+ Skills: harness-tdd, harness-execution, harness-code-review
243
+ State: Mid-execution on a 6-task notification feature plan
244
+ ```
245
+
246
+ **SUMMARIZE:**
247
+
248
+ ```
249
+ Produce orientation with all sections. Getting Started for this context:
250
+ 1. Read the plan at docs/plans/2026-03-14-notifications-plan.md
251
+ 2. Resume execution at Task 4 (state shows Tasks 1-3 complete)
252
+ 3. Note the UTC normalization gotcha from learnings before working with dates
253
+ ```
254
+
255
+ ### Example: Onboarding to a Basic Project
256
+
257
+ **READ:**
258
+
259
+ ```
260
+ Read AGENTS.md — exists, minimal content
261
+ Read harness.yaml — level: basic, no layers defined
262
+ No .harness/learnings.md
263
+ No .harness/state.json
264
+ ```
265
+
266
+ **MAP and SUMMARIZE:**
267
+
268
+ ```
269
+ Adoption level: basic (confirmed — no layers or constraints)
270
+ Getting Started:
271
+ 1. Run npm install && npm test to verify the project builds and tests pass
272
+ 2. Read AGENTS.md for project context and conventions
273
+ 3. Consider migrating to intermediate level to add layer boundaries
274
+ (use initialize-harness-project to upgrade)
275
+ ```
276
+
277
+ ## Adoption Maturity
278
+
279
+ A mental model for where a team sits on the harness adoption curve. Not prescriptive — just orientation.
280
+
281
+ | Level | Name | Description |
282
+ | ----- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
283
+ | 1 | **Manual** | Write `CLAUDE.md` by hand, run commands manually. Harness is a reference, not a tool. |
284
+ | 2 | **Repeatable** | Skills installed, agent follows conventions consistently. Workflows are codified but enforcement is human-driven. |
285
+ | 3 | **Automated** | Mechanical gates in CI. `harness validate` runs on PRs. Failures auto-log to `.harness/failures.md`. The system catches mistakes before humans do. |
286
+ | 4 | **Self-improving** | Learnings accumulate in `.harness/learnings.md`. Agents reference past failures before planning. Institutional knowledge compounds across sessions and team members. |
287
+
288
+ Most teams start at Level 1 and move up as they see the value. There is no pressure to reach Level 4 — each level delivers real benefits on its own.
@@ -0,0 +1,30 @@
1
+ name: harness-onboarding
2
+ version: "1.0.0"
3
+ description: Onboard a new developer to a harness-managed project
4
+ cognitive_mode: advisory-guide
5
+ triggers:
6
+ - manual
7
+ - on_project_init
8
+ platforms:
9
+ - claude-code
10
+ - gemini-cli
11
+ tools:
12
+ - Bash
13
+ - Read
14
+ - Glob
15
+ cli:
16
+ command: harness skill run harness-onboarding
17
+ args:
18
+ - name: path
19
+ description: Project root path
20
+ required: false
21
+ mcp:
22
+ tool: run_skill
23
+ input:
24
+ skill: harness-onboarding
25
+ path: string
26
+ type: flexible
27
+ state:
28
+ persistent: false
29
+ files: []
30
+ depends_on: []