ultimate-pi 0.18.0 → 0.19.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 (314) hide show
  1. package/.agents/skills/harness-debate-plan/SKILL.md +1 -1
  2. package/.agents/skills/harness-decisions/SKILL.md +2 -3
  3. package/.agents/skills/harness-governor/SKILL.md +6 -5
  4. package/.agents/skills/harness-orchestration/SKILL.md +4 -4
  5. package/.agents/skills/harness-review/SKILL.md +7 -7
  6. package/.agents/skills/harness-sentrux-setup/SKILL.md +4 -3
  7. package/.agents/skills/harness-steer/SKILL.md +1 -1
  8. package/.agents/skills/sentrux/SKILL.md +9 -9
  9. package/.pi/PACKAGING.md +4 -4
  10. package/.pi/SYSTEM.md +54 -120
  11. package/.pi/agents/harness/incident-recorder.md +0 -1
  12. package/.pi/agents/harness/planning/decompose.md +1 -3
  13. package/.pi/agents/harness/planning/execution-plan-author.md +0 -2
  14. package/.pi/agents/harness/planning/hypothesis-validator.md +0 -2
  15. package/.pi/agents/harness/planning/hypothesis.md +0 -2
  16. package/.pi/agents/harness/planning/implementation-researcher.md +0 -2
  17. package/.pi/agents/harness/planning/plan-adversary.md +0 -2
  18. package/.pi/agents/harness/planning/plan-evaluator.md +1 -3
  19. package/.pi/agents/harness/planning/planning-context.md +0 -2
  20. package/.pi/agents/harness/planning/review-integrator.md +0 -2
  21. package/.pi/agents/harness/planning/sprint-contract-auditor.md +0 -2
  22. package/.pi/agents/harness/planning/stack-researcher.md +0 -2
  23. package/.pi/agents/harness/{adversary.md → reviewing/adversary.md} +0 -2
  24. package/.pi/agents/harness/{evaluator.md → reviewing/evaluator.md} +0 -2
  25. package/.pi/agents/harness/{tie-breaker.md → reviewing/tie-breaker.md} +0 -2
  26. package/.pi/agents/harness/{executor.md → running/executor.md} +0 -2
  27. package/.pi/agents/harness/sentrux-bootstrap.md +0 -1
  28. package/.pi/agents/harness/sentrux-steward.md +0 -2
  29. package/.pi/agents/harness/trace-librarian.md +0 -1
  30. package/.pi/extensions/00-harness-project-control.ts +133 -0
  31. package/.pi/extensions/00-posthog-network-bootstrap.ts +1 -1
  32. package/.pi/extensions/agt-kill-switch.ts +57 -0
  33. package/.pi/extensions/agt-prompt-guard.ts +32 -0
  34. package/.pi/extensions/budget-guard.ts +2 -0
  35. package/.pi/extensions/custom-footer.ts +46 -145
  36. package/.pi/extensions/custom-header.ts +1 -1
  37. package/.pi/extensions/custom-system-prompt.ts +1 -1
  38. package/.pi/extensions/debate-orchestrator.ts +7 -5
  39. package/.pi/extensions/harness-ask-user.ts +8 -8
  40. package/.pi/extensions/harness-debate-tools.ts +27 -43
  41. package/.pi/extensions/harness-lens.ts +94 -0
  42. package/.pi/extensions/harness-live-widget.ts +33 -2
  43. package/.pi/extensions/harness-plan-approval.ts +12 -12
  44. package/.pi/extensions/harness-run-context.ts +1214 -852
  45. package/.pi/extensions/harness-subagent-governance.ts +8 -0
  46. package/.pi/extensions/harness-subagent-submit.ts +36 -164
  47. package/.pi/extensions/harness-subagents.ts +4 -4
  48. package/.pi/extensions/harness-telemetry.ts +3 -1
  49. package/.pi/extensions/harness-web-tools.ts +3 -3
  50. package/.pi/extensions/observation-bus.ts +2 -0
  51. package/.pi/extensions/policy-gate.ts +27 -5
  52. package/.pi/extensions/review-integrity.ts +91 -10
  53. package/.pi/extensions/sentrux-rules-sync.ts +3 -1
  54. package/.pi/extensions/subagent-governance.ts +92 -0
  55. package/.pi/extensions/test-diff-integrity.ts +1 -0
  56. package/.pi/extensions/trace-recorder.ts +3 -1
  57. package/.pi/extensions/{ultimate-pi-vcc.ts → vcc-compaction.ts} +1 -1
  58. package/.pi/harness/README.md +6 -2
  59. package/.pi/harness/agents.manifest.json +38 -49
  60. package/.pi/harness/agents.policy.yaml +275 -0
  61. package/.pi/harness/corpus/graphify-kb-updater.config.json +55 -0
  62. package/.pi/harness/docs/adrs/0006-sentrux-dual-layer.md +2 -1
  63. package/.pi/harness/docs/adrs/0030-inhouse-vcc-compaction.md +1 -1
  64. package/.pi/harness/docs/adrs/0035-plan-phase-review-gate.md +1 -1
  65. package/.pi/harness/docs/adrs/0044-harness-steer-loop.md +3 -2
  66. package/.pi/harness/docs/adrs/0045-harness-lens-minimal-contract.md +49 -0
  67. package/.pi/harness/docs/adrs/0045-phase-scoped-agent-directories.md +33 -0
  68. package/.pi/harness/docs/adrs/0046-agt-policy-engine.md +51 -0
  69. package/.pi/harness/docs/adrs/0047-agt-layered-security.md +39 -0
  70. package/.pi/harness/docs/adrs/0048-tool-call-hook-order.md +25 -0
  71. package/.pi/harness/docs/adrs/0049-agents-policy-manifest.md +36 -0
  72. package/.pi/harness/docs/adrs/README.md +6 -0
  73. package/.pi/harness/docs/graphify-kb-updater-runbook.md +11 -5
  74. package/.pi/harness/docs/practice-map.md +2 -2
  75. package/.pi/harness/evolution/README.md +1 -2
  76. package/.pi/harness/examples/agents.policy.project.yaml +19 -0
  77. package/.pi/harness/examples/policies/custom-deny-bash.yaml +9 -0
  78. package/.pi/harness/policies/bash-denylists.yaml +5 -0
  79. package/.pi/harness/policies/defaults.yaml +51 -0
  80. package/.pi/harness/policies/orchestrator.yaml +18 -0
  81. package/.pi/harness/policies/phases.yaml +10 -0
  82. package/.pi/harness/policies/roles.yaml +5 -0
  83. package/.pi/harness/policies/web-guard.yaml +5 -0
  84. package/.pi/harness/policies/workflow-sequences.yaml +9 -0
  85. package/.pi/harness/sentrux/architecture.manifest.json +26 -4
  86. package/.pi/harness/specs/harness-spawn-context.schema.json +1 -1
  87. package/.pi/harness/specs/observation.schema.json +2 -1
  88. package/.pi/lib/agents-policy.d.mts +70 -0
  89. package/.pi/lib/agents-policy.mjs +325 -0
  90. package/.pi/lib/agents-policy.ts +19 -0
  91. package/.pi/lib/agt/audit-run-sink.ts +52 -0
  92. package/.pi/lib/agt/build-evaluation-context.ts +285 -0
  93. package/.pi/lib/agt/config.ts +28 -0
  94. package/.pi/lib/agt/delegation.ts +69 -0
  95. package/.pi/lib/agt/evaluate-policy.ts +56 -0
  96. package/.pi/lib/agt/identity-registry.ts +41 -0
  97. package/.pi/lib/agt/index.ts +55 -0
  98. package/.pi/lib/agt/kill-switch-state.ts +11 -0
  99. package/.pi/lib/agt/legacy-evaluate.ts +101 -0
  100. package/.pi/lib/agt/policy-engine.ts +154 -0
  101. package/.pi/lib/agt/rings.ts +21 -0
  102. package/.pi/lib/agt/sre-hooks.ts +45 -0
  103. package/.pi/lib/agt/trust-run-store.ts +26 -0
  104. package/.pi/lib/agt/workflow-history.ts +29 -0
  105. package/.pi/lib/agt-governance-active.ts +14 -0
  106. package/.pi/lib/agt-tool-guard.ts +78 -0
  107. package/.pi/lib/ask-user/dialog.ts +314 -0
  108. package/.pi/{extensions/lib → lib}/debate-bus-core.ts +10 -10
  109. package/.pi/{extensions/lib → lib}/debate-bus-state.ts +1 -1
  110. package/.pi/{extensions/lib → lib}/extension-load-guard.ts +21 -0
  111. package/.pi/lib/harness-agt-tool-guard.ts +5 -0
  112. package/.pi/{extensions/lib → lib}/harness-artifact-gate.ts +6 -16
  113. package/.pi/lib/harness-debate-core-deps.ts +14 -0
  114. package/.pi/lib/harness-debate-workflow-deps.ts +43 -0
  115. package/.pi/lib/harness-lens/.gitattributes +1 -0
  116. package/.pi/lib/harness-lens/clients/edit-autopatch.ts +88 -0
  117. package/.pi/lib/harness-lens/clients/file-kinds.ts +380 -0
  118. package/.pi/lib/harness-lens/clients/file-time.ts +215 -0
  119. package/.pi/lib/harness-lens/clients/file-utils.ts +484 -0
  120. package/.pi/lib/harness-lens/clients/format-service.ts +276 -0
  121. package/.pi/lib/harness-lens/clients/formatters.ts +1000 -0
  122. package/.pi/lib/harness-lens/clients/git-guard.ts +31 -0
  123. package/.pi/lib/harness-lens/clients/indent-retarget.ts +90 -0
  124. package/.pi/lib/harness-lens/clients/installer/index.ts +2368 -0
  125. package/.pi/lib/harness-lens/clients/latency-logger.ts +80 -0
  126. package/.pi/lib/harness-lens/clients/lens-config.ts +43 -0
  127. package/.pi/lib/harness-lens/clients/lens-events.ts +164 -0
  128. package/.pi/lib/harness-lens/clients/lsp/aggregation.ts +91 -0
  129. package/.pi/lib/harness-lens/clients/lsp/client.ts +1466 -0
  130. package/.pi/lib/harness-lens/clients/lsp/config.ts +216 -0
  131. package/.pi/lib/harness-lens/clients/lsp/edits.ts +297 -0
  132. package/.pi/lib/harness-lens/clients/lsp/index.ts +1355 -0
  133. package/.pi/lib/harness-lens/clients/lsp/interactive-install.ts +424 -0
  134. package/.pi/lib/harness-lens/clients/lsp/language.ts +223 -0
  135. package/.pi/lib/harness-lens/clients/lsp/launch.ts +939 -0
  136. package/.pi/lib/harness-lens/clients/lsp/lsp-index.ts +11 -0
  137. package/.pi/lib/harness-lens/clients/lsp/path-utils.ts +12 -0
  138. package/.pi/lib/harness-lens/clients/lsp/server-strategies.ts +81 -0
  139. package/.pi/lib/harness-lens/clients/lsp/server.ts +1971 -0
  140. package/.pi/lib/harness-lens/clients/path-utils.ts +182 -0
  141. package/.pi/lib/harness-lens/clients/pipeline.ts +360 -0
  142. package/.pi/lib/harness-lens/clients/project-profile.ts +117 -0
  143. package/.pi/lib/harness-lens/clients/runtime-agent-end.ts +112 -0
  144. package/.pi/lib/harness-lens/clients/runtime-config.ts +33 -0
  145. package/.pi/lib/harness-lens/clients/runtime-coordinator.ts +186 -0
  146. package/.pi/lib/harness-lens/clients/runtime-tool-result.ts +171 -0
  147. package/.pi/lib/harness-lens/clients/safe-spawn.ts +339 -0
  148. package/.pi/lib/harness-lens/clients/secrets-scanner.ts +214 -0
  149. package/.pi/lib/harness-lens/clients/tool-policy.ts +2072 -0
  150. package/.pi/lib/harness-lens/clients/types.ts +59 -0
  151. package/.pi/lib/harness-lens/clients/widget-state.ts +283 -0
  152. package/.pi/lib/harness-lens/index.ts +532 -0
  153. package/.pi/lib/harness-lens/tools/lsp-diagnostics.ts +706 -0
  154. package/.pi/lib/harness-lens/tools/lsp-navigation.ts +1246 -0
  155. package/.pi/{extensions/lib → lib}/harness-posthog.ts +3 -0
  156. package/.pi/lib/harness-project-config.ts +91 -0
  157. package/.pi/lib/harness-run-context-responses.ts +9 -0
  158. package/.pi/lib/harness-run-context.ts +1 -3
  159. package/.pi/{extensions/lib/spawn-policy.ts → lib/harness-spawn-policy.ts} +4 -3
  160. package/.pi/{extensions/lib → lib}/harness-spawn-topology.ts +5 -28
  161. package/.pi/lib/harness-subagent-auth.ts +51 -0
  162. package/.pi/{extensions/lib → lib}/harness-subagent-precheck.ts +13 -10
  163. package/.pi/{extensions/lib → lib}/harness-subagent-submit-pipeline.ts +3 -3
  164. package/.pi/lib/harness-subagent-submit-register.ts +163 -0
  165. package/.pi/{extensions/lib → lib}/harness-subagent-submit-registry.ts +1 -55
  166. package/.pi/{extensions/lib → lib}/harness-subagents-bridge.ts +53 -14
  167. package/.pi/{extensions/lib → lib}/harness-subprocess-bootstrap.ts +1 -1
  168. package/.pi/lib/harness-ui-state.ts +27 -12
  169. package/.pi/{extensions/lib → lib}/plan-approval/create-plan.ts +2 -2
  170. package/.pi/{extensions/lib → lib}/plan-approval/format-plan.ts +2 -2
  171. package/.pi/{extensions/lib → lib}/plan-approval/plan-review.ts +162 -201
  172. package/.pi/{extensions/lib → lib}/plan-approval/render.ts +1 -1
  173. package/.pi/{extensions/lib → lib}/plan-approval/resolve-disk.ts +2 -2
  174. package/.pi/{extensions/lib → lib}/plan-approval/types.ts +1 -1
  175. package/.pi/{extensions/lib → lib}/plan-approval/validate.ts +3 -3
  176. package/.pi/{extensions/lib → lib}/plan-approval-readiness.ts +3 -52
  177. package/.pi/{extensions/lib → lib}/plan-debate-envelope.ts +1 -1
  178. package/.pi/{extensions/lib → lib}/plan-debate-gate.ts +1 -1
  179. package/.pi/{extensions/lib → lib}/plan-debate-lane.ts +1 -4
  180. package/.pi/{extensions/lib → lib}/plan-messenger.ts +1 -1
  181. package/.pi/prompts/harness-auto.md +2 -2
  182. package/.pi/prompts/harness-plan.md +4 -6
  183. package/.pi/prompts/harness-review.md +9 -9
  184. package/.pi/prompts/harness-run.md +7 -7
  185. package/.pi/prompts/harness-setup.md +42 -68
  186. package/.pi/prompts/harness-steer.md +2 -2
  187. package/.pi/scripts/README.md +3 -5
  188. package/.pi/scripts/generate-agents-policy-yaml.mjs +148 -0
  189. package/.pi/scripts/graphify-kb-updater.mjs +48 -8
  190. package/.pi/scripts/harness-agents-manifest.mjs +61 -4
  191. package/.pi/scripts/harness-agt-doctor.ts +36 -0
  192. package/.pi/scripts/harness-cli-verify.sh +9 -2
  193. package/.pi/scripts/harness-project-toggle.mjs +129 -0
  194. package/.pi/scripts/harness-sentrux-cli.mjs +142 -0
  195. package/.pi/scripts/harness-verify.mjs +113 -39
  196. package/.pi/scripts/harness-web-policy-guard.mjs +2 -2
  197. package/.pi/scripts/validate-plan-dag.mjs +65 -74
  198. package/.pi/scripts/vendor-pi-vcc-settings.stub.ts +2 -2
  199. package/.pi/scripts/vendor-sync-pi-vcc.sh +1 -1
  200. package/.pi/skills/architecture/broker-domain/SKILL.md +65 -0
  201. package/.pi/skills/architecture/cqrs/SKILL.md +63 -0
  202. package/.pi/skills/architecture/event-driven/SKILL.md +60 -0
  203. package/.pi/skills/architecture/hexagonal-ports-adapters/SKILL.md +66 -0
  204. package/.pi/skills/architecture/layered/SKILL.md +68 -0
  205. package/.pi/skills/architecture/microkernel/SKILL.md +62 -0
  206. package/.pi/skills/architecture/microservices/SKILL.md +64 -0
  207. package/.pi/skills/architecture/modular-monolith/SKILL.md +65 -0
  208. package/.pi/skills/architecture/orchestration-driven-soa/SKILL.md +61 -0
  209. package/.pi/skills/architecture/pipeline/SKILL.md +63 -0
  210. package/.pi/skills/architecture/service-based/SKILL.md +64 -0
  211. package/.pi/skills/architecture/service-mesh/SKILL.md +60 -0
  212. package/.pi/skills/architecture/space-based/SKILL.md +60 -0
  213. package/.pi/skills/ast-grep/SKILL.md +40 -321
  214. package/.pi/skills/delivery/debugging-discipline/SKILL.md +36 -0
  215. package/.pi/skills/delivery/documentation-update/SKILL.md +33 -0
  216. package/.pi/skills/delivery/requirements-to-implementation/SKILL.md +34 -0
  217. package/.pi/skills/delivery/risk-based-verification/SKILL.md +43 -0
  218. package/.pi/skills/delivery/tradeoff-analysis/SKILL.md +34 -0
  219. package/.pi/skills/engineering/api-contract-design/SKILL.md +38 -0
  220. package/.pi/skills/engineering/cohesion-coupling/SKILL.md +43 -0
  221. package/.pi/skills/engineering/complexity-control/SKILL.md +31 -0
  222. package/.pi/skills/engineering/defensive-programming/SKILL.md +38 -0
  223. package/.pi/skills/engineering/dependency-management/SKILL.md +29 -0
  224. package/.pi/skills/engineering/domain-modeling/SKILL.md +32 -0
  225. package/.pi/skills/engineering/error-handling/SKILL.md +37 -0
  226. package/.pi/skills/engineering/legacy-code-seams/SKILL.md +35 -0
  227. package/.pi/skills/engineering/naming-and-intent/SKILL.md +29 -0
  228. package/.pi/skills/engineering/refactoring-safe-evolution/SKILL.md +35 -0
  229. package/.pi/skills/engineering/routine-function-design/SKILL.md +34 -0
  230. package/.pi/skills/engineering/small-change-discipline/SKILL.md +35 -0
  231. package/.pi/skills/lsp-navigation/SKILL.md +89 -0
  232. package/.pi/skills/quality/code-review-self-check/SKILL.md +35 -0
  233. package/.pi/skills/quality/privacy-data-handling/SKILL.md +26 -0
  234. package/.pi/skills/quality/security-review/SKILL.md +34 -0
  235. package/.pi/skills/quality/test-strategy/SKILL.md +33 -0
  236. package/.pi/skills/quality/testability-design/SKILL.md +33 -0
  237. package/.pi/skills/systems/concurrency-safety/SKILL.md +32 -0
  238. package/.pi/skills/systems/data-modeling-migrations/SKILL.md +31 -0
  239. package/.pi/skills/systems/observability-instrumentation/SKILL.md +32 -0
  240. package/.pi/skills/systems/performance-measurement/SKILL.md +35 -0
  241. package/.pi/skills/systems/reliability-design/SKILL.md +32 -0
  242. package/.sentrux/rules.toml +20 -4
  243. package/AGENTS.md +5 -0
  244. package/CHANGELOG.md +26 -0
  245. package/README.md +85 -58
  246. package/THIRD_PARTY_NOTICES.md +12 -21
  247. package/package.json +15 -7
  248. package/vendor/pi-subagents/src/agents.ts +45 -1
  249. package/vendor/pi-subagents/src/subagents.ts +866 -811
  250. package/vendor/pi-vcc/src/core/brief.ts +68 -99
  251. package/vendor/pi-vcc/src/core/settings.ts +2 -2
  252. package/.agents/skills/caveman/SKILL.md +0 -67
  253. package/.pi/agents/harness/meta-optimizer.md +0 -36
  254. package/.pi/agents/harness/planning/scout-graphify.md +0 -39
  255. package/.pi/agents/harness/planning/scout-semantic.md +0 -41
  256. package/.pi/agents/harness/planning/scout-structure.md +0 -37
  257. package/.pi/extensions/lib/ask-user/dialog.ts +0 -260
  258. package/.pi/extensions/lib/harness-subagent-auth.ts +0 -209
  259. package/.pi/extensions/lib/harness-subagent-policy.ts +0 -236
  260. package/.pi/extensions/pi-model-router-harness.ts +0 -42
  261. package/.pi/harness/evolution/meta-optimizer.mjs +0 -99
  262. package/.pi/harness/specs/router-tuning-proposal.schema.json +0 -114
  263. package/.pi/model-router.example.json +0 -36
  264. package/.pi/prompts/harness-critic.md +0 -10
  265. package/.pi/prompts/harness-eval.md +0 -10
  266. package/.pi/prompts/harness-router-tune.md +0 -52
  267. package/.pi/scripts/harness-generate-model-router.mjs +0 -327
  268. package/.pi/scripts/harness-model-router-routing.test.mjs +0 -97
  269. package/.pi/scripts/harness-sync-model-router.mjs +0 -97
  270. package/.pi/scripts/vendor-sync-pi-model-router.sh +0 -47
  271. package/vendor/pi-model-router/.prettierignore +0 -4
  272. package/vendor/pi-model-router/.prettierrc +0 -5
  273. package/vendor/pi-model-router/AGENTS.md +0 -39
  274. package/vendor/pi-model-router/LICENSE +0 -21
  275. package/vendor/pi-model-router/README.md +0 -99
  276. package/vendor/pi-model-router/UPSTREAM_PIN.md +0 -10
  277. package/vendor/pi-model-router/docs/ARCHITECTURE.md +0 -54
  278. package/vendor/pi-model-router/extensions/commands.ts +0 -720
  279. package/vendor/pi-model-router/extensions/config.ts +0 -348
  280. package/vendor/pi-model-router/extensions/constants.ts +0 -1
  281. package/vendor/pi-model-router/extensions/index.ts +0 -478
  282. package/vendor/pi-model-router/extensions/provider.ts +0 -580
  283. package/vendor/pi-model-router/extensions/routing.ts +0 -564
  284. package/vendor/pi-model-router/extensions/state.ts +0 -52
  285. package/vendor/pi-model-router/extensions/types.ts +0 -95
  286. package/vendor/pi-model-router/extensions/ui.ts +0 -144
  287. package/vendor/pi-model-router/model-router.example.json +0 -48
  288. package/vendor/pi-model-router/package.json +0 -48
  289. package/vendor/pi-model-router/tsconfig.json +0 -16
  290. /package/.pi/{prompts → harness/docs}/planning-rubrics.md +0 -0
  291. /package/.pi/{extensions/lib → lib}/ask-user/fallback.ts +0 -0
  292. /package/.pi/{extensions/lib → lib}/ask-user/render.ts +0 -0
  293. /package/.pi/{extensions/lib → lib}/ask-user/schema.ts +0 -0
  294. /package/.pi/{extensions/lib → lib}/ask-user/types.ts +0 -0
  295. /package/.pi/{extensions/lib → lib}/ask-user/validate-core.mjs +0 -0
  296. /package/.pi/{extensions/lib → lib}/ask-user/validate.ts +0 -0
  297. /package/.pi/{extensions/lib → lib}/harness-cocoindex-refresh.ts +0 -0
  298. /package/.pi/{extensions/lib → lib}/harness-paths.ts +0 -0
  299. /package/.pi/{extensions/lib → lib}/harness-spawn-budget.ts +0 -0
  300. /package/.pi/{extensions/lib → lib}/harness-vcc-settings.ts +0 -0
  301. /package/.pi/{extensions/lib → lib}/harness-web/run-cli.ts +0 -0
  302. /package/.pi/{extensions/lib → lib}/plan-approval/dialog.ts +0 -0
  303. /package/.pi/{extensions/lib → lib}/plan-approval/schema.ts +0 -0
  304. /package/.pi/{extensions/lib → lib}/plan-debate-eligibility.ts +0 -0
  305. /package/.pi/{extensions/lib → lib}/plan-debate-focus.ts +0 -0
  306. /package/.pi/{extensions/lib → lib}/plan-debate-id.ts +0 -0
  307. /package/.pi/{extensions/lib → lib}/plan-debate-lanes.ts +0 -0
  308. /package/.pi/{extensions/lib → lib}/plan-debate-round-status.ts +0 -0
  309. /package/.pi/{extensions/lib → lib}/plan-debate-write-guard.ts +0 -0
  310. /package/.pi/{extensions/lib → lib}/plan-review-gate.ts +0 -0
  311. /package/.pi/{extensions/lib → lib}/plan-review-integrator-rules.ts +0 -0
  312. /package/.pi/{extensions/lib → lib}/plan-scope-guard.ts +0 -0
  313. /package/.pi/{extensions/lib → lib}/posthog-client.ts +0 -0
  314. /package/.pi/{extensions/lib → lib}/posthog-node.d.ts +0 -0
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: service-mesh
3
+ description: "Use when applying the service mesh pattern to service architectures: move cross-cutting network concerns such as retries, mTLS, routing, observability, policy, and traffic shaping out of service code while preserving domain ownership."
4
+ ---
5
+
6
+ # Service Mesh Pattern
7
+
8
+ Use this skill when cross-service networking concerns are polluting service code or need centralized policy.
9
+
10
+ ## Fit
11
+
12
+ Use with multiple networked services that need consistent traffic policy, mTLS, observability, retries, or progressive delivery.
13
+ Avoid for small systems where a mesh would add platform complexity without clear benefit.
14
+
15
+ ## Agent Workflow
16
+
17
+ 1. Read `graphify-out/GRAPH_REPORT.md`.
18
+ 2. Run `graphify query "service mesh pattern microservices network policy observability"`.
19
+ 3. Identify cross-cutting network behavior embedded in services.
20
+ 4. Decide what belongs in mesh/platform versus application code.
21
+ 5. Remove one cross-cutting concern from service code safely.
22
+ 6. Add tests/config checks for equivalent behavior.
23
+
24
+ ## Target Shape
25
+
26
+ ```text
27
+ services/<service>/code/ # domain/application code without mesh vendor logic
28
+ platform/mesh/
29
+ policies/
30
+ routes/
31
+ telemetry/
32
+ security/
33
+ ```
34
+
35
+ ## Implementation Rules
36
+
37
+ - Service code owns business behavior, data, and explicit dependency calls.
38
+ - Mesh/platform owns mTLS, traffic routing, retries where safe, timeouts, telemetry, and policy.
39
+ - Do not hide business retries or non-idempotent compensation in mesh config.
40
+ - Timeout and retry budgets must align with application semantics.
41
+ - Mesh config is versioned, reviewed, and tested like code.
42
+
43
+ ## Migration Steps
44
+
45
+ 1. Inventory duplicated network concerns in services.
46
+ 2. Pick one safe concern such as telemetry headers or mTLS policy.
47
+ 3. Add mesh/platform config with rollout guardrails.
48
+ 4. Remove redundant service code.
49
+ 5. Validate runtime behavior in tests or staging.
50
+ 6. Document ownership and rollback.
51
+
52
+ ## Verification
53
+
54
+ - Use graphify to confirm service modules no longer depend on platform/mesh internals.
55
+ - Test timeout/retry behavior for idempotent and non-idempotent calls.
56
+ - Validate telemetry, route, and security policies with existing platform checks.
57
+
58
+ ## Output Contract
59
+
60
+ Return: concern inventory, mesh/app ownership split, config/code patch, rollout plan, verification, and operational risks.
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: space-based
3
+ description: "Use when implementing space-based architecture: horizontally scalable processing units, in-memory/distributed state, partitioning, eventual persistence, backpressure, replication, and operational safeguards for high-volume systems."
4
+ ---
5
+
6
+ # Space-Based Architecture
7
+
8
+ Use this skill for systems where database bottlenecks and burst traffic dominate the design.
9
+
10
+ ## Fit
11
+
12
+ Use for high-volume, bursty, low-latency workloads needing horizontal scaling and elastic processing.
13
+ Avoid for ordinary CRUD systems; this pattern adds serious operational complexity.
14
+
15
+ ## Agent Workflow
16
+
17
+ 1. Read `graphify-out/GRAPH_REPORT.md`.
18
+ 2. Run `graphify query "space-based architecture processing units partitioning replication"`.
19
+ 3. Identify the scalability bottleneck and partition key.
20
+ 4. Isolate processing unit logic from persistence.
21
+ 5. Make state ownership, replication, and recovery explicit.
22
+ 6. Add load, failover, and backpressure checks.
23
+
24
+ ## Target Shape
25
+
26
+ ```text
27
+ codebase/space/
28
+ processing-unit/ # stateless-ish compute plus owned partition state
29
+ partitioning # keying and routing
30
+ state-store # distributed/in-memory state port
31
+ persistence-sync # async persistence/replication
32
+ ```
33
+
34
+ ## Implementation Rules
35
+
36
+ - Choose a stable partition key before code changes.
37
+ - Processing units own only their partition's hot state.
38
+ - Persistence is asynchronous where possible; consistency must be stated.
39
+ - Backpressure, retries, and overload behavior are part of the architecture.
40
+ - Recovery must rebuild state from durable sources or snapshots.
41
+ - Do not introduce distributed cache/state without observability.
42
+
43
+ ## Migration Steps
44
+
45
+ 1. Measure or identify the bottleneck.
46
+ 2. Extract hot-path processing into a processing-unit boundary.
47
+ 3. Add a state-store port with one implementation.
48
+ 4. Route requests/events by partition key.
49
+ 5. Add async persistence or snapshot/replay.
50
+ 6. Add load and failover tests around the boundary.
51
+
52
+ ## Verification
53
+
54
+ - Use graphify to confirm hot path does not synchronously depend on the old bottleneck.
55
+ - Test partition routing, duplicate processing, restart recovery, and overloaded dependencies.
56
+ - Record latency/throughput assumptions in an ADR.
57
+
58
+ ## Output Contract
59
+
60
+ Return: bottleneck, partition key, processing-unit patch, state/recovery model, verification, and operational risks.
@@ -1,354 +1,73 @@
1
1
  ---
