Skills

Migrate Orpc To Effect

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

Install

npx skills add humanlayer/humanlayer --skill migrate-orpc-to-effect -g -a claude-code -y
Repository
humanlayer/humanlayer12.7k
Category
Engineering
Updated
4d ago
License
Apache-2.0
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

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.

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:

# 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:

# 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.

Read the whole SKILL.md on GitHub

More in Engineering