ali-master/skills/orpc-rpc-json-serializer

Claude Code and agent skill by ali-master/skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Extend or override the standard RPC JSON serializer.

Install

npx vskill@latest install ali-master/skills/orpc-rpc-json-serializer

SKILL.md

The same SKILL.md was published earlier as ali-master/skills/orpc-rpc-json-serializer.

RPC JSON Serializer

Handles JSON payloads for the RPC Protocol and supports native data types.

Extending Native Data Types

  1. Define Your Custom Serializer:
ts
import type { StandardRPCCustomJsonSerializer } from '@orpc/client/standard'
export class User {
constructor(
public readonly id: string,
public readonly name: string,
public readonly email: string,
public readonly age: number,
) {}
toJSON() {
return { id: this.id, name: this.name, email: this.email, age: this.age }
}
}
export const userSerializer: StandardRPCCustomJsonSerializer = {
type: 21,
condition: data => data instanceof User,
serialize: data => data.toJSON(),
deserialize: data => new User(data.id, data.name, data.email, data.age),
}
Ensure type is unique and greater than 20 to avoid conflicts with built-in types.
  1. Use Your Custom Serializer:
ts
import { RPCHandler } from '@orpc/server/fetch'
import { RPCLink } from '@orpc/client/fetch'
const handler = new RPCHandler(router, {
customJsonSerializers: [userSerializer],
})
const link = new RPCLink({
url: 'https://example.com/rpc',
customJsonSerializers: [userSerializer],
})

Overriding Built-in Types

Match type with built-in types.

Example: oRPC ignores undefined in objects. To override:

ts
export const undefinedSerializer: StandardRPCCustomJsonSerializer = {
type: 3, // Match built-in undefined type
condition: data => data === undefined,
serialize: data => null,
deserialize: data => undefined,
}

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
9
7-day trend score
17

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ali-master/skills/orpc-rpc-json-serializer/badge)](https://verified-skill.com/skills/ali-master/skills/orpc-rpc-json-serializer)

Something wrong with this skill or its page? Tell us.