@vesviet/agent-skills 5.7.3 → 5.10.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 (241) hide show
  1. package/INDEX.md +21 -18
  2. package/README.md +11 -10
  3. package/VERSION +1 -1
  4. package/adapters/antigravity/ANTIGRAVITY.md +89 -4
  5. package/adapters/antigravity/INDEX_TIER1.json +1294 -0
  6. package/adapters/antigravity/a2a-config.template.yaml +22 -8
  7. package/adapters/antigravity/role-skill-index.json +48 -19
  8. package/adapters/claude/CLAUDE_ADAPTER.md +1 -1
  9. package/adapters/claude/settings.template.json +7 -3
  10. package/adapters/cursor/hooks.template.json +3 -1
  11. package/core/contracts/README.md +4 -1
  12. package/core/contracts/schemas/INDEX.md +7 -1
  13. package/core/contracts/schemas/a2a-artifact.json +9 -2
  14. package/core/contracts/schemas/a2a-jsonrpc-envelope.json +7 -2
  15. package/core/contracts/schemas/a2a-task-progress.json +15 -4
  16. package/core/contracts/schemas/a2a-task.json +11 -3
  17. package/core/contracts/schemas/agent-card.json +48 -1
  18. package/core/contracts/schemas/agent-skills-discovery.json +91 -0
  19. package/core/contracts/schemas/compliance-report.json +255 -0
  20. package/core/contracts/schemas/mcp-server-card.json +193 -0
  21. package/core/contracts/schemas/seo-content-brief.json +1 -1
  22. package/core/contracts/schemas/seo-weekly-board.json +1 -1
  23. package/core/contracts/schemas/series-article.json +1 -1
  24. package/core/policies/action-boundaries.yaml +334 -2
  25. package/core/policies/mcp-tool-map.yaml +61 -4
  26. package/core/roles/3d-graphics-engineer.md +5 -1
  27. package/core/roles/README.md +1 -1
  28. package/core/roles/agent-coordinator.md +21 -3
  29. package/core/roles/agent-discovery-engineer.md +27 -8
  30. package/core/roles/ai-systems-engineer.md +3 -1
  31. package/core/roles/aws-engineer.md +6 -8
  32. package/core/roles/backend-developer.md +5 -5
  33. package/core/roles/business-analyst.md +4 -2
  34. package/core/roles/cloudflare-engineer.md +4 -2
  35. package/core/roles/content-manager.md +3 -1
  36. package/core/roles/content-writer.md +3 -1
  37. package/core/roles/data-analyst.md +3 -1
  38. package/core/roles/data-engineer.md +3 -1
  39. package/core/roles/devops-engineer.md +9 -9
  40. package/core/roles/ecommerce-engineer.md +7 -7
  41. package/core/roles/frontend-developer.md +10 -8
  42. package/core/roles/game-developer.md +5 -3
  43. package/core/roles/mmo-engineer.md +8 -9
  44. package/core/roles/mobile-engineer.md +5 -3
  45. package/core/roles/product-manager.md +8 -9
  46. package/core/roles/project-manager.md +10 -13
  47. package/core/roles/prompt-engineer.md +6 -4
  48. package/core/roles/qa-engineer.md +9 -9
  49. package/core/roles/references/vietnam-accounting-specialist-review-checklist.md +6 -6
  50. package/core/roles/researcher.md +12 -14
  51. package/core/roles/reverse-engineer.md +5 -2
  52. package/core/roles/reviewer.md +7 -5
  53. package/core/roles/role-standard.md +23 -1
  54. package/core/roles/sdet.md +7 -5
  55. package/core/roles/security-engineer.md +9 -7
  56. package/core/roles/seo-analyst.md +9 -7
  57. package/core/roles/solution-architect.md +8 -9
  58. package/core/roles/sre.md +8 -6
  59. package/core/roles/system-engineer.md +20 -20
  60. package/core/roles/task-planner.md +8 -10
  61. package/core/roles/teacher.md +8 -6
  62. package/core/roles/technical-architect.md +10 -8
  63. package/core/roles/technical-lead.md +9 -7
  64. package/core/roles/technical-writer.md +8 -6
  65. package/core/roles/ui-ux-designer.md +8 -7
  66. package/core/roles/vietnam-accounting-specialist.md +26 -24
  67. package/core/roles/vietnam-legal-counsel.md +6 -4
  68. package/core/rules/code.md +11 -6
  69. package/core/skills/README.md +3 -2
  70. package/core/skills/agent/agent-a2a-protocol/SKILL.md +25 -93
  71. package/core/skills/agent/agent-memory-compaction/SKILL.md +27 -0
  72. package/core/skills/agent/architect-mcp-server/SKILL.md +35 -27
  73. package/core/skills/agent/configure-agent-commerce/SKILL.md +2 -0
  74. package/core/skills/agent/configure-agent-commerce/examples/ucp-commerce-manifest-and-endpoints.json +55 -0
  75. package/core/skills/agent/configure-agent-commerce/references/acp-ucp-agent-commerce-manifest-specs.md +66 -0
  76. package/core/skills/agent/configure-agent-skills/SKILL.md +60 -68
  77. package/core/skills/agent/manage-agent-identity/SKILL.md +2 -0
  78. package/core/skills/agent/manage-agent-identity/examples/agent-identity-spire-workload.yaml +72 -0
  79. package/core/skills/agent/manage-agent-identity/references/nhi-lifecycle-and-token-rotation.md +45 -0
  80. package/core/skills/ai/openrouter-task/SKILL.md +5 -5
  81. package/core/skills/ai-agent/agent-evaluation/resources/eval-benchmarks/eval-cases.json +529 -0
  82. package/core/skills/ai-agent/agent-evaluation/resources/eval-benchmarks/eval-manifest.yaml +61 -0
  83. package/core/skills/ai-agent/agent-evaluation/scripts/run-eval-benchmark.py +856 -0
  84. package/core/skills/ai-agent/agent-evaluation/tests/test_golden_benchmarks.py +248 -0
  85. package/core/skills/ai-agent/context-optimization/SKILL.md +61 -60
  86. package/core/skills/ai-agent/context-optimization/examples/context-pruner-and-reorderer.py +85 -0
  87. package/core/skills/ai-agent/context-optimization/references/token-budgeting-and-attention-allocation.md +47 -0
  88. package/core/skills/ai-agent/memory-hygiene/SKILL.md +13 -0
  89. package/core/skills/ai-agent/memory-hygiene/examples/memory-audit-and-compaction-routine.py +90 -0
  90. package/core/skills/ai-agent/memory-hygiene/references/agent-memory-vault-spec.md +137 -0
  91. package/core/skills/ai-agent/memory-hygiene/references/owasp-asi06-and-memory-poisoning-defense.md +38 -0
  92. package/core/skills/backend/add-api-endpoint/examples/express-zod-rfc9457-endpoint.md +329 -0
  93. package/core/skills/backend/add-api-endpoint/examples/kratos-go-clean-architecture-endpoint.md +405 -0
  94. package/core/skills/backend/add-api-endpoint/references/idempotency-and-rate-limiting.md +116 -0
  95. package/core/skills/backend/add-event-handler/SKILL.md +1 -1
  96. package/core/skills/backend/scaffold-new-service/SKILL.md +2 -1
  97. package/core/skills/backend/scaffold-new-service/references/deep-modules-and-seams.md +43 -0
  98. package/core/skills/business/elicit-requirements/SKILL.md +1 -0
  99. package/core/skills/commerce/handle-checkout-flow/SKILL.md +3 -1
  100. package/core/skills/commerce/handle-checkout-flow/examples/production-checkout-orchestrator.ts +185 -0
  101. package/core/skills/commerce/handle-checkout-flow/references/pci-dss-v4-and-agentic-checkout-specs.md +72 -0
  102. package/core/skills/commerce/integrate-payment-gateway/SKILL.md +3 -1
  103. package/core/skills/commerce/integrate-payment-gateway/examples/resilient-webhook-and-mpp-handler.ts +164 -0
  104. package/core/skills/commerce/integrate-payment-gateway/references/mpp-x402-and-webhook-security-specs.md +47 -0
  105. package/core/skills/commerce/manage-order-fulfillment/SKILL.md +3 -1
  106. package/core/skills/commerce/manage-order-fulfillment/examples/temporal-fulfillment-saga.ts +104 -0
  107. package/core/skills/commerce/manage-order-fulfillment/references/event-sourced-fulfillment-and-carrier-webhooks.md +58 -0
  108. package/core/skills/commerce/manage-product-catalog/SKILL.md +3 -1
  109. package/core/skills/commerce/manage-product-catalog/examples/hybrid-search-and-governance-pipeline.ts +120 -0
  110. package/core/skills/commerce/manage-product-catalog/references/semantic-vector-catalog-and-graphrag.md +54 -0
  111. package/core/skills/content/write-article/SKILL.md +1 -1
  112. package/core/skills/document/pdf/SKILL.md +1 -0
  113. package/core/skills/document/pdf/references/pdf-acroforms-and-pdfplumber-specs.md +54 -0
  114. package/core/skills/document/pdf/scripts/check_fillable_fields.py +144 -0
  115. package/core/skills/document/pdf/scripts/fill_fillable_fields.py +145 -0
  116. package/core/skills/documentation/configure-llms-txt/SKILL.md +2 -0
  117. package/core/skills/documentation/configure-llms-txt/examples/canonical-llms-txt-and-full-txt.md +45 -0
  118. package/core/skills/documentation/configure-llms-txt/references/llms-txt-and-llms-full-txt-standard.md +37 -0
  119. package/core/skills/documentation/write-documentation/SKILL.md +3 -1
  120. package/core/skills/documentation/write-documentation/examples/microservice-production-readme-and-api-docs.md +70 -0
  121. package/core/skills/documentation/write-documentation/references/diataxis-framework-and-doc-standards.md +62 -0
  122. package/core/skills/foundation/ai-risk-assessment/SKILL.md +3 -5
  123. package/core/skills/foundation/ai-risk-assessment/examples/genai-system-risk-register.md +67 -0
  124. package/core/skills/foundation/ai-risk-assessment/references/nist-ai-rmf-and-eu-ai-act-taxonomy.md +49 -0
  125. package/core/skills/foundation/conduct-research/SKILL.md +1 -1
  126. package/core/skills/foundation/discernment-nudge/SKILL.md +1 -0
  127. package/core/skills/foundation/plan-technical-delivery/SKILL.md +2 -1
  128. package/core/skills/foundation/release-notes/SKILL.md +2 -3
  129. package/core/skills/foundation/release-notes/examples/enterprise-platform-release-notes.md +42 -0
  130. package/core/skills/foundation/release-notes/references/keep-a-changelog-and-semver-governance.md +43 -0
  131. package/core/skills/foundation/systematic-debugging/SKILL.md +5 -0
  132. package/core/skills/foundation/write-tests/examples/anti-tautological-tdd-walkthrough.md +204 -0
  133. package/core/skills/foundation/write-tests/examples/testcontainers-kratos-integration-test.md +186 -0
  134. package/core/skills/foundation/write-tests/references/contract-and-chaos-testing.md +187 -0
  135. package/core/skills/frontend/INDEX.json +16 -0
  136. package/core/skills/frontend/add-page-route/SKILL.md +3 -1
  137. package/core/skills/frontend/add-page-route/examples/streaming-rsc-page-with-view-transition.tsx +133 -0
  138. package/core/skills/frontend/add-page-route/references/rsc-routing-and-view-transitions.md +72 -0
  139. package/core/skills/frontend/add-ui-component/SKILL.md +3 -1
  140. package/core/skills/frontend/add-ui-component/examples/compound-dialog-and-form-actions.tsx +193 -0
  141. package/core/skills/frontend/add-ui-component/references/react19-component-standards-and-anti-slop.md +55 -0
  142. package/core/skills/frontend/component-composition/SKILL.md +2 -1
  143. package/core/skills/frontend/component-composition/examples/headless-combobox-compound-component.tsx +207 -0
  144. package/core/skills/frontend/frontend-testing/SKILL.md +3 -1
  145. package/core/skills/frontend/frontend-testing/examples/playwright-e2e-with-msw-and-axe.spec.ts +87 -0
  146. package/core/skills/frontend/frontend-testing/references/playwright-msw-and-a11y-testing-standards.md +78 -0
  147. package/core/skills/frontend/implement-ai-disclosure/SKILL.md +118 -0
  148. package/core/skills/frontend/implement-webmcp/SKILL.md +3 -1
  149. package/core/skills/frontend/implement-webmcp/examples/webmcp-provider-and-hitl-modal.tsx +163 -0
  150. package/core/skills/frontend/implement-webmcp/references/webmcp-architecture-and-hitl-security.md +48 -0
  151. package/core/skills/frontend/integrate-api-client/SKILL.md +3 -1
  152. package/core/skills/frontend/integrate-api-client/examples/orval-query-and-streaming-mutation.ts +102 -0
  153. package/core/skills/frontend/integrate-api-client/references/orval-tanstack-query-and-streaming-specs.md +57 -0
  154. package/core/skills/frontend/setup-design-system/SKILL.md +3 -1
  155. package/core/skills/frontend/setup-design-system/examples/tailwind-v4-theme-and-dtcg-tokens.css +87 -0
  156. package/core/skills/frontend/setup-design-system/references/tailwind-v4-oklch-and-dtcg-tokens.md +61 -0
  157. package/core/skills/frontend/setup-visual-regression/SKILL.md +3 -1
  158. package/core/skills/frontend/setup-visual-regression/examples/visual-regression-playwright.config.ts +83 -0
  159. package/core/skills/frontend/setup-visual-regression/references/visual-regression-docker-and-masking-specs.md +46 -0
  160. package/core/skills/gamedev/abstract-input-actions/SKILL.md +2 -0
  161. package/core/skills/gamedev/abstract-input-actions/examples/input-action-manager.ts +85 -0
  162. package/core/skills/gamedev/abstract-input-actions/references/action-mapping-and-analog-deadzones.md +54 -0
  163. package/core/skills/gamedev/architect-ecs-systems/SKILL.md +2 -0
  164. package/core/skills/gamedev/architect-ecs-systems/examples/bevy-flecs-combat-system.rs +73 -0
  165. package/core/skills/gamedev/architect-ecs-systems/references/data-oriented-design-and-archetype-ecs.md +39 -0
  166. package/core/skills/gamedev/author-game-ai/SKILL.md +2 -0
  167. package/core/skills/gamedev/author-game-ai/examples/modular-behavior-tree-ai.ts +98 -0
  168. package/core/skills/gamedev/author-game-ai/references/behavior-trees-and-utility-ai-curves.md +47 -0
  169. package/core/skills/gamedev/configure-physics-collision/SKILL.md +2 -0
  170. package/core/skills/gamedev/configure-physics-collision/examples/kinematic-physics-substepping.cpp +100 -0
  171. package/core/skills/gamedev/configure-physics-collision/references/continuous-collision-detection-and-substepping.md +50 -0
  172. package/core/skills/gamedev/develop-gameplay-systems/SKILL.md +2 -0
  173. package/core/skills/gamedev/develop-gameplay-systems/examples/kinematic-character-controller.gd +86 -0
  174. package/core/skills/gamedev/develop-gameplay-systems/references/deterministic-gameplay-state-machines.md +42 -0
  175. package/core/skills/gamedev/implement-save-persistence/SKILL.md +2 -0
  176. package/core/skills/gamedev/implement-save-persistence/examples/versioned-save-manager.ts +127 -0
  177. package/core/skills/gamedev/implement-save-persistence/references/versioned-save-schemas-and-checksums.md +44 -0
  178. package/core/skills/gamedev/render-webgl-threejs/SKILL.md +2 -0
  179. package/core/skills/gamedev/render-webgl-threejs/examples/production-threejs-webgpu-scene.ts +116 -0
  180. package/core/skills/gamedev/render-webgl-threejs/references/webgpu-threejs-pbr-pipeline.md +56 -0
  181. package/core/skills/mmo/analyze-campaign-roi/SKILL.md +2 -0
  182. package/core/skills/mmo/analyze-campaign-roi/examples/campaign-roi-and-roas-dashboard.py +80 -0
  183. package/core/skills/mmo/analyze-campaign-roi/references/multi-touch-attribution-and-cpa-analytics.md +33 -0
  184. package/core/skills/mmo/create-automation-script/SKILL.md +2 -0
  185. package/core/skills/mmo/create-automation-script/examples/stealth-browser-automation-flow.ts +65 -0
  186. package/core/skills/mmo/create-automation-script/references/stealth-cdp-and-behavioral-mimicry.md +37 -0
  187. package/core/skills/mmo/deploy-mmo-infrastructure/SKILL.md +2 -0
  188. package/core/skills/mmo/deploy-mmo-infrastructure/examples/proxy-health-probe-and-rotation-daemon.py +75 -0
  189. package/core/skills/mmo/deploy-mmo-infrastructure/references/proxy-pool-rotation-and-anti-detect-specs.md +45 -0
  190. package/core/skills/mmo/deploy-proxyware-fleet/SKILL.md +2 -0
  191. package/core/skills/mmo/deploy-proxyware-fleet/examples/docker-compose-depin-light-node-fleet.yaml +52 -0
  192. package/core/skills/mmo/deploy-proxyware-fleet/references/depin-bandwidth-monetization-node-specs.md +43 -0
  193. package/core/skills/mmo/generate-mmo-content/SKILL.md +2 -0
  194. package/core/skills/mmo/generate-mmo-content/examples/pseo-programmatic-page-generator.ts +76 -0
  195. package/core/skills/mmo/generate-mmo-content/references/pseo-landing-pages-and-social-video-hooks.md +39 -0
  196. package/core/skills/mmo/manage-mmo-assets/SKILL.md +2 -0
  197. package/core/skills/mmo/manage-mmo-assets/examples/mmo-asset-vault-manager.py +63 -0
  198. package/core/skills/mmo/manage-mmo-assets/references/mmo-asset-rbac-and-vault-isolation.md +38 -0
  199. package/core/skills/mmo/setup-tracking-system/SKILL.md +2 -0
  200. package/core/skills/mmo/setup-tracking-system/examples/meta-capi-s2s-event-dispatcher.ts +79 -0
  201. package/core/skills/mmo/setup-tracking-system/references/server-to-server-postback-and-capi-specs.md +45 -0
  202. package/core/skills/platform/add-telemetry-instrumentation/SKILL.md +2 -0
  203. package/core/skills/platform/add-telemetry-instrumentation/examples/kratos-otel-middleware-instrumentation.go +87 -0
  204. package/core/skills/platform/add-telemetry-instrumentation/references/opentelemetry-semantic-conventions-2026.md +37 -0
  205. package/core/skills/platform/aws-infrastructure/SKILL.md +2 -0
  206. package/core/skills/platform/aws-infrastructure/examples/opentofu-eks-pod-identity-vpc.tf +101 -0
  207. package/core/skills/platform/aws-infrastructure/references/opentofu-aws-zero-trust-and-irsa.md +40 -0
  208. package/core/skills/platform/setup-deployment/SKILL.md +4 -0
  209. package/core/skills/platform/setup-deployment/examples/kustomize-production-service-manifests.yaml +123 -0
  210. package/core/skills/platform/setup-deployment/references/interactive-hitl-wizard.md +55 -0
  211. package/core/skills/platform/setup-deployment/references/k8s-gitops-and-kustomize-invariants.md +40 -0
  212. package/core/skills/platform/supply-chain-security/SKILL.md +2 -0
  213. package/core/skills/platform/supply-chain-security/examples/github-actions-sbom-cosign.yaml +57 -0
  214. package/core/skills/platform/supply-chain-security/references/slsa-provenance-and-sbom-sigstore.md +60 -0
  215. package/core/skills/product/build-story-map/SKILL.md +2 -0
  216. package/core/skills/repo-ops/review-code/SKILL.md +2 -2
  217. package/core/skills/repo-ops/review-code/examples/adversarial-two-axis-pr-review.md +167 -0
  218. package/core/skills/repo-ops/review-code/examples/ai-vibe-slop-remediation.md +220 -0
  219. package/core/skills/repo-ops/review-code/references/supply-chain-and-migration-safety.md +103 -0
  220. package/core/skills/repo-ops/review-service/SKILL.md +1 -1
  221. package/core/skills/security-data/database-maintenance/SKILL.md +1 -1
  222. package/core/skills/security-data/manage-secrets/SKILL.md +2 -0
  223. package/core/skills/security-data/manage-secrets/examples/external-secrets-vault-crds.yaml +53 -0
  224. package/core/skills/security-data/manage-secrets/references/zero-trust-secret-rotation-and-eso.md +30 -0
  225. package/core/skills/security-data/manage-vietnam-accounting/SKILL.md +7 -7
  226. package/core/skills/security-data/prompt-injection-defense/SKILL.md +2 -0
  227. package/core/skills/security-data/prompt-injection-defense/examples/bounded-tool-execution-wrapper.py +78 -0
  228. package/core/skills/security-data/prompt-injection-defense/references/prompt-injection-taxonomy-and-delimiters.md +37 -0
  229. package/core/skills/security-data/reverse-engineer-binary/SKILL.md +2 -0
  230. package/core/skills/security-data/reverse-engineer-binary/examples/binary-triage-and-vulnerability-dossier.md +58 -0
  231. package/core/skills/security-data/reverse-engineer-binary/references/ghidra-radare2-and-rea-evidence-ledgers.md +43 -0
  232. package/core/skills/security-data/security-audit/SKILL.md +3 -1
  233. package/core/skills/security-data/security-audit/examples/enterprise-service-security-audit-report.md +54 -0
  234. package/core/skills/security-data/security-audit/references/owasp-asi-and-cvss4-threat-modeling.md +39 -0
  235. package/core/skills/security-data/skill-preflight-ast-check/SKILL.md +2 -0
  236. package/core/skills/security-data/skill-preflight-ast-check/references/ast-lethal-trifecta-and-static-vetting.md +38 -0
  237. package/core/skills/security-data/skill-preflight-ast-check/scripts/scan-skill-ast.py +127 -0
  238. package/overlays/README.md +1 -1
  239. package/overlays/security-research/README.md +1 -1
  240. package/package.json +2 -2
  241. package/overlays/security-research/skills/reverse-engineer-binary/SKILL.md +0 -129
