orpc-contract-first

Automate oRPC contract-first API setup in the Dify frontend.

2.2k|448|Updated Dec 9, 2024
One-click install
npx skills add https://github.com/YFGaia/dify-plus --skill orpc-contract-first
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: orpc-contract-first
Source: https://github.com/YFGaia/dify-plus/tree/main/.agents/skills/orpc-contract-first
Command: npx skills add https://github.com/YFGaia/dify-plus --skill orpc-contract-first

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides teams to implement oRPC contract-first APIs in the Dify frontend, aligning contracts, routers, and service layers to reduce integration drift.

Core Features & Use Cases

  • Defines input/output contracts, router organization, and typed service hooks to enable end-to-end API development.
  • Supports creating new API contracts, adding service endpoints, and migrating legacy calls to the oRPC pattern within web/contract and web/service.

Quick Start

Create a new contract under web/contract/console for a domain, wire it in router.ts, and implement a matching hook in web/service.

Frequently Asked Questions about orpc-contract-first

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up oRPC contract-first API patterns in a TypeScript frontend?▼

oRPC contract-first API patterns are set up by defining explicit input/output contracts under web/contract, wiring them through router composition, and implementing typed service hooks in web/service to ensure end-to-end consistency.

What is the best way to migrate legacy API calls to an oRPC contract-first workflow?▼

Migrating legacy calls to an oRPC contract-first workflow involves replacing existing endpoints across web/contract and web/service directories with typed imports and explicit contracts to reduce integration drift.

How does oRPC integrate with TanStack Query using typed contracts?▼

oRPC integrates with TanStack Query by applying typed service hooks that bind explicit input/output contracts to query operations, ensuring typed data fetching and end-to-end API development consistency.

Do I need a TypeScript-first workflow to use oRPC contract-first API patterns?▼

Yes, a TypeScript-first workflow is required for oRPC contract-first API patterns to enforce explicit input/output contracts, router organization, and typed imports across the service and contract layers.

Why does oRPC contract-first API design reduce integration drift in web services?▼

oRPC contract-first API design reduces integration drift by codifying contracts, routers, and service layers so that frontend and backend implementations remain aligned through typed imports and explicit definitions.

Can I add new service endpoints without breaking existing oRPC contracts?▼

Adding new service endpoints requires creating a new contract under web/contract/console for the domain, wiring it in router.ts, and implementing a matching typed hook in web/service to maintain consistency.