improve-sdk-naming
Skill17 starsChanged 10 months agoApache-2.0View on GitHub
Use when you want AI-powered suggestions for SDK naming improvements via the `speakeasy suggest` command (not manual overlay creation). Triggers on "suggest improvements", "speakeasy suggest", "AI suggestions", "suggest operation-ids", "suggest error-types", "auto-improve naming", "get AI recommendations".
- Reads credentials
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- configure-sdk-optionsSkill
- customize-sdk-hooksSkill
- diagnose-generation-failureSkill
- extract-openapi-from-codeSkill
- generate-mcp-serverSkill
- generate-terraform-providerSkill
- manage-openapi-overlaysSkill
- orchestrate-multi-repo-sdksSkill
- orchestrate-multi-target-sdksSkill
- setup-sdk-testingSkill
- speakeasy-contextSkill
- start-new-sdk-projectSkill
- writing-openapi-specsSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use this skill when you want AI-powered suggestions from Speakeasy:
- Very specific: line 69
Run the suggest command without -o to preview what would change:
- Very specific: line 145
Do NOT: use generic names like get or post without a group.
- Very specific: line 147
Do NOT: create duplicate operation names across different groups.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
improve-sdk-naming
Improve SDK method naming using AI-powered suggestions or manual overrides. Covers both automatic speakeasy suggest commands and manual naming with x-speakeasy-group and x-speakeasy-name-override extensions.
When to Use
Use this skill when you want AI-powered suggestions from Speakeasy:
- SDK methods have ugly auto-generated names like
GetApiV1Users - You want Speakeasy AI to suggest better operation IDs
- You want AI-generated suggestions for error types
- Looking to improve spec quality automatically using
speakeasy suggest - User says: "suggest improvements", "speakeasy suggest", "AI suggestions", "suggest operation-ids", "suggest error-types", "get AI recommendations"
NOT for: Manually creating overlays (see manage-openapi-overlays instead)
Inputs
| Input | Required | Description |
| OpenAPI spec | Yes | Path to the spec file (-s) |
| Authentication | Yes | Via speakeasy auth login or SPEAKEASY_API_KEY env var |
| Output file | No | Path for overlay output (-o) |
Outputs
| Output | Description |
| Suggestions | Better operation names or error types printed to console |
| Overlay file | Optional: saves suggestions as an overlay YAML file (-o) |
Prerequisites
For non-interactive environments (CI/CD, AI agents), set the API key as an environment variable:
export SPEAKEASY_API_KEY="<your-api-key>"For interactive use, authenticate directly:
speakeasy auth loginCommand
AI-Powered Suggestions
# Suggest better operation IDs (SDK method names)
speakeasy suggest operation-ids -s <spec-path>
# Suggest error type definitions
speakeasy suggest error-types -s <spec-path>
# Output suggestions as an overlay file
speakeasy suggest operation-ids -s <spec-path> -o suggested-overlay.yamlCheck Current Operation IDs
Run the suggest command without -o to preview what would change:
speakeasy suggest operation-ids -s openapi.yamlSDK Method Naming Convention
Speakeasy generates grouped SDK methods from operation IDs. The naming convention uses x-speakeasy-group for the namespace and x-speakeasy-name-override for the method name.
| HTTP Method | SDK Usage | Operation ID |
| GET (list) | sdk.users.list() | users_list |
| GET (single) | sdk.users.get() | users_get |
| POST | sdk.users.create() | users_create |
| PUT | sdk.users.update() | users_update |
| DELETE | sdk.users.delete() | users_delete |
The operation ID format is {group}_{method}. Speakeasy splits on the underscore to create the namespace and method name in the generated SDK.
Example
Step 1: Get AI Suggestions
speakeasy suggest operation-ids -s openapi.yaml -o operation-ids-overlay.yamlThis analyzes your spec and generates an overlay that transforms names like:
get_api_v1_users_list->listUserspost_api_v1_users_create->createUser
Step 2: Review and Apply the Overlay
The AI-generated overlay (from -o) creates naming improvements using x-speakeasy-group and x-speakeasy-name-override.
Note: For manual overlay creation, use the manage-openapi-overlays skill instead of this skill.
Step 3: Add the Overlay to workflow.yaml
sources:
my-api:
inputs:
- location: ./openapi.yaml
overlays:
- location: ./operation-ids-overlay.yamlStep 4: Regenerate the SDK
speakeasy run --output consoleError Type Suggestions
The suggest error-types command analyzes your API and suggests structured error responses:
speakeasy suggest error-types -s openapi.yamlThis suggests:
- Common HTTP error codes (400, 401, 404, 500)
- Custom error schemas appropriate for your API
Output as an overlay:
speakeasy suggest error-types -s openapi.yaml -o error-types-overlay.yamlWhat NOT to Do
- Do NOT modify operationIds directly in the source spec if it is externally managed. Use overlays instead.
- Do NOT use generic names like
getorpostwithout a group. Always pairx-speakeasy-name-overridewithx-speakeasy-group. - Do NOT forget to add the generated overlay to
workflow.yamlafter creating it. Without this step, the names will not change in the generated SDK. - Do NOT create duplicate operation names across different groups. Each
{group}_{method}combination must be unique.
Troubleshooting
| Error | Cause | Solution |
| "unauthorized" | Missing or invalid API key | Set SPEAKEASY_API_KEY env var or run speakeasy auth login |
| Names unchanged after regeneration | Overlay not added to workflow | Add the overlay to the overlays list in workflow.yaml |
| No suggestions returned | Spec already has good naming | No action needed; names are already well-structured |
| Duplicate method names | Similar endpoints share names | Use unique x-speakeasy-name-override values for each endpoint |
| Timeout during suggest | Very large spec | Try running on a smaller subset or increase timeout |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