@@ -0,0 +1,45 @@
1
+ # Server-to-Server (S2S) Postback & Meta CAPI Specifications (2026)
2
+
3
+ ## 1. Tracking Topology in Cookieless Environments
4
+
5
+ With third-party cookie deprecation, Apple Safari ITP, and aggressive ad-blocker filtering, client-side pixel tracking experiences $>35\%$ signal loss. S2S architecture bridges edge capture to platform endpoints:
6
+
7
+ ```
8
+ User Click on Ad (Meta / TikTok / Google)
9
+ │ (Query Params: fbclid, gclid, ttclid)
10
+ ▼
11
+ Edge Proxy / CDN Worker (Cloudflare)
12
+ - Extracts parameters
13
+ - Writes First-Party HTTP-Only Cookies (fbp, fbc, gclid)
14
+ - Generates Shared UUIDv4 event_id
15
+ │
16
+ ├──────────────────────────────┐
17
+ ▼ (Client Web Pixel) ▼ (S2S API Gateway)
18
+ Client Browser Event Server-Side Event Dispatcher
19
+ (Subject to ad-blockers) - Meta CAPI v20+
20
+ │ - TikTok Events API v1.3
21
+ │ - Google Enhanced Conversions
22
+ └──────────────┬───────────────┘
23
+ ▼
24
+ Ad Platform Conversion Hub
25
+ (Deduplicated via event_id)
26
+ ```
27
+
28
+ ## 2. Meta Conversions API (CAPI v20+) Standards
29
+
30
+ ### 2.1 Event Match Quality (EMQ) Optimization
31
+ Target EMQ $\ge 8.0/10$ requires sending rich normalized user data parameters:
32
+ - `em`: SHA-256 lowercase email, leading/trailing whitespace stripped.
33
+ - `ph`: SHA-256 phone number normalized to international E.164 format (`+1...`).
34
+ - `fbp`: First-party Facebook browser cookie.
35
+ - `fbc`: First-party Facebook click identifier (`fb.1.{timestamp}.{fbclid}`).
36
+ - `client_ip_address`: True client IPv4 or IPv6 (extracted from `CF-Connecting-IP`).
37
+ - `client_user_agent`: Unaltered browser user agent string.
38
+
39
+ ### 2.2 Deduplication Window
40
+ Meta deduplicates events received within a 48-hour window matching on `(event_name, event_id)`.
41
+
42
+ ## 3. Click-to-Conversion Time (CTIT) Fraud Filtering
43
+
44
+ - **Automated Script Injection**: If $\Delta t_{\text{conversion}} - t_{\text{click}} < 2.5\text{s}$, the transaction is discarded as programmatic bot click injection.
45
+ - **Click Hijacking**: Conversion delays $> 7\text{ days}$ on short-window impulse offers are quarantined for attribution review.
@@ -91,3 +91,5 @@ When this skill is invoked as part of a coordinated multi-role delivery, emit:
91
91
  - **incident-report**: Connect telemetry evidence and trace IDs to incident postmortems
