@harness-engineering/cli 1.14.0 → 1.16.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 (499) hide show
  1. package/dist/agents/commands/codex/AGENTS.md +39 -0
  2. package/dist/agents/commands/codex/harness/add-harness-component/SKILL.md +195 -0
  3. package/dist/agents/commands/codex/harness/add-harness-component/agents/openai.yaml +3 -0
  4. package/dist/agents/commands/codex/harness/cleanup-dead-code/SKILL.md +248 -0
  5. package/dist/agents/commands/codex/harness/cleanup-dead-code/agents/openai.yaml +3 -0
  6. package/dist/agents/commands/codex/harness/detect-doc-drift/SKILL.md +182 -0
  7. package/dist/agents/commands/codex/harness/detect-doc-drift/agents/openai.yaml +3 -0
  8. package/dist/agents/commands/codex/harness/enforce-architecture/SKILL.md +299 -0
  9. package/dist/agents/commands/codex/harness/enforce-architecture/agents/openai.yaml +3 -0
  10. package/dist/agents/commands/codex/harness/harness-architecture-advisor/SKILL.md +452 -0
  11. package/dist/agents/commands/codex/harness/harness-architecture-advisor/agents/openai.yaml +3 -0
  12. package/dist/agents/commands/codex/harness/harness-autopilot/SKILL.md +919 -0
  13. package/dist/agents/commands/codex/harness/harness-autopilot/agents/openai.yaml +3 -0
  14. package/dist/agents/commands/codex/harness/harness-brainstorming/SKILL.md +409 -0
  15. package/dist/agents/commands/codex/harness/harness-brainstorming/agents/openai.yaml +3 -0
  16. package/dist/agents/commands/codex/harness/harness-code-review/SKILL.md +860 -0
  17. package/dist/agents/commands/codex/harness/harness-code-review/agents/openai.yaml +3 -0
  18. package/dist/agents/commands/codex/harness/harness-codebase-cleanup/SKILL.md +227 -0
  19. package/dist/agents/commands/codex/harness/harness-codebase-cleanup/agents/openai.yaml +3 -0
  20. package/dist/agents/commands/codex/harness/harness-debugging/SKILL.md +369 -0
  21. package/dist/agents/commands/codex/harness/harness-debugging/agents/openai.yaml +3 -0
  22. package/dist/agents/commands/codex/harness/harness-dependency-health/SKILL.md +182 -0
  23. package/dist/agents/commands/codex/harness/harness-dependency-health/agents/openai.yaml +3 -0
  24. package/dist/agents/commands/codex/harness/harness-docs-pipeline/SKILL.md +463 -0
  25. package/dist/agents/commands/codex/harness/harness-docs-pipeline/agents/openai.yaml +3 -0
  26. package/dist/agents/commands/codex/harness/harness-execution/SKILL.md +513 -0
  27. package/dist/agents/commands/codex/harness/harness-execution/agents/openai.yaml +3 -0
  28. package/dist/agents/commands/codex/harness/harness-hotspot-detector/SKILL.md +164 -0
  29. package/dist/agents/commands/codex/harness/harness-hotspot-detector/agents/openai.yaml +3 -0
  30. package/dist/agents/commands/codex/harness/harness-impact-analysis/SKILL.md +187 -0
  31. package/dist/agents/commands/codex/harness/harness-impact-analysis/agents/openai.yaml +3 -0
  32. package/dist/agents/commands/codex/harness/harness-integrity/SKILL.md +170 -0
  33. package/dist/agents/commands/codex/harness/harness-integrity/agents/openai.yaml +3 -0
  34. package/dist/agents/commands/codex/harness/harness-onboarding/SKILL.md +291 -0
  35. package/dist/agents/commands/codex/harness/harness-onboarding/agents/openai.yaml +3 -0
  36. package/dist/agents/commands/codex/harness/harness-perf/SKILL.md +263 -0
  37. package/dist/agents/commands/codex/harness/harness-perf/agents/openai.yaml +3 -0
  38. package/dist/agents/commands/codex/harness/harness-planning/SKILL.md +582 -0
  39. package/dist/agents/commands/codex/harness/harness-planning/agents/openai.yaml +3 -0
  40. package/dist/agents/commands/codex/harness/harness-refactoring/SKILL.md +172 -0
  41. package/dist/agents/commands/codex/harness/harness-refactoring/agents/openai.yaml +3 -0
  42. package/dist/agents/commands/codex/harness/harness-release-readiness/SKILL.md +692 -0
  43. package/dist/agents/commands/codex/harness/harness-release-readiness/agents/openai.yaml +3 -0
  44. package/dist/agents/commands/codex/harness/harness-roadmap/SKILL.md +598 -0
  45. package/dist/agents/commands/codex/harness/harness-roadmap/agents/openai.yaml +3 -0
  46. package/dist/agents/commands/codex/harness/harness-security-scan/SKILL.md +157 -0
  47. package/dist/agents/commands/codex/harness/harness-security-scan/agents/openai.yaml +3 -0
  48. package/dist/agents/commands/codex/harness/harness-skill-authoring/SKILL.md +295 -0
  49. package/dist/agents/commands/codex/harness/harness-skill-authoring/agents/openai.yaml +3 -0
  50. package/dist/agents/commands/codex/harness/harness-soundness-review/SKILL.md +1270 -0
  51. package/dist/agents/commands/codex/harness/harness-soundness-review/agents/openai.yaml +3 -0
  52. package/dist/agents/commands/codex/harness/harness-supply-chain-audit/SKILL.md +247 -0
  53. package/dist/agents/commands/codex/harness/harness-supply-chain-audit/agents/openai.yaml +3 -0
  54. package/dist/agents/commands/codex/harness/harness-tdd/SKILL.md +180 -0
  55. package/dist/agents/commands/codex/harness/harness-tdd/agents/openai.yaml +3 -0
  56. package/dist/agents/commands/codex/harness/harness-test-advisor/SKILL.md +163 -0
  57. package/dist/agents/commands/codex/harness/harness-test-advisor/agents/openai.yaml +3 -0
  58. package/dist/agents/commands/codex/harness/harness-verification/SKILL.md +424 -0
  59. package/dist/agents/commands/codex/harness/harness-verification/agents/openai.yaml +3 -0
  60. package/dist/agents/commands/codex/harness/harness-verify/SKILL.md +162 -0
  61. package/dist/agents/commands/codex/harness/harness-verify/agents/openai.yaml +3 -0
  62. package/dist/agents/commands/codex/harness/initialize-harness-project/SKILL.md +235 -0
  63. package/dist/agents/commands/codex/harness/initialize-harness-project/agents/openai.yaml +3 -0
  64. package/dist/agents/commands/cursor/harness/add-harness-component.mdc +200 -0
  65. package/dist/agents/commands/cursor/harness/cleanup-dead-code.mdc +253 -0
  66. package/dist/agents/commands/cursor/harness/detect-doc-drift.mdc +187 -0
  67. package/dist/agents/commands/cursor/harness/enforce-architecture.mdc +304 -0
  68. package/dist/agents/commands/cursor/harness/harness-architecture-advisor.mdc +457 -0
  69. package/dist/agents/commands/cursor/harness/harness-autopilot.mdc +924 -0
  70. package/dist/agents/commands/cursor/harness/harness-brainstorming.mdc +414 -0
  71. package/dist/agents/commands/cursor/harness/harness-code-review.mdc +865 -0
  72. package/dist/agents/commands/cursor/harness/harness-codebase-cleanup.mdc +232 -0
  73. package/dist/agents/commands/cursor/harness/harness-debugging.mdc +374 -0
  74. package/dist/agents/commands/cursor/harness/harness-dependency-health.mdc +187 -0
  75. package/dist/agents/commands/cursor/harness/harness-docs-pipeline.mdc +468 -0
  76. package/dist/agents/commands/cursor/harness/harness-execution.mdc +518 -0
  77. package/dist/agents/commands/cursor/harness/harness-hotspot-detector.mdc +169 -0
  78. package/dist/agents/commands/cursor/harness/harness-impact-analysis.mdc +192 -0
  79. package/dist/agents/commands/cursor/harness/harness-integrity.mdc +175 -0
  80. package/dist/agents/commands/cursor/harness/harness-onboarding.mdc +296 -0
  81. package/dist/agents/commands/cursor/harness/harness-perf.mdc +268 -0
  82. package/dist/agents/commands/cursor/harness/harness-planning.mdc +587 -0
  83. package/dist/agents/commands/cursor/harness/harness-refactoring.mdc +177 -0
  84. package/dist/agents/commands/cursor/harness/harness-release-readiness.mdc +697 -0
  85. package/dist/agents/commands/cursor/harness/harness-roadmap.mdc +603 -0
  86. package/dist/agents/commands/cursor/harness/harness-security-scan.mdc +162 -0
  87. package/dist/agents/commands/cursor/harness/harness-skill-authoring.mdc +300 -0
  88. package/dist/agents/commands/cursor/harness/harness-soundness-review.mdc +1275 -0
  89. package/dist/agents/commands/cursor/harness/harness-supply-chain-audit.mdc +252 -0
  90. package/dist/agents/commands/cursor/harness/harness-tdd.mdc +185 -0
  91. package/dist/agents/commands/cursor/harness/harness-test-advisor.mdc +168 -0
  92. package/dist/agents/commands/cursor/harness/harness-verification.mdc +429 -0
  93. package/dist/agents/commands/cursor/harness/harness-verify.mdc +167 -0
  94. package/dist/agents/commands/cursor/harness/initialize-harness-project.mdc +240 -0
  95. package/dist/agents/skills/claude-code/enforce-architecture/SKILL.md +52 -0
  96. package/dist/agents/skills/claude-code/harness-api-design/SKILL.md +52 -0
  97. package/dist/agents/skills/claude-code/harness-architecture-advisor/SKILL.md +52 -0
  98. package/dist/agents/skills/claude-code/harness-auth/SKILL.md +52 -0
  99. package/dist/agents/skills/claude-code/harness-autopilot/SKILL.md +355 -45
  100. package/dist/agents/skills/claude-code/harness-autopilot/skill.yaml +12 -0
  101. package/dist/agents/skills/claude-code/harness-code-review/SKILL.md +97 -3
  102. package/dist/agents/skills/claude-code/harness-code-review/skill.yaml +6 -0
  103. package/dist/agents/skills/claude-code/harness-codebase-cleanup/SKILL.md +2 -4
  104. package/dist/agents/skills/claude-code/harness-database/SKILL.md +52 -0
  105. package/dist/agents/skills/claude-code/harness-deployment/SKILL.md +52 -0
  106. package/dist/agents/skills/claude-code/harness-planning/SKILL.md +99 -3
  107. package/dist/agents/skills/claude-code/harness-planning/skill.yaml +6 -0
  108. package/dist/agents/skills/claude-code/harness-pre-commit-review/SKILL.md +1 -1
  109. package/dist/agents/skills/claude-code/harness-product-spec/SKILL.md +5 -5
  110. package/dist/agents/skills/claude-code/harness-security-review/SKILL.md +27 -7
  111. package/dist/agents/skills/claude-code/harness-security-scan/SKILL.md +52 -0
  112. package/dist/agents/skills/claude-code/harness-supply-chain-audit/SKILL.md +281 -0
  113. package/dist/agents/skills/claude-code/harness-supply-chain-audit/skill.yaml +51 -0
  114. package/dist/agents/skills/codex/add-harness-component/SKILL.md +192 -0
  115. package/dist/agents/skills/codex/add-harness-component/skill.yaml +33 -0
  116. package/dist/agents/skills/codex/align-documentation/SKILL.md +213 -0
  117. package/dist/agents/skills/codex/align-documentation/skill.yaml +32 -0
  118. package/dist/agents/skills/codex/check-mechanical-constraints/SKILL.md +191 -0
  119. package/dist/agents/skills/codex/check-mechanical-constraints/skill.yaml +33 -0
  120. package/dist/agents/skills/codex/cleanup-dead-code/SKILL.md +245 -0
  121. package/dist/agents/skills/codex/cleanup-dead-code/skill.yaml +34 -0
  122. package/dist/agents/skills/codex/detect-doc-drift/SKILL.md +179 -0
  123. package/dist/agents/skills/codex/detect-doc-drift/skill.yaml +31 -0
  124. package/dist/agents/skills/codex/enforce-architecture/SKILL.md +296 -0
  125. package/dist/agents/skills/codex/enforce-architecture/skill.yaml +35 -0
  126. package/dist/agents/skills/codex/harness-accessibility/SKILL.md +281 -0
  127. package/dist/agents/skills/codex/harness-accessibility/skill.yaml +52 -0
  128. package/dist/agents/skills/codex/harness-api-design/SKILL.md +356 -0
  129. package/dist/agents/skills/codex/harness-api-design/skill.yaml +74 -0
  130. package/dist/agents/skills/codex/harness-architecture-advisor/SKILL.md +449 -0
  131. package/dist/agents/skills/codex/harness-architecture-advisor/skill.yaml +49 -0
  132. package/dist/agents/skills/codex/harness-auth/SKILL.md +331 -0
  133. package/dist/agents/skills/codex/harness-auth/skill.yaml +81 -0
  134. package/dist/agents/skills/codex/harness-autopilot/SKILL.md +916 -0
  135. package/dist/agents/skills/codex/harness-autopilot/skill.yaml +67 -0
  136. package/dist/agents/skills/codex/harness-brainstorming/SKILL.md +406 -0
  137. package/dist/agents/skills/codex/harness-brainstorming/skill.yaml +50 -0
  138. package/dist/agents/skills/codex/harness-caching/SKILL.md +309 -0
  139. package/dist/agents/skills/codex/harness-caching/skill.yaml +73 -0
  140. package/dist/agents/skills/codex/harness-chaos/SKILL.md +295 -0
  141. package/dist/agents/skills/codex/harness-chaos/skill.yaml +72 -0
  142. package/dist/agents/skills/codex/harness-code-review/SKILL.md +857 -0
  143. package/dist/agents/skills/codex/harness-code-review/skill.yaml +52 -0
  144. package/dist/agents/skills/codex/harness-codebase-cleanup/SKILL.md +224 -0
  145. package/dist/agents/skills/codex/harness-codebase-cleanup/skill.yaml +65 -0
  146. package/dist/agents/skills/codex/harness-compliance/SKILL.md +303 -0
  147. package/dist/agents/skills/codex/harness-compliance/skill.yaml +78 -0
  148. package/dist/agents/skills/codex/harness-containerization/SKILL.md +284 -0
  149. package/dist/agents/skills/codex/harness-containerization/skill.yaml +80 -0
  150. package/dist/agents/skills/codex/harness-data-pipeline/SKILL.md +274 -0
  151. package/dist/agents/skills/codex/harness-data-pipeline/skill.yaml +81 -0
  152. package/dist/agents/skills/codex/harness-data-validation/SKILL.md +343 -0
  153. package/dist/agents/skills/codex/harness-data-validation/skill.yaml +75 -0
  154. package/dist/agents/skills/codex/harness-database/SKILL.md +310 -0
  155. package/dist/agents/skills/codex/harness-database/skill.yaml +80 -0
  156. package/dist/agents/skills/codex/harness-debugging/SKILL.md +366 -0
  157. package/dist/agents/skills/codex/harness-debugging/skill.yaml +48 -0
  158. package/dist/agents/skills/codex/harness-dependency-health/SKILL.md +179 -0
  159. package/dist/agents/skills/codex/harness-dependency-health/skill.yaml +42 -0
  160. package/dist/agents/skills/codex/harness-deployment/SKILL.md +307 -0
  161. package/dist/agents/skills/codex/harness-deployment/skill.yaml +77 -0
  162. package/dist/agents/skills/codex/harness-design/SKILL.md +265 -0
  163. package/dist/agents/skills/codex/harness-design/skill.yaml +54 -0
  164. package/dist/agents/skills/codex/harness-design-mobile/SKILL.md +336 -0
  165. package/dist/agents/skills/codex/harness-design-mobile/skill.yaml +50 -0
  166. package/dist/agents/skills/codex/harness-design-system/SKILL.md +282 -0
  167. package/dist/agents/skills/codex/harness-design-system/skill.yaml +51 -0
  168. package/dist/agents/skills/codex/harness-design-web/SKILL.md +360 -0
  169. package/dist/agents/skills/codex/harness-design-web/skill.yaml +53 -0
  170. package/dist/agents/skills/codex/harness-diagnostics/SKILL.md +318 -0
  171. package/dist/agents/skills/codex/harness-diagnostics/skill.yaml +51 -0
  172. package/dist/agents/skills/codex/harness-docs-pipeline/SKILL.md +460 -0
  173. package/dist/agents/skills/codex/harness-docs-pipeline/skill.yaml +70 -0
  174. package/dist/agents/skills/codex/harness-dx/SKILL.md +276 -0
  175. package/dist/agents/skills/codex/harness-dx/skill.yaml +76 -0
  176. package/dist/agents/skills/codex/harness-e2e/SKILL.md +245 -0
  177. package/dist/agents/skills/codex/harness-e2e/skill.yaml +78 -0
  178. package/dist/agents/skills/codex/harness-event-driven/SKILL.md +280 -0
  179. package/dist/agents/skills/codex/harness-event-driven/skill.yaml +77 -0
  180. package/dist/agents/skills/codex/harness-execution/SKILL.md +510 -0
  181. package/dist/agents/skills/codex/harness-execution/skill.yaml +52 -0
  182. package/dist/agents/skills/codex/harness-feature-flags/SKILL.md +287 -0
  183. package/dist/agents/skills/codex/harness-feature-flags/skill.yaml +74 -0
  184. package/dist/agents/skills/codex/harness-git-workflow/SKILL.md +268 -0
  185. package/dist/agents/skills/codex/harness-git-workflow/skill.yaml +32 -0
  186. package/dist/agents/skills/codex/harness-hotspot-detector/SKILL.md +161 -0
  187. package/dist/agents/skills/codex/harness-hotspot-detector/skill.yaml +45 -0
  188. package/dist/agents/skills/codex/harness-i18n/SKILL.md +484 -0
  189. package/dist/agents/skills/codex/harness-i18n/skill.yaml +55 -0
  190. package/dist/agents/skills/codex/harness-i18n-process/SKILL.md +388 -0
  191. package/dist/agents/skills/codex/harness-i18n-process/skill.yaml +44 -0
  192. package/dist/agents/skills/codex/harness-i18n-workflow/SKILL.md +512 -0
  193. package/dist/agents/skills/codex/harness-i18n-workflow/skill.yaml +54 -0
  194. package/dist/agents/skills/codex/harness-impact-analysis/SKILL.md +184 -0
  195. package/dist/agents/skills/codex/harness-impact-analysis/skill.yaml +45 -0
  196. package/dist/agents/skills/codex/harness-incident-response/SKILL.md +223 -0
  197. package/dist/agents/skills/codex/harness-incident-response/skill.yaml +78 -0
  198. package/dist/agents/skills/codex/harness-infrastructure-as-code/SKILL.md +279 -0
  199. package/dist/agents/skills/codex/harness-infrastructure-as-code/skill.yaml +80 -0
  200. package/dist/agents/skills/codex/harness-integration-test/SKILL.md +271 -0
  201. package/dist/agents/skills/codex/harness-integration-test/skill.yaml +73 -0
  202. package/dist/agents/skills/codex/harness-integrity/SKILL.md +167 -0
  203. package/dist/agents/skills/codex/harness-integrity/skill.yaml +48 -0
  204. package/dist/agents/skills/codex/harness-knowledge-mapper/SKILL.md +195 -0
  205. package/dist/agents/skills/codex/harness-knowledge-mapper/skill.yaml +50 -0
  206. package/dist/agents/skills/codex/harness-load-testing/SKILL.md +274 -0
  207. package/dist/agents/skills/codex/harness-load-testing/skill.yaml +79 -0
  208. package/dist/agents/skills/codex/harness-ml-ops/SKILL.md +341 -0
  209. package/dist/agents/skills/codex/harness-ml-ops/skill.yaml +79 -0
  210. package/dist/agents/skills/codex/harness-mobile-patterns/SKILL.md +326 -0
  211. package/dist/agents/skills/codex/harness-mobile-patterns/skill.yaml +82 -0
  212. package/dist/agents/skills/codex/harness-mutation-test/SKILL.md +251 -0
  213. package/dist/agents/skills/codex/harness-mutation-test/skill.yaml +70 -0
  214. package/dist/agents/skills/codex/harness-observability/SKILL.md +283 -0
  215. package/dist/agents/skills/codex/harness-observability/skill.yaml +78 -0
  216. package/dist/agents/skills/codex/harness-onboarding/SKILL.md +288 -0
  217. package/dist/agents/skills/codex/harness-onboarding/skill.yaml +31 -0
  218. package/dist/agents/skills/codex/harness-parallel-agents/SKILL.md +256 -0
  219. package/dist/agents/skills/codex/harness-parallel-agents/skill.yaml +34 -0
  220. package/dist/agents/skills/codex/harness-perf/SKILL.md +260 -0
  221. package/dist/agents/skills/codex/harness-perf/skill.yaml +51 -0
  222. package/dist/agents/skills/codex/harness-perf-tdd/SKILL.md +249 -0
  223. package/dist/agents/skills/codex/harness-perf-tdd/skill.yaml +48 -0
  224. package/dist/agents/skills/codex/harness-planning/SKILL.md +579 -0
  225. package/dist/agents/skills/codex/harness-planning/skill.yaml +56 -0
  226. package/dist/agents/skills/codex/harness-pre-commit-review/SKILL.md +324 -0
  227. package/dist/agents/skills/codex/harness-pre-commit-review/skill.yaml +34 -0
  228. package/dist/agents/skills/codex/harness-product-spec/SKILL.md +285 -0
  229. package/dist/agents/skills/codex/harness-product-spec/skill.yaml +72 -0
  230. package/dist/agents/skills/codex/harness-property-test/SKILL.md +281 -0
  231. package/dist/agents/skills/codex/harness-property-test/skill.yaml +71 -0
  232. package/dist/agents/skills/codex/harness-refactoring/SKILL.md +169 -0
  233. package/dist/agents/skills/codex/harness-refactoring/skill.yaml +34 -0
  234. package/dist/agents/skills/codex/harness-release-readiness/SKILL.md +689 -0
  235. package/dist/agents/skills/codex/harness-release-readiness/skill.yaml +58 -0
  236. package/dist/agents/skills/codex/harness-resilience/SKILL.md +255 -0
  237. package/dist/agents/skills/codex/harness-resilience/skill.yaml +76 -0
  238. package/dist/agents/skills/codex/harness-roadmap/SKILL.md +595 -0
  239. package/dist/agents/skills/codex/harness-roadmap/skill.yaml +44 -0
  240. package/dist/agents/skills/codex/harness-secrets/SKILL.md +293 -0
  241. package/dist/agents/skills/codex/harness-secrets/skill.yaml +76 -0
  242. package/dist/agents/skills/codex/harness-security-review/SKILL.md +260 -0
  243. package/dist/agents/skills/codex/harness-security-review/skill.yaml +53 -0
  244. package/dist/agents/skills/codex/harness-security-scan/SKILL.md +154 -0
  245. package/dist/agents/skills/codex/harness-security-scan/skill.yaml +42 -0
  246. package/dist/agents/skills/codex/harness-skill-authoring/SKILL.md +292 -0
  247. package/dist/agents/skills/codex/harness-skill-authoring/skill.yaml +33 -0
  248. package/dist/agents/skills/codex/harness-soundness-review/SKILL.md +1267 -0
  249. package/dist/agents/skills/codex/harness-soundness-review/skill.yaml +49 -0
  250. package/dist/agents/skills/codex/harness-sql-review/SKILL.md +315 -0
  251. package/dist/agents/skills/codex/harness-sql-review/skill.yaml +74 -0
  252. package/dist/agents/skills/codex/harness-state-management/SKILL.md +309 -0
  253. package/dist/agents/skills/codex/harness-state-management/skill.yaml +33 -0
  254. package/dist/agents/skills/codex/harness-supply-chain-audit/SKILL.md +281 -0
  255. package/dist/agents/skills/codex/harness-supply-chain-audit/skill.yaml +51 -0
  256. package/dist/agents/skills/codex/harness-tdd/SKILL.md +177 -0
  257. package/dist/agents/skills/codex/harness-tdd/skill.yaml +49 -0
  258. package/dist/agents/skills/codex/harness-test-advisor/SKILL.md +160 -0
  259. package/dist/agents/skills/codex/harness-test-advisor/skill.yaml +45 -0
  260. package/dist/agents/skills/codex/harness-test-data/SKILL.md +268 -0
  261. package/dist/agents/skills/codex/harness-test-data/skill.yaml +74 -0
  262. package/dist/agents/skills/codex/harness-ux-copy/SKILL.md +271 -0
  263. package/dist/agents/skills/codex/harness-ux-copy/skill.yaml +77 -0
  264. package/dist/agents/skills/codex/harness-verification/SKILL.md +421 -0
  265. package/dist/agents/skills/codex/harness-verification/skill.yaml +43 -0
  266. package/dist/agents/skills/codex/harness-verify/SKILL.md +159 -0
  267. package/dist/agents/skills/codex/harness-verify/skill.yaml +41 -0
  268. package/dist/agents/skills/codex/harness-visual-regression/SKILL.md +257 -0
  269. package/dist/agents/skills/codex/harness-visual-regression/skill.yaml +74 -0
  270. package/dist/agents/skills/codex/initialize-harness-project/SKILL.md +232 -0
  271. package/dist/agents/skills/codex/initialize-harness-project/skill.yaml +32 -0
  272. package/dist/agents/skills/codex/validate-context-engineering/SKILL.md +150 -0
  273. package/dist/agents/skills/codex/validate-context-engineering/skill.yaml +32 -0
  274. package/dist/agents/skills/cursor/add-harness-component/SKILL.md +192 -0
  275. package/dist/agents/skills/cursor/add-harness-component/skill.yaml +33 -0
  276. package/dist/agents/skills/cursor/align-documentation/SKILL.md +213 -0
  277. package/dist/agents/skills/cursor/align-documentation/skill.yaml +32 -0
  278. package/dist/agents/skills/cursor/check-mechanical-constraints/SKILL.md +191 -0
  279. package/dist/agents/skills/cursor/check-mechanical-constraints/skill.yaml +33 -0
  280. package/dist/agents/skills/cursor/cleanup-dead-code/SKILL.md +245 -0
  281. package/dist/agents/skills/cursor/cleanup-dead-code/skill.yaml +34 -0
  282. package/dist/agents/skills/cursor/detect-doc-drift/SKILL.md +179 -0
  283. package/dist/agents/skills/cursor/detect-doc-drift/skill.yaml +31 -0
  284. package/dist/agents/skills/cursor/enforce-architecture/SKILL.md +296 -0
  285. package/dist/agents/skills/cursor/enforce-architecture/skill.yaml +35 -0
  286. package/dist/agents/skills/cursor/harness-accessibility/SKILL.md +281 -0
  287. package/dist/agents/skills/cursor/harness-accessibility/skill.yaml +52 -0
  288. package/dist/agents/skills/cursor/harness-api-design/SKILL.md +356 -0
  289. package/dist/agents/skills/cursor/harness-api-design/skill.yaml +74 -0
  290. package/dist/agents/skills/cursor/harness-architecture-advisor/SKILL.md +449 -0
  291. package/dist/agents/skills/cursor/harness-architecture-advisor/skill.yaml +49 -0
  292. package/dist/agents/skills/cursor/harness-auth/SKILL.md +331 -0
  293. package/dist/agents/skills/cursor/harness-auth/skill.yaml +81 -0
  294. package/dist/agents/skills/cursor/harness-autopilot/SKILL.md +916 -0
  295. package/dist/agents/skills/cursor/harness-autopilot/skill.yaml +67 -0
  296. package/dist/agents/skills/cursor/harness-brainstorming/SKILL.md +406 -0
  297. package/dist/agents/skills/cursor/harness-brainstorming/skill.yaml +50 -0
  298. package/dist/agents/skills/cursor/harness-caching/SKILL.md +309 -0
  299. package/dist/agents/skills/cursor/harness-caching/skill.yaml +73 -0
  300. package/dist/agents/skills/cursor/harness-chaos/SKILL.md +295 -0
  301. package/dist/agents/skills/cursor/harness-chaos/skill.yaml +72 -0
  302. package/dist/agents/skills/cursor/harness-code-review/SKILL.md +857 -0
  303. package/dist/agents/skills/cursor/harness-code-review/skill.yaml +52 -0
  304. package/dist/agents/skills/cursor/harness-codebase-cleanup/SKILL.md +224 -0
  305. package/dist/agents/skills/cursor/harness-codebase-cleanup/skill.yaml +65 -0
  306. package/dist/agents/skills/cursor/harness-compliance/SKILL.md +303 -0
  307. package/dist/agents/skills/cursor/harness-compliance/skill.yaml +78 -0
  308. package/dist/agents/skills/cursor/harness-containerization/SKILL.md +284 -0
  309. package/dist/agents/skills/cursor/harness-containerization/skill.yaml +80 -0
  310. package/dist/agents/skills/cursor/harness-data-pipeline/SKILL.md +274 -0
  311. package/dist/agents/skills/cursor/harness-data-pipeline/skill.yaml +81 -0
  312. package/dist/agents/skills/cursor/harness-data-validation/SKILL.md +343 -0
  313. package/dist/agents/skills/cursor/harness-data-validation/skill.yaml +75 -0
  314. package/dist/agents/skills/cursor/harness-database/SKILL.md +310 -0
  315. package/dist/agents/skills/cursor/harness-database/skill.yaml +80 -0
  316. package/dist/agents/skills/cursor/harness-debugging/SKILL.md +366 -0
  317. package/dist/agents/skills/cursor/harness-debugging/skill.yaml +48 -0
  318. package/dist/agents/skills/cursor/harness-dependency-health/SKILL.md +179 -0
  319. package/dist/agents/skills/cursor/harness-dependency-health/skill.yaml +42 -0
  320. package/dist/agents/skills/cursor/harness-deployment/SKILL.md +307 -0
  321. package/dist/agents/skills/cursor/harness-deployment/skill.yaml +77 -0
  322. package/dist/agents/skills/cursor/harness-design/SKILL.md +265 -0
  323. package/dist/agents/skills/cursor/harness-design/skill.yaml +54 -0
  324. package/dist/agents/skills/cursor/harness-design-mobile/SKILL.md +336 -0
  325. package/dist/agents/skills/cursor/harness-design-mobile/skill.yaml +50 -0
  326. package/dist/agents/skills/cursor/harness-design-system/SKILL.md +282 -0
  327. package/dist/agents/skills/cursor/harness-design-system/skill.yaml +51 -0
  328. package/dist/agents/skills/cursor/harness-design-web/SKILL.md +360 -0
  329. package/dist/agents/skills/cursor/harness-design-web/skill.yaml +53 -0
  330. package/dist/agents/skills/cursor/harness-diagnostics/SKILL.md +318 -0
  331. package/dist/agents/skills/cursor/harness-diagnostics/skill.yaml +51 -0
  332. package/dist/agents/skills/cursor/harness-docs-pipeline/SKILL.md +460 -0
  333. package/dist/agents/skills/cursor/harness-docs-pipeline/skill.yaml +70 -0
  334. package/dist/agents/skills/cursor/harness-dx/SKILL.md +276 -0
  335. package/dist/agents/skills/cursor/harness-dx/skill.yaml +76 -0
  336. package/dist/agents/skills/cursor/harness-e2e/SKILL.md +245 -0
  337. package/dist/agents/skills/cursor/harness-e2e/skill.yaml +78 -0
  338. package/dist/agents/skills/cursor/harness-event-driven/SKILL.md +280 -0
  339. package/dist/agents/skills/cursor/harness-event-driven/skill.yaml +77 -0
  340. package/dist/agents/skills/cursor/harness-execution/SKILL.md +510 -0
  341. package/dist/agents/skills/cursor/harness-execution/skill.yaml +52 -0
  342. package/dist/agents/skills/cursor/harness-feature-flags/SKILL.md +287 -0
  343. package/dist/agents/skills/cursor/harness-feature-flags/skill.yaml +74 -0
  344. package/dist/agents/skills/cursor/harness-git-workflow/SKILL.md +268 -0
  345. package/dist/agents/skills/cursor/harness-git-workflow/skill.yaml +32 -0
  346. package/dist/agents/skills/cursor/harness-hotspot-detector/SKILL.md +161 -0
  347. package/dist/agents/skills/cursor/harness-hotspot-detector/skill.yaml +45 -0
  348. package/dist/agents/skills/cursor/harness-i18n/SKILL.md +484 -0
  349. package/dist/agents/skills/cursor/harness-i18n/skill.yaml +55 -0
  350. package/dist/agents/skills/cursor/harness-i18n-process/SKILL.md +388 -0
  351. package/dist/agents/skills/cursor/harness-i18n-process/skill.yaml +44 -0
  352. package/dist/agents/skills/cursor/harness-i18n-workflow/SKILL.md +512 -0
  353. package/dist/agents/skills/cursor/harness-i18n-workflow/skill.yaml +54 -0
  354. package/dist/agents/skills/cursor/harness-impact-analysis/SKILL.md +184 -0
  355. package/dist/agents/skills/cursor/harness-impact-analysis/skill.yaml +45 -0
  356. package/dist/agents/skills/cursor/harness-incident-response/SKILL.md +223 -0
  357. package/dist/agents/skills/cursor/harness-incident-response/skill.yaml +78 -0
  358. package/dist/agents/skills/cursor/harness-infrastructure-as-code/SKILL.md +279 -0
  359. package/dist/agents/skills/cursor/harness-infrastructure-as-code/skill.yaml +80 -0
  360. package/dist/agents/skills/cursor/harness-integration-test/SKILL.md +271 -0
  361. package/dist/agents/skills/cursor/harness-integration-test/skill.yaml +73 -0
  362. package/dist/agents/skills/cursor/harness-integrity/SKILL.md +167 -0
  363. package/dist/agents/skills/cursor/harness-integrity/skill.yaml +48 -0
  364. package/dist/agents/skills/cursor/harness-knowledge-mapper/SKILL.md +195 -0
  365. package/dist/agents/skills/cursor/harness-knowledge-mapper/skill.yaml +50 -0
  366. package/dist/agents/skills/cursor/harness-load-testing/SKILL.md +274 -0
  367. package/dist/agents/skills/cursor/harness-load-testing/skill.yaml +79 -0
  368. package/dist/agents/skills/cursor/harness-ml-ops/SKILL.md +341 -0
  369. package/dist/agents/skills/cursor/harness-ml-ops/skill.yaml +79 -0
  370. package/dist/agents/skills/cursor/harness-mobile-patterns/SKILL.md +326 -0
  371. package/dist/agents/skills/cursor/harness-mobile-patterns/skill.yaml +82 -0
  372. package/dist/agents/skills/cursor/harness-mutation-test/SKILL.md +251 -0
  373. package/dist/agents/skills/cursor/harness-mutation-test/skill.yaml +70 -0
  374. package/dist/agents/skills/cursor/harness-observability/SKILL.md +283 -0
  375. package/dist/agents/skills/cursor/harness-observability/skill.yaml +78 -0
  376. package/dist/agents/skills/cursor/harness-onboarding/SKILL.md +288 -0
  377. package/dist/agents/skills/cursor/harness-onboarding/skill.yaml +31 -0
  378. package/dist/agents/skills/cursor/harness-parallel-agents/SKILL.md +256 -0
  379. package/dist/agents/skills/cursor/harness-parallel-agents/skill.yaml +34 -0
  380. package/dist/agents/skills/cursor/harness-perf/SKILL.md +260 -0
  381. package/dist/agents/skills/cursor/harness-perf/skill.yaml +51 -0
  382. package/dist/agents/skills/cursor/harness-perf-tdd/SKILL.md +249 -0
  383. package/dist/agents/skills/cursor/harness-perf-tdd/skill.yaml +48 -0
  384. package/dist/agents/skills/cursor/harness-planning/SKILL.md +579 -0
  385. package/dist/agents/skills/cursor/harness-planning/skill.yaml +56 -0
  386. package/dist/agents/skills/cursor/harness-pre-commit-review/SKILL.md +324 -0
  387. package/dist/agents/skills/cursor/harness-pre-commit-review/skill.yaml +34 -0
  388. package/dist/agents/skills/cursor/harness-product-spec/SKILL.md +285 -0
  389. package/dist/agents/skills/cursor/harness-product-spec/skill.yaml +72 -0
  390. package/dist/agents/skills/cursor/harness-property-test/SKILL.md +281 -0
  391. package/dist/agents/skills/cursor/harness-property-test/skill.yaml +71 -0
  392. package/dist/agents/skills/cursor/harness-refactoring/SKILL.md +169 -0
  393. package/dist/agents/skills/cursor/harness-refactoring/skill.yaml +34 -0
  394. package/dist/agents/skills/cursor/harness-release-readiness/SKILL.md +689 -0
  395. package/dist/agents/skills/cursor/harness-release-readiness/skill.yaml +58 -0
  396. package/dist/agents/skills/cursor/harness-resilience/SKILL.md +255 -0
  397. package/dist/agents/skills/cursor/harness-resilience/skill.yaml +76 -0
  398. package/dist/agents/skills/cursor/harness-roadmap/SKILL.md +595 -0
  399. package/dist/agents/skills/cursor/harness-roadmap/skill.yaml +44 -0
  400. package/dist/agents/skills/cursor/harness-secrets/SKILL.md +293 -0
  401. package/dist/agents/skills/cursor/harness-secrets/skill.yaml +76 -0
  402. package/dist/agents/skills/cursor/harness-security-review/SKILL.md +260 -0
  403. package/dist/agents/skills/cursor/harness-security-review/skill.yaml +53 -0
  404. package/dist/agents/skills/cursor/harness-security-scan/SKILL.md +154 -0
  405. package/dist/agents/skills/cursor/harness-security-scan/skill.yaml +42 -0
  406. package/dist/agents/skills/cursor/harness-skill-authoring/SKILL.md +292 -0
  407. package/dist/agents/skills/cursor/harness-skill-authoring/skill.yaml +33 -0
  408. package/dist/agents/skills/cursor/harness-soundness-review/SKILL.md +1267 -0
  409. package/dist/agents/skills/cursor/harness-soundness-review/skill.yaml +49 -0
  410. package/dist/agents/skills/cursor/harness-sql-review/SKILL.md +315 -0
  411. package/dist/agents/skills/cursor/harness-sql-review/skill.yaml +74 -0
  412. package/dist/agents/skills/cursor/harness-state-management/SKILL.md +309 -0
  413. package/dist/agents/skills/cursor/harness-state-management/skill.yaml +33 -0
  414. package/dist/agents/skills/cursor/harness-supply-chain-audit/SKILL.md +281 -0
  415. package/dist/agents/skills/cursor/harness-supply-chain-audit/skill.yaml +51 -0
  416. package/dist/agents/skills/cursor/harness-tdd/SKILL.md +177 -0
  417. package/dist/agents/skills/cursor/harness-tdd/skill.yaml +49 -0
  418. package/dist/agents/skills/cursor/harness-test-advisor/SKILL.md +160 -0
  419. package/dist/agents/skills/cursor/harness-test-advisor/skill.yaml +45 -0
  420. package/dist/agents/skills/cursor/harness-test-data/SKILL.md +268 -0
  421. package/dist/agents/skills/cursor/harness-test-data/skill.yaml +74 -0
  422. package/dist/agents/skills/cursor/harness-ux-copy/SKILL.md +271 -0
  423. package/dist/agents/skills/cursor/harness-ux-copy/skill.yaml +77 -0
  424. package/dist/agents/skills/cursor/harness-verification/SKILL.md +421 -0
  425. package/dist/agents/skills/cursor/harness-verification/skill.yaml +43 -0
  426. package/dist/agents/skills/cursor/harness-verify/SKILL.md +159 -0
  427. package/dist/agents/skills/cursor/harness-verify/skill.yaml +41 -0
  428. package/dist/agents/skills/cursor/harness-visual-regression/SKILL.md +257 -0
  429. package/dist/agents/skills/cursor/harness-visual-regression/skill.yaml +74 -0
  430. package/dist/agents/skills/cursor/initialize-harness-project/SKILL.md +232 -0
  431. package/dist/agents/skills/cursor/initialize-harness-project/skill.yaml +32 -0
  432. package/dist/agents/skills/cursor/validate-context-engineering/SKILL.md +150 -0
  433. package/dist/agents/skills/cursor/validate-context-engineering/skill.yaml +32 -0
  434. package/dist/agents/skills/gemini-cli/enforce-architecture/SKILL.md +52 -0
  435. package/dist/agents/skills/gemini-cli/harness-api-design/SKILL.md +52 -0
  436. package/dist/agents/skills/gemini-cli/harness-architecture-advisor/SKILL.md +52 -0
  437. package/dist/agents/skills/gemini-cli/harness-auth/SKILL.md +52 -0
  438. package/dist/agents/skills/gemini-cli/harness-autopilot/SKILL.md +355 -45
  439. package/dist/agents/skills/gemini-cli/harness-autopilot/skill.yaml +12 -0
  440. package/dist/agents/skills/gemini-cli/harness-code-review/SKILL.md +97 -3
  441. package/dist/agents/skills/gemini-cli/harness-code-review/skill.yaml +6 -0
  442. package/dist/agents/skills/gemini-cli/harness-codebase-cleanup/SKILL.md +2 -4
  443. package/dist/agents/skills/gemini-cli/harness-database/SKILL.md +52 -0
  444. package/dist/agents/skills/gemini-cli/harness-deployment/SKILL.md +52 -0
  445. package/dist/agents/skills/gemini-cli/harness-planning/SKILL.md +99 -3
  446. package/dist/agents/skills/gemini-cli/harness-planning/skill.yaml +6 -0
  447. package/dist/agents/skills/gemini-cli/harness-pre-commit-review/SKILL.md +1 -1
  448. package/dist/agents/skills/gemini-cli/harness-product-spec/SKILL.md +5 -5
  449. package/dist/agents/skills/gemini-cli/harness-security-review/SKILL.md +27 -7
  450. package/dist/agents/skills/gemini-cli/harness-security-scan/SKILL.md +52 -0
  451. package/dist/agents/skills/gemini-cli/harness-supply-chain-audit/SKILL.md +281 -0
  452. package/dist/agents/skills/gemini-cli/harness-supply-chain-audit/skill.yaml +51 -0
  453. package/dist/agents/skills/package.json +1 -0
  454. package/dist/agents/skills/templates/discipline-template.md +49 -0
  455. package/dist/agents/skills/tests/schema.ts +1 -1
  456. package/dist/agents/skills/vitest.config.mts +5 -0
  457. package/dist/{agents-md-YTYQDA3P.js → agents-md-VYDFPIRW.js} +1 -1
  458. package/dist/{architecture-JQZYM4US.js → architecture-K5HSRBGB.js} +2 -2
  459. package/dist/bin/harness-mcp.js +13 -13
  460. package/dist/bin/harness.js +21 -19
  461. package/dist/{check-phase-gate-L3RADYWO.js → check-phase-gate-5AS6SXL6.js} +3 -3
  462. package/dist/{chunk-6KTUUFRN.js → chunk-5ZXHMCPL.js} +1 -1
  463. package/dist/{chunk-RCWZBSK5.js → chunk-6KWBH4EO.js} +1 -1
  464. package/dist/{chunk-ABQHQ6I5.js → chunk-ALFKNAZW.js} +2436 -233
  465. package/dist/{chunk-OXLLOSSR.js → chunk-AV6KMDO5.js} +2 -2
  466. package/dist/{chunk-7IP4JIFL.js → chunk-C7DTKLPW.js} +4 -4
  467. package/dist/{chunk-ZOAWBDWU.js → chunk-CJDVBBPB.js} +5 -1
  468. package/dist/{chunk-YPYGXRDR.js → chunk-DNDBFIZN.js} +18 -4
  469. package/dist/{chunk-XYLGHKG6.js → chunk-HKUX2X7O.js} +11 -2
  470. package/dist/{chunk-YZD2MRNQ.js → chunk-JOP2NDNB.js} +684 -142
  471. package/dist/{chunk-YBJ262QL.js → chunk-LRG3B43J.js} +1 -1
  472. package/dist/{chunk-AOZRDOIP.js → chunk-M6TIO6NF.js} +1 -1
  473. package/dist/{chunk-O5OJVPL6.js → chunk-OCDDCGDE.js} +9 -1
  474. package/dist/{chunk-OSXBPAMK.js → chunk-QDF7COPQ.js} +1 -1
  475. package/dist/{chunk-TPOTOBR7.js → chunk-RWZPHW4H.js} +3 -3
  476. package/dist/{chunk-3C2MLBPJ.js → chunk-SFRGPAK6.js} +1 -1
  477. package/dist/{chunk-XKECDXJS.js → chunk-SHYWICGA.js} +2184 -456
  478. package/dist/{chunk-S2FXOWOR.js → chunk-TF6ZLHJV.js} +2 -2
  479. package/dist/{chunk-NLVUVUGD.js → chunk-ZJMU7MEV.js} +1 -1
  480. package/dist/{ci-workflow-EQZFVX3P.js → ci-workflow-CRWU723U.js} +1 -1
  481. package/dist/{create-skill-XSWHMSM5.js → create-skill-NDXQSTIK.js} +2 -2
  482. package/dist/{dist-HWXF2C3R.js → dist-4LPXJYVZ.js} +105 -1
  483. package/dist/{docs-7ECGYMAV.js → docs-4JRHTLUZ.js} +3 -3
  484. package/dist/{engine-EG4EH4IX.js → engine-3G3VIM6L.js} +1 -1
  485. package/dist/{entropy-5USWKLVS.js → entropy-G6CZ2A6P.js} +2 -2
  486. package/dist/{feedback-UTBXZZHF.js → feedback-QYKQ65HB.js} +1 -1
  487. package/dist/{generate-agent-definitions-3PM5EU7V.js → generate-agent-definitions-SAAOAPT4.js} +3 -3
  488. package/dist/index.d.ts +25 -4
  489. package/dist/index.js +18 -18
  490. package/dist/{loader-ZPALXIVR.js → loader-VCOK3PF7.js} +1 -1
  491. package/dist/{mcp-362EZHF4.js → mcp-YENEPHBW.js} +13 -13
  492. package/dist/{performance-OQAFMJUD.js → performance-UBCFI2UP.js} +4 -2
  493. package/dist/{review-pipeline-C4GCFVGP.js → review-pipeline-IQAVCWAX.js} +1 -1
  494. package/dist/{runtime-7YLVK453.js → runtime-PYFFIESU.js} +1 -1
  495. package/dist/{security-PZOX7AQS.js → security-ZDADTPYW.js} +1 -1
  496. package/dist/{skill-executor-XZLYZYAK.js → skill-executor-XEVDGXUM.js} +2 -2
  497. package/dist/{validate-FD3Z6VJD.js → validate-VRTUHALQ.js} +2 -2
  498. package/dist/{validate-cross-check-WNJM6H2D.js → validate-cross-check-4Y6NHNK3.js} +1 -1
  499. package/package.json +8 -5
