@vesviet/agent-skills 5.6.0 → 5.7.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 (184) hide show
  1. package/INDEX.md +5 -5
  2. package/README.md +1 -1
  3. package/VERSION +1 -1
  4. package/adapters/antigravity/a2a-config.template.yaml +1 -1
  5. package/adapters/antigravity/role-skill-index.json +12 -12
  6. package/adapters/claude/CLAUDE_ADAPTER.md +1 -1
  7. package/adapters/cursor/README.md +185 -185
  8. package/bin/agent-skills.mjs +17 -14
  9. package/core/contracts/README.md +1 -1
  10. package/core/contracts/schemas/api-contract-spec.json +191 -191
  11. package/core/contracts/schemas/data-pipeline-spec.json +1 -1
  12. package/core/contracts/schemas/design-tokens-spec.json +19 -0
  13. package/core/contracts/schemas/feature-ticket.json +1293 -1293
  14. package/core/contracts/schemas/pull-request-spec.json +338 -338
  15. package/core/contracts/schemas/references/detailed/01-solution-and-governance.md +19 -19
  16. package/core/contracts/schemas/references/detailed/02-engineering-delivery.md +93 -93
  17. package/core/contracts/schemas/references/detailed/04-finance-accounting-and-compliance.md +54 -54
  18. package/core/contracts/schemas/references/detailed/05-design-and-content.md +92 -92
  19. package/core/contracts/schemas/references/detailed/06-seo-and-publishing.md +48 -48
  20. package/core/contracts/schemas/references/detailed/07-a2a-protocol.md +85 -85
  21. package/core/contracts/schemas/security-audit.json +143 -12
  22. package/core/contracts/schemas/system-design-spec.json +9 -1
  23. package/core/contracts/schemas/test-report.json +530 -530
  24. package/core/contracts/schemas/ux-flow-spec.json +66 -0
  25. package/core/roles/ai-systems-engineer.md +31 -18
  26. package/core/roles/aws-engineer.md +33 -29
  27. package/core/roles/backend-developer.md +6 -4
  28. package/core/roles/content-manager.md +7 -7
  29. package/core/roles/data-engineer.md +39 -36
  30. package/core/roles/qa-engineer.md +18 -18
  31. package/core/roles/references/ai-systems-engineer-review-checklist.md +11 -3
  32. package/core/roles/references/aws-engineer-review-checklist.md +29 -16
  33. package/core/roles/references/business-analyst-responsibilities.md +207 -207
  34. package/core/roles/references/content-manager-governance-standards.md +2 -2
  35. package/core/roles/references/content-manager-review-checklist.md +7 -1
  36. package/core/roles/references/data-engineer-review-checklist.md +11 -3
  37. package/core/roles/references/frontend-developer-responsibilities.md +275 -275
  38. package/core/roles/references/qa-engineer-review-checklist.md +10 -5
  39. package/core/roles/references/security-engineer-review-checklist.md +8 -0
  40. package/core/roles/references/solution-architect-review-checklist.md +6 -1
  41. package/core/roles/references/system-engineer-review-checklist.md +11 -0
  42. package/core/roles/references/ui-ux-designer-review-checklist.md +12 -0
  43. package/core/roles/security-engineer.md +35 -5
  44. package/core/roles/solution-architect.md +7 -7
  45. package/core/roles/system-engineer.md +470 -465
  46. package/core/roles/ui-ux-designer.md +17 -3
  47. package/core/skills/agent/agent-memory-compaction/references/anchored-schema-and-compaction-algorithms.md +141 -141
  48. package/core/skills/agent/architect-mcp-server/SKILL.md +3 -3
  49. package/core/skills/agent/decompose-agentic-system/SKILL.md +1 -1
  50. package/core/skills/ai/deploy-vllm-inference/SKILL.md +14 -14
  51. package/core/skills/ai-agent/agent-evaluation/SKILL.md +5 -0
  52. package/core/skills/ai-agent/context-optimization/SKILL.md +9 -0
  53. package/core/skills/backend/add-api-endpoint/SKILL.md +1 -0
  54. package/core/skills/backend/add-event-handler/SKILL.md +1 -0
  55. package/core/skills/backend/add-service-client/SKILL.md +1 -0
  56. package/core/skills/backend/build-mcp-server/SKILL.md +101 -100
  57. package/core/skills/backend/implement-auth/SKILL.md +1 -0
  58. package/core/skills/backend/implement-structured-outputs/SKILL.md +95 -94
  59. package/core/skills/backend/optimize-postgres/SKILL.md +1 -0
  60. package/core/skills/backend/scaffold-new-service/SKILL.md +1 -0
  61. package/core/skills/business/elicit-requirements/SKILL.md +102 -102
  62. package/core/skills/business/elicit-requirements/references/elicitation-techniques-and-babok-criteria.md +60 -60
  63. package/core/skills/business/trace-requirements-impact/SKILL.md +97 -97
  64. package/core/skills/business/trace-requirements-impact/references/rtm-graph-and-prioritization-models.md +109 -109
  65. package/core/skills/business/write-use-cases/SKILL.md +106 -106
  66. package/core/skills/business/write-use-cases/references/cockburn-scoping-and-13-field-template.md +135 -135
  67. package/core/skills/content/audit-content/SKILL.md +3 -2
  68. package/core/skills/content/audit-content/references/information-gain-rubric.md +1 -1
  69. package/core/skills/content/design-content-strategy/SKILL.md +6 -5
  70. package/core/skills/content/design-content-strategy/references/information-gain-and-decay-triage.md +2 -2
  71. package/core/skills/content/optimize-seo/SKILL.md +6 -5
  72. package/core/skills/content/optimize-seo/references/geo-ai-citation-playbook.md +2 -2
  73. package/core/skills/content/optimize-seo/references/process-and-checklist.md +1 -1
  74. package/core/skills/content/repurpose-content/SKILL.md +4 -3
  75. package/core/skills/content/write-article/SKILL.md +6 -5
  76. package/core/skills/content/write-copy/SKILL.md +3 -2
  77. package/core/skills/document/pptx/SKILL.md +1 -0
  78. package/core/skills/document/pptx/scripts/add_slide.py +0 -0
  79. package/core/skills/document/pptx/scripts/clean.py +0 -0
  80. package/core/skills/document/pptx/scripts/thumbnail.py +0 -0
  81. package/core/skills/document/xlsx/scripts/recalc.py +0 -0
  82. package/core/skills/documentation/write-documentation/SKILL.md +143 -143
  83. package/core/skills/documentation/write-tech-radar/SKILL.md +149 -149
  84. package/core/skills/foundation/accessibility-review/SKILL.md +160 -160
  85. package/core/skills/foundation/design-review/SKILL.md +11 -1
  86. package/core/skills/foundation/design-ux-flow/SKILL.md +13 -1
  87. package/core/skills/foundation/performance-profiling/SKILL.md +3 -1
  88. package/core/skills/foundation/release-notes/SKILL.md +192 -192
  89. package/core/skills/foundation/webapp-server-runner/scripts/with_server.py +0 -0
  90. package/core/skills/foundation/write-product-brief/SKILL.md +160 -160
  91. package/core/skills/foundation/write-tests/SKILL.md +11 -10
  92. package/core/skills/frontend/anti-ui-slop-finish-gate/SKILL.md +5 -0
  93. package/core/skills/frontend/design-md-specification/SKILL.md +1 -0
  94. package/core/skills/frontend/design-system-engineering/SKILL.md +4 -2
  95. package/core/skills/meetings-analysis/analyze-business-requirements/SKILL.md +1 -1
  96. package/core/skills/platform/add-telemetry-instrumentation/SKILL.md +2 -1
  97. package/core/skills/platform/aws-infrastructure/SKILL.md +12 -11
  98. package/core/skills/platform/cloudflare-email-service/SKILL.md +166 -166
  99. package/core/skills/platform/cloudflare-email-service/references/routing.md +199 -199
  100. package/core/skills/platform/debug-runtime-platform/SKILL.md +1 -0
  101. package/core/skills/platform/debug-workers-edge/SKILL.md +111 -111
  102. package/core/skills/platform/sandbox-sdk/SKILL.md +183 -183
  103. package/core/skills/platform/setup-gpu-finops/SKILL.md +111 -107
  104. package/core/skills/platform/setup-llm-gateway/SKILL.md +110 -108
  105. package/core/skills/platform/supply-chain-security/SKILL.md +1 -0
  106. package/core/skills/platform/system-design/SKILL.md +7 -0
  107. package/core/skills/platform/turnstile-spin/SKILL.md +118 -118
  108. package/core/skills/platform/turnstile-spin/scripts/auth-probe.sh +0 -0
  109. package/core/skills/platform/turnstile-spin/scripts/fetch-secret.sh +0 -0
  110. package/core/skills/platform/turnstile-spin/scripts/persist-skill.sh +0 -0
  111. package/core/skills/platform/turnstile-spin/scripts/validate.sh +0 -0
  112. package/core/skills/platform/turnstile-spin/scripts/widget-create.sh +0 -0
  113. package/core/skills/platform/turnstile-spin/scripts/worker-deploy.sh +0 -0
  114. package/core/skills/platform/turnstile-spin/templates/worker/src/index.ts +199 -199
  115. package/core/skills/platform/turnstile-spin/templates/worker/wrangler.toml +31 -31
  116. package/core/skills/platform/web-perf/SKILL.md +151 -151
  117. package/core/skills/platform/workers-best-practices/references/rules.md +463 -463
  118. package/core/skills/product/build-story-map/SKILL.md +104 -104
  119. package/core/skills/product/build-story-map/references/story-mapping-and-cpm-scheduling.md +101 -101
  120. package/core/skills/product/define-product-strategy/SKILL.md +105 -105
  121. package/core/skills/product/define-product-strategy/references/strategy-frameworks-and-pr-faq.md +142 -142
  122. package/core/skills/product/model-saas-metrics/SKILL.md +104 -104
  123. package/core/skills/product/model-saas-metrics/references/saas-unit-economics-and-pricing.md +110 -110
  124. package/core/skills/product/prioritize-roadmap/SKILL.md +106 -106
  125. package/core/skills/product/prioritize-roadmap/references/prioritization-scoring-and-kill-criteria.md +105 -105
  126. package/core/skills/repo-ops/commit-code/SKILL.md +190 -190
  127. package/core/skills/repo-ops/commit-code/references/multi-repo-and-deployment.md +21 -21
  128. package/core/skills/repo-ops/navigate-service/SKILL.md +199 -199
  129. package/core/skills/repo-ops/review-code/references/process-and-format.md +100 -100
  130. package/core/skills/repo-ops/review-service/SKILL.md +186 -186
  131. package/core/skills/repo-ops/troubleshoot-service/SKILL.md +127 -127
  132. package/core/skills/repo-ops/troubleshoot-service/references/failure-modes-and-security.md +22 -22
  133. package/core/skills/repo-ops/troubleshoot-service/references/suggested-process.md +110 -110
  134. package/core/skills/security-data/build-data-pipeline/SKILL.md +15 -14
  135. package/core/skills/security-data/build-data-pipeline/references/producer-contracts-and-lakehouse.md +5 -5
  136. package/core/skills/security-data/database-maintenance/SKILL.md +1 -0
  137. package/core/skills/security-data/database-maintenance/references/relational-and-vector-maintenance.md +5 -5
  138. package/core/skills/security-data/manage-secrets/SKILL.md +3 -0
  139. package/core/skills/security-data/optimize-olap-database/SKILL.md +14 -13
  140. package/core/skills/security-data/optimize-olap-database/references/olap-database-guide.md +2 -2
  141. package/core/skills/security-data/prompt-injection-defense/SKILL.md +3 -0
  142. package/core/skills/security-data/query-analytical-engine/SKILL.md +8 -7
  143. package/core/skills/security-data/query-analytical-engine/references/analytical-query-guide.md +3 -3
  144. package/core/skills/security-data/security-audit/SKILL.md +126 -119
  145. package/core/workflows/add-new-feature.md +212 -212
  146. package/core/workflows/agent-a2a-delegation.md +142 -142
  147. package/core/workflows/bug-fix.md +147 -147
  148. package/core/workflows/build-deploy.md +208 -208
  149. package/core/workflows/code-review.md +137 -137
  150. package/core/workflows/curriculum-delivery.md +1 -1
  151. package/core/workflows/dependency-upgrade.md +193 -193
  152. package/core/workflows/feature-delivery.md +149 -149
  153. package/core/workflows/hotfix-production.md +172 -172
  154. package/core/workflows/qa-validation.md +231 -231
  155. package/core/workflows/refactoring.md +154 -154
  156. package/core/workflows/revert-deployment.md +147 -147
  157. package/core/workflows/security-incident-response.md +191 -191
  158. package/core/workflows/seo-content-lifecycle.md +91 -91
  159. package/core/workflows/service-review-release.md +223 -223
  160. package/core/workflows/setup-new-service.md +214 -214
  161. package/core/workflows/tech-repo-review.md +245 -245
  162. package/core/workflows/troubleshooting.md +241 -241
  163. package/overlays/astro-cloudflare/README.md +93 -93
  164. package/overlays/data-analyst-stack/README.md +109 -109
  165. package/overlays/data-analyst-stack/rules/metric-dashboard-templates.md +135 -135
  166. package/overlays/data-analyst-stack/rules/stack-conventions.md +80 -80
  167. package/overlays/ecommerce-microservices/README.md +65 -65
  168. package/overlays/go-microservices/README.md +78 -78
  169. package/overlays/go-microservices/rules/go-conventions.md +223 -223
  170. package/overlays/laravel-filament/README.md +90 -90
  171. package/overlays/laravel-filament/rules/laravel-conventions.md +220 -220
  172. package/overlays/laravel-filament/skills/develop-laravel-feature/SKILL.md +141 -141
  173. package/overlays/laravel-filament/workflows/deploy-laravel.md +133 -133
  174. package/overlays/obj-configurator/rules/obj-project-rules.md +111 -111
  175. package/overlays/obj-configurator/skills/develop-obj-feature/SKILL.md +71 -71
  176. package/overlays/r3f-stack/README.md +89 -89
  177. package/overlays/r3f-stack/rules/stub.md +43 -43
  178. package/overlays/r3f-stack/skills/debug-3d-scene/SKILL.md +166 -166
  179. package/overlays/r3f-stack/skills/integrate-r3f-three-legacy/SKILL.md +159 -159
  180. package/overlays/r3f-stack/skills/optimize-3d-assets/SKILL.md +128 -128
  181. package/overlays/seo-publishing/rules/site-mix-and-cannibalization.md +52 -52
  182. package/overlays/ui-design-system/rules/handoff-conventions.md +73 -73
  183. package/package.json +2 -2
  184. package/core/README.md +0 -53
