Skip to content
Back to skills

Ruby Anything

ASecurity

Migrate an app or a function written in TypeScript/JavaScript, Python, Go, Java/Spring Boot, Kotlin, C#, PHP, Rust or Swift to Ruby on Rails 8 with Hotwire (Turbo + Stimulus), Tailwind CSS and daisyUI, with the ruby-anything CLI or MCP tools - plan, grill the user, record the original's behavior, put a Rails front door in front of it, port route by route and unit by unit, diff, gate, and lift to a pure Rails app. Use when asked to rewrite, port, convert or migrate code or an app to Ruby or Ra...

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
developmentjavascripttypescriptpythonrustgojavarubyphpswiftkotlin

Works with

  • cli
  • mcp

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 12 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add akkisavi/ruby-anything --skill ruby-anything --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ruby Anything?

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

Security grade badge for Ruby Anything
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/akkisavi-ruby-anything/badge)](https://www.skillsdirectory.com/skills/akkisavi-ruby-anything)

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: ruby-anything
description: Migrate an app or a function written in TypeScript/JavaScript, Python, Go, Java/Spring Boot, Kotlin, C#, PHP, Rust or Swift to Ruby on Rails 8 with Hotwire (Turbo + Stimulus), Tailwind CSS and daisyUI, with the ruby-anything CLI or MCP tools - plan, grill the user, record the original's behavior, put a Rails front door in front of it, port route by route and unit by unit, diff, gate, and lift to a pure Rails app. Use when asked to rewrite, port, convert or migrate code or an app to Ruby or Rails, or to plan such a migration.
---

# Migration to Ruby on Rails with ruby-anything

ruby-anything gives you ground truth; you write the Ruby. The original's recorded behavior is the
spec, not its tests and not your reading of the code. Move one piece at a time, keep the app
running at every step, and call a piece done only when `gate` passes.

**Target stack** (unless the user's ADRs say otherwise): Rails 8 (7.2 works), Hotwire (Turbo
Drive, Frames, Streams + Stimulus) with importmap, Tailwind CSS v4 through `tailwindcss-rails` with
daisyUI 5, ActiveRecord, Minitest, Solid Queue/Cache/Cable, the Rails authentication generator.

**Whole app** (the usual request): read [whole-app.md](whole-app.md) first and follow it. It
grills the user on the decisions, records the whole app over HTTP, puts a Rails front door in
front of the original, moves routes one at a time, and lifts to a pure Rails app. For every page
you build, read [frontend.md](frontend.md): how React/Vue/Angular/templates map to ERB + Turbo +
Stimulus + daisyUI.

**Before porting any code, read the file for its language** in [languages/](languages/): how
its constructs map to Ruby and the traps that made recorded cases differ.
[python.md](languages/python.md), [javascript.md](languages/javascript.md) (TS and JS),
[go.md](languages/go.md), [java.md](languages/java.md) (Spring Boot), [kotlin.md](languages/kotlin.md),
[csharp.md](languages/csharp.md) (ASP.NET Core), [php.md](languages/php.md) (Laravel),
[rust.md](languages/rust.md), [swift.md](languages/swift.md).

Tools: the `ruby-anything` CLI, or the same steps as MCP tools (`ruby-anything mcp`): `go`,
`analyze`, `bridge`, `record`, `diff`, `gate`, `rules`, `app_record`, `app_replay`,
`app_front_door`, `app_wire`, `app_status`, `app_lift`, `doctor`. If the MCP tools are missing, use
the CLI. If `ruby-anything` is not installed, ask the user to run `npm i -g ruby-anything` and
`ruby-anything setup`, then restart the agent. When a step fails because a runtime is missing,
run `ruby-anything doctor`: it checks each one and prints the fix.

Recording runs the original's real code. Work on a copy, with a test database
(`--db-reset "<command>"`). Never point it at production data.

## The one command: `go`

```sh
ruby-anything go                       # 1st run: analyze -> rails/port/PLAN.md + TASK.md (grill the user)
ruby-anything go -- python3 app.py     # once DECISIONS.md has ADRs: record the app, build the front door, replay
ruby-anything go                       # every later run: replay, fallback rate, next route -> TASK.md
```

Each run moves to the next stage and writes `rails/port/TASK.md`. Do what it says, then run `go`
again. Report its stage and next step to the user at each checkpoint.

## 1. Plan, then stop

```sh
ruby-anything analyze <repo>          # people: rails/port/PLAN.md
ruby-anything analyze <repo> --json   # you: schema ruby-anything/analyze@1
```

- Present the shape, the waves (1 models, 2 business logic, 3 routes/controllers, 4 views, 5 jobs
  and mailers, 6 lift) and the `start_here` units.
- Call out dependencies with no Rails equivalent (`rails: null`). Do not hand-roll a missing gem
  silently: research it (whole-app.md step 2) and flag it.
- Ask the decisions `analyze` lists (whole-app.md step 1). **Wait for the user's approval of the
  plan and the decisions before writing Ruby.**

## 2. Port one unit (a function)

Units are the original's functions: pricing rules, parsers, validators, formatters. Their Ruby
lives in `rails/app/services/<module>.rb` as module methods (or a class for stateless service
objects).

```sh
ruby-anything bridge <repo> <unit-id>      # Ruby skeleton + rails/port/TASK.md; never overwrites a method
ruby-anything record <repo> <unit-id>      # the original's behavior on edge cases -> rails/port/cases/*.jsonl
ruby-anything record <repo> <unit-id> --inputs real.jsonl   # {"fn": name, "args": [...]} per line
ruby-anything record <repo> <unit-id> --from-tests -- pytest     # or: npx jest, npx vitest run, node --test
ruby-anything record <repo> <unit-id> --pin-clock          # time and dates read 2026-01-01T00:00:00Z
```

- **The original has tests? Record their calls**: `--from-tests -- <test command>` runs the suite
  with the function instrumented (Python, TypeScript, JavaScript), and every distinct call it makes
  becomes a case next to the generated ones (`--no-generate` for only those). The source file is
  restored byte for byte afterwards, also after a crash.
- **The function reads the clock** (`datetime.now`, `Date.now`, `time.time`, `date.today`):
  record with `--pin-clock`. The original then sees 2026-01-01T00:00:00Z and `diff` runs the port
  with `Time.now`, `Date.today` and `DateTime.now` frozen at the same instant. Random numbers cannot
  match across languages: make the random value an argument (or inject a generator) instead.

**A port keeps behavior, bugs included.** Port a known bug as it is; fix it in its own change
after `gate` passes, with each case it changes in `rails/port/known-diffs.jsonl`
(`{"unit", "args", "actual", "reason"}`) and the user's yes.

Before writing code, run `ruby-anything rules <repo>` and follow every rule. When the user
corrects how the port behaves, add it right away: `ruby-anything rules <repo> --add "<rule>"`.

- Read each risk the plan lists for the unit, at its `file:line`.
- Errors: raise where the original raises. `diff` maps error families across languages
  (ValueError / IllegalArgumentException / ArgumentException -> `ArgumentError`, KeyError /
  NoSuchElementException -> `KeyError`, IndexError / IndexOutOfBounds -> `IndexError`,
  ZeroDivisionError / ArithmeticException -> `ZeroDivisionError`, plain Error / RuntimeException ->
  `RuntimeError`). Use the original's own class name (`class InvalidCoupon < StandardError`) when
  the original defines one. Messages are compared only with `diff --messages`; keep them anyway.
- Numbers: keep ints ints and floats floats; `diff` tells `1` from `1.0`. Watch rounding,
  integer division and modulo signs (the language file lists each trap).
- Ordered output: Ruby hashes keep insertion order like JS objects and Python dicts; sort where
  the original sorts, never where it does not.
- Regex: Ruby's `\w`, `\d`, `\b` are ASCII-only unless you use `\p{}` classes; Python 3 and .NET
  are Unicode by default. Record non-ASCII inputs when patterns touch user text.
- Use Ruby and ActiveSupport idioms (`sum`, `each_with_object`, `group_by`, `presence`,
  `in_groups_of`) instead of transliterating loops, as long as `diff` stays N/N.
- Add a Minitest test in `rails/test/services/` for the cases you reason about.

## 3. Prove it

```sh
ruby-anything diff <repo> <unit-id>       # must be N/N; groups mismatches and names where each first differs
```

A mismatch is a behavior difference: fix the port, never the recording.

**The original keeps changing?** After pulling upstream changes (and in CI while the original is
still developed), run `ruby-anything drift <repo>`: it re-runs the original on every recorded unit
case and HTTP/CLI case and lists what now answers differently, plus routes no case records. For
each drifted unit: `record` again, then `diff`; the new mismatches are what changed upstream. When `diff` says the port
is **stalled** (three changes to the port in a row gained no matching case), stop editing: show the
user the remaining mismatches and ask. They may know the rule you are missing.

## 4. Done means gate passes

```sh
ruby-anything gate <repo> <unit-id>       # one unit
ruby-anything gate <repo> --all           # every bridged unit
ruby-anything gate <repo> --app           # the whole app: units, bin/rails test, rubocop, brakeman, replay
```

Unit gate: recorded, recording untouched (an edited `cases.jsonl` fails), recording fresh (the
original changed -> record again), Ruby syntax, method defined, no `NotImplementedError`/`TODO`
stubs, no debugger calls, results computed (recorded answers written into the code fail), the port
at most 3x the original's lines plus 50, every `raise`/`throw` in the original reached by a
recorded case (add one with `record --inputs` when gate names it), tests and assertions never fewer
than at the last passing gate, rubocop clean, every recorded case matching. Each failed check
carries a `fix`: run that first.

Then report to the user, and **wait for their go-ahead before the next unit or route**:

- what changed (files, functions, routes, views),
- gate output, diff counts, replay result and fallback rate,
- behavior differences or risks left, and what is left in the plan.

Files in this skill

  • SKILL.md8.9 KB
  • frontend.md4.3 KB
  • languages/csharp.md2.4 KB
  • languages/go.md2.4 KB
  • languages/java.md3.7 KB
  • languages/javascript.md3.5 KB
  • languages/kotlin.md1.5 KB
  • languages/php.md2.6 KB
  • languages/python.md3.2 KB
  • languages/rust.md1.9 KB
  • languages/swift.md1.6 KB
  • whole-app.md11.6 KB

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.

View all in development →

Comments

Loading comments…

Newsletter

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