@@ -0,0 +1,309 @@
1
+ # Harness Caching
2
+
3
+ > Advisory guide for cache strategies, invalidation patterns, and distributed caching. Detects existing cache usage, analyzes access patterns, designs cache layers with proper invalidation, and validates consistency guarantees.
4
+
5
+ ## When to Use
6
+
7
+ - When adding a caching layer to an existing application (Redis, Memcached, in-memory)
8
+ - When designing cache invalidation strategies for data consistency
9
+ - When troubleshooting cache-related bugs (stale data, thundering herd, cache stampede)
10
+ - When evaluating HTTP caching headers (Cache-Control, ETag, Vary)
11
+ - When designing a distributed cache for a multi-instance deployment
12
+ - When reviewing CDN caching configuration for static or dynamic content
13
+ - NOT for database query optimization (use harness-database for indexing and query patterns)
14
+ - NOT for message queue pub/sub with Redis (use harness-event-driven for async messaging)
15
+ - NOT for session storage design (use harness-auth for session management patterns)
16
+ - NOT for in-memory data structures or algorithms (this skill focuses on caching as an architectural pattern)
17
+
18
+ ## Process
19
+
20
+ ### Phase 1: DETECT -- Identify Existing Cache Usage and Backends
21
+
22
+ 1. **Detect cache backends.** Scan for stack signals: `docker-compose.*redis*` or `ioredis`/`redis` imports for Redis, `docker-compose.*memcached*` or `memcached` imports for Memcached, `node-cache` or `lru-cache` imports for in-memory caches. Check for CDN configuration in `vercel.json`, `netlify.toml`, `cloudfront`, or nginx config files.
23
+
24
+ 2. **Map existing cache usage.** Scan for cache operations: `cache.get(`, `cache.set(`, `redis.get(`, `redis.set(`, `redis.hget(`, `.setex(`, `.getex(`, and memoization decorators (`@Cacheable`, `@CacheEvict`). For each cache call, record: the cache key pattern, the TTL, the data being cached, and the source module.
25
+
26
+ 3. **Identify access patterns.** For each cached resource, classify the access pattern: read-heavy (high read:write ratio, good cache candidate), write-heavy (frequent updates, invalidation-critical), time-sensitive (TTL must be short), or session-scoped (per-user data). Count the approximate read:write ratio from code analysis.
27
+
28
+ 4. **Detect cache invalidation logic.** Scan for cache deletion or expiration calls: `cache.del(`, `redis.del(`, `cache.invalidate(`, `redis.expire(`, `cache.clear(`. Map each invalidation to the corresponding write operation. Flag cached data that is written but never explicitly invalidated.
29
+
30
+ 5. **Check for existing cache problems.** Look for common anti-patterns: unbounded caches (no maxSize or TTL), cache keys built from user input without sanitization, cache-aside with no error handling on cache miss, and string-concatenated keys without namespace prefixes.
31
+
32
+ ### Phase 2: ANALYZE -- Evaluate Cache Effectiveness and Risks
33
+
34
+ 1. **Assess TTL appropriateness.** For each cached resource, evaluate whether the TTL matches the data's volatility. WHERE a frequently-updated resource has a TTL greater than 60 seconds, THEN flag potential staleness. WHERE a rarely-updated resource has a TTL less than 60 seconds, THEN flag unnecessary cache churn.
35
+
36
+ 2. **Check for thundering herd risk.** WHERE a popular cache key expires and multiple concurrent requests trigger simultaneous cache rebuilds, THEN flag the thundering herd. Identify keys with high read frequency and non-trivial rebuild cost (database query, external API call).
37
+
38
+ 3. **Evaluate cache key design.** Check for: overly broad keys that cache too much data (reducing hit rate), overly specific keys that create too many entries (memory pressure), missing namespace prefixes (key collision risk across features), and keys that include volatile data (timestamp, random ID) making them un-cacheable.
39
+
40
+ 4. **Assess memory pressure.** WHERE an in-memory cache has no `maxSize` configuration, THEN flag unbounded memory growth. WHERE Redis is used without a `maxmemory` policy, THEN flag the risk of Redis running out of memory and evicting keys unpredictably.
41
+
42
+ 5. **Check cache-database consistency.** Trace each write path that modifies cached data. WHERE the database write succeeds but cache invalidation could fail (separate operations, no transaction), THEN flag the consistency risk. Classify as eventual consistency (acceptable) or strong consistency (requires synchronous invalidation).
43
+
44
+ ### Phase 3: DESIGN -- Recommend Cache Strategies and Key Schemas
45
+
46
+ 1. **Select the cache strategy per resource.** Based on the access pattern analysis:
47
+ - **Cache-aside (lazy loading):** Application checks cache first, loads from database on miss, populates cache. Best for read-heavy data with tolerance for occasional staleness.
48
+ - **Write-through:** Application writes to cache and database simultaneously. Best for data that must be fresh on the next read.
49
+ - **Write-behind (write-back):** Application writes to cache, cache asynchronously flushes to database. Best for write-heavy workloads where some data loss risk is acceptable.
50
+ - **Read-through:** Cache itself loads from the database on miss. Best when using a cache framework that supports it (e.g., Spring Cache, NestJS CacheModule).
51
+
52
+ 2. **Design the key schema.** Produce a key naming convention: `{service}:{resource}:{identifier}:{variant}`. Examples: `api:user:123:profile`, `api:products:list:page=1&limit=20`, `api:config:feature-flags:v2`. Include version suffixes for keys whose structure may change during deployments.
53
+
54
+ 3. **Design invalidation strategy.** For each cached resource:
55
+ - **TTL-based:** Set a TTL that balances freshness with hit rate. Include jitter (randomize TTL +/- 10%) to prevent synchronized expiration.
56
+ - **Event-based:** Invalidate on write events. Wire cache invalidation into the write path or subscribe to database change events.
57
+ - **Tag-based:** Group related keys with tags. Invalidate all keys with a tag in a single operation (e.g., invalidate all `user:123:*` keys when user 123 updates their profile).
58
+
59
+ 4. **Design thundering herd protection.** For high-traffic keys, implement one or more: lock-based recomputation (only one request rebuilds the cache, others wait), stale-while-revalidate (serve stale data while rebuilding in background), probabilistic early expiration (some requests refresh before TTL expires), or request coalescing (deduplicate identical concurrent requests).
60
+
61
+ 5. **Design cache warming.** WHERE the application has predictable traffic patterns (e.g., morning spike), THEN recommend preloading popular cache keys during low-traffic periods. Define the warming strategy: full preload, top-N most accessed keys, or on-deploy warming for critical paths.
62
+
63
+ ### Phase 4: VALIDATE -- Verify Consistency and Failure Modes
64
+
65
+ 1. **Verify invalidation completeness.** For every write path that modifies cacheable data, confirm that the corresponding cache keys are invalidated. Trace through the code: database write -> cache invalidation. Flag any write path that modifies data without invalidating the cache.
66
+
67
+ 2. **Test cache failure gracefully.** WHERE Redis or Memcached is unavailable, THEN the application must degrade gracefully to database-only mode, not crash. Check for try/catch around cache operations. WHERE cache errors bubble up as 500 errors to the user, THEN flag the missing fallback.
68
+
69
+ 3. **Verify serialization roundtrip.** WHERE objects are cached as JSON, THEN verify that `JSON.parse(JSON.stringify(obj))` preserves all fields. Common losses: Date objects become strings, undefined fields are dropped, BigInt values throw. Flag any cached type that does not survive a serialization roundtrip.
70
+
71
+ 4. **Check distributed cache consistency.** WHERE multiple application instances share a Redis cache, THEN verify: cache writes use appropriate Redis data structures (not race-prone read-modify-write), cache keys include a deployment version to prevent stale reads after schema changes, and Redis is configured with an appropriate eviction policy (`allkeys-lru` for general caching, `volatile-lru` for TTL-based).
72
+
73
+ 5. **Validate HTTP caching headers.** For API responses that include `Cache-Control`, verify: `private` is set for user-specific data, `no-store` is set for sensitive data, `max-age` matches the backend TTL, `ETag` or `Last-Modified` headers enable conditional requests, and `Vary` headers include all relevant dimensions (e.g., `Vary: Authorization` for user-specific responses).
74
+
75
+ ## Harness Integration
76
+
77
+ - **`harness validate`** -- Run after modifying cache configuration to confirm project health
78
+ - **`harness scan`** -- Refresh the knowledge graph after adding cache modules
79
+ - **`query_graph`** -- Trace which modules read from and write to a cached resource
80
+ - **`get_impact`** -- Understand blast radius when modifying a shared cache key schema
81
+
82
+ ## Success Criteria
83
+
84
+ - Cache backends were correctly detected or explicitly specified
85
+ - All existing cache usage was mapped with key patterns, TTLs, and invalidation logic
86
+ - Every cached resource has a defined strategy (cache-aside, write-through, etc.)
87
+ - Cache key schema uses namespaced, versioned keys with no collision risk
88
+ - Invalidation covers every write path that modifies cached data
89
+ - Thundering herd protection is in place for high-traffic keys
90
+ - Cache failure degrades gracefully (no 500 errors when Redis is down)
91
+ - HTTP caching headers are correct for user-specific vs public data
92
+ - No unbounded caches exist without maxSize or eviction policy
93
+
94
+ ## Examples
95
+
96
+ ### Example: Redis Cache-Aside for User Profiles in Express
97
+
98
+ **Input:** "Add Redis caching for user profile lookups in our Express API."
99
+
100
+ **Phase 1 -- DETECT:**
101
+
102
+ ```
103
+ Backend: Redis 7.x (ioredis 5.x, docker-compose with redis:7-alpine)
104
+ Existing cache usage: none (all reads hit PostgreSQL directly)
105
+ Access pattern: read-heavy (profile viewed ~100x per write)
106
+ Framework: Express 4.x, Prisma ORM
107
+ ```
108
+
109
+ **Phase 3 -- DESIGN:**
110
+
111
+ ```typescript
112
+ // src/cache/redis.ts
113
+ import Redis from 'ioredis';
114
+
115
+ const redis = new Redis(process.env.REDIS_URL, {
116
+ maxRetriesPerRequest: 1, // fail fast on Redis errors
117
+ enableReadyCheck: true,
118
+ lazyConnect: true,
119
+ });
120
+
121
+ // src/cache/user-cache.ts
122
+ const USER_TTL = 300; // 5 minutes
123
+ const USER_TTL_JITTER = 30; // +/- 30 seconds to prevent synchronized expiry
124
+
125
+ function userCacheKey(userId: string): string {
126
+ return `api:user:${userId}:profile:v1`;
127
+ }
128
+
129
+ async function getCachedUser(userId: string): Promise<User | null> {
130
+ try {
131
+ const cached = await redis.get(userCacheKey(userId));
132
+ if (cached) return JSON.parse(cached);
133
+ return null;
134
+ } catch {
135
+ // Cache failure: degrade to database
136
+ return null;
137
+ }
138
+ }
139
+
140
+ async function setCachedUser(userId: string, user: User): Promise<void> {
141
+ try {
142
+ const jitter = Math.floor(Math.random() * USER_TTL_JITTER * 2) - USER_TTL_JITTER;
143
+ await redis.setex(userCacheKey(userId), USER_TTL + jitter, JSON.stringify(user));
144
+ } catch {
145
+ // Cache write failure: log and continue
146
+ }
147
+ }
148
+
149
+ async function invalidateUserCache(userId: string): Promise<void> {
150
+ try {
151
+ await redis.del(userCacheKey(userId));
152
+ } catch {
153
+ // Cache invalidation failure: TTL will expire the stale entry
154
+ }
155
+ }
156
+ ```
157
+
158
+ **Invalidation wiring:**
159
+
160
+ ```typescript
161
+ // src/routes/users.ts -- PATCH /users/:id
162
+ app.patch('/users/:id', async (req, res) => {
163
+ const user = await prisma.user.update({ where: { id: req.params.id }, data: req.body });
164
+ await invalidateUserCache(req.params.id); // invalidate after write
165
+ res.json({ data: user });
166
+ });
167
+ ```
168
+
169
+ **Phase 4 -- VALIDATE:**
170
+
171
+ ```
172
+ Invalidation: PASS -- PATCH /users/:id and DELETE /users/:id both call invalidateUserCache
173
+ Failure mode: PASS -- all cache operations wrapped in try/catch, degrade to DB
174
+ Serialization: WARN -- User.createdAt is a Date object, will become a string after JSON roundtrip
175
+ -> Recommend: parse dates in getCachedUser or use superjson for serialization
176
+ Distributed: PASS -- stateless cache-aside, no read-modify-write races
177
+ HTTP headers: INFO -- consider adding Cache-Control: private, max-age=300 to GET /users/:id response
178
+ ```
179
+
180
+ ### Example: HTTP Caching for a Next.js API
181
+
182
+ **Input:** "Configure caching headers for our Next.js API routes."
183
+
184
+ **Phase 1 -- DETECT:**
185
+
186
+ ```
187
+ Backend: Vercel Edge Cache (detected vercel.json)
188
+ Existing cache usage: no Cache-Control headers on API routes
189
+ CDN: Vercel Edge Network (automatic)
190
+ Routes analyzed: GET /api/products (public), GET /api/cart (user-specific), GET /api/config (rarely changes)
191
+ ```
192
+
193
+ **Phase 3 -- DESIGN:**
194
+
195
+ ```typescript
196
+ // GET /api/products -- public, cacheable
197
+ export async function GET() {
198
+ const products = await db.product.findMany();
199
+ return Response.json(
200
+ { data: products },
201
+ {
202
+ headers: {
203
+ 'Cache-Control': 'public, s-maxage=60, stale-while-revalidate=300',
204
+ Vary: 'Accept-Encoding',
205
+ },
206
+ }
207
+ );
208
+ }
209
+
210
+ // GET /api/cart -- user-specific, private
211
+ export async function GET(req: Request) {
212
+ const cart = await getCartForUser(req);
213
+ return Response.json(
214
+ { data: cart },
215
+ {
216
+ headers: {
217
+ 'Cache-Control': 'private, no-cache', // revalidate every request
218
+ ETag: generateETag(cart),
219
+ },
220
+ }
221
+ );
222
+ }
223
+
224
+ // GET /api/config -- rarely changes, long cache
225
+ export async function GET() {
226
+ const config = await db.config.findFirst();
227
+ return Response.json(
228
+ { data: config },
229
+ {
230
+ headers: {
231
+ 'Cache-Control': 'public, s-maxage=3600, stale-while-revalidate=86400',
232
+ },
233
+ }
234
+ );
235
+ }
236
+ ```
237
+
238
+ ### Example: Distributed Cache Stampede Protection
239
+
240
+ **Input:** "Our product listing page causes a cache stampede every 5 minutes when the Redis key expires."
241
+
242
+ **Phase 2 -- ANALYZE:**
243
+
244
+ ```
245
+ Key: api:products:list:all (TTL: 300s)
246
+ Read frequency: ~200 requests/second
247
+ Rebuild cost: 450ms (joins across 3 PostgreSQL tables)
248
+ Problem: when TTL expires, ~50 concurrent requests all trigger the same DB query
249
+ ```
250
+
251
+ **Phase 3 -- DESIGN (stampede protection):**
252
+
253
+ ```typescript
254
+ // Probabilistic early expiration (XFetch algorithm)
255
+ async function getProducts(): Promise<Product[]> {
256
+ const raw = await redis.hgetall('api:products:list:all:v1');
257
+
258
+ if (raw && raw.data) {
259
+ const expiry = Number(raw.expiry);
260
+ const delta = Number(raw.delta); // time to recompute in ms
261
+ const beta = 1.0; // tuning parameter
262
+
263
+ // Probabilistically recompute before actual expiry
264
+ const now = Date.now();
265
+ const shouldRecompute = now - delta * beta * Math.log(Math.random()) >= expiry;
266
+
267
+ if (!shouldRecompute) {
268
+ return JSON.parse(raw.data);
269
+ }
270
+ }
271
+
272
+ // Recompute with distributed lock
273
+ const lock = await redis.set('lock:products:list', '1', 'EX', 10, 'NX');
274
+ if (!lock) {
275
+ // Another instance is recomputing, serve stale if available
276
+ if (raw?.data) return JSON.parse(raw.data);
277
+ // No stale data, wait briefly and retry
278
+ await sleep(100);
279
+ return getProducts();
280
+ }
281
+
282
+ const start = Date.now();
283
+ const products = await db.product.findMany({ include: { category: true, images: true } });
284
+ const delta = Date.now() - start;
285
+
286
+ await redis.hmset('api:products:list:all:v1', {
287
+ data: JSON.stringify(products),
288
+ expiry: String(Date.now() + 300_000),
289
+ delta: String(delta),
290
+ });
291
+ await redis.expire('api:products:list:all:v1', 600); // hard expiry 2x TTL
292
+ await redis.del('lock:products:list');
293
+
294
+ return products;
295
+ }
296
+ ```
297
+
298
+ ## Gates
299
+
300
+ - **No unbounded caches.** Every cache (in-memory, Redis, Memcached) must have either a `maxSize`/`maxmemory` limit or a TTL on every key. An unbounded cache will grow until it causes memory exhaustion. WHERE a cache has no eviction policy configured, THEN the skill must halt and require one before proceeding.
301
+ - **Cache failure must not crash the application.** WHERE a cache operation (get, set, del) is not wrapped in error handling, THEN the skill must halt. Cache backends are external dependencies that fail independently. An unhandled Redis connection error must not return a 500 to the user.
302
+ - **Invalidation must cover every write path.** WHERE a cached resource can be modified through multiple code paths (API endpoint, background job, admin panel) and any path lacks invalidation, THEN the skill must flag the gap. Partial invalidation is worse than no caching -- it serves confidently wrong data.
303
+
304
+ ## Escalation
305
+
306
+ - **Stale data causing business impact:** When analysis reveals cached data could be stale for longer than the business tolerates (e.g., pricing data cached for 5 minutes), report: "Product prices are cached with a 300-second TTL. A price change will not be visible for up to 5 minutes. If this is unacceptable, switch to write-through caching with event-based invalidation for the pricing resource."
307
+ - **Redis memory approaching limit:** When Redis `maxmemory` is configured but eviction policy is `noeviction`, report: "Redis is configured with `maxmemory 256mb` and `noeviction` policy. When memory is full, all SET operations will fail with OOM errors. Change to `allkeys-lru` for general caching or `volatile-lru` if mixing cached and persistent data."
308
+ - **Cache key collision across services:** When multiple services share a Redis instance without key namespacing, report: "Both the user-service and order-service write to key `user:123`. These are different data shapes from different services. Namespace keys by service: `user-svc:user:123` and `order-svc:user:123`."
309
+ - **Serialization data loss detected:** When a cached object contains types that do not survive JSON roundtrip (Date, BigInt, Map, Set, undefined), report: "The `Order` object contains `Date` fields that become strings after JSON serialization. Use `superjson` or a custom serializer, or convert dates before caching and parse on retrieval."
@@ -0,0 +1,73 @@
1
+ name: harness-caching
2
+ version: "1.0.0"
3
+ description: Cache strategies, invalidation patterns, and distributed caching
4
+ cognitive_mode: advisory-guide
5
+ triggers:
6
+ - manual
7
+ - on_new_feature
8
+ platforms:
9
+ - claude-code
10
+ - gemini-cli
11
+ tools:
12
+ - Bash
13
+ - Read
14
+ - Write
15
+ - Edit
16
+ - Glob
17
+ - Grep
18
+ cli:
19
+ command: harness skill run harness-caching
20
+ args:
21
+ - name: path
22
+ description: Project root path
23
+ required: false
24
+ - name: strategy
25
+ description: "Cache strategy: cache-aside, write-through, write-behind, read-through. All evaluated when omitted."
26
+ required: false
27
+ - name: backend
28
+ description: "Cache backend: redis, memcached, in-memory. Auto-detected when omitted."
29
+ required: false
30
+ mcp:
31
+ tool: run_skill
32
+ input:
33
+ skill: harness-caching
34
+ path: string
35
+ type: rigid
36
+ tier: 3
37
+ internal: false
38
+ keywords:
39
+ - cache
40
+ - Redis
41
+ - Memcached
42
+ - CDN
43
+ - invalidation
44
+ - TTL
45
+ - cache-aside
46
+ - write-through
47
+ - write-behind
48
+ - memoization
49
+ - HTTP cache
50
+ - ETag
51
+ stack_signals:
52
+ - "redis.config.*"
53
+ - "src/**/cache/**"
54
+ - "src/**/*cache*"
55
+ - "docker-compose.*redis*"
56
+ - "docker-compose.*memcached*"
57
+ phases:
58
+ - name: detect
59
+ description: Identify existing cache usage, backends, and access patterns
60
+ required: true
61
+ - name: analyze
62
+ description: Evaluate cache hit ratios, TTL policies, and invalidation correctness
63
+ required: true
64
+ - name: design
65
+ description: Recommend cache strategies, key schemas, and eviction policies
66
+ required: true
67
+ - name: validate
68
+ description: Verify cache consistency, thundering herd protection, and failure modes
69
+ required: true
70
+ state:
71
+ persistent: false
72
+ files: []
73
+ depends_on: []
@@ -0,0 +1,295 @@
1
+ # Harness Chaos
2
+
3
+ > Chaos engineering, fault injection, and resilience validation. Systematically introduces failures to verify that systems degrade gracefully, recover automatically, and maintain availability under real-world fault conditions.
4
+
5
+ ## When to Use
6
+
7
+ - Validating resilience of a service before a production launch or major milestone
8
+ - Testing circuit breakers, retries, timeouts, and fallback mechanisms under failure
9
+ - Preparing for a game day exercise with defined failure scenarios
10
+ - NOT when the service has no resilience mechanisms implemented (implement them first with harness-resilience)
11
+ - NOT when testing application logic correctness (use harness-tdd or harness-integration-test instead)
12
+ - NOT when performing load or performance testing (use harness-load-testing instead)
13
+
14
+ ## Process
15
+
16
+ ### Phase 1: PLAN -- Define Failure Modes and Steady-State Hypotheses
17
+
18
+ 1. **Map the system architecture.** Identify:
19
+ - Services and their dependencies (databases, caches, message queues, third-party APIs)
20
+ - Network boundaries (service-to-service calls, DNS resolution, load balancers)
21
+ - Infrastructure components (Kubernetes pods, Docker containers, cloud services)
22
+ - Data stores and their replication topology
23
+
24
+ 2. **Define steady-state behavior.** Establish measurable indicators of normal operation:
25
+ - Response time P50 and P99 (e.g., P99 < 500ms)
26
+ - Error rate (e.g., < 0.1% 5xx responses)
27
+ - Throughput (e.g., > 100 requests/second)
28
+ - Business metrics (e.g., orders processed per minute, messages delivered)
29
+
30
+ 3. **Enumerate failure modes.** For each dependency, define what can go wrong:
31
+ - **Network failures:** latency injection, packet loss, DNS resolution failure, connection reset
32
+ - **Service failures:** dependency returns 500, dependency is unreachable, dependency responds slowly
33
+ - **Infrastructure failures:** pod crash, node failure, disk full, memory exhaustion
34
+ - **Data failures:** database connection pool exhaustion, replication lag, cache eviction storm
35
+
36
+ 4. **Scope the blast radius.** For each experiment, define:
37
+ - **Target:** which specific service or instance is affected
38
+ - **Duration:** how long the fault persists (start small: 30 seconds to 2 minutes)
39
+ - **Magnitude:** what percentage of traffic or instances are affected
40
+ - **Abort conditions:** when to immediately stop the experiment (e.g., customer-visible error rate > 5%)
41
+
42
+ 5. **Prioritize experiments by risk and value.** Start with:
43
+ - High likelihood, high impact failures (database connection loss, primary cache failure)
44
+ - Failures with existing but untested resilience mechanisms (circuit breakers, retries)
45
+ - Failures that have caused production incidents historically
46
+
47
+ 6. **Document the experiment plan.** For each experiment, write:
48
+ - Hypothesis: "When [fault] is injected into [target], the system [expected behavior]"
49
+ - Steady-state metric: what to monitor
50
+ - Abort criteria: when to terminate the experiment
51
+ - Rollback procedure: how to immediately restore normal operation
52
+
53
+ ### Phase 2: INJECT -- Apply Fault Injection
54
+
55
+ 1. **Select the chaos tooling.** Based on the infrastructure:
56
+ - **Chaos Toolkit:** framework-agnostic, declarative experiment definitions (JSON/YAML)
57
+ - **Gremlin:** SaaS platform for enterprise chaos engineering
58
+ - **Litmus:** Kubernetes-native chaos engineering
59
+ - **Toxiproxy:** network-level fault injection proxy
60
+ - **tc (traffic control):** Linux kernel network delay/loss injection
61
+ - **Custom middleware:** application-level fault injection via feature flags or interceptors
62
+
63
+ 2. **Configure the experiment.** Write the experiment definition:
64
+ - Steady-state probe: how to verify normal operation before and after
65
+ - Fault action: what fault to inject (latency, error, crash, resource exhaustion)
66
+ - Rollback action: how to undo the fault if the experiment must abort
67
+ - Duration and magnitude parameters
68
+
69
+ 3. **Verify the pre-experiment steady state.** Before injecting any fault:
70
+ - Run the steady-state probe and confirm it passes
71
+ - Record baseline metrics (latency, error rate, throughput)
72
+ - Confirm monitoring and alerting are active and visible to the experiment operator
73
+
74
+ 4. **Inject the fault.** Execute the experiment:
75
+ - Start with the smallest blast radius (single instance, short duration)
76
+ - Monitor real-time metrics during injection
77
+ - Be prepared to abort immediately if abort criteria are met
78
+
79
+ 5. **Verify the abort mechanism works.** Before running experiments with larger blast radius:
80
+ - Test that the rollback action successfully removes the injected fault
81
+ - Confirm the system returns to steady state after rollback
82
+ - Measure recovery time
83
+
84
+ ### Phase 3: OBSERVE -- Monitor System Behavior Under Fault
85
+
86
+ 1. **Collect metrics during the experiment.** Capture:
87
+ - Response latency distribution (P50, P95, P99) for the affected service and its consumers
88
+ - Error rates (HTTP status codes, exception counts, queue dead letters)
89
+ - Circuit breaker state transitions (closed, open, half-open)
90
+ - Retry counts and backoff behavior
91
+ - Resource utilization (CPU, memory, connections, threads)
92
+
93
+ 2. **Verify the steady-state hypothesis.** Compare observed metrics against the hypothesis:
94
+ - **Hypothesis holds:** the system degraded gracefully as expected. Record as a successful experiment.
95
+ - **Hypothesis violated:** the system behaved worse than expected. This is a finding. Record the specific deviation.
96
+
97
+ 3. **Check for cascading failures.** Monitor downstream services:
98
+ - Did the fault in service A cause service B to fail?
99
+ - Did retry storms amplify the failure?
100
+ - Did the load balancer route traffic away from the faulty instance?
101
+ - Did the circuit breaker open before the caller's timeout?
102
+
103
+ 4. **Record the timeline.** Document:
104
+ - T+0: fault injected
105
+ - T+N: first detection by monitoring/alerting
106
+ - T+N: circuit breaker opens (if applicable)
107
+ - T+N: system reaches degraded but stable state
108
+ - T+N: fault removed
109
+ - T+N: system returns to full steady state (recovery time)
110
+
111
+ 5. **Terminate the experiment.** Remove the injected fault and verify:
112
+ - The system returns to steady state within the expected recovery time
113
+ - No data loss or corruption occurred during the experiment
114
+ - All queued/retried operations complete successfully
115
+
116
+ ### Phase 4: IMPROVE -- Analyze Findings and Strengthen Resilience
117
+
118
+ 1. **Classify findings.** For each experiment:
119
+ - **Passed:** system behavior matched the hypothesis. No action needed.
120
+ - **Finding -- minor:** system recovered but slower than expected. Add to backlog.
121
+ - **Finding -- major:** system experienced partial outage or data issue. Immediate action required.
122
+ - **Finding -- critical:** cascading failure or data loss. Stop experiments and prioritize fix.
123
+
124
+ 2. **Recommend resilience improvements.** For each finding:
125
+ - Missing circuit breaker: implement circuit breaker with appropriate thresholds
126
+ - Insufficient timeout: reduce timeout to prevent thread pool exhaustion
127
+ - No fallback: implement graceful degradation (cached response, default value, feature flag)
128
+ - Retry storm: implement exponential backoff with jitter and retry budget
129
+ - No health check: add readiness/liveness probes that detect the specific failure mode
130
+
131
+ 3. **Update runbooks and incident response documentation.** For each experiment:
132
+ - Add the failure mode to the incident response playbook
133
+ - Document the detection time, recovery procedure, and expected recovery time
134
+ - Update alerting thresholds if monitoring did not detect the failure promptly
135
+
136
+ 4. **Plan follow-up experiments.** Based on findings:
137
+ - Re-run failed experiments after resilience improvements are implemented
138
+ - Increase blast radius for successful experiments (from single instance to multiple instances)
139
+ - Combine faults (e.g., database slowdown plus cache failure simultaneously)
140
+
141
+ 5. **Run `harness validate`.** Confirm the project passes all harness checks after any code changes made for resilience improvements.
142
+
143
+ 6. **Generate an experiment report.** Summarize:
144
+ - Experiments run, hypotheses tested, and pass/fail outcomes
145
+ - Findings with severity classification
146
+ - Resilience improvements recommended or implemented
147
+ - Recovery time measurements
148
+ - Recommended next experiments
149
+
150
+ ### Graph Refresh
151
+
152
+ If a knowledge graph exists at `.harness/graph/`, refresh it after code changes to keep graph queries accurate:
153
+
154
+ ```
155
+ harness scan [path]
156
+ ```
157
+
158
+ ## Harness Integration
159
+
160
+ - **`harness validate`** -- Run in IMPROVE phase after resilience changes are implemented. Confirms project health.
161
+ - **`harness check-deps`** -- Run after INJECT phase setup to verify chaos tooling dependencies do not leak into production bundles.
162
+ - **`emit_interaction`** -- Used at checkpoints to present experiment plans for human approval before fault injection, and to present findings for prioritization.
163
+ - **Grep** -- Used in PLAN phase to find circuit breaker configurations, retry policies, timeout settings, and fallback implementations.
164
+ - **Glob** -- Used to locate infrastructure configuration files, Kubernetes manifests, and Docker Compose definitions.
165
+
166
+ ## Success Criteria
167
+
168
+ - Every critical dependency has at least one chaos experiment testing its failure mode
169
+ - Steady-state hypotheses are defined with measurable metrics before experiments run
170
+ - The system degrades gracefully under every tested fault (no cascading failures, no data loss)
171
+ - Recovery time after fault removal is measured and meets the defined SLA
172
+ - Findings are documented with severity, root cause, and recommended fix
173
+ - Abort mechanisms are tested and confirmed functional before expanding blast radius
174
+ - `harness validate` passes after resilience improvements
175
+
176
+ ## Examples
177
+
178
+ ### Example: Chaos Toolkit Experiment for Database Latency
179
+
180
+ **PLAN -- Experiment definition:**
181
+
182
+ ```json
183
+ {
184
+ "title": "Database latency does not cause cascading timeout failures",
185
+ "description": "Inject 2-second latency on PostgreSQL connections and verify the order service responds within 5 seconds using cached data",
186
+ "steady-state-hypothesis": {
187
+ "title": "Order service responds within SLA",
188
+ "probes": [
189
+ {
190
+ "type": "probe",
191
+ "name": "order-api-responds",
192
+ "tolerance": true,
193
+ "provider": {
194
+ "type": "http",
195
+ "url": "http://localhost:3000/api/orders/health",
196
+ "timeout": 5
197
+ }
198
+ }
199
+ ]
200
+ },
201
+ "method": [
202
+ {
203
+ "type": "action",
204
+ "name": "inject-db-latency",
205
+ "provider": {
206
+ "type": "process",
207
+ "path": "toxiproxy-cli",
208
+ "arguments": "toxic add -t latency -a latency=2000 postgresql"
209
+ }
210
+ },
211
+ {
212
+ "type": "probe",
213
+ "name": "check-order-response-time",
214
+ "provider": {
215
+ "type": "http",
216
+ "url": "http://localhost:3000/api/orders?limit=10",
217
+ "timeout": 5
218
+ }
219
+ }
220
+ ],
221
+ "rollbacks": [
222
+ {
223
+ "type": "action",
224
+ "name": "remove-db-latency",
225
+ "provider": {
226
+ "type": "process",
227
+ "path": "toxiproxy-cli",
228
+ "arguments": "toxic remove -n inject-db-latency_latency_downstream postgresql"
229
+ }
230
+ }
231
+ ]
232
+ }
233
+ ```
234
+
235
+ ### Example: Litmus Chaos for Kubernetes Pod Failure
236
+
237
+ **INJECT -- Pod kill experiment:**
238
+
239
+ ```yaml
240
+ # litmus/pod-kill-experiment.yaml
241
+ apiVersion: litmuschaos.io/v1alpha1
242
+ kind: ChaosEngine
243
+ metadata:
244
+ name: order-service-pod-kill
245
+ namespace: staging
246
+ spec:
247
+ appinfo:
248
+ appns: staging
249
+ applabel: app=order-service
250
+ appkind: deployment
251
+ chaosServiceAccount: litmus-admin
252
+ experiments:
253
+ - name: pod-delete
254
+ spec:
255
+ components:
256
+ env:
257
+ - name: TOTAL_CHAOS_DURATION
258
+ value: '60'
259
+ - name: CHAOS_INTERVAL
260
+ value: '10'
261
+ - name: FORCE
262
+ value: 'false'
263
+ - name: PODS_AFFECTED_PERC
264
+ value: '50'
265
+ ```
266
+
267
+ **OBSERVE -- Expected behavior timeline:**
268
+
269
+ ```
270
+ T+0s: Fault injected - 50% of order-service pods killed
271
+ T+3s: Kubernetes detects pod failure, starts replacement pods
272
+ T+5s: Load balancer routes traffic to surviving pods
273
+ T+8s: Response latency increases from 50ms to 200ms (surviving pods absorb load)
274
+ T+15s: Replacement pods pass readiness probe, rejoin the pool
275
+ T+20s: Latency returns to baseline (50ms)
276
+ T+60s: Experiment ends
277
+
278
+ Result: PASSED - System maintained availability throughout.
279
+ P99 latency spiked to 450ms (within 500ms SLA).
280
+ Zero 5xx errors observed. No data loss.
281
+ ```
282
+
283
+ ## Gates
284
+
285
+ - **No chaos experiments without abort criteria.** Every experiment must define conditions under which it is immediately terminated. Running an experiment that you cannot stop is reckless, not engineering.
286
+ - **No production experiments without staging validation.** Run every experiment in staging first. Only after the experiment passes in staging and the team is confident in the abort mechanism should it be considered for production.
287
+ - **No expanding blast radius without successful small-scope runs.** Start with a single instance or a small percentage of traffic. Only increase scope after the smaller experiment passes and recovery is confirmed.
288
+ - **No experiments during incidents or peak traffic.** Chaos experiments must not be run when the system is already under stress or during known high-traffic periods. Schedule experiments during low-traffic windows.
289
+
290
+ ## Escalation
291
+
292
+ - **When an experiment causes unexpected data loss or corruption:** Immediately abort, restore from backup, and halt all chaos experiments. Conduct a post-mortem to understand why the data protection mechanisms failed. Do not resume experiments until the data safety gap is addressed.
293
+ - **When monitoring does not detect the injected fault:** This is a finding -- the monitoring is inadequate. Do not interpret "no alerts" as "the system handled it well." Escalate to the observability team to add detection for the specific failure mode before re-running the experiment.
294
+ - **When the team is reluctant to run chaos experiments:** Start with the least risky experiment in a non-production environment. Use the results to demonstrate value. Chaos engineering requires organizational buy-in; do not force it.
295
+ - **When cascading failures are discovered:** This is a critical finding. The service mesh or dependency chain lacks isolation. Escalate immediately with a recommendation for circuit breakers, bulkheads, or service mesh fault injection policies.