2
2
  name: ast-grep
3
- description: "Structural code search using AST patterns via the `sg` CLI. Use when searching for code patterns, finding all call sites, locating function/class definitions, matching import structures, or any task where code shape matters not just text. Triggers on: find all usages, where is X called, find functions that, pattern search, structural search, AST search, find imports of, find class definitions, find methods with, codemod, rewrite code, refactor pattern, sg, ast-grep."
3
+ description: "Structural code search and replacement using the sg CLI. Use for function calls, imports, class/method definitions, call sites, and codemods. Prefer LSP for definitions/references/types; use sg for structural patterns; reserve grep for exact literals, comments, URLs, or non-code files."
4
4
  allowed-tools:
5
5
  - Bash(sg *)
6
6
  - Bash(npm install -g @ast-grep/cli)
7
7
  ---
8
8
 
9
- # ast-grep: Structural Code Search
9
+ # ast-grep: Structural Code Search (sg CLI)
10
10
 
11
- Search code by structure, not text. `sg` uses tree-sitter to parse code into ASTs, then matches patterns against the tree. It understands code semantics — not just string matching.
11
+ Search code by structure, not text. ast-grep parses code into ASTs and matches code shape.
12
12
 
13
- ## Install
13
+ **Harness policy:** use the **`sg` shell CLI only**. harness-lens does not expose `ast_grep_search` / `ast_grep_replace` pi tools.
14
+
15
+ ## Install CLI
14
16
 