@@ -1,100 +1,101 @@
1
- ---
2
- name: build-mcp-server
3
- description: Scaffolds and implements a new Model Context Protocol (MCP) server. Use when exposing new backend tools or resources to AI agents.
4
- allowed-tools: [read_file, write_file, edit_file, create_file, search_code, mcp_call, run_tests, execute_command]
5
- ---
6
-
7
- # Build MCP Server
8
-
9
- Use this skill to create standard-compliant MCP servers that expose system capabilities securely to AI agents.
10
-
11
- ## Core Rules
12
-
13
- - **Schema-First**: Define all tool inputs and outputs using Zod or Pydantic schemas as the absolute source of truth; generate JSON Schema 2020-12 from these definitions for protocol compliance
14
- - **Stateless Server Guarantee** (July 2026 MCP spec): MCP server instances must not store in-memory session state — all context must be passed in the request or persisted externally (Redis, Durable Objects); this enables deployment on serverless edge runtimes (Cloudflare Workers, AWS Lambda)
15
- - **Transport Selection**: Use **Streamable HTTP** for remote/cloud deployments; use **stdio** exclusively for local IDE/CLI tools — in stdio mode, `stdout` is strictly reserved for JSON-RPC 2.0 frames; all logs must route to `stderr`
16
- - **Header-Based Routing**: Pass tool method and name in HTTP headers (`Mcp-Method: tools/call`, `Mcp-Name: create_invoice`) to enable API gateway rate limiting and authorization without body parsing
17
- - **Versioning**: Apply SemVer 2.0 to tool names; treat tool names as immutable public contracts — breaking schema changes require major version increments with dual-version deprecation windows
18
- - **Security**: Implement OAuth 2.1 with PKCE Bearer token validation for HTTP-transport servers; apply tenant scoping and **least-privilege mutation gating** — destructive tools (write, delete, send) require explicit authorization and confirmation tokens; read-only tools may be open by default
19
- - **Telemetry**: Emit an OTel span for every `tools/call` execution with `mcp.tool_name`, `mcp.transport_type`, duration, and outcome; never log sensitive payload data or auth credentials in trace attributes
20
-
21
- ## Suggested Process
22
-
23
- ### 1. Define Server Scope & Tool Contracts
24
-
25
- Identify the capabilities, resources, and tools the MCP server will provide. For each tool:
26
- - Define strict input schemas using Zod (TypeScript) or Pydantic (Python).
27
- - Document clear, unambiguous tool descriptions so AI agents choose tools accurately.
28
- - Specify returned output schemas and error response shapes.
29
-
30
- ### 2. Scaffold Server Runtime & Transport
31
-
32
- Initialize the MCP server using the official SDK (`@modelcontextprotocol/sdk` or `mcp` Python package):
33
- - Configure standard transports: stdio for local agent execution, streamable HTTP with SSE headers (`Accept: text/event-stream`) for remote service deployment.
34
- - Declare server metadata (`name`, `version`) and capabilities (`tools`, `resources`, `prompts`).
35
-
36
- ### 3. Implement Tool Handlers & Boundary Validation
37
-
38
- Wire tool registration and execution logic:
39
- - Parse and validate incoming arguments against input schemas before executing business logic.
40
- - Route execution to internal service methods or downstream APIs without embedding tight coupling.
41
- - Wrap execution in structured error handling, returning informative error messages rather than raw stack traces.
42
-
43
- ### 4. Enforce Security & Authorization Middleware
44
-
45
- Protect sensitive operations:
46
- - For HTTP-transport servers, enforce OAuth 2.1 with PKCE or JWT bearer token validation.
47
- - Decode tenant and user claims from the authentication context and inject them into execution context.
48
- - Apply rate limiting and action whitelisting to prevent runaway agent execution loops.
49
-
50
- ### 5. Instrument Observability & Tracing
51
-
52
- Use skill: `add-telemetry-instrumentation`
53
- - Create OpenTelemetry spans for each `tools/call` invocation with standard attributes (`mcp.tool_name`, `mcp.transport_type`).
54
- - Record token consumption, latency, and success/failure outcomes.
55
- - Ensure no sensitive payload data or authorization credentials leak into trace logs.
56
-
57
- ### 6. Verify Protocol Compliance & Testing
58
-
59
- Use skill: `write-tests`
60
- - Test tool discovery via MCP Inspector or mock client initialization.
61
- - Author unit and integration tests covering happy paths, schema validation failures, and downstream error handling.
62
-
63
- ## Failure Modes
64
-
65
- - **Server card published without server-discover**: the MCP server card lacks the `server/discover` endpoint required by 2026-07-28. **Mitigation:** validate the card against the current MCP spec; reject cards without the discover endpoint.
66
- - **Tool handler missing input schema**: a tool is registered without an `inputSchema` field. **Mitigation:** require an explicit `inputSchema` for every tool; reject registrations without it.
67
- - **Auth scope too broad**: a tool grants the entire `admin` scope to any caller. **Mitigation:** validate every tool's required scope against the smallest-privilege profile; reject tools with over-broad scopes.
68
- - **Streaming HTTP header missing**: a tool uses streamable HTTP without the `Accept: text/event-stream` header. **Mitigation:** enforce the streamable HTTP transport headers; reject tools without the header.
69
-
70
- ## Output Contracts
71
-
72
- When this skill is invoked as part of a coordinated multi-role delivery, emit:
73
-
74
- - **`contracts/schemas/implementation-result.json`** — Required fields: `change_summary`, `files_touched[]`, `endpoints_added[]` (list of MCP tools/resources), and `validation_run` output confirming the MCP schema validates.
75
-
76
- ## Checklist
77
-
78
- - [ ] Schema-first tool definition complete with Zod or Pydantic.
79
- - [ ] Server transport (stdio or streamable HTTP) configured with proper headers.
80
- - [ ] Tool argument validation and boundary error handling implemented.
81
- - [ ] Authorization guards and tenant isolation verified.
82
- - [ ] OpenTelemetry spans instrumented for all tool calls.
83
- - [ ] Unit and protocol compliance tests added.
84
- - [ ] `implementation-result.json` emitted.
85
-
86
- ## Security Guardrails (OWASP ASI)
87
-
88
- - **ASI04 Supply Chain**: MCP server libraries and tool SDKs must be schema-validated against the expected manifest; treat unknown versions as untrusted.
89
- - **ASI05 RCE Guard**: never construct tool inputs, server bindings, or transport config from external content without strict schema validation.
90
- - **ASI07 Inter-Agent Communication**: the MCP contract is consumed by external agents; treat the server card as a public, signed contract.
91
- - **ASI09 Human-Agent Trust Exploitation**: do not present a server as "production-ready" without the auth, observability, and rate-limit gates; surface the residual risk honestly.
92
-
93
- ## Related Skills
94
-
95
- - **configure-mcp**: Set up domain discovery, server cards, and client integration for the MCP server
96
- - **add-api-endpoint**: Connect MCP tool handlers to internal service endpoints and business logic
97
- - **implement-structured-outputs**: Enforce strict JSON schema validation on tool arguments and outputs
98
- - **add-telemetry-instrumentation**: Wire OpenTelemetry spans and metrics for MCP tool executions
99
- - **security-audit**: Review authentication, authorization boundaries, and input sanitization
100
- - **write-tests**: Author automated test suites verifying MCP tool invocations and error scenarios
1
+ ---
2
+ name: build-mcp-server
3
+ description: Scaffolds and implements a new Model Context Protocol (MCP) server. Use when exposing new backend tools or resources to AI agents.
4
+ version: 1.0.0
5
+ allowed-tools: [read_file, write_file, edit_file, create_file, search_code, mcp_call, run_tests, execute_command]
6
+ ---
7
+
8
+ # Build MCP Server
9
+
10
+ Use this skill to create standard-compliant MCP servers that expose system capabilities securely to AI agents.
11
+
12
+ ## Core Rules
13
+
14
+ - **Schema-First**: Define all tool inputs and outputs using Zod or Pydantic schemas as the absolute source of truth; generate JSON Schema 2020-12 from these definitions for protocol compliance
15
+ - **Stateless Server Guarantee** (July 2026 MCP spec): MCP server instances must not store in-memory session state — all context must be passed in the request or persisted externally (Redis, Durable Objects); this enables deployment on serverless edge runtimes (Cloudflare Workers, AWS Lambda)
16
+ - **Transport Selection**: Use **Streamable HTTP** for remote/cloud deployments; use **stdio** exclusively for local IDE/CLI tools — in stdio mode, `stdout` is strictly reserved for JSON-RPC 2.0 frames; all logs must route to `stderr`
17
+ - **Header-Based Routing**: Pass tool method and name in HTTP headers (`Mcp-Method: tools/call`, `Mcp-Name: create_invoice`) to enable API gateway rate limiting and authorization without body parsing
18
+ - **Versioning**: Apply SemVer 2.0 to tool names; treat tool names as immutable public contracts — breaking schema changes require major version increments with dual-version deprecation windows
19
+ - **Security**: Implement OAuth 2.1 with PKCE Bearer token validation for HTTP-transport servers; apply tenant scoping and **least-privilege mutation gating** — destructive tools (write, delete, send) require explicit authorization and confirmation tokens; read-only tools may be open by default
20
+ - **Telemetry**: Emit an OTel span for every `tools/call` execution with `mcp.tool_name`, `mcp.transport_type`, duration, and outcome; never log sensitive payload data or auth credentials in trace attributes
21
+
22
+ ## Suggested Process
23
+
24
+ ### 1. Define Server Scope & Tool Contracts
25
+
26
+ Identify the capabilities, resources, and tools the MCP server will provide. For each tool:
27
+ - Define strict input schemas using Zod (TypeScript) or Pydantic (Python).
28
+ - Document clear, unambiguous tool descriptions so AI agents choose tools accurately.
29
+ - Specify returned output schemas and error response shapes.
30
+
31
+ ### 2. Scaffold Server Runtime & Transport
32
+
33
+ Initialize the MCP server using the official SDK (`@modelcontextprotocol/sdk` or `mcp` Python package):
34
+ - Configure standard transports: stdio for local agent execution, streamable HTTP with SSE headers (`Accept: text/event-stream`) for remote service deployment.
35
+ - Declare server metadata (`name`, `version`) and capabilities (`tools`, `resources`, `prompts`).
36
+
37
+ ### 3. Implement Tool Handlers & Boundary Validation
38
+
39
+ Wire tool registration and execution logic:
40
+ - Parse and validate incoming arguments against input schemas before executing business logic.
41
+ - Route execution to internal service methods or downstream APIs without embedding tight coupling.
42
+ - Wrap execution in structured error handling, returning informative error messages rather than raw stack traces.
43
+
44
+ ### 4. Enforce Security & Authorization Middleware
45
+
46
+ Protect sensitive operations:
47
+ - For HTTP-transport servers, enforce OAuth 2.1 with PKCE or JWT bearer token validation.
48
+ - Decode tenant and user claims from the authentication context and inject them into execution context.
49
+ - Apply rate limiting and action whitelisting to prevent runaway agent execution loops.
50
+
51
+ ### 5. Instrument Observability & Tracing
52
+
53
+ Use skill: `add-telemetry-instrumentation`
54
+ - Create OpenTelemetry spans for each `tools/call` invocation with standard attributes (`mcp.tool_name`, `mcp.transport_type`).
55
+ - Record token consumption, latency, and success/failure outcomes.
56
+ - Ensure no sensitive payload data or authorization credentials leak into trace logs.
57
+
58
+ ### 6. Verify Protocol Compliance & Testing
59
+
60
+ Use skill: `write-tests`
61
+ - Test tool discovery via MCP Inspector or mock client initialization.
62
+ - Author unit and integration tests covering happy paths, schema validation failures, and downstream error handling.
63
+
64
+ ## Failure Modes
65
+
66
+ - **Server card published without server-discover**: the MCP server card lacks the `server/discover` endpoint required by 2026-07-28. **Mitigation:** validate the card against the current MCP spec; reject cards without the discover endpoint.
67
+ - **Tool handler missing input schema**: a tool is registered without an `inputSchema` field. **Mitigation:** require an explicit `inputSchema` for every tool; reject registrations without it.
68
+ - **Auth scope too broad**: a tool grants the entire `admin` scope to any caller. **Mitigation:** validate every tool's required scope against the smallest-privilege profile; reject tools with over-broad scopes.
69
+ - **Streaming HTTP header missing**: a tool uses streamable HTTP without the `Accept: text/event-stream` header. **Mitigation:** enforce the streamable HTTP transport headers; reject tools without the header.
70
+
71
+ ## Output Contracts
72
+
73
+ When this skill is invoked as part of a coordinated multi-role delivery, emit:
74
+
75
+ - **`contracts/schemas/implementation-result.json`** — Required fields: `change_summary`, `files_touched[]`, `endpoints_added[]` (list of MCP tools/resources), and `validation_run` output confirming the MCP schema validates.
76
+
77
+ ## Checklist
78
+
79
+ - [ ] Schema-first tool definition complete with Zod or Pydantic.
80
+ - [ ] Server transport (stdio or streamable HTTP) configured with proper headers.
81
+ - [ ] Tool argument validation and boundary error handling implemented.
82
+ - [ ] Authorization guards and tenant isolation verified.
83
+ - [ ] OpenTelemetry spans instrumented for all tool calls.
84
+ - [ ] Unit and protocol compliance tests added.
85
+ - [ ] `implementation-result.json` emitted.
86
+
87
+ ## Security Guardrails (OWASP ASI)
88
+
89
+ - **ASI04 Supply Chain**: MCP server libraries and tool SDKs must be schema-validated against the expected manifest; treat unknown versions as untrusted.
90
+ - **ASI05 RCE Guard**: never construct tool inputs, server bindings, or transport config from external content without strict schema validation.
91
+ - **ASI07 Inter-Agent Communication**: the MCP contract is consumed by external agents; treat the server card as a public, signed contract.
92
+ - **ASI09 Human-Agent Trust Exploitation**: do not present a server as "production-ready" without the auth, observability, and rate-limit gates; surface the residual risk honestly.
93
+
94
+ ## Related Skills
95
+
96
+ - **configure-mcp**: Set up domain discovery, server cards, and client integration for the MCP server
97
+ - **add-api-endpoint**: Connect MCP tool handlers to internal service endpoints and business logic
98
+ - **implement-structured-outputs**: Enforce strict JSON schema validation on tool arguments and outputs
99
+ - **add-telemetry-instrumentation**: Wire OpenTelemetry spans and metrics for MCP tool executions
100
+ - **security-audit**: Review authentication, authorization boundaries, and input sanitization
101
+ - **write-tests**: Author automated test suites verifying MCP tool invocations and error scenarios
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: implement-auth
3
3
  description: Implement secure authentication, OAuth2 PKCE flows, session lifecycles, JWT rotation with Redis revocation, Row-Level Security, and worker runtime state isolation. Use when adding or hardening auth, tokens, sessions, or multi-tenant boundaries.
