@vesviet/agent-skills 5.8.0 → 5.11.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 (454) hide show
  1. package/INDEX.md +35 -22
  2. package/README.md +7 -18
  3. package/VERSION +1 -1
  4. package/adapters/antigravity/ANTIGRAVITY.md +40 -142
  5. package/adapters/antigravity/INDEX_TIER1.json +174 -146
  6. package/adapters/antigravity/a2a-config.template.yaml +1 -1
  7. package/adapters/antigravity/antigravity-tools.md +25 -0
  8. package/adapters/antigravity/role-skill-index.json +175 -58
  9. package/adapters/claude/CLAUDE_ADAPTER.md +3 -7
  10. package/adapters/claude/settings.template.json +18 -3
  11. package/adapters/cursor/README.md +1 -5
  12. package/adapters/cursor/hooks.template.json +4 -2
  13. package/core/contracts/README.md +0 -20
  14. package/core/contracts/schemas/compact-working-state.json +42 -1
  15. package/core/contracts/schemas/ui-component-spec.json +28 -2
  16. package/core/policies/README.md +0 -20
  17. package/core/policies/action-boundaries.yaml +10 -1
  18. package/core/policies/execution-sandbox.md +0 -12
  19. package/core/policies/mcp-tool-map.yaml +28 -0
  20. package/core/roles/3d-graphics-engineer.md +144 -208
  21. package/core/roles/README.md +1 -23
  22. package/core/roles/agent-coordinator.md +28 -147
  23. package/core/roles/agent-discovery-engineer.md +46 -39
  24. package/core/roles/ai-systems-engineer.md +2 -0
  25. package/core/roles/backend-developer.md +22 -117
  26. package/core/roles/cloudflare-engineer.md +1 -1
  27. package/core/roles/data-engineer.md +3 -1
  28. package/core/roles/devops-engineer.md +4 -3
  29. package/core/roles/ecommerce-engineer.md +18 -6
  30. package/core/roles/frontend-developer.md +146 -317
  31. package/core/roles/game-developer.md +2 -1
  32. package/core/roles/mobile-engineer.md +18 -204
  33. package/core/roles/product-manager.md +3 -3
  34. package/core/roles/project-manager.md +5 -5
  35. package/core/roles/references/3d-graphics-engineer-review-checklist.md +109 -109
  36. package/core/roles/references/agent-coordinator-responsibilities.md +120 -0
  37. package/core/roles/references/agent-coordinator-review-checklist.md +22 -4
  38. package/core/roles/references/agent-discovery-engineer-review-checklist.md +29 -20
  39. package/core/roles/references/backend-developer-responsibilities.md +47 -0
  40. package/core/roles/references/backend-developer-review-checklist.md +15 -0
  41. package/core/roles/references/business-analyst-responsibilities.md +2 -2
  42. package/core/roles/references/frontend-developer-responsibilities.md +14 -6
  43. package/core/roles/references/frontend-developer-review-checklist.md +13 -6
  44. package/core/roles/references/mobile-engineer-responsibilities.md +137 -0
  45. package/core/roles/references/mobile-engineer-review-checklist.md +63 -0
  46. package/core/roles/references/reviewer-review-checklist.md +54 -0
  47. package/core/roles/references/sdet-review-checklist.md +53 -0
  48. package/core/roles/references/solution-architect-responsibilities.md +134 -0
  49. package/core/roles/references/sre-review-checklist.md +81 -0
  50. package/core/roles/references/system-engineer-responsibilities.md +124 -0
  51. package/core/roles/references/technical-architect-responsibilities.md +192 -0
  52. package/core/roles/references/technical-architect-review-checklist.md +58 -0
  53. package/core/roles/references/technical-lead-review-checklist.md +65 -0
  54. package/core/roles/references/ui-ux-designer-anti-slop-standards.md +61 -35
  55. package/core/roles/references/ui-ux-designer-responsibilities.md +79 -226
  56. package/core/roles/references/ui-ux-designer-review-checklist.md +102 -116
  57. package/core/roles/references/vietnam-accounting-specialist-review-checklist.md +6 -6
  58. package/core/roles/researcher.md +3 -3
  59. package/core/roles/reviewer.md +2 -2
  60. package/core/roles/role-standard.md +79 -205
  61. package/core/roles/sdet.md +5 -6
  62. package/core/roles/security-engineer.md +4 -3
  63. package/core/roles/solution-architect.md +9 -130
  64. package/core/roles/sre.md +1 -0
  65. package/core/roles/system-engineer.md +15 -155
  66. package/core/roles/task-planner.md +1 -1
  67. package/core/roles/technical-architect.md +15 -244
  68. package/core/roles/technical-lead.md +1 -0
  69. package/core/roles/technical-writer.md +3 -3
  70. package/core/roles/ui-ux-designer.md +158 -303
  71. package/core/roles/vietnam-accounting-specialist.md +20 -20
  72. package/core/rules/README.md +0 -22
  73. package/core/rules/code.md +11 -6
  74. package/core/skills/README.md +12 -25
  75. package/core/skills/agent/agent-delegation/SKILL.md +11 -0
  76. package/core/skills/agent/agent-graph-orchestration/SKILL.md +5 -0
  77. package/core/skills/agent/agent-memory-compaction/SKILL.md +79 -82
  78. package/core/skills/agent/agent-memory-compaction/references/anchored-schema-and-compaction-algorithms.md +74 -115
  79. package/core/skills/agent/agent-model-routing/SKILL.md +2 -0
  80. package/core/skills/agent/agent-observability/SKILL.md +12 -6
  81. package/core/skills/agent/agent-observability/references/session-forensics-7-dimensions.md +41 -0
  82. package/core/skills/agent/agent-panel-meeting/SKILL.md +3 -3
  83. package/core/skills/agent/agent-quality-gate/SKILL.md +9 -0
  84. package/core/skills/agent/configure-agent-commerce/SKILL.md +2 -0
  85. package/core/skills/agent/configure-agent-commerce/examples/ucp-commerce-manifest-and-endpoints.json +55 -0
  86. package/core/skills/agent/configure-agent-commerce/references/acp-ucp-agent-commerce-manifest-specs.md +66 -0
  87. package/core/skills/agent/configure-agent-headers/SKILL.md +3 -0
  88. package/core/skills/agent/configure-agent-skills/SKILL.md +4 -4
  89. package/core/skills/agent/configure-oauth-metadata/SKILL.md +10 -7
  90. package/core/skills/agent/manage-agent-identity/SKILL.md +2 -0
  91. package/core/skills/agent/manage-agent-identity/examples/agent-identity-spire-workload.yaml +72 -0
  92. package/core/skills/agent/manage-agent-identity/references/nhi-lifecycle-and-token-rotation.md +45 -0
  93. package/core/skills/ai/deploy-vllm-inference/SKILL.md +2 -0
  94. package/core/skills/ai/deploy-vllm-inference/examples/vllm-production-serve-config.yaml +22 -0
  95. package/core/skills/ai/deploy-vllm-inference/references/vllm-v1-paged-attention-and-kv-tiering.md +20 -0
  96. package/core/skills/ai/openrouter-task/SKILL.md +5 -5
  97. package/core/skills/ai-agent/context-optimization/SKILL.md +2 -0
  98. package/core/skills/ai-agent/context-optimization/examples/context-pruner-and-reorderer.py +85 -0
  99. package/core/skills/ai-agent/context-optimization/references/token-budgeting-and-attention-allocation.md +47 -0
  100. package/core/skills/ai-agent/memory-hygiene/SKILL.md +13 -0
  101. package/core/skills/ai-agent/memory-hygiene/examples/memory-audit-and-compaction-routine.py +90 -0
  102. package/core/skills/ai-agent/memory-hygiene/references/agent-memory-vault-spec.md +137 -0
  103. package/core/skills/ai-agent/memory-hygiene/references/owasp-asi06-and-memory-poisoning-defense.md +38 -0
  104. package/core/skills/backend/add-api-endpoint/SKILL.md +9 -0
  105. package/core/skills/backend/add-api-endpoint/examples/express-zod-rfc9457-endpoint.md +329 -0
  106. package/core/skills/backend/add-api-endpoint/examples/kratos-go-clean-architecture-endpoint.md +405 -0
  107. package/core/skills/backend/add-api-endpoint/references/idempotency-and-rate-limiting.md +116 -0
  108. package/core/skills/backend/add-event-handler/SKILL.md +12 -1
  109. package/core/skills/backend/add-event-handler/examples/go-outbox-skip-locked-relay.go +97 -0
  110. package/core/skills/backend/add-event-handler/references/transactional-outbox-and-cloudevents.md +42 -0
  111. package/core/skills/backend/add-service-client/SKILL.md +2 -0
  112. package/core/skills/backend/add-service-client/examples/ts-circuit-breaker-full-jitter-client.ts +71 -0
  113. package/core/skills/backend/add-service-client/references/resilient-client-circuit-breaker-specs.md +25 -0
  114. package/core/skills/backend/build-mcp-server/SKILL.md +2 -0
  115. package/core/skills/backend/build-mcp-server/examples/ts-stateless-mcp-server-zod.ts +52 -0
  116. package/core/skills/backend/build-mcp-server/references/mcp-2026-stateless-contract-specs.md +21 -0
  117. package/core/skills/backend/design-caching-and-locking/SKILL.md +83 -0
  118. package/core/skills/backend/design-caching-and-locking/examples/redis-lua-atomic-reservation-fencing.lua +30 -0
  119. package/core/skills/backend/design-caching-and-locking/references/redis-lua-fencing-and-stampede-specs.md +25 -0
  120. package/core/skills/backend/design-caching-and-locking/scripts/verify_lua_atomicity.py +68 -0
  121. package/core/skills/backend/implement-auth/SKILL.md +9 -0
  122. package/core/skills/backend/implement-structured-outputs/SKILL.md +2 -0
  123. package/core/skills/backend/implement-structured-outputs/examples/python-pydantic-structured-output.py +65 -0
  124. package/core/skills/backend/implement-structured-outputs/references/constrained-decoding-and-double-validation.md +18 -0
  125. package/core/skills/backend/optimize-postgres/SKILL.md +9 -0
  126. package/core/skills/backend/scaffold-new-service/SKILL.md +2 -1
  127. package/core/skills/backend/scaffold-new-service/references/deep-modules-and-seams.md +43 -0
  128. package/core/skills/business/elicit-requirements/SKILL.md +2 -0
  129. package/core/skills/business/trace-requirements-impact/SKILL.md +1 -0
  130. package/core/skills/business/write-use-cases/SKILL.md +1 -0
  131. package/core/skills/commerce/handle-checkout-flow/SKILL.md +18 -66
  132. package/core/skills/commerce/handle-checkout-flow/examples/production-checkout-orchestrator.ts +185 -0
  133. package/core/skills/commerce/handle-checkout-flow/references/pci-dss-v4-and-agentic-checkout-specs.md +72 -0
  134. package/core/skills/commerce/integrate-payment-gateway/SKILL.md +22 -58
  135. package/core/skills/commerce/integrate-payment-gateway/examples/resilient-webhook-and-mpp-handler.ts +164 -0
  136. package/core/skills/commerce/integrate-payment-gateway/references/mpp-x402-and-webhook-security-specs.md +47 -0
  137. package/core/skills/commerce/manage-order-fulfillment/SKILL.md +17 -50
  138. package/core/skills/commerce/manage-order-fulfillment/examples/temporal-fulfillment-saga.ts +104 -0
  139. package/core/skills/commerce/manage-order-fulfillment/references/event-sourced-fulfillment-and-carrier-webhooks.md +58 -0
  140. package/core/skills/commerce/manage-product-catalog/SKILL.md +5 -1
  141. package/core/skills/commerce/manage-product-catalog/examples/hybrid-search-and-governance-pipeline.ts +120 -0
  142. package/core/skills/commerce/manage-product-catalog/references/semantic-vector-catalog-and-graphrag.md +54 -0
  143. package/core/skills/content/write-article/SKILL.md +1 -1
  144. package/core/skills/document/docx/SKILL.md +1 -0
  145. package/core/skills/document/pdf/SKILL.md +2 -0
  146. package/core/skills/document/pdf/references/pdf-acroforms-and-pdfplumber-specs.md +54 -0
  147. package/core/skills/document/pdf/scripts/check_fillable_fields.py +144 -0
  148. package/core/skills/document/pdf/scripts/fill_fillable_fields.py +145 -0
  149. package/core/skills/document/xlsx/SKILL.md +1 -0
  150. package/core/skills/documentation/configure-llms-txt/SKILL.md +3 -0
  151. package/core/skills/documentation/configure-llms-txt/examples/canonical-llms-txt-and-full-txt.md +45 -0
  152. package/core/skills/documentation/configure-llms-txt/references/llms-txt-and-llms-full-txt-standard.md +37 -0
  153. package/core/skills/documentation/write-documentation/SKILL.md +4 -1
  154. package/core/skills/documentation/write-documentation/examples/microservice-production-readme-and-api-docs.md +70 -0
  155. package/core/skills/documentation/write-documentation/references/diataxis-framework-and-doc-standards.md +62 -0
  156. package/core/skills/documentation/write-tech-radar/SKILL.md +1 -0
  157. package/core/skills/education/create-exercises/SKILL.md +1 -0
  158. package/core/skills/education/design-learning-plan/SKILL.md +1 -0
  159. package/core/skills/education/grade-and-review/SKILL.md +1 -0
  160. package/core/skills/foundation/accessibility-review/SKILL.md +1 -0
  161. package/core/skills/foundation/ai-risk-assessment/SKILL.md +4 -5
  162. package/core/skills/foundation/ai-risk-assessment/examples/genai-system-risk-register.md +67 -0
  163. package/core/skills/foundation/ai-risk-assessment/references/nist-ai-rmf-and-eu-ai-act-taxonomy.md +49 -0
  164. package/core/skills/foundation/combinatorial-testing/SKILL.md +1 -0
  165. package/core/skills/foundation/conduct-research/SKILL.md +2 -2
  166. package/core/skills/foundation/conduct-research/references/ai-era-source-discipline.md +1 -1
  167. package/core/skills/foundation/create-migration/SKILL.md +10 -0
  168. package/core/skills/foundation/design-review/SKILL.md +9 -10
  169. package/core/skills/foundation/design-ux-flow/SKILL.md +9 -7
  170. package/core/skills/foundation/discernment-nudge/SKILL.md +2 -0
  171. package/core/skills/foundation/hostile-component-stress-testing/SKILL.md +1 -0
  172. package/core/skills/foundation/incident-report/SKILL.md +1 -0
  173. package/core/skills/foundation/plan-technical-delivery/SKILL.md +3 -1
  174. package/core/skills/foundation/playwright-evidence-qa/SKILL.md +1 -0
  175. package/core/skills/foundation/refactor-legacy-code/SKILL.md +84 -0
  176. package/core/skills/foundation/refactor-legacy-code/examples/characterization-test-seam-extraction.py +34 -0
  177. package/core/skills/foundation/refactor-legacy-code/references/strangler-fig-seams-and-characterization-tests.md +17 -0
  178. package/core/skills/foundation/refactor-legacy-code/scripts/check_refactor_blast_radius.py +63 -0
  179. package/core/skills/foundation/release-notes/SKILL.md +3 -3
  180. package/core/skills/foundation/release-notes/examples/enterprise-platform-release-notes.md +42 -0
  181. package/core/skills/foundation/release-notes/references/keep-a-changelog-and-semver-governance.md +43 -0
  182. package/core/skills/foundation/systematic-debugging/SKILL.md +15 -0
  183. package/core/skills/foundation/webapp-server-runner/SKILL.md +1 -0
  184. package/core/skills/foundation/write-product-brief/SKILL.md +1 -0
  185. package/core/skills/foundation/write-tests/SKILL.md +9 -0
  186. package/core/skills/foundation/write-tests/examples/anti-tautological-tdd-walkthrough.md +204 -0
  187. package/core/skills/foundation/write-tests/examples/testcontainers-kratos-integration-test.md +186 -0
  188. package/core/skills/foundation/write-tests/references/contract-and-chaos-testing.md +187 -0
  189. package/core/skills/frontend/INDEX.json +16 -0
  190. package/core/skills/frontend/add-page-route/SKILL.md +10 -8
  191. package/core/skills/frontend/add-page-route/examples/streaming-rsc-page-with-view-transition.tsx +133 -0
  192. package/core/skills/frontend/add-page-route/references/rsc-routing-and-view-transitions.md +72 -0
  193. package/core/skills/frontend/add-ui-component/SKILL.md +4 -1
  194. package/core/skills/frontend/add-ui-component/examples/compound-dialog-and-form-actions.tsx +193 -0
  195. package/core/skills/frontend/add-ui-component/references/react19-component-standards-and-anti-slop.md +55 -0
  196. package/core/skills/frontend/component-composition/SKILL.md +12 -1
  197. package/core/skills/frontend/component-composition/examples/headless-combobox-compound-component.tsx +207 -0
  198. package/core/skills/frontend/design-md-specification/SKILL.md +5 -0
  199. package/core/skills/frontend/design-system-engineering/SKILL.md +4 -2
  200. package/core/skills/frontend/frontend-micro-polish/SKILL.md +1 -0
  201. package/core/skills/frontend/frontend-testing/SKILL.md +4 -1
  202. package/core/skills/frontend/frontend-testing/examples/playwright-e2e-with-msw-and-axe.spec.ts +87 -0
  203. package/core/skills/frontend/frontend-testing/references/playwright-msw-and-a11y-testing-standards.md +78 -0
  204. package/core/skills/frontend/implement-ai-disclosure/SKILL.md +119 -0
  205. package/core/skills/frontend/implement-view-transitions/SKILL.md +1 -0
  206. package/core/skills/frontend/implement-webmcp/SKILL.md +7 -4
  207. package/core/skills/frontend/implement-webmcp/examples/webmcp-provider-and-hitl-modal.tsx +163 -0
  208. package/core/skills/frontend/implement-webmcp/references/webmcp-architecture-and-hitl-security.md +48 -0
  209. package/core/skills/frontend/integrate-api-client/SKILL.md +12 -12
  210. package/core/skills/frontend/integrate-api-client/examples/orval-query-and-streaming-mutation.ts +102 -0
  211. package/core/skills/frontend/integrate-api-client/references/orval-tanstack-query-and-streaming-specs.md +57 -0
  212. package/core/skills/frontend/interactive-component-workbench/SKILL.md +1 -0
  213. package/core/skills/frontend/motion-performance-engineering/SKILL.md +1 -0
  214. package/core/skills/frontend/setup-design-system/SKILL.md +6 -3
  215. package/core/skills/frontend/setup-design-system/examples/tailwind-v4-theme-and-dtcg-tokens.css +87 -0
  216. package/core/skills/frontend/setup-design-system/references/tailwind-v4-oklch-and-dtcg-tokens.md +61 -0
  217. package/core/skills/frontend/setup-visual-regression/SKILL.md +8 -5
  218. package/core/skills/frontend/setup-visual-regression/examples/visual-regression-playwright.config.ts +83 -0
  219. package/core/skills/frontend/setup-visual-regression/references/visual-regression-docker-and-masking-specs.md +46 -0
  220. package/core/skills/frontend/ui-ux-designer-anti-slop-standards.md +64 -42
  221. package/core/skills/frontend/web-quality-audit/SKILL.md +1 -0
  222. package/core/skills/gamedev/abstract-input-actions/SKILL.md +2 -0
  223. package/core/skills/gamedev/abstract-input-actions/examples/input-action-manager.ts +85 -0
  224. package/core/skills/gamedev/abstract-input-actions/references/action-mapping-and-analog-deadzones.md +54 -0
  225. package/core/skills/gamedev/architect-ecs-systems/SKILL.md +2 -0
  226. package/core/skills/gamedev/architect-ecs-systems/examples/bevy-flecs-combat-system.rs +73 -0
  227. package/core/skills/gamedev/architect-ecs-systems/references/data-oriented-design-and-archetype-ecs.md +39 -0
  228. package/core/skills/gamedev/author-game-ai/SKILL.md +2 -0
  229. package/core/skills/gamedev/author-game-ai/examples/modular-behavior-tree-ai.ts +98 -0
  230. package/core/skills/gamedev/author-game-ai/references/behavior-trees-and-utility-ai-curves.md +47 -0
  231. package/core/skills/gamedev/configure-physics-collision/SKILL.md +2 -0
  232. package/core/skills/gamedev/configure-physics-collision/examples/kinematic-physics-substepping.cpp +100 -0
  233. package/core/skills/gamedev/configure-physics-collision/references/continuous-collision-detection-and-substepping.md +50 -0
  234. package/core/skills/gamedev/develop-gameplay-systems/SKILL.md +2 -0
  235. package/core/skills/gamedev/develop-gameplay-systems/examples/kinematic-character-controller.gd +86 -0
  236. package/core/skills/gamedev/develop-gameplay-systems/references/deterministic-gameplay-state-machines.md +42 -0
  237. package/core/skills/gamedev/implement-save-persistence/SKILL.md +2 -0
  238. package/core/skills/gamedev/implement-save-persistence/examples/versioned-save-manager.ts +127 -0
  239. package/core/skills/gamedev/implement-save-persistence/references/versioned-save-schemas-and-checksums.md +44 -0
  240. package/core/skills/gamedev/render-webgl-threejs/SKILL.md +14 -10
  241. package/core/skills/gamedev/render-webgl-threejs/examples/production-threejs-webgpu-scene.ts +116 -0
  242. package/core/skills/gamedev/render-webgl-threejs/references/webgpu-threejs-pbr-pipeline.md +72 -0
  243. package/core/skills/legal-compliance/audit-ai-compliance/SKILL.md +1 -0
  244. package/core/skills/legal-compliance/draft-legal-opinion/SKILL.md +1 -0
  245. package/core/skills/legal-compliance/manage-vietnam-legal/SKILL.md +1 -0
  246. package/core/skills/meetings-analysis/analyze-business-requirements/SKILL.md +1 -0
  247. package/core/skills/meetings-analysis/analyze-data/SKILL.md +1 -0
  248. package/core/skills/meetings-analysis/meeting-review/SKILL.md +1 -0
  249. package/core/skills/mmo/analyze-campaign-roi/SKILL.md +2 -0
  250. package/core/skills/mmo/analyze-campaign-roi/examples/campaign-roi-and-roas-dashboard.py +80 -0
  251. package/core/skills/mmo/analyze-campaign-roi/references/multi-touch-attribution-and-cpa-analytics.md +33 -0
  252. package/core/skills/mmo/create-automation-script/SKILL.md +2 -0
  253. package/core/skills/mmo/create-automation-script/examples/stealth-browser-automation-flow.ts +65 -0
  254. package/core/skills/mmo/create-automation-script/references/stealth-cdp-and-behavioral-mimicry.md +37 -0
  255. package/core/skills/mmo/deploy-mmo-infrastructure/SKILL.md +3 -0
  256. package/core/skills/mmo/deploy-mmo-infrastructure/examples/proxy-health-probe-and-rotation-daemon.py +75 -0
  257. package/core/skills/mmo/deploy-mmo-infrastructure/references/proxy-pool-rotation-and-anti-detect-specs.md +45 -0
  258. package/core/skills/mmo/deploy-proxyware-fleet/SKILL.md +3 -0
  259. package/core/skills/mmo/deploy-proxyware-fleet/examples/docker-compose-depin-light-node-fleet.yaml +52 -0
  260. package/core/skills/mmo/deploy-proxyware-fleet/references/depin-bandwidth-monetization-node-specs.md +43 -0
  261. package/core/skills/mmo/generate-mmo-content/SKILL.md +2 -0
  262. package/core/skills/mmo/generate-mmo-content/examples/pseo-programmatic-page-generator.ts +76 -0
  263. package/core/skills/mmo/generate-mmo-content/references/pseo-landing-pages-and-social-video-hooks.md +39 -0
  264. package/core/skills/mmo/manage-mmo-assets/SKILL.md +2 -0
  265. package/core/skills/mmo/manage-mmo-assets/examples/mmo-asset-vault-manager.py +63 -0
  266. package/core/skills/mmo/manage-mmo-assets/references/mmo-asset-rbac-and-vault-isolation.md +38 -0
  267. package/core/skills/mmo/setup-tracking-system/SKILL.md +2 -0
  268. package/core/skills/mmo/setup-tracking-system/examples/meta-capi-s2s-event-dispatcher.ts +79 -0
  269. package/core/skills/mmo/setup-tracking-system/references/server-to-server-postback-and-capi-specs.md +45 -0
  270. package/core/skills/mobile/deploy-mobile-app/SKILL.md +1 -0
  271. package/core/skills/mobile/develop-mobile-app/SKILL.md +1 -0
  272. package/core/skills/platform/add-telemetry-instrumentation/SKILL.md +2 -0
  273. package/core/skills/platform/add-telemetry-instrumentation/examples/kratos-otel-middleware-instrumentation.go +87 -0
  274. package/core/skills/platform/add-telemetry-instrumentation/references/opentelemetry-semantic-conventions-2026.md +37 -0
  275. package/core/skills/platform/agents-sdk/SKILL.md +1 -0
  276. package/core/skills/platform/aws-infrastructure/SKILL.md +2 -0
  277. package/core/skills/platform/aws-infrastructure/examples/opentofu-eks-pod-identity-vpc.tf +101 -0
  278. package/core/skills/platform/aws-infrastructure/references/opentofu-aws-zero-trust-and-irsa.md +40 -0
  279. package/core/skills/platform/cloudflare-email-service/SKILL.md +2 -2
  280. package/core/skills/platform/configure-ci-cd-pipeline/SKILL.md +83 -0
  281. package/core/skills/platform/configure-ci-cd-pipeline/examples/hardened-ci-matrix-workflow.yml +33 -0
  282. package/core/skills/platform/configure-ci-cd-pipeline/references/github-actions-sha-pinning-and-slsa-specs.md +22 -0
  283. package/core/skills/platform/configure-ci-cd-pipeline/scripts/audit_workflow_pinning.py +74 -0
  284. package/core/skills/platform/debug-runtime-platform/SKILL.md +1 -2
  285. package/core/skills/platform/debug-workers-edge/SKILL.md +2 -2
  286. package/core/skills/platform/durable-objects/SKILL.md +1 -0
  287. package/core/skills/platform/orchestrate-chaos-experiment/SKILL.md +1 -0
  288. package/core/skills/platform/sandbox-sdk/SKILL.md +1 -0
  289. package/core/skills/platform/setup-deployment/SKILL.md +6 -2
  290. package/core/skills/platform/setup-deployment/examples/kustomize-production-service-manifests.yaml +123 -0
  291. package/core/skills/platform/setup-deployment/references/interactive-hitl-wizard.md +55 -0
  292. package/core/skills/platform/setup-deployment/references/k8s-gitops-and-kustomize-invariants.md +40 -0
  293. package/core/skills/platform/setup-gpu-finops/SKILL.md +2 -0
  294. package/core/skills/platform/setup-gpu-finops/examples/gpu-finops-prometheus-rules.yaml +23 -0
  295. package/core/skills/platform/setup-gpu-finops/references/dcgm-kubecost-gpu-attribution-specs.md +16 -0
  296. package/core/skills/platform/setup-llm-gateway/SKILL.md +2 -0
  297. package/core/skills/platform/setup-llm-gateway/examples/litellm-gateway-config.yaml +28 -0
  298. package/core/skills/platform/setup-llm-gateway/references/litellm-routing-budget-failover-specs.md +16 -0
  299. package/core/skills/platform/supply-chain-security/SKILL.md +3 -2
  300. package/core/skills/platform/supply-chain-security/examples/github-actions-sbom-cosign.yaml +57 -0
  301. package/core/skills/platform/supply-chain-security/references/slsa-provenance-and-sbom-sigstore.md +60 -0
  302. package/core/skills/platform/turnstile-spin/SKILL.md +2 -2
  303. package/core/skills/platform/web-perf/SKILL.md +2 -2
  304. package/core/skills/platform/workers-best-practices/SKILL.md +1 -0
  305. package/core/skills/platform/wrangler/SKILL.md +1 -0
  306. package/core/skills/product/build-story-map/SKILL.md +3 -0
  307. package/core/skills/product/define-product-strategy/SKILL.md +1 -0
  308. package/core/skills/product/model-saas-metrics/SKILL.md +1 -0
  309. package/core/skills/product/prioritize-roadmap/SKILL.md +1 -0
  310. package/core/skills/repo-ops/commit-code/SKILL.md +1 -0
  311. package/core/skills/repo-ops/navigate-service/SKILL.md +28 -132
  312. package/core/skills/repo-ops/navigate-service/examples/service-boundary-map-example.md +14 -0
  313. package/core/skills/repo-ops/navigate-service/references/service-topology-mapping-guide.md +18 -0
  314. package/core/skills/repo-ops/review-code/SKILL.md +12 -2
  315. package/core/skills/repo-ops/review-code/examples/adversarial-two-axis-pr-review.md +167 -0
  316. package/core/skills/repo-ops/review-code/examples/ai-vibe-slop-remediation.md +220 -0
  317. package/core/skills/repo-ops/review-code/references/supply-chain-and-migration-safety.md +103 -0
  318. package/core/skills/repo-ops/review-service/SKILL.md +4 -1
  319. package/core/skills/repo-ops/review-service/examples/service-release-audit-report.md +21 -0
  320. package/core/skills/repo-ops/review-service/references/release-readiness-audit-rubric.md +21 -0
  321. package/core/skills/repo-ops/troubleshoot-service/SKILL.md +1 -0
  322. package/core/skills/security-data/database-maintenance/SKILL.md +1 -1
  323. package/core/skills/security-data/manage-secrets/SKILL.md +2 -0
  324. package/core/skills/security-data/manage-secrets/examples/external-secrets-vault-crds.yaml +53 -0
  325. package/core/skills/security-data/manage-secrets/references/zero-trust-secret-rotation-and-eso.md +30 -0
  326. package/core/skills/security-data/manage-vietnam-accounting/SKILL.md +8 -7
  327. package/core/skills/security-data/prompt-injection-defense/SKILL.md +2 -0
  328. package/core/skills/security-data/prompt-injection-defense/examples/bounded-tool-execution-wrapper.py +78 -0
  329. package/core/skills/security-data/prompt-injection-defense/references/prompt-injection-taxonomy-and-delimiters.md +37 -0
  330. package/core/skills/security-data/reverse-engineer-binary/SKILL.md +3 -0
  331. package/core/skills/security-data/reverse-engineer-binary/examples/binary-triage-and-vulnerability-dossier.md +58 -0
  332. package/core/skills/security-data/reverse-engineer-binary/references/ghidra-radare2-and-rea-evidence-ledgers.md +43 -0
  333. package/core/skills/security-data/security-audit/SKILL.md +3 -1
  334. package/core/skills/security-data/security-audit/examples/enterprise-service-security-audit-report.md +54 -0
  335. package/core/skills/security-data/security-audit/references/owasp-asi-and-cvss4-threat-modeling.md +39 -0
  336. package/core/skills/security-data/skill-preflight-ast-check/SKILL.md +3 -0
  337. package/core/skills/security-data/skill-preflight-ast-check/references/ast-lethal-trifecta-and-static-vetting.md +38 -0
  338. package/core/skills/security-data/skill-preflight-ast-check/scripts/scan-skill-ast.py +127 -0
  339. package/core/skills/seo/audit-technical-seo/SKILL.md +1 -0
  340. package/core/skills/seo/implement-schema-markup/SKILL.md +1 -0
  341. package/core/workflows/README.md +0 -20
  342. package/overlays/README.md +2 -22
  343. package/overlays/astro-cloudflare/README.md +0 -20
  344. package/overlays/astro-cloudflare/rules/astro-cloudflare-conventions.md +0 -31
  345. package/overlays/b2b-catalog-golf/README.md +0 -20
  346. package/overlays/b2b-catalog-golf/rules/golf-project-rules.md +0 -31
  347. package/overlays/b2b-catalog-golf/skills/develop-b2b-golf-feature/SKILL.md +1 -0
  348. package/overlays/b2b-factory-catalog/README.md +0 -20
  349. package/overlays/b2b-factory-catalog/rules/icm-project-rules.md +0 -31
  350. package/overlays/b2b-factory-catalog/skills/develop-b2b-catalog-feature/SKILL.md +1 -0
  351. package/overlays/b2b-sport-catalog/README.md +0 -20
  352. package/overlays/b2b-sport-catalog/rules/sport-project-rules.md +0 -31
  353. package/overlays/cad-projection/README.md +0 -20
  354. package/overlays/cad-projection/rules/cad-conventions.md +0 -20
  355. package/overlays/cad-projection/skills/isometric-svg-projection/SKILL.md +1 -0
  356. package/overlays/data-analyst-stack/README.md +0 -20
  357. package/overlays/data-analyst-stack/rules/metric-dashboard-templates.md +0 -31
  358. package/overlays/data-analyst-stack/rules/stack-conventions.md +0 -31
  359. package/overlays/data-warehouse/README.md +0 -22
  360. package/overlays/data-warehouse/learning/learning-conventions.md +0 -31
  361. package/overlays/data-warehouse/learning/phase-roadmap.md +0 -31
  362. package/overlays/data-warehouse/rules/amis-accounting-standards.md +0 -33
  363. package/overlays/data-warehouse/rules/duckdb-concurrency.md +0 -37
  364. package/overlays/data-warehouse/rules/pii-scrubbing.md +0 -37
  365. package/overlays/data-warehouse/rules/stocktake-tolerance.md +0 -33
  366. package/overlays/ecommerce-microservices/README.md +22 -35
  367. package/overlays/ecommerce-microservices/config/README.md +3 -1
  368. package/overlays/ecommerce-microservices/rules/README.md +2 -1
  369. package/overlays/ecommerce-microservices/rules/microservices-conventions.md +30 -0
  370. package/overlays/ecommerce-microservices/skills/README.md +1 -1
  371. package/overlays/ecommerce-microservices/workflows/README.md +3 -1
  372. package/overlays/fintech-compliance/README.md +0 -20
  373. package/overlays/fintech-compliance/rules/credit-scorecard-rules.md +0 -20
  374. package/overlays/fintech-compliance/skills/build-credit-scorecard/SKILL.md +1 -0
  375. package/overlays/go-microservices/README.md +1 -21
  376. package/overlays/go-microservices/rules/go-conventions.md +0 -31
  377. package/overlays/hugo-authority-content/README.md +0 -20
  378. package/overlays/hugo-authority-content/roles/README.md +0 -20
  379. package/overlays/hugo-authority-content/rules/content-brand.md +0 -30
  380. package/overlays/hugo-authority-content/rules/link-topology.md +0 -30
  381. package/overlays/hugo-authority-content/rules/seo-authority.md +0 -30
  382. package/overlays/hugo-authority-content/rules/technical-article-2027.md +0 -30
  383. package/overlays/hugo-authority-content/skills/audit-technical-article/SKILL.md +1 -0
  384. package/overlays/hugo-authority-content/skills/write-hugo-twin-content/SKILL.md +1 -0
  385. package/overlays/hugo-authority-content/workflows/README.md +0 -20
  386. package/overlays/hvac-authority-content/README.md +0 -20
  387. package/overlays/hvac-authority-content/config/collections.md +0 -22
  388. package/overlays/hvac-authority-content/rules/content-schema.md +0 -30
  389. package/overlays/hvac-authority-content/rules/hvac-engineering-standards.md +0 -30
  390. package/overlays/hvac-authority-content/rules/silo-linking.md +0 -30
  391. package/overlays/hvac-authority-content/skills/write-hvac-authority-content/SKILL.md +1 -0
  392. package/overlays/hvac-authority-content/workflows/publish-hvac-content.md +0 -22
  393. package/overlays/laravel-ecommerce/README.md +0 -20
  394. package/overlays/laravel-ecommerce/rules/elomus-design-system.md +0 -31
  395. package/overlays/laravel-ecommerce/rules/laravel-ecommerce-rules.md +0 -31
  396. package/overlays/laravel-ecommerce/skills/develop-laravel-ecommerce-feature/SKILL.md +1 -0
  397. package/overlays/laravel-filament/README.md +0 -20
  398. package/overlays/laravel-filament/rules/laravel-conventions.md +0 -31
  399. package/overlays/laravel-filament/skills/develop-laravel-feature/SKILL.md +1 -0
  400. package/overlays/livestream-web/README.md +0 -20
  401. package/overlays/livestream-web/rules/livestream-web-ux-conventions.md +0 -31
  402. package/overlays/obj-configurator/README.md +0 -20
  403. package/overlays/obj-configurator/rules/obj-project-rules.md +0 -31
  404. package/overlays/obj-configurator/skills/develop-obj-feature/SKILL.md +1 -0
  405. package/overlays/r3f-stack/README.md +0 -20
  406. package/overlays/r3f-stack/rules/stub.md +0 -31
  407. package/overlays/r3f-stack/skills/debug-3d-scene/SKILL.md +4 -2
  408. package/overlays/r3f-stack/skills/integrate-r3f-three-legacy/SKILL.md +6 -5
  409. package/overlays/r3f-stack/skills/optimize-3d-assets/SKILL.md +4 -3
  410. package/overlays/real-estate-content/README.md +0 -20
  411. package/overlays/real-estate-content/roles/README.md +0 -20
  412. package/overlays/real-estate-content/rules/affiliate-links.md +0 -31
  413. package/overlays/real-estate-content/rules/content-schema.md +0 -31
  414. package/overlays/real-estate-content/rules/seo-baseline.md +0 -31
  415. package/overlays/real-estate-content/skills/write-real-estate-astro-data/SKILL.md +1 -0
  416. package/overlays/real-estate-content/workflows/README.md +0 -20
  417. package/overlays/security-research/README.md +0 -20
  418. package/overlays/security-research/rules/reverse-engineering-rules.md +0 -20
  419. package/overlays/seo-publishing/README.md +1 -21
  420. package/overlays/seo-publishing/rules/publish-log-conventions.md +0 -31
  421. package/overlays/seo-publishing/rules/publishing-cadence.md +0 -31
  422. package/overlays/seo-publishing/rules/site-mix-and-cannibalization.md +0 -31
  423. package/overlays/seo-publishing/rules/topic-board-template.md +0 -31
  424. package/overlays/ui-design-system/README.md +0 -20
  425. package/overlays/ui-design-system/rules/handoff-conventions.md +0 -31
  426. package/package.json +2 -2
  427. package/packs/README.md +3 -9
  428. package/packs/ecommerce-team/manifest.yaml +1 -1
  429. package/core/skills/commerce/2026_STANDARDS_SUMMARY.md +0 -316
  430. package/core/skills/commerce/handle-checkout-flow/UPGRADE_PLAN_2026.md +0 -99
  431. package/core/skills/commerce/integrate-payment-gateway/UPGRADE_PLAN_2026.md +0 -128
  432. package/core/skills/commerce/manage-order-fulfillment/UPGRADE_PLAN_2026.md +0 -136
  433. package/core/skills/commerce/manage-product-catalog/UPGRADE_PLAN_2026.md +0 -130
  434. package/core/skills/education/2026_STANDARDS_SUMMARY.md +0 -290
  435. package/core/skills/education/create-exercises/UPGRADE_PLAN_2026.md +0 -115
  436. package/core/skills/education/design-learning-plan/UPGRADE_PLAN_2026.md +0 -140
  437. package/core/skills/education/grade-and-review/UPGRADE_PLAN_2026.md +0 -141
  438. package/core/skills/frontend/2026_STANDARDS_SUMMARY.md +0 -345
  439. package/core/skills/frontend/add-page-route/UPGRADE_PLAN_2026.md +0 -102
  440. package/core/skills/frontend/add-ui-component/UPGRADE_PLAN_2026.md +0 -114
  441. package/core/skills/frontend/component-composition/UPGRADE_PLAN_2026.md +0 -103
  442. package/core/skills/frontend/frontend-testing/UPGRADE_PLAN_2026.md +0 -137
  443. package/core/skills/frontend/implement-view-transitions/UPGRADE_PLAN_2026.md +0 -118
  444. package/core/skills/frontend/implement-webmcp/UPGRADE_PLAN_2026.md +0 -108
  445. package/core/skills/frontend/integrate-api-client/UPGRADE_PLAN_2026.md +0 -118
  446. package/core/skills/frontend/setup-design-system/UPGRADE_PLAN_2026.md +0 -123
  447. package/core/skills/frontend/setup-visual-regression/UPGRADE_PLAN_2026.md +0 -121
  448. package/core/skills/meetings-analysis/2026_STANDARDS_SUMMARY.md +0 -236
  449. package/core/skills/meetings-analysis/analyze-business-requirements/UPGRADE_PLAN_2026.md +0 -97
  450. package/core/skills/meetings-analysis/analyze-data/UPGRADE_PLAN_2026.md +0 -143
  451. package/core/skills/meetings-analysis/meeting-review/UPGRADE_PLAN_2026.md +0 -125
  452. package/core/skills/mobile/2026_STANDARDS_SUMMARY.md +0 -209
  453. package/core/skills/mobile/deploy-mobile-app/UPGRADE_PLAN_2026.md +0 -122
  454. package/core/skills/mobile/develop-mobile-app/UPGRADE_PLAN_2026.md +0 -141
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: navigate-service
3
3
  description: Navigate and understand an unfamiliar service by mapping its entrypoints, core flows, dependencies, and delivery boundaries. Use when exploring a service, locating behavior, or gathering context before a change, review, or debug session.
