orval
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "orval" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-5099dbe27fcfca9e3801a57dcbea7ede97cf5839d14db74267efeae2e3caab89. Verify the upstream source and version against https://github.com/pproenca/dot-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Best practices for generating TypeScript clients with Orval from OpenAPI, including configuring Orval, generating TypeScript clients from OpenAPI specs, setting up React Query/SWR hooks, creating custom mutators, and writing MSW mock data. Triggered when tasks involve orval.config.ts, OpenAPI code generation, API client setup, or mock data generation.
Introduction source: third_party · pproenca · 0.0.1 Reference
SkillPi interpretation
- Tasks
- 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.
- Inputs and outputs
- `output-file-extension` - Use distinct file extensions for generated code `output-index-files` - Generate index files for clean imports `output-naming-convention` - Configure consistent naming conventions `output-clean-target` - Enable clean mode for consistent regeneration `output-headers-enabled` - Enable headers in generated functions
- Testing
- Not tested
Browse files
Frontmatter
name: orval
description: 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.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
Current listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 Orval OpenAPI TypeScript 客户端生成的全面最佳实践
- 涵盖 42 条规则,8 大类别,优先级清晰,实用性强
- 面向开发者解决实际工程痛点,具有明确应用场景
Highlights
- 触发词精准完整,覆盖配置、生成、集成、测试等关键场景
- 边界清晰,不易与其他 Skill 重叠
Areas to improve
-
description写错位置 Reported severity: Minor
description 写在 skill_body 内部而非顶层 frontmatter
Recommendation: 将 description 移至顶层 frontmatter
-
文档过长 Reported severity: Minor
单文件内容较长,建议拆分为多个子文档
Recommendation: 考虑将详细规则拆分为独立的参考文档
-
引用文件缺失 Reported severity: Minor
引用了 references/_sections.md 等文件但未传入
Recommendation: 确保所有引用文件都包含在 Skill 包中
Highlights
- 结构清晰,有明确的章节划分和优先级体系
- 提供了完整的规则分类和快速参考指南
Highlights
- 内容基于 Orval 官方生态,来源可靠
- 覆盖类型安全、错误处理、测试等关键可靠性方面
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.