@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,130 @@
|
|
|
1
|
+
# Dependency Client Patterns
|
|
2
|
+
|
|
3
|
+
Use this when implementing reusable clients or adapters for dependencies.
|
|
4
|
+
|
|
5
|
+
## Secret Client
|
|
6
|
+
|
|
7
|
+
- Hide secret reads behind typed methods such as `GetDatabaseCredential`, `GetQueueCredential`, `GetObjectStorageCredential`, or `GetAppCredential`.
|
|
8
|
+
- Apply a request timeout to secret reads and wrap errors with the secret class, not the secret value.
|
|
9
|
+
- Decode JSON secret payloads into typed structs and validate required fields.
|
|
10
|
+
- Cache temporary credentials under a mutex or singleflight and refresh before expiry.
|
|
11
|
+
- For write/admin secret APIs, require explicit call sites and audit logging.
|
|
12
|
+
- Redact secrets from logs, test output, panic messages, and generated docs.
|
|
13
|
+
- Convenience package-level clients must be replaceable by constructors or DI for tests. If a client can panic during initialization, keep that path in bootstrap code and expose a constructor that returns errors for request-time dependencies.
|
|
14
|
+
|
|
15
|
+
## Service Discovery Client
|
|
16
|
+
|
|
17
|
+
- Create discovery clients once in DI and pass them to RPC/HTTP client builders.
|
|
18
|
+
- Use healthy-only lookup by default.
|
|
19
|
+
- Support metadata filters such as lane/environment through typed tags.
|
|
20
|
+
- If lane lookup misses, fall back only to an explicit baseline lane.
|
|
21
|
+
- Return a clear dependency error when no instance is available; do not fabricate endpoints.
|
|
22
|
+
|
|
23
|
+
## Internal RPC Proxy Adapter
|
|
24
|
+
|
|
25
|
+
- Require an explicit target-service field in trusted metadata or a typed proxy request; reject empty or malformed destinations before opening downstream connections.
|
|
26
|
+
- Resolve targets through the runtime discovery policy: in-cluster service DNS when appropriate, otherwise same-lane lookup with explicit baseline fallback.
|
|
27
|
+
- Preserve trace/log id, lane/environment, and caller service identity in outgoing metadata; do not forward unreviewed headers or credentials blindly.
|
|
28
|
+
- Bound connection pools, return or close connections deterministically, and propagate context cancellation to both upstream and downstream streams.
|
|
29
|
+
- Isolate transport-specific reflection or frame-copying code behind a narrow adapter with tests for metadata propagation, connection cleanup, EOF handling, and downstream selection failure. When codegen output shape varies, prefer a documented interface method with a direct-then-unwrap fallback over reflecting into generated structs; reflection here is a smell, and the reflective fallback must emit an observability signal when it fails to find the field, or propagation breaks silently.
|
|
30
|
+
|
|
31
|
+
## Dynamic Config Client
|
|
32
|
+
|
|
33
|
+
- When etcd backs dynamic config, prefer a small store adapter or typed client boundary; do not let etcd imports or raw keys leak into domain, application, or transport code.
|
|
34
|
+
- For local-first KMS over dynamic config, provide an in-memory store for fast tests and verify encrypted envelopes, missing master key failure, missing secret failure, and readiness behavior.
|
|
35
|
+
- Wrap dynamic config keys behind typed methods instead of exposing raw string keys throughout application code.
|
|
36
|
+
- Centralize namespace and backend key construction in the client; list/watch APIs should return caller-facing keys or documented resume markers, not raw backend prefixes by accident.
|
|
37
|
+
- Use bounded timeouts for get, set, delete, and watch operations.
|
|
38
|
+
- Decode JSON config into typed structs and validate required fields before use.
|
|
39
|
+
- Cache read-heavy keys with TTL; distinguish not found, decode error, and remote dependency error.
|
|
40
|
+
- Listener callbacks should recover panics, update local cache, and stop cleanly when the parent context is canceled.
|
|
41
|
+
- Tests should cover default behavior when config is missing or malformed.
|
|
42
|
+
|
|
43
|
+
## HTTP Client Wrapper
|
|
44
|
+
|
|
45
|
+
- Provide helpers for constructing requests, attaching discovery options, setting headers, and executing with timeout.
|
|
46
|
+
- Use `DoTimeout` or a context deadline for every outbound call.
|
|
47
|
+
- **A middleware / client WRAPPER (interceptor, governance layer) owns deadline *propagation*, not a fixed timeout *policy* — but every production call still gets a bounded effective deadline.** Honor the caller's `context` deadline; don't bake an arbitrary fixed default (a hardcoded `30s`) into the wrapper that overrides it. But "no wrapper default" ≠ "unbounded": a `context.Background()` caller plus a hung dependency pins goroutines/connections forever, so the wrapper applies an **env-configured max backstop** as the effective deadline when the caller supplies none, overridable at the call site, with an explicit documented opt-out only for long-lived watch/stream calls **that still bound their own liveness** (idle/read timeout, heartbeat, bounded reconnect, cancel cleanup) — the opt-out is from the single request deadline, not from all bounds, or a half-open stream pins resources forever. Clamp **every untrusted/external inbound deadline** — an inbound gRPC `grpc-timeout` as much as an HTTP deadline header — to platform min/max **before** honoring or propagating it, or an external caller sets a huge deadline to hold resources (slow-DoS). Propagate with the transport's **native** decrementing mechanism where it exists (gRPC `grpc-timeout`, not a reinvented `x-rpc-timeout-ms`); HTTP has **no** native on-wire deadline, so cross-hop propagation over HTTP needs an explicit deadline-header contract — strip any caller-supplied one at ingress and generate the internal header from the server-side (clamped) effective context. Don't add an *independent competing* timer, but a **derived** per-attempt cap is correct — `per-attempt = min(caller-remaining, configured max)`; and before each retry/hedge recompute the remaining budget and **skip** the attempt when it can't cover attempt + backoff + cleanup (doomed retries amplify overload).
|
|
48
|
+
- Always close response bodies when using standard HTTP APIs.
|
|
49
|
+
- Parse response status and body separately; do not treat a 200 transport status as domain success automatically.
|
|
50
|
+
- Keep redirect behavior explicit.
|
|
51
|
+
- Include operation name, callee service, status code, duration, and canonical error code in logs/metrics.
|
|
52
|
+
|
|
53
|
+
## Object Storage Adapter
|
|
54
|
+
|
|
55
|
+
- Build object storage clients from config plus secret provider credentials.
|
|
56
|
+
- Default endpoint selection can depend on runtime environment, but the choice must be explicit and testable.
|
|
57
|
+
- Add source service, lane/environment, and trace/log id metadata or tags on writes when supported.
|
|
58
|
+
- Wrap provider errors into typed categories: not found, forbidden, retryable server error, client/config error.
|
|
59
|
+
- For uploads, validate content size, content type, key namespace, and idempotency before writing.
|
|
60
|
+
- For downloads, support `Head` before `Get` when size, range, or existence matters.
|
|
61
|
+
- For multipart upload, define part iterator, part numbering, completion, and cleanup-on-error behavior.
|
|
62
|
+
- For object copy or migration tools, define overwrite/conflict policy before transfer, tag migrated objects with source identity, emit replayable success/error/conflict records, bound concurrency, and flush/close log writers on shutdown.
|
|
63
|
+
- For signed URLs, require explicit expiry and never log the full URL if it contains credentials.
|
|
64
|
+
|
|
65
|
+
## Search Or Document Store Adapter
|
|
66
|
+
|
|
67
|
+
- Wrap index or collection access behind repository interfaces; do not let handlers build raw provider queries.
|
|
68
|
+
- Build clients with timeout, pool bounds, tracing, health policy, and credentials from the secret provider.
|
|
69
|
+
- Keep index names, collection names, mappings, and versioning policy near the adapter or migration package.
|
|
70
|
+
- Validate filters through an allowlist and enforce max limit plus stable sorting before executing queries.
|
|
71
|
+
- Treat bulk writes as partially successful until per-item results are inspected.
|
|
72
|
+
- Tests should cover query construction, pagination, empty result behavior, and retryable write failures.
|
|
73
|
+
|
|
74
|
+
## ID Generator Client
|
|
75
|
+
|
|
76
|
+
- Wrap ID allocation behind a small interface such as `Next(ctx)` and `Batch(ctx, n)`.
|
|
77
|
+
- Validate namespace and requested count at the boundary.
|
|
78
|
+
- Batch prefetch may improve latency, but cache size must be bounded and refill errors must not spin hot.
|
|
79
|
+
- `Next` should time out quickly and return an ordinary error.
|
|
80
|
+
- If using local fallback, log it as degraded behavior and keep the fallback generator's node/namespace uniqueness explicit.
|
|
81
|
+
- Propagate caller identity and trace/log id to central ID services.
|
|
82
|
+
|
|
83
|
+
### In-process ID generator (snowflake-style)
|
|
84
|
+
|
|
85
|
+
Applies when the architecture chose a local-only generator OR when the central client falls back to a local one. The architecture-level "in-process vs central vs DB-issued" decision lives in `go-microservice-architecture/references/dependency-platform.md` (ID Generation section); the rules here govern how the local generator must behave once that choice is made.
|
|
86
|
+
|
|
87
|
+
- **Bit layout is a frozen contract**: document the layout once (e.g., `41-bit timestamp + 8-bit namespace + 4-bit node + 10-bit counter`) and the epoch (`baseTs`) alongside it. Changing widths or order invalidates every previously-issued ID that any consumer parses by position; treat layout changes as a versioned migration with an epoch bump, not an in-place edit.
|
|
88
|
+
- **Counter width sizes the per-generator per-millisecond peak**: 10 bits is 1024 IDs/ms per generator, 12 bits is 4096/ms. When the millisecond's counter exhausts, the generator yields (short `Sleep` or runtime yield, not a raw spin) until the next millisecond — never overflow into adjacent bit fields (namespace or node), which silently collides IDs with another logical generator. The wait is bounded by both the caller's context deadline AND a documented per-generator cap (typical: low milliseconds for counter rollover, longer for clock-backward stall); whichever fires first returns an ordinary timeout error rather than block past it. A `context.Background()` caller still hits the per-generator cap — never block indefinitely on a stalled wall clock. The same discipline applies to the clock-backward stall below.
|
|
89
|
+
- **Clock-backward protection is mandatory, not advisory**: persist `last_issued_ts` in-memory across a process lifetime. On every issue, refuse or stall when `now < last_issued_ts`. Logging a warning while issuing the ID is not protection — NTP slew, VM pause-replay, container start before time sync, and operator clock reset all produce backward clocks; without refusal, duplicates are issued for the entire backward window. Stalls are bounded by caller deadline AND a per-generator cap as above; on exceed, return an error rather than block.
|
|
90
|
+
- **Restart safety when `(namespace, node)` is reused**: persisting in-memory state only is insufficient — a crash-restart cycle inside the same millisecond resets the in-memory counter to zero and re-issues the IDs already emitted that millisecond, without any clock rewind. When `(namespace, node)` is reusable across restarts (the common case for stable-identity replicas), the generator MUST do one of:
|
|
91
|
+
- **(a) Skip-the-partial-millisecond**: persist `last_issued_ts` durably and, on startup, refuse to issue until wall time strictly exceeds the persisted value. Durable write of `last_issued_ts` must occur BEFORE the ID with that timestamp is observable to the caller (write-ahead, not async flush, not shutdown-only flush) — otherwise a crash between "ID returned" and "state persisted" leaves the persisted high-water mark below the issued ts and the next startup re-issues into that millisecond. Per-call durable writes are expensive; the common implementation amortizes by reserving the next millisecond durably (write `last_issued_ts = now_ms + 1` before issuing any ID in `now_ms`).
|
|
92
|
+
- **(b) Resume-the-counter**: persist `(last_issued_ts, last_counter)` durably and resume from `last_counter + 1` within the same millisecond on startup. The same write-ahead durability rule applies as in (a). Option (b) does NOT replace the clock-backward refusal above: when the host clock restarts below the persisted `last_issued_ts` (container before NTP sync, operator reset), the generator MUST still refuse-or-stall until wall time catches up, otherwise it re-issues timestamps from the rewound window.
|
|
93
|
+
- **(c) Incarnation / fencing epoch**: include an incarnation epoch in the bit layout (sub-allocated from the node-id bits) that increments monotonically per process restart and is allocated by an external registry. The epoch field MUST fail closed on exhaustion: when the encoded width has wrapped or the registry refuses, the generator refuses to start and the operator either rotates to a fresh node-id namespace or widens the epoch field with an epoch-bump migration. A rapid crash loop within one millisecond can exhaust a small epoch field; the registry's allocation contract guarantees no epoch reuse within the timestamp collision window (typical: epoch is never reused, period).
|
|
94
|
+
|
|
95
|
+
Persisting only across "host clock can rewind across restart" cases is too narrow; same-ms restart re-issuance does not require a clock rewind to occur.
|
|
96
|
+
- **Field-width masking uses `(1<<bits)-1`, not `1<<bits`**: masking a configured `node_id` or `namespace_id` with `value & (1<<bits)` keeps only the high bit and zeroes the rest, which collapses many distinct IDs into one. The correct mask is `(1<<bits) - 1`. Validate inputs at boundary; clamp documented.
|
|
97
|
+
- **Node id and namespace id come from a uniqueness-enforced source**: k8s StatefulSet ordinal, a centralized allocator that registers and revokes on shutdown, or a pinned per-host config with a registry of assignments. "Random in range" is a finding; the bit budget is small (typically 4-10 bits combined) and birthday collisions are easy. Two replicas with the same `(namespace, node)` re-issue duplicates within the same millisecond.
|
|
98
|
+
- **Singleton per process AND per (namespace, node)**: multiple generator instances in the same process sharing the same `(namespace, node)` re-issue duplicates because each holds its own counter / `last_issued_ts` state. If sharded generators are needed (per-CPU, per-shard), partition the node-id bits across them; do not partition the counter bits.
|
|
99
|
+
- **Concurrent callers serialize through a mutex on (counter, last_issued_ts)**: lock-free atomics are valid only when bit-pack, clock-backward check, and counter-rollover-to-next-millisecond wait fit into a single CAS loop. Default to mutex; only optimize when contention is measured.
|
|
100
|
+
- **Wall clock, not monotonic**: IDs encode wall time for cross-process orderability, so `time.Now().UnixMilli()` (or equivalent) is the time source. The clock-backward check on `last_issued_ts` catches wall-time non-monotonicity — that is what protects correctness, not the choice of clock source.
|
|
101
|
+
- **Local-fallback discipline**: when the in-process generator is a fallback for a central ID service, the fallback's node-id MUST come from a different pool than the central generators (a reserved high-bit prefix, or a fallback-only namespace) so post-incident reconciliation can distinguish central IDs from fallback IDs. Fallback issuance is a degraded-mode metric; never silent.
|
|
102
|
+
|
|
103
|
+
## Queue And Task Clients
|
|
104
|
+
|
|
105
|
+
For full consumer implementation, activation, retry/drop, and observability rules, also apply `mq-consumer-patterns.md`.
|
|
106
|
+
|
|
107
|
+
- Producers should attach trace/log id and lane/environment metadata to every message when the queue supports properties.
|
|
108
|
+
- Consumer constructors should read topic, group, worker count, retry count, filter tags, and mode from typed config.
|
|
109
|
+
- Ordered consumers must reduce concurrency to one or otherwise prove ordering is preserved.
|
|
110
|
+
- Consumer handlers should decode into typed payloads, validate, then call application logic.
|
|
111
|
+
- Return retry for transient dependency errors; return success after logging for permanent malformed payloads.
|
|
112
|
+
- For delayed tasks, put delay, queue name, timeout, and max retry in config rather than literals.
|
|
113
|
+
- For Redis-backed task queues, create producer, server, and inspector as separate DI dependencies.
|
|
114
|
+
|
|
115
|
+
## Bounded Fan-Out
|
|
116
|
+
|
|
117
|
+
- Use a shared helper or local pattern for bounded concurrency instead of open-ended goroutines.
|
|
118
|
+
- Configurable knobs should include limit, timeout, retry count, retry interval, and ignore-error behavior.
|
|
119
|
+
- Preserve task index or key with each result so callers can reconstruct slices or maps.
|
|
120
|
+
- Cancel remaining work on first error only when partial results are not useful.
|
|
121
|
+
- Keep retry sleeps bounded by context deadline.
|
|
122
|
+
|
|
123
|
+
## Dynamic Config Key Convention (Etcd / Config Center)
|
|
124
|
+
|
|
125
|
+
When the dynamic config backend is etcd or an etcd-style key-value store, the key scheme is part of the cross-service contract.
|
|
126
|
+
|
|
127
|
+
- Use a structured key pattern such as `/{service}/{namespace}/{key}` where `service` identifies the owning platform service identifier, `namespace` separates logical config domains (e.g. `db_shard`, `rate_limit`, `feature_flag`), and `key` is the leaf. Never let raw etcd keys leak into application code — wrap with typed accessors.
|
|
128
|
+
- Periodic endpoint discovery: when the etcd endpoint list itself comes from service discovery (Nacos / Consul / k8s services), refresh the endpoint list on a bounded cadence (10–30 s is typical) in a background goroutine — NOT on the hot request path. Lazy refresh on next operation makes the refresh + reconnect cost (DNS lookup, TLS handshake) land on a user request during endpoint churn, and lets concurrent requests stampede the reconnect. Use singleflight to deduplicate concurrent reconnects and serve last-known-good endpoints with a bounded staleness window while the background refresh runs.
|
|
129
|
+
- For dynamic config that backs production-critical data (DB sharding map, rate-limit budget, feature flag), distinguish three failure modes: key not found, decode error, and remote/transient error. The product contract decides which falls back to the cached value, which fails closed, and which fails open.
|
|
130
|
+
- Watch callbacks (`AddListener`) must recover from panics, update the local cache atomically, and stop cleanly on parent-ctx cancellation. A watch goroutine that crashes silently is harder to detect than a missing watcher.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Developer Tooling Patterns
|
|
2
|
+
|
|
3
|
+
Use this when implementing developer CLIs, code generators, scaffolding commands, or generated-file workflows.
|
|
4
|
+
|
|
5
|
+
## CLI Shape
|
|
6
|
+
|
|
7
|
+
- Provide non-interactive flags for every input needed by CI or agents.
|
|
8
|
+
- Interactive prompts may wrap the same execution path, but should not be the only supported mode.
|
|
9
|
+
- Validate required flags before doing file or remote work.
|
|
10
|
+
- Print planned inputs and output paths before generation when the command changes files.
|
|
11
|
+
- Return errors instead of only logging so callers can fail CI.
|
|
12
|
+
|
|
13
|
+
## Project Dev Command Surface
|
|
14
|
+
|
|
15
|
+
- Prefer a small documented project command surface for common agent/developer actions: status, setup, start, stop, restart, format, lint, check, test, focused test, codegen, and review.
|
|
16
|
+
- A wrapper script or Make target should call the same underlying commands used by CI; do not create a second untested path.
|
|
17
|
+
- Commands should print the working directory, selected config, important environment source, and the exact subcommands they run when useful for debugging.
|
|
18
|
+
- Long-running service commands should expose readiness checks and logs instead of requiring manual observation.
|
|
19
|
+
- Test commands should distinguish fast deterministic tests from integration, live dependency, browser, replay, or long-running suites.
|
|
20
|
+
- Wrappers may load local env files for development, but CI and agents need non-interactive flags or documented environment variables.
|
|
21
|
+
- Repo-local agent contracts (`AGENTS.md`): when the repo adopts root + per-source-directory contracts, wire the coverage gate into the normal lint/check path so contracts do not drift from the code. `check-agent-contract-coverage.sh` (from `product-rd-workflow/scripts/`) provides it — `--check` (guidance, non-blocking), `--fix` (scaffold missing, additive), `--enforce` (CI block once adopted). Contracts are nearest-file-wins (no root index); scope is every source-code directory, detected by source file rather than manifest — Go packages such as `dal`/`service`/`handler`/`logic` carry no manifest yet each owns distinct layering rules. Policy/ownership lives in `product-rd-workflow`'s spec / repo-contract sync gate; do not rely on review memory or a generic passing build to prove the contract is current.
|
|
22
|
+
|
|
23
|
+
## Generator Shape
|
|
24
|
+
|
|
25
|
+
- Parse structured inputs with real parsers, not ad hoc string splitting.
|
|
26
|
+
- Keep templates in files or embedded assets with tests for rendered output.
|
|
27
|
+
- Build a typed intermediate model before rendering generated files.
|
|
28
|
+
- Use deterministic ordering for columns, fields, imports, indexes, routes, and generated methods.
|
|
29
|
+
- Run formatting tools on generated Go files.
|
|
30
|
+
- Mark generated files and document whether they are safe to edit.
|
|
31
|
+
|
|
32
|
+
## File Safety
|
|
33
|
+
|
|
34
|
+
- Refuse to overwrite hand-written files by default.
|
|
35
|
+
- Overwrite only generated files or when an explicit force flag is provided.
|
|
36
|
+
- Write to a temporary file and rename when partial writes would leave broken output.
|
|
37
|
+
- Use repo-relative paths in docs and generated references.
|
|
38
|
+
- Clean up temporary layout/config files.
|
|
39
|
+
- When regenerating directories, move old generated output to a guarded backup path and delete that backup only after the full generation succeeds.
|
|
40
|
+
- Guard any cleanup command with repo-root/path validation so a bad environment variable cannot remove an arbitrary directory.
|
|
41
|
+
|
|
42
|
+
## DDL And Data Model Generation
|
|
43
|
+
|
|
44
|
+
- Parse DDL with a SQL parser and preserve table name, column names, comments, indexes, unique constraints, nullable fields, and soft-delete fields.
|
|
45
|
+
- Map database types to Go types through one tested table.
|
|
46
|
+
- Generate model constants, query helpers, update helpers, and optional repository wrappers from the same intermediate model.
|
|
47
|
+
- Sharded table suffix handling must be explicit and tested; do not infer it silently unless the convention is documented.
|
|
48
|
+
|
|
49
|
+
## Tests
|
|
50
|
+
|
|
51
|
+
- Test missing input, bad input parse, existing output file, force overwrite, deterministic output, formatting failure, template failure, type mapping, index generation, module path detection, and command exit status.
|
|
52
|
+
|
|
53
|
+
## Build Script And Makefile Convention
|
|
54
|
+
|
|
55
|
+
- Keep a per-service `build.sh` whose only job is reproducibly produce a deployable artifact: create the output directory, copy the conf files needed at runtime, mark scripts executable, and run `go build` with explicit output path. Avoid embedding codegen inside `build.sh` — codegen runs separately and its output is committed.
|
|
56
|
+
- For cross-platform builds, detect OS/ARCH from `uname` and select the matching binary suffix; do not embed personal absolute paths or developer-specific Go toolchain pinning in the script.
|
|
57
|
+
- Centralize all codegen and DI entrypoints in the Makefile so callers do not need to remember tool names: `make wire` (DI), `make gen_db` (DAL from DDL), `make idl` or `make_service` (IDL → server/client stubs), `make doc` (API docs). Each target is the canonical command — CI and developers use the same path.
|
|
58
|
+
- Provide a top-level one-command codegen target (e.g., `make codegen` that fans out to `make wire`, `make gen_db`, `make idl`) for new-service onboarding and post-IDL-bump refreshes. Leaving each business repo with its own ad-hoc targets and no portfolio-level entrypoint is a recurring onboarding pain.
|
|
59
|
+
- The Makefile should expose `make test` (fast tests) and `make test-integration` (live-dep tests). Builds that skip tests are intentional, not an oversight.
|
|
60
|
+
|
|
61
|
+
## Breaking-Change Gate
|
|
62
|
+
|
|
63
|
+
- For any IDL surface consumed by another team, another binary, or external clients, add a breaking-change check to CI: `buf breaking` for proto, `kitex check` for Kitex, or a custom script that compares the generated descriptor against the previous merged revision.
|
|
64
|
+
- Pre-commit syntax/format checks (protoc compile + clang-format) are not breaking-change checks. They catch typos, not contract regressions.
|
|
65
|
+
- When a breaking change is intentional, route it through an explicit approval path: a marker file, a PR label, or a separate "breaking" branch the gate recognizes. Do not let "the gate is annoying" be a reason to disable the check.
|
|
66
|
+
|
|
67
|
+
## Static Analysis And Vulnerability Scan
|
|
68
|
+
|
|
69
|
+
- **`golangci-lint` is the current default-recommendation meta-linter** for Go services — wraps `staticcheck`, `govet`, `errcheck`, `ineffassign`, `gosec`, and 100+ other linters behind one config + one binary, with parallel execution and caching. v2 reorganized the config format and made the enabled-linter list explicit rather than implicit; verify the exact stability tiering against `golangci-lint.run/usage/linters` for the version you pin. Pin a specific version in CI so the rule set doesn't drift under a contributor's local `golangci-lint` upgrade. Service-specific tuning lives in `.golangci.yml` at the repo root — do NOT enable every available linter (the noise drowns real findings); start from a curated set (`govet, errcheck, ineffassign, staticcheck, gosec, gocritic` plus team-specific picks) and add linters individually as the team agrees on them. Reserve `staticcheck` standalone only when a sibling Go service hasn't yet adopted golangci-lint and migration would block the current change.
|
|
70
|
+
- **`govulncheck` (`golang.org/x/vuln/cmd/govulncheck`) is the Go team's official vulnerability scanner** — symbol/call-graph aware (significantly reduces false positives versus naive go.sum CVE scanners by skipping CVEs whose vulnerable symbols the binary's call graph does not reach; reflection / `init` side effects / build-tag-conditional code can still expose CVEs that static call-graph analysis misses, so govulncheck is a strong baseline, not absolute proof of safety). Run as a CI gate: `govulncheck ./...`. Integrate into the same Make target as other quality gates (`make vuln` or fold into `make lint`); fail the build on findings unless the project explicitly waives a CVE via an issue-tracker reference and a justification comment in the waive-list. Re-run on schedule (weekly cron) in addition to per-PR — new CVEs land continuously and a passing PR last month may be vulnerable today.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Domain Feature Patterns
|
|
2
|
+
|
|
3
|
+
## Handler Pattern
|
|
4
|
+
|
|
5
|
+
- Keep handlers thin: bind request, validate shape and limits, resolve auth/resource scope context, call application logic, and map response/error.
|
|
6
|
+
- Put reusable validation in small check functions instead of burying it in domain orchestration.
|
|
7
|
+
- Validate batch size, required IDs, enum values, pagination, and mutually exclusive fields before side effects.
|
|
8
|
+
- Use canonical error codes for validation failures; do not leak raw dependency errors in public responses.
|
|
9
|
+
- Always return a response envelope even when downstream logic returns an error.
|
|
10
|
+
- Avoid mutating inbound generated request objects except for narrowly documented compatibility normalization; prefer converting into application parameters.
|
|
11
|
+
|
|
12
|
+
## Parameter And Result Mapping
|
|
13
|
+
|
|
14
|
+
- Convert transport requests into application parameter structs before domain logic.
|
|
15
|
+
- Parameter constructors should tolerate nil input only when nil is a valid no-op; otherwise validate at the handler boundary.
|
|
16
|
+
- Use pointer fields or explicit presence flags for patch/update semantics where zero and absent differ.
|
|
17
|
+
- Keep helper getters such as `GetX()` value-or-zero only after validation has decided whether absence is allowed.
|
|
18
|
+
- Result structs should own conversion back to transport response objects when response assembly is non-trivial.
|
|
19
|
+
- Add a safe `Meta` or summary method for audit/logging when complex params need observability; include identifiers and option flags, not raw sensitive payloads.
|
|
20
|
+
|
|
21
|
+
## Domain Model Mapping
|
|
22
|
+
|
|
23
|
+
- Keep domain objects separate from DB models when they carry behavior, derived flags, runtime-only fields, or compatibility transforms.
|
|
24
|
+
- For finite domain values such as market, region, status, scene, source, provider, priority, permission, or channel, define one domain-owned constant/type set and one canonicalization/parse function before using the value across application, persistence, or tests. Transport enums, DB strings, headers, and query params should convert at the boundary; business logic and tests should reuse the domain symbols instead of scattering raw literals such as `"US"`, `"CN"`, `"active"`, or `"default"`.
|
|
25
|
+
- When the same finite value crosses service or package boundaries, put the canonical type/constants and parser in the smallest shared domain or platform package already allowed by the repo. Do not let two services invent parallel canonical sets for the same concept. A shared package exempts local debt markers only after it actually contains the canonical type/constants and parser, not merely because the package exists; a CI check, grep panel, or required review checklist MUST verify the package contents before accepting the exemption. If no eligible shared package exists, the shared package lacks the canonical type/parser, or creating one needs architecture approval, keep the local constants for this slice, add a same-line `finite-value-debt: <task-ref> <owner> <deadline> <reason>` comment at every temporary duplicate/raw use outside boundary conversion, and record a consolidation task. A debt marker without task reference, owner, and deadline is non-compliant.
|
|
26
|
+
- When a finite value already has a protobuf enum or external enum, do not treat the generated enum as the only domain model unless every non-transport layer can safely depend on it. If storage, headers, or existing domain models remain string-based, add domain constants plus explicit enum/string conversion helpers first, mark direct generated-enum or raw-string use outside transport/storage conversion with `finite-value-debt: <task-ref> <owner> <deadline> <reason>`, and migrate call sites incrementally.
|
|
27
|
+
- Architecture owns cross-boundary semantic consistency for finite values: approve the shared package or contract location, approve any transport-coupled exception through a traceable architecture decision, and make sure every `finite-value-debt` marker has an exit owner, deadline, and consolidation task.
|
|
28
|
+
- Use explicit `FromModel`, `Model`, or `Populate` methods for conversion; do not rely on reflection-based copying for behavior-rich objects.
|
|
29
|
+
- For patch/updater structs, use pointer fields to mean "set this field" and nil to mean "leave unchanged".
|
|
30
|
+
- Generate or centralize repetitive getters/mappers when many services need stable map/group/sort keys.
|
|
31
|
+
- Do not let storage-only columns leak into public response objects unless the API contract intentionally exposes them.
|
|
32
|
+
|
|
33
|
+
## Application Logic Pattern
|
|
34
|
+
|
|
35
|
+
- Application logic orchestrates domain rules and infrastructure calls; it should not parse transport-specific headers, cookies, or query strings directly.
|
|
36
|
+
- Convert transport DTOs into domain/application parameters before deep domain logic.
|
|
37
|
+
- Group related side effects into phases:
|
|
38
|
+
- validation and read preconditions.
|
|
39
|
+
- durable writes inside a transaction. **Required async side effects (MQ publish, projection update, downstream notify that the workflow depends on) MUST be written to an outbox row in the SAME transaction**, then dispatched by a separate poller/relayer — see `db-schema-and-dal-patterns.md` outbox pattern. Publishing MQ "after the transaction commits" loses messages whenever the process dies between commit and publish.
|
|
40
|
+
- only explicitly **best-effort** side effects (cache warm-up, low-priority counter, optional notification) may happen post-commit; document each one as opt-in best-effort, not the default.
|
|
41
|
+
- Mark best-effort side effects explicitly in logs and metrics; failures should not silently disappear. If a side effect's failure would leave the system in an inconsistent state, it is NOT best-effort — promote it to the outbox.
|
|
42
|
+
- For external file or HTTP fetches, use bounded clients with context, validate content type/size/status, and close response bodies with `defer`.
|
|
43
|
+
- Do not accept caller-provided URLs, file paths, or object keys directly into fetch/read/delete operations without validation and namespace checks.
|
|
44
|
+
|
|
45
|
+
## Transaction Pattern
|
|
46
|
+
|
|
47
|
+
- Use a DB transaction only for writes that must commit atomically in the same database.
|
|
48
|
+
- Pass transaction-bound repositories into inner calls rather than letting inner code reopen the default write connection.
|
|
49
|
+
- Keep network calls, MQ sends, object storage writes, and long CPU work outside the transaction where possible.
|
|
50
|
+
- Re-read mutable quantities or counters inside the transaction when correctness depends on latest state.
|
|
51
|
+
- Use row locks or compare-and-update when concurrent writers can affect the same record.
|
|
52
|
+
- Do not hide post-commit side effects inside transaction callbacks.
|
|
53
|
+
- Transaction helpers should rollback on returned error and recovered panic, then return a typed error instead of swallowing the failure.
|
|
54
|
+
- Always check begin and commit errors; if rollback fails, log it with safe context without replacing the original operation error unless the rollback failure changes correctness.
|
|
55
|
+
|
|
56
|
+
## Batch Write Pattern
|
|
57
|
+
|
|
58
|
+
- Enforce a maximum batch size at the handler or application boundary.
|
|
59
|
+
- Split huge imports into chunks and make each chunk idempotent.
|
|
60
|
+
- Use upsert with explicit update columns; avoid update-all unless the whole row is intentionally replaceable.
|
|
61
|
+
- For per-row status updates, prefer generated update helpers or parameterized expressions. If raw SQL is unavoidable, never construct it from untrusted strings.
|
|
62
|
+
- Treat empty input as a no-op only when that is semantically valid; otherwise return a validation error.
|
|
63
|
+
|
|
64
|
+
## Pagination And Listing
|
|
65
|
+
|
|
66
|
+
- Normalize page/limit or offset/limit at the boundary.
|
|
67
|
+
- Set a maximum limit for public APIs and high-cost internal queries.
|
|
68
|
+
- For ordinary UI lists, count plus ordered page is acceptable.
|
|
69
|
+
- For backfills, exports, and large reads, prefer cursor/id-window iteration over offset pagination.
|
|
70
|
+
- Always specify a deterministic order when paginating.
|
|
71
|
+
|
|
72
|
+
## Concurrency In Domain Logic
|
|
73
|
+
|
|
74
|
+
- Use bounded concurrency for fan-out RPC/HTTP calls.
|
|
75
|
+
- Combine timeout, retry, and concurrency limit; do not retry unboundedly.
|
|
76
|
+
- Preserve result mapping by stable key when concurrent calls return out of order.
|
|
77
|
+
- Decide fast-fail versus collect-partial-results deliberately.
|
|
78
|
+
- Tests that stress concurrency should be separate from default fast tests when they need real services.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Engineering Patterns
|
|
2
|
+
|
|
3
|
+
## Repo Layout
|
|
4
|
+
|
|
5
|
+
Recommended layout for a new service:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
cmd/ or main.go
|
|
9
|
+
conf/
|
|
10
|
+
idl/ or proto/
|
|
11
|
+
handler/
|
|
12
|
+
service/ or logic/
|
|
13
|
+
domain/
|
|
14
|
+
infra/
|
|
15
|
+
dal/
|
|
16
|
+
cache/
|
|
17
|
+
rpc/
|
|
18
|
+
mq/
|
|
19
|
+
model/
|
|
20
|
+
inject/ or internal/di/
|
|
21
|
+
tests/
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Use the existing repo's layout when one already exists.
|
|
25
|
+
|
|
26
|
+
When a layering boundary must actually hold — e.g. the core domain must never import infra or heavy SDK dependencies — consider giving that layer its own Go module: a module whose `go.mod` physically lacks the dependency turns a violation into a compile error, which is strictly harder to bypass than import-lint or review convention. Reserve this for boundaries worth the extra module/versioning overhead.
|
|
27
|
+
|
|
28
|
+
## Code Generation
|
|
29
|
+
|
|
30
|
+
- IDL/protobuf generates RPC/HTTP contracts and stubs.
|
|
31
|
+
- DB DDL can generate model/query/updater/DAL helpers if the project has a generator.
|
|
32
|
+
- DI code can be generated from provider declarations.
|
|
33
|
+
- Swagger/OpenAPI annotations can be generated from handlers or contracts.
|
|
34
|
+
|
|
35
|
+
Rules:
|
|
36
|
+
|
|
37
|
+
- Keep source inputs and generated outputs in the same change.
|
|
38
|
+
- Document commands in Makefile, README, or scripts.
|
|
39
|
+
- Use repo-relative paths; do not commit generator commands with personal absolute paths.
|
|
40
|
+
- Do not patch generated files manually unless the generator is unavailable and the risk is accepted.
|
|
41
|
+
- When a repo uses multiple generators, identify the source of truth for IDL/routes, DB models/query helpers, and DI output before editing; update source inputs first, then regenerate outputs.
|
|
42
|
+
|
|
43
|
+
## DB Pattern
|
|
44
|
+
|
|
45
|
+
- DAL exposes intent-focused methods, not raw query fragments everywhere.
|
|
46
|
+
- Query builder/updater helpers are useful when they prevent unsafe ad hoc SQL.
|
|
47
|
+
- Use `R(ctx)` for reads and `W(ctx)` for writes when supported.
|
|
48
|
+
- Configure connection pool, read/write resolver, tracing, and query logger at DB proxy initialization.
|
|
49
|
+
- Treat sharding as a first-class DB concern: define shard key, shard count, DDL behavior, and bypass rules explicitly.
|
|
50
|
+
- Use transactions for multi-step writes and recover/rollback on panic.
|
|
51
|
+
- Apply the detailed DAL guardrails in `data-access-patterns.md` for list bounds, update/delete conditions, explicit update columns, and upsert column selection.
|
|
52
|
+
|
|
53
|
+
## Redis Pattern
|
|
54
|
+
|
|
55
|
+
- Key format should be deterministic and centralized.
|
|
56
|
+
- TTL must be explicit for every cache key.
|
|
57
|
+
- Cache miss should be distinguishable from infrastructure failure.
|
|
58
|
+
- Locks must use unique values and safe unlock.
|
|
59
|
+
- Lua/CAS scripts are appropriate for compound atomic operations.
|
|
60
|
+
- Script-backed helpers should handle script-cache misses by reloading or falling back according to the client contract, and tests should cover missing-key, compare-failed, and invalid-return paths.
|
|
61
|
+
|
|
62
|
+
## MQ Pattern
|
|
63
|
+
|
|
64
|
+
- Event names should describe domain facts, not implementation steps.
|
|
65
|
+
- Producers attach trace/log metadata where the stack supports it.
|
|
66
|
+
- Producers should use bounded send context and document sync, async, or one-way semantics.
|
|
67
|
+
- Consumers must tolerate duplicate, delayed, and out-of-order messages unless ordering is guaranteed and configured.
|
|
68
|
+
- Handler return value should intentionally control retry vs skip.
|
|
69
|
+
- Consumer config should make worker count, broadcast vs cluster mode, retry count, ordering, topic, and tag/filter expression explicit.
|
|
70
|
+
|
|
71
|
+
## Tests
|
|
72
|
+
|
|
73
|
+
- Table-driven unit tests for domain logic, pure helpers, validation, and DAL query options.
|
|
74
|
+
- Component tests for DB/Redis/MQ wrappers when the local environment is available.
|
|
75
|
+
- Fake clients for RPC/HTTP integrations, including timeout, dependency error, and non-OK domain status.
|
|
76
|
+
- Contract tests for protobuf default values, enum handling, and response error mapping.
|
|
77
|
+
- Handler/service scenario tests for request mapping, auth context, resource-scope context, and response codes.
|
|
78
|
+
- Consumer tests for duplicate message and retry/skip decisions.
|
|
79
|
+
- Scheduled job tests for lock acquisition failure, timeout, retry exhaustion, and panic recovery.
|
|
80
|
+
- Build/codegen verification when IDL, generated code, or DI changes.
|
|
81
|
+
- Keep infrastructure-dependent tests out of the default fast test path unless the local environment is guaranteed.
|
|
82
|
+
|
|
83
|
+
## Middleware Pattern
|
|
84
|
+
|
|
85
|
+
- Inbound middleware should create or accept a trace/log id, attach it to context, and return it to the caller when the protocol supports it.
|
|
86
|
+
- Request and response body logging should be gated by config and environment.
|
|
87
|
+
- Recovery middleware should log panic stack, return canonical internal/panic error, and increment panic metrics.
|
|
88
|
+
- Metrics middleware should record QPS, latency, success, error, and canonical error code for both server and client sides.
|
|
89
|
+
- Auth middleware should populate typed context values; application code should not parse tokens or cookies directly.
|
|
90
|
+
|
|
91
|
+
## Error Handling Pattern
|
|
92
|
+
|
|
93
|
+
- Domain/application code returns typed or wrapped errors with stable canonical codes.
|
|
94
|
+
- Transport code converts canonical errors into HTTP/RPC responses.
|
|
95
|
+
- Client middleware converts remote canonical errors back into local errors so callers can branch on code.
|
|
96
|
+
- When a dependency or helper returns an explicit status/envelope, callers must branch on success or error before reading optional result fields; never assume success from a nil error alone when the contract carries domain status separately.
|
|
97
|
+
- Unknown errors default to internal/dependency failure and must be logged with context.
|
|
98
|
+
- Validation errors should be permanent; dependency timeouts and unavailable errors may be retryable depending on operation idempotency.
|
|
99
|
+
|
|
100
|
+
## Context Key Convention And Metainfo Propagation
|
|
101
|
+
|
|
102
|
+
The set of ctx keys a service relies on is part of the service's public surface; treat it as deliberately designed, not ad hoc.
|
|
103
|
+
|
|
104
|
+
- Organize ctx keys in tiers by trust and lifetime: global keys that travel with every request (trace/log id, PSM, lane, IDC, cluster, stress tag); API-context keys derived from the gateway after auth (user id, tenant id, organization id, role); raw header keys mapping inbound `X-*` HTTP headers to their canonical ctx name. Document the tier in code (separate const blocks or files) so reviewers can see which keys are platform-level vs business-level.
|
|
105
|
+
- Define a typed accessor per ctx key: a function `LogIDFromCtx(ctx) string` that performs the type assertion is safer than asking callers to remember `ctx.Value("logId").(string)`. Bare string-key access returning `any` is acceptable only for short-lived experiments; production code should hide the assertion behind typed helpers.
|
|
106
|
+
- For Kitex-style frameworks that must propagate ctx values both inside the binary and across the wire, dual-inject: write the value to `metainfo.WithPersistentValue(ctx, key)` for cross-hop persistence and to the framework-specific outgoing metadata (HTTP/2 metadata for gRPC, TTHeader for Thrift). The framework's `MetaHandler` chosen at server-build time determines which transport carries it; the application code remains transport-agnostic.
|
|
107
|
+
- Distinguish "persistent" metainfo (forwarded on every downstream hop) from "transient" metainfo (one hop only). Lane, stress tag, and trace identity are persistent; one-off control flags should be transient or moved to typed request fields.
|
|
108
|
+
- For HTTP gateways, define the mapping between inbound `X-*` headers and ctx keys once, in a binding step at the edge; do not re-read raw headers in domain code.
|
|
109
|
+
|
|
110
|
+
## Go Language Baseline 2025-2026
|
|
111
|
+
|
|
112
|
+
Adopt newer Go stdlib idioms when the project targets Go 1.21+ — the older patterns (hand-rolled `sync.Once` value-cache, `for { ... <- ch }` iterators, manual JSON omit-zero handling, ad-hoc context propagation in tests) are now non-idiomatic and produce reviewer questions.
|
|
113
|
+
|
|
114
|
+
- **`sync.OnceFunc` / `sync.OnceValue` / `sync.OnceValues` (Go 1.21+) replace the `sync.Once` + closure + cached-result pattern** for lazy singletons. Per Go stdlib docs: `sync.OnceValue(func() *Client { ... }) func() *Client` returns a function that initializes once and returns the cached value on every subsequent call. Use `OnceValues` for `(value, error)` pair. Old pattern (`var once sync.Once; var client *Client; func get() *Client { once.Do(...); return client }`) is verbose and easy to get wrong; `sync.OnceValue` is one-liner. **Panic semantics to know**: if the init function panics, every subsequent call re-panics with the same panic value (literally — same value, not a wrapped error); concurrent callers waiting during init unblock after `Do` completes and also re-panic. This is fail-fast-by-design (the cached value is never partial), but it means a transient init failure that you might want to retry across calls needs explicit retry-or-reset logic outside the OnceValue closure — OnceValue gives no second chance on its own.
|
|
115
|
+
- **Range-over-function iterators (`iter.Seq[T]` / `iter.Seq2[K,V]`, Go 1.23+)** are the new idiom for user-defined iteration over arbitrary in-process sequences — paginated API pages held in memory, lazy filter/map/take/zip chains, tree/graph traversal, slice/map iteration via `slices.Values`/`maps.All`. Producers expose `func(yield func(T) bool) {...}`; consumers use `for v := range producer { ... }`. The new `iter` package shipped in 1.23; `slices` and `maps` packages already existed and gained iterator-oriented helpers in 1.23 (`slices.All`, `slices.Values`, `maps.All`, etc). **NOT the right tool for cancellable streaming over a network or long-lived async source** — yield is synchronous and the iterator does not compose with `select { case <-ctx.Done(): ... case v := <-ch: ... }` the way a channel does. Channels + cancellation context remain the right shape for: streaming RPC responses, MQ consumers, long-poll, websocket message loops, anywhere the consumer needs to interleave the data source with deadline / shutdown / multiple sources. The producer-side rule: if the source can block on I/O for an arbitrary duration AND the consumer needs to cancel it, prefer a channel + context; if the source is synchronous (computation, in-memory traversal) or blocks only on cooperative read calls the producer controls, prefer an iterator.
|
|
116
|
+
- **`omitzero` struct tag (Go 1.24+)** replaces the `omitempty` foot-gun for non-pointer numeric / time / struct fields. `omitempty` drops `0`, `""`, `false` (often incorrect for fields where zero IS meaningful); `omitzero` drops only the actual Go zero value of the field type, and if the type has `IsZero() bool` (e.g. `time.Time`) it uses that. Migrate `time.Time omitempty` to `omitzero` first — it's the most common bug source. **`omitzero` is recognized only by Go's stdlib `encoding/json` (1.24+). Third-party JSON encoders (`json-iterator/go`, `goccy/go-json`, `easyjson`, `sonic`, etc) ignore unknown tags silently and behave as if no `omitempty` is set — verify the project's actual JSON serializer accepts `omitzero` before migration, or the marshaled output reverts to "always emit" semantics**. Same caveat for any non-stdlib codegen serializer.
|
|
117
|
+
- **Per-object / per-request state maps: `delete` on lifecycle; a strong-pointer key leaks, a numeric/id key cross-attributes.** A long-lived map holding per-connection / per-request / per-object state must delete its entry on the object's close / lifecycle end. Two distinct failure modes: a `map[*T]` with a **strong pointer key keeps the object alive**, so a missed delete is a memory leak (the object is never freed); a `map[id]` / `map[uintptr]` keyed by a **numeric id or address does NOT keep the object alive**, so once the original is gone that id/address can be **reused** and silently cross-attributes one object's state to a different, later one. Either way, `delete` deterministically on the close/lifecycle you control — Go does not prune a strong-keyed map for you. Guard the map (a mutex or `sync.Map`) — but a map mutex alone is not enough: on `Close`, under the registry lock mark the object closed (tombstone) and block future lookups; then **release the lock to cancel/drain/wait** for in-flight goroutines (holding the lock through the drain deadlocks if those goroutines need it to finish); then re-acquire and `delete` — otherwise a concurrent goroutine reads or lazily recreates state for a closing object (use-after-delete / resurrected state). Keep the `closed` marker on the **object itself** (an object-owned flag / generation token), not only in the registry entry, or the `delete` erases the tombstone and a later call on the still-referenced object recreates state. (Go 1.24+ `weak` pointers + `runtime.AddCleanup` help for objects with **no** explicit close, but only as a backstop: they fire after the object is unreachable, may be delayed, and are not guaranteed before process exit. Route `Close` and the cleanup through **one idempotent release** (`sync.Once`/atomic) and call the cleanup's `Stop()` on a successful `Close` to avoid a double-free; and the cleanup func must NOT capture the object itself — that keeps it reachable so cleanup never runs — pass only the underlying handle and `runtime.KeepAlive` the object after its last real use.)
|
|
118
|
+
- **`testing.TB.Context()` (Go 1.24+) and `t.Chdir(dir)` (Go 1.24+)** clean up two common test patterns. `tb.Context()` is a context auto-cancelled on test cleanup — replace `ctx, cancel := context.WithCancel(...); t.Cleanup(cancel)` with `ctx := t.Context()`. **Scope is the current test/subtest, not the parent**: a goroutine spawned inside `t.Run("sub", func(t *testing.T) { go work(t.Context()) })` sees the context cancel when the subtest ends, NOT when the parent ends — leaking that goroutine past the subtest is the responsibility of the test (use a wait + verify or use the parent's context if cross-subtest scope is intended). `t.Chdir()` changes directory for the test and restores on cleanup — replace manual `os.Chdir + t.Cleanup(os.Chdir(orig))`.
|
|
119
|
+
- **`encoding/json/v2` (Go 1.25, experimental behind `GOEXPERIMENT=jsonv2`)** is the upcoming replacement for `encoding/json` — faster, stricter, better error messages, fixes long-standing decoder quirks. NOT production-default yet (experimental flag required). Track for Go 1.26+ stabilization; do not migrate hot paths to it before stable, but new greenfield services may pilot it on opt-in subpackages with the experiment flag set in build config + tests verifying behavior parity with stable v1.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Error Contract Patterns
|
|
2
|
+
|
|
3
|
+
Use this when implementing canonical errors, response builders, validation errors, dependency error mapping, or transport error conversion.
|
|
4
|
+
|
|
5
|
+
> Sibling sync (this file holds the canonical list): `python-service-dev/references/error-handling-patterns.md` mirrors these for Python and points back here rather than restating them, so the list lives in one place. Shared error-model invariants both stacks must hold — edit them HERE: canonical typed error model; convert only at the transport boundary; no internal/secret leak in API responses; cross-RPC envelope via structured details, not a freeform status-message string; closed classification enums with fail-closed defaults, and classification correct before retry/fallback policy is built on it. Stack glue (Kitex/gRPC vs FastAPI/gRPC) may differ; the invariants may not. Advisory — there is no automated parity gate; keep the two in sync by hand.
|
|
6
|
+
|
|
7
|
+
## Error Type
|
|
8
|
+
|
|
9
|
+
- Implement a typed error with code and safe message, and make it compatible with `errors.As`.
|
|
10
|
+
- Keep the internal error chain when adding context; do not replace the cause with a formatted string unless intentionally crossing a trust boundary.
|
|
11
|
+
- Do not encode typed errors only as JSON strings; provide methods or fields for code/message access.
|
|
12
|
+
- Common constructors should cover known codes and default messages.
|
|
13
|
+
- Avoid embedding raw request bodies, secrets, credentials, tokens, or personal data in error messages.
|
|
14
|
+
|
|
15
|
+
## Definitions
|
|
16
|
+
|
|
17
|
+
- Group local errors by layer: validation, domain rules, data access, dependency, and system failures.
|
|
18
|
+
- Use common codes for common classes and local definitions for local meanings.
|
|
19
|
+
- Validation errors should use stable field names and client-safe messages.
|
|
20
|
+
- Dependency adapters should translate upstream status/code/message into canonical local errors.
|
|
21
|
+
- Timeout, cancellation, and rate-limit errors should remain distinguishable.
|
|
22
|
+
- When policy code (retry, fallback, cooldown, alerting) branches on error class, define the classification as a closed enum and make every `switch` over it fail closed in `default` — where "safe direction" is decided per policy domain, not one global answer: for side-effect-bearing actions (retry that can double-execute, billing, writes) unclassified means do-not-act; for availability paths, an unclassified dependency-origin error may still enter bounded, semantics-preserving degradation (count toward circuit-open, take an already-safe fallback) — a provider changing its error wire shape must not turn every response into a hard refusal. The invariant is that a missed mapping never *amplifies* (no blind retry storms) and never silently acts on unknown semantics; pick each default deliberately and record it.
|
|
23
|
+
- Get the classification layer right before building retry/fallback/cooldown on top of it — the order cannot be reversed; policy stacked on a wrong or leaky classification hard-codes the wrong failure behavior and is expensive to unwind.
|
|
24
|
+
|
|
25
|
+
## Response Mapping
|
|
26
|
+
|
|
27
|
+
- Response builders should map typed errors to code/message and unknown errors to internal failure.
|
|
28
|
+
- Success responses should set the canonical success code and include data only when available.
|
|
29
|
+
- For shipped response envelopes or error payloads, preserve existing accepted fields and client-readable semantics by default while adding the new canonical shape. Removing legacy fields, changing success/error code meaning, or changing where business data lives is a breaking change and requires explicit human approval with a compatibility and rollback plan.
|
|
30
|
+
- When a breaking response-contract change is approved, update server tests, generated or typed clients, web/app parsing tests, smoke/E2E checks, documentation, and residual compatibility scans in the same delivery slice.
|
|
31
|
+
- HTTP and RPC handlers should convert errors once at the boundary.
|
|
32
|
+
- Worker and async job handlers should persist canonical error code/message on terminal failure.
|
|
33
|
+
- Logs should include trace/log id and the wrapped internal error where safe.
|
|
34
|
+
|
|
35
|
+
## Cross-RPC Envelope Serdes
|
|
36
|
+
|
|
37
|
+
When typed errors must traverse Kitex/gRPC/HTTP boundaries, both sides participate:
|
|
38
|
+
|
|
39
|
+
- Server-side ErrorHandler converts internal causes — framework biz error, RPC timeout, ACL denial, panic, validation — into the canonical typed error and serializes it into the transport-level error slot per protocol: for gRPC, use `google.rpc.Status` details (carried via `grpc-status-details-bin` trailer or framework-native details mechanism), not the freeform status message string; for header-based RPC protocols, use protocol-native metadata frames; for HTTP, use a response body envelope. Do not let raw internal errors leak across the boundary.
|
|
40
|
+
- Client-side ErrorHandler runs the reverse: extract the canonical structured shape from the protocol-specific channel — for gRPC, parse `google.rpc.Status` details from `grpc-status-details-bin` trailer or framework details mechanism, NOT freeform `rpcErr.Error()` text; for header-based RPC, read protocol-native metadata frames; for HTTP, parse the response body envelope. Reconstruct the typed error and surface it to the caller as a real Go error implementing the project's typed-error interface. If the wire payload is not the canonical shape, wrap it as a transport / unknown error and never drop the original cause silently. Parsing `rpcErr.Error()` as a JSON envelope loses typed-retry / security decisions and risks leaking server-rendered messages that were meant for logs.
|
|
41
|
+
- Reserve a numeric code range for the shared envelope (e.g., `[0, 11999]`) inside the shared IDL (`base.proto` or equivalent). Within that range, sub-range allocation per tier (platform / api / domain) prevents collisions when services define their own codes.
|
|
42
|
+
- Distinguish "system errors with a structured code" from "biz errors with a structured code" in the envelope so middleware decisions (alert vs ignore, retry-safe vs not) are deterministic.
|
|
43
|
+
- Document the i18n boundary: error messages in the envelope are typically a single language (often English). User-facing translations belong to the gateway / front-end based on the code, not the message text.
|
|
44
|
+
|
|
45
|
+
## Standard Library Wrap Compatibility
|
|
46
|
+
|
|
47
|
+
- Prefer `fmt.Errorf("...: %w", err)` for non-boundary wrapping inside one process. When crossing a transport boundary forces JSON / string serialization of the typed error, keep the `errors.As`-compatible reconstruction on the client side so consumers can still type-assert. Document any place where `%w` chain is intentionally severed (boundary serdes) and provide a reverse path.
|
|
48
|
+
- `%w` makes the wrapped error part of the package's public API — callers can `errors.Is`/`As` it. Inside the process keep `%w`. At an exported / public-contract or transport boundary, **return the typed safe error (or canonical envelope) itself** — do not `%v`-wrap the typed error, or the boundary mapper's `errors.As` stops matching and you emit unknown/500. Use `%v` only to embed a raw internal/driver cause as *text* inside a safe message or log line, never to wrap the canonical typed error. And do not blanket-`%v` errors callers legitimately match on: `context.Canceled` / `context.DeadlineExceeded`, not-found, and documented domain sentinels stay `%w` (test-asserted via `errors.Is`/`As`) — switching them to `%v` breaks cancellation/timeout/not-found mapping and loses the observability chain.
|
|
49
|
+
|
|
50
|
+
## Tests
|
|
51
|
+
|
|
52
|
+
- Test typed error matching with `errors.As`, wrapping preservation, unknown error fallback, validation field output, dependency mapping, panic mapping, timeout mapping, and response envelope output.
|
|
53
|
+
- For cross-RPC envelope serdes, test a roundtrip: server raises typed error → wire format captured → client reconstruction yields a typed error with the same code/message and matches `errors.As` on the original type. Include the unknown-shape path: a wire-format that does not match the canonical envelope returns a transport/unknown error without silent data loss.
|
|
54
|
+
- Test code-range allocation: a service trying to register a code outside its allocated range fails at build/test time, not at runtime.
|
|
55
|
+
- For closed error-classification enums, add an exhaustive positive-assertion test: every enum member is explicitly asserted to map to its intended policy outcome, plus at least one unknown/unclassified value asserted to take the fail-closed branch.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Feature Playbook
|
|
2
|
+
|
|
3
|
+
## Before Business Feature Work
|
|
4
|
+
|
|
5
|
+
1. Inspect the existing platform layer before adding business code.
|
|
6
|
+
2. Reuse existing cross-cutting primitives for runtime wiring, config, secrets, dependency clients, lifecycle, readiness, observability, request metadata, response envelopes, and canonical errors.
|
|
7
|
+
3. Do not promote by category name alone. Promote a capability to platform only when it has at least two real reuse points, stable behavior across those features, and can remain domain-agnostic without importing domain/application/interfaces types.
|
|
8
|
+
4. Keep concrete external adapters in infra unless the repository already defines a platform-level dependency lifecycle primitive for them.
|
|
9
|
+
5. Keep product-specific workflow, policy, schema, query, feature-specific readiness, business error classification, and side-effect orchestration outside platform.
|
|
10
|
+
|
|
11
|
+
## New HTTP Endpoint
|
|
12
|
+
|
|
13
|
+
1. Add or update protobuf/API contract.
|
|
14
|
+
2. Regenerate HTTP router/handler stubs if the stack uses codegen.
|
|
15
|
+
3. Implement handler validation and auth/context extraction.
|
|
16
|
+
4. Call application/service layer; do not put domain workflow directly in handler.
|
|
17
|
+
5. Map domain errors to stable API errors.
|
|
18
|
+
6. Add handler/service tests and update Swagger/OpenAPI if used.
|
|
19
|
+
|
|
20
|
+
## New RPC Method
|
|
21
|
+
|
|
22
|
+
1. Add protobuf request/response and service method.
|
|
23
|
+
2. Regenerate RPC code.
|
|
24
|
+
3. Implement generated interface in handler/server package.
|
|
25
|
+
4. Put domain workflow in service/logic layer.
|
|
26
|
+
5. Add client wrapper if other services will call it.
|
|
27
|
+
6. Add compatibility tests for default/empty fields and error cases.
|
|
28
|
+
|
|
29
|
+
## New DB Table Or Column
|
|
30
|
+
|
|
31
|
+
1. Write migration/DDL first.
|
|
32
|
+
2. Generate or update model/query/update helpers if codegen exists.
|
|
33
|
+
3. Add DAL methods using context and read/write connection conventions.
|
|
34
|
+
4. Keep batch sizes bounded.
|
|
35
|
+
5. Use transactions for multi-table writes.
|
|
36
|
+
6. Add tests for query conditions, empty inputs, duplicate/upsert behavior, and transaction rollback.
|
|
37
|
+
|
|
38
|
+
## New Redis Cache / Lock / Limiter
|
|
39
|
+
|
|
40
|
+
1. Define key format and scope.
|
|
41
|
+
2. Define TTL and stale-data behavior.
|
|
42
|
+
3. For caches, decide cache-aside read-through behavior and invalidation path.
|
|
43
|
+
4. For locks, use unique values and compare-and-delete unlock.
|
|
44
|
+
5. For rate limiters, define scope, window, limit, and transaction/retry behavior.
|
|
45
|
+
6. Add tests around key generation and miss/error behavior.
|
|
46
|
+
|
|
47
|
+
## New MQ Consumer
|
|
48
|
+
|
|
49
|
+
1. Define event schema and producer ownership.
|
|
50
|
+
2. Define topic, group, tag/filter, ordering, retry count, and worker count.
|
|
51
|
+
3. Implement handler idempotency before side effects.
|
|
52
|
+
4. Distinguish invalid messages that should be skipped from transient failures that should retry.
|
|
53
|
+
5. Add metrics for consumed, skipped, retried, failed, and lag if available.
|
|
54
|
+
6. Start consumer through service lifecycle, not package init.
|
|
55
|
+
|
|
56
|
+
## New External Client
|
|
57
|
+
|
|
58
|
+
1. Wrap generated or third-party client behind a small adapter.
|
|
59
|
+
2. Centralize timeout, retry, discovery, auth, tracing, and logging.
|
|
60
|
+
3. Convert external errors into service/domain errors.
|
|
61
|
+
4. Add tests with fake adapter or mock client.
|