15
17
  ```bash
16
18
  npm install -g @ast-grep/cli
19
+ sg --version
17
20
  ```
18
21
 
19
- Verifies with `sg --version`.
22
+ `/harness-setup` installs global `sg` on the machine. That is a harness dev tool — it does not imply every target repo uses ast-grep rules.
20
23
 
21
24
  ## When to Use
22
25
 
23
26
  | Task | Tool | Why |
24
27
  |------|------|-----|
25
- | Find code by structure/pattern | **ast-grep** (`sg`) | AST-aware knows what is a function call vs a string |
26
- | Find code by concept/meaning | graphify / `ccc search` | Architecture (graphify) vs implementation chunks (`ccc`) |
27
- | Find exact literal string | `grep` | Only tool for non-code files or exact byte match |
28
- | Explore architecture | graphify | Call graph, community detection |
29
-
30
- **Rule:** For any code search involving patterns, signatures, or structure — use `sg` first. Reserve `grep` for exact literal strings in non-code files (configs, logs, markdown).
31
-
32
- ## Pattern Syntax
33
-
34
- Patterns match code structure. Write code like you'd write it — `sg` parses it as AST.
35
-
36
- ### Metavariables
37
-
38
- Prefix with `$` to match any expression, type, or identifier:
39
-
40
- | Pattern | Matches |
41
- |---------|---------|
42
- | `$X` | Any single expression, identifier, or type |
43
- | `$NAME` | Captures and names the match (use in rewrites) |
44
- | `...` | Matches zero or more of anything (statements, args, etc.) |
45
- | `$$...ARGS` | Captures multiple items as a list |
28
+ | Definitions, references, hover/types, symbol navigation | LSP (`lsp_navigation`) | Language server code intelligence |
29
+ | Type/error checks | LSP (`lsp_diagnostics`) | Active diagnostics |
30
+ | Find code by structure/pattern | `sg -p 'pattern'` | AST-aware matching |
31
+ | Safe structural replacement/codemod | `sg --rewrite` | Shape-preserving rewrites |
32
+ | Find code by concept/meaning | graphify / `ccc search` | Architecture vs implementation chunks |
33
+ | Architecture gate at review | Sentrux | Ship/promotion quality |
34
+ | Find exact literal string | `grep` | Non-code, comments, logs, generated text |
46
35
 
