willyd61/nautobot-v2-custom-metrics-old/openapi-codegen
Claude Code and agent skill by willyd61/nautobot-v2-custom-metrics-old
- community
- ext:[{"type":"template","description":"Custom templates for code generation"},{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
OpenAPI client code generation. Covers openapi-typescript, openapi-generator-cli, swagger-typescript-api, and trpc-openapi. Use for generating type-safe API clients. USE WHEN: user mentions "OpenAPI codegen", "generate API client", "openapi-typescript", "swagger-typescript-api", "openapi-generator", asks about "generate types from OpenAPI", "type-safe API client", "OpenAPI client generation" DO NOT USE FOR: Writing OpenAPI specs - use `openapi` instead; GraphQL codegen - use `graphql-codegen` i…
Install
npx vskill@latest install willyd61/nautobot-v2-custom-metrics-old/openapi-codegenSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as willyd61/nautobot-v2-custom-metrics-old/openapi-codegen.
OpenAPI Code Generation Core Knowledge
Deep Knowledge: Usemcp__documentation__fetch_docswith technology:openapi-codegenfor comprehensive documentation.
openapi-typescript (Types Only)
Generates TypeScript types from OpenAPI schemas. Lightweight, no runtime.
Generated Types Usage
With openapi-fetch
openapi-generator-cli (Full Client)
Generates complete API clients with fetch/axios implementations.
Configuration File
Generated Client Usage
swagger-typescript-api
Fast, customizable generator with template support.
Configuration
Generated Client Usage
trpc-openapi (Export tRPC as OpenAPI)
Generate OpenAPI spec from tRPC router. Useful for external API consumers.
Define OpenAPI Endpoints
Generate OpenAPI Document
REST Handler
Production Readiness
CI/CD Integration
Package Scripts
Watch Mode Development
Validation Before Generation
Monitoring Metrics
| Metric | Target | |
|---|---|---|
| Generated type coverage | 100% of endpoints | |
| Build time with generation | < 30s | |
| Type errors after generation | 0 | |
| Spec validation errors | 0 |
Checklist
- [ ] OpenAPI spec validation in CI
- [ ] Automated type generation on spec changes
- [ ] Generated code committed or gitignored
- [ ] Version pinned for generator CLI
- [ ] Custom templates documented
- [ ] API client initialization documented
- [ ] Error handling patterns documented
- [ ] Authentication setup in client
- [ ] Breaking change detection
- [ ] Generated code tested
When NOT to Use This Skill
- Writing OpenAPI specifications (use
openapiskill) - GraphQL type generation (use
graphql-codegenskill) - tRPC type-safe APIs (use
trpcskill) - Manual API client implementation
- Simple APIs where manual types suffice
Anti-Patterns
| Anti-Pattern | Why It's Bad | Solution | |
|---|---|---|---|
| Committing generated code to git | Merge conflicts, stale code | Add to .gitignore, generate in CI/build | |
| Not versioning generator CLI | Inconsistent output | Pin generator versions in package.json | |
| Editing generated files manually | Changes lost on regeneration | Extend or wrap generated code | |
| No validation before generation | Invalid types generated | Validate spec with @redocly/cli first | |
| Using different generators across team | Type inconsistencies | Standardize on one generator | |
| Generating from remote spec without caching | Slow builds, network dependency | Cache spec locally or use schema registry | |
| Not updating on spec changes | Type/runtime mismatch | Run generation in CI on spec updates | |
| Missing error handling in generated code | Poor error UX | Wrap generated client with error handling |
Quick Troubleshooting
| Issue | Possible Cause | Solution | |
|---|---|---|---|
| Generation fails | Invalid OpenAPI spec | Validate with @redocly/cli lint | |
| Type errors after generation | Spec doesn't match API | Verify spec matches actual responses | |
| Missing types | Spec incomplete or refs broken | Check all $refs resolve, add missing schemas | |
| Wrong HTTP client generated | Generator config mismatch | Check -g flag or generator setting | |
| Circular reference errors | Self-referencing schemas | Use discriminators or flatten schema | |
| Slow generation | Large spec file | Use spec splitting or partial generation | |
| Auth not working | Security scheme not configured | Add securityWorker or token config | |
| "Cannot find module" errors | Generation didn't complete | Check for generation errors, rerun | |
| Type conflicts | Multiple generators running | Use single generator, remove others |
Reference Documentation
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.mcp-servers/skill-loader/skills/api-integration/openapi-codegen/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
templateCustom templates for code generationconfigConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/willyd61/nautobot-v2-custom-metrics-old/openapi-codegen)