Skip to content
Back to skills

Orpc Procedure

ASecurity

Understanding procedures in oRPC — standard functions with validation, middleware, and DI.

  • 8 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 12, 2026
toolsgit

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add ali-master/skills --skill orpc-procedure --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Orpc Procedure?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Orpc Procedure
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ali-master-orpc-procedure/badge)](https://www.skillsdirectory.com/skills/ali-master-orpc-procedure)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: oRPC Procedure
description: Understanding procedures in oRPC — standard functions with validation, middleware, and DI.
license: MIT
metadata:
  author: Ali Torki
  homepage: https://github.com/ali-master
  version: "1.0.0"
---

# Procedure in oRPC

A procedure is like a standard function with built-in support for:

* Input/output validation
* Middleware
* Dependency injection
* Other extensibility features

## Overview

```ts
import { os } from '@orpc/server'

const example = os
  .use(aMiddleware)
  .input(z.object({ name: z.string() }))
  .use(aMiddlewareWithInput, input => input.name)
  .output(z.object({ id: z.number() }))
  .handler(async ({ input, context }) => {
    return { id: 1 }
  })
  .callable() // Make callable
  .actionable() // Server Action compatibility
```

> Only `.handler` is required.

## Input/Output Validation

Supports [Zod](https://github.com/colinhacks/zod), [Valibot](https://github.com/fabian-hiller/valibot), [Arktype](https://github.com/arktypeio/arktype), and any [Standard Schema](https://github.com/standard-schema/standard-schema) library.

> Explicitly specifying `.output` or handler return type dramatically improves type-checking speed.

### `type` Utility

```ts
import { os, type } from '@orpc/server'

const example = os
  .input(type<{ value: number }>())
  .output(type<{ value: number }, number>(({ value }) => value))
  .handler(async ({ input }) => input)
```

## Using Middleware

```ts
const aMiddleware = os.middleware(async ({ context, next }) => next())

const example = os
  .use(aMiddleware)
  .use(async ({ context, next }) => next())
  .handler(async ({ context }) => {})
```

## Initial Configuration

```ts
const base = os.$input(z.void())
const base = os.$input<Schema<void, unknown>>()
```

`.$input` lets you redefine the input schema after initial configuration.

## Reusability

Each modification creates a new instance:

```ts
const pub = os.use(logMiddleware)
const authed = pub.use(authMiddleware)

const pubExample = pub.handler(async ({ context }) => {})
const authedExample = pubExample.use(authMiddleware)
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.