/speakeasy:diagnose-generation-failurefrom speakeasy
Diagnoses root causes of SDK generation failures from OpenAPI specs, categorizing issues as fixable with overlays, spec fixes, or user input.
Ships in speakeasy. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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 practicesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sdk-generation, speakeasy, openapi, diagnosis, error-resolution, overlay-fixes
14 skills in this plugin
/configure-sdk-optionsUse when CONFIGURING an existing SDK - NOT for initial generation. Covers gen.yaml configuration for all languages: TypeScript, Python, Go, Java, C#, PHP, Ruby. Also covers runtime overrides (retries, timeouts, server selection) in application code. Triggers on "configure SDK", "gen.yaml", "SDK options", "SDK config", "SDK configuration", "runtime override", "SDK client config", "override timeout", "per-call config". For NEW SDK generation, use start-new-sdk-project instead./customize-sdk-hooksUse when implementing SDK code hooks for custom logic (not spec configuration or runtime overrides).
Covers SDK lifecycle hooks: BeforeRequest, AfterSuccess, AfterError for custom headers,
telemetry, HMAC signing, and request/response transformation.
Triggers on "SDK hooks", "add hooks", "BeforeRequestHook", "custom logic in SDK",
"telemetry hook", "SDK middleware", "intercept requests", "HMAC signing hook",
"custom code in hooks directory".
/extract-openapi-from-codeUse when extracting or generating an OpenAPI spec from existing API code. Triggers on "extract OpenAPI", "code first", "generate spec from code", "FastAPI OpenAPI", "Spring Boot OpenAPI", "NestJS swagger", "Django OpenAPI", "Flask OpenAPI", "Rails swagger", "Laravel OpenAPI", "existing API code"Claude Code refuses to install this plugin
.claude-plugin/plugin.json: skills: Invalid string: must start with "./"
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
Other plugins' skills for the same job