4
+ version: "1.0.0"
4
5
  allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_tests, run_linter, run_build, run_dev_server, execute_command]
5
6
  ---
6
7
 
@@ -31,155 +32,48 @@ Use this skill when the user asks to understand, explore, or orient within a spe
31
32
 
32
33
  ## Output Contracts
33
34
 
34
- When the navigation summary is consumed by a review, planning, or
35
- multi-role handoff, emit:
35
+ When the navigation summary is consumed by a review, planning, or multi-role handoff, emit:
36
36
 
37
- - **`contracts/schemas/coordination-plan.json`** adapted for navigation: capture the service boundary, the entrypoints, the dependencies, the open questions, and the assumptions. The receiving agent can then plan the change without redoing the exploration.
38
- - For human-readable reports, the markdown summary already documented is the canonical format.
39
- - The summary must distinguish confirmed facts from assumptions; downstream agents must be able to trust the fact/assumption boundary.
37
+ - **`contracts/schemas/coordination-plan.json`** adapted for navigation: capture the service boundary, entrypoints, dependencies, open questions, and confirmed facts vs assumptions.
38
+ - Skip emission for trivial lookups that do not cross a role boundary.
40
39
 
41
- Skip emission for trivial lookups that do not cross a role boundary.
40
+ ## Operating Principles & Triggers
42
41
 