47
- ### Examples
36
+ ## Golden Rules
48
37
 
49
- ```
50
- # Any function call to `fetch` with any arguments
51
- fetch($ARGS)
52
-
53
- # Any function definition named `handle`
54
- function handle($PARAMS) { ... }
55
-
56
- # Any import from `react`
57
- import $X from 'react'
58
-
59
- # Any method call on `console`
60
- console.$METHOD($ARGS)
61
-
62
- # Any try-catch block
63
- try { ... } catch ($ERR) { ... }
64
-
65
- # Any class extending something
66
- class $NAME extends $BASE { ... }
67
- ```
38
+ 1. **Be specific** — `fetchMetrics($ARGS)` or `fetchMetrics($$$ARGS)`, not bare `fetchMetrics`.
39
+ 2. **Scope it** pass a directory or file to `sg` whenever possible.
40
+ 3. **Retry once on zero matches** — simplify the pattern; then grep only if still empty.
41
+ 4. **Dry-run replacements** — use `--dry-run` before applying rewrites.
42
+ 5. **Valid code patterns** — `function $NAME($$$ARGS) { $$$BODY }`, not incomplete fragments.
68
43
 
69
- ### Language Specification
70
-
71
- `sg` auto-detects language from file extensions. Override explicitly:
44
+ ## CLI Quick Reference
72
45
 
