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,328 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/secure-op.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2026-06-10
|
|
6
|
+
source_hash: 7ef0c2e3a2c2
|
|
7
|
+
status: current
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Secure-Op:AI Agent 安全操作标准
|
|
11
|
+
|
|
12
|
+
> **语言**: [繁體中文(原文)](../../../core/secure-op.md) | [繁體中文](../../zh-TW/core/secure-op.md) | 简体中文
|
|
13
|
+
|
|
14
|
+
**版本**:1.0.0
|
|
15
|
+
**最后更新**:2026-05-04
|
|
16
|
+
**适用范围**:所有部署 AI Agent 的系统
|
|
17
|
+
**范围**:AI Agent 安全操作
|
|
18
|
+
**行业标准**:ISO/IEC 27001:2022、NIST SP 800-207、OWASP LLM Top 10 2025
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 标准概述
|
|
23
|
+
|
|
24
|
+
**Secure-Op** 是针对 AI Agent 系统的安全操作方法论,定义 AI Agent 在执行高风险操作时必须遵循的六大安全支柱。
|
|
25
|
+
|
|
26
|
+
本标准源自 External Guardian OPA Sidecar reference implementation (XSPEC-146 from an external project)的实现经验,并沉淀为通用 UDS 标准,供任何采用 UDS 的 AI Agent 系统应用。
|
|
27
|
+
|
|
28
|
+
### 核心理念
|
|
29
|
+
|
|
30
|
+
传统软件安全假设操作主体是人类用户。AI Agent 系统带来新的威胁模型:
|
|
31
|
+
- **Agent 可能被提示注入(Prompt Injection)操控**,伪装成合法操作
|
|
32
|
+
- **LLM 推理不确定性**,相同输入可能产生不同决策
|
|
33
|
+
- **操作范围不可预测**,一个指令可能触发连锁副作用
|
|
34
|
+
|
|
35
|
+
Secure-Op 的回应是:**确定性系统守护边界,概率性系统只做辅助**。
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 六大支柱
|
|
40
|
+
|
|
41
|
+
### 支柱一:Veto-Based Decision(否决式决策)
|
|
42
|
+
|
|
43
|
+
决策逻辑必须以「否决权」为基础,不得使用投票制。
|
|
44
|
+
|
|
45
|
+
#### 核心原则
|
|
46
|
+
|
|
47
|
+
| 原则 | 说明 |
|
|
48
|
+
|------|------|
|
|
49
|
+
| Deterministic > Probabilistic | 确定性系统(Policy Engine、Rule Engine)的决策优先于 LLM 推理 |
|
|
50
|
+
| Policy-as-Code | 所有安全规则必须版本控制,可回归测试 |
|
|
51
|
+
| 否决即终止 | 任一层 DENY 即立刻终止管道,不继续下一层 |
|
|
52
|
+
|
|
53
|
+
#### 决策管道(Decision Pipeline)
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
输入操作请求
|
|
57
|
+
│
|
|
58
|
+
▼
|
|
59
|
+
[M1] Prompt Injection 检测
|
|
60
|
+
│ DENY → 终止
|
|
61
|
+
▼
|
|
62
|
+
[M2] Policy Engine(OPA / Rule Engine)
|
|
63
|
+
│ DENY → 终止
|
|
64
|
+
▼
|
|
65
|
+
[M3] SOBR 风险评分
|
|
66
|
+
│ ≥76 → DENY;51-75 → HITL;≤50 → 继续
|
|
67
|
+
▼
|
|
68
|
+
[M4] Semantic Review(可选,LLM)
|
|
69
|
+
│ DENY → 终止
|
|
70
|
+
▼
|
|
71
|
+
执行操作 + 记录 Audit
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**参考实现**:OPA(Open Policy Agent)或等效 Policy Engine
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### 支柱二:SOBR Risk Scoring(四维风险评分)
|
|
79
|
+
|
|
80
|
+
量化风险分数,提供一致且可解释的决策依据。
|
|
81
|
+
|
|
82
|
+
#### 公式
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
RiskScore = S×0.30 + O×0.25 + B×0.25 + R×0.20
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
#### 四个维度
|
|
89
|
+
|
|
90
|
+
| 维度 | 权重 | 说明 | 示例高分 | 示例低分 |
|
|
91
|
+
|------|------|------|---------|---------|
|
|
92
|
+
| **S** Sensitivity | 0.30 | 目标资源敏感度 | 用户凭证(100)| 公开文档(5)|
|
|
93
|
+
| **O** OperationType | 0.25 | 操作危险程度 | 执行任意代码(100)| 读取公开数据(10)|
|
|
94
|
+
| **B** BlastRadius | 0.25 | 操作影响范围 | 影响所有生产环境(100)| 隔离开发沙箱(10)|
|
|
95
|
+
| **R** Reversibility | 0.20 | 不可逆程度(越不可逆分数越高)| 永久删除无备份(100)| 只读操作(0)|
|
|
96
|
+
|
|
97
|
+
#### 决策阈值
|
|
98
|
+
|
|
99
|
+
| 分数范围 | 决策 | 行动 |
|
|
100
|
+
|---------|------|------|
|
|
101
|
+
| 0–25 | **ALLOW** | 正常执行,记录 Audit |
|
|
102
|
+
| 26–50 | **ALLOW_WITH_MONITORING** | 执行并加强监控,标记人工事后审查 |
|
|
103
|
+
| 51–75 | **REQUIRE_HITL** | 触发人工审核升级(Human-in-the-Loop)|
|
|
104
|
+
| 76–100 | **DENY** | 拒绝,记录决策路径与违规项目 |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### 支柱三:Fail-Closed(故障关闭原则)
|
|
109
|
+
|
|
110
|
+
任何安全组件故障时,**默认行为必须是 DENY**,禁止 fail-open。
|
|
111
|
+
|
|
112
|
+
#### 故障场景对应
|
|
113
|
+
|
|
114
|
+
| 故障场景 | 必要响应 | 例外 |
|
|
115
|
+
|---------|---------|------|
|
|
116
|
+
| Policy Engine 不可达 | DENY ALL | 只读操作可由操作者明确设置例外 |
|
|
117
|
+
| SOBR 评分计算失败 | REQUIRE_HITL(保守升级)| 无 |
|
|
118
|
+
| Signature 验证失败 | DENY ALL | 无 |
|
|
119
|
+
| 任何未知错误 | DENY | 无 |
|
|
120
|
+
|
|
121
|
+
#### 禁止的反模式
|
|
122
|
+
|
|
123
|
+
- **Fail-Open**:错误时默认 ALLOW(严重度:CRITICAL)
|
|
124
|
+
- **部分验证继续执行**:某层验证失败但仍继续(严重度:HIGH)
|
|
125
|
+
- **静默吞噬错误**:catch 错误但不改变决策(严重度:HIGH)
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### 支柱四:Audit Chain(不可篡改审计轨迹)
|
|
130
|
+
|
|
131
|
+
所有安全决策必须记录在**可验证的不可篡改审计轨迹**中。
|
|
132
|
+
|
|
133
|
+
#### 每条 Audit 记录必要字段
|
|
134
|
+
|
|
135
|
+
| 字段 | 类型 | 说明 |
|
|
136
|
+
|------|------|------|
|
|
137
|
+
| `request_id` | UUID v4 | 每次决策的唯一标识符 |
|
|
138
|
+
| `decision` | enum | ALLOW / ALLOW_WITH_MONITORING / REQUIRE_HITL / DENY |
|
|
139
|
+
| `risk_score` | number (0-100) | SOBR 计算结果 |
|
|
140
|
+
| `timestamp` | ISO 8601 UTC | 毫秒精度时间戳 |
|
|
141
|
+
| `violations` | string[] | 违规政策列表(ALLOW 时为空数组)|
|
|
142
|
+
| `signature` | base64 Ed25519 | 对核心字段的非对称签名 |
|
|
143
|
+
| `prev_hash` | SHA-256 hex | 前一条记录的 hash(构成 hash chain)|
|
|
144
|
+
|
|
145
|
+
#### Hash Chain 设计
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
Record[0]: prev_hash = "0000...0000" (genesis)
|
|
149
|
+
Record[1]: prev_hash = SHA-256(Record[0])
|
|
150
|
+
Record[2]: prev_hash = SHA-256(Record[1])
|
|
151
|
+
...
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
必须提供 `verify_chain()` 函数,可检测任何中间记录的篡改。
|
|
155
|
+
|
|
156
|
+
#### 签名规范
|
|
157
|
+
|
|
158
|
+
- **算法**:Ed25519(非对称加密)
|
|
159
|
+
- **签署内容**:`{request_id}:{decision}:{risk_score}:{timestamp}`
|
|
160
|
+
- **禁止**:使用 HMAC(对称)作为审计签名
|
|
161
|
+
|
|
162
|
+
#### 存储级别
|
|
163
|
+
|
|
164
|
+
| 级别 | 存储介质 | 适用环境 |
|
|
165
|
+
|------|---------|---------|
|
|
166
|
+
| Level 0(最低)| 本地 append-only file | 开发/测试 |
|
|
167
|
+
| Level 1(推荐)| WORM 存储(S3 Object Lock / Azure Immutable Blob)| 生产环境 |
|
|
168
|
+
| Level 2(最高)| 不可变云端 + Remote Attestation | 法规要求环境(SOC2, ISO 27001 认证)|
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### 支柱五:HITL Escalation(人工审核升级)
|
|
173
|
+
|
|
174
|
+
Risk Score 落在 51–75(REQUIRE_HITL 区间)时,必须有明确的人工审核升级机制。
|
|
175
|
+
|
|
176
|
+
#### 两种 HITL 模式
|
|
177
|
+
|
|
178
|
+
| 模式 | 行为 | 适用场景 |
|
|
179
|
+
|------|------|---------|
|
|
180
|
+
| **Non-Blocking** | 发送通知,执行继续(加强监控)| 分数 51–62,低敏感操作 |
|
|
181
|
+
| **Blocking** | 暂停执行,等待人工确认 | 分数 63–75,高敏感环境 |
|
|
182
|
+
|
|
183
|
+
#### 必要要求
|
|
184
|
+
|
|
185
|
+
- **TTL**:HITL 审核请求必须有过期时间(建议 **1800 秒**)
|
|
186
|
+
- **过期行为**:TTL 到期未审核 → 自动升级为 DENY
|
|
187
|
+
- **Audit**:HITL 触发事件与审核结果必须记入 Audit Chain
|
|
188
|
+
- **通知接口**:Webhook 为标准接口;Adapter 模式支持 Slack / Teams / PagerDuty
|
|
189
|
+
|
|
190
|
+
#### 通知 Payload 必要字段
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"request_id": "...",
|
|
195
|
+
"risk_score": 67,
|
|
196
|
+
"operation_summary": "...",
|
|
197
|
+
"policy_violations": [...],
|
|
198
|
+
"expires_at": "2026-05-04T12:30:00Z"
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
### 支柱六:Prompt Injection Defense(提示注入防护)
|
|
205
|
+
|
|
206
|
+
AI Agent 系统必须防护 Prompt Injection 攻击,防止恶意输入绕过安全控制。
|
|
207
|
+
|
|
208
|
+
#### 检测模式类型
|
|
209
|
+
|
|
210
|
+
| 类型 | 示例模式 |
|
|
211
|
+
|------|---------|
|
|
212
|
+
| 覆盖指令 | "ignore previous instructions", "disregard your programming" |
|
|
213
|
+
| 角色扮演操控 | "you are now", "act as", "DAN", "jailbreak" |
|
|
214
|
+
| 系统 Token 注入 | `[SYSTEM]`, `[INST]`, `<\|system\|>`, `<<SYS>>` |
|
|
215
|
+
| 指令前缀 | "New instruction:", "OVERRIDE:", "Updated system prompt:" |
|
|
216
|
+
|
|
217
|
+
#### 防护措施
|
|
218
|
+
|
|
219
|
+
1. **拦截位置**:M1 Intake 层(管道最前端),在任何语义评估前拦截
|
|
220
|
+
2. **响应**:触发 DENY + 记录 `PROMPT_INJECTION_DETECTED` violation
|
|
221
|
+
3. **日志安全**:**禁止**将原始恶意输入存入日志;只记录检测到的模式类型与输入的 Hash
|
|
222
|
+
4. **模式维护**:每月更新检测模式;订阅 OWASP LLM Working Group 更新
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 实现参考
|
|
227
|
+
|
|
228
|
+
### External Guardian (reference implementation)(TypeScript 参考实现)
|
|
229
|
+
|
|
230
|
+
External Guardian OPA Sidecar reference implementation (XSPEC-146 from an external project)是 Secure-Op 的完整 TypeScript 参考实现,包含:
|
|
231
|
+
|
|
232
|
+
- **GuardianService**:主要 Veto-based 决策管道
|
|
233
|
+
- **SobrScorer**:SOBR 四维风险评分
|
|
234
|
+
- **AuditChain**:SHA-256 Hash Chain + Ed25519 签名
|
|
235
|
+
- **HitlNotifier**:Webhook Adapter(支持 Slack/Teams)
|
|
236
|
+
- **PromptInjectionDetector**:正则表达式 + 模式匹配
|
|
237
|
+
|
|
238
|
+
> 路径:external Guardian implementation (separately licensed)
|
|
239
|
+
|
|
240
|
+
### 最小实现清单
|
|
241
|
+
|
|
242
|
+
建立 Secure-Op 合规系统的最小步骤:
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
□ Step 1:建立 Policy Engine(OPA 或等效工具)并连接至 Agent 管道
|
|
246
|
+
□ Step 2:实现 SOBR 评分计算(4 维度 + 权重公式)
|
|
247
|
+
□ Step 3:设置决策阈值路由(ALLOW / MONITORING / HITL / DENY)
|
|
248
|
+
□ Step 4:建立 Audit Chain(append-only + hash + signature)
|
|
249
|
+
□ Step 5:实现 HITL 通知 + TTL 机制
|
|
250
|
+
□ Step 6:加入 Prompt Injection 检测(M1 位置)
|
|
251
|
+
□ Step 7:在所有错误路径确认 Fail-Closed 行为
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## ISO / NIST / OWASP 映射
|
|
257
|
+
|
|
258
|
+
| 支柱 | 标准映射 |
|
|
259
|
+
|------|---------|
|
|
260
|
+
| Veto-Based Decision | ISO/IEC 27001:2022 A.8.24 |
|
|
261
|
+
| SOBR Risk Scoring | ISO/IEC 27001:2022 Annex A.8.24;ISO/IEC 27005 |
|
|
262
|
+
| Fail-Closed | NIST SP 800-207 Zero Trust Architecture(2.1节);ISO/IEC 27001:2022 A.8.22 |
|
|
263
|
+
| Audit Chain | ISO/IEC 27001:2022 A.8.15(Logging);ISO/IEC 27001:2022 A.5.33(Protection of records)|
|
|
264
|
+
| HITL Escalation | ISO/IEC 27001:2022 A.8.2;NIST SP 800-53 AC-2 |
|
|
265
|
+
| Prompt Injection Defense | OWASP LLM Top 10 2025 LLM01;ISO/IEC 27001:2022 A.8.24 |
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## 级别分类
|
|
270
|
+
|
|
271
|
+
Secure-Op 标准分为三个实现级别(Priority Levels):
|
|
272
|
+
|
|
273
|
+
### P0a:审查层(必须)
|
|
274
|
+
|
|
275
|
+
最低基准要求,所有 AI Agent 系统必须实现:
|
|
276
|
+
|
|
277
|
+
- Policy Engine 连接并设置 Fail-Closed
|
|
278
|
+
- SOBR 风险评分(任何操作请求触发)
|
|
279
|
+
- Prompt Injection 检测(M1 位置)
|
|
280
|
+
|
|
281
|
+
### P0b:执行验证层(必须)
|
|
282
|
+
|
|
283
|
+
在 P0a 基础上,强化执行时的决策保障:
|
|
284
|
+
|
|
285
|
+
- 完整决策路由(ALLOW / MONITORING / HITL / DENY)
|
|
286
|
+
- HITL 升级机制(含 TTL)
|
|
287
|
+
- 所有决策记入 Audit Log
|
|
288
|
+
|
|
289
|
+
### P0c:强化层(高安全需求环境)
|
|
290
|
+
|
|
291
|
+
在 P0b 基础上,达到法规合规级别:
|
|
292
|
+
|
|
293
|
+
- Hash Chain + Ed25519 签名的 Audit Chain
|
|
294
|
+
- WORM 存储(Level 1 或 Level 2)
|
|
295
|
+
- Remote Attestation 支持
|
|
296
|
+
- 定期 Audit Chain 完整性验证
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## 快速开始建议
|
|
301
|
+
|
|
302
|
+
### 对于小型 AI Agent 系统(MVP / Prototype)
|
|
303
|
+
|
|
304
|
+
从 SOBR 评分 + 基本 DENY 阈值开始:
|
|
305
|
+
|
|
306
|
+
1. 为每个操作类型定义 S / O / B / R 值
|
|
307
|
+
2. 计算 RiskScore;≥76 直接拒绝
|
|
308
|
+
3. 记录决策到 append-only log
|
|
309
|
+
|
|
310
|
+
### 对于生产环境 AI Agent 系统
|
|
311
|
+
|
|
312
|
+
完整实现六大支柱,使用 External Guardian (reference implementation) 作为参考或直接引用。
|
|
313
|
+
|
|
314
|
+
### 对于法规要求环境(金融、医疗、政府)
|
|
315
|
+
|
|
316
|
+
P0c 级别 + 外部审计师可访问的 Audit Chain 导出功能。
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## 相关标准
|
|
321
|
+
|
|
322
|
+
- `security-standards`:架构层安全设计(输入验证、认证设计)
|
|
323
|
+
- `security-testing`:安全测试方法论(SAST、DAST、依赖审计)
|
|
324
|
+
- `audit-trail`:一般 Audit Trail 标准
|
|
325
|
+
- `mock-boundary`:测试中禁止 mock 安全控制
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
**Scope**: universal
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/security-testing.md
|
|
3
|
+
source_version: 1.1.0
|
|
4
|
+
translation_version: 1.1.0
|
|
5
|
+
last_synced: 2026-07-08
|
|
6
|
+
source_hash: 242e9016416c
|
|
7
|
+
status: current
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 安全测试标准
|
|
11
|
+
|
|
12
|
+
> **语言**: [English](../../../core/security-testing.md) | [繁體中文](../../zh-TW/core/security-testing.md) | 简体中文
|
|
13
|
+
|
|
14
|
+
**版本**: 1.1.0
|
|
15
|
+
**最后更新**: 2026-06-19
|
|
16
|
+
**适用性**: 所有软件项目
|
|
17
|
+
**范围**: universal
|
|
18
|
+
**行业标准**: OWASP Testing Guide v4, NIST SP 800-115, ISO/IEC 27001
|
|
19
|
+
**参考**: OWASP Top 10, CWE/SANS Top 25
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 目的
|
|
24
|
+
|
|
25
|
+
本文档定义软件项目的安全测试方法论。它与 `security-standards.md`(架构层面的安全设计)互补,提供执行层面的指导:应运行哪些工具、何时运行、以及如何响应发现的问题。
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 四个安全测试层
|
|
30
|
+
|
|
31
|
+
### 1. SAST — 静态分析
|
|
32
|
+
|
|
33
|
+
在不执行代码的情况下分析源代码。在 pre-commit 和 CI 中运行。
|
|
34
|
+
|
|
35
|
+
| 语言 | 工具 | 检测项 |
|
|
36
|
+
|----------|------|---------|
|
|
37
|
+
| TypeScript/JS | eslint-plugin-security | eval 注入、regex DoS、路径遍历 |
|
|
38
|
+
| Python | bandit | SQL 注入、硬编码凭据 |
|
|
39
|
+
| Java | SpotBugs + FindSecBugs | SQL 注入、XSS |
|
|
40
|
+
|
|
41
|
+
**门禁**: High/Critical → 阻止 merge
|
|
42
|
+
|
|
43
|
+
### 2. 依赖审计
|
|
44
|
+
|
|
45
|
+
扫描第三方包的已知 CVE。在 pre-push 和每周运行。
|
|
46
|
+
|
|
47
|
+
| 生态系统 | 工具 | 命令 |
|
|
48
|
+
|-----------|------|---------|
|
|
49
|
+
| Node.js | npm audit | `npm audit --audit-level=high` |
|
|
50
|
+
| Python | pip-audit | `pip-audit` |
|
|
51
|
+
|
|
52
|
+
**门禁**: High/Critical CVE → 阻止发布(例外须记录并附到期日期)
|
|
53
|
+
|
|
54
|
+
### 3. 密钥扫描
|
|
55
|
+
|
|
56
|
+
检测意外提交的密钥。在每次 commit 时运行。
|
|
57
|
+
|
|
58
|
+
工具: gitleaks、truffleHog
|
|
59
|
+
|
|
60
|
+
**门禁**: 检测到任何密钥 → 立即阻止 commit
|
|
61
|
+
|
|
62
|
+
### 4. DAST — 动态分析
|
|
63
|
+
|
|
64
|
+
通过 HTTP 测试运行中的应用程序。在 staging 部署后运行。
|
|
65
|
+
|
|
66
|
+
工具: OWASP ZAP、Nuclei
|
|
67
|
+
|
|
68
|
+
**门禁**: High/Critical 发现 → 阻止晋升至 production
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## CVE 响应策略
|
|
73
|
+
|
|
74
|
+
| 严重程度 | 响应 |
|
|
75
|
+
|----------|----------|
|
|
76
|
+
| Critical | 24 小时内修补;阻止所有部署 |
|
|
77
|
+
| High | 下次发布前解决 |
|
|
78
|
+
| Moderate | 14 天内解决 |
|
|
79
|
+
| Low | 跟踪;在维护窗口解决 |
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 发现事项修复生命周期
|
|
84
|
+
|
|
85
|
+
上述各层负责检测发现,CVE 策略则设定解决时限(SLA),但一个发现事项还需要一个**有负责人的生命周期**——否则「阻止 merge」就是唯一定义好的动作,检测之后的一切都没有定义。每个安全发现(SAST / DAST / 密钥 / 依赖 CVE)都遵循以下状态机。
|
|
86
|
+
|
|
87
|
+
| 状态 | 含义 | 负责人 | 退出条件 |
|
|
88
|
+
|-------|---------|-------|----------------|
|
|
89
|
+
| **Detected(已检测)** | 由某一层(SAST/DAST/密钥/审计)提出 | 扫描门禁(CI) | 已分配严重程度 |
|
|
90
|
+
| **Triaged(已分诊)** | 已确认严重程度与有效性(真实 vs 误报) | 安全审查者 | 真实 → 转为 In-Progress;误报 → 标记为 `suppressed` 并记录理由 |
|
|
91
|
+
| **In-Progress(处理中)** | 修复正在实现 | 受影响组件的代码负责人 | 修复已提交 |
|
|
92
|
+
| **Resolved(已解决)** | 修复已合并 | 代码负责人 | 原扫描重新运行后无发现 |
|
|
93
|
+
| **Verified(已验证)** | 重新扫描确认发现已消失 | 扫描门禁(CI) | 发现事项关闭 |
|
|
94
|
+
|
|
95
|
+
- **门禁**:任何 Critical/High 发现若状态非 `Verified`(或 `Triaged → suppressed` 且附有理由),皆**阻止发布**,与上述 CVE 响应策略的 SLA 一致。
|
|
96
|
+
- **不得静默关闭**:发现事项只能通过 `Verified`(重新扫描无发现)或安全审查者明确记录的 `suppressed` 决定离开此生命周期——绝不可通过删除,也不可由修复作者自行批准关闭。
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 反模式
|
|
101
|
+
|
|
102
|
+
- 将所有 CVE 视为同等紧急
|
|
103
|
+
- 对 production 运行 DAST(应使用 staging)
|
|
104
|
+
- 无限期忽略 `npm audit`
|
|
105
|
+
- 在测试中 mock 身份认证 middleware(见 mock-boundary.md)
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 与其他标准的关系
|
|
110
|
+
|
|
111
|
+
- `security-standards`: 架构层面的控制措施(输入验证、身份认证设计)
|
|
112
|
+
- `mock-boundary`: 测试中绝不 mock 安全控制
|
|
113
|
+
- `deployment-standards`: DAST 作为部署流水线的一部分运行
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/self-review-protocol.md
|
|
3
|
+
source_version: 1.1.0
|
|
4
|
+
translation_version: 1.1.0
|
|
5
|
+
last_synced: 2026-07-09
|
|
6
|
+
source_hash: 35603d9b6211
|
|
7
|
+
status: current
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Self-Review Protocol(自我审查协议)
|
|
11
|
+
|
|
12
|
+
> **语言**: [English](../../../core/self-review-protocol.md) | [繁體中文](../../zh-TW/core/self-review-protocol.md) | 简体中文
|
|
13
|
+
|
|
14
|
+
**版本**: 1.1.0
|
|
15
|
+
**最后更新**: 2026-07-09
|
|
16
|
+
**适用范围**: 所有软件项目(新建、重构、迁移、维护)
|
|
17
|
+
**范围**: partial
|
|
18
|
+
**业界标准**: ISO/IEC 25010(文档可维护性)、IEEE 1063-2001(软件用户文档)
|
|
19
|
+
**参考**: 受 Google Engineering Practices 代码审查实践启发;专为大型 markdown 对象编辑特化
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 目的
|
|
24
|
+
|
|
25
|
+
本标准规范大型 markdown 编辑**commit 前**必跑 **self-review**,捕捉内部 cross-reference 不一致 — 这类问题惯性被内部推理忽略,但完整 re-read 一次即可 surface。
|
|
26
|
+
|
|
27
|
+
**与其他标准的关系**:
|
|
28
|
+
- 与 [code-review.md](code-review-checklist.md) 互补(后者涵盖代码变更)
|
|
29
|
+
- 与 [documentation-writing-standards.md](documentation-writing-standards.md) 互补(后者涵盖内容创作)
|
|
30
|
+
- 本标准专注于**大型 markdown 文档**(DEC、ADR、XSPEC、SKILL.md、规格文档、runbook 等)的**编辑后验证**
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 背景
|
|
35
|
+
|
|
36
|
+
多次 Claude 辅助编辑 session(如 `dev-platform/.claude/skills/eval-source/SKILL.md` v1.1.0 → v1.1.1、v1.2.0 → v1.2.1)观察到一致模式:**每次大型 markdown 编辑都引入 3-6 处小型内部不一致**,内部推理看不出来,但完整 re-read 立刻 surface。
|
|
37
|
+
|
|
38
|
+
这些不一致归纳为 **6 大类**,且固定触发后续 patch commit。在 commit 前加入强制 re-read 步骤后,此模式消失(eval-source v1.3.0 为首次无 patch follow-up 的 SKILL.md 变更)。第 7 大类(语言与术语一致性)为后续因不同动机(跨对话 AI 输出漂移,非原始 patch 周期模式)新增,详见下方。
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 触发条件
|
|
43
|
+
|
|
44
|
+
| 变更规模 | 是否必跑 self-review? |
|
|
45
|
+
|---|---|
|
|
46
|
+
| commit 修改 **> 50 行** markdown | **必跑** |
|
|
47
|
+
| commit 修改 ≤ 50 行 markdown | 可选(小修常无 cross-ref 风险)|
|
|
48
|
+
| 纯 code / config 变更 | 不适用(另有 lint / test / code review)|
|
|
49
|
+
|
|
50
|
+
适用文件类型:
|
|
51
|
+
- ADR(架构决策记录)
|
|
52
|
+
- 跨项目规格(XSPEC)与 SDD Delta
|
|
53
|
+
- SKILL.md(Claude Code 自定义 skill)
|
|
54
|
+
- ARCHITECTURE.md、API.md、DEPLOYMENT.md、MIGRATION.md 等长型项目文档
|
|
55
|
+
- Runbook、playbook
|
|
56
|
+
- README.md(修改主要 section 时)
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 7 类常见内部不一致
|
|
61
|
+
|
|
62
|
+
### 1. Diagram / Flow 与 step list 不同步
|
|
63
|
+
**示例**:工作流程图 7 格但文档实际定义 8 步骤
|
|
64
|
+
**检查**:数每个 diagram 节点数量 vs `## Step N:` / `## N.` heading
|
|
65
|
+
|
|
66
|
+
### 2. Changelog 引用编号错位
|
|
67
|
+
**示例**:Changelog 写「Step 1 新增 X」但 X 实际在 Step 0
|
|
68
|
+
**检查**:对每条 changelog 描述,grep 其引用的 anchor 位置
|
|
69
|
+
|
|
70
|
+
### 3. 计数错位
|
|
71
|
+
**示例**:文档说「自我审计 4 题」但实际 list 有 7 题
|
|
72
|
+
**检查**:grep 「N 题」「N 列」「N 点」等明确数字并对照实际 count
|
|
73
|
+
|
|
74
|
+
### 4. Stale 模板
|
|
75
|
+
**示例**:commit 模板写死 `Claude Sonnet 4.6` 但实际模型随环境变动
|
|
76
|
+
**检查**:找硬编码的模型名、工具版本、日期;改为 placeholder 或更新
|
|
77
|
+
|
|
78
|
+
### 5. 错误工具 / 命令引用
|
|
79
|
+
**示例**:建议用 `claude --version` 取得模型名,但该命令只显示 CLI 版本
|
|
80
|
+
**检查**:对每个提及的 CLI 命令做 mental check 或 `which X` / `--help` 验证
|
|
81
|
+
|
|
82
|
+
### 6. Placeholder 与 rule 不对齐
|
|
83
|
+
**示例**:example 写「D1/D2/D3」但 rule 明说 D3 不强制,且当前案例正好把 D3 降为后续追踪
|
|
84
|
+
**检查**:example 中每个具体值是否与当前 rule 一致;example 不应与最新案例经验矛盾
|
|
85
|
+
|
|
86
|
+
### 7. 语言与术语一致性
|
|
87
|
+
**示例**:双语文档某段落中英文夹杂,或日文假名/韩文谚文混入简体中文段落;或同一份文档内「XSPEC」「gate」「pipeline」等项目惯用术语写法不一致
|
|
88
|
+
**检查**:扫描非目标语言文字是否出现在非预期段落(如日文假名 U+3040–U+30FF、韩文谚文 U+AC00–U+D7A3 混入简体中文段落)、同段落语言混杂、以及同一文件内既有惯用术语拼法是否一致
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 流程
|
|
93
|
+
|
|
94
|
+
1. **edit 完成后、commit 前**,用 file-reading 工具重新读过**完整文件**(不只 diff)
|
|
95
|
+
2. 依上方 7 类逐项对照
|
|
96
|
+
3. **发现问题** → 直接 Edit 修补后再 commit(同一 commit 包含修正,不要分开 ship)
|
|
97
|
+
4. **若已 commit 才发现** → 新增 patch commit(如 v1.2.1 对 v1.2.0)
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 记录格式(按文件类型)
|
|
102
|
+
|
|
103
|
+
### SKILL.md
|
|
104
|
+
在 frontmatter 附近 changelog 追加一行:
|
|
105
|
+
```
|
|
106
|
+
> **v{X.Y.(Z+1)} Self-review pass {YYYY-MM-DD}**:找到 {N} 处 issue,{M} 处于同 commit 修正;或「0 issues found」
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### ADR / DEC
|
|
110
|
+
在 `## 后续追踪` 表格新增一行:
|
|
111
|
+
```
|
|
112
|
+
| Self-review pass | 本 DEC | ✅ YYYY-MM-DD (7 类无 issue) |
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### XSPEC SDD Delta
|
|
116
|
+
在「不改动清单」section(如 §N.6)后追加:
|
|
117
|
+
```
|
|
118
|
+
> Self-review pass: YYYY-MM-DD (7 类无 issue)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Commit message body
|
|
122
|
+
最后一行附:
|
|
123
|
+
```
|
|
124
|
+
Self-review (protocol v1.1.0): N issues found, M applied in same commit / 0 found.
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## 与其他审查实践的区别
|
|
130
|
+
|
|
131
|
+
| 实践 | 涵盖面向 | 触发时机 |
|
|
132
|
+
|---|---|---|
|
|
133
|
+
| **Code Review**([code-review.md](code-review-checklist.md))| 代码正确性、设计、安全 | code PR merge 前 |
|
|
134
|
+
| **内容自我审计**(如 eval-source skill 7 题)| 内容完整性(是否包含所有必要 section)| 每次文档产出 |
|
|
135
|
+
| **Self-Review Protocol**(本标准)| 内部 cross-reference 一致性(形式,非内容)| 大型 markdown 编辑后、commit 前 |
|
|
136
|
+
| **同侪审查** | 独立视角、blast radius 评估 | 重要变更 |
|
|
137
|
+
|
|
138
|
+
三层审查互补:
|
|
139
|
+
- **内容审计** 问:*是否包含所有必要的部分?*
|
|
140
|
+
- **Self-review** 问:*包含的部分内部一致吗?*
|
|
141
|
+
- **同侪审查** 问:*从另一个角度看,这个变更合理吗?*
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 反模式
|
|
146
|
+
|
|
147
|
+
1. **因为「diff 看起来不大」就跳过 self-review** — 大文件的小 diff 常引入其他位置的 cross-ref 错误
|
|
148
|
+
2. **只 review diff 而非整文件** — cross-ref 错误可能在未变动的 section 中(引用了已变动内容)
|
|
149
|
+
3. **记录 protocol 但不执行** — 纪律在于实践,不在于文档本身
|
|
150
|
+
4. **把 self-review 当 peer review 的替代品** — self-review 抓不一致,不抓设计缺陷
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 验证
|
|
155
|
+
|
|
156
|
+
采纳本标准的验证方式:
|
|
157
|
+
|
|
158
|
+
- **Patch commit 比例**:采纳后,同一对象 `v1.X.0 → v1.X.1` 后续 patch 比例应显著下降(eval-source 从 v1.3.0 前的 100% 降至之后的 0%)
|
|
159
|
+
- **Issue surface 时间**:self-review 抓到的 issue(pre-commit)vs 下一个 reader 抓到的 issue(post-commit)— 前者应上升、后者应下降
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 实践案例
|
|
164
|
+
|
|
165
|
+
- **dev-platform** `eval-source` skill v1.3.0 — 首次 SKILL.md 变更在 commit 前 self-review pass(commit `6b45c5d`);前有两次 patch 周期(v1.1.0→v1.1.1 3 处、v1.2.0→v1.2.1 6 处)促成本标准诞生
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Self-Review Pass
|
|
170
|
+
|
|
171
|
+
> Self-review pass: 2026-05-26 (6 类无 issue;本标准首稿同步 self-review)
|
|
172
|
+
> Self-review pass: 2026-07-09(7 类无 issue —— 依 XSPEC-324 新增第 7 类「语言与术语一致性」)
|