43
- ## Failure Modes
44
-
45
- - **Wrong file from AI tool**: an AI code-search tool returns a file that doesn't actually contain the behavior. Mitigation: verify every AI-suggested file against the actual source before recording it in the summary.
46
- - **Stale OpenAPI/AsyncAPI spec**: the OpenAPI/AsyncAPI spec referenced as the service map is out of date. Mitigation: regenerate the spec from code; do not trust a stale spec.
47
- - **Assumption recorded as fact**: an unverified claim is recorded as a confirmed fact. Mitigation: separate confirmed facts from assumptions in the summary; mark every unverified claim explicitly.
48
- - **Missing boundary**: the service boundary is misidentified, missing a downstream consumer. Mitigation: trace entrypoints to persistence; cross-check with the deployment manifest.
49
- - **Internal workflow wording in summary**: the summary mentions agent names or AI workflow. Mitigation: treat the summary as a user-visible artifact; strip internal terms.
50
- - **Secret or PII in summary**: a credential or customer identifier is pasted into the summary. Mitigation: reference secret names only; classify customer-affecting boundaries with `data-classification.yaml`.
51
- - **Service map missing**: the repo has no OpenAPI/AsyncAPI spec and no service map. Mitigation: generate the spec from code as the first navigation artifact.
52
- - **Layout assumed from prior experience**: the summary assumes a fixed folder layout or framework. Mitigation: discover boundaries from the codebase, not from prior expectations.
53
-
54
- ## Navigation Triggers
55
-
56
- - the user asks how a service works
57
- - the user needs to find where a behavior is implemented
58
- - the user is new to a service and needs fast orientation
59
- - before making changes, so the local architecture is understood first
60
- - during review or troubleshooting, when code context is incomplete
61
-
62
- ## Operating Assumptions
63
-
64
- This skill is intentionally repo-agnostic.
65
-
66
- - assume a service-oriented codebase, but not a fixed framework
67
- - do not assume a fixed folder layout or service inventory
68
- - prefer repo-local structure over generic examples
69
- - discover boundaries from the codebase instead of from prior expectations
70
-
71
- ## Navigation Goals
72
-
73
- When using this skill, answer these questions as quickly as possible:
74
-
75
- 1. What does this service own?
76
- 2. What are its public entrypoints?
77
- 3. Where does the core business logic live?
78
- 4. What data stores or external systems does it depend on?
79
- 5. What other services or packages does it call?
80
- 6. What configuration, rollout, or runtime constraints matter?
42
+ Use this repo-agnostic skill when exploring an unfamiliar service, locating behavior, or pre-flighting review/debug work:
43
+ - Discover boundaries, folder layout, and frameworks directly from repo-local files rather than prior assumptions.
44
+ - Answer: what does it own, what are its public entrypoints, where does core logic live, what data stores/external dependencies exist, and what config/runtime constraints apply?
81
45
 
