universal-dev-standards 5.17.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/uds.js +13 -135
- package/bundled/ai/options/commit-message/bilingual.ai.yaml +19 -1
- 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 +3 -3
- 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/documentation-writing-standards.ai.yaml +1 -1
- 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/frontend-design-standards.ai.yaml +33 -3
- 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/push-standards.ai.yaml +14 -3
- package/bundled/ai/standards/refactoring-standards.ai.yaml +68 -3
- package/bundled/ai/standards/requirement-engineering.ai.yaml +42 -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/self-review-protocol.ai.yaml +15 -10
- 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-evidence.ai.yaml +88 -5
- 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 +10 -3
- 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 +2 -2
- package/bundled/core/error-code-standards.md +4 -3
- package/bundled/core/feature-discovery-standards.md +191 -0
- 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/frontend-design-standards.md +93 -4
- 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/multi-environment-e2e-testing.md +195 -0
- 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/push-standards.md +82 -0
- package/bundled/core/refactoring-standards.md +44 -3
- package/bundled/core/replay-test.md +1 -1
- package/bundled/core/requirement-engineering.md +2 -2
- 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 +15 -10
- 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/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-evidence.md +170 -10
- package/bundled/core/verification-oracle.md +167 -0
- package/bundled/core/versioning.md +133 -109
- package/bundled/locales/COVERAGE.md +94 -77
- package/bundled/locales/zh-CN/CHANGELOG.md +94 -6
- package/bundled/locales/zh-CN/CLAUDE.md +1 -1
- package/bundled/locales/zh-CN/MAINTENANCE.md +42 -661
- package/bundled/locales/zh-CN/README.md +25 -12
- package/bundled/locales/zh-CN/SECURITY.md +2 -2
- package/bundled/locales/zh-CN/adoption/DAILY-WORKFLOW-GUIDE.md +2 -2
- package/bundled/locales/zh-CN/ai/options/commit-message/bilingual.ai.yaml +6 -1
- 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 +239 -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 +200 -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/frontend-design-standards.md +1 -1
- package/bundled/locales/zh-CN/core/full-coverage-testing.md +269 -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 +131 -0
- package/bundled/locales/zh-CN/core/llm-output-validation.md +192 -0
- package/bundled/locales/zh-CN/core/logging-standards.md +205 -7
- package/bundled/locales/zh-CN/core/mock-boundary.md +161 -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 +77 -5
- package/bundled/locales/zh-CN/core/pipeline-security-gates.md +146 -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/requirement-engineering.md +1 -1
- 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 +113 -0
- package/bundled/locales/zh-CN/core/self-review-protocol.md +172 -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 +39 -3
- package/bundled/locales/zh-CN/core/supply-chain-attestation.md +131 -0
- package/bundled/locales/zh-CN/core/verification-evidence.md +252 -41
- package/bundled/locales/zh-CN/core/versioning.md +1 -1
- package/bundled/locales/zh-CN/docs/CHEATSHEET.md +36 -7
- package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +71 -53
- 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/commit-message/bilingual.md +10 -3
- 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 +115 -17
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/guide.md +37 -12
- 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 +169 -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 +94 -6
- package/bundled/locales/zh-TW/CLAUDE.md +1 -1
- package/bundled/locales/zh-TW/MAINTENANCE.md +51 -4
- package/bundled/locales/zh-TW/README.md +25 -12
- package/bundled/locales/zh-TW/SECURITY.md +2 -2
- package/bundled/locales/zh-TW/adoption/DAILY-WORKFLOW-GUIDE.md +2 -2
- package/bundled/locales/zh-TW/ai/options/commit-message/bilingual.ai.yaml +6 -1
- 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/frontend-design-standards.md +1 -1
- 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 +131 -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 +77 -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 +146 -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/requirement-engineering.md +1 -1
- 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 +113 -0
- package/bundled/locales/zh-TW/core/self-review-protocol.md +18 -13
- 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 +19 -11
- 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-evidence.md +260 -31
- 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 +36 -7
- package/bundled/locales/zh-TW/docs/DEV-WORKFLOW-MAPPING.md +6 -6
- package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +71 -53
- 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/commit-message/bilingual.md +10 -3
- 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 +116 -18
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/guide.md +38 -11
- 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 +52 -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 +139 -15
- package/bundled/skills/brainstorm-assistant/guide.md +39 -8
- 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 +13 -2
- 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 +4 -4
- 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 +168 -75
- 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 +61 -149
- 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,335 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/behavior-snapshot.md
|
|
3
|
+
source_version: 1.1.0
|
|
4
|
+
translation_version: 1.1.0
|
|
5
|
+
last_synced: 2026-06-28
|
|
6
|
+
source_hash: 36a3683ae75b
|
|
7
|
+
status: current
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 行为快照标准
|
|
11
|
+
|
|
12
|
+
> **语言**: [English](../../../core/behavior-snapshot.md) | [繁體中文](../../zh-TW/core/behavior-snapshot.md) | 简体中文
|
|
13
|
+
|
|
14
|
+
**适用范围**:需要行为一致性验证的迁移与重构项目
|
|
15
|
+
**Scope**: universal
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 概述
|
|
20
|
+
|
|
21
|
+
行为快照标准定义了一种黄金文件格式,用于记录现有系统的 HTTP 请求/响应配对。这些快照有两个用途:
|
|
22
|
+
|
|
23
|
+
1. **迁移一致性基准线** — 验证新系统能重现与旧系统相同的行为
|
|
24
|
+
2. **重构特性化** — 在修改代码前锁定现有行为(Gate 0 协议)
|
|
25
|
+
|
|
26
|
+
## 参考资料
|
|
27
|
+
|
|
28
|
+
| 标准/来源 | 内容 |
|
|
29
|
+
|----------------|---------|
|
|
30
|
+
| XSPEC-201 | 重构/迁移完整性协议 |
|
|
31
|
+
| Michael Feathers: *Working Effectively with Legacy Code* | 特性化测试概念 |
|
|
32
|
+
| Golden Master Testing | 记录并重放预期输出的模式 |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 快照文件格式
|
|
37
|
+
|
|
38
|
+
### 位置
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
.snapshots/<feature-id>/<scenario>.json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Schema
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"feature_id": "FM-007",
|
|
49
|
+
"scenario": "happy_path",
|
|
50
|
+
"request": {
|
|
51
|
+
"method": "POST",
|
|
52
|
+
"path": "/api/orders/123/cancel",
|
|
53
|
+
"headers": {
|
|
54
|
+
"Content-Type": "application/json"
|
|
55
|
+
},
|
|
56
|
+
"body": {
|
|
57
|
+
"reason": "customer_request"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"response": {
|
|
61
|
+
"status": 200,
|
|
62
|
+
"body": {
|
|
63
|
+
"success": true,
|
|
64
|
+
"order_status": "cancelled",
|
|
65
|
+
"refund_initiated": true
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"ignore_fields": ["refund_id", "cancelled_at"]
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 字段参考
|
|
73
|
+
|
|
74
|
+
| 字段 | 必填 | 说明 |
|
|
75
|
+
|-------|----------|-------------|
|
|
76
|
+
| `feature_id` | 是 | feature-manifest.yaml 中的 `FM-NNN` |
|
|
77
|
+
| `scenario` | 是 | `snake_case` 场景名称(`happy_path`、`not_found` 等) |
|
|
78
|
+
| `request.method` | 是 | HTTP 方法 |
|
|
79
|
+
| `request.path` | 是 | 不含 base URL 的 URL 路径 |
|
|
80
|
+
| `request.headers` | 否 | 请求所需的请求头(不含真实认证 token) |
|
|
81
|
+
| `request.body` | 否 | 请求体(JSON) |
|
|
82
|
+
| `response.status` | 是 | 预期的 HTTP 状态码 |
|
|
83
|
+
| `response.body` | 是 | 预期的响应体(比较用字段) |
|
|
84
|
+
| `ignore_fields` | 否 | 比较时跳过的字段(详见下方指南) |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 目录结构
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
.snapshots/
|
|
92
|
+
FM-001-UserLogin/
|
|
93
|
+
happy_path.json
|
|
94
|
+
invalid_credentials.json
|
|
95
|
+
account_locked.json
|
|
96
|
+
FM-007-OrderCancellation/
|
|
97
|
+
happy_path.json
|
|
98
|
+
order_not_found.json
|
|
99
|
+
order_already_cancelled.json
|
|
100
|
+
MANUAL-refund_webhook.json ← 手动编写
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### MANUAL- 前缀
|
|
104
|
+
|
|
105
|
+
以 `MANUAL-` 为前缀的文件包含无法自动录制的快照:
|
|
106
|
+
- 由第三方触发的 Webhook 端点
|
|
107
|
+
- 需要特定、难以重现的数据库状态的场景
|
|
108
|
+
- 后台任务 / 队列触发流程(非 HTTP 入口点)
|
|
109
|
+
|
|
110
|
+
`MANUAL-` 文件不纳入自动重放,但计入覆盖率报告。
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## `ignore_fields` 使用指南
|
|
115
|
+
|
|
116
|
+
> **核心原则 —— 忽略「值」,保留「格式」断言。** 某字段是非确定性的,意指它的*值*在每次执行间会改变;这**并不**代表该字段的*形状*可以自由变动。`ignore_fields` 的天真用法会把整个字段排除在比较之外,连带也停止断言其格式 —— 于是当序列化器悄悄把 ISO-8601 时间戳改成 Unix epoch、拿掉时区、或变更 UUID 大小写/版本时,皆无人察觉。**忽略其值,但仍断言其格式。**
|
|
117
|
+
|
|
118
|
+
### 忽略值 vs. 忽略格式
|
|
119
|
+
|
|
120
|
+
| 字段 | 天真做法:整字段忽略 | 建议做法:忽略值、断言格式 |
|
|
121
|
+
|-------|---------------------------|-------------------------------------------|
|
|
122
|
+
| `created_at` | 完全不比较 | 忽略其值;但仍断言它是 ISO-8601、且维持相同的小数秒精度与相同的时区表示 |
|
|
123
|
+
| `trace_id` | 完全不比较 | 忽略其值;但仍断言它符合 UUID 版本与标准 8-4-4-4-12 形状 |
|
|
124
|
+
| `token` | 完全不比较 | 忽略其值;但仍断言长度、字符集与前缀 |
|
|
125
|
+
|
|
126
|
+
### 非确定性字段:忽略值、断言格式
|
|
127
|
+
|
|
128
|
+
| 字段模式 | 忽略(值) | 仍须断言(格式/形状) |
|
|
129
|
+
|--------------|--------------------|-------------------------------|
|
|
130
|
+
| `created_at`、`updated_at`、`timestamp` | 该瞬时 | ISO-8601 vs. epoch vs. 自定义;小数秒精度(位数);时区表示(`Z` vs `+00:00` vs 偏移量) |
|
|
131
|
+
| `token`、`session_id`、`csrf_token` | 随机字节 | 长度、字符集、前缀 |
|
|
132
|
+
| `request_id`、`trace_id`、`correlation_id` | 随机 UUID | UUID 版本 + 标准 8-4-4-4-12 形状与大小写 |
|
|
133
|
+
|
|
134
|
+
**时间字段示例。** 某迁移后的端点返回 `created_at`:
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
旧系统:"2026-05-12T08:30:00Z"
|
|
138
|
+
新系统:"2026-05-12T08:30:00.000+00:00"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
两者解码后是同一瞬时,因此整字段忽略 —— 甚至是「先 parse 成日期再比值」 —— 都会通过。但**序列化格式已漂移**:多了小数秒、且时区表示从 `Z` 变成 `+00:00`。对采字符串比对、或以严格格式 parse 的客户端而言,这在正式环境会坏掉。断言格式 pattern(例如 `^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$`)能抓到它;整字段忽略则会遮蔽它。
|
|
142
|
+
|
|
143
|
+
### 始终比较(业务逻辑)
|
|
144
|
+
|
|
145
|
+
| 字段模式 | 原因 |
|
|
146
|
+
|--------------|--------|
|
|
147
|
+
| `status`、`code`、`message`、`error_code` | 核心业务结果 |
|
|
148
|
+
| `order_status`、`payment_status` | 状态机结果 |
|
|
149
|
+
| `amount`、`quantity`、`price` | 计算后的业务数值 |
|
|
150
|
+
| `success`、`refunded`、`cancelled` | 布尔业务结果 |
|
|
151
|
+
| `user_id`、`order_id`(搭配固定测试数据) | 引用完整性 |
|
|
152
|
+
|
|
153
|
+
### 整字段忽略(例外 —— 须附理由)
|
|
154
|
+
|
|
155
|
+
把字段完全排除在比较之外 —— 既不比值、**也不**断言格式 —— 是**例外**,非默认。仅在字段格式确实未定义或无关紧要时保留此做法(例如不透明的厂商 blob),并在行内注明理由。
|
|
156
|
+
|
|
157
|
+
> ⚠️ **风险**:整字段忽略会遮蔽**格式漂移**。改变精度或时区的时间戳、改变版本的 UUID、或多了/少了一个尾零的数字都会悄悄通过 —— 而这正是一致性测试本应抓到的那类 bug。
|
|
158
|
+
|
|
159
|
+
**规则**:`ignore_fields` 仅用于确实不确定性的*值*。忽略其值的同时,仍须断言该字段的格式/形状。用它来排除业务逻辑字段 —— 或用它来消音非确定性字段的格式漂移 —— 都会使一致性测试失去意义。
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 序列化格式对等
|
|
164
|
+
|
|
165
|
+
只比较**反序列化后对象**的差分 oracle,会悄悄把序列化层级的差异 normalize 掉:它把两边的响应都 parse 成 map/对象再比较,于是任何在 parse 后消失的分歧都看不见了。要抓到序列化 bug,oracle 必须以能保留序列化形式的粒度比较 —— 要么比对**原始序列化字符串**,要么明确断言 JSON 形状。
|
|
166
|
+
|
|
167
|
+
### 比较反序列化对象会遮蔽什么
|
|
168
|
+
|
|
169
|
+
| 序列化分歧 | 比较 parse 后对象时会被遮蔽吗? |
|
|
170
|
+
|--------------------------|------------------------------------------|
|
|
171
|
+
| `1` vs `1.0`(数字格式) | 会 —— 两者都 parse 成数字 `1` |
|
|
172
|
+
| `null` vs 缺少该 key | 会 —— 两者都读成不存在/null |
|
|
173
|
+
| `true` vs `1` vs `"true"` | 常会 —— 类型强制转换后 |
|
|
174
|
+
| key 排序 | 会 —— 对象 key 无序 |
|
|
175
|
+
| 前导零/科学记数法 | 会 —— parse 时被 normalize |
|
|
176
|
+
| 空白与 Unicode 转义(`\/`、`\uXXXX`) | 会 —— parse 时丢失 |
|
|
177
|
+
|
|
178
|
+
### 两种策略
|
|
179
|
+
|
|
180
|
+
1. **原始字符串比对** —— 比对精确的序列化字符串。保真度最强;当 wire 格式属于契约一部分时采用(公开 API、被缓存的 payload、签名过的 body)。
|
|
181
|
+
2. **明确的 JSON 形状断言** —— 当原始比对太严格时(例如确实有非确定性的值),改为明确断言形状:
|
|
182
|
+
- **key 的存在性与顺序**(当顺序属于契约时)
|
|
183
|
+
- **数字格式**:`1` vs `1.0`、前导零、科学记数法
|
|
184
|
+
- **`null` vs 缺漏 key**(省略字段不等于明确的 `null`)
|
|
185
|
+
- **布尔/字符串类型**:`true` vs `"true"` vs `1`
|
|
186
|
+
|
|
187
|
+
### 跨语言重写会换掉序列化器
|
|
188
|
+
|
|
189
|
+
当系统以另一种语言重写时,序列化器会换 —— 而各序列化器的**默认行为**不同。oracle 必须明确断言这些,因为没有其他东西会帮你抓。PHP `json_encode` ↔ C# `System.Text.Json` 常见的默认差异:
|
|
190
|
+
|
|
191
|
+
| 关注点 | PHP `json_encode`(默认) | C# `System.Text.Json`(默认) |
|
|
192
|
+
|---------|------------------------------|----------------------------------|
|
|
193
|
+
| 数字尾零 | `(float) 1.0` 输出 `1`;需 `JSON_PRESERVE_ZERO_FRACTION` 才保留 `1.0` | `double` `1.0` 序列化成 `1`;`decimal` 保留小数位 |
|
|
194
|
+
| 日期/时间 | 无原生日期类型 —— 由应用决定(常是自定义字符串或 epoch) | `DateTime`/`DateTimeOffset` → ISO-8601(round-trip "O"),例如 `2026-05-12T08:30:00+00:00` |
|
|
195
|
+
| 时区 | 由应用决定 | `DateTimeOffset` 保留偏移量;`DateTime.Kind` 决定 `Z` vs 偏移量 |
|
|
196
|
+
| `null` 属性 | 以 `"k":null` 输出 | 默认输出;仅在 `DefaultIgnoreCondition.WhenWritingNull` 时省略 |
|
|
197
|
+
| key 排序 | 插入顺序(associative array) | 属性声明/反射顺序 |
|
|
198
|
+
| 斜杠与 Unicode 转义 | 默认转义 `/` 与非 ASCII,除非设 `JSON_UNESCAPED_SLASHES` / `JSON_UNESCAPED_UNICODE` | 不转义 `/`;非 ASCII 依所配置的 encoder 转义 |
|
|
199
|
+
|
|
200
|
+
### 断言序列化形状(TypeScript)
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
// 超越值的对等:断言序列化形式,而不只是 parse 后的对象。
|
|
204
|
+
function assertSerializationParity(oldRaw: string, newRaw: string): void {
|
|
205
|
+
// 1. 最强:精确的序列化字符串(只剥除被忽略的*值*之后)。
|
|
206
|
+
if (oldRaw === newRaw) return;
|
|
207
|
+
|
|
208
|
+
// 2. 否则在原始文本上明确断言形状,而非在 JSON.parse() 上:
|
|
209
|
+
// 数字格式 —— 旧的 "1.0" 不可悄悄变成新的 "1"
|
|
210
|
+
const numberShape = (s: string) => s.match(/:\s*-?\d+(\.\d+)?([eE][+-]?\d+)?/g) ?? [];
|
|
211
|
+
expect(numberShape(newRaw)).toEqual(numberShape(oldRaw));
|
|
212
|
+
|
|
213
|
+
// null vs 缺漏 —— 明确的 "key":null 不可消失
|
|
214
|
+
expect(/"refund_id"\s*:\s*null/.test(newRaw))
|
|
215
|
+
.toBe(/"refund_id"\s*:\s*null/.test(oldRaw));
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## 一致性检查工具
|
|
222
|
+
|
|
223
|
+
执行 `scripts/parity-check.ts` 对目标系统重放所有快照:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
npx tsx scripts/parity-check.ts --url http://new-system:8080 [--snapshots .snapshots] [--env uat|staging]
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### 输出示例
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
🔄 Parity Check — 119 snapshots against http://new-system:8080
|
|
233
|
+
|
|
234
|
+
✅ FM-001 / happy_path
|
|
235
|
+
✅ FM-001 / invalid_credentials
|
|
236
|
+
❌ [PARITY-FAIL] FM-007 / happy_path
|
|
237
|
+
body.order_status: expected "cancelled", got "pending"
|
|
238
|
+
body.refund_initiated: expected true, got false
|
|
239
|
+
|
|
240
|
+
─────────────────────────────────
|
|
241
|
+
Parity Results: 118/119 passed (99.2%)
|
|
242
|
+
|
|
243
|
+
❌ 1 parity check(s) failed.
|
|
244
|
+
[PARITY-BLOCK] UAT/production deployment blocked. Fix parity failures first.
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### 退出码
|
|
248
|
+
|
|
249
|
+
| 代码 | 含义 |
|
|
250
|
+
|------|---------|
|
|
251
|
+
| 0 | 所有快照通过 |
|
|
252
|
+
| 1 | 发现失败 + `--env uat` 或 `production` → 部署被阻止 |
|
|
253
|
+
| 2 | 发现失败 + `--env staging` → 仅警告 |
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Gate 0:特性化测试协议(重构)
|
|
258
|
+
|
|
259
|
+
在开始任何重构之前,特性化测试必须存在且通过。
|
|
260
|
+
|
|
261
|
+
### 什么是特性化测试?
|
|
262
|
+
|
|
263
|
+
特性化测试记录现有代码*实际的行为*——而非它*应有的行为*。它们在修改开始前锁定可观察的行为。若重构期间特性化测试失败,代表行为发生了非预期的变更。
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
describe('characterization: OrderService.cancelOrder', () => {
|
|
267
|
+
// @characterization
|
|
268
|
+
it('returns status cancelled and sets refund_initiated=true for valid order', async () => {
|
|
269
|
+
const result = await orderService.cancelOrder('test-order-123', 'customer_request');
|
|
270
|
+
expect(result.order_status).toBe('cancelled');
|
|
271
|
+
expect(result.refund_initiated).toBe(true);
|
|
272
|
+
});
|
|
273
|
+
});
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Gate 0 强制执行
|
|
277
|
+
|
|
278
|
+
1. **第一次重构 commit 前**:执行 `npm test -- --grep characterization`
|
|
279
|
+
- 任何失败 → 停止。先修复现有代码,再进行修改。
|
|
280
|
+
2. **重构期间**:每次 commit 重新执行特性化测试
|
|
281
|
+
- 任何失败 → 立即警告行为偏移
|
|
282
|
+
3. **Gate 2(完成)**:所有特性化测试通过 → 重构完成
|
|
283
|
+
|
|
284
|
+
### 反模式警告
|
|
285
|
+
|
|
286
|
+
> 绝不要在没有 Gate 0 的情况下开始重构。一旦开始修改代码,就无法判断测试失败究竟是「我破坏了某些东西」还是「测试对旧行为的描述有误」。
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## 与迁移 Pipeline 集成
|
|
291
|
+
|
|
292
|
+
### Gate 1 预飞行(`--variant migration`)
|
|
293
|
+
|
|
294
|
+
在执行 `/vo-pipeline --variant migration` 之前:
|
|
295
|
+
1. `artifacts/feature-manifest.yaml` 必须存在
|
|
296
|
+
2. `.snapshots/` 必须包含每个功能至少一个快照
|
|
297
|
+
|
|
298
|
+
### 一致性闸门(UAT 前)
|
|
299
|
+
|
|
300
|
+
所有功能实现完成后,执行一致性检查:
|
|
301
|
+
- 要求 100% 通过率(不含 `MANUAL-` 文件)
|
|
302
|
+
- 任何失败皆阻止 UAT 晋升
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## 反模式
|
|
307
|
+
|
|
308
|
+
| 反模式 | 影响 | 正确做法 |
|
|
309
|
+
|--------------|--------|------------------|
|
|
310
|
+
| 过度使用 `ignore_fields` | 隐藏业务逻辑差异 | 仅忽略非确定性字段 |
|
|
311
|
+
| 跳过 MANUAL 快照 | Webhook/后台行为未测试 | UAT 前先编写 MANUAL 快照 |
|
|
312
|
+
| 从损坏的系统录制快照 | 基准线错误 | 录制前先验证旧系统行为 |
|
|
313
|
+
| 只比较反序列化后的对象 | 序列化格式 bug(数字格式、`null` vs 缺漏 key、key 排序、类型强制转换)在 parse 时被 normalize 掉 | 比对原始序列化字符串,或明确断言 JSON 形状(见「序列化格式对等」) |
|
|
314
|
+
| 对非确定性字段采整字段 `ignore_fields` | 遮蔽该字段的**格式**漂移(时间戳精度/时区、UUID 版本) | 忽略其值但仍断言格式/形状(见「`ignore_fields` 使用指南」) |
|
|
315
|
+
| 特性化测试缺少 `@characterization` | Gate 0 找不到它们 | 一律加上 `@characterization` 标记 |
|
|
316
|
+
| 未进行 Gate 0 就开始重构 | 无法检测行为偏移 | 先跑特性化测试,始终如此 |
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## 相关标准
|
|
321
|
+
|
|
322
|
+
- [功能清单标准](../../../core/feature-manifest-standard.md) — 功能清单中 FM-NNN 的 schema
|
|
323
|
+
- [验收条件追踪](../../../core/acceptance-criteria-traceability.md) — `not_implemented` AC 状态
|
|
324
|
+
- [重构标准](../../../core/refactoring-standards.md) — 特性化测试需求
|
|
325
|
+
- [测试标准](../../../core/testing-standards.md) — 测试实现标准
|
|
326
|
+
- [数据迁移测试](../../../core/data-migration-testing.md) — 同样的「别只比看起来相等」原则,作用于 DB 存储层(byte/codepoint 编码),而非 oracle/序列化层
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## 版本历史
|
|
331
|
+
|
|
332
|
+
| 版本 | 日期 | 变更 |
|
|
333
|
+
|---------|------|---------|
|
|
334
|
+
| 1.0.0 | 2026-05-12 | 初始版本 — 快照 schema、一致性闸门、Gate 0 特性化协议(XSPEC-201) |
|
|
335
|
+
| 1.1.0 | 2026-06-28 | 比对保真度补强(XSPEC-306)— `ignore_fields` 改写为「忽略值、断言格式」;新增「序列化格式对等」章节(原始 vs. JSON 形状断言、PHP↔C# 序列化器默认);2 条格式遮蔽反模式;与 data-migration-testing 交叉引用 |
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/browser-compatibility-standards.md
|
|
3
|
+
source_version: 1.0.2
|
|
4
|
+
translation_version: 1.0.2
|
|
5
|
+
last_synced: 2026-07-08
|
|
6
|
+
source_hash: d4a9c4e89256
|
|
7
|
+
status: current
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 浏览器兼容性标准
|
|
11
|
+
|
|
12
|
+
> **语言**: [English](../../../core/browser-compatibility-standards.md) | [繁體中文](../../zh-TW/core/browser-compatibility-standards.md) | 简体中文
|
|
13
|
+
|
|
14
|
+
**版本**:1.0.2
|
|
15
|
+
**最后更新**:2026-06-18
|
|
16
|
+
**适用范围**:前端项目(Web 应用、渐进式 Web 应用 PWA、Web Components)
|
|
17
|
+
**范围**:universal
|
|
18
|
+
**负责规格**:XSPEC-293(与 XSPEC-209 路由覆盖率正交)
|
|
19
|
+
**行业标准**:Browserslist、W3C WebDriver、WebDriver BiDi
|
|
20
|
+
**参考资料**:[caniuse.com](https://caniuse.com/)、[Playwright 浏览器支持矩阵](https://playwright.dev/docs/browsers)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 目的
|
|
25
|
+
|
|
26
|
+
本标准定义所支持的浏览器与设备矩阵、测试自动化策略,以及浏览器兼容性的发布门禁(即 `release-readiness-gate.md` 中的第 9 维度,Tier-3)。
|
|
27
|
+
|
|
28
|
+
浏览器兼容性问题属于用户最容易察觉的缺陷之一,却因为团队往往假设「在 Chrome 上能跑就好」而被系统性地测试不足。若缺少明确的支持矩阵与自动化验证,回归缺陷便会渗漏到生产环境,影响大量用户群体。
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 支持层级定义
|
|
33
|
+
|
|
34
|
+
| 层级 | 定义 | 发布门禁 |
|
|
35
|
+
|------|-----------|--------------|
|
|
36
|
+
| **Tier-1**(完整支持) | 功能完全对等 + 自动化测试覆盖 | 100% 通过 —— 任一测试失败即阻断发布 |
|
|
37
|
+
| **Tier-2**(部分支持) | 尽力支持;主要流程必须可运行 | ≥ 95% 通过 —— 低于则 WARN,< 90% 则 FAIL |
|
|
38
|
+
| **Tier-3**(尽力而为) | 非正式支持;缺陷会记录但不阻断发布 | 仅作为建议参考 |
|
|
39
|
+
|
|
40
|
+
> **Tier-2 `≥95%` / `<90%` 阈值 —— 依据与可配置性**:这些是 UDS 默认值,可依项目配置。
|
|
41
|
+
> Tier-2 是「尽力支持,主要流程必须可运行」,因此门禁容许少量非关键失败的尾量:
|
|
42
|
+
> `≥95%` = 健康(低于则 WARN,用于提示排查);`<90%` = 实质性回归(FAIL)。
|
|
43
|
+
> 请依你的目标市场浏览器覆盖率调整——例如依 Browserslist 市场占比配置(`> 0.5%` 等)
|
|
44
|
+
> 推导 Tier-2 浏览器集合与通过门槛。**例外**:当失败的 Tier-2 案例皆为非关键流程
|
|
45
|
+
> (以 Tier-3 类型缺陷记录)时,发布负责人可在记录理由后覆盖 WARN/FAIL 判定。
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 默认浏览器矩阵
|
|
50
|
+
|
|
51
|
+
团队**必须**明确声明其支持矩阵。以下默认值涵盖了大多数 Web 流量(依 2025–2026 年数据):
|
|
52
|
+
|
|
53
|
+
### Tier-1(默认)
|
|
54
|
+
|
|
55
|
+
| 浏览器 | 版本 | 平台 |
|
|
56
|
+
|---------|----------|---------|
|
|
57
|
+
| Chrome | latest、latest-1 | Windows、macOS、Linux、Android |
|
|
58
|
+
| Safari | latest、latest-1 | macOS、iOS |
|
|
59
|
+
| Firefox | latest | Windows、macOS、Linux |
|
|
60
|
+
| Edge | latest | Windows、macOS |
|
|
61
|
+
|
|
62
|
+
### Tier-2(默认)
|
|
63
|
+
|
|
64
|
+
| 浏览器 | 版本 | 平台 |
|
|
65
|
+
|---------|----------|---------|
|
|
66
|
+
| Chrome | latest-2、latest-3 | 桌面 |
|
|
67
|
+
| Safari | latest-2 | macOS、iOS |
|
|
68
|
+
| Samsung Internet | latest | Android |
|
|
69
|
+
| Opera | latest | 桌面 |
|
|
70
|
+
|
|
71
|
+
### Tier-3(默认)
|
|
72
|
+
|
|
73
|
+
| 浏览器 | 备注 |
|
|
74
|
+
|---------|-------|
|
|
75
|
+
| IE 11 | 已终止支持(EOL);仅在合同要求时才支持 |
|
|
76
|
+
| Chrome < latest-3 | 列为已知限制跟踪 |
|
|
77
|
+
|
|
78
|
+
### 设备 / 视口(Viewport)矩阵
|
|
79
|
+
|
|
80
|
+
| 类别 | 最小宽度 | 代表性设备 |
|
|
81
|
+
|----------|-----------|-----------------------|
|
|
82
|
+
| 移动设备(小) | 360px | Android(小尺寸) |
|
|
83
|
+
| 移动设备(标准) | 390px | iPhone 14 |
|
|
84
|
+
| 平板(竖屏) | 768px | iPad |
|
|
85
|
+
| 平板(横屏) | 1024px | iPad 横屏 |
|
|
86
|
+
| 桌面(小) | 1280px | 13 英寸笔记本 |
|
|
87
|
+
| 桌面(标准) | 1440px | 15 英寸笔记本 / 外接显示器 |
|
|
88
|
+
| 桌面(宽) | 1920px | Full HD 显示器 |
|
|
89
|
+
|
|
90
|
+
最低要求:在 **360px、768px、1280px**(移动 / 平板 / 桌面断点)进行测试。
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 自动化测试
|
|
95
|
+
|
|
96
|
+
### Playwright 矩阵配置
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
// playwright.config.ts
|
|
100
|
+
import { defineConfig, devices } from "@playwright/test";
|
|
101
|
+
|
|
102
|
+
export default defineConfig({
|
|
103
|
+
projects: [
|
|
104
|
+
// Tier-1 browsers
|
|
105
|
+
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
|
|
106
|
+
{ name: "firefox", use: { ...devices["Desktop Firefox"] } },
|
|
107
|
+
{ name: "webkit", use: { ...devices["Desktop Safari"] } },
|
|
108
|
+
{ name: "edge", use: { ...devices["Desktop Edge"] } },
|
|
109
|
+
// Mobile Tier-1
|
|
110
|
+
{ name: "mobile-chrome", use: { ...devices["Pixel 7"] } },
|
|
111
|
+
{ name: "mobile-safari", use: { ...devices["iPhone 14"] } },
|
|
112
|
+
// Viewport coverage
|
|
113
|
+
{ name: "tablet", use: { ...devices["iPad Pro 11"] } },
|
|
114
|
+
],
|
|
115
|
+
// Tier-1 failure = build failure
|
|
116
|
+
reporter: [["html"], ["junit", { outputFile: "results/browser-compat.xml" }]],
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### CI 执行策略
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Run full Tier-1 matrix on release candidate
|
|
124
|
+
npx playwright test --project=chromium,firefox,webkit,edge,mobile-chrome,mobile-safari,tablet
|
|
125
|
+
|
|
126
|
+
# Run Tier-1 only on every PR (fast feedback)
|
|
127
|
+
npx playwright test --project=chromium,firefox,webkit
|
|
128
|
+
|
|
129
|
+
# Run Tier-2 on release candidate (results feed into sign-off as WARN/PASS)
|
|
130
|
+
npx playwright test --project=samsung,opera
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 云端浏览器测试
|
|
134
|
+
|
|
135
|
+
针对 Tier-1 的跨操作系统测试(例如在 Windows 主机的 CI 上测试 Safari),请使用云服务:
|
|
136
|
+
|
|
137
|
+
| 服务 | 使用场景 |
|
|
138
|
+
|---------|---------|
|
|
139
|
+
| BrowserStack Automate | 商业项目;提供最广泛的 OS + 浏览器矩阵 |
|
|
140
|
+
| Sauce Labs | 已有既有合同的企业 |
|
|
141
|
+
| LambdaTest | 开源 / 对成本敏感的项目 |
|
|
142
|
+
|
|
143
|
+
**最低云端测试要求**:在真实 iOS 设备上测试 Safari latest 与 latest-1(对于 WebKit 的缺陷,模拟器(Simulator)并不足够)。
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 视觉回归测试(可选但建议)
|
|
148
|
+
|
|
149
|
+
像素差异(Pixel-diff)测试可检测跨浏览器的布局回归:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Using Playwright visual comparisons
|
|
153
|
+
npx playwright test --update-snapshots # update baseline
|
|
154
|
+
npx playwright test # compare against baseline; fail if diff > threshold
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
阈值建议值:布局组件 < 0.5% 像素差异;复杂的交互组件 < 2%。
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## 发布门禁条件
|
|
162
|
+
|
|
163
|
+
这是 `release-readiness-gate.md` 中的**第 9 维度**(Tier-3:前端 / Web 项目必填;CLI / 纯后端项目则标记为 `N/A`)。
|
|
164
|
+
|
|
165
|
+
| 门禁 | Pass | Warn | Fail |
|
|
166
|
+
|------|------|------|------|
|
|
167
|
+
| Tier-1 浏览器矩阵 | 100% 测试通过 | — | 任一测试失败 |
|
|
168
|
+
| Tier-2 浏览器矩阵 | ≥ 95% 通过 | 90–95% | < 90% |
|
|
169
|
+
| 视口覆盖(360/768/1280) | 任何 Tier-1 浏览器上布局皆无破版 | — | 任一关键流程无法使用 |
|
|
170
|
+
|
|
171
|
+
### 签核所需的证据
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
| 9 | Browser / Device Compat | PASS | Playwright: 6 browsers × 7 viewports, 100% Tier-1; Tier-2: 97%; [junit report link] | QA Lead |
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### `N/A` 条件
|
|
178
|
+
|
|
179
|
+
在以下情况标记为 `N/A`:
|
|
180
|
+
- 项目为纯 CLI、纯后端 API,或移动原生(非 Web)
|
|
181
|
+
- 记录理由:`"N/A — backend API service, no browser UI"`
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Browserslist 配置
|
|
186
|
+
|
|
187
|
+
在 repo 根目录提交一份 `.browserslistrc`,以确保构建工具(Babel、PostCSS、Autoprefixer)针对相同的浏览器:
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
# .browserslistrc
|
|
191
|
+
# Tier-1: production targets
|
|
192
|
+
last 2 Chrome versions
|
|
193
|
+
last 2 Firefox versions
|
|
194
|
+
last 2 Safari versions
|
|
195
|
+
last 2 Edge versions
|
|
196
|
+
last 2 iOS versions
|
|
197
|
+
last 2 ChromeAndroid versions
|
|
198
|
+
|
|
199
|
+
# Tier-2: for reference (not in build targets by default)
|
|
200
|
+
# last 4 Chrome versions
|
|
201
|
+
# Samsung Internet >= 14
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## 反模式
|
|
207
|
+
|
|
208
|
+
- **只测试 Chrome** —— Chrome 约占桌面流量的 65%;剩下的 35% 是 Safari / Firefox / Edge 用户,而你的 bug 会被他们发现
|
|
209
|
+
- **使用浏览器模拟器测试 iOS Safari** —— 模拟器上的 WebKit 与真实设备的 WebKit 有所分歧;对于 release candidate,务必在真实 iOS 上测试
|
|
210
|
+
- **未指定矩阵** —— 隐含假设「支持所有浏览器」是不可能测试的;明确的 Tier-1 矩阵胜过毫无实质的隐含覆盖
|
|
211
|
+
- **将 Tier-3 浏览器失败当作阻断项** —— Tier-3 是尽力而为;记录问题才是恰当做法,而非阻断发布
|
|
212
|
+
- **跳过移动视口测试** —— 移动优先(mobile-first)已是标准;缺少 360px 测试将为大多数移动用户带来损坏的使用体验
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 与其他标准的关系
|
|
217
|
+
|
|
218
|
+
- **`accessibility-standards.md`** —— 键盘导航与屏幕阅读器测试需跨所有 Tier-1 浏览器执行
|
|
219
|
+
- **`e2e-testing.md`** —— Playwright 矩阵配置将 E2E 测试扩展为多浏览器
|
|
220
|
+
- **`release-readiness-gate.md`** —— 第 9 维度(Tier-3)
|
|
221
|
+
- **`performance-standards.md`** —— Core Web Vitals 目标适用于每个 Tier-1 浏览器
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 版本历史
|
|
226
|
+
|
|
227
|
+
| 版本 | 日期 | 变更内容 |
|
|
228
|
+
|---------|------|---------|
|
|
229
|
+
| 1.0.2 | 2026-06-18 | 新增:Tier-2 95%/90% 阈值的依据、可配置性与例外说明(XSPEC-292 T8 / XSPEC-293 AC-293-2) |
|
|
230
|
+
| 1.0.1 | 2026-06-18 | 新增:负责规格指标 → XSPEC-293(XSPEC-291 §11) |
|
|
231
|
+
| 1.0.0 | 2026-05-05 | 首次发布:Tier-1/2/3 矩阵、Playwright 配置、云端测试、发布门禁条件 |
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## 授权
|
|
236
|
+
|
|
237
|
+
本标准依 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授权发布。
|
|
238
|
+
|
|
239
|
+
**来源**:[universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
|