From speakeasy
Diagnoses root causes of Speakeasy SDK generation failures from OpenAPI specs using linting and provides fix strategies like overlays or spec changes. Triggers on 'generation failed', 'speakeasy run failed', or build errors.
How this skill is triggered — by the user, by Claude, or both
Slash command
/speakeasy:diagnose-generation-failureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
When SDK generation fails, diagnose the root cause and determine the fix strategy.
When SDK generation fails, diagnose the root cause and determine the fix strategy.
speakeasy run failed with errors| Input | Required | Description |
|---|---|---|
| OpenAPI spec | Yes | Path to spec that failed generation |
| Error output | Helpful | Error messages from failed run |
| Output | Description |
|---|---|
| Diagnosis | Root cause of failure |
| Fix strategy | Overlay vs spec fix vs user decision |
| Action items | Specific steps to resolve |
Run lint to get detailed errors:
speakeasy lint openapi --non-interactive -s <spec-path>
Categorize issues:
| Issue Type | Fix Strategy | Example |
|---|---|---|
| Missing operationId | Overlay | Use speakeasy suggest operation-ids |
| Missing description | Overlay | Add via overlay |
| Invalid $ref | Ask user | Broken reference needs spec fix |
| Circular reference | Ask user | Design decision needed |
| Missing security | Ask user | Auth design needed |
PROBLEM
│
├─ ResponseValidationError at runtime?
│ └─ SDK types don't match server responses
│ ├─ Run contract tests to identify mismatches
│ └─ Fix spec or create overlay to correct types
│
├─ SDK doesn't match live API behavior?
│ ├─ Spec may have drifted from API
│ │ → Run contract tests to detect drift
│ └─ Third-party spec may be inaccurate
│ → Validate with contract testing before trusting
│
├─ Type mismatch errors in generated SDK?
│ ├─ At compile time → Check spec schema definitions
│ └─ At runtime → Server returns unexpected types
│ → Contract testing required
│
└─ Enum value not recognized?
└─ API returned value not in spec enum
├─ Add missing value to spec/overlay
└─ Or use open enums for anti-fragility
Use yq (YAML) or jq (JSON) to inspect specs without loading full content:
# List all paths
yq '.paths | keys' spec.yaml
# Inspect a specific endpoint
yq '.paths["/users/{id}"]' spec.yaml
# List all schema names
yq '.components.schemas | keys' spec.yaml
# List all operationIds
yq '[.paths[][].operationId // empty] | unique' spec.yaml
For complex issues, produce a document:
## OpenAPI Spec Analysis
### Blocking Issues (require user input)
- [List issues that need human decision]
### Fixable Issues (can use overlays)
- [List issues with proposed overlay fixes]
### Recommended Approach
[Your recommendation]
manage-openapi-overlays - Fix issues with overlayssetup-sdk-testing - Contract testing for validationwriting-openapi-specs - Spec design best practicesnpx claudepluginhub speakeasy-api/skills --plugin speakeasy2plugins reuse this skill
First indexed Jul 8, 2026
Creates, applies, and validates OpenAPI overlay files with x-speakeasy extensions to customize specs for SDK generation without source changes. Covers JSONPath targeting, retries, pagination, naming, security.
Generates and maintains OpenAPI 3.1 specs from code or design-first, validates API implementations, and generates SDKs.
Generates and validates OpenAPI 3.1 specs from code or design-first contracts. Use when creating API docs, generating SDKs, or ensuring contract compliance.