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
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../../core/deployment-standards.md
|
|
3
|
-
source_version: 1.
|
|
4
|
-
translation_version: 1.
|
|
5
|
-
last_synced: 2026-
|
|
3
|
+
source_version: 1.1.0
|
|
4
|
+
translation_version: 1.1.0
|
|
5
|
+
last_synced: 2026-06-10
|
|
6
|
+
source_hash: ede6223c8aba
|
|
6
7
|
status: current
|
|
7
8
|
---
|
|
8
9
|
|
|
@@ -10,8 +11,8 @@ status: current
|
|
|
10
11
|
|
|
11
12
|
> **語言**: [English](../../../core/deployment-standards.md) | 繁體中文
|
|
12
13
|
|
|
13
|
-
**版本**: 1.
|
|
14
|
-
**最後更新**: 2026-
|
|
14
|
+
**版本**: 1.1.0
|
|
15
|
+
**最後更新**: 2026-05-26
|
|
15
16
|
**適用性**: 所有具有部署管線的軟體專案
|
|
16
17
|
**範圍**: 通用 (Universal)
|
|
17
18
|
**業界標準**: Twelve-Factor App、Google SRE — Release Engineering、DORA State of DevOps
|
|
@@ -26,6 +27,7 @@ status: current
|
|
|
26
27
|
**參考標準**:
|
|
27
28
|
- [The Twelve-Factor App](https://12factor.net/) — Factor X:開發/正式一致性
|
|
28
29
|
- [Google SRE Book — Release Engineering](https://sre.google/sre-book/release-engineering/)
|
|
30
|
+
- [Martin Fowler — Feature Toggles](https://martinfowler.com/articles/feature-toggles.html)
|
|
29
31
|
- [DORA State of DevOps Report](https://dora.dev/)
|
|
30
32
|
|
|
31
33
|
---
|
|
@@ -41,23 +43,319 @@ status: current
|
|
|
41
43
|
| **自動化一切** | 手動部署步驟容易出錯;自動化建置、測試、部署和回滾 |
|
|
42
44
|
| **監控一切** | 部署時必須具備可觀測性;無法測量就無法安全部署 |
|
|
43
45
|
|
|
46
|
+
---
|
|
47
|
+
|
|
44
48
|
## 部署策略選擇
|
|
45
49
|
|
|
46
|
-
| 策略 |
|
|
47
|
-
|
|
48
|
-
| **滾動更新 (Rolling)** |
|
|
49
|
-
| **藍綠部署 (Blue-Green)** |
|
|
50
|
-
| **金絲雀部署 (Canary)** |
|
|
51
|
-
|
|
|
50
|
+
| 策略 | 使用場景 | 回滾速度 | 資源成本 | 複雜度 |
|
|
51
|
+
|------|----------|----------|----------|--------|
|
|
52
|
+
| **滾動更新 (Rolling)** | 無狀態服務、標準更新 | 中(分鐘) | 低(無額外基礎設施) | 低 |
|
|
53
|
+
| **藍綠部署 (Blue-Green)** | 零停機需求、相容資料庫變更 | 快(秒,DNS/LB 切換) | 高(2× 基礎設施) | 中 |
|
|
54
|
+
| **金絲雀部署 (Canary)** | 高風險變更、大型使用者群 | 快(重導流量) | 中(部分額外基礎設施) | 高 |
|
|
55
|
+
| **Feature Flag** | 解耦部署與發布、A/B 測試 | 即時(關閉開關) | 低(程式碼層級) | 中 |
|
|
52
56
|
|
|
53
|
-
|
|
57
|
+
### 決策指南
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
是否需要零停機時間?
|
|
61
|
+
├── 是 → 變更是否高風險或大規模?
|
|
62
|
+
│ ├── 是 → Canary
|
|
63
|
+
│ └── 否 → Blue-Green
|
|
64
|
+
└── 否 → 變更是否在 Feature Flag 後面?
|
|
65
|
+
├── 是 → Feature Flag(任何時候都可部署)
|
|
66
|
+
└── 否 → Rolling
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 策略組合
|
|
70
|
+
|
|
71
|
+
策略並非互斥,常見組合如下:
|
|
72
|
+
- **Canary + Feature Flag**:部署 canary 並停用 flag,先對 canary 群組啟用 flag
|
|
73
|
+
- **Blue-Green + Feature Flag**:切換流量至 green 環境,再逐步啟用 flags
|
|
74
|
+
- **Rolling + Feature Flag**:推送程式碼,再分別控制功能曝光
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Feature Flags 生命週期
|
|
79
|
+
|
|
80
|
+
### Flag 類型
|
|
81
|
+
|
|
82
|
+
| 類型 | 目的 | 存活期 | 範例 |
|
|
83
|
+
|------|------|--------|------|
|
|
84
|
+
| **Release** | 控制功能推出 | 數天至數週 | `enable_new_checkout` |
|
|
85
|
+
| **Experiment** | A/B 測試 | 數週至數月 | `experiment_pricing_v2` |
|
|
86
|
+
| **Ops** | 操作控制(緊急關閉) | 永久 | `enable_cache_layer` |
|
|
87
|
+
| **Permission** | 使用者授權 | 永久 | `feature_premium_export` |
|
|
88
|
+
|
|
89
|
+
### 生命週期階段
|
|
90
|
+
|
|
91
|
+
| 階段 | 動作 | 目標期限 |
|
|
92
|
+
|------|------|----------|
|
|
93
|
+
| **1. 建立** | 定義 flag、設定預設值(關閉)、記錄目的與負責人 | 第 0 天 |
|
|
94
|
+
| **2. 啟用** | 漸進式推出:1% → 10% → 50% → 100% | 數天至數週 |
|
|
95
|
+
| **3. 監控** | 追蹤指標、錯誤率、使用者回饋 | 100% 時持續 1-2 週 |
|
|
96
|
+
| **4. 清理** | 從程式碼移除 flag、刪除設定、更新測試 | 全面推出後 1 個 sprint 內 |
|
|
97
|
+
|
|
98
|
+
### 技術債規則
|
|
99
|
+
|
|
100
|
+
| 規則 | 執行方式 |
|
|
101
|
+
|------|----------|
|
|
102
|
+
| Release flag 必須在全面推出後 **30 天內**移除 | 自動提醒/工單 |
|
|
103
|
+
| Experiment flag 必須在 **90 天內**移除 | 季度審計 |
|
|
104
|
+
| 每個 flag 必須有**負責人**和**到期日** | Flag 建立清單 |
|
|
105
|
+
| 每個服務的 flag 數量不應超過 **20** | 儀表板告警 |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 回滾策略
|
|
110
|
+
|
|
111
|
+
### 自動觸發條件
|
|
112
|
+
|
|
113
|
+
| 指標 | 警告閾值 | 自動回滾閾值 | 時間窗口 |
|
|
114
|
+
|------|----------|-------------|----------|
|
|
115
|
+
| **錯誤率** | > 1% | > 5% | 5 分鐘 |
|
|
116
|
+
| **p95 延遲** | > 2× 基線 | > 3× 基線 | 5 分鐘 |
|
|
117
|
+
| **健康檢查** | 1 次失敗 | 3 次連續失敗 | 立即 |
|
|
118
|
+
| **CPU 使用率** | > 80% | > 95% | 10 分鐘 |
|
|
119
|
+
| **記憶體使用率** | > 85% | > 95% | 10 分鐘 |
|
|
120
|
+
|
|
121
|
+
### 手動觸發情境
|
|
122
|
+
|
|
123
|
+
- 客戶回報影響核心功能的嚴重 Bug
|
|
124
|
+
- 部署後發現安全漏洞
|
|
125
|
+
- 偵測到資料損毀或不一致
|
|
126
|
+
- 發現法規遵循違規
|
|
127
|
+
|
|
128
|
+
### 嚴重性決策矩陣
|
|
129
|
+
|
|
130
|
+
| 嚴重性 | 影響 | 動作 | 時限 |
|
|
131
|
+
|--------|------|------|------|
|
|
132
|
+
| **P1 嚴重** | 服務中斷、資料遺失 | 立即回滾,全員動員 | < 5 分鐘 |
|
|
133
|
+
| **P2 高** | 主要功能損壞、顯著使用者影響 | 在時間窗口內回滾 | < 15 分鐘 |
|
|
134
|
+
| **P3 中** | 次要功能損壞、有繞道方案 | 決定:回滾或熱修復 | < 1 小時 |
|
|
135
|
+
| **P4 低** | 外觀問題、邊緣情境 | 在下一個 release 修復 | 下次部署 |
|
|
136
|
+
|
|
137
|
+
### 回滾方式
|
|
138
|
+
|
|
139
|
+
| 方式 | 使用時機 | 速度 |
|
|
140
|
+
|------|----------|------|
|
|
141
|
+
| **還原部署** | 應用程式程式碼問題、無資料庫變更 | < 5 分鐘 |
|
|
142
|
+
| **Feature Flag 切換** | Flag 控制的功能出現問題 | 立即 |
|
|
143
|
+
| **資料庫回滾** | Schema 遷移失敗(若可逆) | 5-30 分鐘 |
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 環境一致性
|
|
148
|
+
|
|
149
|
+
### 三大落差(Twelve-Factor App)
|
|
150
|
+
|
|
151
|
+
| 落差 | 反模式 | 最佳實踐 |
|
|
152
|
+
|------|--------|----------|
|
|
153
|
+
| **時間落差** | 開發與部署相隔數週 | 開發後數小時內部署 |
|
|
154
|
+
| **人員落差** | 開發者寫程式,Ops 部署 | 撰寫程式的開發者參與部署 |
|
|
155
|
+
| **工具落差** | 不同環境使用不同技術棧 | 所有環境使用相同支援服務 |
|
|
156
|
+
|
|
157
|
+
### 環境一致性清單
|
|
158
|
+
|
|
159
|
+
#### 基礎設施
|
|
160
|
+
- [ ] 所有環境使用相同 OS 系列與版本
|
|
161
|
+
- [ ] 相同容器執行環境與 Orchestrator 版本
|
|
162
|
+
- [ ] 相同網路拓樸(負載平衡器、服務網格)
|
|
163
|
+
- [ ] 相同資源配置比例(暫存 = 正式 × 縮放因子)
|
|
164
|
+
|
|
165
|
+
#### 應用程式
|
|
166
|
+
- [ ] 所有環境部署相同應用程式版本
|
|
167
|
+
- [ ] 相同依賴版本(已提交 lock 檔案)
|
|
168
|
+
- [ ] 相同執行環境版本(Node.js、Python、JVM 等)
|
|
169
|
+
- [ ] 相同建置產物(建置一次,部署各處)
|
|
170
|
+
|
|
171
|
+
#### 資料
|
|
172
|
+
- [ ] 相同資料庫引擎與版本
|
|
173
|
+
- [ ] 相同 Schema 遷移工具
|
|
174
|
+
- [ ] 暫存環境使用實際資料量(匿名化的正式資料)
|
|
175
|
+
- [ ] 相同訊息佇列與快取實作
|
|
176
|
+
|
|
177
|
+
#### 設定
|
|
178
|
+
- [ ] 環境特定值透過環境變數管理
|
|
179
|
+
- [ ] 無環境特定程式碼路徑(不寫 `if (env === 'production')`)
|
|
180
|
+
- [ ] 跨環境使用相同 secret 管理工具
|
|
181
|
+
- [ ] 設定差異已記錄並最小化
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 部署前清單
|
|
186
|
+
|
|
187
|
+
### 1. 程式碼品質
|
|
188
|
+
- [ ] 所有測試通過(單元、整合、E2E)
|
|
189
|
+
- [ ] 程式碼審查已核准
|
|
190
|
+
- [ ] 無嚴重靜態分析警告
|
|
191
|
+
- [ ] 測試覆蓋率未降低
|
|
192
|
+
|
|
193
|
+
### 2. 安全性
|
|
194
|
+
- [ ] 依賴漏洞掃描通過
|
|
195
|
+
- [ ] 程式碼或設定檔中無 secrets
|
|
196
|
+
- [ ] 安全標頭已設定
|
|
197
|
+
- [ ] 驗證/授權變更已審查
|
|
198
|
+
|
|
199
|
+
### 3. 效能
|
|
200
|
+
- [ ] 受影響端點已完成負載測試
|
|
201
|
+
- [ ] 未偵測到效能回歸
|
|
202
|
+
- [ ] 資料庫查詢效能已驗證
|
|
203
|
+
- [ ] 快取失效策略已確認
|
|
204
|
+
|
|
205
|
+
### 4. 資料庫
|
|
206
|
+
- [ ] 遷移腳本在暫存環境測試過
|
|
207
|
+
- [ ] 可用並測試過的回滾遷移
|
|
208
|
+
- [ ] 無破壞性 Schema 變更(除非有向後相容性)
|
|
209
|
+
- [ ] 資料遷移已用正式規模資料量驗證
|
|
210
|
+
|
|
211
|
+
### 5. 設定與依賴
|
|
212
|
+
- [ ] 環境變數已記錄並設定
|
|
213
|
+
- [ ] Feature Flag 已設定正確預設值
|
|
214
|
+
- [ ] 第三方服務依賴已驗證
|
|
215
|
+
- [ ] API 版本相容性已確認
|
|
216
|
+
|
|
217
|
+
### 6. 部署準備
|
|
218
|
+
- [ ] 部署 Runbook 已更新
|
|
219
|
+
- [ ] 回滾程序已記錄並測試
|
|
220
|
+
- [ ] 監控儀表板已準備
|
|
221
|
+
- [ ] 告警閾值已設定
|
|
222
|
+
|
|
223
|
+
### 7. 溝通
|
|
224
|
+
- [ ] 利害關係人已通知部署時間窗口
|
|
225
|
+
- [ ] On-call 工程師已確認並待命
|
|
226
|
+
- [ ] 客戶支援已了解變更內容
|
|
227
|
+
- [ ] 狀態頁面已準備(若為公開服務)
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 防禦性部署順序
|
|
232
|
+
|
|
233
|
+
當部署腳本替換運行中的安裝(常見於 Windows IIS、SystemD 管理服務或任何「停止 → 替換 → 啟動」工作流程的破壞性更新模式),破壞性步驟相對於驗證的順序至關重要。
|
|
54
234
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
235
|
+
### 禁止的順序
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
1. 停止服務
|
|
239
|
+
2. 解壓縮新套件 ← 格式不符時可能靜默空操作
|
|
240
|
+
3. 刪除舊安裝 ← 無條件執行——摧毀運行中的安裝
|
|
241
|
+
4. 複製新安裝 ← 拋出例外(來源不存在)
|
|
242
|
+
5. 啟動服務 ← 無法啟動(Binary 已消失)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
若步驟 2 靜默失敗(損毀的 archive、格式錯誤、磁碟空間不足、權限問題),步驟 3 仍然執行並**摧毀運行中的安裝**,除備份外無法恢復。備份有助於完整回滾,但**無法防止停機**——服務已經中斷。
|
|
246
|
+
|
|
247
|
+
### 必要順序——解壓縮、驗證、再刪除
|
|
248
|
+
|
|
249
|
+
破壞性部署順序**必須**如下:
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
1. 停止服務
|
|
253
|
+
2. 解壓縮新套件 → 暫存區 (不直接覆蓋運行中的安裝)
|
|
254
|
+
3. ✅ 驗證暫存區包含預期的產物
|
|
255
|
+
↑ 若驗證失敗:中止,不要動運行中的安裝
|
|
256
|
+
4. 備份運行中的安裝 (或在稍早完成——兩者皆做更好)
|
|
257
|
+
5. 刪除舊安裝(保留日誌 / 執行期資料)
|
|
258
|
+
6. 從暫存區複製新安裝
|
|
259
|
+
7. 還原保留的設定
|
|
260
|
+
8. 啟動服務
|
|
261
|
+
9. 健全性檢查(HTTP probe / health endpoint)
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**步驟 3 的驗證不可省略。** 最低驗證要求是確認新套件中至少一個已知檔案存在於暫存區。若有可用的 manifest,以雜湊值逐一比對預期檔案為較佳做法。
|
|
265
|
+
|
|
266
|
+
### 驗證程式碼片段
|
|
267
|
+
|
|
268
|
+
**PowerShell**(Windows IIS 部署):
|
|
269
|
+
|
|
270
|
+
```powershell
|
|
271
|
+
$staging = "C:\deploy\staging-$(Get-Date -Format yyyyMMddHHmmss)"
|
|
272
|
+
Expand-Archive -Path $zipPath -DestinationPath $staging -Force
|
|
273
|
+
|
|
274
|
+
# 不可省略:驗證暫存區後再動運行中的安裝
|
|
275
|
+
if (-not (Test-Path "$staging\api\MyApp.dll")) {
|
|
276
|
+
throw "Expected $staging\api\MyApp.dll not found — archive may be corrupt or wrong format. Aborting deploy. Live install untouched."
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
# 直到此時才動運行中的安裝
|
|
280
|
+
Copy-Item "$apiDir" "$backupDir" -Recurse -Force
|
|
281
|
+
Get-ChildItem $apiDir -Exclude logs | Remove-Item -Recurse -Force
|
|
282
|
+
Copy-Item "$staging\api\*" $apiDir -Recurse
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**bash**(Linux SystemD 管理服務):
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
set -euo pipefail
|
|
289
|
+
|
|
290
|
+
STAGING="/srv/deploy/staging-$(date +%Y%m%d%H%M%S)"
|
|
291
|
+
mkdir -p "$STAGING"
|
|
292
|
+
tar -xzf "$ARCHIVE" -C "$STAGING"
|
|
293
|
+
|
|
294
|
+
# 不可省略:驗證暫存區後再動運行中的安裝
|
|
295
|
+
if [ ! -f "$STAGING/bin/myapp" ]; then
|
|
296
|
+
echo "ERROR: Expected $STAGING/bin/myapp not found. Aborting deploy. Live install untouched." >&2
|
|
297
|
+
exit 1
|
|
298
|
+
fi
|
|
299
|
+
|
|
300
|
+
# 直到此時才動運行中的安裝
|
|
301
|
+
systemctl stop myapp
|
|
302
|
+
cp -a "$LIVE_DIR" "$BACKUP_DIR"
|
|
303
|
+
find "$LIVE_DIR" -mindepth 1 -not -path "$LIVE_DIR/logs*" -delete
|
|
304
|
+
cp -a "$STAGING"/* "$LIVE_DIR/"
|
|
305
|
+
systemctl start myapp
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### 涵蓋的失敗模式
|
|
309
|
+
|
|
310
|
+
| 失敗模式 | 保護機制 |
|
|
311
|
+
|---|---|
|
|
312
|
+
| Archive 格式錯誤(例如 tar 改名為 `.zip`) | 步驟 3 驗證失敗——運行中安裝不受影響 |
|
|
313
|
+
| 部分解壓縮(磁碟空間在解壓縮中途用完) | 步驟 3 驗證失敗——運行中安裝不受影響 |
|
|
314
|
+
| Archive 根目錄結構改變(額外的包裝資料夾、缺少關鍵檔案) | 步驟 3 驗證失敗——運行中安裝不受影響 |
|
|
315
|
+
| 權限問題(解壓縮步驟有讀取但沒有寫入權限) | 步驟 3 驗證失敗——運行中安裝不受影響 |
|
|
316
|
+
| 備份腳本本身失敗 | 步驟 4 後的可選次要檢查 |
|
|
317
|
+
|
|
318
|
+
### 上游預防
|
|
319
|
+
|
|
320
|
+
消費端的驗證是最後一道防線。**上游**預防——拒絕在一開始就產生格式錯誤的 archive——由[打包標準 — Archive 格式完整性](packaging-standards.md#archive-格式完整性)涵蓋。兩層合在一起構成縱深防禦;單獨任一層都不足夠。
|
|
321
|
+
|
|
322
|
+
### 失敗模式參考(真實事故)
|
|
323
|
+
|
|
324
|
+
一個 Windows IIS 正式部署腳本(2026-05-24)對 tar 改名的 `.zip` archive 執行 `Expand-Archive`(靜默空操作),接著對運行中的 `apiDir` 執行 `Remove-Item -Recurse`,然後從一個不存在的來源執行 `Copy-Item`(因為什麼都沒有被解壓縮)。運行中的安裝被清除,AppPool 停止,正式環境中斷約 3 分鐘,直到完成基於備份的回滾。若在步驟 3 加入驗證(`Test-Path "$staging/api/MyApp.dll"`),部署就會在暫存階段中止,運行中的安裝不受影響。
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## 部署後清單
|
|
329
|
+
|
|
330
|
+
### 立即(< 5 分鐘)
|
|
331
|
+
|
|
332
|
+
- [ ] Health check endpoint 回傳 200
|
|
333
|
+
- [ ] 應用程式日誌未顯示錯誤
|
|
334
|
+
- [ ] 關鍵業務指標未變(訂單、註冊等)
|
|
335
|
+
- [ ] 監控儀表板顯示正常模式
|
|
336
|
+
|
|
337
|
+
### 短期(< 1 小時)
|
|
338
|
+
|
|
339
|
+
- [ ] 錯誤率在可接受閾值內(< 0.1%)
|
|
340
|
+
- [ ] 回應時間符合 SLA(p95 < 目標值)
|
|
341
|
+
- [ ] 客戶支援工單無增加
|
|
342
|
+
- [ ] 資料庫效能穩定
|
|
343
|
+
|
|
344
|
+
### 中期(< 24 小時)
|
|
345
|
+
|
|
346
|
+
- [ ] 批次任務成功完成
|
|
347
|
+
- [ ] 資料一致性已驗證
|
|
348
|
+
- [ ] 無記憶體洩漏或資源降級
|
|
349
|
+
- [ ] Feature Flag 漸進推出進度正常
|
|
350
|
+
|
|
351
|
+
### 長期(< 1 週)
|
|
352
|
+
|
|
353
|
+
- [ ] Feature Flag 清理已排程
|
|
354
|
+
- [ ] 部署回顧會議已完成
|
|
355
|
+
- [ ] 監控閾值已視需要調整
|
|
356
|
+
- [ ] 文件已更新並記錄學習心得
|
|
357
|
+
|
|
358
|
+
---
|
|
61
359
|
|
|
62
360
|
## 部署驗證
|
|
63
361
|
|
|
@@ -83,6 +381,11 @@ status: current
|
|
|
83
381
|
| **Rolling** | 整個上線期間 | 每批次 Health check |
|
|
84
382
|
| **Feature Flag** | 首次啟用 24 小時 | 業務指標、使用者回饋 |
|
|
85
383
|
|
|
384
|
+
觀測期間:
|
|
385
|
+
- 自動監控必須處於啟用狀態
|
|
386
|
+
- 回滾能力必須保持可用
|
|
387
|
+
- 不應對相同服務進行額外部署
|
|
388
|
+
|
|
86
389
|
### Smoke Test 要求
|
|
87
390
|
|
|
88
391
|
部署後 Smoke Test 必須自動執行,至少涵蓋:
|
|
@@ -99,12 +402,47 @@ Smoke Test 失敗必須阻擋部署並觸發 rollback。
|
|
|
99
402
|
|
|
100
403
|
---
|
|
101
404
|
|
|
405
|
+
## DORA 指標
|
|
406
|
+
|
|
407
|
+
| 指標 | 菁英水準 | 高水準 | 中水準 | 低水準 |
|
|
408
|
+
|------|----------|--------|--------|--------|
|
|
409
|
+
| **部署頻率** | 隨需(每天多次) | 每週至每月 | 每月至每半年 | 每半年至每年 |
|
|
410
|
+
| **變更前置時間** | < 1 小時 | 1 天至 1 週 | 1 週至 1 個月 | 1 至 6 個月 |
|
|
411
|
+
| **變更失敗率** | < 5% | 5-10% | 10-15% | > 15% |
|
|
412
|
+
| **平均恢復時間 (MTTR)** | < 1 小時 | < 1 天 | < 1 週 | > 1 週 |
|
|
413
|
+
|
|
414
|
+
### 追蹤建議
|
|
415
|
+
|
|
416
|
+
| 指標 | 資料來源 | 工具範例 |
|
|
417
|
+
|------|----------|----------|
|
|
418
|
+
| **部署頻率** | CI/CD pipeline 事件 | GitHub Actions、GitLab CI、Jenkins |
|
|
419
|
+
| **前置時間** | 首次提交 → 正式部署 | Git log + 部署時間戳記 |
|
|
420
|
+
| **變更失敗率** | 回滾次數 / 總部署次數 | 事故追蹤 + 部署日誌 |
|
|
421
|
+
| **MTTR** | 事故開始 → 解決 | PagerDuty、Opsgenie、事故日誌 |
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
102
425
|
## 相關標準
|
|
103
426
|
|
|
104
|
-
- [
|
|
105
|
-
- [
|
|
106
|
-
- [
|
|
107
|
-
- [
|
|
108
|
-
- [Changelog 標準](changelog-standards.md)
|
|
109
|
-
- [Git 工作流標準](git-workflow.md)
|
|
110
|
-
- [
|
|
427
|
+
- [程式碼簽入標準](checkin-standards.md) — 部署前品質關卡
|
|
428
|
+
- [測試標準](testing-standards.md) — 部署準備的測試需求
|
|
429
|
+
- [安全標準](security-standards.md) — 部署安全清單
|
|
430
|
+
- [效能標準](performance-standards.md) — 部署前效能驗證
|
|
431
|
+
- [Changelog 標準](changelog-standards.md) — 記錄已部署變更
|
|
432
|
+
- [Git 工作流標準](git-workflow.md) — 分支策略與發布流程
|
|
433
|
+
- [版本控制標準](versioning.md) — 發布版本號碼
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## 版本歷史
|
|
438
|
+
|
|
439
|
+
| 版本 | 日期 | 變更 |
|
|
440
|
+
|------|------|------|
|
|
441
|
+
| 1.1.0 | 2026-05-26 | 新增:防禦性部署順序章節——必要的解壓縮-驗證-再刪除順序、PowerShell + bash 驗證程式碼片段、失敗模式對照表、交叉連結至打包標準 Archive 格式完整性(XSPEC-231 / 關閉 issue #110) |
|
|
442
|
+
| 1.0.0 | 2026-02-09 | 初始發行 |
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## 授權
|
|
447
|
+
|
|
448
|
+
本標準以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權發布。
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../../core/deprecation-standards.md
|
|
3
|
-
source_version: 1.
|
|
4
|
-
translation_version: 1.
|
|
5
|
-
last_synced: 2026-
|
|
3
|
+
source_version: 1.1.0
|
|
4
|
+
translation_version: 1.1.0
|
|
5
|
+
last_synced: 2026-06-24
|
|
6
6
|
status: current
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# 棄用與日落標準
|
|
10
10
|
|
|
11
|
-
> 版本: 1.
|
|
11
|
+
> 版本: 1.1.0 | 最後更新: 2026-06-24
|
|
12
12
|
|
|
13
13
|
## 概述
|
|
14
14
|
|
|
@@ -43,6 +43,19 @@ Link: <https://api.example.com/v3/docs>; rel="successor-version"
|
|
|
43
43
|
- 新版本 GA 後 **6 個月**
|
|
44
44
|
- 最後一個活躍消費者完成遷移後 **3 個月**
|
|
45
45
|
|
|
46
|
+
### 依 API 分級的最短棄用期間
|
|
47
|
+
|
|
48
|
+
上方的 6 階段 Sunset 時間線呈現的是**公開 API 的預設節奏**(從宣布到日落約 6 個月通知期)。*最短*棄用期間會隨 API 的受眾與關鍵程度而調整。請取下表的分級最低值與上方版本平行期兩者中**較長者**:
|
|
49
|
+
|
|
50
|
+
| API 分級 | 最短棄用期間 |
|
|
51
|
+
|----------|--------------|
|
|
52
|
+
| **內部 API** | 1 個 minor 版本 |
|
|
53
|
+
| **合作夥伴 API** | 2 個 minor 版本 + 3 個月 |
|
|
54
|
+
| **公開 API** | 2 個 minor 版本 + 6 個月 |
|
|
55
|
+
| **關鍵基礎設施** | 最少 1 年 |
|
|
56
|
+
|
|
57
|
+
以上皆為最低值;SLA 或合約義務可能要求更長的期間(見[功能日落 → 影響分析](#影響分析-5-維度))。何謂觸發棄用的破壞性變更、以及 API 版本化機制本身,則歸[API 設計標準](api-design-standards.md#api-版本控制策略)——本標準僅就棄用時間線與這些通知期間作為單一真實來源。
|
|
58
|
+
|
|
46
59
|
---
|
|
47
60
|
|
|
48
61
|
## 消費者通知策略
|
|
@@ -3,7 +3,7 @@ source: ../../../core/developer-memory.md
|
|
|
3
3
|
source_version: 1.0.0
|
|
4
4
|
translation_version: 1.0.0
|
|
5
5
|
last_synced: 2026-02-07
|
|
6
|
-
status:
|
|
6
|
+
status: stale
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# 開發者持久記憶標準
|
|
@@ -528,7 +528,7 @@ by_category:
|
|
|
528
528
|
|
|
529
529
|
| 模式 | 特性 | 範例 | 需要 Skill? |
|
|
530
530
|
|------|------|------|------------|
|
|
531
|
-
| **使用者觸發** | 使用者明確調用、多步驟引導式工作流 | `/commit`、`/review`、`/sdd` | 是 |
|
|
531
|
+
| **使用者觸發** | 使用者明確調用、多步驟引導式工作流 | `/commit`、`/code-review`、`/sdd` | 是 |
|
|
532
532
|
| **Always-On Protocol** | AI 載入 ai.yaml 後持續遵循規則 | 反幻覺、開發者記憶 | 否 |
|
|
533
533
|
|
|
534
534
|
### 理由:不需要 CLI / Skill / 斜線命令
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/disaster-recovery-drill.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2026-06-10
|
|
6
|
+
source_hash: c97a5f4a554b
|
|
7
|
+
status: current
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 災難復原演練標準
|
|
11
|
+
|
|
12
|
+
> **Language**: [English](../../../core/disaster-recovery-drill.md) | 繁體中文
|
|
13
|
+
|
|
14
|
+
## 概述
|
|
15
|
+
|
|
16
|
+
未經測試的 DR 計畫只是虛假的安全感。從未在壓力下實際執行過復原 runbook 的團隊,會在最糟糕的時間點才發現缺口。DR 演練能安全地暴露這些缺口。
|
|
17
|
+
|
|
18
|
+
## RTO/RPO 目標
|
|
19
|
+
|
|
20
|
+
在撰寫 runbook 之前先定義這些指標:
|
|
21
|
+
|
|
22
|
+
| 指標 | 定義 | 商用等級目標 |
|
|
23
|
+
|--------|-----------|--------------------------|
|
|
24
|
+
| RTO (Recovery Time Objective) | 可接受的最大停機時間 | < 1 小時 |
|
|
25
|
+
| RPO (Recovery Point Objective) | 可接受的最大資料遺失量 | < 24 小時(每日備份) |
|
|
26
|
+
|
|
27
|
+
## 備份還原腳本
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
#!/usr/bin/env bash
|
|
31
|
+
# scripts/backup-restore.sh — DR drill backup restore verification
|
|
32
|
+
set -euo pipefail
|
|
33
|
+
|
|
34
|
+
BACKUP_DIR="${BACKUP_DIR:-/var/backups/app}"
|
|
35
|
+
RESTORE_DIR="${RESTORE_DIR:-/tmp/dr-restore}"
|
|
36
|
+
DB_FILE="${DB_FILE:-app.db}"
|
|
37
|
+
|
|
38
|
+
echo "=== DR Drill: Backup Restore Verification ==="
|
|
39
|
+
echo "Source: ${BACKUP_DIR}/${DB_FILE}.backup"
|
|
40
|
+
echo "Target: ${RESTORE_DIR}/${DB_FILE}"
|
|
41
|
+
|
|
42
|
+
mkdir -p "$RESTORE_DIR"
|
|
43
|
+
|
|
44
|
+
# Find latest backup
|
|
45
|
+
LATEST=$(ls -t "${BACKUP_DIR}"/*.backup 2>/dev/null | head -1)
|
|
46
|
+
if [[ -z "$LATEST" ]]; then
|
|
47
|
+
echo "FAIL: No backup found in ${BACKUP_DIR}"
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# Restore
|
|
52
|
+
cp "$LATEST" "${RESTORE_DIR}/${DB_FILE}"
|
|
53
|
+
|
|
54
|
+
# Verify integrity (SQLite)
|
|
55
|
+
if command -v sqlite3 >/dev/null 2>&1; then
|
|
56
|
+
sqlite3 "${RESTORE_DIR}/${DB_FILE}" "PRAGMA integrity_check;" | grep -q "ok" && \
|
|
57
|
+
echo "OK: Database integrity check passed" || \
|
|
58
|
+
{ echo "FAIL: Integrity check failed"; exit 1; }
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
BACKUP_AGE=$(( ($(date +%s) - $(stat -c %Y "$LATEST" 2>/dev/null || stat -f %m "$LATEST")) / 3600 ))
|
|
62
|
+
echo "OK: Backup age: ${BACKUP_AGE} hours (RPO target: 24h)"
|
|
63
|
+
|
|
64
|
+
echo "=== PASS: Restore complete ==="
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Game Day 協議
|
|
68
|
+
|
|
69
|
+
1. **公告(Announce)**:提前一週通知團隊,定義演練範圍
|
|
70
|
+
2. **基準(Baseline)**:記錄目前系統狀態
|
|
71
|
+
3. **注入(Inject)**:模擬故障(重新命名/刪除 DB、kill process 等)
|
|
72
|
+
4. **執行(Execute)**:團隊從頭遵循 runbook 操作——不准抄捷徑
|
|
73
|
+
5. **量測(Measure)**:記錄 RTO、RPO 與遭遇到的問題
|
|
74
|
+
6. **回顧(Retrospective)**:哪裡不夠清楚?哪裡有遺漏?
|
|
75
|
+
|
|
76
|
+
## Runbook 範本
|
|
77
|
+
|
|
78
|
+
完整 runbook 範本請見 `docs/DR-RUNBOOK.md`。
|
|
79
|
+
|
|
80
|
+
## 相關標準
|
|
81
|
+
|
|
82
|
+
- [Deployment Standards](deployment-standards.md) — 部署管線
|
|
83
|
+
- [Chaos Engineering Standards](chaos-engineering-standards.md) — 故障注入
|
|
84
|
+
- [Verification Evidence Standards](verification-evidence.md) — 演練紀錄
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
**Scope**: universal
|
|
@@ -769,7 +769,7 @@ project-root/
|
|
|
769
769
|
| 需求 | 描述 | 範例 |
|
|
770
770
|
|------|------|------|
|
|
771
771
|
| **淺顯語言** | 使用清晰、簡單的語言;目標為 8 年級閱讀程度 | 避免:「utilize」→ 使用:「use」 |
|
|
772
|
-
| **圖片替代文字** | 為所有非裝飾性圖片提供描述性替代文字 | `` |
|
|
772
|
+
| **圖片替代文字** | 為所有非裝飾性圖片提供描述性替代文字 | `` |
|
|
773
773
|
| **標題層級** | 使用正確的標題層級(h1→h2→h3),不跳級 | 不要從 `#` 直接跳到 `###` |
|
|
774
774
|
| **連結文字** | 使用描述性連結文字,而非「點此」 | 避免:[點此] → 使用:[安裝指南] |
|
|
775
775
|
| **程式碼區塊** | 使用帶語言標示的圍欄式程式碼區塊 | ` ```javascript ` 而非 ` ``` ` |
|
|
@@ -3,7 +3,7 @@ source: ../../../core/error-code-standards.md
|
|
|
3
3
|
source_version: 1.2.0
|
|
4
4
|
translation_version: 1.2.0
|
|
5
5
|
last_synced: 2026-03-18
|
|
6
|
-
status:
|
|
6
|
+
status: stale
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# 錯誤碼標準
|
|
@@ -579,7 +579,7 @@ AUTH_VAL_001
|
|
|
579
579
|
|
|
580
580
|
**相關標準:**
|
|
581
581
|
- [日誌標準](logging-standards.md) - 錯誤日誌實踐
|
|
582
|
-
- [API 文件標準](api-
|
|
582
|
+
- [API 文件標準](api-design-standards.md) - 錯誤回應文件
|
|
583
583
|
|
|
584
584
|
---
|
|
585
585
|
|