82
46
  ## Suggested Process
83
47
 
84
- Adapt the order to the target repo, but usually start here:
85
-
86
- ### Step 1: Identify the Service Boundary
87
-
88
- - find the service or component directory
89
- - check `README`, package docs, or service docs if present
90
- - identify the main runtime entrypoint or bootstrap path
91
-
92
- ### Step 2: Find Entrypoints
93
-
94
- Look for the files or packages that define how requests, jobs, or messages enter the service:
95
-
96
- - HTTP or RPC handlers
97
- - background jobs or workers
98
- - event consumers or subscribers
99
- - CLI entrypoints or scheduled tasks
48
+ Adapt the order to the target repo, starting here:
100
49
 
101
- ### Step 3: Map Core Business Flow
50
+ ### Step 1: Identify Service Boundary & Entrypoints
51
+ - Locate service root, `README`, bootstrap path, HTTP/RPC handlers, workers/consumers, CLI commands, and cron jobs.
102
52
 
103
- Locate the path from entrypoint to decision-making logic:
53
+ ### Step 2: Map Core Flow & Persistence State
54
+ - Trace entrypoint → handler → domain/use-case logic → repositories, migrations, caches, and storage adapters (without assuming fixed folder names).
104
55
 
105
- - boundary or handler layer
106
- - use case or domain layer
107
- - persistence or adapter layer
108
-
109
- Do not assume the repo uses names like `service`, `biz`, or `data`. Follow the actual structure.
110
-
111
- ### Step 4: Inspect Persistence and State
112
-
113
- Check where the service reads or writes state:
114
-
115
- - repositories or query packages
116
- - migrations or schema definitions
117
- - cache integrations
118
- - outbound storage adapters
119
-
120
- ### Step 5: Identify External Dependencies
121
-
122
- Look for:
123
-
124
- - service clients
125
- - SDK integrations
126
- - event publishing
127
- - shared internal packages
128
- - environment and config dependencies
129
-
130
- ### Step 6: Check Runtime and Delivery Context
131
-
132
- Review the local source of truth for:
133
-
134
- - configuration
135
- - environment variables
136
- - health or readiness behavior
137
- - build, generation, or release steps
138
-
139
- ## What to Extract
140
-
141
- When you finish exploration, you should be able to summarize:
142
-
143
- - service purpose
144
- - primary user or system-facing capabilities
145
- - main code path for the feature in question
146
- - key dependencies and side effects
147
- - important constraints, risks, or unknowns
56
+ ### Step 3: Identify External Dependencies & Runtime Context
57
+ - Map outbound HTTP/RPC clients, SDKs, event publishers, shared packages, env vars, health/readiness probes, and build/release configs.
148
58
 
