rails-ai-context 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29cd675e5f63893551b3ca87869bc6bca2335a5a2fe15ea38e54ec11dab6329a
4
- data.tar.gz: 4c2a0fe1003abd939f1ea005cf1aefac1055672dbe80c9fb771937acec1bde24
3
+ metadata.gz: 6eefc7e3df780d0a0553d8d33945cba9f799ff12e0013f2f4e4d8dffe2243a08
4
+ data.tar.gz: fed18a63451cf2a649288c5e4f8a5a13386d98eb164cc312b2e559ebc788b739
5
5
  SHA512:
6
- metadata.gz: 31a7796c31b70f9e3d667d4b961d00cd316a6bd365720fff32b9d922d7faa1febdbcfad00adcba0ff7d625af510e80ff8a1b596dba504543e0f1e72ce65022af
7
- data.tar.gz: 552c6388e3ea2648f400d2b948eefd25e325e4ec67a896b7917dee61d6bd37032df0a5d1c5e03c1dd6dbe66fbf6b21e2e38d725344b4438b98d23c0d5141d6f4
6
+ metadata.gz: 84fc5cb59112194dbc3a6f31c1473734646f7cd5cb29777f58290a2cc12c1ebf87036186ed7cc4fd60b52365b9486adea6a9995a561ee4f00c3348487deec532
7
+ data.tar.gz: b74d3406587a18690aa4bffcfbd928efd4b0ead69c176e14163821dee96b3d983958c007cf0c74073b94875e098865ab73cf239b67a59a0565b4911d7d9a7cfe
data/CHANGELOG.md CHANGED
@@ -13,17 +13,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
 
14
14
  ### Added
15
15
 