92
92
  - **setup-deployment**: Wire telemetry config into runtime source of truth
93
93
  - **performance-profiling**: Measure latency, throughput, or resource bottlenecks
94
+ - Companion reference: `references/opentelemetry-semantic-conventions-2026.md`
95
+ - Companion example: `examples/kratos-otel-middleware-instrumentation.go`
@@ -0,0 +1,87 @@
1
+ package telemetry
2
+
3
+ import (
4
+ "context"
5
+ "time"
6
+
7
+ "github.com/go-kratos/kratos/v2/middleware"
8
+ "github.com/go-kratos/kratos/v2/transport"
9
+ "go.opentelemetry.io/otel"
10
+ "go.opentelemetry.io/otel/attribute"
11
+ "go.opentelemetry.io/otel/metric"
12
+ "go.opentelemetry.io/otel/propagation"
13
+ semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
14
+ "go.opentelemetry.io/otel/trace"
15
+ )
16
+
17
+ // TelemetryMiddleware creates a Kratos middleware instrumenting distributed tracing and metrics.
18
+ func TelemetryMiddleware(tracerName string, meterName string) middleware.Middleware {
19
+ tracer := otel.GetTracerProvider().Tracer(tracerName)
20
+ meter := otel.GetMeterProvider().Meter(meterName)
21
+
22
+ durationHist, _ := meter.Float64Histogram(
23
+ "http_server_duration_seconds",
24
+ metric.WithDescription("HTTP server request latency in seconds"),
25
+ metric.WithUnit("s"),
26
+ )
27
+
28
+ return func(handler middleware.Handler) middleware.Handler {
29
+ return func(ctx context.Context, req interface{}) (interface{}, error) {
30
+ startTime := time.Now()
31
+
32
+ var operation string
33
+ if tr, ok := transport.FromServerContext(ctx); ok {
34
+ operation = tr.Operation()
35
+ // Extract W3C TraceContext from incoming headers
36
+ ctx = otel.GetTextMapPropagator().Extract(ctx, propagation.HeaderCarrier(tr.RequestHeader()))
37
+ }
38
+
39
+ // Start active OpenTelemetry span
40
+ ctx, span := tracer.Start(
41
+ ctx,
42
+ operation,
43
+ trace.WithSpanKind(trace.SpanKindServer),
44
+ trace.WithAttributes(
45
+ semconv.RPCSystemKey.String("kratos"),
46
+ attribute.String("rpc.service", operation),
47
+ ),
48
+ )
49
+ defer span.End()
50
+
51
+ reply, err := handler(ctx, req)
52
+
53
+ duration := time.Since(startTime).Seconds()
54
+ statusCode := "200"
55
+ if err != nil {
56
+ statusCode = "500"
57
+ span.RecordError(err)
58
+ span.SetAttributes(attribute.String("error.type", "internal_error"))
59
+ }
60
+
61
+ // Record Prometheus / OTel duration histogram
62
+ durationHist.Record(ctx, duration, metric.WithAttributes(
63
+ attribute.String("operation", operation),
64
+ attribute.String("status_code", statusCode),
65
+ ))
66
+
67
+ return reply, err
68
+ }
69
+ }
70
+ }
71
+
72
+ // RecordGenAiSpan adds GenAI semantic convention attributes to an active span.
73
+ func RecordGenAiSpan(ctx context.Context, model string, inputTokens, outputTokens int, ttft time.Duration) {
74
+ span := trace.SpanFromContext(ctx)
75
+ if !span.IsRecording() {
76
+ return
77
+ }
78
+
79
+ span.SetAttributes(
80
+ attribute.String("gen_ai.system", "openai"),
81
+ attribute.String("gen_ai.response.model", model),
82
+ attribute.Int("gen_ai.usage.input_tokens", inputTokens),
83
+ attribute.Int("gen_ai.usage.output_tokens", outputTokens),
84
+ attribute.Int("gen_ai.usage.tokens", inputTokens+outputTokens),
85
+ attribute.Float64("gen_ai.server.time_to_first_token", ttft.Seconds()),
86
+ )
87
+ }
@@ -0,0 +1,37 @@
1
+ # OpenTelemetry Semantic Conventions & GenAI Observability Standards (2026)
2
+
3
+ ## 1. W3C TraceContext & Distributed Propagation
4
+
5
+ ### 1.1 Trace Context Headers
6
+ Distributed tracing requires unbroken propagation of context across all process boundaries, asynchronous message queues (Kafka, Dapr, RabbitMQ), and network hops:
7
+ - **`traceparent`**: `00-{trace_id}-{parent_id}-{trace_flags}` (e.g. `00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01`).
8
+ - **`tracestate`**: Preserves vendor-specific telemetry attributes across multi-cloud boundaries.
9
+
10
+ ---
11
+
12
+ ## 2. OpenTelemetry GenAI Semantic Conventions (v1.30+)
13
+
14
+ When instrumenting LLM agent operations, opt-in via `OTEL_SEMCONV_STABILITY_OPT_IN=genai` and emit standardized attributes:
15
+ - `gen_ai.system`: Provider identifier (`openai`, `anthropic`, `vllm`).
16
+ - `gen_ai.request.model` & `gen_ai.response.model`: Model IDs (e.g. `gpt-4o`, `deepseek-r1`).
17
+ - `gen_ai.usage.input_tokens`: Count of prompt/context tokens.
18
+ - `gen_ai.usage.output_tokens`: Count of generated tokens.
19
+ - `gen_ai.usage.tokens`: Total aggregated token consumption.
20
+ - `gen_ai.response.finish_reasons`: Array of termination causes (`stop`, `length`, `tool_calls`).
21
+ - `gen_ai.server.time_to_first_token`: Duration from request initiation to arrival of the first streaming chunk (TTFT).
22
+
23
+ ---
24
+
25
+ ## 3. Multi-Window Multi-Burn-Rate (MWMBR) SLI Alerting
26
+
27
+ Alerting on simple error rates causes false positives during off-peak hours and delayed notification during catastrophic regressions:
28
+ - **Dual Window Evaluation**: Evaluate error budget consumption across short windows (5m, 30m, 2h) paired with long windows (1h, 6h, 3d).
29
+ - **Empty-Vector Coalescing**: Guard against alert flapping when traffic drops to zero:
30
+ ```promql
31
+ (
32
+ sum(rate(http_requests_total{status=~"5.."}[5m]))
33
+ /
34
+ sum(rate(http_requests_total[5m]))
35
+ ) > (14.4 * (1 - 0.999))
36
+ or on() vector(0)
37
+ ```
@@ -119,3 +119,5 @@ Skip emission for local sandbox experimentation where no cloud resources are pro
119
119
  - **manage-secrets**: For configuring AWS Secrets Manager and External Secrets Operator (ESO) integration.
