CtrlK
BlogDocsLog inGet started
Tessl Logo

orpc-contract-first

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

2.66x
Quality

89%

Does it follow best practices?

Impact

96%

2.66x

Average score across 6 eval scenarios

SecuritybySnyk

Passed

No known issues

SKILL.md
Quality
Evals
Security

Evaluation results

92%

68%

Add In-App Notifications API Contract

Contract definition and structure

Criteria
Without context
With context

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%

86%

12%

Wire Up Subscription Management API for Frontend Consumption

Router registration and no-barrel-file rule

Criteria
Without context
With context

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%

100%

57%

Implement Audit Log API Integration

TanStack Query hooks and type exports

Criteria
Without context
With context

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%

100%

77%

API Token Management for Dify Workspace

Mutation patterns with oRPC

Criteria
Without context
With context

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%

100%

64%

Billing Dashboard with Shared Plan Data

Query abstraction decision rule

Criteria
Without context
With context

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%

100%

84%

Plugin Marketplace Integration with Live Cache Refresh

Cache invalidation patterns and marketplace contracts

Criteria
Without context
With context

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%

Repository
langgenius/dify
Evaluated
Agent
Claude Code
Model
Claude Sonnet 4.6

Table of Contents

Is this your skill?

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.