Contract-first API patterns for Dify frontend using oRPC with TanStack Query integration.
Works with
Define contracts in web/contract/* as single source of truth; consume via useQuery(consoleQuery.xxx.queryOptions(...)) at call sites for 1:1 endpoint mappings
Use .key() for partial matching in invalidation/refetch, .queryKey() for specific query identity, and .mutationKey() for mutation defaults or status filtering
Extract queryOptions helpers only when 3+ call sites share identical options; cr
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionorpc-contract-firstExecute the skills CLI command in your project's root directory to begin installation:
Fetches orpc-contract-first from langgenius/dify and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate orpc-contract-first. Access via /orpc-contract-first in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
9
total installs
9
this week
136.4K
GitHub stars
0
upvotes
Run in your terminal
9
installs
9
this week
136.4K
stars
web/contract/*.useQuery(consoleQuery|marketplaceQuery.xxx.queryOptions(...)) when endpoint behavior maps 1:1 to the contract.web/contract/
├── base.ts
├── router.ts
├── marketplace.ts
└── console/
├── billing.ts
└── ...other domains
web/service/client.ts
web/contract/console/{domain}.ts or web/contract/marketplace.ts
base.route({...}).output(type<...>()) as baseline..input(type<...>()) only when request has params/query/body.GET without input, omit .input(...) (do not use .input(type<unknown>())).web/contract/router.ts
import { useQuery } from '@tanstack/react-query'
import { consoleQuery } from '@/service/client'
const invoiceQuery = useQuery(consoleQuery.billing.invoices.queryOptions({
staleTime: 5 * 60 * 1000,
throwOnError: true,
select: invoice => invoice.url,
}))
*.queryOptions(...).retry: false), extract a small queryOptions helper, not a use-* passthrough hook.web/service/use-{domain}.ts only for orchestration:
const invoicesBaseQueryOptions = () =>
consoleQuery.billing.invoices.queryOptions({ retry: false })
const invoiceQuery = useQuery({
...invoicesBaseQueryOptions(),
throwOnError: true,
})
consoleQuery / marketplaceQuery, for example useMutation(consoleQuery.billing.bindPartnerStack.mutationOptions(...)).mutationFn (for example consoleClient.xxx / marketplaceClient.xxx), instead of generic handwritten non-oRPC mutation logic..key vs .queryKey vs .mutationKey).key(...):
queryClient.invalidateQueries({ queryKey: consoleQuery.billing.key() }).queryKey(...):
.mutationKey(...):
useIsMutating, queryClient.isMutating), or explicit devtools grouping.useQuery with options?: Partial<UseQueryOptions>.queryKey/queryFn when oRPC queryOptions already exists and fits the use case.use-* passthrough hooks for a single endpoint.data may become unknown, especially around throwOnError/select) and add unnecessary indirection.{ params, query?, body? } format.input(...); do not use .input(type<unknown>()){paramName} in path, match in params object/billing/* -> billing: {})@/types/, use type<T>() helpermutationOptions; use explicit mutationKey mainly for defaults/filtering/devtoolsexport type ConsoleInputs = InferContractRouterInputs<typeof consoleRouterContract>
Make data-driven prioritization decisions faster
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Prerequisites
Time Estimate
30-60 minutes to see productivity improvements
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid when
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
mattpocock/skills
parcadei/continuous-claude-v3
cursor/plugins
ailabs-393/ai-labs-claude-skills
pproenca/dot-skills
mattpocock/skills
orpc-contract-first is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
I recommend orpc-contract-first for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
orpc-contract-first reduced setup friction for our internal harness; good balance of opinion and flexibility.
orpc-contract-first fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
Registry listing for orpc-contract-first matched our evaluation — installs cleanly and behaves as described in the markdown.
Keeps context tight: orpc-contract-first is the kind of skill you can hand to a new teammate without a long onboarding doc.
I recommend orpc-contract-first for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
orpc-contract-first has been reliable in day-to-day use. Documentation quality is above average for community skills.
Useful defaults in orpc-contract-first — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
I recommend orpc-contract-first for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
showing 1-10 of 40