oRPC API routes with 5-file pattern. Only for projects using oRPC.
Builds type-safe oRPC APIs using the 5-file pattern (contract, schema, router, impl, spec). Triggers when creating new API routes in oRPC projects to ensure consistent structure and validation.
/plugin marketplace add settlemint/agent-marketplace/plugin install devtools@settlemintThis skill inherits all available tools. When active, it can use any tool Claude has access to.
templates/contract.ts.mdtemplates/impl.ts.mdtemplates/router.ts.mdtemplates/schema.ts.mdtemplates/spec.ts.md<mcp_first> CRITICAL: oRPC has no Context7 docs. Use OctoCode to search the source.
MCPSearch({ query: "select:mcp__plugin_devtools_octocode__githubSearchCode" })
MCPSearch({ query: "select:mcp__plugin_devtools_octocode__githubGetFileContent" })
// Search oRPC patterns
mcp__octocode__githubSearchCode({
keywordsToSearch: ["oc.route", "oc.input", "oc.output"],
owner: "unnoq",
repo: "orpc",
path: "packages/contract/src",
mainResearchGoal: "Understand oRPC contract definition",
researchGoal: "Find route contract patterns",
reasoning: "Need current API for oRPC contracts",
});
</mcp_first>
<quick_start> The 5-File Pattern:
routes/token/
├── token.transfer.contract.ts # API shape (OpenAPI)
├── token.transfer.schema.ts # Zod input/output
├── token.transfer.router.ts # Connects contract → impl
├── token.transfer.impl.ts # Business logic
└── token.transfer.spec.ts # Tests
</quick_start>
<five_file_pattern> Files to create for each route:
| File | Template | Purpose |
|---|---|---|
{domain}.{action}.contract.ts | templates/contract.ts.md | API shape (OpenAPI) |
{domain}.{action}.schema.ts | templates/schema.ts.md | Zod input/output validation |
{domain}.{action}.router.ts | templates/router.ts.md | Connects contract → impl |
{domain}.{action}.impl.ts | templates/impl.ts.md | Business logic handler |
{domain}.{action}.spec.ts | templates/spec.ts.md | Tests |
Read the templates for scaffolding new routes. Each template includes placeholders and documentation. </five_file_pattern>
<router_layers>
| Router | Use When | Context Provided |
|---|---|---|
publicRouter | Health, public data | requestId |
authRouter | User operations | session, user |
onboardedRouter | Org operations | organization, wallet |
tokenRouter | Token management | token, admin check |
| </router_layers> |
Required:
routes.ts.spec.ts with testsNODE_ENV checksNaming: Files=<domain>.<action>.<type>.ts, Handlers=<domain><Action>Handler
</constraints>
<success_criteria>
routes.ts.meta({ description })This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.