universal-dev-standards 5.3.2 → 5.5.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.
Files changed (122) hide show
  1. package/bundled/ai/standards/adversarial-test.ai.yaml +277 -0
  2. package/bundled/ai/standards/agent-communication-protocol.ai.yaml +32 -166
  3. package/bundled/ai/standards/agent-dispatch.ai.yaml +32 -58
  4. package/bundled/ai/standards/audit-trail.ai.yaml +113 -0
  5. package/bundled/ai/standards/branch-completion.ai.yaml +34 -70
  6. package/bundled/ai/standards/change-batching-standards.ai.yaml +31 -180
  7. package/bundled/ai/standards/chaos-injection-tests.ai.yaml +91 -0
  8. package/bundled/ai/standards/container-image-standards.ai.yaml +88 -0
  9. package/bundled/ai/standards/container-security.ai.yaml +331 -0
  10. package/bundled/ai/standards/cost-budget-test.ai.yaml +96 -0
  11. package/bundled/ai/standards/data-contract.ai.yaml +110 -0
  12. package/bundled/ai/standards/data-migration-testing.ai.yaml +96 -0
  13. package/bundled/ai/standards/data-pipeline.ai.yaml +113 -0
  14. package/bundled/ai/standards/disaster-recovery-drill.ai.yaml +89 -0
  15. package/bundled/ai/standards/execution-history.ai.yaml +30 -288
  16. package/bundled/ai/standards/flaky-test-management.ai.yaml +89 -0
  17. package/bundled/ai/standards/flow-based-testing.ai.yaml +240 -0
  18. package/bundled/ai/standards/iac-design-principles.ai.yaml +83 -0
  19. package/bundled/ai/standards/incident-response.ai.yaml +107 -0
  20. package/bundled/ai/standards/license-compliance.ai.yaml +106 -0
  21. package/bundled/ai/standards/llm-output-validation.ai.yaml +269 -0
  22. package/bundled/ai/standards/mock-boundary.ai.yaml +250 -0
  23. package/bundled/ai/standards/mutation-testing.ai.yaml +192 -0
  24. package/bundled/ai/standards/pii-classification.ai.yaml +109 -0
  25. package/bundled/ai/standards/pipeline-integration-standards.ai.yaml +28 -169
  26. package/bundled/ai/standards/policy-as-code-testing.ai.yaml +227 -0
  27. package/bundled/ai/standards/prd-standards.ai.yaml +88 -0
  28. package/bundled/ai/standards/product-metrics-standards.ai.yaml +111 -0
  29. package/bundled/ai/standards/prompt-regression.ai.yaml +94 -0
  30. package/bundled/ai/standards/property-based-testing.ai.yaml +105 -0
  31. package/bundled/ai/standards/release-quality-manifest.ai.yaml +135 -0
  32. package/bundled/ai/standards/replay-test.ai.yaml +111 -0
  33. package/bundled/ai/standards/runbook.ai.yaml +104 -0
  34. package/bundled/ai/standards/sast-advanced.ai.yaml +135 -0
  35. package/bundled/ai/standards/schema-evolution.ai.yaml +111 -0
  36. package/bundled/ai/standards/secret-management-standards.ai.yaml +105 -0
  37. package/bundled/ai/standards/secure-op.ai.yaml +365 -0
  38. package/bundled/ai/standards/security-testing.ai.yaml +171 -0
  39. package/bundled/ai/standards/server-ops-security.ai.yaml +274 -0
  40. package/bundled/ai/standards/slo-sli.ai.yaml +97 -0
  41. package/bundled/ai/standards/smoke-test.ai.yaml +87 -0
  42. package/bundled/ai/standards/supply-chain-attestation.ai.yaml +109 -0
  43. package/bundled/ai/standards/test-completeness-dimensions.ai.yaml +52 -5
  44. package/bundled/ai/standards/user-story-mapping.ai.yaml +108 -0
  45. package/bundled/ai/standards/workflow-enforcement.ai.yaml +34 -240
  46. package/bundled/ai/standards/workflow-state-protocol.ai.yaml +31 -107
  47. package/bundled/core/adversarial-test.md +212 -0
  48. package/bundled/core/chaos-injection-tests.md +116 -0
  49. package/bundled/core/container-security.md +521 -0
  50. package/bundled/core/cost-budget-test.md +69 -0
  51. package/bundled/core/data-migration-testing.md +110 -0
  52. package/bundled/core/disaster-recovery-drill.md +73 -0
  53. package/bundled/core/flaky-test-management.md +73 -0
  54. package/bundled/core/flow-based-testing.md +142 -0
  55. package/bundled/core/llm-output-validation.md +178 -0
  56. package/bundled/core/mock-boundary.md +100 -0
  57. package/bundled/core/mutation-testing.md +97 -0
  58. package/bundled/core/policy-as-code-testing.md +188 -0
  59. package/bundled/core/prompt-regression.md +72 -0
  60. package/bundled/core/property-based-testing.md +73 -0
  61. package/bundled/core/release-quality-manifest.md +147 -0
  62. package/bundled/core/replay-test.md +86 -0
  63. package/bundled/core/sast-advanced.md +300 -0
  64. package/bundled/core/secure-op.md +314 -0
  65. package/bundled/core/security-testing.md +87 -0
  66. package/bundled/core/server-ops-security.md +493 -0
  67. package/bundled/core/smoke-test.md +65 -0
  68. package/bundled/core/supply-chain-attestation.md +117 -0
  69. package/bundled/locales/zh-CN/CHANGELOG.md +3 -3
  70. package/bundled/locales/zh-CN/README.md +1 -1
  71. package/bundled/locales/zh-CN/skills/ai-instruction-standards/SKILL.md +5 -5
  72. package/bundled/locales/zh-TW/CHANGELOG.md +3 -3
  73. package/bundled/locales/zh-TW/README.md +1 -1
  74. package/bundled/locales/zh-TW/skills/ai-instruction-standards/SKILL.md +183 -79
  75. package/bundled/skills/README.md +4 -3
  76. package/bundled/skills/SKILL_NAMING.md +94 -0
  77. package/bundled/skills/ai-instruction-standards/SKILL.md +181 -88
  78. package/bundled/skills/atdd-assistant/SKILL.md +8 -0
  79. package/bundled/skills/bdd-assistant/SKILL.md +7 -0
  80. package/bundled/skills/checkin-assistant/SKILL.md +8 -0
  81. package/bundled/skills/code-review-assistant/SKILL.md +7 -0
  82. package/bundled/skills/journey-test-assistant/SKILL.md +203 -0
  83. package/bundled/skills/orchestrate/SKILL.md +167 -0
  84. package/bundled/skills/plan/SKILL.md +234 -0
  85. package/bundled/skills/pr-automation-assistant/SKILL.md +8 -0
  86. package/bundled/skills/push/SKILL.md +49 -2
  87. package/bundled/skills/{process-automation → skill-builder}/SKILL.md +1 -1
  88. package/bundled/skills/{forward-derivation → spec-derivation}/SKILL.md +1 -1
  89. package/bundled/skills/spec-driven-dev/SKILL.md +7 -0
  90. package/bundled/skills/sweep/SKILL.md +145 -0
  91. package/bundled/skills/tdd-assistant/SKILL.md +7 -0
  92. package/package.json +1 -1
  93. package/src/commands/flow.js +8 -0
  94. package/src/commands/start.js +14 -0
  95. package/src/commands/sweep.js +8 -0
  96. package/src/commands/workflow.js +8 -0
  97. package/standards-registry.json +474 -12
  98. package/bundled/locales/zh-CN/skills/ac-coverage-assistant/SKILL.md +0 -190
  99. package/bundled/locales/zh-CN/skills/forward-derivation/SKILL.md +0 -71
  100. package/bundled/locales/zh-CN/skills/forward-derivation/guide.md +0 -130
  101. package/bundled/locales/zh-CN/skills/methodology-system/SKILL.md +0 -88
  102. package/bundled/locales/zh-CN/skills/methodology-system/create-methodology.md +0 -350
  103. package/bundled/locales/zh-CN/skills/methodology-system/guide.md +0 -131
  104. package/bundled/locales/zh-CN/skills/methodology-system/runtime.md +0 -279
  105. package/bundled/locales/zh-CN/skills/process-automation/SKILL.md +0 -143
  106. package/bundled/locales/zh-TW/skills/ac-coverage-assistant/SKILL.md +0 -195
  107. package/bundled/locales/zh-TW/skills/deploy-assistant/SKILL.md +0 -178
  108. package/bundled/locales/zh-TW/skills/forward-derivation/SKILL.md +0 -69
  109. package/bundled/locales/zh-TW/skills/forward-derivation/guide.md +0 -415
  110. package/bundled/locales/zh-TW/skills/methodology-system/SKILL.md +0 -86
  111. package/bundled/locales/zh-TW/skills/methodology-system/create-methodology.md +0 -350
  112. package/bundled/locales/zh-TW/skills/methodology-system/guide.md +0 -131
  113. package/bundled/locales/zh-TW/skills/methodology-system/runtime.md +0 -279
  114. package/bundled/locales/zh-TW/skills/process-automation/SKILL.md +0 -144
  115. /package/bundled/skills/{ac-coverage-assistant → ac-coverage}/SKILL.md +0 -0
  116. /package/bundled/skills/{methodology-system → dev-methodology}/SKILL.md +0 -0
  117. /package/bundled/skills/{methodology-system → dev-methodology}/create-methodology.md +0 -0
  118. /package/bundled/skills/{methodology-system → dev-methodology}/guide.md +0 -0
  119. /package/bundled/skills/{methodology-system → dev-methodology}/integrated-flow.md +0 -0
  120. /package/bundled/skills/{methodology-system → dev-methodology}/prerequisite-check.md +0 -0
  121. /package/bundled/skills/{methodology-system → dev-methodology}/runtime.md +0 -0
  122. /package/bundled/skills/{forward-derivation → spec-derivation}/guide.md +0 -0