149
59
  ## Output Format
150
60
 
151
- When presenting a service overview, structure the response like this:
152
-
153
- 1. Service purpose
154
- 2. Entrypoints and primary flows
155
- 3. Core business logic location
156
- 4. State and persistence model
157
- 5. External dependencies
158
- 6. Configuration and runtime considerations
159
- 7. Risks, assumptions, and open questions
61
+ Structure service overviews as: 1) Service purpose, 2) Entrypoints & primary flows, 3) Core business logic location, 4) State & persistence model, 5) External dependencies, 6) Configuration & runtime constraints, 7) Confirmed facts vs assumptions & open questions.
160
62
 
161
63
  ## Checklist
162
64
 
163
- - [ ] service boundary identified
164
- - [ ] main entrypoints located
165
- - [ ] local docs or service notes checked
166
- - [ ] main business flow mapped
167
- - [ ] persistence layer located
168
- - [ ] external dependencies identified
169
- - [ ] config source reviewed
170
- - [ ] build or generation steps noted
171
- - [ ] rollout or runtime constraints noted
65
+ - [ ] service boundary and main entrypoints located
66
+ - [ ] local docs, OpenAPI/AsyncAPI specs, and runtime topology reviewed
67
+ - [ ] main business flow, persistence layer, and external dependencies mapped
68
+ - [ ] config source, build steps, and rollout/runtime constraints noted
69
+ - [ ] confirmed facts separated from assumptions (zero secrets/PII in summary)
172
70
 
