@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.
- package/LICENSE +201 -0
- package/README.md +49 -0
- package/dist/assets/marketplace/.agents/plugins/marketplace.json +12 -0
- package/dist/assets/marketplace/.claude-plugin/marketplace.json +13 -0
- package/dist/assets/marketplace/marketplace-manifest.json +12 -0
- package/dist/assets/marketplace/plugins/ccl-skills/.claude-plugin/marketplace.json +16 -0
- package/dist/assets/marketplace/plugins/ccl-skills/.claude-plugin/plugin.json +5 -0
- package/dist/assets/marketplace/plugins/ccl-skills/.codex-plugin/plugin.json +5 -0
- package/dist/assets/marketplace/plugins/ccl-skills/.worktree-only +3 -0
- package/dist/assets/marketplace/plugins/ccl-skills/agent-context/session-start.md +45 -0
- package/dist/assets/marketplace/plugins/ccl-skills/agent-context/subagent-start.md +12 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/AGENTS.md +19 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/guard-delegation-owner.sh +125 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/guard-edit-isolation.sh +102 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/guard-merge-authorization.sh +1156 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/hooks.json +131 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/merge-authorization-prompt.sh +142 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/owner-dispatch-guard.sh +12 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/owner-dispatch-stop.sh +13 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/remind-post-merge-cleanup.sh +144 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/session-context.sh +87 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/session-start.sh +86 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/skill-extraction-gate-stop.sh +69 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/subagent-start.sh +26 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/test_guard_delegation_owner.sh +329 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/test_guard_edit_isolation.sh +322 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/test_guard_merge_authorization.sh +902 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/test_merge_authorization_prompt.sh +178 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/test_remind_post_merge_cleanup.sh +121 -0
- package/dist/assets/marketplace/plugins/ccl-skills/hooks/test_session_start.sh +170 -0
- package/dist/assets/marketplace/plugins/ccl-skills/packages/opencode-plugin/AGENTS.md +17 -0
- package/dist/assets/marketplace/plugins/ccl-skills/packages/opencode-plugin/ccl-skills.ts +564 -0
- package/dist/assets/marketplace/plugins/ccl-skills/packages/opencode-plugin/commands/ccl-install-skills.md +14 -0
- package/dist/assets/marketplace/plugins/ccl-skills/packages/opencode-plugin/commands/ccl-update-skills.md +44 -0
- package/dist/assets/marketplace/plugins/ccl-skills/packages/opencode-plugin/commands/ccl-verify-skills.md +109 -0
- package/dist/assets/marketplace/plugins/ccl-skills/packages/opencode-plugin/commands/ccl-worktree-check.md +36 -0
- package/dist/assets/marketplace/plugins/ccl-skills/scripts/owner-dispatch/AGENTS.md +28 -0
- package/dist/assets/marketplace/plugins/ccl-skills/scripts/owner-dispatch/README.md +276 -0
- package/dist/assets/marketplace/plugins/ccl-skills/scripts/owner-dispatch/owner-dispatch.example.json +10 -0
- package/dist/assets/marketplace/plugins/ccl-skills/scripts/owner-dispatch/owner-dispatch.sh +1307 -0
- package/dist/assets/marketplace/plugins/ccl-skills/scripts/owner-dispatch/test.sh +941 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/agents-file-coverage-gate/SKILL.md +45 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/agents-file-coverage-gate/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/SKILL.md +188 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/android-dev.md +92 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/flutter-dev.md +80 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/ios-dev.md +72 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/kotlin-multiplatform.md +93 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/mobile-platform-boundaries.md +77 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/mobile-quality-release.md +77 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/app-cross-platform-dev/references/source-evidence-map.md +64 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/SKILL.md +353 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/references/client-routing.md +419 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/references/manual-invocation-and-prompts.md +126 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/references/staged-review-contract.md +197 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/references/timeout-auth-and-capabilities.md +179 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/AGENTS.md +98 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/classify_envelope.py +93 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/classify_timeout_exit.sh +15 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/claude_review.sh +1438 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/codex_review.sh +324 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/concern_excerpt.py +295 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/egress_schema.py +214 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/init_policy_matrix.py +642 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/kimi_packet_mcp.py +181 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/kimi_review.sh +1165 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/opencode_review.sh +1190 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/parse_cli_review.py +946 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/parse_opencode_review.py +474 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/parse_probe_result.py +1899 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/parse_review_json.py +200 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/review_gate.py +2845 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/review_gate.sh +6 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/run_claude_capture.py +71 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/runtime-surface-verification-design.md +53 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_classify_envelope.sh +68 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_claude_review_probe.sh +2311 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_cli_review_wrappers.sh +1832 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_code_review_identity.sh +73 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_concern_excerpt.sh +245 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_egress_schema.sh +177 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_init_policy_matrix.sh +272 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_kimi_packet_mcp.py +195 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_opencode_review_concurrency.sh +120 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_opencode_review_retry.sh +1005 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_parse_opencode_review.sh +258 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_parse_probe_result.sh +574 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_parse_review_json.sh +349 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_review_client_compat.py +434 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_review_client_order.sh +264 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/test_review_gate.sh +2412 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/code-review/scripts/verify_native_skill_binding.py +123 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/defect-diagnosis/SKILL.md +153 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/defect-diagnosis/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/defect-diagnosis/references/diagnosis-playbook.md +54 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/defect-diagnosis/references/prevention-routing.md +36 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/feature-risk-router/SKILL.md +69 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/feature-risk-router/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/feature-risk-router/references/security-review-gate.md +41 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/SKILL.md +165 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/api-security-boundaries.md +47 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/architecture-playbook.md +160 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/artifact-generation-architecture.md +37 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/audit-history-architecture.md +29 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/bulk-workflow-architecture.md +33 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/config-rule-routing-architecture.md +34 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/cross-cutting-concerns.md +72 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/data-modeling-and-migrations.md +79 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/data-platform-architecture.md +210 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/dependency-platform.md +105 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/developer-tooling-architecture.md +38 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/error-contract-architecture.md +36 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/event-driven-architecture.md +260 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/http-gateway-architecture.md +74 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/mq-consumer-architecture.md +38 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/multi-tenant-isolation.md +275 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/notification-architecture.md +25 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/ops-checklist.md +57 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/performance-capacity-architecture.md +38 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/protobuf-contract-architecture.md +119 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/redis-cache-coordination.md +93 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/release-runtime-readiness.md +65 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/replay-comparison-architecture.md +26 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/runtime-observability.md +94 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/service-scaffold.md +76 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/source-evidence-map.md +55 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-architecture/references/workflow-state-architecture.md +38 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/SKILL.md +159 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/artifact-generation-patterns.md +37 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/audit-history-patterns.md +28 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/bulk-import-export-patterns.md +56 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/config-rule-routing-patterns.md +38 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/data-access-patterns.md +55 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/db-schema-and-dal-patterns.md +109 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/dependency-client-patterns.md +130 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/developer-tooling-patterns.md +70 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/domain-feature-patterns.md +78 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/engineering-patterns.md +119 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/error-contract-patterns.md +55 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/feature-playbook.md +61 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/http-gateway-client-patterns.md +76 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/mq-consumer-patterns.md +55 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/notification-patterns.md +42 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/observability-implementation-patterns.md +101 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/performance-capacity-patterns.md +44 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/protobuf-contract-patterns.md +72 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/public-api-integration-patterns.md +56 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/quality-and-testing-patterns.md +91 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/redis-cache-lock-patterns.md +123 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/release-ops-patterns.md +112 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/reliability-patterns.md +83 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/replay-comparison-patterns.md +32 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/scaffold-and-codegen.md +86 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/source-evidence-map.md +54 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/go-microservice-dev/references/state-machine-task-patterns.md +45 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/grill-me/SKILL.md +80 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/grill-me/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/SKILL.md +117 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-approval-auto-reviewer.md +106 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-command-sandbox.md +441 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-context-freshness.md +47 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-credentials-auth.md +13 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-extensions-skills.md +13 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-file-edit-protocol.md +129 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-ide-integration.md +5 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-input-ingestion.md +13 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-instruction-composition.md +13 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-lifecycle-hooks.md +92 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-messaging.md +5 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-runtime-bootstrap.md +5 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-session-persistence.md +448 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-task-orchestration.md +13 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-tool-dispatch.md +123 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/agent-turn-lifecycle.md +131 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/inference-capacity-operations.md +162 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/llm-client-gateway.md +156 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/model-prompt-evaluation.md +146 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/llm-inference-integration/references/retrieval-agent-safety.md +273 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/SKILL.md +202 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/contracts-and-state.md +62 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/cross-stack-alignment.md +94 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/framework-choice.md +76 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/online-practice-uptake.md +56 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/platform-capabilities.md +91 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/product-page-checklist.md +40 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/qa-release.md +72 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/miniapp-product-dev/references/source-evidence-map.md +82 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-agent-delegation/SKILL.md +103 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-agent-delegation/agents/openai.yaml +5 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-agent-delegation/references/multi-agent-delegation-playbook.md +100 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/SKILL.md +70 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/references/public-data-acquisition.md +549 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/references/public-disclosure-channels.md +97 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/references/research-prompts.md +66 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/scripts/AGENTS.md +32 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/multi-perspective-research/scripts/test-public-data-acquisition-recipes.sh +379 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/SKILL.md +244 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/alerting-and-on-call.md +76 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/framework-middleware-checklist.md +142 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/infra-component-deployment.md +268 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/log-correlation-recipe.md +124 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/log-schema-canonical.md +208 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/metrics-conventions.md +105 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/obs-stack-architecture.md +107 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/sli-slo-design.md +95 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-observability/references/source-register.md +11 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/SKILL.md +303 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/canary-and-rollout-strategy.md +163 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/config-center-via-etcd.md +245 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/custom-control-plane-boundary.md +298 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/deploy-cli-concrete-recipe.md +312 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/deploy-pipeline.md +165 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/env-and-lane-matrix.md +126 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/lane-orchestration-control-plane.md +383 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/multi-region-and-cluster.md +135 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/promotion-gate-and-review.md +149 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/python-package-registry-release.md +462 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/rollback-playbook.md +123 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/secret-and-config-management.md +231 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-release-engineering/references/version-authority-and-deprecation.md +21 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/SKILL.md +276 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/dual-sidecar-and-traffic-config-center.md +127 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/framework-middleware.md +143 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/grpc-authority-workaround.md +90 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/http-response-envelope-contract.md +24 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/mesh-architecture.md +127 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/multi-env-routing.md +192 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/protobuf-http-contract-signals.md +64 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/retry-timeout-circuit-breaker.md +124 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/rpc-framework-recipe.md +494 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/service-discovery-choice.md +113 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/service-discovery-migration-playbook.md +231 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/platform-service-connectivity/references/service-discovery-recipe.md +131 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/SKILL.md +235 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/adr-convention.md +146 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/algorithm-launch-checklist.md +30 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/algorithm-launch-evaluation-report-template.md +25 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/algorithm-launch-execution-spec.md +108 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/algorithm-launch-sop.md +457 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/algorithm-launch-templates.md +24 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/artifact-egress-confidentiality.md +58 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/code-review-checklist.md +86 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/cross-repo-coordination.md +46 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/delivery-lifecycle.md +192 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/design-review-gate-mechanics.md +62 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/design-routing-and-readiness.md +45 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/diagnostic-spec-match-gate.md +36 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/dispatch-owner-skills.md +35 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/dormant-code-activation.md +47 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/existing-project-assessment-report.md +223 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/external-skill-augmentation.md +46 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/feature-deprecation-cascade.md +15 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/high-risk-resilience-gates.md +73 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/implementation-completeness-and-minimality.md +120 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/implementation-entry-reentry-gate.md +122 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/modular-monolith-heuristic.md +105 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/pre-final-continuation-gate.md +115 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/problem-resolution-and-learning.md +62 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/quality-attributes.md +112 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/quality-remediation-program.md +88 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/rd-standards-doc-family-checklist.md +27 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/refactoring-discipline.md +52 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/review-reception.md +34 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/shared-gate-artifact-classification.md +76 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/source-evidence-map.md +31 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/status-tracker-sync.md +77 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/sync-spec-repo-contract.md +25 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/verify-developer-experience.md +34 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/references/worktree-mechanics.md +55 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/scripts/AGENTS.md +18 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-rd-workflow/scripts/check-agent-contract-coverage.sh +213 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/SKILL.md +136 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/agents/openai.yaml +9 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/analytics-visualization-interactions.md +206 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/behavioral-aesthetic-logic.md +108 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/complex-creation-interactions.md +194 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/design-execution-checklist.md +214 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/design-impl-naming-and-versioning.md +53 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/design-intake-and-acceptance.md +129 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/design-system-source-of-truth.md +97 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/external-ui-ux-quality-benchmarks.md +79 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/frontend-code-evidence-map.md +63 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/interaction-design-patterns.md +146 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/layout-recipes-and-screenshot-acceptance.md +250 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/multi-project-token-consistency.md +237 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/multi-stack-strategy.md +65 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/operational-processing-workflows.md +237 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/platform-mobile-patterns.md +324 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/platform-web-desktop-patterns.md +456 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/product-lifecycle-acceptance-and-iteration.md +114 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/product-surface-patterns.md +79 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/resource-management-interactions.md +113 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/scenario-community-patterns.md +133 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/source-map.md +130 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/tokens-and-components.md +47 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/trust-sensitive-ai-and-data-patterns.md +96 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/ui-ux-audit.md +106 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/ui-ux-design-development.md +176 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/product-ui-ux-design/references/visual-craft.md +111 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/SKILL.md +157 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/ai-service-integration-boundaries.md +57 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/api-contract-and-schema.md +62 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/api-security-boundaries.md +39 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/architecture-playbook.md +46 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/async-execution-model.md +24 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/background-jobs-and-scheduling.md +18 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/batch-and-pipeline-architecture.md +11 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/config-secrets-runtime.md +22 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/data-modeling-and-migrations.md +64 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/data-platform-architecture.md +211 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/event-driven-architecture.md +263 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/multi-tenant-isolation.md +281 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/observability-and-ops.md +26 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/packaging-runtime-readiness.md +20 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/redis-cache-coordination.md +41 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/reliability-and-error-contract.md +17 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/source-evidence-map.md +55 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-architecture/references/web-framework-boundaries.md +26 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/SKILL.md +143 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/ai-service-wiring-patterns.md +16 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/async-and-worker-patterns.md +24 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/background-job-patterns.md +18 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/batch-and-artifact-patterns.md +13 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/dependency-client-patterns.md +39 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/error-handling-patterns.md +26 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/feature-playbook.md +43 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/observability-implementation-patterns.md +31 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/project-structure-and-tooling.md +24 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/public-api-security-patterns.md +52 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/redis-cache-lock-patterns.md +78 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/schema-and-validation-patterns.md +23 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/source-evidence-map.md +56 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/sqlalchemy-and-migrations-patterns.md +99 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/testing-and-quality-patterns.md +61 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/python-service-dev/references/web-framework-patterns.md +35 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/SKILL.md +91 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/config-runtime-readback.md +20 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/mr-merge-authorization.md +31 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/post-release-env-reset.md +31 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/release-closeout-evidence.md +20 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/release-scope-confirmation.md +21 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/tag-and-prod-pipeline-gate.md +20 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/test-scope-prompt.md +24 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-coordination/references/watcher-discipline.md +14 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-doc-writer/SKILL.md +64 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-doc-writer/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-doc-writer/references/comment-safe-release-doc.md +19 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-doc-writer/references/release-evidence-workflow.md +23 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/release-doc-writer/references/release-testing-scope-section.md +15 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-baseline/SKILL.md +87 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-baseline/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-doc-writer/SKILL.md +130 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-doc-writer/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-doc-writer/references/prd-composition-contract.md +35 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-doc-writer/references/requirement-closure-contract.md +86 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-doc-writer/references/security-four-questions.md +38 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-intent/SKILL.md +91 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-intent/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-scope/SKILL.md +88 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/requirement-scope/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/SKILL.md +337 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/analysis-parse-fix-test-challenge-replay.md +47 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/attribution-verification.md +69 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/bootstrap-slim-c3-obligation-table.md +112 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/coverage-exhaustion-traps.md +45 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/description-authoring.md +162 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/dual-track-review-gate.md +507 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/eval-routing.md +86 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/evidence-card-template.md +51 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/example-domain-preselect.md +79 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/external-practice-controls.md +57 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/extraction-lifecycle-handoff.md +65 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/extraction-quickstart.md +194 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/firing-point-placement.md +75 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/harness-patterns-and-eval.md +286 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/incident-postmortem-extraction.md +190 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/l0-l1-l2-routing.md +114 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/online-skill-review.md +47 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/parallel-stack-references-pattern.md +164 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/r0-leakage-audit.md +90 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/recurring-anti-patterns-checklist.md +320 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/resume-paused-delivery.md +16 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/review-feedback-mining.md +33 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/review-finding-standards.md +57 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/review-rubric.md +40 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/rule-consolidation.md +118 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/skill-listing-budget.md +19 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/source-register.md +254 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/source-to-skill-extraction.md +658 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/two-source-extraction-pattern.md +167 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/uiux-judgment-extraction.md +179 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/uiux-routing-map.md +51 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/references/validation-and-landing.md +180 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/AGENTS.md +18 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/check-ccl-skills.sh +1452 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/check-evidence-card-leak.sh +491 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/check-mr-target-freshness.sh +173 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/check-size-budget.sh +488 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/check-sync-pointers.sh +419 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/eval-golden-trace.rb +197 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/eval-health.rb +327 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/eval-routing-bank.rb +401 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/eval-routing.rb +248 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/generic-r0-leak-scan.sh +282 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/governing-chain-diff.py +321 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/impact-chain-gate.rb +964 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/register-firing-path-resolution.rb +708 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/skill-behavior-eval.py +540 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/source-register-lifecycle.rb +51 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/source-register-pending-status.rb +55 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_ai_coding_implementation_gates.sh +829 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_impact_chain_refscripts.sh +1203 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_r0_status.sh +75 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_register_pending_exclusion.sh +137 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_regressions.sh +173 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_route_drift.sh +377 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_size_budget.sh +833 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_skill_catalog.sh +491 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_ccl_source_register_lifecycle.sh +114 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_mr_target_freshness.sh +261 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_check_sync_pointers.sh +538 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_controlled_escalation_pins.sh +154 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_eval_routing_bank_grader_diagnostics.sh +190 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_eval_routing_bank_surface_binding.sh +178 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_eval_routing_prose_target.sh +86 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_generic_r0_leak_scan.sh +131 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_git_identity_predicate_gate.sh +243 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_governing_chain_diff.sh +419 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_impact_chain_gate_dateless_host.sh +120 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_register_firing_path_resolution.sh +724 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_register_firing_path_wiring.sh +414 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_regression_runner_registration.sh +34 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_routing_bank_integrity.sh +205 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_routing_pointer_integrity.sh +194 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_validate_skill_credential_cwd.sh +61 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_validate_skill_cross_refs.sh +111 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/test_validate_skill_root_depth.sh +53 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/skill-extraction-workflow/scripts/validate-skill.sh +257 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/terminal-cli-dev/SKILL.md +98 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/terminal-cli-dev/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/terminal-cli-dev/references/input-state-machines.md +36 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/terminal-cli-dev/references/streaming-rich-output.md +130 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/terminal-cli-dev/references/terminal-side-channels.md +96 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/SKILL.md +408 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/AGENTS.md +18 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/bitable-setup.md +573 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/ci_templates/README.md +120 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/ci_templates/github-actions.yml +119 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/ci_templates/gitlab-ci.yml +76 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/ci_templates/jenkins.Jenkinsfile +106 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/classical-test-design-techniques.md +279 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/gen_report.py +2807 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/makefile-template.md +200 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/report-config-schema.md +272 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/run_pytestless.py +475 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/source-to-case-workflows.md +258 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc-marker-conventions.md +316 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc-review-and-prioritization.md +145 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc_helpers/AGENTS.md +16 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc_helpers/tc.dart +129 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc_helpers/tc.go +197 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc_helpers/tc.py +135 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/tc_helpers/tc.ts +285 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/test_gen_report.py +2144 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/test-artifact-management/references/update-lifecycle.md +62 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/SKILL.md +212 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/ci-fixtures-and-flake-control.md +75 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/client-runtime-test-matrices.md +50 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/data-and-workflow-testing.md +34 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/design-closed-contract-oracles.md +31 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/e2e-real-flow-testing.md +71 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/fitness-functions.md +240 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/integration-contract-testing.md +235 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/non-functional-specialized-scenarios.md +296 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/rd-testing-standard-template.md +126 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/run-killing-mutation-walk.md +43 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/scenario-testing.md +136 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/source-evidence-map.md +59 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/structured-tc-input-translation.md +67 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/test-code-authoring-patterns.md +392 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/test-data-and-determinism.md +39 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/test-topology-and-commands.md +92 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/unit-testing.md +46 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/vendored-contract-drift-checklist.md +64 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/references/verify-enforcement-mechanisms.md +18 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/AGENTS.md +17 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/client-terminal-ansi-check.py +140 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/client-terminal-ansi-check.test.sh +75 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/lang-basics-ast-check.py +170 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/lang-basics-ast-check.test.sh +87 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/lang-basics-go-check.go +198 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/lang-basics-go-check.test.sh +109 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/testing-strategy/scripts/test_mutation_backup_recipe.sh +237 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/SKILL.md +184 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/references/comment-safe-feishu.md +93 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/references/cross-model-co-review.md +3 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/references/delivery-face-closeout.md +60 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/references/doc-charter-first.md +17 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/tighten-doc/references/session-vantage-leakage.md +58 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/SKILL.md +126 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/references/complex-workspace-patterns.md +47 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/references/embedded-h5-in-host.md +87 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/references/react-architecture.md +194 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/references/source-evidence-map.md +60 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/references/web-quality-release.md +190 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/web-react-dev/references/web-ui-quality.md +83 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/SKILL.md +179 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/agents/openai.yaml +4 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/references/shared-branch-rebase.md +25 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/scripts/AGENTS.md +23 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/scripts/test_worktree_status.sh +207 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/scripts/test_worktree_sweep.sh +481 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/scripts/worktree-status.sh +325 -0
- package/dist/assets/marketplace/plugins/ccl-skills/skills/worktree-isolation/scripts/worktree-sweep.sh +245 -0
- package/dist/assets/release.json +2797 -0
- package/dist/claude-adapter.d.ts +9 -0
- package/dist/claude-adapter.js +240 -0
- package/dist/cli-worker.d.ts +1 -0
- package/dist/cli-worker.js +32 -0
- package/dist/cli.d.ts +22 -0
- package/dist/cli.js +214 -0
- package/dist/codex-host.d.ts +30 -0
- package/dist/codex-host.js +162 -0
- package/dist/fs-safe.d.ts +21 -0
- package/dist/fs-safe.js +241 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/manifest.d.ts +8 -0
- package/dist/manifest.js +135 -0
- package/dist/opencode-adapter.d.ts +10 -0
- package/dist/opencode-adapter.js +416 -0
- package/dist/operations.d.ts +3 -0
- package/dist/operations.js +956 -0
- package/dist/paths.d.ts +20 -0
- package/dist/paths.js +4 -0
- package/dist/types.d.ts +58 -0
- package/dist/types.js +1 -0
- package/dist/unified.d.ts +4 -0
- package/dist/unified.js +64 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +5 -0
- package/package.json +35 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
# Event-Driven Architecture (Go)
|
|
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 Go service that publishes or consumes messages.
|
|
4
|
+
|
|
5
|
+
Scope split with the sibling `mq-consumer-architecture.md` (which covers consumer-side processing semantics, topic/group ownership, and consumer operations): this file owns the **broader event-driven architecture concerns** — delivery semantics taxonomy, producer-side patterns, transactional outbox, idempotency design, schema evolution, saga/choreography, fanout, replay, and end-to-end "exactly-once" illusion. Load both when designing a new event-driven boundary.
|
|
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 `python-service-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 `python-service-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 *Go-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 RPC with no durable async boundary (use `protobuf-contract-architecture.md` instead),
|
|
24
|
+
- uses a job queue purely for in-tenant background work where loss is acceptable (use `notification-architecture.md` or `bulk-workflow-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 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 in Go services: 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 schema embedded in the protobuf/Avro descriptor 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 Go services using protobuf for events, see also `protobuf-contract-architecture.md` for `message`/`enum`/`oneof` evolution rules.
|
|
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; shutdown via the request/service cancellation signal (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 channel + single worker, or process messages serially within the partition's poll loop. Feeding multiple ordered partitions into a single shared bounded channel + 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, 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 error 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 RPC as command** — a "command" sent via blocking 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 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
|
+
## Go-specific implementation patterns
|
|
220
|
+
|
|
221
|
+
These are stack-localized recipes that implement the stack-agnostic patterns above; the sibling Python file localizes the same patterns differently.
|
|
222
|
+
|
|
223
|
+
- **Library choice axis** — pick by feature, not popularity. For Kafka in Go: a high-level client (e.g., `segmentio/kafka-go` or `confluent-kafka-go`) for ergonomic ops; a lower-level client when you need precise offset/transaction control. For Pulsar/NATS/RabbitMQ: the vendor's Go client. Standardize within the service; multi-broker services need an abstraction that does not hide delivery semantics.
|
|
224
|
+
- **Consumer goroutine shape** — depends on ordering (see *Backpressure* above):
|
|
225
|
+
- *Unordered work queue*: one puller goroutine into a buffered channel; a worker pool of N goroutines reads from the channel.
|
|
226
|
+
- *Ordered partitioned log*: one goroutine per assigned partition that processes serially, or a per-partition bounded channel with a single worker. Use `ctx.Done()` for shutdown; never feed multiple ordered partitions into a shared worker pool.
|
|
227
|
+
- **Context propagation** — extract correlation id, trace context, lane/env from the message headers into `context.Context` at the consumer boundary. Use the existing service helper for ctx-clone-without-cancel when spawning workers; do not let a single message's cancellation cancel the whole consumer.
|
|
228
|
+
- **Outbox poller with GORM/sqlx** — a goroutine in the same service that runs a **claim → commit → publish → mark-sent** loop, not "publish inside the DB tx" (a broker call inside `BEGIN…COMMIT` holds the tx open for the broker round-trip and violates the short-transaction rule in `data-modeling-and-migrations.md`):
|
|
229
|
+
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; tx closes immediately.
|
|
230
|
+
2. **Publish (outside any tx)**: call the broker for each leased row. Duplicate publish on retry is acceptable because the consumer dedups.
|
|
231
|
+
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.
|
|
232
|
+
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).
|
|
233
|
+
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).
|
|
234
|
+
- **Idempotency storage** — pick by impact (see *Idempotency design*):
|
|
235
|
+
- Lossy/rebuildable: Redis `SET dedup:<key> 1 EX <window> NX`, branch on success/skip.
|
|
236
|
+
- Source-of-truth: insert into a `processed_events` table with `event_id` as primary key inside the side-effect transaction; on duplicate-key error, skip. Optionally cache the recent N keys in Redis as a hot-path filter, but Redis is not the authority.
|
|
237
|
+
- Cross-system effects: intent-then-execute pattern — write `processed_events` row with status `pending` in DB tx, run the external call with a provider idempotency key, update status to `done` on success.
|
|
238
|
+
- **Retry policy** — bounded `exponential backoff with jitter`; never retry inside the message handler with an inline `time.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).
|
|
239
|
+
- **Error classification** — wrap errors with `fmt.Errorf("…: %w", err)`; classify via `errors.Is`/`errors.As` at the boundary into `retry` / `drop` / `dlq` dispositions; never return a bare `error` and let the dispatcher guess.
|
|
240
|
+
- **Test substitution** — define a `Broker` interface at the service boundary; provide an in-memory implementation for unit tests and an integration test that hits a real broker (Kafka container, RabbitMQ container). Mocking the broker client directly leaks library specifics into tests.
|
|
241
|
+
- **Graceful shutdown order** — signal handler → cancel root context → puller stops fetching → workers drain (bounded by `ShutdownGracePeriod`) → outbox poller finishes its in-flight publish → broker client closes → DB connection closes. If the last outbox publish needs an in-flight DB read, hold DB open until the outbox poller acknowledges drain; the rule is "no new work in flight," not "rigid component order."
|
|
242
|
+
|
|
243
|
+
### Mirrored-section grep gate
|
|
244
|
+
|
|
245
|
+
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 `## Go-specific implementation patterns` H2). Run this grep against the mirrored region before every commit; zero hits required.
|
|
246
|
+
|
|
247
|
+
Forbidden tokens for this Go file's mirrored sections:
|
|
248
|
+
|
|
249
|
+
- **DB-engine syntax** — `SET LOCAL`, `set_config\(`, `current_setting\(`, `pg_try_advisory`, `pg_stat_activity`, `BYPASSRLS`, `FORCE ROW LEVEL SECURITY`, `search_path`, `GET_LOCK\(`.
|
|
250
|
+
- **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`.
|
|
251
|
+
- **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`.
|
|
252
|
+
|
|
253
|
+
Run:
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
awk '/^## Go-specific implementation patterns/{exit} 1' event-driven-architecture.md \
|
|
257
|
+
| 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)'
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
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 Python file maintains the matching gate for Python-side tokens, so a token forbidden here may legitimately appear in the *Python-specific implementation patterns* section of the sibling, and vice versa.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# HTTP Gateway Architecture
|
|
2
|
+
|
|
3
|
+
Use this when designing an HTTP API layer, generated HTTP routes, gateway-to-RPC mapping, or generated HTTP clients.
|
|
4
|
+
|
|
5
|
+
## Boundary
|
|
6
|
+
|
|
7
|
+
- Treat the HTTP gateway as a transport boundary, not the owner of core domain behavior.
|
|
8
|
+
- Public HTTP contracts and internal RPC contracts may share protobuf inputs only when their stability, trust, and validation needs are the same.
|
|
9
|
+
- Generated route files, generated DTOs, and generated clients are output surfaces; hand-written code should live in extension points that generators preserve.
|
|
10
|
+
- Generated handlers may be a scaffold, but final handlers should explicitly call application logic, map errors, and return canonical responses.
|
|
11
|
+
- Keep custom routes separate from generated routes unless the generator provides a stable insertion point.
|
|
12
|
+
|
|
13
|
+
## Route And Middleware Design
|
|
14
|
+
|
|
15
|
+
- Derive method, path, path/query/body/header binding, and docs from IDL annotations or one authoritative route source.
|
|
16
|
+
- Route groups should mirror path and trust boundaries, not incidental folder structure.
|
|
17
|
+
- Middleware should be ordered deliberately: request context, tracing/log id, authentication, authorization, validation, recovery/error mapping, metrics/logging, then handler logic.
|
|
18
|
+
- Bypass middleware should be explicit, reviewed, and small.
|
|
19
|
+
- Generated middleware hooks should default to no-op and require intentional implementation.
|
|
20
|
+
|
|
21
|
+
## Handler Responsibilities
|
|
22
|
+
|
|
23
|
+
- Handlers bind and validate transport input, resolve caller context, call application logic, and map output to the HTTP contract.
|
|
24
|
+
- Do not put transactions, complex queries, fan-out, or long-running work directly in handlers.
|
|
25
|
+
- Validation errors, auth failures, dependency failures, and domain failures should map to stable HTTP status and canonical error code/message semantics.
|
|
26
|
+
- API docs should describe the public contract, not internal implementation names.
|
|
27
|
+
|
|
28
|
+
## Generated HTTP Client Policy
|
|
29
|
+
|
|
30
|
+
- Generated clients should expose typed request/response methods while allowing caller-supplied context, headers, request options, middleware, and response-result policy.
|
|
31
|
+
- Service discovery or host selection should be explicit; do not mix relative generated paths with hidden global endpoints.
|
|
32
|
+
- Response success must consider both HTTP status and the API envelope when one exists.
|
|
33
|
+
- Client wrappers should handle compression, content type, path escaping, repeated query fields, and typed error bodies consistently.
|
|
34
|
+
- Generated client code should be reproducible and reviewed separately from handwritten adapter logic.
|
|
35
|
+
|
|
36
|
+
## IDL-First Three-Tier Layout
|
|
37
|
+
|
|
38
|
+
- Architecture standardizes a three-tier layout for IDL-driven HTTP gateways: generated router (IDL → URL/verb binding), thin handwritten stubs (request struct + BindAndValidate + dispatch), and business handler (application logic). The three tiers exist so IDL evolution does not force handler rewrites and so handlers do not duplicate validation.
|
|
39
|
+
- The stub tier is a stable seam: when initially generated, freeze it with a "do not hand-edit" marker; subsequent regeneration may overwrite. Business logic does not live in the stub tier under any circumstance.
|
|
40
|
+
- Generated router files and stubs both carry the generated-file convention; reformatters and linters must skip them.
|
|
41
|
+
|
|
42
|
+
## Middleware Composition Across Layers
|
|
43
|
+
|
|
44
|
+
- The middleware contract has two layers: the framework default (recovery, context injection, metrics, tenant/identity propagation, tracing) registered inside the server-construction helper, and the business-level middleware (CORS, auth/login, request logging, custom context) registered in service `main()`.
|
|
45
|
+
- Architecture writes down both layers and the resulting effective order so service authors and reviewers can see the full stack. Hidden defaults plus invisible business overrides lead to ordering bugs that surface only under load.
|
|
46
|
+
- Recovery middleware sanitizes the response: a stable error code and a generic message reach the client; the panic value, stack trace, and internal error chain stay in the log/trace. Information disclosure through recovery is a security finding.
|
|
47
|
+
- An empty middleware stub (declared but not implemented) is dead code and should not ship.
|
|
48
|
+
|
|
49
|
+
## Long-Lived Connection Handling (WebSocket / SSE / long-poll)
|
|
50
|
+
|
|
51
|
+
Distinct from request/response handlers: long-lived connections (WebSocket, Server-Sent Events, long-poll) hold one socket per active user for minutes to hours and have a separate failure mode set. The release-side client-of-progress-stream concerns live in `go-microservice-dev/references/release-ops-patterns.md` (Release CLI section); the architecture rules below govern the *server* holding the connections.
|
|
52
|
+
|
|
53
|
+
- **Origin / handshake check is production-strict**: the WebSocket-upgrade and EventSource-upgrade `Origin` check is the browser-CSRF defense for these protocols (long-poll uses normal HTTP CORS); disabling it ("`CheckOrigin: always true`") is acceptable only for non-production environments and MUST be guarded by an explicit `env.IsProd()`-style condition with the production branch enforcing an allowlist. Origin headers are spoofable from non-browser clients, so the Origin check is the browser-CSRF defense only; cross-origin auth on the connection itself still requires a session cookie / token bound to the user.
|
|
54
|
+
- **Handshake / idle / liveness — per-protocol**:
|
|
55
|
+
- *WebSocket*: HandshakeTimeout (typical 5-10s, prevents slow-loris on upgrade); per-connection read deadline refreshed on each ping/pong or business message; server-initiated application-level ping at a documented interval (typical 30s) with close on missed-pong.
|
|
56
|
+
- *SSE*: write deadline on each event; server-emitted heartbeat comment (`: ping\n\n` or named-event no-op) at a documented interval (typical 15-30s); reverse-proxy buffering disabled (`X-Accel-Buffering: no` or framework equivalent) so heartbeats are not held in a buffer.
|
|
57
|
+
- *Long-poll*: bounded request timeout on the server side (typical 30-60s — must be shorter than ingress/LB idle timeout to surface as orderly close, not a TCP reset); reconnect cadence is the client's contract and the server returns an empty-result response immediately on timeout so the client can reconnect.
|
|
58
|
+
|
|
59
|
+
Absence of the protocol's liveness contract lets dead connections accumulate until file-descriptor exhaustion.
|
|
60
|
+
|
|
61
|
+
- **Identity key is the full tuple `(app, tenant, user)` everywhere — never bare `user_id`**: the connection registry, the cap counter, the consistent-hash routing key, the broker channel name, the presence-index ownership key, and the read/write paths all use the same tuple. Bare `user_id` collides across tenants and apps: tenant A user 42 and tenant B user 42 share the same routing slot, the same cap bucket, the same channel, and the same presence owner — silent cross-tenant message delivery and cap-bucket sharing. The tuple is treated as one opaque composite key (e.g. hash of all three) in routing functions; the parts are never recombined downstream by a different rule.
|
|
62
|
+
- **Per-user connection cap is enforced through shared state, not per-replica registry alone**: a per-replica registry counts only that replica's connections; with N replicas and naive enforcement, effective cap = `cap × N`. Enforce the cap, keyed by `(app, tenant, user)`, through one of: (a) consistent-hash routing of inbound connections by the `(app, tenant, user)` tuple at the ingress (so per-replica cap *is* the effective cap), (b) a shared lease / counter (Redis `INCR` on the tuple-keyed counter with TTL, refreshed on heartbeat; decrement on disconnect — and a sweep job to release stale leases when a replica dies), or (c) the presence-index service from the fan-out rule below also owning the count. Documented policy on cap-hit (kick oldest, reject new, structured error) AND the policy holds identically across replicas because the counter is shared.
|
|
63
|
+
- **Multi-replica fan-out story is explicit AND the send path is consistent with the connection path**: in-process connection registries are ephemeral and per-replica. When the notify-to-user path traverses multiple replicas (the most common case: any replica can receive an incoming "send" while a different replica holds the user's connection), the architecture names ONE of (all keyed by the same `(app, tenant, user)` tuple as the registry):
|
|
64
|
+
- **(a) Consistent send + connection routing**: both the inbound user connection AND the inbound "send to user" RPC are consistent-hash routed by the same `(app, tenant, user)` tuple at the ingress, so they always land on the same replica. Sticky connection routing alone is NOT sufficient — if the send path is normally load-balanced while connections are sticky, sends land on replica A while the connection is on replica B and the user never receives the message.
|
|
65
|
+
- **(b) Broker-mediated fan-out**: the inbound send writes to a channel keyed by `(app, tenant, user)` (Redis Pub/Sub, NATS, internal MQ) and every replica subscribes and delivers to its locally-held connections. The send replica does not need to know which replica holds the connection.
|
|
66
|
+
- **(c) Presence-index service**: a separate service maps `(app, tenant, user) → owning-replica`; the send-receiving replica looks up the owner and RPC-calls that replica. Presence-index needs its own lease / heartbeat so a dead owning-replica's users are remapped.
|
|
67
|
+
- **Concurrent writes to one connection MUST hold a per-connection write mutex**: WebSocket / SSE framing corrupts if two goroutines write simultaneously to the same connection. The mutex protects only writes (reads are inherently single-reader). A buffer pool (`sync.Pool` of `bytes.Buffer`) for write payloads reduces allocation but does not substitute for the write mutex.
|
|
68
|
+
- **Close handling distinguishes graceful close from network drop**: server reads a `CloseMessage` (graceful) versus the read returning an error (drop); both paths MUST remove the entry from the connection registry, decrement the shared per-user counter (per the cap rule), and release the per-user slot — leaking a registry entry blocks the user from reconnecting.
|
|
69
|
+
- **Connection-state vs message-state are different stores**: "is user X currently connected" lives in a shared cache (Redis with short TTL) for cross-replica visibility AND the unread-message-count for offline users; the message inbox itself lives in a durable store (DB) so disconnected users get history on next pull. Conflating "presence cache" with "message store" loses messages on cache eviction.
|
|
70
|
+
- **Backpressure: bound by items AND bytes AND aggregate memory**: per-connection outbound queue capped by item count (typical: low double-digits) AND per-connection byte budget (item count alone allows a single large message to OOM the connection) AND per-message size limit (server rejects oversized payloads before they enter the queue). Aggregate process / pod outbound-buffer memory is bounded with shedding — when the global budget is hit, shed lowest-priority deliveries or close slowest connections rather than waiting for OOM-kill. On per-connection overflow, either close the connection (the client will reconnect and pull from the durable inbox) or drop the in-flight delivery and rely on the durable inbox + the client's pull path. Item-count bounds without byte bounds are an OOM-by-large-message vector; per-connection bounds without aggregate bounds are an OOM-by-many-slow-clients vector.
|
|
71
|
+
|
|
72
|
+
## Framework Version Baseline (CloudWeGo Hertz)
|
|
73
|
+
|
|
74
|
+
- **Hertz v0.10 (released 2025-05) baseline shifts to track**: (a) **first-class SSE handler integration** — services standing up SSE no longer need a third-party SSE library on top of Hertz; the new built-in SSE helper handles framing, heartbeat emission, and connection close per the SSE rules in the Long-Lived Connection Handling section above (still on the team to implement origin check, per-user cap, multi-replica fan-out — Hertz only owns the per-connection write side). (b) **`http.Handler` adapter** lets a Hertz route delegate to a stdlib `net/http.Handler` — useful when a third-party library (Prometheus exporter, pprof, generic OAuth library) only ships a stdlib handler; before v0.10 those needed custom wrappers. (c) **HTTP/3 + QUIC remain `hertz-contrib/http3` (separate module on `quic-go`), NOT in Hertz core** — the architecture must declare HTTP/3 as a deliberate adoption (extra deployment surface, quic-go upgrade cadence, observability gaps) rather than a Hertz version-bump side effect. ALPN + Alt-Svc + QUIC/TLS parallel-listen support shipped earlier (v0.5+), so the wire side has been stable for a while; the contrib package is the integration point. Pin Hertz minor versions in `go.mod` and re-run smoke tests on any minor bump.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# MQ Consumer Architecture
|
|
2
|
+
|
|
3
|
+
Use this when designing message topics, consumer groups, event contracts, async processors, or producer/consumer ownership.
|
|
4
|
+
|
|
5
|
+
## Event Contract
|
|
6
|
+
|
|
7
|
+
- Treat MQ delivery as at-least-once unless the queue contract proves otherwise.
|
|
8
|
+
- Every event type needs owner, producer, consumer group, payload schema, version, event id or idempotency key, occurred time, and retry policy.
|
|
9
|
+
- Payloads should carry stable resource identifiers and event type, not require consumers to parse free-form text.
|
|
10
|
+
- Consumers should tolerate unknown additive fields and reject unknown required semantics at the boundary.
|
|
11
|
+
- If ordering matters, define the ordering key and constrain consumer concurrency accordingly.
|
|
12
|
+
|
|
13
|
+
## Topic And Group Ownership
|
|
14
|
+
|
|
15
|
+
- Topic names, consumer groups, tags/filters, worker count, retry count, and delay policy belong in typed config.
|
|
16
|
+
- Consumer groups should map to one logical processing responsibility.
|
|
17
|
+
- Multiple responsibilities may share a topic only when each consumer has explicit event filters and independent idempotency.
|
|
18
|
+
- Producer identity, queue selector, trace/log metadata, lane/environment metadata, and ordering key are part of the contract when the queue platform supports them.
|
|
19
|
+
- Dynamic activation gates, such as environment/lane allowlists or feature switches, should be config-driven and observable.
|
|
20
|
+
- A disabled consumer should skip startup cleanly; a misconfigured required consumer should fail service readiness.
|
|
21
|
+
|
|
22
|
+
## Processing Semantics
|
|
23
|
+
|
|
24
|
+
- Decode, validate, and pre-handle payloads before side effects.
|
|
25
|
+
- Distinguish permanent drops from retryable failures:
|
|
26
|
+
- malformed payload, unknown event type, or irrelevant event can be logged/alerted and acknowledged.
|
|
27
|
+
- transient dependency failures should return retry.
|
|
28
|
+
- permanent domain conflicts should map to a documented ack or dead-letter policy.
|
|
29
|
+
- Re-read current state before acting on delayed, duplicate, or out-of-order messages.
|
|
30
|
+
- Side effects must be idempotent by event id, resource id, natural key, or durable task state.
|
|
31
|
+
|
|
32
|
+
## Operations
|
|
33
|
+
|
|
34
|
+
- Consumer startup, skip, retry, drop, success, failure, and latency should be logged and metered with low-cardinality tags.
|
|
35
|
+
- Slow message processing needs a configurable threshold and alert path.
|
|
36
|
+
- Consumer shutdown should stop fetching new messages, wait for in-flight handlers up to a deadline, then close clients.
|
|
37
|
+
- Poison messages need a dead-letter, quarantine, or manual replay plan before launch.
|
|
38
|
+
- Ordered processing should constrain worker count or partitioning explicitly; unordered processing must tolerate duplicate, delayed, and out-of-order delivery.
|