# Migrate Orpc To Effect

Migrate a single oRPC procedure from classic async handler to Effect-backed...

- Repository: https://github.com/humanlayer/humanlayer (12740 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add humanlayer/humanlayer --skill migrate-orpc-to-effect -g -a claude-code -y`
Codex: `npx skills add humanlayer/humanlayer --skill migrate-orpc-to-effect -g -a codex -y`
Cursor: `npx skills add humanlayer/humanlayer --skill migrate-orpc-to-effect -g -a cursor -y`
Gemini CLI: `npx skills add humanlayer/humanlayer --skill migrate-orpc-to-effect -g -a gemini-cli -y`

## Description

Migrate a single oRPC procedure from classic async handler to Effect-backed implementation. Use when converting procedures one at a time to maintain incremental, reviewable changes.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Migrate oRPC Procedure to Effect

Converts a single classic oRPC procedure to an Effect-backed implementation while preserving route shape, response contract, and authorization semantics.

## When to Use

- Converting procedures that only use services we have Effect wrappers for
- Incremental Effect migration where you want one procedure per commit/PR
- Procedure does not already use Effect (no `from 'effect'` import)

## Available Effect Services

**IMPORTANT: Always check the source of truth for available services:**

```bash
# Check AppRuntimeServices type for available Effect services
cat apps/riptide-api/src/effects/app-runtime.ts | head -50
```

Only migrate procedures that use services available in `appRuntime`. The `AppRuntimeServices` type in `apps/riptide-api/src/effects/app-runtime.ts` is the authoritative list.

**Key services to look for:**
- `PostgresDb` - for database access (replaces `context.services.db`)
- `S3` - for S3 operations (replaces `context.services.s3`)
- `StripeService` - for Stripe billing operations (replaces eligible `context.services.stripe` usage)
- Check `effects/services/` directory for other available services

**If a procedure uses a classic service not in `AppRuntimeServices`, do NOT migrate it.**

## Prerequisites

Before starting, verify the target procedure is eligible:

```bash
# 1. Check what services the procedure uses
rg 'services\.' <file>

# 2. Check what Effect services are available in the runtime
cat apps/riptide-api/src/effects/app-runtime.ts | grep -A20 'AppRuntimeServices'

# 3. Confirm procedure hasn't already been migrated
rg "from 'effect'" <file>
# If matches, procedure is already migrated
```

If the procedure uses any service from `context.services` that doesn't have a corresponding Effect service in `AppRuntimeServices`, **do NOT migrate it**.

The rest: https://github.com/humanlayer/humanlayer/blob/HEAD/.claude/skills/migrate-orpc-to-effect/SKILL.md