173
- ## Quick Reference
174
-
175
- Use this when the request is narrow and you need fast orientation:
71
+ ## Failure Modes
176
72
 
177
- - identify the service directory
178
- - find the main entrypoint
179
- - trace one important request or job flow
180
- - note persistence touchpoints
181
- - note outbound dependencies
182
- - summarize risks or unknowns
73
+ - **Wrong file from AI search**: AI tools misattribute behavior. Mitigation: verify every suggested file against source before citing.
74
+ - **Stale OpenAPI/AsyncAPI spec**: spec diverges from runtime routes. Mitigation: inspect actual route handlers and regenerate specs when needed.
75
+ - **Assumption recorded as fact**: unverified claims mislead downstream plans. Mitigation: mark confirmed facts vs assumptions explicitly.
76
+ - **Secret or PII leakage in map**: credentials pasted into navigation docs. Mitigation: reference secret names only and tag PII with `data-classification.yaml`.
183
77
 
184
78
  ## Security Guardrails (OWASP ASI)
185
79
 
@@ -196,4 +90,6 @@ Use this when the request is narrow and you need fast orientation:
196
90
  - **review-code**: Inspect implementation details after exploration
197
91
  - **write-tests**: Add coverage once the target flow is understood
198
92
  - **meeting-review**: Run a structured cross-role review
93
+ - Companion reference: [`references/service-topology-mapping-guide.md`](references/service-topology-mapping-guide.md)
94
+ - Companion example: [`examples/service-boundary-map-example.md`](examples/service-boundary-map-example.md)
199
95
 
@@ -0,0 +1,14 @@
1
+ # Service Boundary Map Example: `billing-service`
2
+
3
+ ## 1. Confirmed Facts (`[CONFIRMED]`)
4
+ - **Service Purpose**: Owns invoice issuance, tax snapshots, and ledger settlement state.
5
+ - **HTTP Entrypoints**: `internal/server/http.go` -> `POST /v1/invoices`, `GET /v1/invoices/{id}`, `GET /healthz`.
6
+ - **Event Consumers**: `internal/worker/payment_consumer.go` (`com.example.payment.settled.v1`, idempotent on `event.id`).
7
+ - **Core Domain Logic**: `internal/biz/invoice_usecase.go` (enforces `draft -> issued -> paid` state transitions inside `InTx`).
8
+ - **Persistence**: PostgreSQL tables `invoices`, `invoice_lines`, `outbox_events` (`migrations/0004_invoices.sql`); Redis key prefix `invoice:lock:*` (`TTL 30s`).
9
+ - **Outbound Dependencies**: Tax calculation gRPC client (`internal/data/tax_client.go`, `timeout=2000ms`), Kafka outbox topic `billing.events.v1`.
10
+ - **Configuration Keys**: `DB_POOL_DSN`, `TAX_GRPC_ADDR`, `SIGNING_KEY_SECRET_REF` (values omitted per `data-classification.yaml`).
11
+
12
+ ## 2. Assumptions & Open Questions (`[UNVERIFIED]`)
13
+ - **Open Question**: Whether `legacy-cron/nightly_reconcile.sh` still runs against production replica or was retired in v2.4.
14
+ - **Blast Radius Note**: Renaming JSON fields in `GET /v1/invoices/{id}` impacts `frontend-portal` and `pdf-renderer-worker`.
@@ -0,0 +1,18 @@
1
+ # Service Topology Mapping Guide
2
+
3
+ Normative reference for `navigate-service`: rapid boundary discovery, entrypoint-to-persistence tracing, confirmed-facts vs assumptions separation, and secret redaction.
4
+
5
+ ## 1. Six-Question Discovery Protocol
6
+
7
+ 1. **Ownership**: Service root directory, package manifest, domain entities owned exclusively here.
8
+ 2. **Entrypoints**: HTTP/gRPC routers, GraphQL resolvers, cron schedules, queue consumers, CLI commands, and OpenAPI/AsyncAPI specs.
9
+ 3. **Domain Core**: Business rules, state machines, and invariants decoupled from transport and storage.
10
+ 4. **Persistence & State**: Relational tables, migrations, Redis keys/Lua scripts, object storage buckets, outbox tables.
11
+ 5. **External Dependencies**: Outbound service clients, payment/auth providers, emitted events, shared internal libraries.
12
+ 6. **Runtime Context**: Health/readiness probes, feature flags, environment config names (names ONLY — zero secret values), and deployment manifests.
13
+
14
+ ## 2. Anti-Hallucination & Security Rules
15
+
16
+ - **Verify AI Search Hits**: Never record a file path returned by natural-language search without reading the actual declaration in source.
17
+ - **Fact vs Assumption Boundary**: Separate `[CONFIRMED]` (verified line numbers/symbols) from `[ASSUMED / UNVERIFIED]` so downstream planning agents do not treat guesses as truth.
18
+ - **Zero Secret Leakage**: Classify PII/credential boundaries with `core/policies/data-classification.yaml` and emit variable names only.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: review-code
3
- description: Review a diff since a fixed point along two separate axes — Standards (does the code follow this repo's documented standards plus a fixed smell baseline?) and Spec (does it faithfully implement the originating issue or spec?). Runs both axes as parallel sub-agents and reports them side by side without reranking. Use for PR reviews, "review since X", local change reviews, and pre-merge audits.
3
+ description: Review a diff since a fixed point along two separate axes — Standards (conformance to documented standards and smell baseline) and Spec (faithful requirement delivery) — reported side by side without reranking. Use when performing PR reviews, 'review since X' audits, local change reviews, adversarial anti-slop checks, or pre-merge gates.
4
+ version: "1.0.0"
4
5
  allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_tests, run_linter, run_build, execute_command]
5
6
  ---
6
7
 