73
46
  ```bash
74
- sg -p 'pattern' -l ts # TypeScript
75
- sg -p 'pattern' -l python # Python
76
- sg -p 'pattern' -l go # Go
77
- sg -p 'pattern' -l rust # Rust
78
- sg -p 'pattern' -l java # Java
79
- sg -p 'pattern' -l cpp # C++
80
- ```
81
-
82
- Supported languages: TypeScript, JavaScript, Python, Go, Rust, Java, C, C++, C#, Ruby, Swift, Kotlin, Scala, PHP, HTML, CSS, JSON, YAML, and more (full tree-sitter grammar set).
83
-
84
- ## Quick Reference
85
-
86
- ```bash
87
- # Search by pattern (auto-detects language)
88
- sg -p 'pattern'
89
-
90
- # Search with language explicit
91
- sg -p 'pattern' -l ts
92
-
93
- # Search specific directory
94
- sg -p 'pattern' src/
95
-
96
- # Search with glob filter
97
- sg -p 'pattern' --include '*.ts'
98
-
99
- # Show context lines
100
- sg -p 'pattern' -A 3 # 3 lines after
101
- sg -p 'pattern' -B 3 # 3 lines before
102
- sg -p 'pattern' -C 3 # 3 lines before and after
103
-
104
- # List matching files only
105
- sg -p 'pattern' --json | jq -r '.[].file' | sort -u
106
-
107
- # Count matches
108
- sg -p 'pattern' | wc -l
109
-
110
- # Interactive selection (fuzzy picker)
111
- sg -p 'pattern' --interactive
112
- ```
113
-
114
- ## Common Patterns
115
-
116
- ### Find all call sites of a function
117
-
118
- ```bash
119
- # Who calls `processPayment`?
120
- sg -p 'processPayment($ARGS)'
121
-
122
- # Who calls `console.log`?
123
- sg -p 'console.log($ARGS)'
124
-
125
- # Who calls any method on `db`?
126
- sg -p 'db.$METHOD($ARGS)'
127
- ```
128
-
129
- ### Find function/method definitions
130
-
131
- ```bash
132
- # All async function definitions
133
- sg -p 'async function $NAME($PARAMS) { ... }'
134
-
135
- # All method definitions in a class (TS)
136
- sg -p '$VISIBILITY $NAME($PARAMS) { ... }' -l ts
137
-
138
- # All arrow functions assigned to const
139
- sg -p 'const $NAME = ($PARAMS) => $BODY'
140
- ```
141
-
142
- ### Find imports
143
-
144
- ```bash
145
- # Default import from specific module
146
- sg -p 'import $X from "lodash"'
147
-
148
- # Named imports
149
- sg -p 'import { $NAMES } from "react"'
150
-
151
- # Any import from a module
152
- sg -p 'import * from "axios"'
153
-
154
- # Dynamic imports
155
- sg -p 'import($MODULE)'
156
- ```
157
-
158
- ### Find class definitions
159
-
160
- ```bash
161
- # All class definitions
162
- sg -p 'class $NAME { ... }'
163
-
164
- # Classes extending a specific base
165
- sg -p 'class $NAME extends Error { ... }'
166
-
167
- # Classes with specific decorator
168
- sg -p '@$DECORATOR(...) class $NAME { ... }'
169
- ```
170
-
171
- ### Find specific patterns
172
-
173
- ```bash
174
- # All try-catch blocks
175
- sg -p 'try { ... } catch ($E) { ... }'
176
-
177
- # All useEffect calls (React)
178
- sg -p 'useEffect(() => { ... }, [$DEPS])'
179
-
180
- # All await expressions
181
- sg -p 'await $EXPR'
182
-
183
- # All error throws
184
- sg -p 'throw new $ERR($ARGS)'
185
-
186
- # All object destructuring
187
- sg -p 'const { $PROPS } = $OBJ'
188
- ```
189
-
190
- ### Find and replace (codemods)
191
-
192
- ```bash
193
- # Preview rewrite (dry run)
194
- sg -p 'oldPattern($X)' --rewrite 'newPattern($X)' --dry-run
195
-
196
- # Execute rewrite
197
- sg -p 'oldPattern($X)' --rewrite 'newPattern($X)'
198
-
199
- # Rewrite with language explicit
200
- sg -p 'console.log($MSG)' --rewrite 'logger.info($MSG)' -l ts
201
-
202
- # Rewrite across project using rules (see sgconfig.yml below)
203
- sg scan
204
- ```
205
-
206
- ## Project Rules with sgconfig.yml
207
-
208
- For project-wide pattern enforcement, create `sgconfig.yml` at project root:
209
-
210
- ```yaml
211
- # sgconfig.yml
212
- ruleDirs:
213
- - .sg/rules
214
- ```
215
-
216
- Then create rule files in `.sg/rules/`:
217
-
218
- ```yaml
219
- # .sg/rules/no-console-log.yml
220
- id: no-console-log
221
- language: TypeScript
222
- severity: warning
223
- rule:
224
- pattern: console.log($ARGS)
225
- fix: logger.debug($ARGS)
226
- message: "Use logger.debug instead of console.log"
227
- ```
228
-
229
- ```yaml
230
- # .sg/rules/require-await.yml
231
- id: no-floating-promises
232
- language: TypeScript
233
- severity: error
234
- rule:
235
- pattern: $FUNC($ARGS)
236
- not:
237
- pattern: await $FUNC($ARGS)
238
- inside:
239
- kind: function_declaration
240
- stopBy: end
241
- message: "Promise returned by $FUNC is not awaited"
242
- ```
243
-
244
- ```yaml
245
- # .sg/rules/no-any.yml
246
- id: no-explicit-any
247
- language: TypeScript
248
- severity: warning
249
- rule:
250
- pattern: any
251
- message: "Avoid using 'any' type — use unknown or a specific type"
252
- ```
253
-
254
- Run rules:
255
-
256
- ```bash
257
- # Scan all rules in sgconfig.yml
258
- sg scan
259
-
260
- # Scan specific rule
261
- sg scan --rule .sg/rules/no-console-log.yml
262
-
263
- # Scan specific directory
264
- sg scan src/
265
- ```
266
-
267
- ### Rule Structure
268
-
269
- Every rule file is YAML with these fields:
270
-
271
- | Field | Required | Purpose |
272
- |-------|----------|---------|
273
- | `id` | Yes | Unique rule identifier (kebab-case) |
274
- | `language` | Yes | Language to match (TypeScript, Python, Go, etc.) |
275
- | `severity` | Yes | `error`, `warning`, `hint`, `info` |
276
- | `rule` | Yes | The pattern to match (supports `pattern`, `not`, `inside`, `has`, `follows`, `all`, `any`) |
277
- | `message` | Yes | Human-readable explanation |
278
- | `fix` | No | Rewrite template (uses same metavariables) |
279
-
280
- ### Composite Rule Matchers
281
-
282
- ```yaml
283
- # Match ALL conditions
284
- rule:
285
- all:
286
- - pattern: console.log($X)
287
- - inside:
288
- kind: function_declaration
289
-
290
- # Match ANY condition
291
- rule:
292
- any:
293
- - pattern: console.log($X)
294
- - pattern: console.warn($X)
295
-
296
- # Exclude matches
297
- rule:
298
- pattern: fetch($URL)
299
- not:
300
- pattern: fetch($URL, { init: $INIT })
301
-
302
- # Must be inside specific AST node
303
- rule:
304
- pattern: $CALL($ARGS)
305
- inside:
306
- kind: try_statement
307
-
308
- # Must follow another pattern
309
- rule:
310
- pattern: $X.close()
311
- follows:
312
- pattern: $X.open()
47
+ sg -p 'console.log($$$ARGS)' -l ts src/
48
+ sg -p 'import { $NAMES } from $PATH' -l go
49
+ sg -p 'pattern' --rewrite 'replacement' --dry-run
50
+ sg scan # only when the target repo defines sg rules (not a harness default)
313
51
  ```
