# Rails on lambda

> Rails on lambda is an open-source agent skill for cloud and infrastructure. Guides an agent through deploying and debugging a Rails app on AWS Lambda. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/sorah/config/tree/master/claude/marketplace/plugins/sorah-guides/skills/rails-on-lambda
- **Repository:** https://github.com/sorah/config
- **GitHub stars:** 31
- **License:** MIT
- **Skill name:** rails-on-lambda
- **Collection:** https://github.com/sorah/config
- **Categories:** [cloud and infrastructure](https://ai-powered.com/categories/cloud-and-infrastructure), [design and media](https://ai-powered.com/categories/design-and-media)
- **Listing updated:** 2026-12-03

## About

This skill covers running a Rails application on AWS Lambda from a single container image split into three functions: a web handler behind a function URL and CloudFront, an ActiveJob worker fed by SQS through Lambdakiq, and a runner for one-off commands such as database migrations. It explains the constraints Lambda imposes, including single-request environments, a read-only filesystem apart from /tmp, a 6 MB payload limit and a 15-minute invocation cap, and tells the agent how to design around them.

The skill points to a set of reference files to copy into a project and describes the details that matter: configuration from SSM Parameter Store loaded before Rails boots, origin verification and client IP handling through CloudFront, bootsnap precompilation, and a CLI that invokes the runner and returns the command's exit status. It also gives an ordered deploy flow that runs migrations before updating the job and web functions.

The skill expects Terraform for the infrastructure, AWS credentials with the listed Lambda, SSM, SQS and ECR permissions, and a Ruby project using apigatewayv2_rack, lambdakiq and aws_lambda_ric. Project conventions in CLAUDE.md or docs take priority over its guidance.

## When your agent uses it

> This skill should be used when deploying, running, or debugging a Rails app on AWS Lambda, or when moving a Rails app from ECS, App Runner, Heroku or a VM onto Lambda. Use it when touching the Dockerfile, an entrypoint, a Lambda handler, ActiveJob on SQS, secrets loading, CloudFront in front of a function URL, one-off commands like `db:migrate` in production, or the deploy workflow of such an app, even if the user only says "add a job", "add a secret" or "why is the client IP wrong" in such an app. Signs include `apigatewayv2_rack`, `aws_lambda_ric`, `lambdakiq`, `Lambdakiq.cmd`, `LambdaRackApp`, `CommandRunner`, `lambrunner.rb`, `lambda_entrypoint.sh`, `SSM_SECRET__`, `APP_HANDLER`, `AWS_LAMBDA_FUNCTION_NAME`, `aws_lambda_function_url`, `x-origin-verify`, or the user mentioning "Rails on Lambda", "serverless Rails", "Lamby", or "function URL". Provides the container image, handlers for web, jobs and commands, secrets, CloudFront, deploy and migration flow, and the limits to design around. Project-specific co

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs shell and Ruby scripts](https://github.com/sorah/config/tree/HEAD/claude/marketplace/plugins/sorah-guides/skills/rails-on-lambda)
- [Network calls found in its scripts](https://github.com/sorah/config/tree/HEAD/claude/marketplace/plugins/sorah-guides/skills/rails-on-lambda)
- [License: MIT](https://github.com/sorah/config/tree/HEAD/claude/marketplace/plugins/sorah-guides/skills/rails-on-lambda)

## Features

- **Container image setup:** Covers building one Ruby image that runs under the Lambda runtime interface client and the Puma server.
- **Web function via CloudFront:** Explains the function URL, origin verification header, and client IP and host forwarding behind CloudFront.
- **SQS background jobs:** Describes ActiveJob on SQS with Lambdakiq, including queue visibility, redrive settings and retry behavior.
- **One-off command runner:** Covers invoking a runner function to execute commands such as rake db:migrate and returning their output.
- **Secrets from SSM:** Explains loading SSM parameters into environment variables before Rails boots.
- **Ordered deploy workflow:** Lists the sequence of migrating, then updating job and web functions, with rollback by image tag.

## Good for

- Move a Rails app from ECS or Heroku onto AWS Lambda
- Add a background job that runs through SQS on Lambda
- Run a database migration against a production Lambda deployment
- Debug a wrong client IP behind CloudFront in a Lambda-hosted Rails app
- Set up a secret loaded from SSM Parameter Store for a Lambda function

## Install

### Claude Code

This skill ships in the `sorah-guides` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add sorah/config
/plugin install sorah-guides@sorah-marketplace
```

Or copy only this skill to `~/.claude/skills/rails-on-lambda`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/rails-on-lambda &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/rails-on-lambda" ~/.claude/skills/rails-on-lambda &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/rails-on-lambda` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/rails-on-lambda` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/rails-on-lambda &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/rails-on-lambda" ~/.agents/skills/rails-on-lambda &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/rails-on-lambda` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/rails-on-lambda` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/rails-on-lambda &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/rails-on-lambda" ~/.cursor/skills/rails-on-lambda &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/rails-on-lambda` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/sorah/config.git --path claude/marketplace/plugins/sorah-guides/skills/rails-on-lambda
```

Or copy the folder to `~/.gemini/skills/rails-on-lambda` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/rails-on-lambda`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/rails-on-lambda &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/rails-on-lambda" ~/.copilot/skills/rails-on-lambda &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/rails-on-lambda` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/sorah/config.git
```

Then copy `config/claude/marketplace/plugins/sorah-guides/skills/rails-on-lambda` into your agent's skills folder as `rails-on-lambda`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need before Rails on lambda can be used?

It expects a Rails app that will run on AWS Lambda, with Terraform for the infrastructure and the gems apigatewayv2_rack, lambdakiq and aws_lambda_ric.

### Does Rails on lambda change the app's code on its own?

It provides reference files to copy into the project and describes the steps, replacing placeholders such as the app name, account ID and region.

### Why are migrations run before the functions are updated?

The skill says to migrate first so that neither jobs nor requests run new code against an old schema, and to keep schema changes compatible with the running code.

### Can a Rails console or long task run on Lambda?

The skill says long-running or interactive commands such as rails console need ECS or ECS Exec with the same image, since the runner is limited to 900 seconds.

### How do I install Rails on lambda in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/rails-on-lambda to use it in all your projects, or to .claude/skills/rails-on-lambda in one project. Or install the sorah-guides plugin, which includes it: /plugin marketplace add sorah/config, then /plugin install sorah-guides@sorah-marketplace.

### Does Rails on lambda run scripts?

Yes. It runs shell and Ruby scripts. Its scripts contain network calls. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Rails on lambda?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Rails on lambda?

The closest alternatives to Rails on lambda are Runpod flash, Cascading voice agent, Deploy, Craft cloud and Runpod companion clis.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Runpod flash](https://ai-powered.com/skills/runpod-flash): Runpod flash is an open-source agent skill for cloud and infrastructure.
- [Cascading voice agent](https://ai-powered.com/skills/cascading-voice-agent): Cascading voice agent is an open-source agent skill for design and media.
- [Deploy](https://ai-powered.com/skills/deploy-zeitlos): Deploy is an open-source agent skill for cloud and infrastructure.
- [Craft cloud](https://ai-powered.com/skills/craft-cloud): Craft cloud is an open-source agent skill for databases.
- [Runpod companion clis](https://ai-powered.com/skills/runpod-companion-clis): Runpod companion clis is an open-source agent skill for cloud and infrastructure.
- [Deployment patterns](https://ai-powered.com/skills/deployment-patterns): Deployment patterns is an open-source agent skill for cloud and infrastructure.
- [Cloud run basics](https://ai-powered.com/skills/cloud-run-basics): Cloud run basics is an open-source agent skill for cloud and infrastructure.
- [Hf cloud sagemaker production defaults](https://ai-powered.com/skills/hf-cloud-sagemaker-production-defaults): Hf cloud sagemaker production defaults is an open-source agent skill for cloud and infrastructure.

---
Source: https://ai-powered.com/skills/rails-on-lambda
