Orval
Skill ulpi-io/plugin-marketplace/plugins/pproenca/skills/orval
Orval OpenAPI TypeScript client generation best practices. This skill should be used when configuring Orval, generating TypeScript clients from OpenAPI specs, setting up React Query/SWR hooks, creating custom mutators, or writing MSW mocks. Triggers on tasks involving orval.config.ts, OpenAPI codegen, API client setup, or mock generation.From its SKILL.md
npx -y skills add ulpi-io/plugin-marketplace --skill orvalAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.2 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
Orval OpenAPI Best Practices
Comprehensive guide for generating type-safe TypeScript clients from OpenAPI specifications using Orval. Contains 42 rules across 8 categories, prioritized by impact to guide automated configuration, client generation, and testing setup.
When to Apply
Reference these guidelines when:
- Configuring Orval for a new project
- Setting up OpenAPI-based TypeScript client generation
- Integrating React Query, SWR, or Vue Query with generated hooks
- Creating custom mutators for authentication and error handling
- Generating MSW mocks for testing
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | OpenAPI Specification Quality | CRITICAL | spec- |
| 2 | Configuration Architecture | CRITICAL | orvalcfg- |
| 3 | Output Structure & Organization | HIGH | output- |
| 4 | Custom Client & Mutators | HIGH | mutator- |
| 5 | Query Library Integration | MEDIUM-HIGH | oquery- |
| 6 | Type Safety & Validation | MEDIUM | types- |
| 7 | Mock Generation & Testing | MEDIUM | mock- |
| 8 | Advanced Patterns | LOW | adv- |
Quick Reference
1. OpenAPI Specification Quality (CRITICAL)
spec-operationid-unique- Use unique and descriptive operationIdsspec-schemas-reusable- Define reusable schemas in componentsspec-tags-organization- Organize operations with tagsspec-response-types- Define all response types explicitlyspec-required-fields- Mark required fields explicitly
2. Configuration Architecture (CRITICAL)
orvalcfg-mode-selection- Choose output mode based on API sizeorvalcfg-client-selection- Select client based on framework requirementsorvalcfg-separate-schemas- Separate schemas into dedicated directoryorvalcfg-input-validation- Validate OpenAPI spec before generationorvalcfg-baseurl-setup- Configure base URL properlyorvalcfg-prettier-format- Enable automatic code formatting
3. Output Structure & Organization (HIGH)
output-file-extension- Use distinct file extensions for generated codeoutput-index-files- Generate index files for clean importsoutput-naming-convention- Configure consistent naming conventionsoutput-clean-target- Enable clean mode for consistent regenerationoutput-headers-enabled- Enable headers in generated functions
4. Custom Client & Mutators (HIGH)
mutator-custom-instance- Use custom mutator for HTTP client configurationmutator-error-types- Export custom error types from mutatormutator-body-wrapper- Export body type wrapper for request transformationmutator-interceptors- Use interceptors for cross-cutting concernsmutator-token-refresh- Handle token refresh in mutatormutator-fetch-client- Use fetch mutator for smaller bundle size
5. Query Library Integration (MEDIUM-HIGH)
oquery-hook-options- Configure default query options globallyoquery-key-export- Export query keys for cache invalidationoquery-infinite-queries- Enable infinite queries for paginated endpointsoquery-suspense-support- Enable suspense mode for streaming UXoquery-signal-cancellation- Pass AbortSignal for request cancellationoquery-mutation-callbacks- Use generated mutation options types
6. Type Safety & Validation (MEDIUM)
types-zod-validation- Generate Zod schemas for runtime validationtypes-zod-strict- Enable Zod strict mode for safer validationtypes-zod-coerce- Use Zod coercion for type transformationstypes-use-dates- Enable useDates for Date type generationtypes-bigint-support- Enable useBigInt for large integer support
7. Mock Generation & Testing (MEDIUM)
mock-msw-generation- Generate MSW handlers for testingmock-use-examples- Use OpenAPI examples for realistic mocksmock-delay-config- Configure mock response delaysmock-http-status- Generate mocks for all HTTP status codesmock-index-files- Generate mock index files for easy setup
8. Advanced Patterns (LOW)
adv-input-transformer- Use input transformer for spec preprocessingadv-operation-override- Override settings per operationadv-output-transformer- Use output transformer for generated code modificationadv-form-data-handling- Configure form data serialization
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
- Example: spec-operationid-unique
Related Skills
- For consuming generated hooks, see
tanstack-queryskill - For mocking generated API clients, see
test-mswskill - For schema validation, see
zodskill
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
What ships with it: 47 files
95.6 KB alongside SKILL.md
assets/
references/
- adv-form-data-handling.md1.9 KB
- adv-input-transformer.md2.0 KB
- adv-operation-override.md2.1 KB
- adv-output-transformer.md2.1 KB
- mock-delay-config.md2.0 KB
- mock-http-status.md1.9 KB
- mock-index-files.md2.0 KB
- mock-msw-generation.md1.9 KB
- mock-use-examples.md1.8 KB
- mutator-body-wrapper.md2.0 KB
- mutator-custom-instance.md1.9 KB
- mutator-error-types.md2.0 KB
- mutator-fetch-client.md2.2 KB
- mutator-interceptors.md2.2 KB
- mutator-token-refresh.md2.6 KB
- oquery-hook-options.md2.0 KB
- oquery-infinite-queries.md1.9 KB
- oquery-key-export.md2.0 KB
- oquery-mutation-callbacks.md2.1 KB
- oquery-signal-cancellation.md1.9 KB
- oquery-suspense-support.md2.0 KB
- orvalcfg-baseurl-setup.md1.9 KB
- orvalcfg-client-selection.md1.7 KB
- orvalcfg-input-validation.md1.6 KB
- orvalcfg-mode-selection.md1.5 KB
- orvalcfg-prettier-format.md1.5 KB
- orvalcfg-separate-schemas.md1.8 KB
- output-clean-target.md1.6 KB
- output-file-extension.md1.6 KB
- output-headers-enabled.md1.6 KB
- output-index-files.md1.6 KB
- output-naming-convention.md1.8 KB
- _sections.md1.7 KB
- spec-operationid-unique.md1.4 KB
- spec-required-fields.md1.8 KB
- spec-response-types.md2.2 KB
- AGENTS.md8.8 KB
- metadata.json815 B
- README.md4.1 KB
7 more files not listed here. See all 47 in the repository.