RailsForge — Supercharged Ruby & Rails IDE
The all-in-one developer platform for Ruby and Ruby on Rails in VS Code & Cursor. Why RailsForge?Developers working with Ruby and Rails typically have to install 8 to 12 separate extensions (LSP, RuboCop, Brakeman, route finders, ERB helpers, test runners, and AI plugins) that do not share state. RailsForge replaces this fragmented toolchain with a single, highly integrated extension. It features deterministic runtime environment detection, Hotwire/Stimulus intelligence, native VS Code Test Explorer integration, zero-downtime migration diagnostics, and a grounded local AI agent ( Core Features⚡ 1. ActiveRecord Schema Peek & Association Explorer
🚀 2. Fast MVC & Resource NavigationQuickly jump across related Rails companion files using ergonomic keybindings:
🛣️ 3. Real-Time Route Resolver & Path Helpers
⚡ 4. Native Hotwire, Stimulus & Turbo Orchestration
🧪 5. Next-Gen Testing & FactoryBot Intelligence
🏛️ 6. Design Principles Engine (SOLID, DRY, KISS, YAGNI & Demeter)
📖 7. Version-Aware Documentation & Style Guide Engine
📊 8. RailsForge Architecture & Health SidebarDedicated Activity Bar Panel displaying:
🛡️ 9. DevSecOps & Zero-Downtime Migration Safety
🧱 10. Architecture & Refactoring Tools
📚 11. Design Patterns Sidebar (in the editor)The Design Patterns view lists 17 patterns (Service, Query, Form, Value and Policy objects, plus Strategy, Command, Observer, State, Template Method, Chain of Responsibility, Adapter, Facade, Decorator, Factory Method, Builder and Singleton). Selecting one opens an explanation in the editor ( 🧩 12. Living Pattern Catalog ("How We Do X Here")Unlike a static reference catalog, this indexes your own project's
🔗 13. Cross-File "Related Files" CodeLens & HoverStops the "open 5-6 files to understand this class" loop:
💎 14. Standalone Ruby Scripts & Gem SupportRailsForge activates on any Ruby file, Gemfile, or
🧠 15. Semantic Code Search
🤖 11. Grounded AI Integration (Copilot Agent Mode, MCP, &
|
| Command | Identifier |
|---|---|
| RailsForge: Scan Workspace for Patterns, Smells & Safety | railsforge.scanWorkspaceArchitecture |
| RailsForge: Refactor Selection (Design Patterns) | railsforge.refactorSelection |
| RailsForge: Suggest Refactorings (AI) | railsforge.suggestRefactorings |
| RailsForge: Go to Matching Model | railsforge.goToModel |
| RailsForge: Go to Matching Controller | railsforge.goToController |
| RailsForge: Go to Matching View | railsforge.goToView |
| RailsForge: Go to Spec / Test | railsforge.goToSpec |
| RailsForge: Go to Pundit / CanCanCan Policy | railsforge.goToPolicy |
| RailsForge: Go to ViewComponent | railsforge.goToComponent |
| RailsForge: Search Rails Routes | railsforge.searchRoutes |
| RailsForge: RuboCop Autocorrect File | railsforge.rubocopAutocorrect |
| RailsForge: Run Brakeman Security Scan | railsforge.runBrakeman |
| RailsForge: Run Gemfile Security Audit (bundle-audit) | railsforge.runBundleAudit |
| RailsForge: Check Migration Safety (Strong Migrations) | railsforge.analyzeMigration |
| RailsForge: Extract Selection to Service Object | railsforge.extractService |
| RailsForge: Extract Selection to Query Object | railsforge.extractQuery |
| RailsForge: Set AI Provider API Key | railsforge.setAiApiKey |
| RailsForge: Generate OpenAPI Skeleton | railsforge.generateApiDocs |
| RailsForge: Bump Gem Version | railsforge.bumpGemVersion |
| RailsForge: Release Gem | railsforge.releaseGem |
Several of these only show in the palette for the relevant project type — see features.md §6.
Configuration Settings
Every setting lives under railsForge.* and works at either the user level (global settings.json) or the workspace level (.vscode/settings.json, wins over user settings) — there's nothing extension-specific to set up for that, it's how VS Code settings scoping already works. Full reference with defaults, live-vs-reload behavior, and descriptions: features.md §7.
{
// Exclude project-specific directories from every RailsForge scan, on top of
// the built-in node_modules/vendor/tmp/log/.git/coverage defaults
"railsForge.excludePatterns": ["**/spec/dummy/**"],
// Force a project type instead of auto-detecting (monolith/api_only/gem/script)
"railsForge.projectType.override": "auto",
"railsForge.rubocop.autocorrectOnSave": true,
"railsForge.rubocop.mode": "safe",
"railsForge.brakeman.scanOnSave": false,
"railsForge.testing.framework": "rspec",
"railsForge.schema.autoIndex": true,
"railsForge.routes.autoIndex": true,
"railsForge.ollama.host": "http://localhost:11434",
"railsForge.ollama.model": "qwen2.5-coder:14b",
"railsForge.ollama.embeddingModel": "nomic-embed-text",
// Cloud AI providers — API keys are set via the "RailsForge: Set AI Provider
// API Key" command (stored in SecretStorage), never here
"railsForge.ai.provider": "ollama",
"railsForge.ai.openai.model": "gpt-4o-mini",
"railsForge.ai.anthropic.model": "claude-sonnet-4-5",
// Optional legal-tech prompt guardrails for contract/policy/litigation workflows
"railsForge.legal.skills.enabled": false,
"railsForge.mcp.enabled": true,
"railsForge.apiDocs.enabled": true,
"railsForge.performance.cacheSize": 200
}
Legal-tech AI guardrails
Set railsForge.legal.skills.enabled to true when using @rails in legal-tech workspaces. RailsForge then injects legal-domain guardrails inspired by the lawve-ai/awesome-legal-skills vscode-extension-builder-lawvable skill pack: jurisdiction assumptions, confidentiality handling, source-text citation discipline, uncertainty callouts, and attorney-review reminders.
Installation
In VS Code
code --install-extension railsforge.vsix
In Cursor
cursor --install-extension railsforge.vsix
Or install manually via VS Code / Cursor Extensions View (Ctrl+Shift+X) $\to$ Click ... $\to$ Install from VSIX... $\to$ select railsforge.vsix.
Relationship to Ruby LSP
RailsForge is a companion to Shopify's ruby-lsp, not a replacement for it.
Install both:
// .vscode/extensions.json
{ "recommendations": ["shopify.ruby-lsp", "ShubhamTaywade.railsforge"] }
ruby-lsp (plus ruby-lsp-rails) remains the source of truth for Ruby syntax,
diagnostics, and go-to-definition. RailsForge adds Rails-specific intelligence
(schema peek, route search, pattern catalog, principle diagnostics, security
scans, the local AI agent) on top. For deeper integration, RailsForge also
ships an optional ruby-lsp add-on gem that injects schema
context directly into ruby-lsp's own Hover responses — see
ruby-lsp-addon/README.md for setup and the
current scope (schema-aware hover today; route-aware completion and
association-aware navigation are natural next steps on the same scaffold).
Roadmap
The pattern catalog and principle diagnostics above started as a regex/heuristic
layer, deliberately kept dependency-light. That layer is now complemented by a
persistent AST index (tree-sitter + SQLite, off the extension host thread —
see "AST-Backed Analysis" above) that powers cross-file DRY detection, dependency
cycle detection, guided multi-file extraction, and an MCP server. Remaining
roadmap items are tracked in prd.md; happy to scope any of them as
a follow-up.
🧬 16. AST-Backed Analysis (tree-sitter + SQLite, off-thread)
A second, complementary index alongside the regex-based one above — built with
real Ruby parsing (tree-sitter-ruby) and persisted to a workspace-local
.railsforge/index.sqlite3 (gitignore it, like any other local cache) so it
survives VS Code restarts instead of rebuilding from scratch. Indexing runs in
a worker_threads worker, never on the extension host's own thread. Fails
soft: if the native modules can't load on some platform or Node/Electron
version — better-sqlite3 specifically requires Node >= 22.14 (checked via
process.versions.napi before ever touching the module, since an
unsupported version aborts the process rather than throwing) — these
features disable themselves and nothing else in RailsForge is affected. You
are told when that happens: a one-time warning explains why (e.g. "runtime
provides N-API 9; needs >= 10"), the Architecture & Health view shows an
AST index status line, and the AST commands report the reason instead of a
generic "try again". In a multi-root workspace each project gets its own
.railsforge/index.sqlite3, started when you first open a file from it and
disposed when its folder is removed.
RailsForge: Find Near-Duplicate Methods (DRY)— near-duplicate method bodies across the whole codebase (not just line-count heuristics), ranked by token-overlap similarity. Two methods with the same logic under different names/variables in different files are still flagged.RailsForge: Show Circular Dependencies— DFS cycle detection (A → B → C → A) over an AST-derived dependency graph that also understandsinclude/prepend/extend, not just.call/.new.- Guided Extract Service/Query:
railsforge.extractServiceandrailsforge.extractQuerynow also (a) search the workspace for other exact copies of the selected code and offer to replace them too in the same multi-file edit, and (b) generate a companion RSpec skeleton atspec/services/*_spec.rb(orspec/queries/) when aspec/directory exists, so extraction doesn't leave zero test coverage behind. RailsForge: Export Cursor Rules & Register MCP Server— writes.cursor/rules/railsforge.mdc(schema, routes, existing patterns, the "search before generating" rule) and registers therailsforgeMCP server in.cursor/mcp.json.- MCP server (
dist/mcp/server.js, standalone — not loaded by the extension host) exposesget_schema,list_routes,list_patterns,find_similar_pattern,get_dependencies, andfind_duplicate_methodsas MCP tools, so any MCP-capable AI client can query the same project context the built-in@railsagent uses — not just Cursor/Claude Code.
Requirements
- Ruby $\ge 2.7$ & Rails $\ge 5.2$
- Bundler (
Gemfile/Gemfile.lock) - Node $\ge$ 22.14 — the AST-Backed Analysis features (§16) bundle native modules (
better-sqlite3,tree-sitter-ruby) that require N-API >= 10, only available in Node 22.14+. If your VS Code/Cursor build bundles an older Node, §16 disables itself gracefully — everything else in RailsForge is unaffected. - (Optional) Ollama running locally on
http://localhost:11434for@railsAI assistant features (ollama run qwen2.5-coder:14borqwen2.5-coder:7b). - The AST-Backed Analysis features (§16) bundle native modules with prebuilt binaries for macOS/Linux/Windows on x64 and arm64. If your platform or Node version isn't covered, §16 disables itself — everything else in RailsForge is unaffected.
CI/CD & Release Process
Three GitHub Actions workflows guard this repo:
| Workflow | Triggers | What it does |
|---|---|---|
ci.yml |
Every push to master, every pull request (any base branch) |
Lint, type-check, compile, vitest run, and a full VSIX package build — on Node 20.x and 22.x. Uploads the built .vsix as a downloadable build artifact so a reviewer can install and manually test a PR's exact build. A separate job syntax-checks and gem builds ruby-lsp-addon/. |
codeql.yml |
Push to master, every PR, weekly schedule |
Static security analysis (CodeQL) over the TypeScript extension and the Ruby add-on. |
release.yml |
Push of a v* tag |
Two jobs: verify re-runs lint/type-check/test, checks the tag version matches package.json and that CHANGELOG.md has a section for it, builds the VSIX, installs it into a clean VS Code and smoke-tests the installed copy (pnpm run vsix-smoke), and records its sha256; publish (gated behind a release environment — see below) re-verifies that the VSIX is byte-identical to the smoke-tested one, creates the GitHub Release and publishes to the VS Code Marketplace / Open VSX if the corresponding secret is set. |
Cutting a release:
- Bump
"version"inpackage.jsonand rename## UnreleasedinCHANGELOG.mdto## X.Y.Z. - Commit, merge to
master. - Tag and push:
git tag vX.Y.Z && git push origin vX.Y.Zfor a stable release, orgit tag vX.Y.Z-pre && git push origin vX.Y.Z-prefor a Marketplace pre-release (package.jsonstill saysX.Y.Z; the-presuffix only selects--pre-releasepublishing and marks the GitHub Release as a pre-release). verifyruns automatically; a tag/package.jsonmismatch, a missing changelog section, a failing test or a failing installed-VSIX smoke test stops the release before anything is published.publishthen runs — see below for how to require a manual approval before it actually publishes anything.
One-time repo setup (not something this repo's code can configure for you):
releaseenvironment (Settings → Environments → New environment namedrelease, add required reviewers): without this,publishruns immediately afterverifypasses with no human check. With it, publishing to the Marketplace/Open VSX pauses for approval — recommended, since un-publishing a bad version afterward is much harder than a 30-second approval click.- Marketplace credentials (Settings → Secrets and variables → Actions). Preferred: Microsoft Entra ID via GitHub OIDC — Marketplace personal access tokens are being retired (Dec 1, 2026). Create an Entra app registration with a federated credential for this repository (subject
repo:<owner>/<repo>:environment:release), add the app's service principal as a member of your Marketplace publisher, then set the repository variablesAZURE_CLIENT_IDandAZURE_TENANT_ID. The workflow then logs in withazure/loginand runsvsce publish --azure-credential(no stored secret). Fallback until you migrate: theVSCE_PATsecret.OVSX_PAT(Open VSX token) is separate and optional. A marketplace is skipped with a warning (not failed) if it has no credentials. - Dependabot (
.github/dependabot.yml) opens weekly update PRs for npm, the Ruby add-on's bundler dependencies, and the GitHub Actions themselves — those PRs go through the normalci.ymlchecks like any other PR.
License
MIT License © 2026 Shubham Taywade.