16
- - **CLI tool support** — all 25 MCP tools can now be run from the terminal. Rake: `rails 'ai:tool[schema]' table=users detail=full`. Thor CLI: `rails-ai-context tool schema --table users --detail full`. `rails ai:tool` (no args) lists all tools. `--help` shows per-tool help auto-generated from input_schema. `--json` / `JSON=1` for JSON envelope output. Tool name resolution: `schema` → `get_schema` → `rails_get_schema`.
17
- - **`tool_mode` config** — new `config.tool_mode` option: `:mcp` (default, MCP primary + CLI fallback) or `:cli` (CLI only, no MCP server needed). Selected during `rails generate rails_ai_context:install`.
18
- - **ToolGuideHelper** — shared serializer module for tool reference sections, rendering MCP or CLI syntax based on `tool_mode`. All 5 serializers updated to use it.
19
- - **ToolRunner** — `lib/rails_ai_context/cli/tool_runner.rb` handles CLI tool execution with argument parsing, tool name resolution, help generation, and JSON output formatting.
16
+ - **CLI tool support** — all 25 MCP tools can now be run from the terminal: `rails 'ai:tool[schema]' table=users detail=full`. Also via Thor CLI: `rails-ai-context tool schema --table users`. `rails ai:tool` lists all tools. `--help` shows per-tool help auto-generated from input_schema. `--json` / `JSON=1` for JSON envelope. Tool name resolution: `schema` → `get_schema` → `rails_get_schema`.
17
+ - **`tool_mode` config** — `:mcp` (default, MCP primary + CLI fallback) or `:cli` (CLI only, no MCP server needed). Selected during install and first `rails ai:context` run.
18
+ - **ToolRunner** — `lib/rails_ai_context/cli/tool_runner.rb` handles CLI tool execution: arg parsing, type coercion from input_schema, required param validation, enum checking, fuzzy tool name suggestions on typos.
19
+ - **ToolGuideHelper** — shared serializer module renders tool reference sections with MCP or CLI syntax based on `tool_mode`, with MANDATORY enforcement + CLI escape hatch. 3-column tool table (MCP | CLI | description).
20
+ - **Copilot `excludeAgent`** — MCP tools instruction file uses `excludeAgent: "code-review"` (code review can't invoke MCP tools, saves 4K char budget).
21
+ - **`.mcp.json` auto-create** — `rails ai:context` automatically creates `.mcp.json` when `tool_mode` is `:mcp` and the file doesn't exist. Existing apps upgrading to v3.0.0 get it without re-running the install generator.
22
+ - **Full config initializer** — generated initializer documents every configuration option organized by section (AI Tools, Introspection, Models & Filtering, MCP Server, File Size Limits, Extensibility, Security, Search).
23
+ - **Cursor MDC compliance spec** — 26 tests validating MDC format: frontmatter fields, rule types, glob syntax, line limits.
24
+ - **Copilot compliance spec** — 25 tests validating instruction format: applyTo, excludeAgent, file naming, content quality.
20
25
 
21
26
  ### Changed
22
27
 
23
28
  - Serializer count reduced from 6 to 5 (Claude, Cursor, Copilot, OpenCode, JSON).
24
- - Install generator AI tool selection renumbered (4 options instead of 5).
25
- - Install generator now includes MCP opt-in step for `tool_mode` selection.
26
- - All documentation, rake tasks, CLI, and configuration updated to reflect Windsurf removal.
29
+ - Install generator renumbered (4 AI tool options instead of 5) + MCP opt-in step.
30
+ - Cursor glob-based rules no longer combine `globs` + `description` (pure Type 2 auto-attach per Cursor best practices).
31
+ - MCP tool instructions use MANDATORY enforcement with CLI escape hatch — AI agents use tools when available, fall back to CLI or file reading when not.
32
+ - All CLI examples use zsh-safe quoting: `rails 'ai:tool[X]'` (brackets are glob patterns in zsh).
33
+ - README rewritten with real-world workflow examples, categorized tool table, MCP vs CLI showcase.
27
34
 
28
35
  ## [2.0.5] - 2026-03-25
29
36
 
data/CLAUDE.md CHANGED
@@ -11,7 +11,7 @@ structure to AI assistants via the Model Context Protocol (MCP).
11
11
  - `lib/rails_ai_context/introspectors/` — 29 introspectors (schema, models, routes, jobs, gems, conventions, stimulus, database_stats, controllers, views, view_templates, design_tokens, turbo, i18n, config, active_storage, action_text, auth, api, tests, rake_tasks, assets, devops, action_mailbox, migrations, seeds, middleware, engines, multi_database)
12
12
  - `lib/rails_ai_context/tools/` — 25 MCP tools using the official mcp SDK
13
13
  - `lib/rails_ai_context/cli/` — CLI tool runner (`tool_runner.rb`) — executes MCP tools from rake/Thor
14
- - `lib/rails_ai_context/serializers/` — Output formatters (claude, claude_rules, opencode, opencode_rules, cursor_rules, copilot, copilot_instructions, rules, markdown, JSON, context_file_serializer, test_command_detection, tool_guide_helper)
14
+ - `lib/rails_ai_context/serializers/` — Output formatters (claude, claude_rules, opencode, opencode_rules, cursor_rules, copilot, copilot_instructions, rules, markdown, JSON, context_file_serializer, test_command_detection, tool_guide_helper, design_system_helper, stack_overview_helper)
15
15
  - `lib/rails_ai_context/resources.rb` — MCP resources (static data AI clients read directly)
16
16
  - `lib/rails_ai_context/server.rb` — MCP server configuration (stdio + HTTP transports)
17
17
  - `lib/rails_ai_context/middleware.rb` — Rack middleware for auto-mounting MCP HTTP endpoint
data/README.md CHANGED
@@ -9,6 +9,8 @@
9
9
 
10
10
  **Works with:** Claude Code • Cursor • GitHub Copilot • OpenCode • Any terminal
11
11
 
12
+ > Built by a Rails developer with 10+ years of production experience. AI assisted — the same way it assists me shipping features at work. I designed the architecture, made every decision, reviewed every line, and wrote 653 tests. This gem exists because I understand Rails deeply enough to know exactly what AI agents get wrong and what context they need to get it right.
13
+
12
14
  ```bash
13
15
  gem "rails-ai-context", group: :development
14
16
  rails generate rails_ai_context:install
@@ -16,6 +18,8 @@ rails generate rails_ai_context:install
16
18
 
17
19
  That's it. Your AI now has 25 tools that understand your entire Rails app — via MCP server or CLI. Zero config.
18
20
 
21
+ > **[Full Guide →](docs/GUIDE.md)** — every command, every parameter, every configuration option.
22
+
19
23
  ---
20
24
 
21
25
  ## Two ways to use it
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsAiContext
4
- VERSION = "3.0.0"
4
+ VERSION = "3.0.1"
5
5
  end
data/server.json CHANGED
@@ -2,16 +2,16 @@
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
3
  "name": "io.github.crisnahine/rails-ai-context",
4
4
  "title": "Rails AI Context",
5
- "description": "Auto-expose Rails app structure to AI via MCP. Zero config, 25 read-only tools.",
5
+ "description": "Auto-expose Rails app structure to AI via MCP or CLI. Zero config, 25 read-only tools.",
6
6
  "repository": {
7
7
  "url": "https://github.com/crisnahine/rails-ai-context",
8
8
  "source": "github"
9
9
  },
10
- "version": "3.0.0",
10
+ "version": "3.0.1",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "mcpb",
14
- "identifier": "https://github.com/crisnahine/rails-ai-context/releases/download/v3.0.0/rails-ai-context-mcp.mcpb",
14
+ "identifier": "https://github.com/crisnahine/rails-ai-context/releases/download/v3.0.1/rails-ai-context-mcp.mcpb",
15
15
  "fileSha256": "dd711a0ad6c4de943ae4da94eaf59a6dc9494b9d57f726e24649ed4e2f156990",
16
16
  "transport": {
17
17
  "type": "stdio"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-ai-context
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - crisnahine
@@ -164,10 +164,11 @@ dependencies:
164
164
  description: |
165
165
  rails-ai-context gives AI coding agents a complete mental model of your Rails
166
166
  app — not just files, but how schema, models, routes, controllers, views, and
167
- conventions connect. 25 live MCP tools let agents query structure on demand with
168
- semantic validation that catches cross-file errors (wrong columns, missing
169
- partials, broken routes) before code runs. Auto-generates context files for
170
- Claude Code, Cursor, GitHub Copilot, and OpenCode. Zero config.
167
+ conventions connect. 25 live tools (via MCP server or CLI) let agents query
168
+ structure on demand with semantic validation that catches cross-file errors
169
+ (wrong columns, missing partials, broken routes) before code runs.
170
+ Auto-generates context files for Claude Code, Cursor, GitHub Copilot, and
171
+ OpenCode. Zero config.
171
172
  email:
172
173
  - crisjosephnahine@gmail.com
173
174
  executables:
@@ -290,9 +291,9 @@ metadata:
290
291
  post_install_message: |
291
292
  rails-ai-context installed! Quick start:
292
293
  rails generate rails_ai_context:install
293
- rails ai:context # generate context files (compact mode)
294
- rails ai:context:full # full dump (good for small apps)
295
- rails ai:serve # start MCP server for Claude Code / Cursor
294
+ rails ai:context # generate context files
295
+ rails 'ai:tool[schema]' # run any of the 25 tools from CLI
296
+ rails ai:serve # start MCP server (optional)
296
297
  rdoc_options: []
297
298
  require_paths:
298
299
  - lib
@@ -309,5 +310,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
309
310
  requirements: []
310
311
  rubygems_version: 3.6.9
311
312
  specification_version: 4
312
- summary: Give AI agents a complete mental model of your Rails app via MCP zero config.
313
+ summary: Give AI agents a complete mental model of your Rails app 25 tools via MCP
314
+ or CLI. Zero config.
313
315
  test_files: []