Guide for implementing oRPC contract-first API patterns in Dify frontend. Trigger when creating or updating contracts in web/contract, wiring router composition, integrating TanStack Query with typed contracts, migrating legacy service calls to oRPC, or deciding whether to call queryOptions directly vs extracting a helper or use-* hook in web/service.
94
89%
Does it follow best practices?
Impact
96%
2.66xAverage score across 6 eval scenarios
Passed
No known issues
Contract definition and structure
Contract file location
0%
100%
base import
0%
100%
type import from @orpc/contract
100%
100%
path field defined
0%
100%
method field defined
0%
100%
input field defined
100%
100%
output field defined
100%
100%
Detailed input structure
0%
100%
Path param syntax
0%
100%
Path param in params object
0%
100%
Type import source
0%
0%
type<T>() helper
0%
100%
Router registration and no-barrel-file rule
Router file updated
100%
100%
Direct domain import in router
100%
100%
No barrel file created
100%
100%
API prefix nesting
100%
100%
Hook file location
25%
100%
Multiple hooks created
100%
100%
consoleQuery queryKey called
33%
77%
Correct group.contract in queryKey
55%
77%
consoleClient called as fetcher
33%
44%
Correct group.contract in client call
55%
44%
ConsoleInputs type export preserved
100%
100%
TanStack Query hooks and type exports
Contract file in console/
100%
100%
base import used
0%
100%
Detailed input structure
0%
100%
Path param in path string
100%
100%
Path param in params schema
22%
100%
Hook file naming
25%
100%
consoleQuery.queryKey usage
0%
100%
consoleClient call usage
14%
100%
ConsoleInputs reflects new contracts
100%
100%
No barrel files
100%
100%
Mutation patterns with oRPC
useMutation with mutationOptions
0%
100%
Custom mutation uses oRPC client
0%
100%
No non-oRPC mutation logic
0%
100%
mutationKey used for status or defaults
0%
100%
No-input GET omits .input()
30%
100%
Contract file location
100%
100%
Mutation contract input structure
0%
100%
base.route baseline
0%
100%
Router registration
37%
100%
No barrel files
100%
100%
Types from @/types/
50%
100%
Query abstraction decision rule
Shared queryOptions helper created
0%
100%
Helper not a use-* hook
0%
100%
No thin passthrough use-* hook
0%
100%
Single call-site uses queryOptions directly
0%
100%
No Partial<UseQueryOptions> wrapping
100%
100%
No manual queryKey/queryFn split
41%
100%
consoleQuery used throughout
60%
100%
Shared options in helper only
50%
100%
No barrel files
100%
100%
Cache invalidation patterns and marketplace contracts
Marketplace contract location
100%
100%
marketplaceQuery at call site
0%
100%
.key() used for group invalidation
0%
100%
.queryKey() used for exact entry
0%
100%
No manual queryKey/queryFn split
0%
100%
invalidateQueries not using raw key arrays
0%
100%
Contract input structure
0%
100%
base.route baseline
0%
100%
Router registration
0%
100%
No barrel files
100%
100%
ConsoleInputs preserved
0%
100%
4717168
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.