rails-ai-context
Rails MCP server: stop AI coding agents from guessing your app. A Ruby gem with 35 read-only tools that give Claude Code, Cursor, GitHub Copilot, OpenCode and Codex CLI your real schema, models, routes, controllers and views.
Install / Use
npx skills add crisnahine/rails-ai-contextInstalls into whichever agent you are using.
Other
Other agent config
Quality Score
Category
AI & Machine LearningSupported Platforms
Our assessment of rails-ai-context
rails-ai-context scores 90/100 on our quality scale, 357th of 949 AI & Machine Learning skills we index (top 38%).
Its Other is 38 KB long, well organised into 45 sections with 19 code examples: a thorough specification that gives an agent plenty to work with.
It has 171 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated today, so rails-ai-context is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-11-01. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
rails-ai-context compared with similar skills
All 4 of these similar skills score higher than rails-ai-context; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| rails-ai-context (this skill)by crisnahine | 90 | 171 | today | Other |
| claude-memby thedotmack | 100 | 108.0k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 107.3k | 7d ago | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 89.4k | 6d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.5k | 1d ago | CLAUDE.md |
Frequently asked questions
- How do I install rails-ai-context?
- Run
npx skills add crisnahine/rails-ai-context. The install tabs above show the steps for each supported agent. - Which AI agents does rails-ai-context work with?
- It is written for Claude Code, Cursor, GitHub Copilot and OpenAI Codex, as a Other file. Other agents that read the same format can often use it too.
- Is rails-ai-context safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is rails-ai-context still maintained?
- The repository was last updated today, so rails-ai-context is actively maintained.
Skill content
View source on GitHubContents
- What it does
- Try it in your Rails app
- A closer look: the schema, the model, the inherited filters, the trace, the app that cannot boot, the six rules
- The tools
- How it works
- What it costs
- Questions you should ask first
- What it will not do
- Install options and configuration
- Troubleshooting
- Development
- Contributing and security
- Learn more
What it does
An assistant writing Rails code knows what an average Rails app looks like. Yours has its own columns,
associations, filters and test setup, and the assistant starts every session with none of that. It
writes a migration for a column that exists, calls user.posts when the association is user.articles,
scaffolds FactoryBot into a fixture suite, and misses the before_action a parent controller adds. You
catch it, fix it, re-prompt, and something next to it breaks.
rails-ai-context gives the assistant 35 tools that read the app itself, over MCP from the AI tool or from the command line. Every answer is read from the app and says how sure it is, and most end with a hint for the next call.
| When | What the assistant gets | A real line from an answer |
|---|---|---|
| It asks about a table | Columns with types, nulls and defaults, the indexes, the model on the table | index_users_on_email on (email) (unique) |
| Before it calls an association | Associations with their options, validations including the implicit ones, enums, scopes, callbacks, concerns | has_many articles dependent: destroy (foreign_key: :author_id, inverse_of: :author) |
| Before it writes an action | The actions, every filter with where it was inherited from, strong parameters, the layout | before authenticate_user! (from ApplicationController) (skipped on: index, show) |
| Before it writes a test | The framework, where the factories or fixtures live, their traits, a template in the app's style | Factories: spec/factories (3 files) |
| It traces a method | The definition and source, what it calls, every caller grouped by file and kind, the tests | app/services/article_publisher.rb (Service) · 11: return false unless @article.publishable? |
| When the app cannot boot | The same tools, from config/routes.rb, the schema dump and the source, saying so | [STATIC] Static mode (static mode requested with --no-boot). Serving static analysis; runtime-only data is marked [UNAVAILABLE]. |
Each line comes from the sample app in this repository, a blog with Devise, an admin namespace, a JSON API, a Sidekiq job and a FactoryBot suite. The website records the whole answers every time it is built, by running the gem at that commit: crisnahine.github.io/rails-ai-context.
The install writes the files each AI tool reads, so the assistant knows the tools exist and how to ask: the MCP config, one root context file with six anti-hallucination rules, and rules that load when a model, a controller or a migration is open. The tools are read-only, the SQL tool runs inside a read-only transaction, and files that hold secrets are never served.
Try it in your Rails app
Open your AI tool at the root of your Rails app and paste this. It installs the gem, sets up the AI tool you are in, checks the result and tells you the one step left.
<!-- BEGIN install-prompt: kept identical to "Install (recommended)" in docs/PROMPTS.md by spec -->Install the rails-ai-context gem in this Rails app so you can read its schema, models, routes and code through its tools instead of guessing.
1. Run `ruby -v` and `bundle exec rails -v`. rails-ai-context needs Ruby 3.1+ and Rails 7.0+. If either is older, stop and tell me.
2. Pick TOOL, the key for the AI tool you are: claude (Claude Code), cursor (Cursor), copilot (GitHub Copilot in VS Code), opencode (OpenCode), codex (Codex CLI). If you are another AI tool, stop and tell me to use the "Another MCP client" prompt instead.
3. Run `bundle add rails-ai-context --group development --version '>= 5.35.0'`. If the Gemfile already lists it, run `bundle update rails-ai-context --conservative` instead. Then run `bundle exec rails-ai-context version`: it must print 5.35.0 or newer, the first version with the flags used below. If it is older, the Gemfile pins it: change its rails-ai-context line to `gem "rails-ai-context", ">= 5.35.0", group: :development` and run `bundle update rails-ai-context --conservative`. If Bundler refuses (a frozen or deployment bundle), run `gem install rails-ai-context -v '>= 5.35.0'` instead and use `rails-ai-context init --tools TOOL --defaults` in step 4.
4. Run `bundle exec rails generate rails_ai_context:install --tools TOOL --defaults`. If it fails because the app can't boot, run `bundle exec rails-ai-context init --tools TOOL --defaults` instead; that one reads the source files when the app won't start.
5. Run `bundle exec rails-ai-context tool onboard` (or `rails-ai-context tool onboard` if you used gem install) and check it describes this app.
6. Tell me which files changed, then the "Next step" lines the install printed for TOOL, word for word. I have to do that step before your rails-ai-context MCP tools appear.
<!-- END install-prompt -->
Rather type it yourself? In the Gemfile:
bundle add rails-ai-context --group development
bin/rails generate rails_ai_context:install --tools claude --defaults
Standalone, with no Gemfile change:
gem install rails-ai-context
rails-ai-context init --tools claude --defaults
As a Claude Code plugin, which adds the MCP server and gives each session the six rules, and writes no context files. It runs the installed gem, so install that first, and run it in the app's folder:
gem install rails-ai-context
claude plugin install rails-ai-context --marketpla
Truncated for display — read the full file on GitHub.
Related Skills
claude-mem
108.0kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
107.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
89.4kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
78.5kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