4
+ version: 1.0.0
4
5
  allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_tests, run_linter, run_build, execute_command]
5
6
  ---
6
7
 
@@ -1,94 +1,95 @@
1
- ---
2
- name: implement-structured-outputs
3
- description: Implements strict constrained decoding and validation for LLM responses. Use when enforcing JSON Schema guarantees on model generations, eliminating regex parsing, or integrating structured LLM outputs into backend services.
4
- allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_tests, run_linter, run_build, execute_command]
5
- ---
6
-
7
- # Implement Structured Outputs
8
-
9
- Use this skill when integrating LLM responses into application code to guarantee schema adherence and eliminate parsing errors.
10
-
11
- ## Core Rules
12
-
13
- - **No Regex Parsing**: Never use regex to extract JSON from raw LLM output — this is strictly prohibited in production backend pipelines
14
- - **Constrained Decoding First**: Use provider-native constrained decoding (`response_format: { type: "json_schema", strict: true }` for OpenAI/Gemini; XGrammar, Outlines, or SGLang grammar constraints for self-hosted inference) — this guarantees JSON syntax compliance at the token generation layer
15
- - **Contract-First Schema DSL**: Define schemas once in Zod or Pydantic v2 with `strict: true` / `additionalProperties: false`; consider BAML for cross-language type-safe prompt functions; export to JSON Schema 2020-12 for provider compatibility
16
- - **Dual-Layer Runtime Validation**: After constrained decoding, parse through the application-layer validator (`schema.safeParse()` / `TypeAdapter.validate_json()`) to enforce business invariants, enum bounds, and cross-field rules not expressible in JSON Schema
17
- - **Bounded Repair Loops**: On validation failure, inject the exact schema violation diff into a one-turn repair prompt; limit to **maximum 2 retry attempts** before returning a structured domain error — never loop indefinitely
18
- - **Format Tax Mitigation**: Include a `thought_process` or `reasoning` field in the schema before final output fields to preserve model reasoning space under grammar constraints; strip this field before returning to callers
19
- - **Centralized Gateway Routing**: Route all LLM structured output requests through a centralized LLM gateway responsible for token budgeting, provider fallback, rate limiting, and prompt injection filtering
20
-
21
- ## Suggested Process
22
-
23
- ### 1. Define Canonical Schema Contract
24
-
25
- Create a strict schema definition using Zod or Pydantic:
26
- - Ensure all object properties are explicitly typed and marked as required (or given explicit default values).
27
- - Add field descriptions to guide the LLM's generative decoding.
28
- - Compile or export the definition to a strict JSON Schema object matching OpenAPI / JSON Schema 2020-12 specs.
29
-
30
- ### 2. Configure Model Provider Constrained Decoding
31
-
32
- Wire the schema into the provider-specific SDK call:
33
- - OpenAI: set `response_format: { type: "json_schema", json_schema: { name: "...", strict: true, schema: ... } }`.
34
- - Google Gemini: configure `responseMimeType: "application/json"` and pass `responseSchema`.
35
- - Local / Self-Hosted (vLLM, Ollama): pass guided decoding grammars or JSON Schema constraints.
36
-
37
- ### 3. Integrate Dual-Layer Runtime Validation
38
-
39
- Implement defensive validation around the decoded response:
40
- - Parse the received string payload through the canonical validator (e.g., `schema.safeParse()` or `TypeAdapter.validate_json()`).
41
- - Verify data types, enum bounds, and domain invariant constraints that JSON Schema alone cannot enforce.
42
- - Map validation errors to structured domain error types.
43
-
44
- ### 4. Implement Error Recovery & Context-Injected Retries
45
-
46
- Handle rare edge cases such as token limit truncation or refusal:
47
- - Check for provider refusal signals (`refusal` field or safety finish reasons).
48
- - If validation fails, capture the validation error list and pass it back into a one-turn repair prompt with bounded backoff.
49
- - Set a hard retry ceiling (max 2 retries) before raising a structured error.
50
-
51
- ### 5. Add Unit & Contract Tests
52
-
53
- Use skill: `write-tests`
54
- - Test schema generation and serialization.
55
- - Author unit tests using mock provider responses (valid payload, partial payload, malformed payload, refusal).
56
- - Assert that invalid model responses never reach core business logic without triggering the recovery flow.
57
-
58
- ## Failure Modes
59
-
60
- - **Schema drift from the source spec**: a generated output diverges from the JSON Schema the spec declares. **Mitigation:** validate every output against the source JSON Schema before returning; reject outputs that fail validation.
61
- - **Constrained decoding disabled**: a tool returns free-form text instead of a schema-validated object. **Mitigation:** enforce structured outputs (constrained decoding) at the model gateway; reject free-form responses.
62
- - **Field rename in a future model version**: a model version change renames a field. **Mitigation:** validate every output against the schema; surface the rename in the eval report; update the schema and the prompt.
63
- - **Ungrounded output**: the model returns a value that is not in the source data. **Mitigation:** enforce a grounding check (cosine similarity ≥ 0.7) on retrieval-augmented outputs; surface the ungrounded output as `[UNVERIFIED]`.
64
-
65
- ## Output Contracts
66
-
67
- When this skill is invoked as part of a coordinated multi-role delivery, emit:
68
-
69
- - **`contracts/schemas/implementation-result.json`** — Required fields: `change_summary`, `files_touched[]`, and `validation_run` output proving the schema validation handles both valid and invalid mock responses.
70
-
71
- ## Checklist
72
-
73
- - [ ] Strict canonical schema defined with Zod/Pydantic without untyped fields.
74
- - [ ] Provider-native constrained decoding parameters configured.
75
- - [ ] Runtime validation layer verifies response payload before business logic.
76
- - [ ] Refusal handling and targeted error-repair retry logic implemented.
77
- - [ ] Unit tests with valid and invalid mock responses written and passing.
78
- - [ ] `implementation-result.json` emitted.
79
-
80
- ## Security Guardrails (OWASP ASI)
81
-
82
- - **ASI01 Goal Hijack**: a malformed or adversarial prompt may try to escape the constrained decoding envelope. Validate every output against the JSON Schema before returning to the caller.
83
- - **ASI04 Supply Chain**: schema validators, constrained decoding libraries, and model SDKs must be schema-validated against the expected manifest; treat unknown versions as untrusted.
84
- - **ASI05 RCE Guard**: never construct schema, prompts, or constrained-decoding configs from external content without strict validation.
85
- - **ASI07 Inter-Agent Communication**: the structured output is consumed by downstream agents; require schema validation at the boundary.
86
- - **ASI09 Human-Agent Trust Exploitation**: do not present the structured output as "schema-valid" without a successful validation run; surface the actual validation status.
87
-
88
- ## Related Skills
89
-
90
- - **build-mcp-server**: Apply structured output validation to MCP tool call results and argument parsing
91
- - **setup-llm-gateway**: Route structured output requests through centralized gateway proxies
92
- - **add-api-endpoint**: Integrate validated LLM output payloads into service endpoints and domain flows
93
- - **write-tests**: Create test suites covering schema validation, constraint failures, and retry logic
94
- - **review-code**: Verify schema strictness, error boundaries, and absence of regex parsing
1
+ ---
2
+ name: implement-structured-outputs
3
+ description: Implements strict constrained decoding and validation for LLM responses. Use when enforcing JSON Schema guarantees on model generations, eliminating regex parsing, or integrating structured LLM outputs into backend services.
4
+ version: 1.0.0
5
+ allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_tests, run_linter, run_build, execute_command]
6
+ ---
7
+
8
+ # Implement Structured Outputs
9
+
10
+ Use this skill when integrating LLM responses into application code to guarantee schema adherence and eliminate parsing errors.
11
+
12
+ ## Core Rules
13
+
14
+ - **No Regex Parsing**: Never use regex to extract JSON from raw LLM output — this is strictly prohibited in production backend pipelines
15
+ - **Constrained Decoding First**: Use provider-native constrained decoding (`response_format: { type: "json_schema", strict: true }` for OpenAI/Gemini; XGrammar, Outlines, or SGLang grammar constraints for self-hosted inference) — this guarantees JSON syntax compliance at the token generation layer
16
+ - **Contract-First Schema DSL**: Define schemas once in Zod or Pydantic v2 with `strict: true` / `additionalProperties: false`; consider BAML for cross-language type-safe prompt functions; export to JSON Schema 2020-12 for provider compatibility
17
+ - **Dual-Layer Runtime Validation**: After constrained decoding, parse through the application-layer validator (`schema.safeParse()` / `TypeAdapter.validate_json()`) to enforce business invariants, enum bounds, and cross-field rules not expressible in JSON Schema
18
+ - **Bounded Repair Loops**: On validation failure, inject the exact schema violation diff into a one-turn repair prompt; limit to **maximum 2 retry attempts** before returning a structured domain error — never loop indefinitely
19
+ - **Format Tax Mitigation**: Include a `thought_process` or `reasoning` field in the schema before final output fields to preserve model reasoning space under grammar constraints; strip this field before returning to callers
20
+ - **Centralized Gateway Routing**: Route all LLM structured output requests through a centralized LLM gateway responsible for token budgeting, provider fallback, rate limiting, and prompt injection filtering
21
+
22
+ ## Suggested Process
23
+
24
+ ### 1. Define Canonical Schema Contract
25
+
26
+ Create a strict schema definition using Zod or Pydantic:
27
+ - Ensure all object properties are explicitly typed and marked as required (or given explicit default values).
28
+ - Add field descriptions to guide the LLM's generative decoding.
29
+ - Compile or export the definition to a strict JSON Schema object matching OpenAPI / JSON Schema 2020-12 specs.
30
+
31
+ ### 2. Configure Model Provider Constrained Decoding
32
+
33
+ Wire the schema into the provider-specific SDK call:
34
+ - OpenAI: set `response_format: { type: "json_schema", json_schema: { name: "...", strict: true, schema: ... } }`.
35
+ - Google Gemini: configure `responseMimeType: "application/json"` and pass `responseSchema`.
36
+ - Local / Self-Hosted (vLLM, Ollama): pass guided decoding grammars or JSON Schema constraints.
37
+
38
+ ### 3. Integrate Dual-Layer Runtime Validation
39
+
40
+ Implement defensive validation around the decoded response:
41
+ - Parse the received string payload through the canonical validator (e.g., `schema.safeParse()` or `TypeAdapter.validate_json()`).
42
+ - Verify data types, enum bounds, and domain invariant constraints that JSON Schema alone cannot enforce.
43
+ - Map validation errors to structured domain error types.
44
+
45
+ ### 4. Implement Error Recovery & Context-Injected Retries
46
+
47
+ Handle rare edge cases such as token limit truncation or refusal:
48
+ - Check for provider refusal signals (`refusal` field or safety finish reasons).
49
+ - If validation fails, capture the validation error list and pass it back into a one-turn repair prompt with bounded backoff.
50
+ - Set a hard retry ceiling (max 2 retries) before raising a structured error.
51
+
52
+ ### 5. Add Unit & Contract Tests
53
+
54
+ Use skill: `write-tests`
55
+ - Test schema generation and serialization.
56
+ - Author unit tests using mock provider responses (valid payload, partial payload, malformed payload, refusal).
57
+ - Assert that invalid model responses never reach core business logic without triggering the recovery flow.
58
+
59
+ ## Failure Modes
60
+
61
+ - **Schema drift from the source spec**: a generated output diverges from the JSON Schema the spec declares. **Mitigation:** validate every output against the source JSON Schema before returning; reject outputs that fail validation.
62
+ - **Constrained decoding disabled**: a tool returns free-form text instead of a schema-validated object. **Mitigation:** enforce structured outputs (constrained decoding) at the model gateway; reject free-form responses.
63
+ - **Field rename in a future model version**: a model version change renames a field. **Mitigation:** validate every output against the schema; surface the rename in the eval report; update the schema and the prompt.
64
+ - **Ungrounded output**: the model returns a value that is not in the source data. **Mitigation:** enforce a grounding check (cosine similarity ≥ 0.7) on retrieval-augmented outputs; surface the ungrounded output as `[UNVERIFIED]`.
65
+
66
+ ## Output Contracts
67
+
68
+ When this skill is invoked as part of a coordinated multi-role delivery, emit:
69
+
70
+ - **`contracts/schemas/implementation-result.json`** — Required fields: `change_summary`, `files_touched[]`, and `validation_run` output proving the schema validation handles both valid and invalid mock responses.
71
+
72
+ ## Checklist
73
+
74
+ - [ ] Strict canonical schema defined with Zod/Pydantic without untyped fields.
75
+ - [ ] Provider-native constrained decoding parameters configured.
76
+ - [ ] Runtime validation layer verifies response payload before business logic.
77
+ - [ ] Refusal handling and targeted error-repair retry logic implemented.
78
+ - [ ] Unit tests with valid and invalid mock responses written and passing.
79
+ - [ ] `implementation-result.json` emitted.
80
+
81
+ ## Security Guardrails (OWASP ASI)
82
+
83
+ - **ASI01 Goal Hijack**: a malformed or adversarial prompt may try to escape the constrained decoding envelope. Validate every output against the JSON Schema before returning to the caller.
84
+ - **ASI04 Supply Chain**: schema validators, constrained decoding libraries, and model SDKs must be schema-validated against the expected manifest; treat unknown versions as untrusted.
85
+ - **ASI05 RCE Guard**: never construct schema, prompts, or constrained-decoding configs from external content without strict validation.
86
+ - **ASI07 Inter-Agent Communication**: the structured output is consumed by downstream agents; require schema validation at the boundary.
87
+ - **ASI09 Human-Agent Trust Exploitation**: do not present the structured output as "schema-valid" without a successful validation run; surface the actual validation status.
88
+
89
+ ## Related Skills
90
+
91
+ - **build-mcp-server**: Apply structured output validation to MCP tool call results and argument parsing
92
+ - **setup-llm-gateway**: Route structured output requests through centralized gateway proxies
93
+ - **add-api-endpoint**: Integrate validated LLM output payloads into service endpoints and domain flows
94
+ - **write-tests**: Create test suites covering schema validation, constraint failures, and retry logic
95
+ - **review-code**: Verify schema strictness, error boundaries, and absence of regex parsing
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: optimize-postgres
3
3
  description: Optimize PostgreSQL performance, serverless connection pooling, ephemeral database branching, EXPLAIN ANALYZE execution plan tuning, and zero-downtime migrations. Use when tuning queries, configuring poolers, branching databases, or rolling out DDL.
4
+ version: 1.0.0
4
5
  allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_tests, run_linter, run_build, execute_command]
5
6
  ---
6
7
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: scaffold-new-service
3
3
  description: Bootstrap a new service or bounded component from repo-local templates and conventions. Use when creating a new service, worker, or deployable unit without assuming a fixed framework or folder layout.
4
+ version: 1.0.0
4
5
  allowed-tools: [read_file, write_file, edit_file, create_file, search_code, run_tests, run_linter, run_build, execute_command]
5
6
  ---
6
7