universal-dev-standards 5.16.0 → 6.0.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/bin/uds.js +13 -135
- package/bundled/ai/standards/acceptance-criteria-traceability.ai.yaml +13 -4
- package/bundled/ai/standards/accessibility-standards.ai.yaml +1 -1
- package/bundled/ai/standards/ai-response-navigation.ai.yaml +15 -2
- package/bundled/ai/standards/api-design-standards.ai.yaml +27 -4
- package/bundled/ai/standards/behavior-snapshot.ai.yaml +86 -9
- package/bundled/ai/standards/checkin-standards.ai.yaml +2 -2
- package/bundled/ai/standards/code-review.ai.yaml +2 -2
- package/bundled/ai/standards/context-aware-loading.ai.yaml +3 -3
- package/bundled/ai/standards/data-migration-testing.ai.yaml +79 -3
- package/bundled/ai/standards/deprecation-standards.ai.yaml +10 -2
- package/bundled/ai/standards/developer-memory.ai.yaml +4 -3
- package/bundled/ai/standards/flow-based-testing.ai.yaml +2 -2
- package/bundled/ai/standards/forward-derivation-standards.ai.yaml +26 -2
- package/bundled/ai/standards/full-coverage-testing.ai.yaml +34 -2
- package/bundled/ai/standards/git-worktree.ai.yaml +3 -3
- package/bundled/ai/standards/logging.ai.yaml +97 -3
- package/bundled/ai/standards/mock-boundary.ai.yaml +48 -2
- package/bundled/ai/standards/model-provenance.ai.yaml +297 -0
- package/bundled/ai/standards/model-selection.ai.yaml +11 -2
- package/bundled/ai/standards/observability-standards.ai.yaml +10 -0
- package/bundled/ai/standards/performance-standards.ai.yaml +46 -1
- package/bundled/ai/standards/pii-classification.ai.yaml +15 -1
- package/bundled/ai/standards/pipeline-security-gates.ai.yaml +10 -0
- package/bundled/ai/standards/privacy-standards.ai.yaml +2 -2
- package/bundled/ai/standards/project-context-memory.ai.yaml +2 -2
- package/bundled/ai/standards/refactoring-standards.ai.yaml +68 -3
- package/bundled/ai/standards/resource-cost-boundary.ai.yaml +279 -0
- package/bundled/ai/standards/reverse-engineering-standards.ai.yaml +55 -2
- package/bundled/ai/standards/security-testing.ai.yaml +13 -2
- package/bundled/ai/standards/skill-standard-alignment-check.ai.yaml +37 -2
- package/bundled/ai/standards/user-journey-testing.ai.yaml +107 -0
- package/bundled/ai/standards/verification-oracle.ai.yaml +278 -0
- package/bundled/ai/standards/versioning.ai.yaml +32 -38
- package/bundled/core/acceptance-criteria-traceability.md +15 -5
- package/bundled/core/accessibility-standards.md +8 -4
- package/bundled/core/ai-friendly-architecture.md +1 -1
- package/bundled/core/ai-response-navigation.md +31 -3
- package/bundled/core/anti-sycophancy-prompting.md +1 -1
- package/bundled/core/api-design-standards.md +92 -7
- package/bundled/core/audit-trail.md +119 -0
- package/bundled/core/behavior-snapshot.md +94 -7
- package/bundled/core/browser-compatibility-standards.md +15 -2
- package/bundled/core/checkin-standards.md +9 -2
- package/bundled/core/code-review-checklist.md +10 -2
- package/bundled/core/container-image-standards.md +97 -0
- package/bundled/core/context-aware-loading.md +2 -2
- package/bundled/core/cost-budget-test.md +1 -1
- package/bundled/core/cross-flow-regression.md +3 -2
- package/bundled/core/data-contract.md +104 -0
- package/bundled/core/data-migration-testing.md +90 -0
- package/bundled/core/data-pipeline.md +113 -0
- package/bundled/core/deprecation-standards.md +16 -2
- package/bundled/core/developer-memory.md +13 -8
- package/bundled/core/documentation-writing-standards.md +1 -1
- package/bundled/core/error-code-standards.md +4 -3
- package/bundled/core/flaky-test-management.md +1 -1
- package/bundled/core/flow-based-testing.md +3 -3
- package/bundled/core/forward-derivation-standards.md +33 -5
- package/bundled/core/full-coverage-testing.md +72 -0
- package/bundled/core/git-worktree.md +4 -4
- package/bundled/core/guides/performance-guide.md +1 -1
- package/bundled/core/guides/security-guide.md +1 -1
- package/bundled/core/health-check-standards.md +2 -2
- package/bundled/core/iac-design-principles.md +97 -0
- package/bundled/core/incident-response.md +119 -0
- package/bundled/core/license-compliance.md +2 -0
- package/bundled/core/logging-standards.md +78 -2
- package/bundled/core/mock-boundary.md +54 -2
- package/bundled/core/model-provenance.md +181 -0
- package/bundled/core/model-selection.md +27 -2
- package/bundled/core/packaging-standards.md +1 -0
- package/bundled/core/performance-standards.md +96 -2
- package/bundled/core/pii-classification.md +148 -0
- package/bundled/core/pipeline-security-gates.md +22 -2
- package/bundled/core/postmortem-standards.md +2 -0
- package/bundled/core/prd-standards.md +91 -0
- package/bundled/core/privacy-standards.md +14 -3
- package/bundled/core/product-metrics-standards.md +100 -0
- package/bundled/core/project-context-memory.md +8 -2
- package/bundled/core/prompt-regression.md +1 -1
- package/bundled/core/refactoring-standards.md +44 -3
- package/bundled/core/replay-test.md +1 -1
- package/bundled/core/resource-cost-boundary.md +180 -0
- package/bundled/core/reverse-engineering-standards.md +66 -2
- package/bundled/core/runbook.md +113 -0
- package/bundled/core/schema-evolution.md +105 -0
- package/bundled/core/secret-management-standards.md +110 -0
- package/bundled/core/security-testing.md +26 -2
- package/bundled/core/self-review-protocol.md +2 -2
- package/bundled/core/skill-standard-alignment-check.md +53 -0
- package/bundled/core/slo-sli.md +109 -0
- package/bundled/core/smoke-test.md +1 -1
- package/bundled/core/spec-driven-development.md +21 -3
- package/bundled/core/tech-debt-standards.md +1 -1
- package/bundled/core/test-data-standards.md +2 -2
- package/bundled/core/user-journey-testing.md +102 -0
- package/bundled/core/user-story-mapping.md +96 -0
- package/bundled/core/verification-oracle.md +167 -0
- package/bundled/core/versioning.md +133 -109
- package/bundled/locales/COVERAGE.md +84 -73
- package/bundled/locales/zh-CN/CHANGELOG.md +81 -6
- package/bundled/locales/zh-CN/CLAUDE.md +1 -1
- package/bundled/locales/zh-CN/README.md +22 -9
- package/bundled/locales/zh-CN/SECURITY.md +1 -1
- package/bundled/locales/zh-CN/adoption/DAILY-WORKFLOW-GUIDE.md +2 -2
- package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +4 -6
- package/bundled/locales/zh-CN/core/accessibility-standards.md +1 -1
- package/bundled/locales/zh-CN/core/adversarial-test.md +226 -0
- package/bundled/locales/zh-CN/core/agent-behavior-discipline.md +187 -0
- package/bundled/locales/zh-CN/core/ai-response-navigation.md +32 -6
- package/bundled/locales/zh-CN/core/anti-sycophancy-prompting.md +1 -1
- package/bundled/locales/zh-CN/core/api-design-standards.md +1 -1
- package/bundled/locales/zh-CN/core/behavior-snapshot.md +335 -0
- package/bundled/locales/zh-CN/core/browser-compatibility-standards.md +229 -0
- package/bundled/locales/zh-CN/core/cd-deployment-strategies.md +135 -0
- package/bundled/locales/zh-CN/core/chaos-injection-tests.md +130 -0
- package/bundled/locales/zh-CN/core/checkin-standards.md +1 -1
- package/bundled/locales/zh-CN/core/code-review-checklist.md +1 -1
- package/bundled/locales/zh-CN/core/container-security.md +535 -0
- package/bundled/locales/zh-CN/core/context-aware-loading.md +1 -1
- package/bundled/locales/zh-CN/core/contract-testing-standards.md +191 -0
- package/bundled/locales/zh-CN/core/cost-budget-test.md +86 -0
- package/bundled/locales/zh-CN/core/cross-flow-regression.md +199 -0
- package/bundled/locales/zh-CN/core/data-migration-testing.md +217 -0
- package/bundled/locales/zh-CN/core/deployment-standards.md +328 -9
- package/bundled/locales/zh-CN/core/deprecation-standards.md +1 -1
- package/bundled/locales/zh-CN/core/developer-memory.md +2 -2
- package/bundled/locales/zh-CN/core/disaster-recovery-drill.md +87 -0
- package/bundled/locales/zh-CN/core/documentation-structure.md +1 -1
- package/bundled/locales/zh-CN/core/documentation-writing-standards.md +1 -1
- package/bundled/locales/zh-CN/core/error-code-standards.md +2 -2
- package/bundled/locales/zh-CN/core/feature-manifest-standard.md +222 -0
- package/bundled/locales/zh-CN/core/flaky-test-management.md +87 -0
- package/bundled/locales/zh-CN/core/flow-based-testing.md +284 -0
- package/bundled/locales/zh-CN/core/forward-derivation-standards.md +3 -4
- package/bundled/locales/zh-CN/core/full-coverage-testing.md +197 -0
- package/bundled/locales/zh-CN/core/git-worktree.md +1 -1
- package/bundled/locales/zh-CN/core/governance-layer.md +160 -0
- package/bundled/locales/zh-CN/core/guides/performance-guide.md +515 -0
- package/bundled/locales/zh-CN/core/guides/security-guide.md +494 -0
- package/bundled/locales/zh-CN/core/knowledge-graph-memory.md +128 -0
- package/bundled/locales/zh-CN/core/license-compliance.md +129 -0
- package/bundled/locales/zh-CN/core/llm-output-validation.md +192 -0
- package/bundled/locales/zh-CN/core/logging-standards.md +130 -8
- package/bundled/locales/zh-CN/core/mock-boundary.md +109 -0
- package/bundled/locales/zh-CN/core/model-selection.md +28 -5
- package/bundled/locales/zh-CN/core/mutation-testing.md +106 -0
- package/bundled/locales/zh-CN/core/no-cicd-deployment.md +219 -0
- package/bundled/locales/zh-CN/core/packaging-standards.md +76 -5
- package/bundled/locales/zh-CN/core/pipeline-security-gates.md +126 -0
- package/bundled/locales/zh-CN/core/policy-as-code-testing.md +203 -0
- package/bundled/locales/zh-CN/core/privacy-standards.md +1 -1
- package/bundled/locales/zh-CN/core/project-context-memory.md +1 -1
- package/bundled/locales/zh-CN/core/prompt-regression.md +88 -0
- package/bundled/locales/zh-CN/core/property-based-testing.md +87 -0
- package/bundled/locales/zh-CN/core/release-quality-manifest.md +207 -0
- package/bundled/locales/zh-CN/core/release-readiness-gate.md +193 -0
- package/bundled/locales/zh-CN/core/replay-test.md +102 -0
- package/bundled/locales/zh-CN/core/reverse-engineering-standards.md +46 -1
- package/bundled/locales/zh-CN/core/rollback-standards.md +120 -0
- package/bundled/locales/zh-CN/core/sast-advanced.md +309 -0
- package/bundled/locales/zh-CN/core/secure-op.md +328 -0
- package/bundled/locales/zh-CN/core/security-testing.md +96 -0
- package/bundled/locales/zh-CN/core/self-review-protocol.md +167 -0
- package/bundled/locales/zh-CN/core/server-ops-security.md +507 -0
- package/bundled/locales/zh-CN/core/smoke-test.md +79 -0
- package/bundled/locales/zh-CN/core/spec-driven-development.md +55 -5
- package/bundled/locales/zh-CN/core/supply-chain-attestation.md +131 -0
- package/bundled/locales/zh-CN/core/versioning.md +1 -1
- package/bundled/locales/zh-CN/docs/CHEATSHEET.md +31 -6
- package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +61 -34
- package/bundled/locales/zh-CN/docs/MIGRATION-v6.md +88 -0
- package/bundled/locales/zh-CN/docs/USAGE-MODES-COMPARISON.md +2 -2
- package/bundled/locales/zh-CN/docs/USER-MANUAL.md +14 -14
- package/bundled/locales/zh-CN/docs/specs/system/memory-adoption-strategy.md +105 -0
- package/bundled/locales/zh-CN/docs/user/FAQ.md +132 -0
- package/bundled/locales/zh-CN/docs/user/GETTING-STARTED.md +144 -0
- package/bundled/locales/zh-CN/docs/user/GLOSSARY.md +178 -0
- package/bundled/locales/zh-CN/docs/user/README.md +70 -0
- package/bundled/locales/zh-CN/docs/user/TROUBLESHOOTING.md +190 -0
- package/bundled/locales/zh-CN/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +1 -1
- package/bundled/locales/zh-CN/integrations/github-copilot/README.md +1 -1
- package/bundled/locales/zh-CN/integrations/github-copilot/skills-mapping.md +3 -3
- package/bundled/locales/zh-CN/integrations/opencode/skills-mapping.md +3 -3
- package/bundled/locales/zh-CN/methodologies/guides/sdd-guide.md +836 -0
- package/bundled/locales/zh-CN/options/changelog/auto-generated.md +166 -0
- package/bundled/locales/zh-CN/options/changelog/keep-a-changelog.md +140 -0
- package/bundled/locales/zh-CN/options/code-review/automated-review.md +214 -0
- package/bundled/locales/zh-CN/options/code-review/pair-programming.md +166 -0
- package/bundled/locales/zh-CN/options/code-review/pr-review.md +167 -0
- package/bundled/locales/zh-CN/options/documentation/api-docs.md +191 -0
- package/bundled/locales/zh-CN/options/documentation/markdown-docs.md +150 -0
- package/bundled/locales/zh-CN/options/documentation/wiki-style.md +131 -0
- package/bundled/locales/zh-CN/options/project-structure/kotlin.md +144 -0
- package/bundled/locales/zh-CN/options/project-structure/php.md +168 -0
- package/bundled/locales/zh-CN/options/project-structure/ruby.md +156 -0
- package/bundled/locales/zh-CN/options/project-structure/rust.md +136 -0
- package/bundled/locales/zh-CN/options/project-structure/swift.md +165 -0
- package/bundled/locales/zh-CN/options/testing/contract-testing.md +237 -0
- package/bundled/locales/zh-CN/options/testing/industry-pyramid.md +200 -0
- package/bundled/locales/zh-CN/options/testing/istqb-framework.md +144 -0
- package/bundled/locales/zh-CN/options/testing/performance-testing.md +251 -0
- package/bundled/locales/zh-CN/options/testing/security-testing.md +192 -0
- package/bundled/locales/zh-CN/skills/README.md +89 -126
- package/bundled/locales/zh-CN/skills/ac-coverage/SKILL.md +5 -7
- package/bundled/locales/zh-CN/skills/adr-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/agents/code-architect.md +263 -0
- package/bundled/locales/zh-CN/skills/agents/doc-writer.md +410 -0
- package/bundled/locales/zh-CN/skills/agents/reviewer.md +357 -0
- package/bundled/locales/zh-CN/skills/agents/spec-analyst.md +410 -0
- package/bundled/locales/zh-CN/skills/agents/test-specialist.md +368 -0
- package/bundled/locales/zh-CN/skills/ai-collaboration-standards/SKILL.md +2 -2
- package/bundled/locales/zh-CN/skills/ai-friendly-architecture/SKILL.md +2 -2
- package/bundled/locales/zh-CN/skills/ai-instruction-standards/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/atdd-assistant/acceptance-criteria-guide.md +1 -1
- package/bundled/locales/zh-CN/skills/atdd-assistant/atdd-workflow.md +3 -4
- package/bundled/locales/zh-CN/skills/audit-assistant/SKILL.md +2 -2
- package/bundled/locales/zh-CN/skills/bdd-assistant/guide.md +1 -2
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/SKILL.md +109 -13
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/guide.md +30 -8
- package/bundled/locales/zh-CN/skills/checkin-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/ci-cd-assistant/SKILL.md +50 -0
- package/bundled/locales/zh-CN/skills/code-review-assistant/SKILL.md +5 -5
- package/bundled/locales/zh-CN/skills/commands/ac-coverage.md +1 -1
- package/bundled/locales/zh-CN/skills/commands/atdd.md +3 -3
- package/bundled/locales/zh-CN/skills/commands/bdd.md +2 -2
- package/bundled/locales/zh-CN/skills/commands/brainstorm.md +26 -17
- package/bundled/locales/zh-CN/skills/commands/{review.md → code-review.md} +4 -4
- package/bundled/locales/zh-CN/skills/commands/derive-all.md +1 -1
- package/bundled/locales/zh-CN/skills/commands/derive-atdd.md +1 -1
- package/bundled/locales/zh-CN/skills/commands/derive-bdd.md +2 -3
- package/bundled/locales/zh-CN/skills/commands/derive-tdd.md +1 -1
- package/bundled/locales/zh-CN/skills/commands/derive.md +1 -1
- package/bundled/locales/zh-CN/skills/commands/dev-workflow.md +2 -2
- package/bundled/locales/zh-CN/skills/commands/methodology.md +4 -4
- package/bundled/locales/zh-CN/skills/commands/pr.md +1 -1
- package/bundled/locales/zh-CN/skills/commands/tdd.md +1 -1
- package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/contract-test-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/dev-methodology/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/dev-methodology/create-methodology.md +456 -0
- package/bundled/locales/zh-CN/skills/dev-methodology/guide.md +6 -6
- package/bundled/locales/zh-CN/skills/dev-methodology/runtime.md +296 -0
- package/bundled/locales/zh-CN/skills/dev-workflow-guide/SKILL.md +5 -5
- package/bundled/locales/zh-CN/skills/docs-generator/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/e2e-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/incident-response-assistant/SKILL.md +2 -2
- package/bundled/locales/zh-CN/skills/journey-test-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/logging-guide/SKILL.md +146 -142
- package/bundled/locales/zh-CN/skills/migration-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/observability-assistant/guide.md +1 -1
- package/bundled/locales/zh-CN/skills/pr-automation-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/project-discovery/guide.md +2 -2
- package/bundled/locales/zh-CN/skills/reverse-engineer/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/runbook-assistant/guide.md +1 -1
- package/bundled/locales/zh-CN/skills/security-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/skill-builder/SKILL.md +3 -3
- package/bundled/locales/zh-CN/skills/slo-assistant/guide.md +1 -1
- package/bundled/locales/zh-CN/skills/spec-derivation/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/spec-derivation/guide.md +8 -9
- package/bundled/locales/zh-CN/skills/spec-driven-dev/SKILL.md +2 -2
- package/bundled/locales/zh-CN/skills/sweep/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/tdd-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/testing-guide/SKILL.md +2 -2
- package/bundled/locales/zh-CN/skills/testing-guide/testing-theory.md +2298 -0
- package/bundled/locales/zh-CN/skills/workflows/README.md +451 -0
- package/bundled/locales/zh-TW/CHANGELOG.md +81 -6
- package/bundled/locales/zh-TW/CLAUDE.md +1 -1
- package/bundled/locales/zh-TW/MAINTENANCE.md +25 -2
- package/bundled/locales/zh-TW/README.md +22 -9
- package/bundled/locales/zh-TW/SECURITY.md +1 -1
- package/bundled/locales/zh-TW/adoption/DAILY-WORKFLOW-GUIDE.md +2 -2
- package/bundled/locales/zh-TW/ai/standards/versioning.ai.yaml +8 -48
- package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +4 -6
- package/bundled/locales/zh-TW/core/accessibility-standards.md +1 -1
- package/bundled/locales/zh-TW/core/adversarial-test.md +226 -0
- package/bundled/locales/zh-TW/core/agent-behavior-discipline.md +187 -0
- package/bundled/locales/zh-TW/core/ai-response-navigation.md +32 -6
- package/bundled/locales/zh-TW/core/anti-sycophancy-prompting.md +1 -1
- package/bundled/locales/zh-TW/core/api-design-standards.md +91 -9
- package/bundled/locales/zh-TW/core/audit-trail.md +110 -0
- package/bundled/locales/zh-TW/core/behavior-snapshot.md +335 -0
- package/bundled/locales/zh-TW/core/browser-compatibility-standards.md +1 -0
- package/bundled/locales/zh-TW/core/cd-deployment-strategies.md +135 -0
- package/bundled/locales/zh-TW/core/chaos-injection-tests.md +130 -0
- package/bundled/locales/zh-TW/core/checkin-standards.md +1 -1
- package/bundled/locales/zh-TW/core/code-review-checklist.md +1 -1
- package/bundled/locales/zh-TW/core/container-image-standards.md +93 -0
- package/bundled/locales/zh-TW/core/container-security.md +535 -0
- package/bundled/locales/zh-TW/core/cost-budget-test.md +86 -0
- package/bundled/locales/zh-TW/core/cross-flow-regression.md +1 -0
- package/bundled/locales/zh-TW/core/data-contract.md +101 -0
- package/bundled/locales/zh-TW/core/data-migration-testing.md +217 -0
- package/bundled/locales/zh-TW/core/data-pipeline.md +105 -0
- package/bundled/locales/zh-TW/core/deployment-standards.md +363 -25
- package/bundled/locales/zh-TW/core/deprecation-standards.md +17 -4
- package/bundled/locales/zh-TW/core/developer-memory.md +2 -2
- package/bundled/locales/zh-TW/core/disaster-recovery-drill.md +87 -0
- package/bundled/locales/zh-TW/core/documentation-writing-standards.md +1 -1
- package/bundled/locales/zh-TW/core/error-code-standards.md +2 -2
- package/bundled/locales/zh-TW/core/feature-manifest-standard.md +222 -0
- package/bundled/locales/zh-TW/core/flaky-test-management.md +87 -0
- package/bundled/locales/zh-TW/core/flow-based-testing.md +284 -0
- package/bundled/locales/zh-TW/core/forward-derivation-standards.md +3 -4
- package/bundled/locales/zh-TW/core/full-coverage-testing.md +250 -0
- package/bundled/locales/zh-TW/core/git-worktree.md +1 -1
- package/bundled/locales/zh-TW/core/guides/performance-guide.md +515 -0
- package/bundled/locales/zh-TW/core/guides/security-guide.md +494 -0
- package/bundled/locales/zh-TW/core/iac-design-principles.md +90 -0
- package/bundled/locales/zh-TW/core/incident-response.md +111 -0
- package/bundled/locales/zh-TW/core/license-compliance.md +129 -0
- package/bundled/locales/zh-TW/core/llm-output-validation.md +192 -0
- package/bundled/locales/zh-TW/core/logging-standards.md +208 -4
- package/bundled/locales/zh-TW/core/mock-boundary.md +161 -0
- package/bundled/locales/zh-TW/core/model-provenance.md +173 -0
- package/bundled/locales/zh-TW/core/model-selection.md +28 -5
- package/bundled/locales/zh-TW/core/mutation-testing.md +106 -0
- package/bundled/locales/zh-TW/core/no-cicd-deployment.md +219 -0
- package/bundled/locales/zh-TW/core/packaging-standards.md +76 -5
- package/bundled/locales/zh-TW/core/performance-standards.md +84 -5
- package/bundled/locales/zh-TW/core/pii-classification.md +102 -0
- package/bundled/locales/zh-TW/core/pipeline-security-gates.md +126 -0
- package/bundled/locales/zh-TW/core/policy-as-code-testing.md +203 -0
- package/bundled/locales/zh-TW/core/prd-standards.md +88 -0
- package/bundled/locales/zh-TW/core/privacy-standards.md +1 -1
- package/bundled/locales/zh-TW/core/product-metrics-standards.md +96 -0
- package/bundled/locales/zh-TW/core/project-context-memory.md +1 -1
- package/bundled/locales/zh-TW/core/prompt-regression.md +88 -0
- package/bundled/locales/zh-TW/core/property-based-testing.md +87 -0
- package/bundled/locales/zh-TW/core/refactoring-standards.md +43 -6
- package/bundled/locales/zh-TW/core/release-quality-manifest.md +207 -0
- package/bundled/locales/zh-TW/core/replay-test.md +102 -0
- package/bundled/locales/zh-TW/core/resource-cost-boundary.md +175 -0
- package/bundled/locales/zh-TW/core/reverse-engineering-standards.md +64 -5
- package/bundled/locales/zh-TW/core/rollback-standards.md +120 -0
- package/bundled/locales/zh-TW/core/runbook.md +110 -0
- package/bundled/locales/zh-TW/core/sast-advanced.md +309 -0
- package/bundled/locales/zh-TW/core/schema-evolution.md +98 -0
- package/bundled/locales/zh-TW/core/secret-management-standards.md +101 -0
- package/bundled/locales/zh-TW/core/secure-op.md +328 -0
- package/bundled/locales/zh-TW/core/security-testing.md +96 -0
- package/bundled/locales/zh-TW/core/self-review-protocol.md +2 -2
- package/bundled/locales/zh-TW/core/server-ops-security.md +507 -0
- package/bundled/locales/zh-TW/core/slo-sli.md +108 -0
- package/bundled/locales/zh-TW/core/smoke-test.md +79 -0
- package/bundled/locales/zh-TW/core/spec-driven-development.md +39 -13
- package/bundled/locales/zh-TW/core/supply-chain-attestation.md +131 -0
- package/bundled/locales/zh-TW/core/user-journey-testing.md +111 -0
- package/bundled/locales/zh-TW/core/user-story-mapping.md +94 -0
- package/bundled/locales/zh-TW/core/verification-oracle.md +159 -0
- package/bundled/locales/zh-TW/core/versioning.md +112 -112
- package/bundled/locales/zh-TW/docs/CHEATSHEET.md +31 -6
- package/bundled/locales/zh-TW/docs/DEV-WORKFLOW-MAPPING.md +6 -6
- package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +61 -34
- package/bundled/locales/zh-TW/docs/MIGRATION-v6.md +88 -0
- package/bundled/locales/zh-TW/docs/USAGE-MODES-COMPARISON.md +2 -2
- package/bundled/locales/zh-TW/docs/USER-MANUAL.md +14 -14
- package/bundled/locales/zh-TW/docs/specs/system/memory-adoption-strategy.md +105 -0
- package/bundled/locales/zh-TW/docs/user/FAQ.md +132 -0
- package/bundled/locales/zh-TW/docs/user/GETTING-STARTED.md +144 -0
- package/bundled/locales/zh-TW/docs/user/GLOSSARY.md +178 -0
- package/bundled/locales/zh-TW/docs/user/README.md +70 -0
- package/bundled/locales/zh-TW/docs/user/TROUBLESHOOTING.md +190 -0
- package/bundled/locales/zh-TW/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +1 -1
- package/bundled/locales/zh-TW/integrations/github-copilot/README.md +1 -1
- package/bundled/locales/zh-TW/integrations/github-copilot/skills-mapping.md +3 -3
- package/bundled/locales/zh-TW/integrations/opencode/skills-mapping.md +3 -3
- package/bundled/locales/zh-TW/methodologies/guides/sdd-guide.md +523 -26
- package/bundled/locales/zh-TW/options/changelog/auto-generated.md +166 -0
- package/bundled/locales/zh-TW/options/changelog/keep-a-changelog.md +140 -0
- package/bundled/locales/zh-TW/options/code-review/automated-review.md +214 -0
- package/bundled/locales/zh-TW/options/code-review/pair-programming.md +166 -0
- package/bundled/locales/zh-TW/options/code-review/pr-review.md +167 -0
- package/bundled/locales/zh-TW/options/documentation/api-docs.md +191 -0
- package/bundled/locales/zh-TW/options/documentation/markdown-docs.md +150 -0
- package/bundled/locales/zh-TW/options/documentation/wiki-style.md +131 -0
- package/bundled/locales/zh-TW/options/project-structure/kotlin.md +144 -0
- package/bundled/locales/zh-TW/options/project-structure/php.md +168 -0
- package/bundled/locales/zh-TW/options/project-structure/ruby.md +156 -0
- package/bundled/locales/zh-TW/options/project-structure/rust.md +136 -0
- package/bundled/locales/zh-TW/options/project-structure/swift.md +165 -0
- package/bundled/locales/zh-TW/options/testing/contract-testing.md +237 -0
- package/bundled/locales/zh-TW/options/testing/industry-pyramid.md +200 -0
- package/bundled/locales/zh-TW/options/testing/istqb-framework.md +144 -0
- package/bundled/locales/zh-TW/options/testing/performance-testing.md +251 -0
- package/bundled/locales/zh-TW/options/testing/security-testing.md +192 -0
- package/bundled/locales/zh-TW/skills/README.md +91 -128
- package/bundled/locales/zh-TW/skills/ac-coverage/SKILL.md +4 -6
- package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/agents/code-architect.md +263 -0
- package/bundled/locales/zh-TW/skills/agents/doc-writer.md +410 -0
- package/bundled/locales/zh-TW/skills/agents/reviewer.md +357 -0
- package/bundled/locales/zh-TW/skills/agents/spec-analyst.md +410 -0
- package/bundled/locales/zh-TW/skills/agents/test-specialist.md +368 -0
- package/bundled/locales/zh-TW/skills/ai-collaboration-standards/SKILL.md +2 -2
- package/bundled/locales/zh-TW/skills/ai-friendly-architecture/SKILL.md +2 -2
- package/bundled/locales/zh-TW/skills/ai-instruction-standards/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/atdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/atdd-assistant/acceptance-criteria-guide.md +1 -1
- package/bundled/locales/zh-TW/skills/atdd-assistant/atdd-workflow.md +3 -4
- package/bundled/locales/zh-TW/skills/audit-assistant/SKILL.md +2 -2
- package/bundled/locales/zh-TW/skills/bdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/bdd-assistant/guide.md +1 -2
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +110 -14
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/guide.md +31 -7
- package/bundled/locales/zh-TW/skills/checkin-assistant/SKILL.md +3 -1
- package/bundled/locales/zh-TW/skills/ci-cd-assistant/SKILL.md +50 -0
- package/bundled/locales/zh-TW/skills/code-review-assistant/SKILL.md +7 -5
- package/bundled/locales/zh-TW/skills/commands/ac-coverage.md +1 -1
- package/bundled/locales/zh-TW/skills/commands/atdd.md +3 -3
- package/bundled/locales/zh-TW/skills/commands/bdd.md +2 -2
- package/bundled/locales/zh-TW/skills/commands/brainstorm.md +26 -17
- package/bundled/locales/zh-TW/skills/commands/{review.md → code-review.md} +5 -5
- package/bundled/locales/zh-TW/skills/commands/derive-all.md +1 -1
- package/bundled/locales/zh-TW/skills/commands/derive-atdd.md +1 -1
- package/bundled/locales/zh-TW/skills/commands/derive-bdd.md +2 -3
- package/bundled/locales/zh-TW/skills/commands/derive-tdd.md +1 -1
- package/bundled/locales/zh-TW/skills/commands/derive.md +1 -1
- package/bundled/locales/zh-TW/skills/commands/dev-workflow.md +2 -2
- package/bundled/locales/zh-TW/skills/commands/methodology.md +4 -4
- package/bundled/locales/zh-TW/skills/commands/pr.md +1 -1
- package/bundled/locales/zh-TW/skills/commands/tdd.md +1 -1
- package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/dev-methodology/create-methodology.md +456 -0
- package/bundled/locales/zh-TW/skills/dev-methodology/guide.md +5 -5
- package/bundled/locales/zh-TW/skills/dev-methodology/runtime.md +296 -0
- package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +5 -5
- package/bundled/locales/zh-TW/skills/docs-generator/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/e2e-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/incident-response-assistant/SKILL.md +2 -2
- package/bundled/locales/zh-TW/skills/logging-guide/SKILL.md +29 -27
- package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/pr-automation-assistant/SKILL.md +3 -1
- package/bundled/locales/zh-TW/skills/project-discovery/guide.md +2 -2
- package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/security-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/spec-derivation/guide.md +7 -8
- package/bundled/locales/zh-TW/skills/spec-driven-dev/SKILL.md +2 -2
- package/bundled/locales/zh-TW/skills/sweep/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/tdd-assistant/SKILL.md +3 -1
- package/bundled/locales/zh-TW/skills/testing-guide/SKILL.md +2 -2
- package/bundled/locales/zh-TW/skills/testing-guide/testing-theory.md +2298 -0
- package/bundled/locales/zh-TW/skills/workflows/README.md +451 -0
- package/bundled/skills/README.md +1 -1
- package/bundled/skills/ac-coverage/SKILL.md +17 -7
- package/bundled/skills/adr-assistant/SKILL.md +1 -1
- package/bundled/skills/agents/code-architect.md +1 -1
- package/bundled/skills/agents/doc-writer.md +1 -1
- package/bundled/skills/agents/reviewer.md +2 -2
- package/bundled/skills/agents/spec-analyst.md +1 -1
- package/bundled/skills/agents/test-specialist.md +1 -1
- package/bundled/skills/ai-collaboration-standards/SKILL.md +2 -2
- package/bundled/skills/ai-friendly-architecture/SKILL.md +2 -2
- package/bundled/skills/ai-instruction-standards/SKILL.md +1 -1
- package/bundled/skills/atdd-assistant/SKILL.md +7 -0
- package/bundled/skills/atdd-assistant/acceptance-criteria-guide.md +1 -1
- package/bundled/skills/atdd-assistant/atdd-workflow.md +6 -8
- package/bundled/skills/audit-assistant/SKILL.md +2 -2
- package/bundled/skills/bdd-assistant/SKILL.md +7 -0
- package/bundled/skills/bdd-assistant/guide.md +1 -2
- package/bundled/skills/brainstorm-assistant/SKILL.md +133 -11
- package/bundled/skills/brainstorm-assistant/guide.md +33 -5
- package/bundled/skills/checkin-assistant/SKILL.md +8 -1
- package/bundled/skills/ci-cd-assistant/SKILL.md +57 -0
- package/bundled/skills/code-review-assistant/SKILL.md +15 -8
- package/bundled/skills/commands/COMMAND-FAMILY-OVERVIEW.md +2 -2
- package/bundled/skills/commands/COMMAND-INDEX.json +3 -3
- package/bundled/skills/commands/README.md +2 -2
- package/bundled/skills/commands/ac-coverage.md +1 -1
- package/bundled/skills/commands/atdd.md +2 -2
- package/bundled/skills/commands/bdd.md +2 -2
- package/bundled/skills/commands/brainstorm.md +25 -14
- package/bundled/skills/commands/{review.md → code-review.md} +6 -6
- package/bundled/skills/commands/derive-all.md +1 -1
- package/bundled/skills/commands/derive-atdd.md +1 -1
- package/bundled/skills/commands/derive-bdd.md +2 -3
- package/bundled/skills/commands/derive-tdd.md +1 -1
- package/bundled/skills/commands/derive.md +1 -1
- package/bundled/skills/commands/dev-workflow.md +1 -1
- package/bundled/skills/commands/journey-test.md +45 -0
- package/bundled/skills/commands/methodology.md +4 -4
- package/bundled/skills/commands/pr.md +1 -1
- package/bundled/skills/commands/skill-builder.md +42 -0
- package/bundled/skills/commands/tdd.md +1 -1
- package/bundled/skills/dev-methodology/create-methodology.md +1 -1
- package/bundled/skills/dev-methodology/guide.md +1 -1
- package/bundled/skills/dev-methodology/runtime.md +1 -1
- package/bundled/skills/dev-workflow-guide/SKILL.md +3 -3
- package/bundled/skills/dev-workflow-guide/workflow-phases.md +3 -3
- package/bundled/skills/docs-generator/SKILL.md +3 -3
- package/bundled/skills/incident-response-assistant/SKILL.md +2 -2
- package/bundled/skills/logging-guide/SKILL.md +38 -2
- package/bundled/skills/migration-assistant/SKILL.md +226 -0
- package/bundled/skills/observability-assistant/SKILL.md +74 -0
- package/bundled/skills/pr-automation-assistant/SKILL.md +5 -1
- package/bundled/skills/project-discovery/guide.md +2 -2
- package/bundled/skills/push/SKILL.md +1 -1
- package/bundled/skills/release-standards/SKILL.md +19 -5
- package/bundled/skills/security-assistant/SKILL.md +1 -1
- package/bundled/skills/skill-builder/SKILL.md +1 -1
- package/bundled/skills/spec-derivation/guide.md +3 -4
- package/bundled/skills/spec-driven-dev/SKILL.md +27 -0
- package/bundled/skills/sweep/SKILL.md +1 -1
- package/bundled/skills/tdd-assistant/SKILL.md +8 -1
- package/bundled/skills/testing-guide/SKILL.md +1 -1
- package/bundled/skills/testing-guide/testing-theory.md +1 -1
- package/bundled/skills/workflows/README.md +2 -2
- package/package.json +3 -3
- package/src/commands/audit.js +30 -9
- package/src/commands/config.js +33 -2
- package/src/commands/hitl.js +14 -1
- package/src/commands/init.js +110 -58
- package/src/commands/quickstart.js +1 -2
- package/src/commands/release.js +51 -6
- package/src/commands/run-intent.js +9 -0
- package/src/commands/spec-split.js +27 -2
- package/src/commands/update.js +22 -6
- package/src/config/ai-agent-paths.js +3 -1
- package/src/i18n/messages.js +3 -102
- package/src/missions/MissionManager.js +44 -12
- package/src/utils/build-manifest.js +35 -3
- package/src/utils/friction-detector.js +71 -22
- package/src/utils/health-checker.js +29 -2
- package/src/utils/transaction.js +111 -0
- package/src/utils/version-promote.js +16 -0
- package/standards-registry.json +58 -146
- package/bundled/ai/standards/agent-communication-protocol.ai.yaml +0 -42
- package/bundled/ai/standards/agent-dispatch.ai.yaml +0 -42
- package/bundled/ai/standards/branch-completion.ai.yaml +0 -44
- package/bundled/ai/standards/change-batching-standards.ai.yaml +0 -44
- package/bundled/ai/standards/execution-history.ai.yaml +0 -42
- package/bundled/ai/standards/pipeline-integration-standards.ai.yaml +0 -42
- package/bundled/ai/standards/workflow-enforcement.ai.yaml +0 -44
- package/bundled/ai/standards/workflow-state-protocol.ai.yaml +0 -43
- package/src/commands/flow.js +0 -260
- package/src/commands/start.js +0 -372
- package/src/commands/sweep.js +0 -151
- package/src/commands/workflow.js +0 -681
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/cd-deployment-strategies.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2026-06-10
|
|
6
|
+
source_hash: 0eeb697c2f07
|
|
7
|
+
status: current
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# CD Deployment Strategies(CD 部署策略)
|
|
11
|
+
|
|
12
|
+
> **Language**: [English](../../../core/cd-deployment-strategies.md) | 繁體中文
|
|
13
|
+
|
|
14
|
+
## 概述
|
|
15
|
+
|
|
16
|
+
本標準定義四種主要部署策略的選用矩陣:Blue-Green、Canary、Rolling、Recreate。幫助團隊根據流量規模、風險容忍度和基礎設施成本,做出一致且有據可查的策略選擇。
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 核心原則
|
|
21
|
+
|
|
22
|
+
- **三維決策**:根據流量規模 × 風險容忍度 × 基礎設施成本選擇策略
|
|
23
|
+
- **禁止直接推產**:任何變更都必須先通過 staging 環境驗證
|
|
24
|
+
- **零停機目標**:除非為內部工具或開發環境,否則應追求零停機部署
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 策略選用矩陣
|
|
29
|
+
|
|
30
|
+
| 策略 | 流量規模 | 風險容忍度 | 基礎設施成本 | 停機時間 | 回滾時間 |
|
|
31
|
+
|------|---------|----------|------------|---------|---------|
|
|
32
|
+
| Blue-Green | 高 | 低 | 高 | 零 | < 30 秒 |
|
|
33
|
+
| Canary | 中至高 | 中 | 中 | 零 | < 2 分鐘 |
|
|
34
|
+
| Rolling | 任意 | 中 | 低 | 極少 | 數分鐘 |
|
|
35
|
+
| Recreate | 低 | 高 | 極低 | 數秒至數分鐘 | 數分鐘 |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 各策略詳細說明
|
|
40
|
+
|
|
41
|
+
### Blue-Green
|
|
42
|
+
|
|
43
|
+
**適用場景**:有狀態服務、資料庫相容性變更、高 SLA API
|
|
44
|
+
|
|
45
|
+
**運作方式**:
|
|
46
|
+
- 維護兩個完全相同的環境(Blue = 現有線上版,Green = 新版本)
|
|
47
|
+
- 完整部署並驗證 Green 環境後,切換 Load Balancer 流量
|
|
48
|
+
- 問題發生時立即切回 Blue
|
|
49
|
+
|
|
50
|
+
**前置條件**:雙環境基礎設施、Load Balancer、健康檢查
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### Canary
|
|
55
|
+
|
|
56
|
+
**適用場景**:功能驗證、A/B 測試、高風險變更
|
|
57
|
+
|
|
58
|
+
**流量漸進比例**:1% → 5% → 25% → 50% → 100%
|
|
59
|
+
|
|
60
|
+
**運作方式**:
|
|
61
|
+
- 先將少量流量導向新版本
|
|
62
|
+
- 監控指標,符合自動晉升規則則繼續擴大
|
|
63
|
+
- 發現問題立即縮回 0%
|
|
64
|
+
|
|
65
|
+
**前置條件**:流量切分機制、可觀測性、自動晉升規則
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### Rolling
|
|
70
|
+
|
|
71
|
+
**適用場景**:無狀態服務、標準更新、批次工作者
|
|
72
|
+
|
|
73
|
+
**運作方式**:
|
|
74
|
+
- 依序更新每個實例,更新前進行健康檢查
|
|
75
|
+
- 允許新舊版本短暫共存
|
|
76
|
+
- 資源效率最佳,但回滾需時較長
|
|
77
|
+
|
|
78
|
+
**前置條件**:多個服務實例、健康檢查
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
### Recreate
|
|
83
|
+
|
|
84
|
+
**適用場景**:開發/測試環境、內部工具、單一實例服務
|
|
85
|
+
|
|
86
|
+
**運作方式**:
|
|
87
|
+
- 停止所有現有實例,部署新版本,重新啟動
|
|
88
|
+
- 最簡單,但有停機時間
|
|
89
|
+
|
|
90
|
+
**前置條件**:無(最低門檻)
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 決策樹
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
Q1: 需要零停機時間?
|
|
98
|
+
→ 否 → Recreate
|
|
99
|
+
→ 是 → Q2
|
|
100
|
+
|
|
101
|
+
Q2: 流量 > 10k req/min?
|
|
102
|
+
→ 是 → Q3(Blue-Green 或 Canary)
|
|
103
|
+
→ 否 → Rolling
|
|
104
|
+
|
|
105
|
+
Q3: 變更屬於高風險?
|
|
106
|
+
→ 是 → Canary
|
|
107
|
+
→ 否 → Q4
|
|
108
|
+
|
|
109
|
+
Q4: 基礎設施預算有限?
|
|
110
|
+
→ 是 → Rolling
|
|
111
|
+
→ 否 → Blue-Green
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 無 CI/CD 環境的替代做法
|
|
117
|
+
|
|
118
|
+
| 策略 | 替代方案 |
|
|
119
|
+
|------|---------|
|
|
120
|
+
| Blue-Green | 參見 no-cicd-deployment.ai.yaml 的 Shell Script 實作 |
|
|
121
|
+
| Canary | 使用 Nginx `split_clients` 或 HAProxy 做流量切分 |
|
|
122
|
+
| Rolling | 使用順序式 rsync + 健康檢查迴圈 |
|
|
123
|
+
| Recreate | 最簡單 — 停止、部署、啟動 |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 相關標準
|
|
128
|
+
|
|
129
|
+
- [deployment-standards.md](../../../core/deployment-standards.md) — 部署基礎原則
|
|
130
|
+
- [rollback-standards.md](../../../core/rollback-standards.md) — 回滾觸發條件矩陣
|
|
131
|
+
- [no-cicd-deployment.md](../../../core/no-cicd-deployment.md) — 無 CI/CD 部署策略
|
|
132
|
+
- AI 格式:[../../../ai/standards/cd-deployment-strategies.ai.yaml](../../../ai/standards/cd-deployment-strategies.ai.yaml)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
**Scope**: universal
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/chaos-injection-tests.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2026-06-10
|
|
6
|
+
source_hash: 4aaf84b1c84c
|
|
7
|
+
status: current
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 混沌注入測試
|
|
11
|
+
|
|
12
|
+
> **語言**: [English](../../../core/chaos-injection-tests.md) | 繁體中文 | [简体中文](../../zh-CN/core/chaos-injection-tests.md)
|
|
13
|
+
|
|
14
|
+
## 概述
|
|
15
|
+
|
|
16
|
+
混沌注入測試使失敗情境可機器驗證。`chaos-engineering-standards` 描述實驗方法論,而本標準定義 AI Agent 系統所需的具體測試——LLM 逾時、資料庫斷線、策略引擎失效,以及爆炸半徑控制。
|
|
17
|
+
|
|
18
|
+
## 為什麼 AI Agent 系統需要專屬的混沌測試
|
|
19
|
+
|
|
20
|
+
傳統軟體只有少數外部依賴。AI Agent 系統使這一情況更加複雜:
|
|
21
|
+
|
|
22
|
+
- **LLM API**:高延遲、速率限制、非確定性失敗
|
|
23
|
+
- **策略引擎**(OPA/Rego):安全關鍵——必須在失敗時關閉
|
|
24
|
+
- **向量儲存 / 知識庫**:檢索失敗影響輸出品質
|
|
25
|
+
- **資料庫**:操作中途斷線可能損壞多步驟的 Agent 狀態
|
|
26
|
+
- **對等 Agent**:在多 Agent 管線中,一個 Agent 崩潰不得串聯影響其他 Agent
|
|
27
|
+
|
|
28
|
+
上述每種失敗模式都需要專屬測試,而不僅僅是操作手冊中的一句說明。
|
|
29
|
+
|
|
30
|
+
## 需求摘要
|
|
31
|
+
|
|
32
|
+
| ID | 規則 | 依據 |
|
|
33
|
+
|----|------|-----------|
|
|
34
|
+
| REQ-CIT-001 | 每個外部依賴需要一個失敗隔離測試 | 單一依賴失敗不得串聯 |
|
|
35
|
+
| REQ-CIT-002 | LLM 客戶端必須處理逾時和速率限制 | LLM 是最高風險依賴 |
|
|
36
|
+
| REQ-CIT-003 | 策略引擎不可用時必須預設為 DENY | 開放式失敗是安全漏洞 |
|
|
37
|
+
| REQ-CIT-004 | 操作中途資料庫斷線必須乾淨回滾 | 部分寫入會造成資料損毀 |
|
|
38
|
+
| REQ-CIT-005 | Agent 崩潰不得傳播至不相關的 Agent | Agent 間爆炸半徑必須有界 |
|
|
39
|
+
|
|
40
|
+
## 注入模式
|
|
41
|
+
|
|
42
|
+
### LLM 逾時
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
it('surfaces TimeoutError when LLM does not respond in time', async () => {
|
|
46
|
+
const slowLlm = { complete: () => new Promise(() => {}) } // never resolves
|
|
47
|
+
const agent = new PlannerAgent({ llm: slowLlm, timeoutMs: 100 })
|
|
48
|
+
await expect(agent.run(input)).rejects.toThrow('TimeoutError')
|
|
49
|
+
})
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### LLM 速率限制(429)
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
it('retries with backoff on 429 and eventually surfaces RateLimitError', async () => {
|
|
56
|
+
const rateLimitedLlm = mockLlm({ status: 429, retryAfter: 1 })
|
|
57
|
+
const agent = new PlannerAgent({ llm: rateLimitedLlm })
|
|
58
|
+
await expect(agent.run(input)).rejects.toThrow('RateLimitError')
|
|
59
|
+
expect(rateLimitedLlm.callCount).toBeLessThanOrEqual(3) // respects retry policy
|
|
60
|
+
})
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 策略引擎停機(失敗關閉)
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
it('returns DENY when OPA sidecar is unavailable', async () => {
|
|
67
|
+
const downOpa = { query: () => Promise.reject(new Error('ECONNREFUSED')) }
|
|
68
|
+
const guardian = new GuardianAgent({ opa: downOpa })
|
|
69
|
+
const result = await guardian.review(reviewable)
|
|
70
|
+
expect(result.decision).toBe('DENY')
|
|
71
|
+
expect(result.reason).toMatch(/policy engine unavailable/)
|
|
72
|
+
})
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 資料庫斷線
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
it('rolls back transaction on mid-operation DB disconnect', async () => {
|
|
79
|
+
const db = createTestDb()
|
|
80
|
+
await seedRows(db, [{ id: 1, name: 'alice' }])
|
|
81
|
+
|
|
82
|
+
// Force disconnect after first write in the transaction
|
|
83
|
+
let writeCount = 0
|
|
84
|
+
const hookedDb = hookAfterWrite(db, () => {
|
|
85
|
+
if (++writeCount === 1) db.close()
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
await expect(runner.executeWithDb(hookedDb, plan)).rejects.toThrow()
|
|
89
|
+
|
|
90
|
+
const freshDb = createTestDb()
|
|
91
|
+
const rows = freshDb.prepare('SELECT * FROM records').all()
|
|
92
|
+
expect(rows).toHaveLength(1) // original row preserved, partial write rolled back
|
|
93
|
+
})
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Agent 崩潰控制
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
it('pipeline continues when one agent throws', async () => {
|
|
100
|
+
const crashingAgent = { run: () => { throw new Error('agent crash') } }
|
|
101
|
+
const pipeline = new Pipeline({ agents: { planner: crashingAgent, builder: realBuilder } })
|
|
102
|
+
|
|
103
|
+
const result = await pipeline.run(input, { skipFailedAgents: true })
|
|
104
|
+
expect(result.completedAgents).toContain('builder')
|
|
105
|
+
expect(result.failedAgents).toContain('planner')
|
|
106
|
+
})
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## 安全規則
|
|
110
|
+
|
|
111
|
+
1. 絕對不要對生產環境或共享的測試資料庫執行混沌測試
|
|
112
|
+
2. 在 `afterEach` 或 `finally` 區塊中始終清理注入的故障
|
|
113
|
+
3. 為混沌測試加上標籤(`@chaos`),以在開發工作流程的快速單元測試執行中排除
|
|
114
|
+
4. 混沌測試可在 CI 的專屬工作中執行,不納入標準單元測試矩陣
|
|
115
|
+
|
|
116
|
+
## 反模式
|
|
117
|
+
|
|
118
|
+
- **在主處理器中捕獲並忽略所有錯誤** — 這會對斷言隱藏混沌失敗
|
|
119
|
+
- **斷線後不驗證資料庫狀態** — 僅斷言錯誤被拋出是不夠的;必須斷言沒有寫入部分資料
|
|
120
|
+
- **開放式策略引擎處理** — 策略路徑中的任何模糊情況都必須解析為 DENY,而非 ALLOW
|
|
121
|
+
|
|
122
|
+
## 另請參閱
|
|
123
|
+
|
|
124
|
+
- `chaos-engineering-standards.ai.yaml` — 實驗方法論與 SLO 整合
|
|
125
|
+
- `testing.ai.yaml` — 通用測試結構
|
|
126
|
+
- `secure-op.ai.yaml` — AI Agent 的失敗關閉原則
|
|
127
|
+
- `security-standards.ai.yaml` — 安全不變量
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
**Scope**: universal
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/container-image-standards.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2026-06-17
|
|
6
|
+
source_hash: ac8280a5b7cf
|
|
7
|
+
status: current
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 容器映像建構與安全標準
|
|
11
|
+
|
|
12
|
+
> **Language**: [English](../../../core/container-image-standards.md) | 繁體中文
|
|
13
|
+
|
|
14
|
+
> **版本**: 1.0.0 | **狀態**: Active | **更新日期**: 2026-06-17
|
|
15
|
+
> **AI 最佳化版本**: `ai/standards/container-image-standards.ai.yaml`
|
|
16
|
+
> **規格**: XSPEC-065(cross-project/specs/XSPEC-065-uds-infrastructure-pack.md)
|
|
17
|
+
|
|
18
|
+
## 概觀
|
|
19
|
+
|
|
20
|
+
本標準定義容器映像建構管線的安全與合規要求。涵蓋五項 Dockerfile 撰寫原則(多階段
|
|
21
|
+
建構、非 root 執行、最小基底映像、無秘密的 build args、SBOM metadata)、使用 `syft`
|
|
22
|
+
或 `trivy` 進行 SBOM 生成與嵌入,以及封鎖 Critical/High CVE 的映像掃描政策。
|
|
23
|
+
|
|
24
|
+
本標準屬於 **IaC 標準包**(XSPEC-065),並透過聚焦於供應鏈安全與合規認證
|
|
25
|
+
(attestation)來補足既有的 `containerization-standards`(layer 排序與標記)。
|
|
26
|
+
|
|
27
|
+
> **範圍**:本標準定義生產映像必須保證的事項(rootless、最小化、已掃描、SBOM
|
|
28
|
+
> 認證)以及 CVE 的*嚴重度政策*。具體的 SBOM 工具(`syft`/`trivy`)、掃描器與
|
|
29
|
+
> registry 屬採用者的選擇,不在本標準範圍內。
|
|
30
|
+
|
|
31
|
+
## 需求
|
|
32
|
+
|
|
33
|
+
| ID | 規則 | 等級 |
|
|
34
|
+
|----|------|------|
|
|
35
|
+
| REQ-001 | Dockerfile 五原則(多階段、非 root、最小基底、無秘密、SBOM label) | MUST |
|
|
36
|
+
| REQ-002 | SBOM 嵌入(於 CI 生成、嵌入或認證、保留 ≥12 個月) | MUST |
|
|
37
|
+
| REQ-003 | 映像掃描(Critical/High 封鎖;Medium 開單;自動基底更新) | MUST |
|
|
38
|
+
|
|
39
|
+
### REQ-001 — Dockerfile 五原則
|
|
40
|
+
|
|
41
|
+
每個生產 Dockerfile MUST 遵循五項原則:(1) **多階段建構**——分離 builder 與 runtime
|
|
42
|
+
階段,以最小化最終映像大小與攻擊面;(2) **非 root 最終使用者**——runtime 階段 MUST
|
|
43
|
+
設定非 root `USER`(UID ≥ 1000);生產容器中以 root 執行為禁止;(3) **Distroless 或
|
|
44
|
+
Alpine 基底**——最終階段使用 distroless(`gcr.io/distroless`)或 Alpine 基底映像以
|
|
45
|
+
最小化 CVE 曝險;除非有正當理由並文件化,否則避免完整 Debian/Ubuntu;(4) **無硬
|
|
46
|
+
編碼秘密**——build ARGs 與 ENV 變數 MUST NOT 含秘密;秘密於執行期透過 volume mount
|
|
47
|
+
或 secret manager 注入(見 `secret-management-standards`);(5) **SBOM metadata
|
|
48
|
+
label**——最終映像 MUST 包含 OCI label `org.opencontainers.image.source` 及含 git
|
|
49
|
+
commit SHA 的建構期 label `org.opencontainers.image.revision`。
|
|
50
|
+
|
|
51
|
+
### REQ-002 — SBOM 嵌入
|
|
52
|
+
|
|
53
|
+
每個生產容器映像 MUST 在 CI 建構步驟生成軟體物料清單(SBOM),使用 `syft` 或
|
|
54
|
+
`trivy` 以 CycloneDX 或 SPDX 格式產出。SBOM MUST 為以下其一:(a) 嵌入為 OCI 映像
|
|
55
|
+
annotation(OCI 相容 registry 的首選),或 (b) 以 `cosign` attestation 附加於映像
|
|
56
|
+
digest。SBOM 產物 MUST 與映像一同儲存於容器 registry,並至少保留 12 個月供合規稽核。
|
|
57
|
+
|
|
58
|
+
### REQ-003 — 映像掃描
|
|
59
|
+
|
|
60
|
+
所有容器映像在推送至生產 registry 前 MUST 掃描已知 CVE,使用整合於 CI 管線的
|
|
61
|
+
`trivy`、`grype` 或同等工具。嚴重度政策:**Critical 與 High** CVE MUST 封鎖建構並
|
|
62
|
+
阻止晉升至生產;**Medium** CVE MUST 產生警告並建立追蹤工單;**Low 與 Negligible**
|
|
63
|
+
CVE 僅供參考。當上游映像收到 CVE 修補時,基底映像更新 MUST 自動觸發(例如以
|
|
64
|
+
Dependabot 或 Renovate 處理 Dockerfile 基底映像 pin)。
|
|
65
|
+
|
|
66
|
+
## 反模式
|
|
67
|
+
|
|
68
|
+
- 在生產 Dockerfile 對基底映像使用 `latest` 標籤(不可重現建構)。
|
|
69
|
+
- 在最終 runtime 階段以 root(UID 0)執行容器程序。
|
|
70
|
+
- 將秘密嵌入會殘留於映像 layer 的 Docker build ARGs 或 ENV 變數。
|
|
71
|
+
- 為節省 CI 時間而略過 SBOM 生成,喪失供應鏈可追溯性。
|
|
72
|
+
- 未經 CVE 掃描結果即推送映像至生產。
|
|
73
|
+
|
|
74
|
+
## 與既有標準的整合
|
|
75
|
+
|
|
76
|
+
- **`containerization-standards`**——涵蓋 layer 排序與標記;本標準在其上加上供應鏈
|
|
77
|
+
安全與認證層。
|
|
78
|
+
- **`secret-management-standards`**——執行期秘密注入取代任何 ARGs/ENV 中的建構期
|
|
79
|
+
秘密(REQ-001 原則 4)。
|
|
80
|
+
- **`supply-chain-security-standards`**——此處的 SBOM 與 CVE 掃描政策是更廣供應鏈
|
|
81
|
+
態勢的容器映像面向。
|
|
82
|
+
- **`iac-design-principles`**——映像建構/晉升本身即是版本化、可重現的基礎設施。
|
|
83
|
+
|
|
84
|
+
## 相關規格
|
|
85
|
+
|
|
86
|
+
- XSPEC-065 — UDS 基礎設施(IaC)標準包(本標準來源)
|
|
87
|
+
- DEC-043 — UDS 覆蓋完整性路線圖(Wave 4 範圍)
|
|
88
|
+
|
|
89
|
+
## 變更紀錄
|
|
90
|
+
|
|
91
|
+
| 版本 | 日期 | 變更 |
|
|
92
|
+
|------|------|------|
|
|
93
|
+
| v1.0.0 | 2026-06-17 | 初版——REQ-001~003:Dockerfile 五原則、SBOM 嵌入、映像掃描(XSPEC-065) |
|