@@ -19,7 +20,7 @@ Use this skill to perform adversarial code reviews across two independent axes (
19
20
  ## Core Rules
20
21
 
21
22
  - **Adversarial anti-slop review**: assume diffs may pass CI superficially; rigorously probe for phantom validations, silent error swallowing (`catch { return null; }`), mock collusion, and hollow abstractions per [`references/adversarial-review-rubric.md`](references/adversarial-review-rubric.md)
22
- - **Two-axis independence**: evaluate **Standards** (coding standards + smell baseline) and **Spec** (faithful requirement delivery) as parallel, unmerged streams; never cross-rank or allow one axis to mask the other
23
+ - **Two-axis independence & 12 Fowler Smells Baseline**: evaluate **Standards** (conformance + 12 Fowler smells: *Duplicated Code, Long Function, Long Parameter List, Divergent Change, Shotgun Surgery, Feature Envy, Data Clumps, Primitive Obsession, Repeated Switches, Loops, Lazy Element, Speculative Generality*) and **Spec** (faithful requirement delivery) as parallel, unmerged streams (each summary ≤400 words); classify each finding as **Hard Breach** vs **Judgement Call**, tag risk as **1-Way Door** (irreversible) vs **2-Way Door** (reversible), and never cross-rank axes
23
24
  - **AI bug heuristics**: actively search for AI defect signatures: hallucinated APIs/flags, subtle async race conditions, context-window truncation (dropped switch branches), and over-defensive null coalescing
24
25
  - **Systematic resource leak audit**: inspect every lifecycle boundary for unclosed HTTP response bodies, file descriptors, unmanaged background goroutines/threads, unbounded memory caches, and DB connection pool starvation
25
26
  - **Backward compatibility & wire safety**: enforce zero-downtime Expand/Contract patterns on database migrations; reject breaking wire schema modifications on active API versions
@@ -66,6 +67,15 @@ Present findings side by side under `## Standards` and `## Spec` headings withou
66
67
  - [ ] supply chain security verified (no typosquatted packages, unpinned versions, or untrusted install hooks)
67
68
  - [ ] `code-review-finding.json` emitted for cross-role handoff when gating merge
68
69
 
70
+ ## Red Flags
71
+
72
+ | Rationalization Thought | Positive Corrective Action |
73
+ |---|---|
74
+ | "Diff is small and CI is green — LGTM." | Probe for phantom validations, silent error swallowing, resource leaks, and spec drift before approving. |
75
+ | "Merge Standards and Spec into one prioritized list." | Report `## Standards` and `## Spec` side by side with `file:line` citations and zero cross-axis reranking. |
76
+ | "The reviewer suggested X, so I'll apply it blindly." | Verify every incoming review comment against live code and spec; push back with technical evidence if it breaks an invariant. |
77
+ | "I'll narrate the diff instead of citing evidence." | Anchor every finding to exact `file:line`, violated rule/spec clause, and concrete remediation. |
78
+
69
79
  ## Output Contracts
70
80
 
71
81
  When the review produces a structured handoff (CI gate, pre-merge audit, or multi-role delivery), emit:
@@ -0,0 +1,167 @@
1
+ # Worked Example: Adversarial Two-Axis Code Review Walkthrough
2
+
3
+ This worked example demonstrates an Adversarial Two-Axis Pull Request Review of an AI-generated pull request, contrasting Standards (code smells, concurrency, security, resource leaks) against Specification (contract conformance, edge cases), and emitting the standard `contracts/schemas/code-review-finding.json` payload.
4
+
5
+ ---
6
+
7
+ ## 1. Incoming Pull Request Diff (`PR #418: Add User Profile Sync`)
8
+
9
+ ```diff
10
+ --- a/package.json
11
+ +++ b/package.json
12
+ @@ -24,7 +24,8 @@
13
+ "express": "^4.21.0",
14
+ - "zod": "^3.23.0"
15
+ + "zod": "^3.23.0",
16
+ + "telemetry-collect": "^0.1.2"
17
+ }
18
+ }
19
+
20
+ --- a/src/services/user-sync.ts
21
+ +++ b/src/services/user-sync.ts
22
+ @@ -10,18 +10,38 @@
23
+ export class UserSyncService {
24
+ constructor(private db: Database, private client: HttpClient) {}
25
+
26
+ + async syncUserProfile(userId: string, payload: any): Promise<any> {
27
+ + // Validate email format
28
+ + if (payload.email) {
29
+ + /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(payload.email);
30
+ + }
31
+ +
32
+ + // Fetch current user from external CRM
33
+ + const response = await this.client.get(`https://crm.internal/api/v1/users/${userId}`);
34
+ + // Note: Stream not closed
35
+ + const crmData = await response.json();
36
+ +
37
+ + // Update local database
38
+ + try {
39
+ + const updated = await this.db.users.update({
40
+ + where: { id: userId },
41
+ + data: {
42
+ + email: payload.email || crmData.email,
43
+ + name: payload.name || crmData.name
44
+ + }
45
+ + });
46
+ + return updated;
47
+ + } catch (err) {
48
+ + // Silent error swallowing
49
+ + return null;
50
+ + }
51
+ + }
52
+ ```
53
+
54
+ ---
55
+
56
+ ## 2. Axis 1 — Standards Sub-Agent Report
57
+
58
+ ```markdown
59
+ ### Standards Review Findings
60
+
61
+ 1. **[Fowler Smell: Dead Code / Phantom Validation]** (`src/services/user-sync.ts:15`)
62
+ - **Finding**: `/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(payload.email);` evaluates the regular expression, but the boolean result is completely discarded. Invalid emails silently pass through to the database.
63
+ - **Remediation**: Check the return value or replace with schema-first validation: `if (!EMAIL_REGEX.test(payload.email)) throw new ValidationError("Invalid email format");`.
64
+
65
+ 2. **[Resource Leak: Unclosed HTTP Stream]** (`src/services/user-sync.ts:19`)
66
+ - **Finding**: `this.client.get` opens an HTTP connection. If `response.json()` throws a JSON parse exception, the underlying socket handle is not destroyed, leading to connection pool exhaustion under load.
67
+ - **Remediation**: Wrap in `try ... finally` and invoke `response.body.destroy()` or use an auto-disposing HTTP client.
68
+
69
+ 3. **[AI Anti-Pattern: Silent Error Swallowing]** (`src/services/user-sync.ts:33`)
70
+ - **Finding**: Indiscriminate `catch (err) { return null; }` suppresses database unique constraint violations, connection timeouts, and disk failures, returning `null` as if the update succeeded.
71
+ - **Remediation**: Catch specific business errors, rethrow unexpected exceptions, and propagate an RFC 9457 structured problem details envelope.
72
+
73
+ 4. **[Supply Chain Hazard: Unpinned & Unverified Dependency]** (`package.json:28`)
74
+ - **Finding**: Introduces `telemetry-collect: ^0.1.2`. Package has no repository stars, was published 48 hours ago, and uses loose carat (`^`) pinning.
75
+ - **Remediation**: Remove dependency immediately. Re-evaluate utility against vetted organizational libraries.
76
+ ```
77
+
78
+ ---
79
+
80
+ ## 3. Axis 2 — Specification Sub-Agent Report
81
+
82
+ ```markdown
83
+ ### Specification Review Findings
84
+
85
+ 1. **[Missing Acceptance Criteria: Atomic Idempotency]**
86
+ - **Finding**: Specification Requirement AC-2 mandates that concurrent sync requests for the same `userId` must not cause race conditions or overwriting with stale CRM data. The PR lacks distributed locking or version precondition checks (`If-Match` / `ETag`).
87
+
88
+ 2. **[Contract Violation: Return Types]**
89
+ - **Finding**: Feature contract `api-contract-spec.json` defines return type as `UserProfile` with mandatory `updatedAt` and `syncStatus` fields. Returning `null` on failure violates the non-nullable API schema contract.
90
+ ```
91
+
92
+ ---
93
+
94
+ ## 4. Aggregated Side-by-Side Review Report
95
+
96
+ | Axis | Domain | File & Line | Severity | Description | Actionable Suggestion |
97
+ |---|---|---|---|---|---|
98
+ | **Standards** | Correctness | `user-sync.ts:15` | `blocking` | Phantom regex validation result is discarded. | Enforce check or validate with Zod boundary schema. |
99
+ | **Standards** | Reliability | `user-sync.ts:19` | `important` | HTTP response body stream is not protected by finally cleanup. | Add scoped resource disposal. |
100
+ | **Standards** | Maintainability | `user-sync.ts:33` | `blocking` | Error swallowed returning null without logging or metrics. | Bubble up typed domain error with trace_id. |
101
+ | **Standards** | Security | `package.json:28` | `blocking` | Unvetted dependency `telemetry-collect` introduced. | Remove package and audit supply chain provenance. |
102
+ | **Spec** | Conformance | `user-sync.ts:13` | `blocking` | Lacks concurrency locks and violates return contract. | Add atomic optimistic concurrency check. |
103
+
104
+ ---
105
+
106
+ ## 5. Emitted Structured Contract Payload (`contracts/schemas/code-review-finding.json`)
107
+
108
+ ```json
109
+ {
110
+ "contract_type": "code-review-finding",
111
+ "review_id": "2026-11-08-pr-418-user-profile-sync",
112
+ "created_at": "2026-11-08T11:00:00Z",
113
+ "change_ref": "PR #418 — Add User Profile Sync",
114
+ "change_type": "feature",
115
+ "findings": [
116
+ {
117
+ "finding_id": "F-01",
118
+ "file": "src/services/user-sync.ts",
119
+ "line": 15,
120
+ "severity": "blocking",
121
+ "domain": "correctness",
122
+ "description": "Phantom regex validation: return value of RegExp.test() is discarded.",
123
+ "suggestion": "Validate with Zod schema or early-return 400 error if regex fails.",
124
+ "confidence": "confirmed"
125
+ },
126
+ {
127
+ "finding_id": "F-02",
128
+ "file": "package.json",
129
+ "line": 28,
130
+ "severity": "blocking",
131
+ "domain": "security",
132
+ "description": "Unvetted third-party package 'telemetry-collect' added with loose carat pin.",
133
+ "suggestion": "Remove dependency and require Security Lead approval for new packages.",
134
+ "confidence": "confirmed"
135
+ },
136
+ {
137
+ "finding_id": "F-03",
138
+ "file": "src/services/user-sync.ts",
139
+ "line": 33,
140
+ "severity": "blocking",
141
+ "domain": "reliability",
142
+ "description": "Silent error swallowing masks database write failures and returns null.",
143
+ "suggestion": "Remove empty catch; map to RFC 9457 structured error with trace_id.",
144
+ "confidence": "confirmed"
145
+ }
146
+ ],
147
+ "review_matrix": {
148
+ "correctness": "fail",
149
+ "security": "fail",
150
+ "data_safety": "fail",
151
+ "reliability": "fail",
152
+ "compatibility": "pass",
153
+ "maintainability": "fail",
154
+ "tests": "fail",
155
+ "observability": "fail"
156
+ },
157
+ "blast_radius_assessment": {
158
+ "shared_code_paths_checked": true,
159
+ "downstream_consumers_checked": true,
160
+ "adjacent_flows_checked": true,
161
+ "notes": "User sync affects CRM synchronization and billing notifications downstream."
162
+ },
163
+ "merge_recommendation": "request_changes",
164
+ "residual_risk": "High data corruption risk due to unvalidated input and silent database error suppression.",
165
+ "ai_code_intent_check": true
166
+ }
167
+ ```
@@ -0,0 +1,220 @@
1
+ # Worked Example: AI "Vibe Slop" Remediation Catalog
2
+
3
+ This catalog documents five canonical before-and-after remediations for insidious AI defect patterns ("vibe slop"), demonstrating how to replace cosmetic correctness with genuine software resilience.
4
+
5
+ ---
6
+
7
+ ## 1. Pattern 1: Phantom Validation vs. Verified Boundary Check
8
+
9
+ ### Before (AI Vibe Slop)
10
+ Code appears to validate input, but the result is discarded, or regex evaluates truthy unconditionally:
11
+
12
+ ```typescript
13
+ export async function registerAccount(req: Request, res: Response) {
14
+ const { email, age } = req.body;
15
+
16
+ // Phantom check: regex evaluated, return value discarded
17
+ /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
18
+
19
+ // Faulty check: age string evaluates truthy regardless of number
20
+ if (age && age > 18) {
21
+ console.log("Adult verified");
22
+ }
23
+
24
+ await db.users.create({ email, age });
25
+ res.status(201).json({ status: "created" });
26
+ }
27
+ ```
28
+
29
+ ### After (Genuine Boundary Verification)
30
+ Strict early-exit schema parsing before any business logic:
31
+
32
+ ```typescript
33
+ import { z } from "zod";
34
+
35
+ const RegistrationSchema = z.object({
36
+ email: z.string().email("Invalid email format"),
37
+ age: z.number().int().min(18, "Registrant must be at least 18 years of age")
38
+ }).strict();
39
+
40
+ export async function registerAccount(req: Request, res: Response, next: NextFunction) {
41
+ const parseResult = RegistrationSchema.safeParse(req.body);
42
+ if (!parseResult.success) {
43
+ return next(new ValidationError("Registration failed boundary check", parseResult.error.issues));
44
+ }
45
+
46
+ const { email, age } = parseResult.data;
47
+ const user = await db.users.create({ email, age });
48
+ return res.status(201).json({ id: user.id, email: user.email });
49
+ }
50
+ ```
51
+
52
+ ---
53
+
54
+ ## 2. Pattern 2: Silent Error Swallowing vs. RFC 9457 Structured Details
55
+
56
+ ### Before (AI Vibe Slop)
57
+ Indiscriminate catch block hides database corruption, network timeouts, or schema mismatches:
58
+
59
+ ```typescript
60
+ export async function getBillingProfile(userId: string) {
61
+ try {
62
+ const profile = await stripeClient.customers.retrieve(userId);
63
+ return profile;
64
+ } catch (error) {
65
+ // Slop: Swallows 401 Unauthorized, 404 Not Found, and 500 Network errors alike
66
+ return null;
67
+ }
68
+ }
69
+ ```
70
+
71
+ ### After (Explicit Error Domain Mapping)
72
+ Granular error handling mapping downstream status to RFC 9457 Problem Details:
73
+
74
+ ```typescript
75
+ export async function getBillingProfile(userId: string, traceId: string) {
76
+ try {
77
+ return await stripeClient.customers.retrieve(userId);
78
+ } catch (error: any) {
79
+ if (error.statusCode === 404) {
80
+ throw new ProblemDetailsError(
81
+ 404,
82
+ "Customer Not Found",
83
+ `No billing profile exists for customer ID '${userId}'.`,
84
+ "https://api.example.com/errors/customer-not-found"
85
+ );
86
+ }
87
+
88
+ logger.error("Downstream Stripe retrieval failed", { traceId, error, userId });
89
+ throw new ProblemDetailsError(
90
+ 502,
91
+ "Bad Gateway",
92
+ "Billing provider temporarily unavailable. Please retry shortly.",
93
+ "https://api.example.com/errors/billing-gateway-error"
94
+ );
95
+ }
96
+ }
97
+ ```
98
+
99
+ ---
100
+
101
+ ## 3. Pattern 3: Mock Collusion vs. Contract-Driven Verification
102
+
103
+ ### Before (AI Vibe Slop)
104
+ The test mocks both the dependency and the internal helper, tautologically asserting that the mock returned what was passed into it without testing real code logic:
105
+
106
+ ```typescript
107
+ test("creates order successfully", async () => {
108
+ const mockOrderService = {
109
+ create: jest.fn().mockResolvedValue({ id: "ord_1", status: "PENDING" })
110
+ };
111
+
112
+ // Test does not exercise controller validation or serialization
113
+ const res = await mockOrderService.create({ total: 100 });
114
+ expect(res.id).toBe("ord_1");
115
+ expect(mockOrderService.create).toHaveBeenCalledWith({ total: 100 });
116
+ });
117
+ ```
118
+
119
+ ### After (Contract-Driven Anti-Tautological Test)
120
+ Tests the real HTTP handler using actual validation parsers with downstream calls intercepted at the network layer via MSW v2:
121
+
122
+ ```typescript
123
+ test("rejects order when total is below minimum merchant threshold", async () => {
124
+ const app = createTestApp(); // Real Express app with real Zod middlewares
125
+
126
+ const response = await request(app)
127
+ .post("/v1/orders")
128
+ .send({
129
+ customerId: "a3b4c5d6-e7f8-4a9b-0c1d-2e3f4a5b6c7d",
130
+ items: [{ productId: "p_1", quantity: 1, priceCents: 20 }] // Total 20 cents < min 100
131
+ });
132
+
133
+ expect(response.status).toBe(400);
134
+ expect(response.body.title).toBe("Validation Failed");
135
+ expect(response.body.invalid_params[0].reason).toContain("Minimum order total is 100 cents");
136
+ });
137
+ ```
138
+
139
+ ---
140
+
141
+ ## 4. Pattern 4: Goroutine Leak vs. Managed Worker Pool with Context
142
+
143
+ ### Before (AI Vibe Slop in Go)
144
+ Spawning unmanaged goroutines without cancellation listeners or termination channels:
145
+
146
+ ```go
147
+ func (s *EventService) ProcessBatch(events []Event) {
148
+ for _, ev := range events {
149
+ // Slop: unmanaged goroutine; if processing blocks, leaks memory indefinitely
150
+ go func(e Event) {
151
+ s.externalClient.Send(e)
152
+ }(ev)
153
+ }
154
+ }
155
+ ```
156
+
157
+ ### After (Managed Worker Pool with `errgroup.Group`)
158
+ Bounded concurrency respecting context cancellation and propagating errors:
159
+
160
+ ```go
161
+ func (s *EventService) ProcessBatch(ctx context.Context, events []Event) error {
162
+ g, ctx := errgroup.WithContext(ctx)
163
+ g.SetLimit(10) // Bound concurrency to 10 parallel workers
164
+
165
+ for _, ev := range events {
166
+ event := ev
167
+ g.Go(func() error {
168
+ // Respect context cancellation before starting work
169
+ if err := ctx.Err(); err != nil {
170
+ return err
171
+ }
172
+ return s.externalClient.SendWithContext(ctx, event)
173
+ })
174
+ }
175
+
176
+ // Await completion or first cancellation
177
+ return g.Wait()
178
+ }
179
+ ```
180
+
181
+ ---
182
+
183
+ ## 5. Pattern 5: Destructive Column Drop vs. 3-Phase Expand/Contract
184
+
185
+ ### Before (AI Vibe Slop Migration)
186
+ Single-step destructive schema migration executed while old application pods are running:
187
+
188
+ ```sql
189
+ -- migration_004_rename_column.sql
190
+ ALTER TABLE accounts DROP COLUMN routing_code;
191
+ ALTER TABLE accounts ADD COLUMN iban VARCHAR(34) NOT NULL;
192
+ ```
193
+ *Result*: Live application pods running version N fail immediately on incoming requests because `routing_code` is missing and `iban` has no default.
194
+
195
+ ### After (3-Phase Expand / Contract Migration)
196
+
197
+ **Step 1: Expand (Deployable with App v1)**
198
+ ```sql
199
+ -- Phase 1 Migration: Add nullable new column
200
+ ALTER TABLE accounts ADD COLUMN iban VARCHAR(34) DEFAULT NULL;
201
+ CREATE INDEX CONCURRENTLY idx_accounts_iban ON accounts(iban);
202
+ ```
203
+
204
+ **Step 2: Dual-Write & Async Backfill (Deploy App v2)**
205
+ App v2 writes to both `routing_code` and `iban`. Background worker backfills historical records:
206
+ ```sql
207
+ -- Keyset-paginated backfill
208
+ UPDATE accounts
209
+ SET iban = generate_iban_from_routing(routing_code, account_number)
210
+ WHERE id > :cursor AND iban IS NULL
211
+ ORDER BY id ASC
212
+ LIMIT 500;
213
+ ```
214
+
215
+ **Step 3: Contract (Deploy App v3, then run cleanup)**
216
+ App v3 reads and writes exclusively to `iban`. Run final migration:
217
+ ```sql
218
+ -- Phase 3 Migration: Drop deprecated column
219
+ ALTER TABLE accounts DROP COLUMN routing_code;
220
+ ```