120
120
  - **security-audit**: For auditing IAM policies, SCPs, and CIS AWS Foundations benchmarks.
121
121
  - **system-design**: For cross-cloud architecture and hardware capacity modeling.
122
+ - Companion reference: `references/opentofu-aws-zero-trust-and-irsa.md`
123
+ - Companion example: `examples/opentofu-eks-pod-identity-vpc.tf`
@@ -0,0 +1,101 @@
1
+ terraform {
2
+ required_version = ">= 1.8.0"
3
+ required_providers {
4
+ aws = {
5
+ source = "hashicorp/aws"
6
+ version = "~> 5.75"
7
+ }
8
+ }
9
+
10
+ # Client-side State KMS Encryption Block (OpenTofu v1.13+)
11
+ encryption {
12
+ key_provider "aws_kms" "primary" {
13
+ kms_key_id = "arn:aws:kms:us-east-1:123456789012:key/3a8f7c19-b2e0-4d88-e7b5-1f0923a10582"
14
+ region = "us-east-1"
15
+ key_spec = "AES_256"
16
+ }
17
+ method "aes_gcm" "state_encryption" {
18
+ keys = key_provider.aws_kms.primary
19
+ }
20
+ state {
21
+ method = method.aes_gcm.state_encryption
22
+ enforced = true
23
+ }
24
+ plan {
25
+ method = method.aes_gcm.state_encryption
26
+ enforced = true
27
+ }
28
+ }
29
+ }
30
+
31
+ provider "aws" {
32
+ region = "us-east-1"
33
+ default_tags {
34
+ tags = {
35
+ Environment = "production"
36
+ Team = "platform-engineering"
37
+ Service = "eks-core"
38
+ CostCenter = "cc-9812"
39
+ }
40
+ }
41
+ }
42
+
43
+ # 1. Zero-Trust VPC Topology (Private Subnets with VPC Endpoints)
44
+ resource "aws_vpc" "main" {
45
+ cidr_block = "10.100.0.0/16"
46
+ enable_dns_hostnames = true
47
+ enable_dns_support = true
48
+
49
+ tags = {
50
+ Name = "prod-eks-vpc"
51
+ }
52
+ }
53
+
54
+ # 2. IAM Role for EKS Pod Identity
55
+ resource "aws_iam_role" "s3_access_role" {
56
+ name = "order-processing-s3-access"
57
+
58
+ assume_role_policy = jsonencode({
59
+ Version = "2012-10-17"
60
+ Statement = [
61
+ {
62
+ Effect = "Allow"
63
+ Principal = {
64
+ Service = "pods.eks.amazonaws.com"
65
+ }
66
+ Action = [
67
+ "sts:AssumeRole",
68
+ "sts:TagSession"
69
+ ]
70
+ }
71
+ ]
72
+ })
73
+ }
74
+
75
+ # 3. Scoped Least-Privilege Policy
76
+ resource "aws_iam_policy" "s3_order_receipts" {
77
+ name = "order-receipts-s3-bucket-access"
78
+ policy = jsonencode({
79
+ Version = "2012-10-17"
80
+ Statement = [
81
+ {
82
+ Effect = "Allow"
83
+ Action = ["s3:GetObject", "s3:PutObject"]
84
+ Resource = "arn:aws:s3:::prod-order-receipts-2026/*"
85
+ }
86
+ ]
87
+ })
88
+ }
89
+
90
+ resource "aws_iam_role_policy_attachment" "attach_s3" {
91
+ role = aws_iam_role.s3_access_role.name
92
+ policy_arn = aws_iam_policy.s3_order_receipts.arn
93
+ }
94
+
95
+ # 4. EKS Pod Identity Association
96
+ resource "aws_eks_pod_identity_association" "order_service" {
97
+ cluster_name = "prod-core-eks"
98
+ namespace = "production"
99
+ service_account = "order-service-sa"
100
+ role_arn = aws_iam_role.s3_access_role.arn
101
+ }
@@ -0,0 +1,40 @@
1
+ # OpenTofu AWS Zero-Trust & EKS Pod Identity Architecture (2026)
2
+
3
+ ## 1. OpenTofu Client-Side State Encryption with AWS KMS
4
+
5
+ ### 1.1 In-Memory Encryption (AES-GCM)
6
+ Remote Terraform/OpenTofu state files frequently leak plaintext database passwords, private keys, and token hashes. OpenTofu v1.13+ enforces client-side state encryption before writing to S3:
7
+ - The execution engine encrypts both state and plan files in memory using an AWS KMS Customer Master Key (CMK).
8
+ - Unencrypted state files uploaded to remote storage buckets are blocked via strict S3 bucket policies (`aws:SecureTransport` and `s3:x-amz-server-side-encryption`).
9
+
10
+ ---
11
+
12
+ ## 2. AWS IAM Zero-Trust & EKS Pod Identity (v1.31+)
13
+
14
+ ### 2.1 EKS Pod Identity Association
15
+ Legacy IAM Roles for Service Accounts (IRSA) required complex OIDC provider thumbprints, STS AssumeRoleWithWebIdentity calls, and mutual IAM trust relationship mutations for every cluster.
16
+ - **EKS Pod Identity**: Modern clusters deploy `pods.eks.amazonaws.com` trust policies.
17
+ - **Zero Static Keys**: Root SCPs deny `iam:CreateAccessKey` cluster-wide.
18
+ - Pods obtain temporary, automatically rotated 60-minute AWS session credentials injected into the container environment via the AWS SDK:
19
+ ```json
20
+ {
21
+ "Version": "2012-10-17",
22
+ "Statement": [
23
+ {
24
+ "Effect": "Allow",
25
+ "Principal": { "Service": "pods.eks.amazonaws.com" },
26
+ "Action": ["sts:AssumeRole", "sts:TagSession"]
27
+ }
28
+ ]
29
+ }
30
+ ```
31
+
32
+ ---
33
+
34
+ ## 3. Bottlerocket Distroless EKS Node Pools
35
+
36
+ - **Distroless Immutable Root**: Worker nodes run AWS Bottlerocket container Linux.
37
+ - **Security Invariants**:
38
+ - `dm-verity`: Cryptographic kernel block-level integrity verification halting tampered nodes immediately.
39
+ - SELinux enforcing by default; no interactive shells, package managers, or Python interpreters installed.
40
+ - Updates apply atomically via A/B partition reboots.
@@ -30,6 +30,7 @@ Use this skill when code changes need matching deployment or runtime configurati
30
30
  - **GITOPS-APPLICATIONSET-RECONCILE**: When defining multi-environment or multi-service deployments via GitOps, use ArgoCD `ApplicationSet` with matrix/list generators and explicit `ignoreDifferences` for dynamically mutated fields (e.g. replica count managed by HPA, webhook-injected annotations) to prevent reconciliation loops.
