@ccoalm/ccl-skills 0.1.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 (561) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +49 -0
  3. package/dist/assets/marketplace/.agents/plugins/marketplace.json +12 -0
  4. package/dist/assets/marketplace/.claude-plugin/marketplace.json +13 -0
  5. package/dist/assets/marketplace/marketplace-manifest.json +12 -0
  6. package/dist/assets/marketplace/plugins/ccl-skills/.claude-plugin/marketplace.json +16 -0
  7. package/dist/assets/marketplace/plugins/ccl-skills/.claude-plugin/plugin.json +5 -0
  8. package/dist/assets/marketplace/plugins/ccl-skills/.codex-plugin/plugin.json +5 -0
  9. package/dist/assets/marketplace/plugins/ccl-skills/.worktree-only +3 -0
  10. package/dist/assets/marketplace/plugins/ccl-skills/agent-context/session-start.md +45 -0
  11. package/dist/assets/marketplace/plugins/ccl-skills/agent-context/subagent-start.md +12 -0
  12. package/dist/assets/marketplace/plugins/ccl-skills/hooks/AGENTS.md +19 -0
  13. package/dist/assets/marketplace/plugins/ccl-skills/hooks/guard-delegation-owner.sh +125 -0
  14. package/dist/assets/marketplace/plugins/ccl-skills/hooks/guard-edit-isolation.sh +102 -0
  15. package/dist/assets/marketplace/plugins/ccl-skills/hooks/guard-merge-authorization.sh +1156 -0
  16. package/dist/assets/marketplace/plugins/ccl-skills/hooks/hooks.json +131 -0
  17. package/dist/assets/marketplace/plugins/ccl-skills/hooks/merge-authorization-prompt.sh +142 -0
  18. package/dist/assets/marketplace/plugins/ccl-skills/hooks/owner-dispatch-guard.sh +12 -0
  19. package/dist/assets/marketplace/plugins/ccl-skills/hooks/owner-dispatch-stop.sh +13 -0
  20. package/dist/assets/marketplace/plugins/ccl-skills/hooks/remind-post-merge-cleanup.sh +144 -0
  21. package/dist/assets/marketplace/plugins/ccl-skills/hooks/session-context.sh +87 -0
  22. package/dist/assets/marketplace/plugins/ccl-skills/hooks/session-start.sh +86 -0
  23. package/dist/assets/marketplace/plugins/ccl-skills/hooks/skill-extraction-gate-stop.sh +69 -0
  24. package/dist/assets/marketplace/plugins/ccl-skills/hooks/subagent-start.sh +26 -0
  25. package/dist/assets/marketplace/plugins/ccl-skills/hooks/test_guard_delegation_owner.sh +329 -0
  26. package/dist/assets/marketplace/plugins/ccl-skills/hooks/test_guard_edit_isolation.sh +322 -0
  27. package/dist/assets/marketplace/plugins/ccl-skills/hooks/test_guard_merge_authorization.sh +902 -0
  28. package/dist/assets/marketplace/plugins/ccl-skills/hooks/test_merge_authorization_prompt.sh +178 -0
  29. package/dist/assets/marketplace/plugins/ccl-skills/hooks/test_remind_post_merge_cleanup.sh +121 -0
  30. package/dist/assets/marketplace/plugins/ccl-skills/hooks/test_session_start.sh +170 -0
  31. package/dist/assets/marketplace/plugins/ccl-skills/packages/opencode-plugin/AGENTS.md +17 -0
  32. package/dist/assets/marketplace/plugins/ccl-skills/packages/opencode-plugin/ccl-skills.ts +564 -0
  33. package/dist/assets/marketplace/plugins/ccl-skills/packages/opencode-plugin/commands/ccl-install-skills.md +14 -0
  34. package/dist/assets/marketplace/plugins/ccl-skills/packages/opencode-plugin/commands/ccl-update-skills.md +44 -0
  35. package/dist/assets/marketplace/plugins/ccl-skills/packages/opencode-plugin/commands/ccl-verify-skills.md +109 -0
  36. package/dist/assets/marketplace/plugins/ccl-skills/packages/opencode-plugin/commands/ccl-worktree-check.md +36 -0
  37. package/dist/assets/marketplace/plugins/ccl-skills/scripts/owner-dispatch/AGENTS.md +28 -0
  38. package/dist/assets/marketplace/plugins/ccl-skills/scripts/owner-dispatch/README.md +276 -0
  39. package/dist/assets/marketplace/plugins/ccl-skills/scripts/owner-dispatch/owner-dispatch.example.json +10 -0
  40. package/dist/assets/marketplace/plugins/ccl-skills/scripts/owner-dispatch/owner-dispatch.sh +1307 -0
  41. package/dist/assets/marketplace/plugins/ccl-skills/scripts/owner-dispatch/test.sh +941 -0
  42. package/dist/assets/marketplace/plugins/ccl-skills/skills/agents-file-coverage-gate/SKILL.md +45 -0
  43. package/dist/assets/marketplace/plugins/ccl-skills/skills/agents-file-coverage-gate/agents/openai.yaml +4 -0
  44. package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/SKILL.md +188 -0
  45. package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/agents/openai.yaml +4 -0
  46. package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/android-dev.md +92 -0
  47. package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/flutter-dev.md +80 -0
  48. package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/ios-dev.md +72 -0
  49. package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/kotlin-multiplatform.md +93 -0
  50. package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/mobile-platform-boundaries.md +77 -0
  51. package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/mobile-quality-release.md +77 -0
  52. package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/source-evidence-map.md +64 -0
  53. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/SKILL.md +353 -0
  54. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/agents/openai.yaml +4 -0
  55. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/references/client-routing.md +419 -0
  56. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/references/manual-invocation-and-prompts.md +126 -0
  57. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/references/staged-review-contract.md +197 -0
  58. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/references/timeout-auth-and-capabilities.md +179 -0
  59. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/AGENTS.md +98 -0
  60. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/classify_envelope.py +93 -0
  61. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/classify_timeout_exit.sh +15 -0
  62. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/claude_review.sh +1438 -0
  63. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/codex_review.sh +324 -0
  64. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/concern_excerpt.py +295 -0
  65. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/egress_schema.py +214 -0
  66. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/init_policy_matrix.py +642 -0
  67. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/kimi_packet_mcp.py +181 -0
  68. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/kimi_review.sh +1165 -0
  69. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/opencode_review.sh +1190 -0
  70. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/parse_cli_review.py +946 -0
  71. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/parse_opencode_review.py +474 -0
  72. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/parse_probe_result.py +1899 -0
  73. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/parse_review_json.py +200 -0
  74. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/review_gate.py +2845 -0
  75. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/review_gate.sh +6 -0
  76. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/run_claude_capture.py +71 -0
  77. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/runtime-surface-verification-design.md +53 -0
  78. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_classify_envelope.sh +68 -0
  79. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_claude_review_probe.sh +2311 -0
  80. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_cli_review_wrappers.sh +1832 -0
  81. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_code_review_identity.sh +73 -0
  82. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_concern_excerpt.sh +245 -0
  83. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_egress_schema.sh +177 -0
  84. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_init_policy_matrix.sh +272 -0
  85. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_kimi_packet_mcp.py +195 -0
  86. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_opencode_review_concurrency.sh +120 -0
  87. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_opencode_review_retry.sh +1005 -0
  88. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_parse_opencode_review.sh +258 -0
  89. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_parse_probe_result.sh +574 -0
  90. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_parse_review_json.sh +349 -0
  91. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_review_client_compat.py +434 -0
  92. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_review_client_order.sh +264 -0
  93. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_review_gate.sh +2412 -0
  94. package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/verify_native_skill_binding.py +123 -0
  95. package/dist/assets/marketplace/plugins/ccl-skills/skills/defect-diagnosis/SKILL.md +153 -0
  96. package/dist/assets/marketplace/plugins/ccl-skills/skills/defect-diagnosis/agents/openai.yaml +4 -0
  97. package/dist/assets/marketplace/plugins/ccl-skills/skills/defect-diagnosis/references/diagnosis-playbook.md +54 -0
  98. package/dist/assets/marketplace/plugins/ccl-skills/skills/defect-diagnosis/references/prevention-routing.md +36 -0
  99. package/dist/assets/marketplace/plugins/ccl-skills/skills/feature-risk-router/SKILL.md +69 -0
  100. package/dist/assets/marketplace/plugins/ccl-skills/skills/feature-risk-router/agents/openai.yaml +4 -0
  101. package/dist/assets/marketplace/plugins/ccl-skills/skills/feature-risk-router/references/security-review-gate.md +41 -0
  102. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/SKILL.md +165 -0
  103. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/agents/openai.yaml +4 -0
  104. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/api-security-boundaries.md +47 -0
  105. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/architecture-playbook.md +160 -0
  106. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/artifact-generation-architecture.md +37 -0
  107. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/audit-history-architecture.md +29 -0
  108. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/bulk-workflow-architecture.md +33 -0
  109. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/config-rule-routing-architecture.md +34 -0
  110. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/cross-cutting-concerns.md +72 -0
  111. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/data-modeling-and-migrations.md +79 -0
  112. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/data-platform-architecture.md +210 -0
  113. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/dependency-platform.md +105 -0
  114. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/developer-tooling-architecture.md +38 -0
  115. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/error-contract-architecture.md +36 -0
  116. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/event-driven-architecture.md +260 -0
  117. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/http-gateway-architecture.md +74 -0
  118. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/mq-consumer-architecture.md +38 -0
  119. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/multi-tenant-isolation.md +275 -0
  120. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/notification-architecture.md +25 -0
  121. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/ops-checklist.md +57 -0
  122. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/performance-capacity-architecture.md +38 -0
  123. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/protobuf-contract-architecture.md +119 -0
  124. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/redis-cache-coordination.md +93 -0
  125. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/release-runtime-readiness.md +65 -0
  126. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/replay-comparison-architecture.md +26 -0
  127. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/runtime-observability.md +94 -0
  128. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/service-scaffold.md +76 -0
  129. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/source-evidence-map.md +55 -0
  130. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/workflow-state-architecture.md +38 -0
  131. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/SKILL.md +159 -0
  132. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/agents/openai.yaml +4 -0
  133. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/artifact-generation-patterns.md +37 -0
  134. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/audit-history-patterns.md +28 -0
  135. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/bulk-import-export-patterns.md +56 -0
  136. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/config-rule-routing-patterns.md +38 -0
  137. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/data-access-patterns.md +55 -0
  138. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/db-schema-and-dal-patterns.md +109 -0
  139. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/dependency-client-patterns.md +130 -0
  140. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/developer-tooling-patterns.md +70 -0
  141. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/domain-feature-patterns.md +78 -0
  142. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/engineering-patterns.md +119 -0
  143. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/error-contract-patterns.md +55 -0
  144. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/feature-playbook.md +61 -0
  145. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/http-gateway-client-patterns.md +76 -0
  146. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/mq-consumer-patterns.md +55 -0
  147. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/notification-patterns.md +42 -0
  148. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/observability-implementation-patterns.md +101 -0
  149. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/performance-capacity-patterns.md +44 -0
  150. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/protobuf-contract-patterns.md +72 -0
  151. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/public-api-integration-patterns.md +56 -0
  152. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/quality-and-testing-patterns.md +91 -0
  153. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/redis-cache-lock-patterns.md +123 -0
  154. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/release-ops-patterns.md +112 -0
  155. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/reliability-patterns.md +83 -0
  156. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/replay-comparison-patterns.md +32 -0
  157. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/scaffold-and-codegen.md +86 -0
  158. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/source-evidence-map.md +54 -0
  159. package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/state-machine-task-patterns.md +45 -0
  160. package/dist/assets/marketplace/plugins/ccl-skills/skills/grill-me/SKILL.md +80 -0
  161. package/dist/assets/marketplace/plugins/ccl-skills/skills/grill-me/agents/openai.yaml +4 -0
  162. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/SKILL.md +117 -0
  163. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/agents/openai.yaml +4 -0
  164. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-approval-auto-reviewer.md +106 -0
  165. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-command-sandbox.md +441 -0
  166. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-context-freshness.md +47 -0
  167. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-credentials-auth.md +13 -0
  168. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-extensions-skills.md +13 -0
  169. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-file-edit-protocol.md +129 -0
  170. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-ide-integration.md +5 -0
  171. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-input-ingestion.md +13 -0
  172. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-instruction-composition.md +13 -0
  173. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-lifecycle-hooks.md +92 -0
  174. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-messaging.md +5 -0
  175. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-runtime-bootstrap.md +5 -0
  176. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-session-persistence.md +448 -0
  177. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-task-orchestration.md +13 -0
  178. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-tool-dispatch.md +123 -0
  179. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-turn-lifecycle.md +131 -0
  180. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/inference-capacity-operations.md +162 -0
  181. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/llm-client-gateway.md +156 -0
  182. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/model-prompt-evaluation.md +146 -0
  183. package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/retrieval-agent-safety.md +273 -0
  184. package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/SKILL.md +202 -0
  185. package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/agents/openai.yaml +4 -0
  186. package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/contracts-and-state.md +62 -0
  187. package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/cross-stack-alignment.md +94 -0
  188. package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/framework-choice.md +76 -0
  189. package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/online-practice-uptake.md +56 -0
  190. package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/platform-capabilities.md +91 -0
  191. package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/product-page-checklist.md +40 -0
  192. package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/qa-release.md +72 -0
  193. package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/source-evidence-map.md +82 -0
  194. package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-agent-delegation/SKILL.md +103 -0
  195. package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-agent-delegation/agents/openai.yaml +5 -0
  196. package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-agent-delegation/references/multi-agent-delegation-playbook.md +100 -0
  197. package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/SKILL.md +70 -0
  198. package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/agents/openai.yaml +4 -0
  199. package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/references/public-data-acquisition.md +549 -0
  200. package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/references/public-disclosure-channels.md +97 -0
  201. package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/references/research-prompts.md +66 -0
  202. package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/scripts/AGENTS.md +32 -0
  203. package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/scripts/test-public-data-acquisition-recipes.sh +379 -0
  204. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/SKILL.md +244 -0
  205. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/agents/openai.yaml +4 -0
  206. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/alerting-and-on-call.md +76 -0
  207. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/framework-middleware-checklist.md +142 -0
  208. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/infra-component-deployment.md +268 -0
  209. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/log-correlation-recipe.md +124 -0
  210. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/log-schema-canonical.md +208 -0
  211. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/metrics-conventions.md +105 -0
  212. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/obs-stack-architecture.md +107 -0
  213. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/sli-slo-design.md +95 -0
  214. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/source-register.md +11 -0
  215. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/SKILL.md +303 -0
  216. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/agents/openai.yaml +4 -0
  217. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/canary-and-rollout-strategy.md +163 -0
  218. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/config-center-via-etcd.md +245 -0
  219. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/custom-control-plane-boundary.md +298 -0
  220. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/deploy-cli-concrete-recipe.md +312 -0
  221. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/deploy-pipeline.md +165 -0
  222. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/env-and-lane-matrix.md +126 -0
  223. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/lane-orchestration-control-plane.md +383 -0
  224. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/multi-region-and-cluster.md +135 -0
  225. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/promotion-gate-and-review.md +149 -0
  226. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/python-package-registry-release.md +462 -0
  227. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/rollback-playbook.md +123 -0
  228. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/secret-and-config-management.md +231 -0
  229. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/version-authority-and-deprecation.md +21 -0
  230. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/SKILL.md +276 -0
  231. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/agents/openai.yaml +4 -0
  232. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/dual-sidecar-and-traffic-config-center.md +127 -0
  233. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/framework-middleware.md +143 -0
  234. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/grpc-authority-workaround.md +90 -0
  235. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/http-response-envelope-contract.md +24 -0
  236. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/mesh-architecture.md +127 -0
  237. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/multi-env-routing.md +192 -0
  238. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/protobuf-http-contract-signals.md +64 -0
  239. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/retry-timeout-circuit-breaker.md +124 -0
  240. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/rpc-framework-recipe.md +494 -0
  241. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/service-discovery-choice.md +113 -0
  242. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/service-discovery-migration-playbook.md +231 -0
  243. package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/service-discovery-recipe.md +131 -0
  244. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/SKILL.md +235 -0
  245. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/agents/openai.yaml +4 -0
  246. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/adr-convention.md +146 -0
  247. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/algorithm-launch-checklist.md +30 -0
  248. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/algorithm-launch-evaluation-report-template.md +25 -0
  249. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/algorithm-launch-execution-spec.md +108 -0
  250. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/algorithm-launch-sop.md +457 -0
  251. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/algorithm-launch-templates.md +24 -0
  252. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/artifact-egress-confidentiality.md +58 -0
  253. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/code-review-checklist.md +86 -0
  254. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/cross-repo-coordination.md +46 -0
  255. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/delivery-lifecycle.md +192 -0
  256. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/design-review-gate-mechanics.md +62 -0
  257. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/design-routing-and-readiness.md +45 -0
  258. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/diagnostic-spec-match-gate.md +36 -0
  259. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/dispatch-owner-skills.md +35 -0
  260. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/dormant-code-activation.md +47 -0
  261. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/existing-project-assessment-report.md +223 -0
  262. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/external-skill-augmentation.md +46 -0
  263. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/feature-deprecation-cascade.md +15 -0
  264. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/high-risk-resilience-gates.md +73 -0
  265. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/implementation-completeness-and-minimality.md +120 -0
  266. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/implementation-entry-reentry-gate.md +122 -0
  267. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/modular-monolith-heuristic.md +105 -0
  268. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/pre-final-continuation-gate.md +115 -0
  269. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/problem-resolution-and-learning.md +62 -0
  270. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/quality-attributes.md +112 -0
  271. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/quality-remediation-program.md +88 -0
  272. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/rd-standards-doc-family-checklist.md +27 -0
  273. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/refactoring-discipline.md +52 -0
  274. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/review-reception.md +34 -0
  275. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/shared-gate-artifact-classification.md +76 -0
  276. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/source-evidence-map.md +31 -0
  277. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/status-tracker-sync.md +77 -0
  278. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/sync-spec-repo-contract.md +25 -0
  279. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/verify-developer-experience.md +34 -0
  280. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/worktree-mechanics.md +55 -0
  281. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/scripts/AGENTS.md +18 -0
  282. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/scripts/check-agent-contract-coverage.sh +213 -0
  283. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/SKILL.md +136 -0
  284. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/agents/openai.yaml +9 -0
  285. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/analytics-visualization-interactions.md +206 -0
  286. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/behavioral-aesthetic-logic.md +108 -0
  287. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/complex-creation-interactions.md +194 -0
  288. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/design-execution-checklist.md +214 -0
  289. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/design-impl-naming-and-versioning.md +53 -0
  290. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/design-intake-and-acceptance.md +129 -0
  291. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/design-system-source-of-truth.md +97 -0
  292. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/external-ui-ux-quality-benchmarks.md +79 -0
  293. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/frontend-code-evidence-map.md +63 -0
  294. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/interaction-design-patterns.md +146 -0
  295. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/layout-recipes-and-screenshot-acceptance.md +250 -0
  296. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/multi-project-token-consistency.md +237 -0
  297. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/multi-stack-strategy.md +65 -0
  298. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/operational-processing-workflows.md +237 -0
  299. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/platform-mobile-patterns.md +324 -0
  300. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/platform-web-desktop-patterns.md +456 -0
  301. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/product-lifecycle-acceptance-and-iteration.md +114 -0
  302. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/product-surface-patterns.md +79 -0
  303. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/resource-management-interactions.md +113 -0
  304. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/scenario-community-patterns.md +133 -0
  305. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/source-map.md +130 -0
  306. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/tokens-and-components.md +47 -0
  307. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/trust-sensitive-ai-and-data-patterns.md +96 -0
  308. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/ui-ux-audit.md +106 -0
  309. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/ui-ux-design-development.md +176 -0
  310. package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/visual-craft.md +111 -0
  311. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/SKILL.md +157 -0
  312. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/agents/openai.yaml +4 -0
  313. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/ai-service-integration-boundaries.md +57 -0
  314. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/api-contract-and-schema.md +62 -0
  315. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/api-security-boundaries.md +39 -0
  316. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/architecture-playbook.md +46 -0
  317. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/async-execution-model.md +24 -0
  318. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/background-jobs-and-scheduling.md +18 -0
  319. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/batch-and-pipeline-architecture.md +11 -0
  320. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/config-secrets-runtime.md +22 -0
  321. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/data-modeling-and-migrations.md +64 -0
  322. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/data-platform-architecture.md +211 -0
  323. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/event-driven-architecture.md +263 -0
  324. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/multi-tenant-isolation.md +281 -0
  325. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/observability-and-ops.md +26 -0
  326. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/packaging-runtime-readiness.md +20 -0
  327. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/redis-cache-coordination.md +41 -0
  328. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/reliability-and-error-contract.md +17 -0
  329. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/source-evidence-map.md +55 -0
  330. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/web-framework-boundaries.md +26 -0
  331. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/SKILL.md +143 -0
  332. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/agents/openai.yaml +4 -0
  333. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/ai-service-wiring-patterns.md +16 -0
  334. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/async-and-worker-patterns.md +24 -0
  335. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/background-job-patterns.md +18 -0
  336. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/batch-and-artifact-patterns.md +13 -0
  337. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/dependency-client-patterns.md +39 -0
  338. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/error-handling-patterns.md +26 -0
  339. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/feature-playbook.md +43 -0
  340. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/observability-implementation-patterns.md +31 -0
  341. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/project-structure-and-tooling.md +24 -0
  342. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/public-api-security-patterns.md +52 -0
  343. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/redis-cache-lock-patterns.md +78 -0
  344. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/schema-and-validation-patterns.md +23 -0
  345. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/source-evidence-map.md +56 -0
  346. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/sqlalchemy-and-migrations-patterns.md +99 -0
  347. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/testing-and-quality-patterns.md +61 -0
  348. package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/web-framework-patterns.md +35 -0
  349. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/SKILL.md +91 -0
  350. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/agents/openai.yaml +4 -0
  351. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/config-runtime-readback.md +20 -0
  352. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/mr-merge-authorization.md +31 -0
  353. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/post-release-env-reset.md +31 -0
  354. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/release-closeout-evidence.md +20 -0
  355. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/release-scope-confirmation.md +21 -0
  356. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/tag-and-prod-pipeline-gate.md +20 -0
  357. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/test-scope-prompt.md +24 -0
  358. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/watcher-discipline.md +14 -0
  359. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-doc-writer/SKILL.md +64 -0
  360. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-doc-writer/agents/openai.yaml +4 -0
  361. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-doc-writer/references/comment-safe-release-doc.md +19 -0
  362. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-doc-writer/references/release-evidence-workflow.md +23 -0
  363. package/dist/assets/marketplace/plugins/ccl-skills/skills/release-doc-writer/references/release-testing-scope-section.md +15 -0
  364. package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-baseline/SKILL.md +87 -0
  365. package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-baseline/agents/openai.yaml +4 -0
  366. package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-doc-writer/SKILL.md +130 -0
  367. package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-doc-writer/agents/openai.yaml +4 -0
  368. package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-doc-writer/references/prd-composition-contract.md +35 -0
  369. package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-doc-writer/references/requirement-closure-contract.md +86 -0
  370. package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-doc-writer/references/security-four-questions.md +38 -0
  371. package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-intent/SKILL.md +91 -0
  372. package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-intent/agents/openai.yaml +4 -0
  373. package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-scope/SKILL.md +88 -0
  374. package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-scope/agents/openai.yaml +4 -0
  375. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/SKILL.md +337 -0
  376. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/agents/openai.yaml +4 -0
  377. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/analysis-parse-fix-test-challenge-replay.md +47 -0
  378. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/attribution-verification.md +69 -0
  379. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/bootstrap-slim-c3-obligation-table.md +112 -0
  380. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/coverage-exhaustion-traps.md +45 -0
  381. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/description-authoring.md +162 -0
  382. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/dual-track-review-gate.md +507 -0
  383. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/eval-routing.md +86 -0
  384. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/evidence-card-template.md +51 -0
  385. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/example-domain-preselect.md +79 -0
  386. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/external-practice-controls.md +57 -0
  387. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/extraction-lifecycle-handoff.md +65 -0
  388. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/extraction-quickstart.md +194 -0
  389. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/firing-point-placement.md +75 -0
  390. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/harness-patterns-and-eval.md +286 -0
  391. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/incident-postmortem-extraction.md +190 -0
  392. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/l0-l1-l2-routing.md +114 -0
  393. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/online-skill-review.md +47 -0
  394. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/parallel-stack-references-pattern.md +164 -0
  395. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/r0-leakage-audit.md +90 -0
  396. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/recurring-anti-patterns-checklist.md +320 -0
  397. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/resume-paused-delivery.md +16 -0
  398. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/review-feedback-mining.md +33 -0
  399. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/review-finding-standards.md +57 -0
  400. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/review-rubric.md +40 -0
  401. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/rule-consolidation.md +118 -0
  402. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/skill-listing-budget.md +19 -0
  403. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/source-register.md +254 -0
  404. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/source-to-skill-extraction.md +658 -0
  405. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/two-source-extraction-pattern.md +167 -0
  406. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/uiux-judgment-extraction.md +179 -0
  407. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/uiux-routing-map.md +51 -0
  408. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/validation-and-landing.md +180 -0
  409. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/AGENTS.md +18 -0
  410. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/check-ccl-skills.sh +1452 -0
  411. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/check-evidence-card-leak.sh +491 -0
  412. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/check-mr-target-freshness.sh +173 -0
  413. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/check-size-budget.sh +488 -0
  414. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/check-sync-pointers.sh +419 -0
  415. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/eval-golden-trace.rb +197 -0
  416. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/eval-health.rb +327 -0
  417. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/eval-routing-bank.rb +401 -0
  418. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/eval-routing.rb +248 -0
  419. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/generic-r0-leak-scan.sh +282 -0
  420. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/governing-chain-diff.py +321 -0
  421. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/impact-chain-gate.rb +964 -0
  422. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/register-firing-path-resolution.rb +708 -0
  423. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/skill-behavior-eval.py +540 -0
  424. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/source-register-lifecycle.rb +51 -0
  425. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/source-register-pending-status.rb +55 -0
  426. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_ai_coding_implementation_gates.sh +829 -0
  427. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_impact_chain_refscripts.sh +1203 -0
  428. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_r0_status.sh +75 -0
  429. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_register_pending_exclusion.sh +137 -0
  430. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_regressions.sh +173 -0
  431. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_route_drift.sh +377 -0
  432. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_size_budget.sh +833 -0
  433. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_skill_catalog.sh +491 -0
  434. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_source_register_lifecycle.sh +114 -0
  435. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_mr_target_freshness.sh +261 -0
  436. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_sync_pointers.sh +538 -0
  437. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_controlled_escalation_pins.sh +154 -0
  438. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_eval_routing_bank_grader_diagnostics.sh +190 -0
  439. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_eval_routing_bank_surface_binding.sh +178 -0
  440. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_eval_routing_prose_target.sh +86 -0
  441. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_generic_r0_leak_scan.sh +131 -0
  442. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_git_identity_predicate_gate.sh +243 -0
  443. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_governing_chain_diff.sh +419 -0
  444. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_impact_chain_gate_dateless_host.sh +120 -0
  445. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_register_firing_path_resolution.sh +724 -0
  446. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_register_firing_path_wiring.sh +414 -0
  447. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_regression_runner_registration.sh +34 -0
  448. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_routing_bank_integrity.sh +205 -0
  449. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_routing_pointer_integrity.sh +194 -0
  450. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_validate_skill_credential_cwd.sh +61 -0
  451. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_validate_skill_cross_refs.sh +111 -0
  452. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_validate_skill_root_depth.sh +53 -0
  453. package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/validate-skill.sh +257 -0
  454. package/dist/assets/marketplace/plugins/ccl-skills/skills/terminal-cli-dev/SKILL.md +98 -0
  455. package/dist/assets/marketplace/plugins/ccl-skills/skills/terminal-cli-dev/agents/openai.yaml +4 -0
  456. package/dist/assets/marketplace/plugins/ccl-skills/skills/terminal-cli-dev/references/input-state-machines.md +36 -0
  457. package/dist/assets/marketplace/plugins/ccl-skills/skills/terminal-cli-dev/references/streaming-rich-output.md +130 -0
  458. package/dist/assets/marketplace/plugins/ccl-skills/skills/terminal-cli-dev/references/terminal-side-channels.md +96 -0
  459. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/SKILL.md +408 -0
  460. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/agents/openai.yaml +4 -0
  461. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/AGENTS.md +18 -0
  462. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/bitable-setup.md +573 -0
  463. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/ci_templates/README.md +120 -0
  464. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/ci_templates/github-actions.yml +119 -0
  465. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/ci_templates/gitlab-ci.yml +76 -0
  466. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/ci_templates/jenkins.Jenkinsfile +106 -0
  467. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/classical-test-design-techniques.md +279 -0
  468. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/gen_report.py +2807 -0
  469. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/makefile-template.md +200 -0
  470. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/report-config-schema.md +272 -0
  471. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/run_pytestless.py +475 -0
  472. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/source-to-case-workflows.md +258 -0
  473. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc-marker-conventions.md +316 -0
  474. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc-review-and-prioritization.md +145 -0
  475. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc_helpers/AGENTS.md +16 -0
  476. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc_helpers/tc.dart +129 -0
  477. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc_helpers/tc.go +197 -0
  478. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc_helpers/tc.py +135 -0
  479. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc_helpers/tc.ts +285 -0
  480. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/test_gen_report.py +2144 -0
  481. package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/update-lifecycle.md +62 -0
  482. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/SKILL.md +212 -0
  483. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/agents/openai.yaml +4 -0
  484. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/ci-fixtures-and-flake-control.md +75 -0
  485. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/client-runtime-test-matrices.md +50 -0
  486. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/data-and-workflow-testing.md +34 -0
  487. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/design-closed-contract-oracles.md +31 -0
  488. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/e2e-real-flow-testing.md +71 -0
  489. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/fitness-functions.md +240 -0
  490. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/integration-contract-testing.md +235 -0
  491. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/non-functional-specialized-scenarios.md +296 -0
  492. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/rd-testing-standard-template.md +126 -0
  493. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/run-killing-mutation-walk.md +43 -0
  494. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/scenario-testing.md +136 -0
  495. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/source-evidence-map.md +59 -0
  496. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/structured-tc-input-translation.md +67 -0
  497. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/test-code-authoring-patterns.md +392 -0
  498. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/test-data-and-determinism.md +39 -0
  499. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/test-topology-and-commands.md +92 -0
  500. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/unit-testing.md +46 -0
  501. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/vendored-contract-drift-checklist.md +64 -0
  502. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/verify-enforcement-mechanisms.md +18 -0
  503. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/AGENTS.md +17 -0
  504. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/client-terminal-ansi-check.py +140 -0
  505. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/client-terminal-ansi-check.test.sh +75 -0
  506. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/lang-basics-ast-check.py +170 -0
  507. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/lang-basics-ast-check.test.sh +87 -0
  508. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/lang-basics-go-check.go +198 -0
  509. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/lang-basics-go-check.test.sh +109 -0
  510. package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/test_mutation_backup_recipe.sh +237 -0
  511. package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/SKILL.md +184 -0
  512. package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/agents/openai.yaml +4 -0
  513. package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/references/comment-safe-feishu.md +93 -0
  514. package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/references/cross-model-co-review.md +3 -0
  515. package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/references/delivery-face-closeout.md +60 -0
  516. package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/references/doc-charter-first.md +17 -0
  517. package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/references/session-vantage-leakage.md +58 -0
  518. package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/SKILL.md +126 -0
  519. package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/agents/openai.yaml +4 -0
  520. package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/references/complex-workspace-patterns.md +47 -0
  521. package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/references/embedded-h5-in-host.md +87 -0
  522. package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/references/react-architecture.md +194 -0
  523. package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/references/source-evidence-map.md +60 -0
  524. package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/references/web-quality-release.md +190 -0
  525. package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/references/web-ui-quality.md +83 -0
  526. package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/SKILL.md +179 -0
  527. package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/agents/openai.yaml +4 -0
  528. package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/references/shared-branch-rebase.md +25 -0
  529. package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/scripts/AGENTS.md +23 -0
  530. package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/scripts/test_worktree_status.sh +207 -0
  531. package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/scripts/test_worktree_sweep.sh +481 -0
  532. package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/scripts/worktree-status.sh +325 -0
  533. package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/scripts/worktree-sweep.sh +245 -0
  534. package/dist/assets/release.json +2797 -0
  535. package/dist/claude-adapter.d.ts +9 -0
  536. package/dist/claude-adapter.js +240 -0
  537. package/dist/cli-worker.d.ts +1 -0
  538. package/dist/cli-worker.js +32 -0
  539. package/dist/cli.d.ts +22 -0
  540. package/dist/cli.js +214 -0
  541. package/dist/codex-host.d.ts +30 -0
  542. package/dist/codex-host.js +162 -0
  543. package/dist/fs-safe.d.ts +21 -0
  544. package/dist/fs-safe.js +241 -0
  545. package/dist/index.d.ts +2 -0
  546. package/dist/index.js +1 -0
  547. package/dist/manifest.d.ts +8 -0
  548. package/dist/manifest.js +135 -0
  549. package/dist/opencode-adapter.d.ts +10 -0
  550. package/dist/opencode-adapter.js +416 -0
  551. package/dist/operations.d.ts +3 -0
  552. package/dist/operations.js +956 -0
  553. package/dist/paths.d.ts +20 -0
  554. package/dist/paths.js +4 -0
  555. package/dist/types.d.ts +58 -0
  556. package/dist/types.js +1 -0
  557. package/dist/unified.d.ts +4 -0
  558. package/dist/unified.js +64 -0
  559. package/dist/version.d.ts +2 -0
  560. package/dist/version.js +5 -0
  561. package/package.json +35 -0