314
52
 
315
53
  ## Search Decision Flow
316
54
 
317
- ```
55
+ ```text
318
56
  Need to find code
319
- ├─ Structural pattern (function calls, imports, classes)? → sg -p 'pattern'
320
- ├─ Rewrite/codemod needed? → sg -p 'old' --rewrite 'new'
321
- ├─ Project-wide lint rule? → sg scan (with sgconfig.yml)
322
- ├─ Conceptual/semantic search? → graphify query (architecture) or ccc search (implementation)
323
- ├─ Explore architecture? → graphify
324
- └─ Exact literal string in non-code? → grep
57
+ ├─ Definition, references, type, symbol? → lsp_navigation
58
+ ├─ Diagnostics? → lsp_diagnostics
59
+ ├─ Structural pattern? → sg -p 'pattern'
60
+ ├─ Rewrite/codemod? → sg --rewrite
61
+ ├─ Conceptual search? → graphify query or ccc search
62
+ ├─ Architecture gate? → Sentrux
63
+ └─ Exact literal in logs/text? → grep
325
64
  ```
326
65
 
327
- ## Output Formats
328
-
329
- ```bash
330
- # Default (grep-compatible): file:line:column: match
331
- sg -p 'pattern'
332
-
333
- # JSON (for piping/automation)
334
- sg -p 'pattern' --json
335
-
336
- # Only file paths (deduplicated)
337
- sg -p 'pattern' --json | jq -r '.[].file' | sort -u
338
- ```
339
-
340
- ## Tips
341
-
342
- - **Metavariables are greedy by default.** `$X` matches the smallest valid AST node. Use `$$$X` to match multiple nodes.
343
- - **`...` matches zero or more.** Inside function body `{ ... }` matches any statements. In call args `fn(...)` matches any number of arguments.
344
- - **Pattern must be valid code for the target language.** `sg` parses the pattern itself as AST.
345
- - **Use `--json` for automation.** Parse results programmatically instead of grepping output.
346
- - **Combine with find for scoped searches.** `find src/ -name '*.ts' -exec sg -p 'pattern' {} +`
347
- - **Rules compose.** Multiple rules in `sgconfig.yml` run together with `sg scan`.
348
-
349
66
  ## Integration with Pi Workflow
350
67
 
351
- 1. **Before grep on code files** — consider if `sg -p` would be more precise.
352
- 2. **After graphify identifies a node** — use `sg` to find all call sites or definitions.
353
- 3. **For refactoring tasks** — use `sg -p ... --rewrite ...` for safe structural rewrites.
354
- 4. **For code review** — run `sg scan` with project rules to catch anti-patterns.
68
+ 1. **Graph before grep** — graphify for architecture first.
69
+ 2. **LSP before sg for code intelligence** — definitions, references, types.
70
+ 3. **sg before grep on code** — structural patterns use AST matching.
71
+ 4. **Project rules live in the target repo** — do not assume `.sg/rules/` from harness setup; Sentrux + project linters own gates.
72
+
73
+ Debug patterns: https://ast-grep.github.io/playground.html
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: debugging-discipline
3
+ description: Debug systematically instead of guessing. Use when fixing bugs, failing tests, flaky behavior, runtime errors, regressions, or unexpected output. Guides reproduction, isolation, hypotheses, evidence, one-variable changes, root cause, and regression tests.
4
+ ---
5
+
6
+ # Debugging Discipline
7
+
8
+ Use this skill for bug-fix tasks and failing verification.
9
+
10
+ ## Workflow
11
+
12
+ 1. Reproduce or precisely describe the failure.
13
+ 2. Capture the expected behavior and actual behavior.
14
+ 3. Identify the smallest failing path or input.
15
+ 4. Form one hypothesis from evidence.
16
+ 5. Inspect code/data/logs that can confirm or reject the hypothesis.
17
+ 6. Change one variable at a time.
18
+ 7. Fix root cause, not just the visible symptom.
19
+ 8. Add a regression test or equivalent guard.
20
+ 9. Re-run the failing check and relevant adjacent checks.
21
+
22
+ ## Evidence to collect
23
+
24
+ - failing assertion or error
25
+ - inputs and state
26
+ - recent changes
27
+ - boundary/edge conditions
28
+ - logs with sensitive data redacted
29
+ - dependency/environment differences
30
+
31
+ ## Avoid
32
+
33
+ - Random edits before reproduction.
34
+ - Explaining away failures without evidence.
35
+ - Masking errors by broad catch/ignore logic.
36
+ - Declaring fixed without rerunning the failing path.
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: documentation-update
3
+ description: Update documentation only where it helps future work. Use when behavior, setup, contracts, commands, architecture decisions, operational procedures, or user-facing workflows change. Avoids redundant comments while capturing decisions, invariants, examples, and caveats near the relevant surface.
4
+ ---
5
+
6
+ # Documentation Update
7
+
8
+ Use this skill when code changes affect how people or agents should use, operate, or maintain the system.
9
+
10
+ ## What to document
11
+
12
+ - public contracts and compatibility notes
13
+ - behavior changes and examples
14
+ - setup/configuration changes
15
+ - operational caveats and failure modes
16
+ - invariants not obvious from code
17
+ - design decisions and rejected alternatives
18
+ - migration or rollback procedures
19
+
20
+ ## Workflow
21
+
22
+ 1. Identify who needs the documentation: user, maintainer, operator, integrator, or future agent.
23
+ 2. Update the nearest authoritative doc rather than creating duplicates.
24
+ 3. Keep examples current and minimal.
25
+ 4. Remove or correct stale docs when behavior changes.
26
+ 5. Prefer comments for local non-obvious why; prefer docs for broader usage or process.
27
+ 6. Verify links, commands, and paths when practical.
28
+
29
+ ## Avoid
30
+
31
+ - Comments that merely restate obvious code.
32
+ - New docs that duplicate existing sources of truth.
33
+ - Documentation promises not enforced by tests or code.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: requirements-to-implementation
3
+ description: Translate vague or high-level requests into safe implementation steps. Use before coding features, bug fixes, refactors, or ambiguous tasks. Extracts requirements, constraints, done criteria, non-goals, risk, and the smallest viable implementation path.
4
+ ---
5
+
6
+ # Requirements to Implementation
7
+
8
+ Use this skill to prevent solving the wrong problem.
9
+
10
+ ## Workflow
11
+
12
+ 1. Restate the user objective in concrete behavior terms.
13
+ 2. Separate explicit requirements from assumptions.
14
+ 3. Inspect repo conventions and relevant existing behavior before choosing an approach.
15
+ 4. Identify constraints: compatibility, data, security, performance, architecture, tests, and delivery risk.
16
+ 5. Define done criteria and non-goals.
17
+ 6. Pick the smallest implementation path that satisfies the request.
18
+ 7. Ask the user when scope, risk, destructive action, or irreversible behavior is ambiguous.
19
+
20
+ ## Implementation prompt
21
+
22
+ Before editing, answer:
23
+
24
+ - What behavior changes?
25
+ - What behavior must not change?
26
+ - Which files/contracts are likely affected?
27
+ - What verification proves completion?
28
+ - What would be overreach?
29
+
30
+ ## Avoid
31
+
32
+ - Treating examples as exhaustive requirements without checking.
33
+ - Inventing product behavior not requested or present in code.
34
+ - Starting with a broad redesign when a local change suffices.
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: risk-based-verification
3
+ description: Match verification depth to change risk. Use after code, test, config, dependency, data, or docs changes. Helps agents choose targeted checks for low risk, broader checks for medium/high risk, and report unverified residual risk clearly.
4
+ ---
5
+
6
+ # Risk-Based Verification
7
+
8
+ Use this skill to verify enough without wasting effort or claiming false confidence.
9
+
10
+ ## Risk levels
11
+
12
+ Low risk:
13
+ - small local change
14
+ - no public contract or data change
15
+ - existing tests cover area
16
+ - reversible
17
+
18
+ Medium risk:
19
+ - multiple files or boundaries
20
+ - new branch/error path
21
+ - test coverage uncertain
22
+ - behavior visible to users or other modules
23
+
24
+ High risk:
25
+ - data migration or destructive operation
26
+ - security/privacy/auth change
27
+ - dependency/runtime upgrade
28
+ - concurrency/distributed behavior
29
+ - public contract or compatibility change
30
+
31
+ ## Verification choices
32
+
33
+ - Low: targeted unit test, focused lint/type/build check, or direct script/example.
34
+ - Medium: affected test suite, integration/contract check, diff review, edge-case tests.
35
+ - High: broad test suite, migration/rollback validation, security review, performance check, manual approval when needed.
36
+
37
+ ## Final report
38
+
39
+ Always state:
40
+
41
+ - checks run
42
+ - checks not run
43
+ - why verification is sufficient or what risk remains