31
31
  - **ROLLOUTS-ANALYSIS-GATE**: For critical user-facing services, prefer Argo Rollouts or Flagger with automated Prometheus `MetricAnalysis` (P99 latency, 5xx error thresholds) over naive rolling updates; include empty vector coalescing (`or on() vector(0)`) to guard against false rollbacks during low-traffic windows.
32
32
  - **EXTERNAL-SECRETS-DECLARATIVE**: Never commit raw secrets or base64-encoded credentials to deployment repositories; use External Secrets Operator (`ExternalSecret` manifests referencing `ClusterSecretStore`) to synchronize credentials from HashiCorp Vault or AWS Secrets Manager into native Kubernetes secrets at runtime.
33
+ - **INTERACTIVE-HITL-WIZARD**: For human-gated operational steps (OAuth grants, KMS secret injection, DB cutover), scaffold stage-checkpointed bash wizards (`set -euo pipefail`, silent `read -rsp`, `trap` cleanup for `Ctrl-C` resume) per [`references/interactive-hitl-wizard.md`](references/interactive-hitl-wizard.md).
33
34
 
34
35
  ## Suggested Process
35
36
 
@@ -134,3 +135,6 @@ Skip emission for solo refactor work where no downstream handoff is expected.
134
135
  - **debug-runtime-platform**: Investigate rollout failures after config changes
