ultimate-pi 0.18.1 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. package/.agents/skills/harness-debate-plan/SKILL.md +1 -1
  2. package/.agents/skills/harness-decisions/SKILL.md +1 -2
  3. package/.agents/skills/harness-governor/SKILL.md +6 -5
  4. package/.agents/skills/web-retrieval/SKILL.md +163 -0
  5. package/.agents/skills/wiki-autoresearch/SKILL.md +6 -6
  6. package/.pi/PACKAGING.md +4 -4
  7. package/.pi/SYSTEM.md +75 -123
  8. package/.pi/agents/harness/incident-recorder.md +0 -1
  9. package/.pi/agents/harness/planning/decompose.md +0 -2
  10. package/.pi/agents/harness/planning/execution-plan-author.md +0 -2
  11. package/.pi/agents/harness/planning/hypothesis-validator.md +0 -2
  12. package/.pi/agents/harness/planning/hypothesis.md +0 -2
  13. package/.pi/agents/harness/planning/implementation-researcher.md +1 -3
  14. package/.pi/agents/harness/planning/plan-adversary.md +0 -2
  15. package/.pi/agents/harness/planning/plan-evaluator.md +1 -3
  16. package/.pi/agents/harness/planning/planning-context.md +0 -2
  17. package/.pi/agents/harness/planning/review-integrator.md +0 -2
  18. package/.pi/agents/harness/planning/sprint-contract-auditor.md +0 -2
  19. package/.pi/agents/harness/planning/stack-researcher.md +5 -3
  20. package/.pi/agents/harness/reviewing/adversary.md +0 -2
  21. package/.pi/agents/harness/reviewing/evaluator.md +0 -2
  22. package/.pi/agents/harness/reviewing/tie-breaker.md +0 -2
  23. package/.pi/agents/harness/running/executor.md +0 -2
  24. package/.pi/agents/harness/sentrux-bootstrap.md +0 -1
  25. package/.pi/agents/harness/sentrux-steward.md +0 -2
  26. package/.pi/agents/harness/trace-librarian.md +0 -1
  27. package/.pi/agents/harness/web-retrieval/web-answerer.md +35 -0
  28. package/.pi/agents/harness/web-retrieval/web-criteria-verifier.md +28 -0
  29. package/.pi/agents/harness/web-retrieval/web-gap-analyzer.md +31 -0
  30. package/.pi/agents/harness/web-retrieval/web-query-expander-fast.md +34 -0
  31. package/.pi/agents/harness/web-retrieval/web-query-expander.md +60 -0
  32. package/.pi/agents/harness/web-retrieval/web-summarizer.md +18 -0
  33. package/.pi/extensions/agt-kill-switch.ts +57 -0
  34. package/.pi/extensions/agt-prompt-guard.ts +32 -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 +6 -6
  39. package/.pi/extensions/harness-ask-user.ts +7 -7
  40. package/.pi/extensions/harness-debate-tools.ts +26 -42
  41. package/.pi/extensions/harness-lens.ts +94 -0
  42. package/.pi/extensions/harness-plan-approval.ts +11 -11
  43. package/.pi/extensions/harness-run-context.ts +1070 -876
  44. package/.pi/extensions/harness-subagent-governance.ts +8 -0
  45. package/.pi/extensions/harness-subagent-submit.ts +34 -163
  46. package/.pi/extensions/harness-subagents.ts +3 -3
  47. package/.pi/extensions/harness-telemetry.ts +2 -2
  48. package/.pi/extensions/harness-web-guard.ts +2 -1
  49. package/.pi/extensions/harness-web-tools.ts +691 -53
  50. package/.pi/extensions/policy-gate.ts +25 -5
  51. package/.pi/extensions/sentrux-rules-sync.ts +1 -1
  52. package/.pi/extensions/subagent-governance.ts +92 -0
  53. package/.pi/extensions/trace-recorder.ts +1 -1
  54. package/.pi/extensions/{ultimate-pi-vcc.ts → vcc-compaction.ts} +1 -1
  55. package/.pi/harness/README.md +6 -2
  56. package/.pi/harness/agents.manifest.json +46 -25
  57. package/.pi/harness/agents.policy.yaml +309 -0
  58. package/.pi/harness/docs/adrs/0030-inhouse-vcc-compaction.md +1 -1
  59. package/.pi/harness/docs/adrs/0035-plan-phase-review-gate.md +1 -1
  60. package/.pi/harness/docs/adrs/0045-harness-lens-minimal-contract.md +49 -0
  61. package/.pi/harness/docs/adrs/0046-agt-policy-engine.md +51 -0
  62. package/.pi/harness/docs/adrs/0047-agt-layered-security.md +39 -0
  63. package/.pi/harness/docs/adrs/0048-tool-call-hook-order.md +25 -0
  64. package/.pi/harness/docs/adrs/0049-agents-policy-manifest.md +36 -0
  65. package/.pi/harness/docs/adrs/0050-agentic-web-retrieval-stack.md +46 -0
  66. package/.pi/harness/docs/adrs/README.md +5 -0
  67. package/.pi/harness/docs/harness-web-search.md +97 -0
  68. package/.pi/harness/env.harness.template +9 -1
  69. package/.pi/harness/evolution/README.md +1 -2
  70. package/.pi/harness/examples/agents.policy.project.yaml +19 -0
  71. package/.pi/harness/examples/policies/custom-deny-bash.yaml +9 -0
  72. package/.pi/harness/examples/web-heuristic-angles.project.yaml +22 -0
  73. package/.pi/harness/policies/bash-denylists.yaml +5 -0
  74. package/.pi/harness/policies/defaults.yaml +51 -0
  75. package/.pi/harness/policies/orchestrator.yaml +18 -0
  76. package/.pi/harness/policies/phases.yaml +10 -0
  77. package/.pi/harness/policies/roles.yaml +5 -0
  78. package/.pi/harness/policies/web-guard.yaml +5 -0
  79. package/.pi/harness/policies/workflow-sequences.yaml +9 -0
  80. package/.pi/harness/sentrux/architecture.manifest.json +26 -4
  81. package/.pi/harness/specs/observation.schema.json +2 -1
  82. package/.pi/harness/web-heuristic-angles.json +278 -0
  83. package/.pi/harness/web-heuristic-angles.yaml +182 -0
  84. package/.pi/lib/agents-policy.d.mts +70 -0
  85. package/.pi/lib/agents-policy.mjs +331 -0
  86. package/.pi/lib/agents-policy.ts +19 -0
  87. package/.pi/lib/agt/audit-run-sink.ts +52 -0
  88. package/.pi/lib/agt/build-evaluation-context.ts +285 -0
  89. package/.pi/lib/agt/config.ts +28 -0
  90. package/.pi/lib/agt/delegation.ts +69 -0
  91. package/.pi/lib/agt/evaluate-policy.ts +56 -0
  92. package/.pi/lib/agt/identity-registry.ts +41 -0
  93. package/.pi/lib/agt/index.ts +55 -0
  94. package/.pi/lib/agt/kill-switch-state.ts +11 -0
  95. package/.pi/lib/agt/legacy-evaluate.ts +101 -0
  96. package/.pi/lib/agt/policy-engine.ts +154 -0
  97. package/.pi/lib/agt/rings.ts +21 -0
  98. package/.pi/lib/agt/sre-hooks.ts +45 -0
  99. package/.pi/lib/agt/trust-run-store.ts +26 -0
  100. package/.pi/lib/agt/workflow-history.ts +29 -0
  101. package/.pi/lib/agt-governance-active.ts +14 -0
  102. package/.pi/lib/agt-tool-guard.ts +78 -0
  103. package/.pi/lib/ask-user/dialog.ts +314 -0
  104. package/.pi/{extensions/lib → lib}/debate-bus-core.ts +10 -10
  105. package/.pi/{extensions/lib → lib}/debate-bus-state.ts +1 -1
  106. package/.pi/{extensions/lib → lib}/extension-load-guard.ts +13 -2
  107. package/.pi/lib/harness-agt-tool-guard.ts +5 -0
  108. package/.pi/{extensions/lib → lib}/harness-artifact-gate.ts +1 -1
  109. package/.pi/lib/harness-debate-core-deps.ts +14 -0
  110. package/.pi/lib/harness-debate-workflow-deps.ts +43 -0
  111. package/.pi/lib/harness-lens/.gitattributes +1 -0
  112. package/.pi/lib/harness-lens/clients/edit-autopatch.ts +88 -0
  113. package/.pi/lib/harness-lens/clients/file-kinds.ts +380 -0
  114. package/.pi/lib/harness-lens/clients/file-time.ts +215 -0
  115. package/.pi/lib/harness-lens/clients/file-utils.ts +484 -0
  116. package/.pi/lib/harness-lens/clients/format-service.ts +276 -0
  117. package/.pi/lib/harness-lens/clients/formatters.ts +1000 -0
  118. package/.pi/lib/harness-lens/clients/git-guard.ts +31 -0
  119. package/.pi/lib/harness-lens/clients/indent-retarget.ts +90 -0
  120. package/.pi/lib/harness-lens/clients/installer/index.ts +2368 -0
  121. package/.pi/lib/harness-lens/clients/latency-logger.ts +80 -0
  122. package/.pi/lib/harness-lens/clients/lens-config.ts +43 -0
  123. package/.pi/lib/harness-lens/clients/lens-events.ts +164 -0
  124. package/.pi/lib/harness-lens/clients/lsp/aggregation.ts +91 -0
  125. package/.pi/lib/harness-lens/clients/lsp/client.ts +1466 -0
  126. package/.pi/lib/harness-lens/clients/lsp/config.ts +216 -0
  127. package/.pi/lib/harness-lens/clients/lsp/edits.ts +297 -0
  128. package/.pi/lib/harness-lens/clients/lsp/index.ts +1355 -0
  129. package/.pi/lib/harness-lens/clients/lsp/interactive-install.ts +424 -0
  130. package/.pi/lib/harness-lens/clients/lsp/language.ts +223 -0
  131. package/.pi/lib/harness-lens/clients/lsp/launch.ts +939 -0
  132. package/.pi/lib/harness-lens/clients/lsp/lsp-index.ts +11 -0
  133. package/.pi/lib/harness-lens/clients/lsp/path-utils.ts +12 -0
  134. package/.pi/lib/harness-lens/clients/lsp/server-strategies.ts +81 -0
  135. package/.pi/lib/harness-lens/clients/lsp/server.ts +1971 -0
  136. package/.pi/lib/harness-lens/clients/path-utils.ts +182 -0
  137. package/.pi/lib/harness-lens/clients/pipeline.ts +360 -0
  138. package/.pi/lib/harness-lens/clients/project-profile.ts +117 -0
  139. package/.pi/lib/harness-lens/clients/runtime-agent-end.ts +112 -0
  140. package/.pi/lib/harness-lens/clients/runtime-config.ts +33 -0
  141. package/.pi/lib/harness-lens/clients/runtime-coordinator.ts +186 -0
  142. package/.pi/lib/harness-lens/clients/runtime-tool-result.ts +171 -0
  143. package/.pi/lib/harness-lens/clients/safe-spawn.ts +339 -0
  144. package/.pi/lib/harness-lens/clients/secrets-scanner.ts +214 -0
  145. package/.pi/lib/harness-lens/clients/tool-policy.ts +2072 -0
  146. package/.pi/lib/harness-lens/clients/types.ts +59 -0
  147. package/.pi/lib/harness-lens/clients/widget-state.ts +283 -0
  148. package/.pi/lib/harness-lens/index.ts +532 -0
  149. package/.pi/lib/harness-lens/tools/lsp-diagnostics.ts +706 -0
  150. package/.pi/lib/harness-lens/tools/lsp-navigation.ts +1246 -0
  151. package/.pi/{extensions/lib → lib}/harness-posthog.ts +3 -0
  152. package/.pi/lib/harness-run-context-responses.ts +9 -0
  153. package/.pi/lib/harness-run-context.ts +0 -2
  154. package/.pi/{extensions/lib/spawn-policy.ts → lib/harness-spawn-policy.ts} +1 -0
  155. package/.pi/{extensions/lib → lib}/harness-spawn-topology.ts +1 -1
  156. package/.pi/lib/harness-subagent-auth.ts +81 -0
  157. package/.pi/{extensions/lib → lib}/harness-subagent-precheck.ts +10 -7
  158. package/.pi/{extensions/lib → lib}/harness-subagent-submit-pipeline.ts +3 -3
  159. package/.pi/lib/harness-subagent-submit-register.ts +163 -0
  160. package/.pi/{extensions/lib → lib}/harness-subagent-submit-registry.ts +1 -37
  161. package/.pi/{extensions/lib → lib}/harness-subagents-bridge.ts +74 -14
  162. package/.pi/{extensions/lib → lib}/harness-subprocess-bootstrap.ts +1 -1
  163. package/.pi/lib/harness-web/artifacts.ts +200 -0
  164. package/.pi/lib/harness-web/cache.ts +369 -0
  165. package/.pi/{extensions/lib → lib}/harness-web/run-cli.ts +42 -2
  166. package/.pi/{extensions/lib → lib}/plan-approval/create-plan.ts +2 -2
  167. package/.pi/{extensions/lib → lib}/plan-approval/format-plan.ts +2 -2
  168. package/.pi/{extensions/lib → lib}/plan-approval/plan-review.ts +162 -201
  169. package/.pi/{extensions/lib → lib}/plan-approval/render.ts +1 -1
  170. package/.pi/{extensions/lib → lib}/plan-approval/resolve-disk.ts +2 -2
  171. package/.pi/{extensions/lib → lib}/plan-approval/types.ts +1 -1
  172. package/.pi/{extensions/lib → lib}/plan-approval/validate.ts +3 -3
  173. package/.pi/{extensions/lib → lib}/plan-debate-envelope.ts +1 -1
  174. package/.pi/{extensions/lib → lib}/plan-debate-gate.ts +1 -1
  175. package/.pi/{extensions/lib → lib}/plan-debate-lane.ts +1 -4
  176. package/.pi/{extensions/lib → lib}/plan-messenger.ts +1 -1
  177. package/.pi/prompts/harness-plan.md +2 -1
  178. package/.pi/prompts/harness-setup.md +40 -65
  179. package/.pi/scripts/README.md +2 -5
  180. package/.pi/scripts/gen-web-heuristic-angles-json.mjs +24 -0
  181. package/.pi/scripts/generate-agents-policy-yaml.mjs +148 -0
  182. package/.pi/scripts/harness-agents-manifest.mjs +60 -3
  183. package/.pi/scripts/harness-agt-doctor.ts +36 -0
  184. package/.pi/scripts/harness-cli-verify.sh +14 -2
  185. package/.pi/scripts/harness-verify.mjs +191 -39
  186. package/.pi/scripts/harness-web-policy-guard.mjs +3 -3
  187. package/.pi/scripts/harness-web.py +218 -15
  188. package/.pi/scripts/harness_web/deep_search.py +55 -0
  189. package/.pi/scripts/harness_web/evidence_bundle.py +47 -0
  190. package/.pi/scripts/harness_web/find_similar.py +88 -0
  191. package/.pi/scripts/harness_web/heuristic_angles_shipped.py +85 -0
  192. package/.pi/scripts/harness_web/heuristic_config.py +251 -0
  193. package/.pi/scripts/harness_web/highlights.py +47 -0
  194. package/.pi/scripts/harness_web/multi_search.py +59 -0
  195. package/.pi/scripts/harness_web/output.py +24 -0
  196. package/.pi/scripts/harness_web/query_angles.py +116 -0
  197. package/.pi/scripts/harness_web/rank.py +163 -0
  198. package/.pi/scripts/harness_web/scrape.py +30 -0
  199. package/.pi/scripts/tests/test_harness_web_heuristic_config.py +132 -0
  200. package/.pi/scripts/tests/test_harness_web_query_angles.py +45 -0
  201. package/.pi/scripts/tests/test_harness_web_rank.py +56 -0
  202. package/.pi/scripts/validate-plan-dag.mjs +65 -74
  203. package/.pi/scripts/vendor-pi-vcc-settings.stub.ts +2 -2
  204. package/.pi/scripts/vendor-sync-pi-vcc.sh +1 -1
  205. package/.pi/skills/architecture/broker-domain/SKILL.md +65 -0
  206. package/.pi/skills/architecture/cqrs/SKILL.md +63 -0
  207. package/.pi/skills/architecture/event-driven/SKILL.md +60 -0
  208. package/.pi/skills/architecture/hexagonal-ports-adapters/SKILL.md +66 -0
  209. package/.pi/skills/architecture/layered/SKILL.md +68 -0
  210. package/.pi/skills/architecture/microkernel/SKILL.md +62 -0
  211. package/.pi/skills/architecture/microservices/SKILL.md +64 -0
  212. package/.pi/skills/architecture/modular-monolith/SKILL.md +65 -0
  213. package/.pi/skills/architecture/orchestration-driven-soa/SKILL.md +61 -0
  214. package/.pi/skills/architecture/pipeline/SKILL.md +63 -0
  215. package/.pi/skills/architecture/service-based/SKILL.md +64 -0
  216. package/.pi/skills/architecture/service-mesh/SKILL.md +60 -0
  217. package/.pi/skills/architecture/space-based/SKILL.md +60 -0
  218. package/.pi/skills/ast-grep/SKILL.md +40 -321
  219. package/.pi/skills/delivery/debugging-discipline/SKILL.md +36 -0
  220. package/.pi/skills/delivery/documentation-update/SKILL.md +33 -0
  221. package/.pi/skills/delivery/requirements-to-implementation/SKILL.md +34 -0
  222. package/.pi/skills/delivery/risk-based-verification/SKILL.md +43 -0
  223. package/.pi/skills/delivery/tradeoff-analysis/SKILL.md +34 -0
  224. package/.pi/skills/engineering/api-contract-design/SKILL.md +38 -0
  225. package/.pi/skills/engineering/cohesion-coupling/SKILL.md +43 -0
  226. package/.pi/skills/engineering/complexity-control/SKILL.md +31 -0
  227. package/.pi/skills/engineering/defensive-programming/SKILL.md +38 -0
  228. package/.pi/skills/engineering/dependency-management/SKILL.md +29 -0
  229. package/.pi/skills/engineering/domain-modeling/SKILL.md +32 -0
  230. package/.pi/skills/engineering/error-handling/SKILL.md +37 -0
  231. package/.pi/skills/engineering/legacy-code-seams/SKILL.md +35 -0
  232. package/.pi/skills/engineering/naming-and-intent/SKILL.md +29 -0
  233. package/.pi/skills/engineering/refactoring-safe-evolution/SKILL.md +35 -0
  234. package/.pi/skills/engineering/routine-function-design/SKILL.md +34 -0
  235. package/.pi/skills/engineering/small-change-discipline/SKILL.md +35 -0
  236. package/.pi/skills/lsp-navigation/SKILL.md +89 -0
  237. package/.pi/skills/quality/code-review-self-check/SKILL.md +35 -0
  238. package/.pi/skills/quality/privacy-data-handling/SKILL.md +26 -0
  239. package/.pi/skills/quality/security-review/SKILL.md +34 -0
  240. package/.pi/skills/quality/test-strategy/SKILL.md +33 -0
  241. package/.pi/skills/quality/testability-design/SKILL.md +33 -0
  242. package/.pi/skills/systems/concurrency-safety/SKILL.md +32 -0
  243. package/.pi/skills/systems/data-modeling-migrations/SKILL.md +31 -0
  244. package/.pi/skills/systems/observability-instrumentation/SKILL.md +32 -0
  245. package/.pi/skills/systems/performance-measurement/SKILL.md +35 -0
  246. package/.pi/skills/systems/reliability-design/SKILL.md +32 -0
  247. package/.sentrux/rules.toml +20 -4
  248. package/AGENTS.md +7 -2
  249. package/CHANGELOG.md +20 -0
  250. package/README.md +3 -12
  251. package/THIRD_PARTY_NOTICES.md +12 -21
  252. package/package.json +17 -7
  253. package/vendor/pi-subagents/src/agents.ts +45 -1
  254. package/vendor/pi-subagents/src/subagents.ts +866 -811
  255. package/vendor/pi-vcc/src/core/brief.ts +68 -99
  256. package/vendor/pi-vcc/src/core/settings.ts +2 -2
  257. package/.agents/skills/caveman/SKILL.md +0 -67
  258. package/.agents/skills/scrapling-web/SKILL.md +0 -98
  259. package/.pi/agents/harness/meta-optimizer.md +0 -36
  260. package/.pi/extensions/00-posthog-network-bootstrap.ts +0 -11
  261. package/.pi/extensions/lib/ask-user/dialog.ts +0 -260
  262. package/.pi/extensions/lib/harness-subagent-auth.ts +0 -207
  263. package/.pi/extensions/lib/harness-subagent-policy.ts +0 -236
  264. package/.pi/extensions/pi-model-router-harness.ts +0 -42
  265. package/.pi/harness/evolution/meta-optimizer.mjs +0 -99
  266. package/.pi/harness/specs/router-tuning-proposal.schema.json +0 -114
  267. package/.pi/model-router.example.json +0 -36
  268. package/.pi/prompts/harness-critic.md +0 -10
  269. package/.pi/prompts/harness-eval.md +0 -10
  270. package/.pi/prompts/harness-router-tune.md +0 -52
  271. package/.pi/scripts/harness-generate-model-router.mjs +0 -327
  272. package/.pi/scripts/harness-model-router-routing.test.mjs +0 -97
  273. package/.pi/scripts/harness-sync-model-router.mjs +0 -97
  274. package/.pi/scripts/harness_web/__pycache__/__init__.cpython-314.pyc +0 -0
  275. package/.pi/scripts/harness_web/__pycache__/config.cpython-314.pyc +0 -0
  276. package/.pi/scripts/harness_web/__pycache__/output.cpython-314.pyc +0 -0
  277. package/.pi/scripts/harness_web/__pycache__/scrape.cpython-314.pyc +0 -0
  278. package/.pi/scripts/harness_web/__pycache__/search.cpython-314.pyc +0 -0
  279. package/.pi/scripts/harness_web/__pycache__/search_ddg.cpython-314.pyc +0 -0
  280. package/.pi/scripts/harness_web/__pycache__/search_searxng.cpython-314.pyc +0 -0
  281. package/.pi/scripts/vendor-sync-pi-model-router.sh +0 -47
  282. package/vendor/pi-model-router/.prettierignore +0 -4
  283. package/vendor/pi-model-router/.prettierrc +0 -5
  284. package/vendor/pi-model-router/AGENTS.md +0 -39
  285. package/vendor/pi-model-router/LICENSE +0 -21
  286. package/vendor/pi-model-router/README.md +0 -99
  287. package/vendor/pi-model-router/UPSTREAM_PIN.md +0 -10
  288. package/vendor/pi-model-router/docs/ARCHITECTURE.md +0 -54
  289. package/vendor/pi-model-router/extensions/commands.ts +0 -720
  290. package/vendor/pi-model-router/extensions/config.ts +0 -348
  291. package/vendor/pi-model-router/extensions/constants.ts +0 -1
  292. package/vendor/pi-model-router/extensions/index.ts +0 -478
  293. package/vendor/pi-model-router/extensions/provider.ts +0 -580
  294. package/vendor/pi-model-router/extensions/routing.ts +0 -564
  295. package/vendor/pi-model-router/extensions/state.ts +0 -52
  296. package/vendor/pi-model-router/extensions/types.ts +0 -95
  297. package/vendor/pi-model-router/extensions/ui.ts +0 -144
  298. package/vendor/pi-model-router/model-router.example.json +0 -48
  299. package/vendor/pi-model-router/package.json +0 -48
  300. package/vendor/pi-model-router/tsconfig.json +0 -16
  301. /package/.pi/{prompts → harness/docs}/planning-rubrics.md +0 -0
  302. /package/.pi/{extensions/lib → lib}/ask-user/fallback.ts +0 -0
  303. /package/.pi/{extensions/lib → lib}/ask-user/render.ts +0 -0
  304. /package/.pi/{extensions/lib → lib}/ask-user/schema.ts +0 -0
  305. /package/.pi/{extensions/lib → lib}/ask-user/types.ts +0 -0
  306. /package/.pi/{extensions/lib → lib}/ask-user/validate-core.mjs +0 -0
  307. /package/.pi/{extensions/lib → lib}/ask-user/validate.ts +0 -0
  308. /package/.pi/{extensions/lib → lib}/harness-cocoindex-refresh.ts +0 -0
  309. /package/.pi/{extensions/lib → lib}/harness-paths.ts +0 -0
  310. /package/.pi/{extensions/lib → lib}/harness-spawn-budget.ts +0 -0
  311. /package/.pi/{extensions/lib → lib}/harness-vcc-settings.ts +0 -0
  312. /package/.pi/{extensions/lib → lib}/plan-approval/dialog.ts +0 -0
  313. /package/.pi/{extensions/lib → lib}/plan-approval/schema.ts +0 -0
  314. /package/.pi/{extensions/lib → lib}/plan-approval-readiness.ts +0 -0
  315. /package/.pi/{extensions/lib → lib}/plan-debate-eligibility.ts +0 -0
  316. /package/.pi/{extensions/lib → lib}/plan-debate-focus.ts +0 -0
  317. /package/.pi/{extensions/lib → lib}/plan-debate-id.ts +0 -0
  318. /package/.pi/{extensions/lib → lib}/plan-debate-lanes.ts +0 -0
  319. /package/.pi/{extensions/lib → lib}/plan-debate-round-status.ts +0 -0
  320. /package/.pi/{extensions/lib → lib}/plan-debate-write-guard.ts +0 -0
  321. /package/.pi/{extensions/lib → lib}/plan-review-gate.ts +0 -0
  322. /package/.pi/{extensions/lib → lib}/plan-review-integrator-rules.ts +0 -0
  323. /package/.pi/{extensions/lib → lib}/plan-scope-guard.ts +0 -0
  324. /package/.pi/{extensions/lib → lib}/posthog-client.ts +0 -0
  325. /package/.pi/{extensions/lib → lib}/posthog-node.d.ts +0 -0
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: complexity-control
3
+ description: Reduce accidental complexity while preserving essential behavior. Use when code becomes hard to reason about, branches multiply, abstractions feel premature, or a simple feature is spreading across many files. Focuses on explicitness, concept deduplication, and avoiding clever generic designs.
4
+ ---
5
+
6
+ # Complexity Control
7
+
8
+ Use this skill to make the simplest correct change.
9
+
10
+ ## Distinguish complexity types
11
+
12
+ - Essential complexity: required by the domain, correctness, scale, security, or compatibility.
13
+ - Accidental complexity: introduced by unclear structure, duplication, premature abstraction, hidden state, or over-generalization.
14
+
15
+ ## Workflow
16
+
17
+ 1. State the problem in one sentence.
18
+ 2. Identify the minimum concepts needed to solve it.
19
+ 3. Remove duplicate representations of the same concept.
20
+ 4. Prefer straightforward control flow over clever indirection.
21
+ 5. Add abstraction only after it clarifies repeated behavior or protects a real boundary.
22
+ 6. Document unavoidable complexity near the code that needs it.
23
+ 7. Verify that the final code has fewer paths a maintainer must simulate mentally.
24
+
25
+ ## Warning signs
26
+
27
+ - Generic names with no domain meaning.
28
+ - Configuration that controls unrelated behaviors.
29
+ - Multiple sources of truth.
30
+ - Deep nesting or long chains of callbacks/handlers/coordinators.
31
+ - Abstraction introduced for a single use without a clear boundary.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: defensive-programming
3
+ description: Add robustness at trust boundaries and failure-prone code paths. Use when handling external input, persistence, IO, configuration, user data, inter-process calls, events, commands, or invariants. Guides validation, explicit failures, diagnostics, and invalid-state prevention.
4
+ ---
5
+
6
+ # Defensive Programming
7
+
8
+ Use this skill when code must survive bad inputs, partial failures, or violated assumptions.
9
+
10
+ ## Boundary checks
11
+
12
+ Validate at trust boundaries:
13
+
14
+ - user or caller input
15
+ - configuration and environment
16
+ - serialized data
17
+ - storage reads
18
+ - network/process responses
19
+ - event/message payloads
20
+ - plugin or extension inputs
21
+
22
+ ## Workflow
23
+
24
+ 1. Identify trusted and untrusted data.
25
+ 2. State required invariants and preconditions.
26
+ 3. Normalize or reject invalid input at the boundary.
27
+ 4. Fail explicitly with useful diagnostics.
28
+ 5. Preserve causal context while avoiding secret leakage.
29
+ 6. Make invalid states unrepresentable where practical.
30
+ 7. Add tests for malformed, missing, boundary, and contradictory inputs.
31
+
32
+ ## Guidelines
33
+
34
+ - Do not silently coerce ambiguous data.
35
+ - Do not swallow errors without observability.
36
+ - Distinguish programmer errors from recoverable runtime errors.
37
+ - Prefer clear guard clauses over deeply nested defensive logic.
38
+ - Keep validation close to where trust changes.
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: dependency-management
3
+ description: Prevent dependency sprawl and risky coupling to third-party or shared code. Use when adding, upgrading, replacing, or wrapping dependencies, libraries, tools, plugins, shared utilities, or platform services. Encourages reuse, isolation, compatibility checks, and lockfile discipline.
4
+ ---
5
+
6
+ # Dependency Management
7
+
8
+ Use this skill before introducing or changing a dependency.
9
+
10
+ ## Decision workflow
11
+
12
+ 1. Check whether the project already has an equivalent dependency or local utility.
13
+ 2. Decide whether the task needs a dependency or simple local code is safer.
14
+ 3. Evaluate maintenance, license, security, size, compatibility, and operational risk.
15
+ 4. Isolate third-party APIs behind a local boundary when they affect core code.
16
+ 5. Keep dependency updates scoped and explain lockfile changes.
17
+ 6. Add tests around behavior that depends on external packages or services.
18
+
19
+ ## Guidelines
20
+
21
+ - Do not add dependencies for trivial transformations.
22
+ - Avoid leaking vendor-specific types across domain or public boundaries.
23
+ - Prefer stable, actively maintained dependencies already accepted by the project.
24
+ - Treat major upgrades as behavior-risk changes.
25
+ - Document why the dependency is needed when the choice is non-obvious.
26
+
27
+ ## Verification
28
+
29
+ Run dependency-aware checks available in the project: install/lockfile validation, tests, build, security audit, or compatibility checks as appropriate to risk.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: domain-modeling
3
+ description: Model business rules and domain concepts clearly. Use when adding features with domain behavior, invariants, workflows, policies, state transitions, commands, queries, or user/business terminology. Helps agents place rules correctly and avoid data-bag implementations.
4
+ ---
5
+
6
+ # Domain Modeling
7
+
8
+ Use this skill when correctness depends on business meaning, not just data movement.
9
+
10
+ ## Workflow
11
+
12
+ 1. Extract domain language from requirements, existing code, tests, and docs.
13
+ 2. Identify core concepts, actors, actions, policies, and invariants.
14
+ 3. Distinguish commands that change state from queries that observe state.
15
+ 4. Place invariants in the domain/core path, not only in UI or transport boundaries.
16
+ 5. Represent meaningful values explicitly rather than passing ambiguous primitives everywhere.
17
+ 6. Keep persistence and transport concerns separate from domain decisions.
18
+ 7. Test domain rules directly where possible.
19
+
20
+ ## Modeling prompts
21
+
22
+ - What must always be true?
23
+ - What state transitions are allowed or forbidden?
24
+ - Who is allowed to perform this action?
25
+ - What terms does the business use for this concept?
26
+ - Is this a rule, a calculation, a workflow, or mere data storage?
27
+
28
+ ## Avoid
29
+
30
+ - Anemic data containers when behavior has rules.
31
+ - Duplicating the same rule in multiple adapters.
32
+ - Naming domain concepts after technical implementation details.
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: error-handling
3
+ description: Design predictable, debuggable error behavior. Use when adding or changing failure paths, retries, validation, IO, service calls, event handling, command handling, or user-facing errors. Classifies errors, preserves causes, avoids secret leaks, and separates internal diagnostics from external messages.
4
+ ---
5
+
6
+ # Error Handling
7
+
8
+ Use this skill when a change can fail or when existing failure behavior is unclear.
9
+
10
+ ## Error classes
11
+
12
+ Classify failures before coding:
13
+
14
+ - validation: caller supplied invalid data
15
+ - domain: business invariant rejected the action
16
+ - authorization: actor lacks permission
17
+ - not found/conflict: state does not match expectation
18
+ - infrastructure: storage, network, filesystem, process, or dependency failed
19
+ - transient: retry may succeed
20
+ - programmer: bug or violated internal invariant
21
+ - unknown: unexpected and should be surfaced with diagnostics
22
+
23
+ ## Workflow
24
+
25
+ 1. Identify who needs to act on the error: caller, user, operator, or developer.
26
+ 2. Choose error shape consistent with the codebase.
27
+ 3. Preserve cause/context for diagnostics.
28
+ 4. Expose only safe, actionable messages externally.
29
+ 5. Retry only if the operation is safe or idempotent.
30
+ 6. Add tests for expected failure paths.
31
+
32
+ ## Avoid
33
+
34
+ - Catch-all handlers that hide defects.
35
+ - Retrying non-idempotent operations without safeguards.
36
+ - Logging secrets or private data.
37
+ - Returning success with partial hidden failure.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: legacy-code-seams
3
+ description: Safely change hard-to-test legacy code. Use when code has hidden side effects, weak tests, global state, large routines, unclear ownership, or risky dependencies. Focuses on seams, characterization tests, dependency isolation, and avoiding clean rewrites.
4
+ ---
5
+
6
+ # Legacy Code Seams
7
+
8
+ Use this skill to modify legacy code without destabilizing unknown behavior.
9
+
10
+ ## Principles
11
+
12
+ - Preserve current behavior until a deliberate behavior change is requested.
13
+ - Add tests around observed behavior before restructuring.
14
+ - Introduce seams at dependency boundaries rather than rewriting internals first.
15
+ - Prefer wrapping, extracting, and adapting over large replacement.
16
+
17
+ ## Workflow
18
+
19
+ 1. Identify the change point and affected behavior.
20
+ 2. Find seams: parameters, interfaces, facades, adapters, configuration, entrypoints, or file/module boundaries.
21
+ 3. Add characterization tests for the behavior you will touch.
22
+ 4. Isolate hard dependencies such as time, randomness, storage, network, process state, or environment.
23
+ 5. Make the requested change through the seam.
24
+ 6. Keep legacy compatibility until callers and tests prove it can be removed.
25
+
26
+ ## Avoid
27
+
28
+ - Large rewrites justified only by code quality.
29
+ - Changing multiple responsibilities while fixing one bug.
30
+ - Deleting strange behavior without proving it is unused.
31
+ - Assuming undocumented behavior is accidental.
32
+
33
+ ## Verification
34
+
35
+ Use regression tests, golden examples, focused integration checks, and diff review to prove intended behavior changed and adjacent behavior stayed stable.
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: naming-and-intent
3
+ description: Improve readability through precise names and explicit intent. Use when adding functions, modules, variables, commands, events, errors, tests, or docs. Encourages domain vocabulary, side-effect clarity, consistency, and avoiding vague helper/manager/data names.
4
+ ---
5
+
6
+ # Naming and Intent
7
+
8
+ Use this skill when names carry meaning for future maintainers.
9
+
10
+ ## Naming rules
11
+
12
+ - Prefer domain vocabulary already used by the project.
13
+ - Name by purpose and behavior, not implementation accident.
14
+ - Make side effects visible in command/action names.
15
+ - Use consistent terms for the same concept.
16
+ - Avoid vague names such as manager, helper, util, data, info, item, or handler unless the surrounding code gives them precise meaning.
17
+ - Do not rename broadly unless the task is a rename/refactor and verification is available.
18
+
19
+ ## Workflow
20
+
21
+ 1. Identify the concept's role in the domain or system.
22
+ 2. Search nearby code/docs for existing vocabulary.
23
+ 3. Pick names that distinguish similar concepts.
24
+ 4. Ensure tests describe behavior, not implementation detail.
25
+ 5. Re-read changed code as a sentence: intent should be clear without comments.
26
+
27
+ ## Comments
28
+
29
+ Use comments to explain non-obvious why, invariants, tradeoffs, and constraints. Do not comment what the code already states clearly.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: refactoring-safe-evolution
3
+ description: Refactor code without changing observable behavior. Use when improving structure, extracting abstractions, simplifying code, or modernizing internals while preserving existing contracts. Guides characterization, small mechanical steps, reversible edits, and verification after each phase.
4
+ ---
5
+
6
+ # Refactoring for Safe Evolution
7
+
8
+ Use this skill when the goal is better structure, not new behavior.
9
+
10
+ ## Preconditions
11
+
12
+ - Identify the observable behavior that must remain unchanged.
13
+ - Identify public contracts, persistence formats, events, commands, and integration points.
14
+ - If behavior is unclear, add characterization tests before changing structure.
15
+
16
+ ## Workflow
17
+
18
+ 1. State the refactoring goal and explicit non-behavioral scope.
19
+ 2. Capture current behavior with existing tests, characterization tests, or executable examples.
20
+ 3. Make one mechanical transformation at a time: extract, rename, move, inline, split, or isolate.
21
+ 4. Keep old and new paths equivalent during transitions when possible.
22
+ 5. Run targeted checks after each meaningful step.
23
+ 6. Remove temporary compatibility code only after callers are migrated and verified.
24
+
25
+ ## Safe transformations
26
+
27
+ - Extract pure logic from side-effecting code.
28
+ - Move code behind an existing interface/facade.
29
+ - Rename with all call sites updated atomically.
30
+ - Split large routines by responsibility.
31
+ - Replace duplicated logic with a single well-named concept.
32
+
33
+ ## Stop conditions
34
+
35
+ Stop and ask or report risk if the refactor requires contract changes, data migration, broad formatting, new dependencies, or behavior you cannot characterize.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: routine-function-design
3
+ description: Design clear routines, functions, methods, or procedures. Use when adding or restructuring executable units. Guides single purpose, parameter discipline, pre/postconditions, command-query separation, nesting control, and side-effect clarity in a language-agnostic way.
4
+ ---
5
+
6
+ # Routine / Function Design
7
+
8
+ Use this skill when creating or changing a callable unit.
9
+
10
+ ## Design checklist
11
+
12
+ - One clear purpose.
13
+ - Name communicates the result or action.
14
+ - Parameters are minimal and cohesive.
15
+ - Preconditions and postconditions are explicit or obvious.
16
+ - Side effects are intentional and visible.
17
+ - Return shape is predictable.
18
+ - Error behavior matches caller expectations.
19
+ - Nesting and branching stay readable.
20
+
21
+ ## Workflow
22
+
23
+ 1. Decide whether the routine is a command, query, calculation, policy, coordinator, or adapter call.
24
+ 2. Keep pure calculations separate from IO and mutation where practical.
25
+ 3. Pass cohesive concepts instead of long unrelated parameter lists.
26
+ 4. Extract nested decision logic only when the extracted name adds meaning.
27
+ 5. Test edge cases around boundaries and invariants.
28
+
29
+ ## Avoid
30
+
31
+ - Boolean flags that create multiple hidden behaviors.
32
+ - Hidden reliance on global or ambient state.
33
+ - Routines that both decide policy and perform unrelated IO.
34
+ - Clever compression that obscures intent.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: small-change-discipline
3
+ description: Keep coding-agent edits surgical and reversible. Use when implementing any code change, bug fix, refactor, or cleanup where scope control matters. Enforces inspect-before-edit, minimal diffs, existing style preservation, unrelated-issue isolation, and targeted verification.
4
+ ---
5
+
6
+ # Small Change Discipline
7
+
8
+ Use this skill to keep implementation work narrow, understandable, and safe.
9
+
10
+ ## Operating rules
11
+
12
+ 1. Restate the requested behavior and the exact files/areas likely affected.
13
+ 2. Inspect existing code before editing. Do not infer conventions from memory.
14
+ 3. Change the fewest files and smallest code regions that satisfy the request.
15
+ 4. Preserve existing naming, formatting, layering, and error-handling style unless the task requires changing them.
16
+ 5. Do not mix feature work, refactoring, formatting, dependency updates, and cleanup in one change unless explicitly requested.
17
+ 6. If you discover unrelated defects, report them separately instead of fixing them opportunistically.
18
+ 7. Prefer targeted verification over broad slow checks unless risk requires broader coverage.
19
+
20
+ ## Workflow
21
+
22
+ 1. Identify the requested outcome and non-goals.
23
+ 2. Locate the smallest existing extension point.
24
+ 3. Make the minimal implementation change.
25
+ 4. Add or update only tests/docs directly tied to the behavior.
26
+ 5. Review the diff for accidental broadening.
27
+ 6. Run the narrowest useful checks.
28
+
29
+ ## Self-check
30
+
31
+ - Did I edit only files needed for the request?
32
+ - Did I preserve existing public contracts unless asked to change them?
33
+ - Did I avoid drive-by cleanup?
34
+ - Can each changed line be explained by the user request?
35
+ - Did verification match the risk of the change?
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: lsp-navigation
3
+ description: Navigate code with IDE features and run proactive LSP diagnostics on files/folders/batches. Use as PRIMARY for code intelligence and type/error checks.
4
+ ---
5
+
6
+ # LSP Navigation and Diagnostics
7
+
8
+ Use `lsp_navigation` as **PRIMARY** for code intelligence. Use `lsp_diagnostics` as **PRIMARY** for proactive type/error checks on files, folders, or explicit batches. Do NOT use grep/glob/ast-grep first for code intelligence or diagnostics.
9
+
10
+ **Requires:** `--lens-lsp` flag
11
+
12
+ ## When to Use Diagnostics
13
+
14
+ Use `lsp_diagnostics` before builds/tests or after touching several files:
15
+
16
+ | Need | Tool call |
17
+ | --------------------------- | -------------------------------------------------------------------------- |
18
+ | Check one file | `lsp_diagnostics({ filePath: "src/file.ts" })` |
19
+ | Check a folder | `lsp_diagnostics({ filePath: "src/", severity: "error" })` |
20
+ | Check exact touched files | `lsp_diagnostics({ filePaths: ["src/a.ts", "src/b.ts"], concurrency: 8 })` |
21
+ | Give slow servers more time | `lsp_diagnostics({ filePaths: files, waitMs: 2000 })` |
22
+ | Show warnings too | `lsp_diagnostics({ filePaths: files, severity: "all" })` |
23
+
24
+ Prefer explicit `filePaths` batches after multi-file edits: they are bounded-concurrency and avoid unrelated directory noise.
25
+
26
+ ## When to Use Navigation (Code Intelligence)
27
+
28
+ | Question | Operation | Parameters |
29
+ | --------------------------------------- | ---------------------------------------- | ----------------------------------------------------------------------------- |
30
+ | "Where is this defined?" | `definition` | filePath, line, character |
31
+ | "Find all usages" | `references` | filePath, line, character |
32
+ | "What type is this?" | `hover` | filePath, line, character |
33
+ | "Show call signature here" | `signatureHelp` | filePath, line, character (at call-site args) |
34
+ | "What symbols in this file?" | `documentSymbol` | filePath |
35
+ | "Find symbol across project" | `workspaceSymbol` | query + **filePath strongly recommended** |
36
+ | "What quick fixes are available?" | `codeAction` | filePath, line, character, endLine, endCharacter |
37
+ | "Rename symbol safely" | `rename` | filePath, line, character, newName |
38
+ | "Who implements this interface?" | `implementation` | filePath, line, character |
39
+ | "Who calls this function?" | `prepareCallHierarchy` → `incomingCalls` | filePath, line, character |
40
+ | "What does this function call?" | `prepareCallHierarchy` → `outgoingCalls` | filePath, line, character |
41
+ | "Show tracked LSP diagnostics snapshot" | `workspaceDiagnostics` | optional filePath (snapshot only; prefer `lsp_diagnostics` for active checks) |
42
+
43
+ ## Operational Guidance (From Field Tests)
44
+
45
+ - Always pass `filePath` for `workspaceSymbol` when possible. Unscoped queries are best-effort and often empty.
46
+ - For `references`, prefer querying from the definition site for broader cross-file coverage; usage-site queries can be partial.
47
+ - Use `signatureHelp` only at call-site argument positions; declaration positions often return empty.
48
+ - Treat `workspaceDiagnostics` as tracked push snapshot (`publishDiagnostics`), not protocol pull `workspace/diagnostic` coverage. Prefer `lsp_diagnostics` when you need an active file/folder/batch check.
49
+ - For `codeAction`, separate `quickfix` from generic refactors (for example "Move to new file"). Do not treat generic refactors as error fixes.
50
+ - `prepareCallHierarchy` is server-capability dependent; if unsupported, skip incoming/outgoing calls.
51
+ - If TypeScript returns `No Project` on `workspaceSymbol`, retry after opening the scoped file context.
52
+
53
+ ## Call Hierarchy Pattern
54
+
55
+ ```typescript
56
+ // Step 1: Prepare (get the callable item)
57
+ const items = await lsp_navigation({
58
+ operation: "prepareCallHierarchy",
59
+ filePath: "src/api.ts",
60
+ line: 42,
61
+ character: 10,
62
+ });
63
+
64
+ // Step 2: Get callers (who calls this function)
65
+ const callers = await lsp_navigation({
66
+ operation: "incomingCalls",
67
+ callHierarchyItem: items[0],
68
+ });
69
+
70
+ // Step 2: Get callees (what this function calls)
71
+ const callees = await lsp_navigation({
72
+ operation: "outgoingCalls",
73
+ callHierarchyItem: items[0],
74
+ });
75
+ ```
76
+
77
+ ## When NOT to Use LSP
78
+
79
+ | Task | Use Instead | Why |
80
+ | --------------------------- | ----------------- | --------------------------- |
81
+ | Active type/error checks | `lsp_diagnostics` | Diagnostics, not navigation |
82
+ | Find patterns (console.log) | `ast_grep_search` | Pattern matching |
83
+ | Find text/TODOs | `grep` | Text search |
84
+ | Find files by name | `glob` | File discovery |
85
+ | Read file content | `read` | Direct access |
86
+
87
+ ## Golden Rule
88
+
89
+ **Code intelligence → `lsp_navigation` first. Type/error validation → `lsp_diagnostics` first. Text/pattern search → grep/ast-grep.**
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: code-review-self-check
3
+ description: Perform a final agent self-review before reporting completion. Use after any code edit, refactor, test change, config change, or docs update. Checks diff scope, behavior alignment, edge cases, tests, security/privacy, naming, and unverified risks.
4
+ ---
5
+
6
+ # Code Review Self-Check
7
+
8
+ Use this skill before final response on code-writing tasks.
9
+
10
+ ## Review workflow
11
+
12
+ 1. Inspect the diff, not just memory of edits.
13
+ 2. Re-read the original request and compare it to changed behavior.
14
+ 3. Check that no unrelated files or formatting churn were introduced.
15
+ 4. Check public contracts, data formats, and error behavior.
16
+ 5. Check edge cases and failure paths.
17
+ 6. Check names and structure against nearby conventions.
18
+ 7. Check tests: they should assert behavior that matters and fail for the old bug/change when applicable.
19
+ 8. Check logs/errors for secret or private data exposure.
20
+ 9. Run or explain the most relevant verification.
21
+ 10. Report residual risk honestly.
22
+
23
+ ## Final response fields
24
+
25
+ - changed files
26
+ - why changed
27
+ - verification run
28
+ - known risks or follow-ups
29
+
30
+ ## Red flags
31
+
32
+ - The implementation is larger than the request.
33
+ - Tests only assert mocks or snapshots without behavior.
34
+ - The code handles success but not failure.
35
+ - A new dependency or contract change is unexplained.
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: privacy-data-handling
3
+ description: Handle personal, sensitive, or customer data safely. Use when adding storage, logs, analytics, exports, imports, integrations, telemetry, search indexes, AI context, or user-facing data flows. Focuses on minimization, retention, access, deletion, and safe observability.
4
+ ---
5
+
6
+ # Privacy and Data Handling
7
+
8
+ Use this skill when code touches data that may identify, describe, or affect people, customers, tenants, organizations, or secrets.
9
+
10
+ ## Workflow
11
+
12
+ 1. Classify data: public, internal, sensitive, personal, secret, regulated, or tenant-scoped.
13
+ 2. Minimize collection, storage, logging, and propagation.
14
+ 3. Keep access checks close to reads and writes.
15
+ 4. Avoid placing sensitive data in logs, errors, metrics labels, analytics, caches, prompts, or filenames.
16
+ 5. Define retention, deletion, and export implications when adding storage.
17
+ 6. Redact or aggregate data used for observability.
18
+ 7. Add tests for tenant isolation, access denial, and redaction where relevant.
19
+
20
+ ## Review questions
21
+
22
+ - Who can read this data now?
23
+ - Where else does this data flow?
24
+ - Can it be deleted or corrected if needed?
25
+ - Is sensitive data copied into long-lived artifacts?
26
+ - Does the final response expose private values?
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: security-review
3
+ description: Run a lightweight security pass on code changes. Use when touching authentication, authorization, input handling, files, paths, commands, network calls, serialization, storage, secrets, dependencies, or user-controlled data. Focuses on trust boundaries and common vulnerability classes.
4
+ ---
5
+
6
+ # Security Review
7
+
8
+ Use this skill whenever a change crosses a trust boundary.
9
+
10
+ ## Checklist
11
+
12
+ - Authentication: is the actor known when required?
13
+ - Authorization: is the actor allowed to perform this action on this resource?
14
+ - Input validation: is untrusted input constrained before use?
15
+ - Injection: are queries, commands, paths, templates, and expressions safely constructed?
16
+ - Secrets: are credentials never logged, committed, exposed, or returned?
17
+ - Sensitive data: is private data minimized and protected?
18
+ - Deserialization/parsing: are formats constrained and failures explicit?
19
+ - Filesystem/process/network: are paths, arguments, redirects, and destinations controlled?
20
+ - Dependencies: does the change introduce known vulnerable or unnecessary packages?
21
+
22
+ ## Workflow
23
+
24
+ 1. Identify trust boundaries and attacker-controlled values.
25
+ 2. Trace those values to sensitive sinks.
26
+ 3. Add validation, authorization, escaping, or isolation at the right layer.
27
+ 4. Add abuse-case tests for important risks.
28
+ 5. Report any security assumption that remains unverified.
29
+
30
+ ## Avoid
31
+
32
+ - Relying only on client-side checks.
33
+ - Logging full request bodies or tokens.
34
+ - Treating internal callers as inherently safe when data originated outside.
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: test-strategy
3
+ description: Choose the right test level for a code change. Use when adding features, fixing bugs, refactoring, changing contracts, or improving coverage. Guides unit, integration, contract, characterization, regression, property, and end-to-end test selection without assuming a specific tool or runtime.
4
+ ---
5
+
6
+ # Test Strategy
7
+
8
+ Use this skill to add useful tests rather than merely more tests.
9
+
10
+ ## Choose test type by risk
11
+
12
+ - Unit test: pure logic, calculations, policies, branching, invariants.
13
+ - Integration test: storage, filesystem, network, process, or platform/runtime boundary.
14
+ - Contract test: public API, command, event, plugin, module facade, or service boundary.
15
+ - Characterization test: existing unclear behavior before legacy changes.
16
+ - Regression test: bug fix that must not reappear.
17
+ - End-to-end test: critical user journey or cross-boundary behavior not covered otherwise.
18
+ - Property or generative test: broad input space with stable invariants.
19
+
20
+ ## Workflow
21
+
22
+ 1. Identify the behavior that must be proven.
23
+ 2. Pick the lowest test level that gives confidence.
24
+ 3. Test public behavior and invariants, not incidental implementation details.
25
+ 4. Include edge cases: empty, missing, invalid, boundary, duplicate, reordered, and failure paths where relevant.
26
+ 5. Ensure tests fail for the bug/change before relying on them.
27
+ 6. Keep tests deterministic and readable.
28
+
29
+ ## Avoid
30
+
31
+ - Snapshot/golden tests that hide important intent.
32
+ - Mock-heavy tests that only verify implementation choreography.
33
+ - Broad end-to-end tests for simple pure logic.
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: testability-design
3
+ description: Reshape code so important behavior can be tested simply. Use when code is hard to test due to IO, time, randomness, globals, hidden dependencies, side effects, or platform/runtime coupling. Separates pure logic from effects and introduces stable seams.
4
+ ---
5
+
6
+ # Testability Design
7
+
8
+ Use this skill when verification is difficult because the design hides seams.
9
+
10
+ ## Workflow
11
+
12
+ 1. Identify behavior worth testing separately from the mechanism that triggers it.
13
+ 2. Move pure decisions/calculations away from IO and mutation where practical.
14
+ 3. Inject or pass volatile dependencies such as clocks, randomness, environment, storage, network, and external processes.
15
+ 4. Replace ambient/global state with explicit inputs or narrow adapters where safe.
16
+ 5. Expose behavior through a stable public seam rather than private internals.
17
+ 6. Keep tests close to the level of the behavior being guaranteed.
18
+
19
+ ## Good seams
20
+
21
+ - boundary adapters
22
+ - domain services or policies
23
+ - command/query handlers
24
+ - parser/serializer boundaries
25
+ - workflow step interfaces
26
+ - configuration providers
27
+ - repository/storage ports
28
+
29
+ ## Avoid
30
+
31
+ - Making private implementation public only for tests.
32
+ - Adding test-only branches to production logic.
33
+ - Over-abstracting every dependency before a real testability problem exists.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: concurrency-safety
3
+ description: Prevent race conditions and unsafe shared-state behavior. Use when modifying async work, parallel execution, queues, locks, caches, background jobs, shared mutable state, transactions, event handlers, or distributed coordination. Emphasizes idempotency, ordering, isolation, and deterministic tests.
4
+ ---
5
+
6
+ # Concurrency Safety
7
+
8
+ Use this skill when operations may overlap, reorder, duplicate, or observe stale state.
9
+
10
+ ## Workflow
11
+
12
+ 1. Identify shared mutable state and who can access it concurrently.
13
+ 2. Identify ordering assumptions and whether they are guaranteed.
14
+ 3. Check for duplicate, delayed, retried, or out-of-order execution.
15
+ 4. Use appropriate isolation: immutability, ownership, lock, transaction, compare-and-set, queue serialization, or idempotency key.
16
+ 5. Keep critical sections small and failure-safe.
17
+ 6. Ensure cleanup/release happens on error paths.
18
+ 7. Add tests or simulations for duplicate and interleaved operations where practical.
19
+
20
+ ## Review questions
21
+
22
+ - Can two callers perform this action at once?
23
+ - Can this message/job/event be processed twice?
24
+ - Can a stale read overwrite newer state?
25
+ - Is the operation atomic from the user's perspective?
26
+ - Is there a deadlock, starvation, or resource leak risk?
27
+
28
+ ## Avoid
29
+
30
+ - Assuming single-thread/process execution unless enforced.
31
+ - Using time sleeps as correctness guarantees.
32
+ - Global mutable state without ownership rules.