@@ -0,0 +1,211 @@
1
+ # Data Platform Architecture (Python)
2
+
3
+ Use when designing the data-platform substrate of a service or service-fleet: DB engine choice (single-instance OLTP, managed cloud DB, distributed SQL, sharding middleware), HA topology, read scaling and replica routing, sharding and resharding strategy, cross-region replication, backup and restore (with rehearsed recovery), cluster lifecycle (provision / scale / decommission / re-shard), capacity planning, fleet-wide schema-migration coordination, and connection-pool / proxy topology.
4
+
5
+ This complements `data-modeling-and-migrations.md` (which owns schema, index, transaction, outbox, and per-service migration concerns): this file owns the **substrate** that schema and queries sit on. Load both when designing a new data-bound service or auditing an existing one.
6
+
7
+ > **Sibling sync.** A parallel `go-microservice-architecture/references/data-platform-architecture.md` mirrors **all non-stack-specific sections** of this file. Only the *Python-specific implementation patterns* section diverges by stack. The mirrored sections stay free of three categories of stack-specific token: DB-engine-specific syntax, runtime/concurrency-mechanic names, and library/framework API names. The concrete token list and grep command live in the *Mirrored-section grep gate* subsection at the end of this file's stack-glue.
8
+
9
+ > **Sanitization boundary.** Vendor names (PostgreSQL, MySQL, Vitess, TiDB, CockroachDB, Aurora, Cloud Spanner, AlloyDB, Cloud SQL, DynamoDB, RDS Proxy, PgBouncer, ProxySQL, S3, Glacier, gp3, io2, etc.) below are illustrative; concrete topology choices, region names, cluster identifiers, and capacity numbers live only in the maintainer's private alias map. The sanitization audience list is positive (external / client / regulator / SOC / procurement / internal-compliance / sales-engineering / partner draft / forwardable-internal); sanitize before any document leaves the implementation team's approved audience.
10
+ >
11
+ > **Sanitization vs grep gate are separate concerns.** The mirrored-section grep gate at the end of this file's stack-glue forbids *stack-specific implementation syntax* in mirrored content; "zero hits" on the gate is not "safe to forward externally." The illustrative vendor / cloud-service / storage-tier names above are *intentionally* in mirrored content (an architect must reason about engine choice across stacks); they require **manual sanitization review** before this file or excerpts are forwarded to the audiences above. Maintain the vendor-name list above as the canonical set of names that require manual replacement before external publication.
12
+
13
+ ## When this applies / does not apply
14
+
15
+ Apply when:
16
+ - the service owns a durable relational store (its own DB instance, schema, or shared cluster),
17
+ - the team owns operations of that store (per the business-team-owns-data-infra ownership model),
18
+ - the service or fleet faces a sharding, HA, replication, backup, or capacity decision that goes beyond schema design,
19
+ - the team is choosing between standard OLTP + manual sharding, sharding middleware, or a distributed SQL engine.
20
+
21
+ Skip when:
22
+ - the service uses a fully-managed external DB whose lifecycle is owned by the cloud provider (RDS Aurora / Cloud Spanner / DynamoDB), and the team is only choosing schema and queries — route to `data-modeling-and-migrations.md`,
23
+ - the service is stateless and only consumes data via the data platform owned by another team — route to that team's contract.
24
+
25
+ ## DB engine choice axis
26
+
27
+ The choice is not "PostgreSQL or MySQL" — it is the position on this axis:
28
+
29
+ - **Single-instance OLTP** (PostgreSQL / MySQL on one node, with replicas). Familiar, broad ecosystem, low operational complexity. Sharding becomes a migration project once one instance maxes out.
30
+ - **Single-instance OLTP + sharding middleware** (Vitess in front of MySQL, ShardingSphere, application-layer sharding). Keeps the operational model of single-instance OLTP per shard while spreading load across shards. Adds middleware layer to operate; routing complexity moves into the proxy.
31
+ - **Distributed SQL engine** (TiDB, CockroachDB, YugabyteDB, Spanner-shape). Native horizontal scale, transactions across shards, native HA. Trades latency (Raft / Paxos quorum write path) and operational model (cluster of stateful nodes with consensus protocols) for transparent scale.
32
+ - **Cloud-managed equivalents** (Aurora, Cloud SQL, AlloyDB, DynamoDB, Spanner). The provider owns operations; the team owns schema, queries, and contract. Cost model differs; vendor-specific scaling and pricing characteristics matter.
33
+
34
+ Pick by:
35
+ - **Expected scale** — single-instance maxes out at the box's IOPS / connection ceiling; sharding middleware scales horizontally but each shard is still single-instance ops; distributed SQL scales nodes transparently but at consensus latency cost.
36
+ - **Transaction shape** — single-shard transactions are cheap on all engines; multi-shard transactions are expensive on middleware (two-phase commit, distributed coordinator), built-in on distributed SQL, impossible without an outbox/saga on per-shard apps.
37
+ - **Operational ownership** — single-instance is straightforward; sharding middleware adds a layer to monitor; distributed SQL needs in-house consensus-protocol experience or vendor support; managed cloud DB outsources ops.
38
+ - **Migration path** — choose so the next-tier migration is reachable from this one (start single-instance with a sharding-key contract so a future shard migration does not require schema rewrite).
39
+
40
+ Document the chosen engine, the next-tier migration trigger, and the operational footprint per cluster.
41
+
42
+ ## HA topology
43
+
44
+ State the HA model explicitly per cluster:
45
+
46
+ - **Failover model** — single-primary + synchronous standby with automatic failover (most common); single-primary + async replicas (no automatic failover, RTO = manual promotion time); multi-primary (rare, conflict-resolution required); consensus-based (Raft / Paxos with N replicas, leader election internal to the engine).
47
+ - **Synchronous vs asynchronous replication** — sync gives RPO = 0 at the cost of write latency (every write waits for the standby to ack); async writes are faster but the standby lags. Mixed: sync to one standby (RPO = 0) + async to others (read scaling).
48
+ - **Failover trigger** — health check threshold, automatic promotion, split-brain protection (fencing of the demoted primary). Define the failover time budget; test it on a real schedule.
49
+ - **Quorum semantics** — for consensus engines, the write quorum (e.g., majority of N replicas). Loss of quorum = no writes. The minimum healthy replica count to remain writable is part of the topology contract.
50
+ - **Cross-AZ vs single-AZ** — single-AZ failover handles instance failure; cross-AZ handles AZ failure; cross-region handles region failure. Each tier costs more in latency.
51
+
52
+ Document the failover RTO and RPO targets per cluster, and the last date a failover was tested in production-like conditions (tested vs theoretical).
53
+
54
+ ## Read scaling and replica routing
55
+
56
+ Once read load exceeds a single primary's capacity, read replicas spread the load:
57
+
58
+ - **Replica lag** — async replicas lag the primary by milliseconds to seconds; sync replicas lag by zero but slow writes. Define the maximum acceptable lag per use case.
59
+ - **Read-your-writes consistency** — a read replica may not yet show a write the same client just made. Either route those reads to the primary (the standard "session pinning" pattern), use a per-tenant or per-session replica with a lag budget, or accept eventual consistency on that path.
60
+ - **Replica routing** — at the application layer (the service chooses primary or replica per query), at the proxy layer (the proxy routes by SQL shape), or at the engine layer (the engine routes read-only transactions to replicas). The proxy / engine path is more transparent but moves correctness into infrastructure.
61
+ - **Staleness budget** — per query class, declare the maximum acceptable replica lag; monitor and alert when exceeded; fall back to primary when budget is breached.
62
+
63
+ Replica use is not free: failure modes include lagging replicas serving stale rows, replica connection-pool exhaustion, and replicas falling out of sync after primary failover (must re-attach).
64
+
65
+ ## Sharding and resharding
66
+
67
+ When a single primary cannot handle write volume or storage, shard:
68
+
69
+ - **Shard key** — the column or hash that determines which shard a row lives on. Once committed it is hard to change. Choose carefully: tenant_id for SaaS; resource_id for partitioned workloads; time bucket for time-series; composite (tenant_id, year) for both.
70
+ - **Shard count and growth** — start with more shards than nodes (each node holds N shards), so adding nodes redistributes existing shards rather than re-keying. Shard count growth requires a re-shard migration.
71
+ - **Sharding model** — hash (uniform distribution, no range queries cross-shard), range (range queries cheap, hot range risk), lookup-table / directory (flexible, indirection layer to maintain), composite (tenant + sub-shard).
72
+ - **Cross-shard transactions** — expensive (two-phase commit or distributed coordinator) or impossible (no XA support). Design the domain so cross-shard transactions are rare; route those to outbox/saga workflows when needed.
73
+ - **Resharding path** — the upgrade from N shards to N+M, or from one engine to another. Define: new-shard provisioning, dual-write window, reconciliation, cutover, decommission. Resharding is a multi-week project; estimate it before starting.
74
+
75
+ ## Cross-region replication
76
+
77
+ When the service serves users in multiple regions, or compliance requires data residency, replicate across regions:
78
+
79
+ - **Sync vs async cross-region** — sync gives RPO = 0 but adds inter-region RTT to every write (50–100 ms typical, business-critical or not). Async lets writes complete in the originating region; the secondary region lags.
80
+ - **Multi-region writes** — global tables (each region writes locally, conflict resolution per-row), per-region partitions (each tenant pinned to one region, no cross-region writes for that tenant), single-primary-with-read-replicas-elsewhere (writes only in the home region, reads anywhere).
81
+ - **Data residency** — when "tenant X's data stays in region Y" is a contractual obligation (see `multi-tenant-isolation.md`), the data plane is region-per-tenant or region-pinned by tenant.
82
+ - **Cross-region failure scope** — what happens when a region goes down? Define which clusters fail over to which, which tenants are affected, and the time budget for restore-to-secondary.
83
+
84
+ ## Backup, restore, and tested recovery
85
+
86
+ Backup strategy is not the backup itself; it is the **tested ability to restore**:
87
+
88
+ - **Backup types** — full snapshots (consistent point-in-time, large), incremental snapshots (diff from last snapshot), WAL / binlog archive (continuous, supports PITR), logical exports (portable, slower restore).
89
+ - **Recovery objectives** — RPO (max data loss in seconds/minutes; depends on backup frequency and WAL archival), RTO (max time to restore; depends on backup size, restore mechanism, and tested practice).
90
+ - **Cross-region backup** — store backups in a different region than the primary so a region outage does not also lose the backups.
91
+ - **Encryption at rest in backups** — backups carry the same encryption boundary as the primary; key rotation includes backup re-encryption (or accept that old backups remain on old keys).
92
+ - **Tested recovery (the rule that distinguishes real from theatre)** — restore from backup on a schedule. Validate the restored state matches expected. Time the restore and compare to RTO. A backup that has never been restored is a backup of unknown quality. Date the last successful restore in the cluster contract.
93
+
94
+ ## Cluster lifecycle
95
+
96
+ The cluster has a lifecycle as concrete as any service:
97
+
98
+ - **Provision** — declarative infra (Terraform / equivalent), parameter group, encryption-at-rest configuration, network placement, audit log destination, monitoring scrape config, identity / role setup. Provisioning is reproducible; one-off manual clusters are technical debt.
99
+ - **Scale up** — increasing instance class (vertical) without downtime requires planned maintenance windows on most engines; budget for it.
100
+ - **Scale out** — adding nodes (replicas, shards) requires re-balancing and may briefly affect write latency. Define the scale-out runbook.
101
+ - **Decommission** — taking a cluster out of service: drain traffic, verify zero writes/reads against it for an observation window, snapshot for retention, then destroy. Premature destroy after "looks idle" is a real outage class.
102
+ - **Cluster identity** — the cluster has a name, owner, lifecycle stage, and a connection contract documented; services that connect to it are listed.
103
+
104
+ ## Capacity planning
105
+
106
+ A data cluster has multiple capacity dimensions, each can become the bottleneck:
107
+
108
+ - **Storage** — current usage, growth rate, headroom; alert at 70% / 80% / 90% with an explicit response. Storage growth past auto-extend limits is a hard outage.
109
+ - **IOPS / throughput** — provisioned (e.g., AWS gp3 / io2) or burst-limited; monitor utilization vs limit; right-size before the limit is hit.
110
+ - **Connection ceiling** — the engine's max connections; the proxy's connection pool size; the per-service pool. A connection storm at startup (every instance opens 100 connections) can exceed the ceiling instantly.
111
+ - **Query latency budget** — p50 / p95 / p99 latency; growth in p99 is a leading indicator before throughput saturates.
112
+ - **Replica lag headroom** — lag spikes during heavy writes are normal; sustained lag indicates the replica cannot keep up.
113
+
114
+ Each dimension has a documented limit, current usage, growth rate, and the action when the threshold trips. Capacity planning is monthly minimum, weekly during growth.
115
+
116
+ ## Fleet-wide schema migration coordination
117
+
118
+ When the fleet has more than ~20 service DBs and migration tooling is per-DB, fleet-wide coordination becomes its own concern:
119
+
120
+ - **Migration registry** — a catalog of which service owns which DB, which schema version each is on, and which migrations are pending. Without this, a fleet-wide change (e.g., adding a tenant_id column for compliance) cannot be tracked.
121
+ - **Coordinated change rollout** — when the change spans services (a new column in shared semantics, a deprecation of a cross-service contract), define the order: which service migrates first, which dual-reads, when the old shape is retired.
122
+ - **Migration tool unification** — fleet-wide migrations work best when every service uses the same migration tool with the same conventions; mixed tooling makes fleet operations brittle.
123
+ - **Migration approval gate** — at fleet scale, migrations need pre-merge review (does it break replicas? does it lock tables? does it require downtime?). A "migration approval" workflow + checklist beats heroics.
124
+
125
+ ## Connection pool and proxy topology
126
+
127
+ The path from app to DB has its own architecture:
128
+
129
+ - **Per-service pool** — each service instance holds its own connection pool. Simple, but fleet-wide connection count = (services × instances × pool_size). Watch the engine's max-connections ceiling.
130
+ - **Proxy layer** (PgBouncer, ProxySQL, Vitess gateway, RDS Proxy) — a proxy multiplexes many service connections into fewer DB connections. Reduces the connection count seen by the engine. Adds a hop (latency) and a layer to operate.
131
+ - **Transaction-mode vs session-mode pooling** — transaction-mode is denser (more service connections per DB connection) but breaks features that rely on session state (prepared statements, advisory locks, session variables). Session-mode preserves features at the cost of density.
132
+ - **Connection lifecycle** — the pool's idle timeout, max lifetime, and reconnect-on-error policy. A connection storm on app start (every instance opens 50 connections at once) is a common outage trigger.
133
+ - **Proxy HA** — the proxy must be HA-paired or per-AZ; a single proxy is a single point of failure for every service behind it.
134
+
135
+ ## Cost and efficiency
136
+
137
+ Data layer cost grows with scale; explicit cost ownership prevents drift:
138
+
139
+ - **Right-sizing** — instance class, storage tier (provisioned IOPS vs gp3 vs gp2), backup retention. Over-provisioned clusters are real money.
140
+ - **Cold storage and archival** — old rows that are rarely read move to cheaper storage (S3 / Glacier / equivalent); the archival path must preserve tenant scope and support re-hydration (see `multi-tenant-isolation.md`).
141
+ - **Read-replica tax** — replicas cost as much as primaries; only run replicas that have a real reader.
142
+ - **Cross-region transfer** — egress and inter-region replication traffic costs add up; budget per cluster.
143
+
144
+ ## Anti-patterns
145
+
146
+ Block these:
147
+
148
+ - **Sharding decided after a single-instance outage** — emergency sharding under load is a real outage class. Decide shard key and shard count before the migration is forced.
149
+ - **Backups that have never been restored** — backups of unknown quality; the first restore is during the incident. Schedule restore drills.
150
+ - **Failover that has never been tested in production-like conditions** — RTO is theoretical until proven. Test on a schedule with realistic load.
151
+ - **Cross-region sync writes used to hide application bugs** — using cross-region sync replication to mask consistency bugs in the app layer; the latency tax is permanent. Fix the bug.
152
+ - **Hot shard** — one shard absorbs the majority of writes (popular tenant, hot resource, time-bucket clustering). Audit shard key cardinality before launch.
153
+ - **Long-running transactions on primary** — analytical queries that hold long locks, blocking writes. Route analytical traffic to replicas or a separate warehouse.
154
+ - **Connection storm on app start** — every instance opens its full pool at boot, exceeding the engine ceiling. Stagger pool warmup or use a proxy.
155
+ - **Proxy as single point of failure** — one PgBouncer instance fronting the whole cluster. Pair or per-AZ.
156
+ - **Engine choice driven by hype, not by transaction shape** — picking distributed SQL for a 100-write/sec workload, or single-instance OLTP for a workload that needs distributed transactions. The transaction shape determines the engine, not vice versa.
157
+ - **Schema migration that locks the table on a hot path** — a migration that holds a strong lock for minutes; the service is effectively down. Use online-DDL tooling and review migration locking behavior pre-merge.
158
+ - **Backup retention shorter than the deletion / regulatory clock** — restoring a 30-day backup to recover yesterday's data only works if the backup is within retention. Coordinate backup retention with data-deletion SLAs (see `multi-tenant-isolation.md` per-store deletion modes).
159
+ - **Primary DB as cross-service queue** — using a service's primary OLTP table as the substrate for cross-service async messaging via polling. Adds queue load to the primary's connection pool and IOPS budget; couples the broker semantics to the DB's locking and transaction model; lacks fanout, replay, and lag visibility that a proper broker provides. Route durable cross-service async messaging to `event-driven-architecture.md` (broker + outbox poller); allow only low-volume same-service jobs with an explicit capacity budget against the primary.
160
+
161
+ ## Operations checklist (data platform launch)
162
+
163
+ Each item is a verifiable action:
164
+
165
+ - Engine choice declared with the next-tier migration trigger (e.g., "single-instance until 50k QPS sustained; migrate to sharding middleware at that threshold").
166
+ - HA topology documented: failover model, sync/async configuration, quorum semantics, cross-AZ placement, failover RTO/RPO targets, last tested-failover date.
167
+ - Read-replica routing decision documented per query class with staleness budget and fallback-to-primary path.
168
+ - Sharding model declared (shard key, shard count, growth path) before the first shard is provisioned; not retrofitted.
169
+ - Cross-region replication mode declared per cluster (sync / async / multi-region / per-region partitioned); residency commitments enforced at the data plane.
170
+ - Backup strategy declared: type (snapshot / WAL / logical), frequency, retention, cross-region location, encryption-at-rest, RPO target.
171
+ - Restore drill scheduled on a documented cadence; last successful restore dated; restore time vs RTO target measured.
172
+ - Cluster lifecycle steps documented: provision (declarative IaC), scale up/out (runbook), decommission (drain + observe + snapshot + destroy); no one-off manual clusters.
173
+ - Capacity dimensions monitored (storage, IOPS, connections, latency p99, replica lag) with documented alert thresholds and response runbooks.
174
+ - Fleet-wide migration registry exists; per-service migration tool + version recorded; coordinated migrations have an order and approval gate.
175
+ - Connection pool sizes documented per service; proxy topology declared (per-service / proxy layer / mixed) with HA pairing where a proxy is used.
176
+ - Cost reviewed monthly; right-sizing reviewed quarterly; cold-storage / archival path tested.
177
+
178
+ ## Python-specific implementation patterns
179
+
180
+ Stack-localized recipes; the sibling Go file localizes the same patterns differently.
181
+
182
+ - **DB driver and pool** — choose sync or async driver explicitly: `psycopg` (v3, supports both sync and async) or `psycopg2` (legacy sync) or `asyncpg` (async only) for PostgreSQL; for new MySQL async services prefer `asyncmy` and allow `aiomysql`; for MySQL sync prefer `mysqlclient` and allow `PyMySQL`. Do not replace an existing working `aiomysql` driver solely to comply with the default. ORM layer: SQLAlchemy 2.x (async with asyncpg / asyncmy / aiomysql; sync with psycopg / mysqlclient / PyMySQL); Django ORM for Django services; SQLModel when the service deliberately chooses SQLAlchemy + Pydantic or already uses SQLModel. Configure pool size explicitly (`pool_size`, `max_overflow`, `pool_recycle`, `pool_pre_ping`); do not rely on defaults.
183
+ - **Sync-vs-async-pool decision** — pick one model per service. An asyncio service that occasionally calls a sync DB driver via `to_thread` works but lose efficiency; a sync service spawning asyncio just for DB is over-engineered. The choice is part of `async-execution-model.md` and should be settled before this file is consulted.
184
+ - **Sharding middleware integration** — Vitess via MySQL wire protocol; the Python client (`asyncmy` / `aiomysql` / `mysqlclient` / `PyMySQL`) connects as if to MySQL. Sharding routing is at the gateway; the app's job is to include the shard key in every query.
185
+ - **Replica routing** — SQLAlchemy 2.x supports binds (`session.execute(stmt, bind=replica_engine)`) or separate engine instances per replica; route per query at the service layer. Session pinning for read-your-writes: keep a primary engine for the same async session after a write. The Python file's `data-modeling-and-migrations.md` `Read Replica And Routing Boundary` section names the binding mechanics in more detail.
186
+ - **Migration tooling** — Alembic for SQLAlchemy; Django migrations for Django ORM. Pick one and stick to it across the fleet for the migration registry to be useful. Alembic + asyncpg works (use the sync driver for Alembic, async for runtime).
187
+ - **Outbox poller integration** — the data-platform-architecture decisions (which engine, what HA, replica lag budget) feed into the outbox poller's behavior described in `event-driven-architecture.md` and `data-modeling-and-migrations.md` (Outbox And Dual-Write Consistency).
188
+ - **PgBouncer with Python** — `asyncpg` and `psycopg` both prepare statements by default, which can break PgBouncer transaction-mode pooling. Disable prepared statements at the connection level (`prepare_threshold=None` for psycopg; `statement_cache_size=0` for asyncpg) for transaction-mode pools. Session-mode pools work with all features. Choose mode per service's feature usage.
189
+ - **Vitess gateway** — looks like MySQL on the wire; the Python MySQL driver (e.g., `asyncmy`) connects normally. Transactions across shards require explicit 2PC or routing to a single shard.
190
+ - **Health checks for HA** — a FastAPI dependency or Django readiness view pings the DB; a failed ping → mark un-ready. Distinguish "primary unreachable" (fail) from "replica lagging" (degrade but still ready for non-critical reads).
191
+ - **Connection storm mitigation** — staggered pool warmup (sleep N × instance_index ms before opening connections at boot); `pool_pre_ping=True` to handle stale connections; exponential backoff on reconnect. For an asyncio service, use a single `AsyncEngine` per service instance and share via dependency injection — do not create per-request engines.
192
+ - **Test substitution** — define a repository protocol; provide a real-DB integration test using `testcontainers-python` for PostgreSQL / MySQL containers. SQLAlchemy's in-memory SQLite is convenient for unit tests but loses many semantics (transactions, locking, FK enforcement); use it cautiously and have integration tests on a real engine.
193
+
194
+ ### Mirrored-section grep gate
195
+
196
+ The sibling-sync header forbids three categories of stack-specific token in mirrored sections (everything from "When this applies" through "Operations checklist"; everything *before* the `## Python-specific implementation patterns` H2). Run this grep against the mirrored region before every commit; zero hits required.
197
+
198
+ Forbidden tokens for this Python file's mirrored sections:
199
+
200
+ - **DB-engine syntax** — `SET LOCAL`, `set_config\(`, `current_setting\(`, `pg_try_advisory`, `pg_stat_activity`, `BYPASSRLS`, `FORCE ROW LEVEL SECURITY`, `search_path`, `GET_LOCK\(`.
201
+ - **Runtime / concurrency mechanic names** — `context\.Context`, `\bgoroutine\b`, `\bgoroutines\b`, `ctx\.Done`, `database/sql`, `\bsqlx\b`, `contextvars`, `\basyncio\b`, `run_in_executor`, `to_thread`, `ThreadPoolExecutor`, `ProcessPoolExecutor`, `copy_context`, `async with`, `after_commit`, `listens_for`, `asyncio\.Queue`, `asyncio\.Event`, `asyncio\.create_task`, `asyncio\.Task`.
202
+ - **Library / framework API names** — `GORM`, `Hertz`, `Kitex`, `golang-migrate`, `\bgoose\b`, `\bAtlas\b`, `pgx`, `lib/pq`, `go-sql-driver/mysql`, `SetMaxOpenConns`, `SetMaxIdleConns`, `SetConnMaxLifetime`, `SetConnMaxIdleTime`, `PingContext`, `(^|[^[:alnum:]_])\*?sql\.DB\b`, `(^|[^[:alnum:]_])sql\.Tx\b`, `BeginTx`, `QueryContext`, `ExecContext`, `(^|[^[:alnum:]_])sql\.Rows\b`, `(^|[^[:alnum:]_])sql\.NullString\b`, `DB\.Stats`, `PrimaryDB\(`, `ReplicaDB\(`, `testcontainers-go`, `\btestcontainers\b`, `SQLAlchemy`, `FastAPI`, `Starlette`, `Pydantic`, `httpx`, `Alembic`, `asyncpg`, `psycopg`, `aiomysql`, `asyncmy`, `mysqlclient`, `PyMySQL`, `Django`, `databases`, `sqlmodel`, `tortoise`, `pool_pre_ping`.
203
+
204
+ Run:
205
+
206
+ ```
207
+ awk '/^## Python-specific implementation patterns/{exit} 1' data-platform-architecture.md \
208
+ | grep -nE '(SET LOCAL|set_config\(|current_setting\(|pg_try_advisory|pg_stat_activity|BYPASSRLS|FORCE ROW LEVEL SECURITY|search_path|GET_LOCK\(|context\.Context|\bgoroutine\b|\bgoroutines\b|ctx\.Done|database/sql|\bsqlx\b|contextvars|\basyncio\b|run_in_executor|to_thread|ThreadPoolExecutor|ProcessPoolExecutor|copy_context|async with|after_commit|listens_for|asyncio\.Queue|asyncio\.Event|asyncio\.create_task|asyncio\.Task|GORM|Hertz|Kitex|golang-migrate|\bgoose\b|\bAtlas\b|pgx|lib/pq|go-sql-driver/mysql|SetMaxOpenConns|SetMaxIdleConns|SetConnMaxLifetime|SetConnMaxIdleTime|PingContext|(^|[^[:alnum:]_])\*?sql\.DB\b|(^|[^[:alnum:]_])sql\.Tx\b|BeginTx|QueryContext|ExecContext|(^|[^[:alnum:]_])sql\.Rows\b|(^|[^[:alnum:]_])sql\.NullString\b|DB\.Stats|PrimaryDB\(|ReplicaDB\(|testcontainers-go|\btestcontainers\b|SQLAlchemy|FastAPI|Starlette|Pydantic|httpx|Alembic|asyncpg|psycopg|aiomysql|asyncmy|mysqlclient|PyMySQL|Django|databases|sqlmodel|tortoise|pool_pre_ping)'
209
+ ```
210
+
211
+ Allowed exception: the *Sibling sync* header itself names the three category classes (without tokens) and references this gate; the *Sanitization boundary* header does not contain any of these tokens. Vendor names in mirrored sections that name a DB engine class (PostgreSQL / MySQL / Vitess / TiDB / CockroachDB / PgBouncer / ProxySQL) are allowed because they are engine choices an architect must reason about across stacks; the gate forbids stack-specific *implementation syntax*, not generic engine names.
@@ -0,0 +1,263 @@
1
+ # Event-Driven Architecture (Python)
2
+
3
+ Use when designing event-driven systems, async message contracts, producer/consumer ownership, transactional outbox/inbox, sagas, schema evolution, dead-letter and replay strategy, or end-to-end delivery guarantees for a Python service that publishes or consumes messages.
4
+
5
+ This complements `async-execution-model.md` (concurrency model choice), `background-jobs-and-scheduling.md` (in-tenant scheduled jobs), `reliability-and-error-contract.md` (error contract), and `observability-and-ops.md` (OpenTelemetry / startup wiring / propagation): this file owns the **architecture of durable, cross-service event-driven boundaries** — delivery semantics taxonomy, producer-side patterns, transactional outbox, idempotency design, schema evolution, saga/choreography, fanout, replay, and end-to-end "exactly-once" illusion.
6
+
7
+ > **Conforms to the parallel-stack references pattern.** This file follows the layout documented in `skill-extraction-workflow/references/parallel-stack-references-pattern.md`: mirrored stack-agnostic core (when-applies through operations checklist), stack-specific implementation patterns section, and the embedded `### Mirrored-section grep gate` at the end of the stack-glue. The sibling `go-microservice-architecture/references/event-driven-architecture.md` mirrors the same structure. Either this file or `multi-tenant-isolation.md` may be used as a template for new parallel-stack extractions; multi-tenant additionally demonstrates the `## Topic-extension backlog` H2 for topic-wider-than-loop cases.
8
+
9
+ > **Sibling sync.** A parallel `go-microservice-architecture/references/event-driven-architecture.md` mirrors **all non-stack-specific sections** of this file (when-applies/not-applies, delivery semantics, event vs command vs query, idempotency, outbox, ordering, schema evolution, retry/DLQ/replay, backpressure, fanout, saga, end-to-end exactly-once, anti-patterns, operations checklist). Only the *Python-specific implementation patterns* section diverges by stack. Maintainers updating any mirrored section here must update the sibling in the same change to prevent drift.
10
+
11
+ > **Sanitization boundary.** The named brokers (Kafka, Pulsar, RabbitMQ, NATS JetStream, Redis Streams) and libraries below are concrete examples for **internal** implementation guidance, scoped to the implementation team's approved audience. Before this file (or excerpts) is copied into any document leaving that audience — external / client-facing materials, customer-specific deliverables, regulator or auditor evidence packages, SOC / compliance reports, procurement responses, or partner architecture appendices — replace the named choices with generic categories (`the broker`, `a partitioned log`, `a confirm-mode AMQP queue`) unless the vendor selection is already approved for disclosure to that specific audience.
12
+
13
+ ## When this applies / does not apply
14
+
15
+ Apply when the service:
16
+ - publishes durable events or commands to a broker (Kafka, Pulsar, RabbitMQ, NATS JetStream, Redis Streams, cloud-managed equivalents),
17
+ - consumes from a durable subscription (consumer group, durable subscriber, queue binding),
18
+ - needs cross-service atomicity between a DB write and a published message,
19
+ - needs a documented replay or backfill story for the event log.
20
+
21
+ Skip when the service:
22
+ - only does in-process pub-sub or fire-and-forget logging,
23
+ - uses synchronous HTTP/RPC with no durable async boundary (use `api-contract-and-schema.md` instead),
24
+ - uses a job queue purely for in-tenant background work where loss is acceptable (use `background-jobs-and-scheduling.md` or `batch-and-pipeline-architecture.md`).
25
+
26
+ ## Delivery semantics taxonomy
27
+
28
+ State the semantics of every event-driven boundary explicitly. Default to **at-least-once** unless the broker contract proves otherwise.
29
+
30
+ - **At-most-once** — broker may drop; consumer never sees duplicates. Never acceptable for source-of-truth state changes, money, audit, or non-idempotent external effects. **Is acceptable** for derived or rebuildable state changes (cache-invalidation hints, search-index refresh signals, sampled traces, approximate counters) when each of (a) the downstream state can be repaired by TTL / periodic rebuild / source-of-truth reconciliation, (b) the freshness SLA is documented, and (c) the repair path is itself instrumented and alerted. Otherwise telemetry-only.
31
+ - **At-least-once** — broker may redeliver; consumer must be idempotent. The default for durable brokers. Every consumer needs an idempotency key and dedup design.
32
+ - **"Exactly-once" illusion** — not a broker property; an *end-to-end* property assembled from (a) transactional or idempotent producer, (b) idempotent consumer with dedup storage, (c) atomic commit-and-publish (outbox + transactional message acknowledgement, or the broker's transactional-producer feature), and **(d) the side effect under the claim must be inside the same atomic domain** (DB + broker via transactional consumer, or a single DB transaction). External side effects — third-party API calls, S3 writes, secondary publishes to a different broker, sent emails — are *outside* the atomic domain and require their own provider-side idempotency keys, an outbox/process-manager step, or honest documentation as at-least-once. Do not claim end-to-end exactly-once for a flow whose externally visible side effect is not in the atomic domain.
33
+
34
+ Record the chosen semantics in the event contract; downstream consumers reason about retries and dedup against it.
35
+
36
+ ## Event vs command vs query
37
+
38
+ The semantic shape determines ownership, schema, and retry posture:
39
+
40
+ - **Event** — a fact about something that happened. Past tense. Owned by the producer. Many consumers may subscribe. Schema evolves with backward-compatible additions; semantic meaning is fixed once published.
41
+ - **Command** — a request to do something. Imperative. Owned by the recipient's contract. Typically one consumer (a command handler). May fail validation and be rejected; the sender is told.
42
+ - **Query** — a request for state. Synchronous HTTP/RPC or query API, not a durable message. If you find yourself sending a query as a message, you probably want a query API plus an event subscription for change notifications.
43
+
44
+ Mixing these confuses ownership: a command consumer that drops the message because "it's an event, consumers are best-effort" is a bug; an event producer that retries indefinitely because "it's a command, must deliver" creates head-of-line blocking.
45
+
46
+ ## Idempotency design
47
+
48
+ Every at-least-once consumer needs idempotency. Decide each axis explicitly:
49
+
50
+ - **Idempotency key source** — event id from the producer, natural resource key (`order_id` + `state_transition`), or a derived hash. The producer-generated event id is preferred because it survives intermediate retries and is stable across consumer redeploys.
51
+ - **Dedup window** — how long the consumer remembers seen keys. Shorter window = cheaper storage, larger duplicate risk if a slow retry arrives after window expiry. The window must exceed the broker's maximum redelivery interval and any expected outage/replay window.
52
+ - **Dedup storage** — tier by impact:
53
+ - *Lossy / rebuildable effects* (the same effects allowed under at-most-once above): Redis `SET NX EX` with TTL ≥ window is sufficient. Loss of a dedup key just causes one duplicate side effect, repaired by the same path that handles at-most-once loss.
54
+ - *Source-of-truth state changes, money, audit, regulated, or non-idempotent external effects*: the **authority** is a durable DB row keyed by `event_id` (or natural key). Redis may sit in front, but only as a *negative cache* (a miss does not skip the durable check) or as an *optimization cache for keys known to have been populated only after the durable commit succeeded* (write order: durable insert → commit → cache set; never cache before commit). A positive Redis hit cannot bypass the durable check unless the writer guarantees the cache entry only appears post-commit. If Redis is used at all on this path, configure `maxmemory-policy noeviction`, enable persistence with replication, monitor eviction/replication-lag counters, and alert on loss.
55
+ - Never use Redis as the only dedup for state changes by default.
56
+ - **Side-effect ordering** — there are two side-effect classes; treat them separately:
57
+ - *DB-local effects*: write the dedup record in the same DB transaction as the side effect. A consumer that performs the side effect, then writes the dedup record, can lose the dedup on crash and re-process on redelivery.
58
+ - *Cross-system effects (external API call, broker publish to another topic, S3/object-store write, email send)*: the DB transaction cannot include these. Use the **intent-then-execute** pattern: write a durable intent row + dedup key in one DB tx, mark `pending`; the executor (an outbox poller or process manager) calls the external system using a provider-supplied idempotency key; on success it updates the row to `done`. The dedup record and the terminal status are separate columns. The crash window — executor calls the external system, the call succeeds, the executor dies before updating `done` — is the dangerous case: on restart the row is still `pending` and a naive retry duplicates the effect. Handle it explicitly: add an `unknown` / `reconcile` state and require **the external system to support either (a) idempotency-key replay that returns the same outcome for the same key, or (b) status lookup by the idempotency key**. If the external system supports neither, this pattern is not safe; document the boundary as at-least-once with manual reconciliation, alert on rows stuck in `pending` past a deadline, and run a separate reconciliation job. A redelivery sees `pending` / `unknown` / `done` and either looks up status, runs the call with the idempotent key, or skips. Treat any flow that needs cross-system atomicity as a process-manager workflow (see *Saga / process manager* below), not as inline consumer code.
59
+
60
+ ## Transactional outbox / inbox
61
+
62
+ The outbox pattern makes "write to DB and publish event" atomic without distributed transactions across DB and broker:
63
+
64
+ - Producer writes the event to an `outbox` table in the **same DB transaction** as the state change.
65
+ - A separate poller (a long-running worker in the same service, or a separate worker process) reads the outbox in order, publishes to the broker, and marks the row sent. The poller is at-least-once: idempotent re-publishing is fine because consumers dedup. The stack-glue section names the specific runtime primitive used to host the poller.
66
+ - Use a monotonic `outbox_id` for ordering within a partition key; publish in `outbox_id` order **per key** (not globally).
67
+ - Poller failure modes: crash mid-publish, broker unavailable, slow broker. Each must leave the outbox in a recoverable state.
68
+ - The "never post-commit publish" rule applies to **durable cross-process events**. An after-commit hook or post-commit callback (the ORM's transaction-commit event) that publishes to a remote broker silently drops the event on a crash between commit and publish. *Exception*: in-process, same-instance post-commit notifications that are intentionally best-effort and rebuildable (local cache invalidation, in-process projection refresh, an in-process signal to other workers in the same process) need no outbox, because there is no durable consumer claim — but only when no remote consumer exists on that channel.
69
+
70
+ ### SKIP LOCKED and per-key ordering
71
+
72
+ `SELECT … FOR UPDATE SKIP LOCKED` lets multiple poller replicas run safely **only when outbox rows are independent or ordering is not required**. `SKIP LOCKED` is *defined* to let later rows overtake a locked earlier row; if poller A locks `outbox_id=100` for key `K` and stalls on broker publish, poller B will skip 100, lock 101 for key `K`, and publish 101 first — consumers see `K`'s events out of order. To preserve per-key ordering across HA pollers, choose one strategy, **and implement the prerequisites that go with it**; the strategies are not safe on their own:
73
+
74
+ - *Single active publisher per key/partition* — route by `hash(partition_key) MOD N == poller_index` (NOT by `outbox_id`; `outbox_id` is monotonic and would split a key's rows across publishers). Each row's serializer is the publisher that owns its partition key. **Prerequisites:** stable ownership epoch (each publisher knows its index and the current N), drain on rebalance (when N changes, old owners must finish in-flight publishes before new owners take the key), and a fenced epoch token in the publish path so a stale owner cannot publish after its index has been reassigned.
75
+ - *Per-key advisory lease* — acquire a short-TTL DB lock or row-lock on the partition key before publishing; release on success or on stall. **Prerequisites:** bounded lease TTL with explicit renewal, fencing token written with the publish so a stuck holder cannot resume after its lease expired, and stale-lock recovery (a stuck holder's lease must expire and another poller must take over without duplicate publish — duplicate publish is acceptable because the consumer dedups, but lock leak that blocks the key forever is not). The DB-specific advisory-lock primitive lives in the stack-glue section below; engines differ in lock lifetime and transaction scope.
76
+ - *Dispatcher that refuses to publish `id=N+1` while `id=N` for the same key is unsent* — query `MIN(outbox_id) WHERE key=K AND sent_at IS NULL` and refuse newer ids until that row's `sent_at` is set. **Prerequisites:** an `abandoned` status that the row can move into after K publish failures (otherwise a poisoned unsent row blocks the key forever), an alert on abandonment, and an explicit policy for cross-key dependencies (workflow steps that span keys K1 and K2 can deadlock if K1's next row waits on K2 and vice versa; the dispatcher must not couple keys' progress).
77
+
78
+ Without one of these (and its prerequisites), `SKIP LOCKED` and per-key ordering are mutually exclusive — pick which property the outbox actually delivers and document it on the event contract.
79
+
80
+ Inbox (the dual) is rarer: when a consumer must read a message and produce a side effect in a different system atomically, the consumer writes the inbox record + side effect in one DB tx, then acks the broker. On crash before ack, redelivery hits the inbox row and skips the side effect.
81
+
82
+ ## Delivery ordering
83
+
84
+ Most brokers guarantee per-partition or per-key ordering, not global ordering. Design accordingly:
85
+
86
+ - **Partition key** — choose a key that aligns with the consistency boundary (per-resource, per-tenant). All events for the same boundary land on the same partition and are processed in order.
87
+ - **Hot partition risk** — a key with high cardinality at the head of the distribution (one tenant's traffic, one popular resource) creates a hot partition that blocks the consumer group. Audit key cardinality before launch.
88
+ - *If the ordering boundary can be sharded* (the key is finer than the consistency boundary needs), shard the known hot keys (sub-key suffix, time-windowed re-keying, dedicated topic for the hot tenant).
89
+ - *If the ordering boundary cannot be sharded* (regulated per-tenant audit log, per-resource state machine that must remain serializable), do not shard — sharding destroys the invariant. Mitigate with tenant isolation (dedicated partition or topic for the hot tenant), admission control (per-tenant rate limit at the producer), batching, or a serializing writer; alert on partition-skew metrics so the operator knows when to allocate dedicated capacity.
90
+ - *Throughput ceiling escape hatch* — these mitigations move or throttle the bottleneck; they do not make a non-shardable serial invariant scale beyond a single serializer's physical throughput. If the required write rate genuinely exceeds one serial lane's capacity, no broker tuning fixes it: redesign the invariant (does it really need total ordering, or just per-sub-key ordering?), split the domain (multiple smaller consistency boundaries), pre-aggregate at the producer (one summary event per N), use a stronger consistency model (a write-ordered log service), or reject the SLA. Do not let a fictional broker mitigation hide an unscalable invariant.
91
+ - **Cross-partition ordering** — does not exist for free. If a consumer needs to see events from two different keys in a specific order, that ordering must be encoded in the events (causal links, vector clocks, or a serializing component) or relaxed.
92
+ - **Scaling and repartition** — broker-specific; document the broker's mechanics on the event contract. Kafka-like partitioned logs are expensive to repartition (changes hash placement and ordering); pre-plan partition count for expected growth. Pulsar topics scale via partition addition with key-shared subscription semantics; NATS JetStream streams reshape via mirroring; RabbitMQ queues and Redis Streams have no partition concept — scale via sharded queues/streams managed by the application. The "plan for years" rule is Kafka-specific; do not apply it to NATS / RabbitMQ / Redis Streams without mapping to their actual scaling story.
93
+
94
+ ## Schema evolution
95
+
96
+ Events outlive the producer's current code. Schema discipline is non-negotiable:
97
+
98
+ - **Compatibility mode** — choose `backward` (new producers, old consumers), `forward` (old producers, new consumers), or `full` (both). For multi-team async fanout, full compatibility is the default; pick the others only with explicit consumer coordination.
99
+ - **Additive by default** — new fields are optional with safe defaults; do not remove a field or repurpose its meaning **on the existing version**. Deprecate by creating a new event type or version and migrating consumers.
100
+ - **Security / compliance exception** — when continuing to emit a field is itself the problem (leaky PII field, secret accidentally embedded, regulator-mandated retraction), additive-only is overruled. The path is: create a new event version that omits the field, inventory active consumers, deploy a coordinated emergency migration plan (consumer flips first, producer flips second, old version retired), and define historical-data handling (purge, redaction in archives, controlled access). Document the security trigger; this path is not the default deprecation flow.
101
+ - **Rolling deprecation (the default)** — create a new event type or version, dual-publish or dual-read across a compatibility window, migrate consumers with monitoring and a rollback path, then retire the old version after explicit approval. Do not stop-the-world.
102
+ - **Schema discovery model** — choose by audience:
103
+ - *Single-team, single-broker boundary*: in-payload schema or a model-derived schema (from the service's typed model layer) in the envelope header is acceptable.
104
+ - *Multi-team, single-broker fanout*: a schema registry (Confluent-style or self-hosted) validates compatibility at build/deploy time.
105
+ - *Multi-broker, multi-tenant, or external consumers* (webhooks, partner integrations, tenant-private contracts): hybrid — versioned envelope (`event_type`, `event_version`) in payload + per-tenant contract catalog/registry where available + signed schema references for external consumers + broker-specific validation gates. Neither a single registry nor in-payload alone is sufficient.
106
+ - **Metadata leakage in cross-trust boundaries** — for external or multi-tenant contracts, the schema discovery layer itself can leak. `event_type` strings, version names, registry paths, enum labels, and catalog visibility can reveal unreleased products, regulated workflows, internal team structure, or tenant-specific capabilities even when payload fields are field-level protected. Before publishing to an external boundary: classify each of (`event_type`, `event_version`, schema-reference path, registry namespace, enum values, error codes, catalog listings) by audience; use opaque public aliases (`event_type=ext.<opaque-name>`, namespace-by-tenant-without-tenant-name) where the internal name is sensitive; never let an internal event type cross the boundary as-is.
107
+ - **Breaking change discipline** — a semantic-level breaking change (a field's meaning changes, an enum value is repurposed) is not caught by schema compatibility checks. Document semantic changes; coordinate consumer rollout before publishing the new shape.
108
+
109
+ For event payloads modelled with the service's typed-model layer, freeze the model at publish time and version the envelope; the producer's evolving model must not reach the wire without a registered new version. The stack-glue section names the specific model library and freezing pattern.
110
+
111
+ ## Retry, dead-letter, replay
112
+
113
+ Distinguish three failure dispositions explicitly:
114
+
115
+ - **Retryable** — transient (dependency 5xx, timeout, lock contention). Bounded retries with exponential backoff + jitter, capped attempt count, retry budget.
116
+ - **Permanent drop / dead-letter** — malformed payload, unknown event type, expired delivery, domain conflict that will not resolve on retry. Send to DLQ with the original payload + failure metadata; alert. Do not silently ack.
117
+ - **Poison** — a message that consistently fails after retries. Quarantine to DLQ; alert with the consumer + payload class. Replay decision is manual.
118
+
119
+ **Retry budget scope must match the constrained resource:**
120
+ - *Isolated handler* (the failure costs only this consumer): per-consumer retry budget.
121
+ - *Shared downstream* (multiple consumers call the same payment provider, LLM vendor, third-party API, regulated quota): global or per-provider or per-tenant budget. Three consumers each independently burning their per-consumer budget against the same downstream produces a retry storm at the provider; the budget belongs to the constrained resource, not to the consumer.
122
+
123
+ **Replay tooling is part of the architecture, not a runbook detail.** Every event-driven boundary needs a documented replay path: read from DLQ or from a checkpointed offset, transform if needed (e.g., bump version), republish or invoke the consumer directly. Without replay, DLQ becomes a graveyard and outages produce permanent data loss.
124
+
125
+ **Replay fixtures must be representative by event class.** A synthetic poison message exercises parser failures fine, but is insufficient for:
126
+ - *Signed callbacks* (vendor webhooks with signature + timestamp + raw-body validation): keep captured sanitized raw-body + signature fixtures, or use the provider's test fixtures.
127
+ - *PII or regulated payloads*: privacy-approved fixtures only; the replay tool must accept them without round-tripping through unsanitized logs.
128
+ - *Schema-validated payloads*: fixtures must pass the same registry validation as production messages, or the replay tool will diverge from production semantics.
129
+ - *Stateful sequences* (create/update/delete chains, reserve/release pairs, workflow timeout sequences, multi-event sagas): fixtures must include the ordered sequence, plus the duplicate, missing-predecessor, out-of-order, and replay-after-terminal-state cases. A single in-sequence event replayed in isolation can pass the consumer while the real production failure is a sequence-level invariant violation.
130
+
131
+ Document which fixture class is used and which classes are deliberately not covered.
132
+
133
+ ## Backpressure
134
+
135
+ Consumer lag, broker queue depth, and producer rate are the three backpressure signals. Wire them:
136
+
137
+ - **Consumer-side** — bound the work-in-flight, but **the shape depends on ordering**:
138
+ - *Unordered consumer*: a bounded work-queue sized to the worker pool, N workers reading from the queue. A shared shutdown signal stops the workers (the stack-glue section names the specific primitive). Order of completion is undefined.
139
+ - *Ordered partitioned log* (Kafka, Pulsar key-shared, NATS JetStream ordered consumer): **one serial work lane per assigned partition/key**. Feed each partition into its own bounded work-queue + single worker, or process messages serially within the partition's poll loop. Feeding multiple ordered partitions into a single shared work-queue + worker pool loses per-partition ordering, and a slow message on one partition can starve cold partitions or let later offsets overtake earlier ones. The bounded-queue-plus-pool shape is correct for unordered work queues; not for ordered partitioned logs.
140
+ - *Rebalance handling for partition-assigned consumers* — when a Kafka / Pulsar key-shared / similar consumer group rebalances and a partition is revoked, "one lane per partition" is unsafe without explicit rebalance discipline. The revoked owner must (1) stop fetching from the partition immediately, (2) drain or cancel its in-flight lane (await handler completion to a bounded deadline, or cancel with an explicit `partial-failure` disposition), (3) commit or abort offsets according to the handler outcome (commit only completed offsets; do not commit `last poll` blindly), and (4) be fenced so it cannot still publish a side effect after the new owner has started — typically by tagging each in-flight message with the assignment epoch and refusing side effects whose epoch is stale. Without fencing, the new owner and the old owner can process the same business key concurrently; per-partition ordering at steady state is meaningless if the rebalance window allows concurrent processing.
141
+ - Avoid unbounded worker-per-message fanout in all cases (the stack-glue section names the specific anti-pattern API).
142
+ - **Producer-side** — when the broker buffer fills (Kafka producer queue, RabbitMQ unconfirmed-publishes limit, NATS slow-consumer warning), block the producer's caller with a bounded wait or shed load at the producer entry point. Never block forever; surface a typed exception after a bounded wait so upstream can backpressure further.
143
+ - **Cross-service** — a slow consumer is an upstream producer's problem to know about. Consumer lag must be exposed as a metric and alerted; producers cannot fix what they cannot see.
144
+
145
+ ## Fanout patterns
146
+
147
+ - **Pub-sub** — one publish, many independent subscribers. Each subscriber owns its own consumer group/durable subscription, processes at its own pace, has its own DLQ. Add a subscriber by deploying it; no producer change.
148
+ - **Work queue** — one publish, exactly one of N workers handles it. All workers share a consumer group. Add capacity by adding workers in the same group.
149
+ - **CDC (change-data-capture)** — the DB is the source of truth; a CDC connector (Debezium-style) produces events from the WAL/binlog. Useful when many downstream consumers need to react to a DB-owned domain and the writing service does not own a transactional outbox.
150
+ - **Producer-held subscriber list** — generally an anti-pattern (couples producer to consumers; defeats the point of pub-sub). *Legitimate exceptions*: CDC bridges and webhook dispatchers do interact with external targets (a CDC sink config, a per-tenant webhook URL list). The ownership rule for those external lists: the **authoritative list lives in the owning configuration / control-plane system** (the tenant-config service, the connector-config service, the customer-admin app — whichever owns target lifecycle, approval, rotation, and audit). The producer or dispatcher reads a snapshot from that system; it does not own the list unless it *is* the authoritative config owner. Hardcoded subscriber lists in producer code, or producer-owned lists that bypass the tenant-config policy plane, are still the anti-pattern.
151
+
152
+ ## Saga / process manager vs choreography
153
+
154
+ For multi-step workflows that span services:
155
+
156
+ - **Choreography** — each service listens for events and emits its own. No central coordinator. Loose coupling; the workflow exists only as the set of subscriptions. Hard to reason about end-to-end; debugging requires tracing across services.
157
+ - **Orchestration (process manager / saga)** — a coordinator service drives the workflow: emits commands, listens for responses, compensates on failure. The workflow is explicit in one place.
158
+
159
+ **Orchestration is required by workflow invariants, not by step count.** Use orchestration when any of these is true, regardless of whether the workflow has two steps or twenty:
160
+ - Compensation across services is needed (one step's failure requires undoing another step's effect).
161
+ - Audit needs **a single controllable workflow state or a resume/decision point** — not just append-only traceability. Append-only audit (every step emits an immutable audit event tagged with a workflow id) can be served by choreography; a single state view that an operator must inspect or resume requires orchestration.
162
+ - An external irreversible effect is involved (see below).
163
+ - Timeout handling needs a coordinator with a clock.
164
+ - A single business owner needs one place to inspect or resume stuck state.
165
+
166
+ Choreography is acceptable when none of those hold and the workflow is small and fixed. It is also acceptable for **broadcast fanout** (one event, many independent subscribers, no compensation across subscribers) even when auditability is required — each subscriber owns its own DLQ, immutable audit events carry the shared workflow / trace id, and there is no central state to inspect; the audit story is "did every subscriber see and process this," answered by traces and per-subscriber metrics.
167
+
168
+ **Compensation, where possible; prevention, where not.** Distributed transactions are not available; design compensation as the default:
169
+ - *Compensable steps* — idempotent compensating action (refund, cancel, undo) that is itself at-least-once and idempotent. Document the compensation per step.
170
+ - *Irreversible steps* — sent email, filed regulatory report, shipped physical item, called external action with no reversal API. No real compensation exists; at best there is a corrective follow-up (apology email, retraction filing, refund + recovery offer) which is a separate workflow. For these:
171
+ - Add prevention gates before the irreversible step (validation, manual review, approval, dual-confirm, dry-run).
172
+ - Use `pending` / `confirmed` / `committed` state machine so the orchestrator can fail-stop before the irreversible action.
173
+ - Define explicit irreversible-state handling: how the workflow records the irreversible commit, what the corrective workflow looks like, who is paged.
174
+ - Do not design a fictional compensation that "reverses" an irreversible action; document the reality.
175
+
176
+ If the workflow involves money, audit, or a regulatory requirement, default to orchestration with an explicit state machine.
177
+
178
+ ## End-to-end "exactly-once" illusion
179
+
180
+ Stack-agnostic recipe; document each clause for every event-driven boundary that claims it:
181
+
182
+ 1. Transactional or outbox-based publish — the message is durable iff the originating state change is durable, atomically.
183
+ 2. Idempotent consumer with dedup storage that survives consumer restart and broker redelivery.
184
+ 3. Commit-and-publish ordering — consumer's side effect + dedup record + offset commit are atomic from the consumer's point of view (DB transaction including offset, or broker transactional consumer + producer pairing). Brokers without a transactional offset semantic (NATS JetStream's per-ack model, RabbitMQ classic queues without publisher confirms + tx) cannot satisfy this clause; document the gap.
185
+ 4. **Side effect under the claim is inside the atomic domain.** "Atomic domain" means the DB transaction that includes the offset commit, or the broker transactional producer/consumer pair. External side effects — third-party API calls, S3/object-store writes, secondary publishes to a different broker, sent emails, SMS, payments — are *outside* the atomic domain. For them you need provider-side idempotency keys, an outbox/process-manager step that records terminal status, or honest documentation as at-least-once. Claiming exactly-once for a flow whose externally visible effect is not in the atomic domain is the most common false claim.
186
+ 5. Replay path respects idempotency — a manual replay of a DLQ message lands on the consumer's existing dedup and does not double-apply.
187
+
188
+ If any clause is missing, the boundary is at-least-once with duplicates. Tell consumers honestly.
189
+
190
+ ## Anti-patterns
191
+
192
+ - **Post-commit publish (durable cross-process)** — publishing the event after the DB transaction commits, without an outbox, when consumers are in another process. A crash between commit and publish silently drops the event. In-process, same-instance, rebuildable post-commit hooks are not this anti-pattern.
193
+ - **DB-as-queue** — using a DB table as the message broker via polling without an outbox-style design. Fine for low-volume single-instance background jobs in the same service; breaks under load, lacks fanout, and entangles application reads with queue mechanics when used as a cross-service broker.
194
+ - **No idempotency key** — consumer relies on broker's "exactly-once" claim or on hope. Every redelivery becomes a duplicate side effect.
195
+ - **Naive retry without dedup** — retry on the producer (republishing the same logical event) without the consumer recognising it as a duplicate. Doubles the side effect.
196
+ - **Hot partition / hot key** — one key concentrates traffic, blocking the consumer group. Symptom: consumer lag concentrated on a single partition.
197
+ - **Schema drift without registry or envelope** — producer adds a field without coordinating; an older consumer crashes on unknown required field.
198
+ - **DLQ as graveyard** — messages land in DLQ, nobody looks, no replay tooling. The DLQ becomes a silent data-loss channel.
199
+ - **Exactly-once claimed by broker badge** — broker config has an "exactly-once" mode, but the consumer is not idempotent and the producer is not transactional, OR the side effect is outside the atomic domain. The claim is wrong; record correct end-to-end semantics.
200
+ - **Producer-held subscriber list as code** — subscriber list hardcoded at the producer when broker-side subscription is possible. (CDC bridges and webhook dispatchers are exceptions; their lists must live as config with audit and rotation.)
201
+ - **Sync HTTP/RPC as command** — a "command" sent via blocking HTTP/RPC with retry and no replay path. If the call needs the durability of a queue, use a queue; if it needs the latency of HTTP/RPC, accept best-effort.
202
+
203
+ ## Operations checklist (event-driven boundary launch)
204
+
205
+ Before a new event-driven boundary goes live:
206
+
207
+ - Delivery semantics declared explicitly in the event contract, including which side effects are inside the atomic domain and which require provider idempotency keys.
208
+ - Idempotency key, dedup storage tier (lossy/Redis vs source-of-truth/durable), and dedup window documented per consumer; Redis-as-authority disallowed for source-of-truth flows.
209
+ - Outbox table + poller in place when atomic publish is required; per-key ordering strategy declared if ordering is part of the contract; no post-commit cross-process publish without outbox.
210
+ - Partition key + estimated cardinality; hot-partition mitigation declared (shard if the ordering boundary allows; tenant-isolation/quota/dedicated partition if it does not); broker-specific scaling/repartition path documented.
211
+ - Schema compatibility mode declared; schema registered or versioned envelope in payload; multi-broker / multi-tenant / external boundaries documented with the hybrid model; rolling deprecation plan in place for known breaking changes; security/compliance retraction path documented.
212
+ - Retry policy (max attempts, base delay, jitter, retry budget) declared per consumer; retry budget scope (per-consumer vs per-provider vs per-tenant) matches the constrained resource.
213
+ - DLQ topic + replay tool documented; replay tested with **representative fixtures** for each event class on this boundary (synthetic for parser; raw-body+signature for signed callbacks; privacy-approved for PII flows).
214
+ - Consumer lag metric exposed; SLO and alert threshold defined; per-partition lag visible for ordered partitions.
215
+ - Backpressure path: bounded work-in-flight in the right shape (per-partition lane for ordered logs; shared pool only for unordered queues); producer behaviour when broker is slow or full is documented and observable.
216
+ - End-to-end exactly-once claim, if made, validated against the five-clause recipe above — including the atomic-domain clause — otherwise the boundary is documented as at-least-once.
217
+ - Workflow that involves money, audit, regulatory, or external irreversible effects uses orchestration with explicit `pending`/`confirmed`/`committed` state machine and named prevention gates; no fictional compensation for irreversible steps.
218
+
219
+ ## Python-specific implementation patterns
220
+
221
+ These are stack-localized recipes that implement the stack-agnostic patterns above; the sibling Go file localizes the same patterns differently.
222
+
223
+ - **Library choice axis** — pick by feature, not popularity. For Kafka in Python: `aiokafka` for native asyncio, `confluent-kafka-python` for higher throughput and lower-level offset/transaction control; do not mix in one service. For RabbitMQ: `aio-pika` for asyncio, `pika` for sync. For NATS: `nats-py`. For Redis Streams as a lightweight broker: `redis-py` Stream APIs or `arq` for an opinionated job/queue layer. For Pulsar: `pulsar-client`. Standardize within the service; multi-broker services need an abstraction that does not hide delivery semantics.
224
+ - **Asyncio consumer shape** — depends on ordering (see *Backpressure* above):
225
+ - *Unordered work queue*: one `asyncio.Task` polls the broker into a bounded `asyncio.Queue`; a fixed-size worker pool of N tasks reads from the queue.
226
+ - *Ordered partitioned log*: one `asyncio.Task` per assigned partition that processes serially, or a per-partition bounded `asyncio.Queue` with a single worker task. A shared `asyncio.Event` triggers shutdown; never feed multiple ordered partitions into a shared worker pool.
227
+ - Avoid `asyncio.create_task(handle(msg))` inside a `for msg in consumer` loop — unbounded fanout will OOM under load and discards ordering.
228
+ - **Sync vs async consumers** — if the handler is CPU-bound or calls a sync DB driver (psycopg2, sync SQLAlchemy), use a thread pool or process pool; do not block the event loop. For mixed workloads, route async-friendly handlers to the asyncio worker pool and CPU/sync handlers to a `ProcessPoolExecutor` or to Celery/RQ.
229
+ - **Context propagation** — extract correlation id, trace context, lane/env from message headers into `contextvars` at the consumer boundary. OpenTelemetry's `aiokafka`/`pika` instrumentations restore the trace context automatically; verify they are wired in `observability-and-ops.md`'s OTel/startup section, not in `async-execution-model.md`.
230
+ - **Outbox poller with SQLAlchemy** — an asyncio task that runs a **claim → commit → publish → mark-sent** loop, not "publish inside the DB tx" (a broker call inside a SQLAlchemy session held open for the broker round-trip violates the short-transaction rule in `data-modeling-and-migrations.md`):
231
+ 1. **Claim tx (short)**: `BEGIN; SELECT … FROM outbox WHERE sent_at IS NULL AND (processing_until IS NULL OR processing_until < NOW()) ORDER BY id LIMIT N FOR UPDATE SKIP LOCKED; UPDATE outbox SET processing_until = NOW() + lease, owner = :owner WHERE id IN (…); COMMIT;` — the row is now leased to this poller; session closes immediately.
232
+ 2. **Publish (outside any session)**: `await broker.publish(...)` for each leased row. Duplicate publish on retry is acceptable because the consumer dedups.
233
+ 3. **Mark-sent tx (short)**: `BEGIN; UPDATE outbox SET sent_at = NOW(), processing_until = NULL WHERE id = :id AND owner = :owner; COMMIT;` — guarded by `owner` so a re-leased row (after the original lease expired) is not double-marked.
234
+ 4. **Abandon tx**: after K publish failures, mark row `abandoned` and alert; do not block the partition key forever on a poison row (see the *Dispatcher that refuses to publish `id=N+1`* strategy).
235
+ For per-key ordering across HA pollers, layer one of the strategies in *SKIP LOCKED and per-key ordering* (hash-routed publisher by `hash(partition_key) MOD N`, per-key advisory lease via the DB's advisory-lock primitive — PostgreSQL `pg_try_advisory_xact_lock(hashtext(partition_key))` for tx-scoped locks bound to the connection's current transaction; MySQL `GET_LOCK(name, timeout)` with explicit session-scoped semantics (release explicitly on success or stall, or rely on session close), and lock names server-wide-scoped so use a fully-bounded namespaced name `lk:<env8>:<svc8>:<purpose8>:<hash16>` (total length = 46 chars including separators, fits inside MySQL's 64-char limit; `<env8>`, `<svc8>`, `<purpose8>` are generated from the canonical environment / service / purpose identities by a **documented deterministic function** (e.g., first-8-of-base32(SHA256(canonical_identity))) or allocated from a **collision-checked registry** — human-readable abbreviations are NOT acceptable unless the registry proves uniqueness in the MySQL server-wide lock namespace; `<hash16>` is the first 16 chars of base32(SHA256(length-prefixed-encoding(canonical_partition_key, versioned_namespace))) — e.g., `SHA256(len(pk) + ':' + pk + len(ns) + ':' + ns)` or canonical JSON/CBOR over `[canonical_partition_key, versioned_namespace]`; raw `pk + ':' + ns` concatenation is **not** acceptable because real partition keys (`acme:prod`, `order:123`, user-supplied ids) can contain `:` and the resulting hash input is not injective. **Namespace-migration safety**: changing `versioned_namespace` requires either a drain / stop-the-world for the poller lane, or a dual-lock period (acquire old + new lock names in canonical order) so that mixed namespace versions across a rolling deploy / rollback cannot acquire different locks for the same partition key and publish concurrently. Without this, a version bump silently splits the per-key serialization lane.), and avoid MySQL NDB / multi-mysqld setups where `GET_LOCK` is not cluster-wide; TiDB supports MySQL-style user-level locks (`GET_LOCK`) cluster-wide in supported versions — verify timeout / deadlock semantics for the deployed TiDB version against a scenario-specific compatibility source: **pinned cluster** → checked-in version pin; **managed channel (TiDB Cloud)** → provider channel/SLA *and* current cluster version (channel alone is insufficient — the version still varies inside the channel); **rolling-upgrade fleet** → min/max active versions across the fleet plus the documented rolling-upgrade policy; **ad-hoc verification** → recorded `tidb_version()` output that includes cluster identity and timestamp. Otherwise fall back to an external coordinator (etcd lease, Redis `SET NX` with TTL) with fencing — with bounded TTL and a fencing token written with each publish; or refuse-newer-id dispatcher with abandoned-row state. Use `asyncpg`-backed SQLAlchemy 2.x async sessions for the poller path.
236
+ - **Idempotency storage** — pick by impact (see *Idempotency design*):
237
+ - Lossy/rebuildable: `redis-py` `SET dedup:<key> 1 EX <window> NX`, branch on returned value.
238
+ - Source-of-truth: insert into a `processed_events` table with `event_id` as primary key inside the side-effect SQLAlchemy session; on `IntegrityError(unique violation)`, skip the side effect. Optionally cache the recent N keys in Redis as a hot-path filter, but Redis is not the authority.
239
+ - Cross-system effects: intent-then-execute pattern — write `processed_events` row with status `pending` in a SQLAlchemy session, run the external call with a provider idempotency key, update status to `done` on success.
240
+ - **Retry policy** — bounded exponential backoff with jitter; `tenacity` is the standard library for this, but configure it explicitly per consumer (max attempts, base delay, jitter, retryable exceptions). Never retry inside the handler with an inline `await asyncio.sleep` past tens of seconds — let the broker redeliver after nack, or push to a delay queue/scheduled topic. Scope the retry budget to the actual constrained resource: per-consumer for isolated handlers, **per-provider / per-tenant / per-region / per-API-method / global** for shared downstreams (the budget belongs to whichever resource has the hard quota; "per-provider" alone is insufficient when the real limit is per-region or per-method).
241
+ - **Exception classification** — define a small exception hierarchy (`RetryableError`, `PermanentError`, `PoisonError`) and classify at the boundary; the consumer dispatcher branches into `retry` / `drop` / `dlq` dispositions. Never let an un-typed `Exception` reach the dispatcher and decide by message-matching.
242
+ - **Test substitution** — define a `Broker` protocol at the service boundary; provide an in-memory implementation for unit tests and an integration test against a real broker (Kafka container, RabbitMQ container) via `testcontainers-python`. Mocking the broker client directly leaks library specifics into tests.
243
+ - **Process model** — when the broker client is sync-only (some Kafka clients, legacy RabbitMQ usage), run the consumer in a dedicated process or thread; do not import a sync broker client into an asyncio service and hope. `async-execution-model.md` covers the decision matrix.
244
+ - **Graceful shutdown order** — signal handler → set shutdown `asyncio.Event` → poller stops fetching → worker pool drains (bounded by `shutdown_grace_period_s`) → outbox poller finishes its in-flight publish → broker client closes → DB engine disposes connections. If the last outbox publish needs an in-flight DB read, hold the engine open until the outbox poller acknowledges drain; the rule is "no new work in flight," not "rigid component order."
245
+
246
+ ### Mirrored-section grep gate
247
+
248
+ The sibling-sync header forbids three categories of stack-specific token in mirrored sections (everything from "When this applies" through "Operations checklist"; everything *before* the `## Python-specific implementation patterns` H2). Run this grep against the mirrored region before every commit; zero hits required.
249
+
250
+ Forbidden tokens for this Python file's mirrored sections:
251
+
252
+ - **DB-engine syntax** — `SET LOCAL`, `set_config\(`, `current_setting\(`, `pg_try_advisory`, `pg_stat_activity`, `BYPASSRLS`, `FORCE ROW LEVEL SECURITY`, `search_path`, `GET_LOCK\(`.
253
+ - **Runtime / concurrency mechanic names** — `context\.Context`, `\bgoroutine\b`, `\bgoroutines\b`, `ctx\.Done`, `database/sql`, `\bsqlx\b`, `contextvars`, `\basyncio\b`, `run_in_executor`, `to_thread`, `ThreadPoolExecutor`, `ProcessPoolExecutor`, `copy_context`, `async with`, `after_commit`, `listens_for`, `asyncio\.Queue`, `asyncio\.Event`, `asyncio\.create_task`, `asyncio\.Task`, `asyncio\.gather`.
254
+ - **Library / framework API names** — `GORM`, `Hertz`, `Kitex`, `golang\.org/x/time/rate`, `SQLAlchemy`, `FastAPI`, `Starlette`, `Pydantic`, `httpx`, `aiokafka`, `\bpika\b`, `aio-pika`, `redis-py`, `tenacity`, `structlog`, `testcontainers`, `Alembic`, `async-lru`, `asyncpg`, `psycopg`.
255
+
256
+ Run:
257
+
258
+ ```
259
+ awk '/^## Python-specific implementation patterns/{exit} 1' event-driven-architecture.md \
260
+ | grep -nE '(SET LOCAL|set_config\(|current_setting\(|pg_try_advisory|pg_stat_activity|BYPASSRLS|FORCE ROW LEVEL SECURITY|search_path|GET_LOCK\(|context\.Context|\bgoroutine\b|\bgoroutines\b|ctx\.Done|database/sql|\bsqlx\b|contextvars|\basyncio\b|run_in_executor|to_thread|ThreadPoolExecutor|ProcessPoolExecutor|copy_context|async with|after_commit|listens_for|asyncio\.Queue|asyncio\.Event|asyncio\.create_task|asyncio\.Task|asyncio\.gather|GORM|Hertz|Kitex|golang\.org/x/time/rate|SQLAlchemy|FastAPI|Starlette|Pydantic|httpx|aiokafka|\bpika\b|aio-pika|redis-py|tenacity|structlog|testcontainers|Alembic|async-lru|asyncpg|psycopg)'
261
+ ```
262
+
263
+ Allowed exception: the *Sibling sync* header itself names the three category classes (without tokens) and references this gate; the *Sanitization boundary* header does not contain any of these tokens. The sibling Go file maintains the matching gate for Go-side tokens, so a token forbidden here may legitimately appear in the *Go-specific implementation patterns* section of the sibling, and vice versa.