135
136
  - **commit-code**: Prepare deployment changes for delivery
136
137
  - **deploy-mobile-app**: Deploy mobile applications via EAS Build, EAS Update (OTA), and App Store / Google Play submissions
138
+ - Companion reference: `references/k8s-gitops-and-kustomize-invariants.md`
139
+ - Companion reference: `references/interactive-hitl-wizard.md`
140
+ - Companion example: `examples/kustomize-production-service-manifests.yaml`
@@ -0,0 +1,123 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: order-orchestrator
5
+ namespace: production
6
+ labels:
7
+ app.kubernetes.io/name: order-orchestrator
8
+ app.kubernetes.io/part-of: order-processing
9
+ spec:
10
+ replicas: 3
11
+ strategy:
12
+ type: RollingUpdate
13
+ rollingUpdate:
14
+ maxSurge: 1
15
+ maxUnavailable: 0
16
+ selector:
17
+ matchLabels:
18
+ app.kubernetes.io/name: order-orchestrator
19
+ template:
20
+ metadata:
21
+ labels:
22
+ app.kubernetes.io/name: order-orchestrator
23
+ spec:
24
+ securityContext:
25
+ runAsNonRoot: true
26
+ runAsUser: 10001
27
+ runAsGroup: 10001
28
+ fsGroup: 10001
29
+ containers:
30
+ - name: app
31
+ image: ghcr.io/my-org/order-orchestrator:v2.4.0@sha256:3a8f7c19b2e04d88e7b51f0923a10582d90f23b819ce4108d927a44fbc8112e5
32
+ securityContext:
33
+ readOnlyRootFilesystem: true
34
+ allowPrivilegeEscalation: false
35
+ capabilities:
36
+ drop: ["ALL"]
37
+ ports:
38
+ - containerPort: 8080
39
+ name: http
40
+ - containerPort: 9090
41
+ name: grpc
42
+ resources:
43
+ requests:
44
+ cpu: 500m
45
+ memory: 512Mi
46
+ limits:
47
+ cpu: 2000m
48
+ memory: 1024Mi
49
+ startupProbe:
50
+ httpGet:
51
+ path: /health/live
52
+ port: 8080
53
+ failureThreshold: 30
54
+ periodSeconds: 2
55
+ livenessProbe:
56
+ httpGet:
57
+ path: /health/live
58
+ port: 8080
59
+ periodSeconds: 10
60
+ timeoutSeconds: 3
61
+ readinessProbe:
62
+ httpGet:
63
+ path: /health/ready
64
+ port: 8080
65
+ periodSeconds: 5
66
+ timeoutSeconds: 2
67
+ ---
68
+ apiVersion: v1
69
+ kind: Service
70
+ metadata:
71
+ name: order-orchestrator
72
+ namespace: production
73
+ spec:
74
+ type: ClusterIP
75
+ selector:
76
+ app.kubernetes.io/name: order-orchestrator
77
+ ports:
78
+ - name: http
79
+ port: 80
80
+ targetPort: 8080
81
+ - name: grpc
82
+ port: 9090
83
+ targetPort: 9090
84
+ ---
85
+ apiVersion: policy/v1
86
+ kind: PodDisruptionBudget
87
+ metadata:
88
+ name: order-orchestrator-pdb
89
+ namespace: production
90
+ spec:
91
+ minAvailable: 2
92
+ selector:
93
+ matchLabels:
94
+ app.kubernetes.io/name: order-orchestrator
95
+ ---
96
+ apiVersion: networking.k8s.io/v1
97
+ kind: NetworkPolicy
98
+ metadata:
99
+ name: order-orchestrator-netpol
100
+ namespace: production
101
+ spec:
102
+ podSelector:
103
+ matchLabels:
104
+ app.kubernetes.io/name: order-orchestrator
105
+ policyTypes:
106
+ - Ingress
107
+ - Egress
108
+ ingress:
109
+ - from:
110
+ - podSelector:
111
+ matchLabels:
112
+ app.kubernetes.io/name: api-gateway
113
+ ports:
114
+ - protocol: TCP
115
+ port: 8080
116
+ egress:
117
+ - to:
118
+ - namespaceSelector:
119
+ matchLabels:
120
+ kubernetes.io/metadata.name: database
121
+ ports:
122
+ - protocol: TCP
123
+ port: 5432
@@ -0,0 +1,55 @@
1
+ # Interactive Human-In-The-Loop (HITL) Setup Wizard Reference
2
+
3
+ When operational onboarding, OAuth provisioning, KMS rotation, or DNS/database cutover requires sequential human actions mixed with automated verification, generate an idempotent, stage-checkpointed Bash wizard rather than fragile copy-paste checklists.
4
+
5
+ ---
6
+
7
+ ## 1. Core Architectural Invariants
8
+
9
+ 1. **Strict Shell Safety (`set -euo pipefail`):** Fail fast on unset variables or broken pipes. Never use unquoted variable expansion or dangerous pipelines.
10
+ 2. **Stage Checkpoint Persistence:** Store completed stage IDs in a local state file (e.g. `.wizard-state` ignored by Git) so humans can safely abort (`Ctrl-C` / `SIGINT`) and resume at the exact interrupted step without repeating earlier steps.
11
+ 3. **Zero Plaintext Secret Leakage:**
12
+ - Capture tokens, passwords, and API keys via silent terminal prompts (`read -rsp`).
13
+ - Never print secrets to `stdout`/`stderr`, command history, or LLM agent logs.
14
+ - Persist captured secrets directly into gitignored `.env` files (`chmod 600`) or secret managers (`gh secret set`, AWS Secrets Manager, HashiCorp Vault).
15
+ 4. **Trap & Clean Interrupted Output:** Register a `trap cleanup EXIT INT TERM` handler that prints exact resume status without dumping environment variables.
16
+
17
+ ---
18
+
19
+ ## 2. Canonical Skeleton Pattern
20
+
21
+ ```bash
22
+ #!/usr/bin/env bash
23
+ set -euo pipefail
24
+
25
+ STATE_FILE="${STATE_FILE:-.hitl-wizard.state}"
26
+ touch "$STATE_FILE"
27
+
28
+ cleanup() {
29
+ local rc=$?
30
+ stty echo 2>/dev/null || true
31
+ if [[ $rc -ne 0 ]]; then
32
+ echo "[wizard] Interrupted (exit $rc). Progress saved in $STATE_FILE — re-run to resume." >&2
33
+ fi
34
+ }
35
+ trap cleanup EXIT INT TERM
36
+
37
+ stage_done() { grep -qxF "$1" "$STATE_FILE" 2>/dev/null; }
38
+ mark_done() { echo "$1" >> "$STATE_FILE"; }
39
+
40
+ run_stage() {
41
+ local id="$1" title="$2" fn="$3"
42
+ if stage_done "$id"; then
43
+ echo "[skip] $id: $title (already completed)"
44
+ return 0
45
+ fi
46
+ echo "=== Stage $id: $title ==="
47
+ "$fn"
48
+ mark_done "$id"
49
+ }
50
+ ```
51
+
52
+ ---
53
+
54
+ ## 3. Verification Before Proceeding
55
+ Each stage MUST end with a deterministic health check (`curl -sf`, CLI `whoami`, dry-run validation, or container health probe) before calling `mark_done`. Never mark a human step complete without checking its external post-condition.
@@ -0,0 +1,40 @@
1
+ # Kubernetes GitOps & Kustomize Production Invariants (2026)
2
+
3
+ ## 1. Kustomize Multi-Tier Architecture
4
+
5
+ ### 1.1 Four-Tier Folder Hierarchy
6
+ Production Kubernetes deployments avoid copy-paste drift by enforcing a strict four-tier hierarchy:
7
+ ```
8
+ deploy/
9
+ ├── base/ # Canonical workload definition (Deployment, Service, ServiceAccount)
10
+ ├── components/ # Optional composable traits (ingress, hpa, network-policy, tracing)
11
+ └── overlays/
12
+ ├── dev/ # Single replica, debug logging, local ingress
13
+ ├── staging/ # Multi-replica, external secrets, synthetic monitoring
14
+ └── production/ # Multi-AZ HPA, PodDisruptionBudget, strict NetworkPolicy
15
+ ```
16
+
17
+ ---
18
+
19
+ ## 2. Workload Resilience & Probe Specifications
20
+
21
+ ### 2.1 Three-Probe Architecture for Microservices
22
+ - **`startupProbe`**: Handles slow initialization (e.g. JVM warm-up or Go database migration runs). Prevents aggressive liveness probes from prematurely killing pods during boot:
23
+ ```yaml
24
+ startupProbe:
25
+ httpGet:
26
+ path: /health/live
27
+ port: 8080
28
+ failureThreshold: 30
29
+ periodSeconds: 2
30
+ ```
31
+ - **`livenessProbe`**: Checks process deadlock and internal thread health (`periodSeconds: 10`, `timeoutSeconds: 3`).
32
+ - **`readinessProbe`**: Evaluates downstream connectivity (database pool availability, cache connectivity). Pod is removed from Service endpoints during degraded windows without restarting the container.
33
+
34
+ ---
35
+
36
+ ## 3. High-Availability Release Gates
37
+
38
+ - **Immutable Tag Invariant**: `:latest` tags are strictly blocked in production manifests. Every image reference must pin an immutable Git commit SHA or SemVer release tag (`ghcr.io/org/svc:v2.4.0@sha256:...`).
39
+ - **PodDisruptionBudget (PDB)**: Every replicated service must configure a PDB (`minAvailable: 1` or `maxUnavailable: 25%`) to guarantee availability during voluntary node drain operations and cluster upgrades.
40
+ - **Resource Limits & Requests**: CPU and Memory requests must equal limits for burst-sensitive workloads, or specify explicit requests to enable Kubernetes fair-share scheduling.
@@ -194,3 +194,5 @@ Skip emission for solo refactor work where no downstream handoff is expected.
194
194
  - **manage-secrets**: securely store signing keys and registry credentials