@@ -0,0 +1,240 @@
1
+ # Flow-Based Testing Standards - AI Optimized
2
+ # Source: core/flow-based-testing.md
3
+
4
+ id: flow-based-testing
5
+ meta:
6
+ version: "1.0.0"
7
+ updated: "2026-05-04"
8
+ source: core/flow-based-testing.md
9
+ description: Flow decomposition methodology for testing multi-step processes with branch coverage
10
+
11
+ core_concepts:
12
+ problem: >
13
+ AC-centric tests verify individual behaviors in isolation but miss integration gaps
14
+ between steps and leave decision-point branches untested.
15
+ A flow where AC-1 passes and AC-2 passes independently does NOT guarantee
16
+ the AC-1 → AC-2 → AC-3 sequential flow works correctly.
17
+ solution: >
18
+ Decompose each workflow into flows, identify all decision points,
19
+ expand into a scenario matrix, then write journey tests with shared state threading.
20
+
21
+ # ─────────────────────────────────────────────────────────
22
+ # Step 1: Flow Identification
23
+ # ─────────────────────────────────────────────────────────
24
+ flow_identification:
25
+ description: Extract testable flows from SPEC/AC before writing any test code
26
+ activities:
27
+ - name: Define Preconditions
28
+ description: Document the system's initial state before the flow begins
29
+ examples:
30
+ - User is authenticated (token present)
31
+ - Database has seed data
32
+ - External services are available
33
+ - name: List Ordered Action Sequence
34
+ description: List all steps in the exact execution order
35
+ examples:
36
+ - Step 1: Validate input
37
+ - Step 2: Check quota
38
+ - Step 3: Call external service
39
+ - Step 4: Persist result
40
+ - Step 5: Return response
41
+ - name: Extract Decision Points
42
+ description: Identify every if/else/conditional in the flow
43
+ examples:
44
+ - "Is the user authorized? [yes → continue | no → 401]"
45
+ - "Is quota sufficient? [yes → continue | no → 429]"
46
+ - "Did external service respond? [200 → success | timeout → retry | error → fail]"
47
+ - name: Define Terminal States
48
+ description: List all possible end states (success + each distinct failure)
49
+ examples:
50
+ - "SUCCESS: Resource created, 201 returned"
51
+ - "FAIL_AUTH: 401 with error code AUTH_INVALID"
52
+ - "FAIL_QUOTA: 429 with error code QUOTA_EXCEEDED"
53
+ - "FAIL_EXTERNAL: 504 with error code EXTERNAL_TIMEOUT"
54
+ output: Flow definition (decision point list + terminal state map)
55
+
56
+ # ─────────────────────────────────────────────────────────
57
+ # Step 2: Decision Table Expansion
58
+ # ─────────────────────────────────────────────────────────
59
+ decision_table_expansion:
60
+ description: Expand decision points into a scenario matrix using a coverage strategy
61
+ coverage_strategies:
62
+ - name: Each-Choice
63
+ description: Each decision value appears in at least one scenario
64
+ formula: "Minimum scenarios = sum of unique values across all decision points"
65
+ use_when: Low-risk flows, fast feedback cycles, initial coverage
66
+ example: "3 values + 2 values + 3 values = 8 minimum scenarios"
67
+ - name: Pairwise
68
+ description: All pairs of decision values are covered (OWASP T-way testing)
69
+ formula: Approximately N × max_values scenarios (N = decision points)
70
+ use_when: Medium-risk flows, balance between coverage and test count
71
+ tools: [allpairs, pairwiseJS]
72
+ - name: All-Combinations
73
+ description: Full Cartesian product of all decision values
74
+ formula: "Scenarios = product of value counts per decision point"
75
+ use_when: Critical flows (auth, payment, license validation, security controls)
76
+ warning: Can grow exponentially; only use for flows with < 4 decision points or < 3 values each
77
+
78
+ decision_table_template: |
79
+ Flow: [Flow Name]
80
+
81
+ Decision Points:
82
+ | Point | Values |
83
+ |----------------|---------------------------------|
84
+ | Authorization | valid / expired / missing |
85
+ | Quota | sufficient / exceeded |
86
+ | ExternalSvc | available / timeout / error |
87
+
88
+ Each-Choice Scenarios (minimum coverage):
89
+ | Scenario | Auth | Quota | ExternalSvc | Expected |
90
+ |----------|----------|------------|-------------|-------------------|
91
+ | S1 | valid | sufficient | available | success |
92
+ | S2 | expired | sufficient | available | 401_expired |
93
+ | S3 | missing | sufficient | available | 401_missing |
94
+ | S4 | valid | exceeded | available | 429_quota |
95
+ | S5 | valid | sufficient | timeout | 504_retry |
96
+ | S6 | valid | sufficient | error | 502_external_fail |
97
+
98
+ # ─────────────────────────────────────────────────────────
99
+ # Step 3: Journey Test Structure
100
+ # ─────────────────────────────────────────────────────────
101
+ journey_test_structure:
102
+ description: Write flow tests with shared state threading — state accumulates across steps
103
+ key_principle: >
104
+ Each test step inherits state from previous steps through a shared context object.
105
+ Never reset the context between steps in a journey test.
106
+
107
+ happy_path_pattern: |
108
+ describe("Flow: [Flow Name]", () => {
109
+ // Shared context — state accumulates, NOT reset between steps
110
+ const ctx: {
111
+ token?: string;
112
+ resourceId?: string;
113
+ result?: ResponseType;
114
+ } = {}
115
+
116
+ it("Step 1: [Precondition setup]", async () => {
117
+ ctx.token = await setupAuth()
118
+ expect(ctx.token).toBeTruthy()
119
+ })
120
+
121
+ it("Step 2: [Core action using Step 1 state]", async () => {
122
+ ctx.resourceId = await createResource(ctx.token!, inputData)
123
+ expect(ctx.resourceId).toMatch(/^[a-z0-9-]+$/)
124
+ })
125
+
126
+ it("Step 3: [Verification using accumulated state]", async () => {
127
+ ctx.result = await getResource(ctx.token!, ctx.resourceId!)
128
+ expect(ctx.result.status).toBe("active")
129
+ expect(ctx.result.id).toBe(ctx.resourceId)
130
+ })
131
+ })
132
+
133
+ branch_pattern: |
134
+ // Each branch outcome gets its own describe block
135
+ describe("Flow Branch: [Decision Point] → [Outcome]", () => {
136
+ it("should [expected behavior] when [condition]", async () => {
137
+ // Setup: put the system into the branch condition
138
+ const expiredToken = buildExpiredJwt()
139
+
140
+ // Act: trigger the flow with branch condition
141
+ const response = await callApi(expiredToken)
142
+
143
+ // Assert: verify BOTH the response AND any side effects
144
+ expect(response.status).toBe(401)
145
+ expect(response.body.code).toBe("AUTH_TOKEN_EXPIRED")
146
+ // Verify NO side effects occurred (resource not created)
147
+ const count = await getResourceCount()
148
+ expect(count).toBe(0)
149
+ })
150
+ })
151
+
152
+ anti_patterns_in_structure:
153
+ - "Using beforeEach to reset ctx — breaks state threading between steps"
154
+ - "Putting all steps in a single it() block — hides which step failed"
155
+ - "Asserting only on the final state — intermediate step bugs go undetected"
156
+ - "Using arbitrary delays between steps — use proper async/await"
157
+
158
+ # ─────────────────────────────────────────────────────────
159
+ # Feature Type Mapping
160
+ # ─────────────────────────────────────────────────────────
161
+ feature_type_mapping:
162
+ - type: Workflow / Multi-step Process
163
+ requires: flow_decomposition
164
+ minimum_coverage: Each-Choice
165
+ test_structure: journey-chained-test
166
+ dimensions: [1, 3, 4, 5, 9, 10]
167
+ with_ai: [1, 3, 4, 5, 9, 10, 8]
168
+ note: Apply flow-based-testing standard; use shared ctx; Each-Choice minimum branch coverage
169
+
170
+ # ─────────────────────────────────────────────────────────
171
+ # Rules
172
+ # ─────────────────────────────────────────────────────────
173
+ rules:
174
+ - id: flow-identification-required
175
+ trigger: feature has 3 or more sequential steps
176
+ instruction: Apply 3-step flow decomposition (identify → decision table → journey structure) before writing tests
177
+ priority: required
178
+
179
+ - id: decision-table-for-branches
180
+ trigger: flow has any if/else or conditional logic
181
+ instruction: Create decision table with all decision values; apply Each-Choice minimum coverage
182
+ priority: required
183
+
184
+ - id: shared-state-in-journey
185
+ trigger: writing multi-step flow test
186
+ instruction: Use shared context object (ctx); never reset it between steps within the same flow
187
+ priority: required
188
+
189
+ - id: separate-branch-describes
190
+ trigger: decision point has 2 or more outcome values
191
+ instruction: Each distinct outcome gets its own describe block with a clear name
192
+ priority: required
193
+
194
+ - id: all-combinations-for-critical
195
+ trigger: flow involves authentication, payment, license validation, or security controls
196
+ instruction: Apply All-Combinations coverage strategy; test every value combination
197
+ priority: required
198
+
199
+ - id: verify-side-effects-in-branches
200
+ trigger: writing branch test for failure path
201
+ instruction: Assert BOTH the error response AND that no unintended side effects occurred
202
+ priority: required
203
+
204
+ # ─────────────────────────────────────────────────────────
205
+ # Anti-Patterns
206
+ # ─────────────────────────────────────────────────────────
207
+ anti_patterns:
208
+ - Testing only the happy path flow (missing failure terminal states)
209
+ - Resetting shared state between steps in a journey test (breaks state threading)
210
+ - Testing each step in isolation without verifying accumulated state
211
+ - Using a single test case for a flow with multiple decision points (hides which branch failed)
212
+ - Applying Pairwise or All-Combinations to every flow (creates unmaintainable test counts; reserve for critical flows)
213
+ - Not verifying side effects (or absence of side effects) in branch tests
214
+ - Starting flow test from midpoint without establishing preconditions
215
+
216
+ # ─────────────────────────────────────────────────────────
217
+ # Quick Reference
218
+ # ─────────────────────────────────────────────────────────
219
+ quick_reference:
220
+ flow_test_checklist: |
221
+ Flow: ___________________
222
+
223
+ □ Step 1 — Flow Identification
224
+ □ Preconditions documented
225
+ □ Ordered step sequence listed (Step 1 → Step N)
226
+ □ All decision points extracted (every if/else/condition)
227
+ □ All terminal states defined (success + each distinct failure)
228
+
229
+ □ Step 2 — Decision Table
230
+ □ Decision table created with all values per decision point
231
+ □ Coverage strategy chosen (Each-Choice / Pairwise / All-Combinations)
232
+ □ Critical flows (auth/payment/security) use All-Combinations
233
+ □ Minimum scenario count = sum of unique values (Each-Choice)
234
+
235
+ □ Step 3 — Journey Test Structure
236
+ □ Happy path journey test exists (shared ctx, all steps in sequence)
237
+ □ Each branch outcome has its own describe block
238
+ □ Step assertions verify accumulated ctx state, not just final result
239
+ □ Branch tests verify both error response AND absence of side effects
240
+ □ No beforeEach resetting ctx between steps
@@ -0,0 +1,83 @@
1
+ # IaC Design Principles - AI Optimized
2
+ # Source: XSPEC-065 Wave 4 IaC Pack
3
+
4
+ id: iac-design-principles
5
+ title: Infrastructure as Code Design Principles
6
+ version: "1.0.0"
7
+ status: Active
8
+ tags: [iac, infrastructure, terraform, pulumi, cloudformation, immutable-infrastructure]
9
+ summary: |
10
+ Defines the four foundational principles for Infrastructure as Code (IaC)
11
+ authoring: reproducible, immutable, idempotent, and versioned. Covers state
12
+ management requirements including remote state with locking, drift detection
13
+ categories, and CI/CD integration. Designed to ensure infrastructure changes
14
+ are traceable, reversible, and safe to apply repeatedly without unintended
15
+ side effects.
16
+
17
+ requirements:
18
+ - id: REQ-001
19
+ title: IaC Four Principles
20
+ description: |
21
+ All infrastructure definitions MUST adhere to four foundational principles:
22
+ (1) Reproducible — given the same inputs and state, applying IaC produces
23
+ identical infrastructure. (2) Immutable — infrastructure changes are
24
+ applied by replacing resources, not mutating them in-place; blue/green or
25
+ rolling replacement patterns are preferred over in-place mutations.
26
+ (3) Idempotent — applying the same IaC configuration multiple times
27
+ produces the same result without error or unintended side effects.
28
+ (4) Versioned — all IaC definitions are stored in version control with
29
+ meaningful commit messages; no infrastructure change is made outside the
30
+ VCS workflow.
31
+ level: MUST
32
+ examples:
33
+ - "Terraform modules pinned to specific provider versions for reproducibility"
34
+ - "EC2 instance replacement via launch template version bump, not in-place AMI update"
35
+ - "`terraform apply` is safe to re-run; no manual pre-checks needed for idempotency"
36
+ - "All Pulumi programs committed to git; no ad-hoc CLI changes accepted"
37
+
38
+ - id: REQ-002
39
+ title: State Management
40
+ description: |
41
+ IaC state MUST be stored in a remote backend with locking enabled to
42
+ prevent concurrent modifications. Local state files MUST NOT be committed
43
+ to version control or used in CI/CD pipelines. Recommended backends:
44
+ Terraform Cloud / S3+DynamoDB (Terraform), Pulumi Service / S3 (Pulumi),
45
+ CloudFormation native stack state. State access MUST be restricted to
46
+ authorized principals via IAM or equivalent. State encryption at rest
47
+ is REQUIRED.
48
+ level: MUST
49
+ examples:
50
+ - "Terraform S3 backend with DynamoDB lock table; `.terraform/` in .gitignore"
51
+ - "Pulumi state stored in Pulumi Cloud with team access controls"
52
+ - "CI pipeline uses OIDC to assume role with state bucket access; no static credentials"
53
+ - "State file encrypted using AWS KMS customer-managed key"
54
+
55
+ - id: REQ-003
56
+ title: Drift Detection
57
+ description: |
58
+ Teams MUST run `plan` (or equivalent) in CI on every pull request to
59
+ detect configuration drift. Drift outcomes MUST be classified into one
60
+ of three categories and handled accordingly: (1) rollback-to-code —
61
+ actual infra deviates from code due to manual change; revert actual to
62
+ match code on next apply. (2) update-code-from-actual — actual reflects
63
+ intentional change not yet codified; update IaC to match, then apply.
64
+ (3) manual-reconcile — drift requires human judgment (e.g., data volume
65
+ changes); escalate to infra owner with documented decision. Drift reports
66
+ SHOULD be published to a team channel on a scheduled cadence (e.g., daily).
67
+ level: MUST
68
+ examples:
69
+ - "CI runs `terraform plan` on PR; plan output posted as PR comment"
70
+ - "Security group rule added via console → classified rollback-to-code; removed on next apply"
71
+ - "RDS storage autoscaled → classified update-code-from-actual; IaC updated to new size"
72
+ - "Daily drift scan via scheduled CI job; report posted to #infra-alerts Slack channel"
73
+
74
+ anti_patterns:
75
+ - "Committing local state files (terraform.tfstate) to version control"
76
+ - "Applying mutable in-place changes (e.g., sed-patching running VMs) instead of replacing resources"
77
+ - "Making manual console changes without updating the corresponding IaC definition"
78
+ - "Using no remote locking, allowing concurrent applies that corrupt state"
79
+ - "Pinning to `latest` provider or module versions, breaking reproducibility"
80
+
81
+ related_standards:
82
+ - containerization-standards
83
+ - secret-management-standards
@@ -0,0 +1,107 @@
1
+ # Incident Response Standards - AI Optimized
2
+ # Source: XSPEC-063 Wave 3 SRE Pack
3
+
4
+ id: incident-response
5
+ title: Incident Response Standards
6
+ version: "1.0.0"
7
+ status: Active
8
+ tags: [sre, incident, oncall, postmortem, severity]
9
+ summary: |
10
+ Defines the end-to-end incident response lifecycle: severity classification,
11
+ response time SLAs, roles and responsibilities, communication protocols,
12
+ escalation paths, and blameless postmortem requirements. Designed to reduce
13
+ MTTR, ensure consistent stakeholder communication during incidents, and
14
+ drive systemic reliability improvements through structured postmortems.
15
+
16
+ requirements:
17
+ - id: REQ-001
18
+ title: Severity Classification
19
+ description: |
20
+ Every incident MUST be classified at declaration using a 4-level
21
+ severity scale. SEV-1 (Critical): complete service outage or data
22
+ breach affecting all users, response within 15 minutes, C-suite
23
+ notification. SEV-2 (High): major feature unavailable or significant
24
+ performance degradation >25% users, response within 30 minutes.
25
+ SEV-3 (Medium): minor feature unavailable or degradation <25% users,
26
+ response within 4 hours. SEV-4 (Low): cosmetic issue or very minor
27
+ impact, response within 24 hours.
28
+ level: MUST
29
+ examples:
30
+ - "SEV-1: Payment processing completely down → IC declared, bridge opened in <5min"
31
+ - "SEV-2: Checkout latency >10s for 30% of users → on-call paged, IC assigned"
32
+ - "SEV-3: Search autocomplete broken → ticket created, fix in next sprint"
33
+
34
+ - id: REQ-002
35
+ title: Incident Commander Role
36
+ description: |
37
+ Every SEV-1 and SEV-2 incident MUST have a designated Incident
38
+ Commander (IC) assigned within 10 minutes of declaration. The IC is
39
+ responsible for: coordinating the response bridge, assigning roles
40
+ (scribe, comms lead, technical leads), driving timeline, making
41
+ go/no-go decisions on fixes, and initiating postmortem. The IC does
42
+ NOT directly troubleshoot — their sole focus is coordination.
43
+ level: MUST
44
+ examples:
45
+ - "IC assignment: 'I'm taking IC for this SEV-2, @alice please scribe, @bob comms'"
46
+ - "IC checklist: bridge open, roles assigned, status page updated, stakeholders notified"
47
+ - "IC does not debug code; delegates to technical leads who report findings"
48
+
49
+ - id: REQ-003
50
+ title: Stakeholder Communication Protocol
51
+ description: |
52
+ During SEV-1/SEV-2 incidents, stakeholder updates MUST be sent on a
53
+ defined cadence: initial notification within 15 minutes of declaration,
54
+ updates every 30 minutes until resolution, immediate update on any
55
+ severity change or major development. Updates MUST include: current
56
+ status, known impact, what is being done, next update time. Status
57
+ page MUST be updated simultaneously with internal communications.
58
+ level: MUST
59
+ examples:
60
+ - "T+15min: 'We are investigating elevated error rates on checkout. ~500 users affected. Next update in 30min.'"
61
+ - "T+45min: 'Root cause identified as database connection pool exhaustion. Fix in progress. Next update in 30min.'"
62
+ - "Resolution: 'Service restored at 14:32 UTC. Postmortem scheduled for 2026-05-02.'"
63
+
64
+ - id: REQ-004
65
+ title: Blameless Postmortem Requirements
66
+ description: |
67
+ Every SEV-1 incident MUST have a blameless postmortem completed within
68
+ 5 business days. SEV-2 incidents MUST have a postmortem within 10
69
+ business days. Postmortems MUST be blameless — focusing on systemic
70
+ causes, not individual mistakes. Required sections: timeline, impact,
71
+ root cause (5 Whys), contributing factors, action items with owners
72
+ and due dates, lessons learned. Action items MUST be tracked to
73
+ completion.
74
+ level: MUST
75
+ examples:
76
+ - "Timeline: 14:00 Alert fired → 14:05 IC assigned → 14:23 RCA found → 14:32 resolved"
77
+ - "Root cause: 5 Whys tracing alert → connection pool exhaustion → missing timeout config → no review gate"
78
+ - "Action item: INFRA-2341 Add connection pool monitoring, owner: @dave, due: 2026-05-15"
79
+
80
+ - id: REQ-005
81
+ title: On-Call Rotation and Handoff
82
+ description: |
83
+ Every production service MUST have a documented on-call rotation with
84
+ at least 2 engineers. Rotation schedules MUST be published at least
85
+ 2 weeks in advance. On-call handoff MUST include a written summary of:
86
+ active incidents, recent incidents still under investigation,
87
+ known flaky alerts, upcoming planned maintenance, and any service
88
+ health concerns. Handoff MUST be acknowledged by incoming on-call.
89
+ level: MUST
90
+ examples:
91
+ - "Handoff doc: 3 active flaky alerts (JIRA links), 1 ongoing SEV-3, maintenance window Friday 02:00 UTC"
92
+ - "Rotation: 1-week shifts, 2 primary + 1 secondary, published monthly in PagerDuty"
93
+ - "Handoff acknowledgment: incoming engineer replies 'Handoff received, I have the pager'"
94
+
95
+ - id: REQ-006
96
+ title: Incident Retrospective Metrics
97
+ description: |
98
+ Teams SHOULD track and review incident metrics monthly: MTTD (Mean
99
+ Time To Detect), MTTR (Mean Time To Resolve), incident frequency by
100
+ severity, repeat incidents (same root cause within 90 days), and
101
+ postmortem action item completion rate. These metrics SHOULD be
102
+ reviewed in monthly reliability reviews with engineering leadership.
103
+ level: SHOULD
104
+ examples:
105
+ - "Monthly metrics: MTTD 8min, MTTR 42min, 3 SEV-2s, 0 SEV-1s, 0 repeat incidents"
106
+ - "Repeat incident flag: same DB timeout root cause in March and April → escalate to reliability sprint"
107
+ - "Action item completion rate: 85% of previous month's items closed on time"
@@ -0,0 +1,106 @@
1
+ # License Compliance Standards - AI Optimized
2
+ # Source: XSPEC-066 Wave 3 Compliance Pack
3
+
4
+ id: license-compliance
5
+ title: License Compliance Standards
6
+ version: "1.0.0"
7
+ status: Active
8
+ tags: [compliance, licensing, open-source, legal, supply-chain]
9
+ summary: |
10
+ Defines how teams identify, track, and manage open-source and third-party
11
+ software licenses throughout the software development lifecycle. Covers
12
+ license classification (permissive vs. copyleft), prohibited licenses,
13
+ SBOM generation, license scanning in CI/CD, and remediation processes
14
+ for license violations. Designed to prevent legal exposure from
15
+ incompatible license combinations and ensure supply-chain transparency.
16
+
17
+ requirements:
18
+ - id: REQ-001
19
+ title: License Classification and Allowlist
20
+ description: |
21
+ Every project MUST maintain a documented license policy classifying
22
+ licenses into three tiers. APPROVED: MIT, Apache 2.0, BSD-2-Clause,
23
+ BSD-3-Clause, ISC, CC0 — can be used without review. REVIEW-REQUIRED:
24
+ LGPL-2.1, LGPL-3.0, MPL-2.0, CDDL — requires legal/architecture
25
+ review before adoption. PROHIBITED: GPL-2.0 (without exception),
26
+ GPL-3.0, AGPL-3.0, SSPL, Commons Clause additions — MUST NOT be
27
+ included in proprietary or commercial products.
28
+ level: MUST
29
+ examples:
30
+ - "MIT dependency lodash → auto-approved, no review needed"
31
+ - "LGPL-3.0 dependency → open GitHub issue tagged 'license-review' before merging"
32
+ - "GPL-3.0 dependency found in PR → PR blocked by CI until dependency replaced"
33
+
34
+ - id: REQ-002
35
+ title: Automated License Scanning in CI
36
+ description: |
37
+ Every repository MUST run automated license scanning on every pull
38
+ request and on a daily scheduled basis. The scan MUST fail the build
39
+ if any PROHIBITED license is detected in direct or transitive
40
+ dependencies. REVIEW-REQUIRED licenses MUST generate a warning that
41
+ blocks merge until manually approved and documented. Scan results
42
+ MUST be stored as build artifacts for 1 year.
43
+ level: MUST
44
+ examples:
45
+ - "CI step: `npx license-checker --onlyAllow 'MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC'`"
46
+ - "Daily scheduled scan via GitHub Actions: runs license-checker across all repos"
47
+ - "Build artifact: license-report-2026-04-30.json retained for 1 year"
48
+
49
+ - id: REQ-003
50
+ title: Software Bill of Materials (SBOM) Generation
51
+ description: |
52
+ Every production release MUST include a Software Bill of Materials
53
+ (SBOM) in SPDX 2.3 or CycloneDX 1.5 format. The SBOM MUST list all
54
+ direct and transitive dependencies with: package name, version,
55
+ license identifier (SPDX), and supplier. SBOMs MUST be generated
56
+ automatically as part of the release pipeline and stored alongside
57
+ release artifacts.
58
+ level: MUST
59
+ examples:
60
+ - "SBOM generated via: `syft . -o spdx-json > sbom-v1.2.0.spdx.json`"
61
+ - "SBOM uploaded to release: GitHub Release v1.2.0 includes sbom-v1.2.0.spdx.json"
62
+ - "SBOM SPDX entry: {name: 'lodash', version: '4.17.21', licenseConcluded: 'MIT'}"
63
+
64
+ - id: REQ-004
65
+ title: License Attribution and Notices
66
+ description: |
67
+ Products distributed to external users MUST include a NOTICES or
68
+ LICENSE-THIRD-PARTY file listing all open-source components and their
69
+ license texts. This file MUST be auto-generated from the SBOM data.
70
+ For web applications, attribution MUST be accessible via a dedicated
71
+ page or endpoint (e.g., /licenses or /legal/notices).
72
+ level: MUST
73
+ examples:
74
+ - "NOTICES file auto-generated: `npx generate-license-file --input package.json --output NOTICES`"
75
+ - "Web app: GET /legal/notices returns HTML page with all dependency licenses"
76
+ - "Mobile app: 'Open Source Licenses' screen in Settings menu"
77
+
78
+ - id: REQ-005
79
+ title: License Violation Remediation Process
80
+ description: |
81
+ When a license violation is detected, teams MUST follow the remediation
82
+ process: (1) immediately block merge/release if PROHIBITED license;
83
+ (2) create a tracking issue within 1 business day; (3) remediate
84
+ within 5 business days for PROHIBITED, 30 days for REVIEW-REQUIRED;
85
+ (4) document decision and alternative chosen; (5) update SBOM and
86
+ re-scan to verify clean. Unresolved violations MUST be reported to
87
+ the engineering lead monthly.
88
+ level: MUST
89
+ examples:
90
+ - "Violation: transitive dep uses GPL-3.0 → PR blocked, issue COMP-112 created same day"
91
+ - "Remediation: replaced dep with MIT-licensed alternative within 3 days"
92
+ - "Monthly report: 0 open violations as of 2026-04-30"
93
+
94
+ - id: REQ-006
95
+ title: License Review for New Technology Adoption
96
+ description: |
97
+ Before adopting any new framework, library, or tool, engineers SHOULD
98
+ verify its license tier as part of the technology evaluation. License
99
+ status SHOULD be documented in the relevant ADR or technical spike
100
+ document. For REVIEW-REQUIRED licenses, architecture review board
101
+ approval MUST be obtained before adoption.
102
+ level: SHOULD
103
+ examples:
104
+ - "ADR-042 notes: 'Library X uses Apache 2.0 — approved tier, no legal review needed'"
105
+ - "ADR-043 notes: 'Library Y uses LGPL-3.0 — review-required, legal approved 2026-03-10'"
106
+ - "Technology radar entry includes license classification for each evaluated tool"