195
195
  - **security-audit**: holistic security review that references SBOM findings
196
196
  - **configure-mcp**: every MCP server added must have SBOM entry and registry provenance check
197
+ - Companion reference: `references/slsa-provenance-and-sbom-sigstore.md`
198
+ - Companion example: `examples/github-actions-sbom-cosign.yaml`
@@ -0,0 +1,57 @@
1
+ name: Secure Build, SBOM & Keyless Signing
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+
8
+ permissions:
9
+ contents: read
10
+ packages: write
11
+ id-token: write # Required for Sigstore keyless OIDC authentication
12
+
13
+ jobs:
14
+ build-and-sign:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: Checkout Source
18
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 pinned SHA
19
+
20
+ - name: Install Cosign
21
+ uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
22
+
23
+ - name: Set up Docker Buildx
24
+ uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
25
+
26
+ - name: Log in to GitHub Container Registry
27
+ uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
28
+ with:
29
+ registry: ghcr.io
30
+ username: ${{ github.actor }}
31
+ password: ${{ secrets.GITHUB_TOKEN }}
32
+
33
+ - name: Build and Push Container Image
34
+ id: build-image
35
+ uses: docker/build-push-action@ca877d9245402d1537745e0e316eab4f2b1b5631 # v6.13.0
36
+ with:
37
+ context: .
38
+ push: true
39
+ tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
40
+
41
+ - name: Generate CycloneDX v1.6 SBOM via Syft
42
+ uses: anchore/sbom-action@f325610c9f50a54015d37c8d16cb3b0e2c8f4de0 # v0.18.0
43
+ with:
44
+ image: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
45
+ format: cyclonedx-json
46
+ output-file: sbom.cdx.json
47
+
48
+ - name: Keyless Sign Image and Attest SBOM via Cosign
49
+ run: |
50
+ IMAGE_URI="ghcr.io/${{ github.repository }}:${{ github.ref_name }}"
51
+ IMAGE_DIGEST="${{ steps.build-image.outputs.digest }}"
52
+
53
+ # Keyless sign container image
54
+ cosign sign --yes "${IMAGE_URI}@${IMAGE_DIGEST}"
55
+
56
+ # Attest CycloneDX SBOM to image digest
57
+ cosign attest --yes --predicate sbom.cdx.json --type cyclonedx "${IMAGE_URI}@${IMAGE_DIGEST}"