rails-ai-context 5.35.0 → 5.35.2
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 +4 -4
- data/CHANGELOG.md +1024 -0
- data/CONTEXT.md +37 -7
- data/CONTRIBUTING.md +30 -1
- data/README.md +9 -9
- data/SECURITY.md +2 -2
- data/docs/ARCHITECTURE.md +12 -4
- data/docs/CLI.md +44 -15
- data/docs/COMPATIBILITY.md +34 -8
- data/docs/CONFIGURATION.md +28 -5
- data/docs/CUSTOM_TOOLS.md +8 -2
- data/docs/FAQ.md +5 -5
- data/docs/GUIDE.md +33 -65
- data/docs/INTROSPECTORS.md +4 -4
- data/docs/QUICKSTART.md +1 -1
- data/docs/RECIPES.md +5 -5
- data/docs/RELEASING.md +3 -1
- data/docs/SECURITY.md +255 -74
- data/docs/SETUP.md +1 -1
- data/docs/STANDALONE.md +2 -2
- data/docs/TOOLS.md +151 -90
- data/docs/TROUBLESHOOTING.md +123 -8
- data/docs/_config.yml +1 -1
- data/docs/adr/0008-query-runs-only-where-it-can-guard.md +38 -0
- data/docs/adr/0009-dbhub-shapes-in-ruby.md +26 -0
- data/docs/adr/0010-one-config-tool-with-sections.md +32 -0
- data/docs/index.md +2 -2
- data/exe/rails-ai-context +24 -9
- data/lib/generators/rails_ai_context/install/install_generator.rb +2 -0
- data/lib/rails_ai_context/app_databases.rb +377 -0
- data/lib/rails_ai_context/app_kind.rb +2 -0
- data/lib/rails_ai_context/cli/app_root.rb +1 -0
- data/lib/rails_ai_context/cli/tool_runner.rb +110 -99
- data/lib/rails_ai_context/configuration.rb +15 -8
- data/lib/rails_ai_context/database_family/mysql_runtime.rb +170 -0
- data/lib/rails_ai_context/database_family/postgresql_plan.rb +124 -0
- data/lib/rails_ai_context/database_family/postgresql_runtime.rb +211 -0
- data/lib/rails_ai_context/database_family/sqlite_runtime.rb +391 -0
- data/lib/rails_ai_context/database_family.rb +282 -0
- data/lib/rails_ai_context/database_file.rb +61 -7
- data/lib/rails_ai_context/database_yml.rb +7 -29
- data/lib/rails_ai_context/doctor.rb +15 -16
- data/lib/rails_ai_context/instrumentation.rb +1 -1
- data/lib/rails_ai_context/introspectors/connection_pool_introspector.rb +8 -23
- data/lib/rails_ai_context/introspectors/database_stats_introspector.rb +6 -70
- data/lib/rails_ai_context/introspectors/declared_constant.rb +19 -7
- data/lib/rails_ai_context/introspectors/env_introspector.rb +1 -1
- data/lib/rails_ai_context/introspectors/env_references.rb +1 -1
- data/lib/rails_ai_context/introspectors/job_introspector.rb +7 -7
- data/lib/rails_ai_context/introspectors/migration_introspector.rb +8 -11
- data/lib/rails_ai_context/introspectors/migration_replay/statements.rb +9 -9
- data/lib/rails_ai_context/introspectors/model_introspector.rb +33 -39
- data/lib/rails_ai_context/introspectors/multi_database_introspector.rb +33 -30
- data/lib/rails_ai_context/introspectors/node_source.rb +2 -0
- data/lib/rails_ai_context/introspectors/performance_introspector.rb +80 -24
- data/lib/rails_ai_context/introspectors/pg_partitions.rb +1 -4
- data/lib/rails_ai_context/introspectors/schema_conventions.rb +6 -8
- data/lib/rails_ai_context/introspectors/schema_dump_path.rb +12 -14
- data/lib/rails_ai_context/introspectors/schema_introspector.rb +47 -27
- data/lib/rails_ai_context/introspectors/schema_reader.rb +1 -1
- data/lib/rails_ai_context/introspectors/source_scan.rb +39 -4
- data/lib/rails_ai_context/migration_status.rb +18 -46
- data/lib/rails_ai_context/payload.rb +48 -1
- data/lib/rails_ai_context/pending_migrations.rb +3 -4
- data/lib/rails_ai_context/run_cache.rb +5 -0
- data/lib/rails_ai_context/schema_adapter.rb +13 -18
- data/lib/rails_ai_context/secret_columns.rb +506 -0
- data/lib/rails_ai_context/serializers/claude_rules_serializer.rb +2 -2
- data/lib/rails_ai_context/serializers/markdown_serializer.rb +14 -10
- data/lib/rails_ai_context/serializers/section_facts.rb +12 -2
- data/lib/rails_ai_context/serializers/stack_overview_helper.rb +5 -2
- data/lib/rails_ai_context/serializers/tool_guide_helper.rb +35 -7
- data/lib/rails_ai_context/server.rb +143 -29
- data/lib/rails_ai_context/sql_gate.rb +1007 -0
- data/lib/rails_ai_context/tasks/rails_ai_context.rake +1 -2
- data/lib/rails_ai_context/test_helper.rb +3 -1
- data/lib/rails_ai_context/tools/analyze_feature.rb +11 -7
- data/lib/rails_ai_context/tools/base_tool.rb +71 -48
- data/lib/rails_ai_context/tools/dependency_graph.rb +1 -1
- data/lib/rails_ai_context/tools/diagnose.rb +105 -42
- data/lib/rails_ai_context/tools/generate_test.rb +4 -6
- data/lib/rails_ai_context/tools/get_active_support.rb +1 -6
- data/lib/rails_ai_context/tools/get_api.rb +1 -6
- data/lib/rails_ai_context/tools/get_autoload.rb +1 -6
- data/lib/rails_ai_context/tools/get_callbacks.rb +5 -5
- data/lib/rails_ai_context/tools/get_component_catalog.rb +6 -7
- data/lib/rails_ai_context/tools/get_concern.rb +6 -6
- data/lib/rails_ai_context/tools/get_config.rb +189 -12
- data/lib/rails_ai_context/tools/get_context.rb +111 -105
- data/lib/rails_ai_context/tools/get_controllers.rb +8 -5
- data/lib/rails_ai_context/tools/get_conventions.rb +1 -6
- data/lib/rails_ai_context/tools/get_engines.rb +1 -6
- data/lib/rails_ai_context/tools/get_env.rb +1 -6
- data/lib/rails_ai_context/tools/get_env_config.rb +2 -8
- data/lib/rails_ai_context/tools/get_frontend_stack.rb +1 -6
- data/lib/rails_ai_context/tools/get_gems.rb +1 -6
- data/lib/rails_ai_context/tools/get_helper_methods.rb +4 -5
- data/lib/rails_ai_context/tools/get_i18n.rb +1 -7
- data/lib/rails_ai_context/tools/get_job_pattern.rb +1 -1
- data/lib/rails_ai_context/tools/get_mailers.rb +1 -1
- data/lib/rails_ai_context/tools/get_model_details.rb +5 -8
- data/lib/rails_ai_context/tools/get_partial_interface.rb +3 -4
- data/lib/rails_ai_context/tools/get_schema.rb +10 -8
- data/lib/rails_ai_context/tools/get_service_pattern.rb +60 -24
- data/lib/rails_ai_context/tools/get_turbo_map.rb +1 -1
- data/lib/rails_ai_context/tools/migration_advisor.rb +47 -32
- data/lib/rails_ai_context/tools/onboard.rb +24 -24
- data/lib/rails_ai_context/tools/performance_check.rb +15 -2
- data/lib/rails_ai_context/tools/query.rb +142 -1356
- data/lib/rails_ai_context/tools/read_logs.rb +1 -1
- data/lib/rails_ai_context/tools/review_changes.rb +6 -7
- data/lib/rails_ai_context/tools/runtime_info.rb +125 -88
- data/lib/rails_ai_context/tools/safe_call.rb +70 -28
- data/lib/rails_ai_context/tools/search_code.rb +0 -4
- data/lib/rails_ai_context/tools/search_docs.rb +3 -1
- data/lib/rails_ai_context/tools/security_scan.rb +9 -5
- data/lib/rails_ai_context/tools/session_context.rb +18 -12
- data/lib/rails_ai_context/tools/validate.rb +1 -0
- data/lib/rails_ai_context/tools/validate_semantics.rb +5 -5
- data/lib/rails_ai_context/version.rb +1 -1
- data/lib/rails_ai_context.rb +4 -7
- data/server.json +2 -2
- metadata +14 -3
data/docs/GUIDE.md
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|:------|:------------|
|
|
20
20
|
| [Quickstart](QUICKSTART.md) | Get running in 5 minutes |
|
|
21
21
|
| [Copy-paste prompts](PROMPTS.md) | Let your AI tool install, change, remove or use the gem |
|
|
22
|
-
| [Tools Reference](TOOLS.md) | All
|
|
22
|
+
| [Tools Reference](TOOLS.md) | All 35 MCP tools with parameters |
|
|
23
23
|
| [Recipes](RECIPES.md) | Real-world workflows and examples |
|
|
24
24
|
| [Custom Tools](CUSTOM_TOOLS.md) | Build your own MCP tools |
|
|
25
25
|
| [Configuration](CONFIGURATION.md) | Every config option |
|
|
@@ -373,7 +373,7 @@ rails ai:context:claude # Use this instead (no quoting needed)
|
|
|
373
373
|
|
|
374
374
|
## CLI Tools
|
|
375
375
|
|
|
376
|
-
All
|
|
376
|
+
All 35 MCP tools can be run directly from the terminal - no MCP server or AI client needed.
|
|
377
377
|
|
|
378
378
|
### Rake
|
|
379
379
|
|
|
@@ -443,7 +443,7 @@ The `tool_mode` is selected during `rails generate rails_ai_context:install`.
|
|
|
443
443
|
|
|
444
444
|
## MCP Tools - Common Reference
|
|
445
445
|
|
|
446
|
-
The
|
|
446
|
+
The 21 tools below are the ones worth reading about before you start. [Tools Reference](TOOLS.md) carries all 35 with their parameters.
|
|
447
447
|
|
|
448
448
|
Every tool is **read-only** and **idempotent** - they never modify your application or database.
|
|
449
449
|
|
|
@@ -580,13 +580,35 @@ rails_get_controllers(detail: "full")
|
|
|
580
580
|
|
|
581
581
|
### rails_get_config
|
|
582
582
|
|
|
583
|
-
Returns
|
|
583
|
+
Returns the app's configuration, one section per call. `section` picks it: `app` (the default), `gems`, `frontend`, `api`, `engines`, `conventions`, `autoload`, `active_support`, `env`, `env_config` or `i18n`. Ten sections were tools of their own (`rails_get_gems`, `rails_get_env` and the rest); each answers what its tool did, and the old names still work from the CLI and over MCP.
|
|
584
584
|
|
|
585
|
-
**
|
|
585
|
+
**Parameters:**
|
|
586
|
+
|
|
587
|
+
| Param | Type | Description |
|
|
588
|
+
|-------|------|-------------|
|
|
589
|
+
| `section` | string | Which section. Default: `app`. Required when `skip_tools` turns `app` off. |
|
|
590
|
+
| `detail` | string | `summary` / `standard` (default) / `full`. Read by `frontend`, `api` and `env`. For `env`, summary is env var names only, standard groups them by source with external services, full adds per-file locations, Dockerfile vars and credentials keys. |
|
|
591
|
+
| `category` | string | Read by `gems`: `auth`, `jobs`, `frontend`, `api`, `database`, `files`, `testing`, `deploy`, `monitoring`, `admin`, `pagination`, `search`, `forms`, `server`, `notifications`, `validation`, `utilities`, `services`, `payments`, `all` (default). |
|
|
592
|
+
| `environment` | string | Read by `env_config`: one environment, by exact name. |
|
|
593
|
+
| `locale` | string | Read by `i18n`: one locale's files and coverage. |
|
|
594
|
+
| `offset`, `limit` | integer | Read by `gems`, `env_config` and `i18n`. Defaults: 0 and 50. |
|
|
595
|
+
|
|
596
|
+
A parameter the asked section does not read is named in the answer as ignored.
|
|
597
|
+
|
|
598
|
+
**Returns:** for `app`, cache store, session store, timezone, queue adapter, mailer settings, the app's own middleware classes with their files and the rest of the stack as additions (framework defaults are filtered out), the `use` and `map` calls in `config.ru`, notable initializers, CurrentAttributes classes with the attributes they declare, their defaults and reset hooks. `gems` groups notable gems by category; `conventions` lists architecture patterns, directory structure and config files; `env` lists environment variables grouped by purpose, external services and credentials keys, with no values.
|
|
586
599
|
|
|
587
600
|
```
|
|
588
601
|
rails_get_config()
|
|
589
602
|
→ Cache: redis_cache_store, Session: cookie_store, TZ: UTC, ...
|
|
603
|
+
|
|
604
|
+
rails_get_config(section: "gems")
|
|
605
|
+
→ Auth: devise `4.9.3`, Jobs: sidekiq `7.2.1`, ...
|
|
606
|
+
|
|
607
|
+
rails_get_config(section: "conventions")
|
|
608
|
+
→ Architecture: [MVC, Service objects, Concerns], Patterns: [STI, Polymorphism], ...
|
|
609
|
+
|
|
610
|
+
rails_get_config(section: "env", detail: "summary")
|
|
611
|
+
→ Env var names grouped by category
|
|
590
612
|
```
|
|
591
613
|
|
|
592
614
|
### rails_get_test_info
|
|
@@ -609,36 +631,6 @@ rails_get_test_info(model: "User")
|
|
|
609
631
|
→ Shows spec/models/user_spec.rb test names (summary/standard) or full source (full)
|
|
610
632
|
```
|
|
611
633
|
|
|
612
|
-
### rails_get_gems
|
|
613
|
-
|
|
614
|
-
Returns notable gems categorized by function.
|
|
615
|
-
|
|
616
|
-
**Parameters:**
|
|
617
|
-
|
|
618
|
-
| Param | Type | Description |
|
|
619
|
-
|-------|------|-------------|
|
|
620
|
-
| `category` | string | Filter by category: `auth`, `jobs`, `frontend`, `api`, `database`, `files`, `testing`, `deploy`, `monitoring`, `admin`, `pagination`, `search`, `forms`, `server`, `notifications`, `validation`, `utilities`, `services`, `payments`, `all` (default). |
|
|
621
|
-
| `limit` | integer | Max gems to return. Default: 50. |
|
|
622
|
-
| `offset` | integer | Skip this many gems for pagination. Default: 0. |
|
|
623
|
-
|
|
624
|
-
**Returns:** Notable gems grouped by category with descriptions.
|
|
625
|
-
|
|
626
|
-
```
|
|
627
|
-
rails_get_gems()
|
|
628
|
-
→ Auth: devise `4.9.3`, Jobs: sidekiq `7.2.1`, ...
|
|
629
|
-
```
|
|
630
|
-
|
|
631
|
-
### rails_get_conventions
|
|
632
|
-
|
|
633
|
-
Returns detected architecture patterns. No parameters.
|
|
634
|
-
|
|
635
|
-
**Returns:** architecture patterns (MVC, service objects, STI, etc.), directory structure with file counts, config files, detected patterns.
|
|
636
|
-
|
|
637
|
-
```
|
|
638
|
-
rails_get_conventions()
|
|
639
|
-
→ Architecture: [MVC, Service objects, Concerns], Patterns: [STI, Polymorphism], ...
|
|
640
|
-
```
|
|
641
|
-
|
|
642
634
|
### rails_get_stimulus
|
|
643
635
|
|
|
644
636
|
Returns Stimulus controller details: targets, values, actions, outlets, classes.
|
|
@@ -972,7 +964,7 @@ rails_get_service_pattern(detail: "full")
|
|
|
972
964
|
→ All services with methods, initialize params, side effects, and rescue blocks
|
|
973
965
|
```
|
|
974
966
|
|
|
975
|
-
**Returns:** Service listing with common pattern detection (initialize+call, self.call, Result objects) or full detail including file path, initialize parameters, public methods, dependencies (other classes called), error handling (rescue blocks), side effects (database writes, email delivery, job enqueues, HTTP requests, Turbo broadcasts), and a list of files that call the service. A base class other services inherit from is named above the listing
|
|
967
|
+
**Returns:** Service listing with common pattern detection (initialize+call, self.call, Result objects) or full detail including file path, initialize parameters, public methods, dependencies (other classes called), error handling (rescue blocks), side effects (database writes, email delivery, job enqueues, HTTP requests, Turbo broadcasts), and a list of files that call the service. A base class other services inherit from is named above the listing and left out of the service count; asking for it by name still answers. When the service directories hold more Ruby files than the listing counts, one line says how many were left out and of which kind.
|
|
976
968
|
|
|
977
969
|
### rails_get_job_pattern
|
|
978
970
|
|
|
@@ -1000,31 +992,6 @@ rails_get_job_pattern(detail: "full")
|
|
|
1000
992
|
|
|
1001
993
|
**Returns:** Job listing with queue breakdown or full detail including queue name, retry/discard configuration (retry_on, discard_on, Sidekiq options), perform method signature, guard clauses (early returns), dependencies (classes called), Turbo broadcasts, cron/recurring schedule (from sidekiq.yml or config files), side effects, and a list of files that enqueue the job.
|
|
1002
994
|
|
|
1003
|
-
### rails_get_env
|
|
1004
|
-
|
|
1005
|
-
Discover environment variables, external service dependencies, and credentials keys used by the app. Scans .rb, .rake, ERB views and config YAML for ENV[], .env.example, Dockerfile, the env Kamal's config/deploy.yml sets (secret names; clear values, except one holding a URL or a key-like token, or under a secret-named variable, which shows as hidden, and one an ERB tag sets, which says so), config gem setting keys, Anyway::Config attributes with their env names, external HTTP calls, and credentials keys (never values).
|
|
1006
|
-
|
|
1007
|
-
**Parameters:**
|
|
1008
|
-
|
|
1009
|
-
| Param | Type | Description |
|
|
1010
|
-
|-------|------|-------------|
|
|
1011
|
-
| `detail` | string | `summary` / `standard` (default) / `full`. summary: env var names only. standard: env vars grouped by source + external services. full: everything including per-file locations, Dockerfile vars, and credentials keys. |
|
|
1012
|
-
|
|
1013
|
-
**Examples:**
|
|
1014
|
-
|
|
1015
|
-
```
|
|
1016
|
-
rails_get_env()
|
|
1017
|
-
→ Env vars grouped by purpose (Database, Redis, AWS, etc.) + external services + credentials keys
|
|
1018
|
-
|
|
1019
|
-
rails_get_env(detail: "summary")
|
|
1020
|
-
→ Env var names grouped by category
|
|
1021
|
-
|
|
1022
|
-
rails_get_env(detail: "full")
|
|
1023
|
-
→ Per-file env var locations with line numbers, .env.example contents, Dockerfile ENV/ARG, external services with detection method, credentials keys, encrypted columns
|
|
1024
|
-
```
|
|
1025
|
-
|
|
1026
|
-
**Returns:** Environment variables grouped by purpose (Database, Redis, AWS, Payments, Email, Monitoring, API Keys, etc.) with default values where detected. External service dependencies discovered from Gemfile gems and HTTP client calls. Credentials keys (never values). Encrypted model columns. Full detail includes per-file locations with line numbers.
|
|
1027
|
-
|
|
1028
995
|
### rails_get_partial_interface
|
|
1029
996
|
|
|
1030
997
|
Analyze a partial's interface: local variables it expects, where it's rendered from, and what methods are called on each local. Use when rendering a partial, understanding what locals to pass, or refactoring partial dependencies.
|
|
@@ -1290,7 +1257,7 @@ end
|
|
|
1290
1257
|
|
|
1291
1258
|
The endpoint is then served by your app's own server, on its address and port; `http_bind` and `http_port` configure only the standalone process.
|
|
1292
1259
|
|
|
1293
|
-
Both transports are **read-only** - they expose the same
|
|
1260
|
+
Both transports are **read-only** - they expose the same 35 tools and never modify your app.
|
|
1294
1261
|
|
|
1295
1262
|
### Controller Transport (Alternative)
|
|
1296
1263
|
|
|
@@ -1446,7 +1413,7 @@ end
|
|
|
1446
1413
|
| `max_tool_response_chars` | Integer | `200_000` | Safety cap for MCP tool responses and resource payloads |
|
|
1447
1414
|
| `cache_ttl` | Integer | `60` | Cache TTL in seconds for introspection results |
|
|
1448
1415
|
| `custom_tools` | Array | `[]` | Additional MCP tool classes to register alongside built-in tools |
|
|
1449
|
-
| `skip_tools` | Array | `[]` | Built-in tool names to exclude (e.g. `%w[rails_security_scan]`) |
|
|
1416
|
+
| `skip_tools` | Array | `[]` | Built-in tool names to exclude (e.g. `%w[rails_security_scan]`). A custom tool with a skipped built-in's name takes its place, `rails_get_config` with its sections included |
|
|
1450
1417
|
| `tool_mode` | Symbol | `:mcp` | `:mcp` (MCP primary + CLI fallback) or `:cli` (CLI only, no MCP server needed) |
|
|
1451
1418
|
| `ai_tools` | Array | `nil` (all) | AI tools to generate context for: `%i[claude cursor copilot opencode codex]`. Selected during install. |
|
|
1452
1419
|
| `excluded_models` | Array | internal Rails models | Models to skip |
|
|
@@ -1484,10 +1451,10 @@ end
|
|
|
1484
1451
|
| `context_files` | Boolean | `true` | Set `false` for an MCP-only install: no CLAUDE.md, AGENTS.md, rules files or `.ai-context.json` are written |
|
|
1485
1452
|
| `frontend_paths` | Array | `nil` (auto-detected) | Frontend directories, e.g. `["app/frontend", "../web-client"]`. One outside the app root is read for manifests only |
|
|
1486
1453
|
| `extra_app_paths` | Array | `[]` | More app-root-relative directories that hold Rails app code. Each one's `app/models`, `app/controllers` and `app/views` are scanned |
|
|
1487
|
-
| `query_timeout` |
|
|
1454
|
+
| `query_timeout` | Number | `5` | `rails_query` statement timeout in seconds, a positive number |
|
|
1488
1455
|
| `query_row_limit` | Integer | `100` | Max rows `rails_query` returns (1 to 1000) |
|
|
1489
1456
|
| `query_redacted_columns` | Array | `password_digest`, `encrypted_password`, tokens, etc. | Column names `rails_query` refuses: a query naming one is rejected before it runs, and a returned column of that name comes back `[FILTERED]` |
|
|
1490
|
-
| `query_allowed_columns` | Array | `[]` | Column names to exempt from the built-in
|
|
1457
|
+
| `query_allowed_columns` | Array | `[]` | Column names to exempt from the built-in secret column names. It does not release an `encrypts` column |
|
|
1491
1458
|
| `allow_query_in_production` | Boolean | `false` | Allow `rails_query` in production |
|
|
1492
1459
|
| `log_lines` | Integer | `50` | Default number of lines `rails_read_logs` tails |
|
|
1493
1460
|
| `instrumentation_include_arguments` | Boolean | `false` | Forward raw tool arguments in `ActiveSupport::Notifications` events |
|
|
@@ -1881,6 +1848,7 @@ config.max_tool_response_chars = 60_000
|
|
|
1881
1848
|
### Models not detected
|
|
1882
1849
|
|
|
1883
1850
|
- Models must descend from `ActiveRecord::Base`, through `ApplicationRecord` or any other base class. Without a boot they must also sit in a model directory (`app/models/`, or a pack's or engine's)
|
|
1851
|
+
- A file in a `concerns/` directory of a model root is a model when the class its path names has a model superclass. A concern module that holds an inner class stays a concern. Without a boot, such a class is not listed when its superclass is a gem's own record base. The booted tier resolves it through the loaded class
|
|
1884
1852
|
- Excluded models: `ApplicationRecord`, `ActiveStorage::*`, `ActionText::*`, `ActionMailbox::*`
|
|
1885
1853
|
- Add custom exclusions: `config.excluded_models += %w[InternalModel]`
|
|
1886
1854
|
|
data/docs/INTROSPECTORS.md
CHANGED
|
@@ -228,7 +228,7 @@ Passed to `SourceIntrospector.walk(path, key => Listener)` when a specific file
|
|
|
228
228
|
| VariantCallListener | `variant` calls (ChainedCallListener with `:variant` preset) |
|
|
229
229
|
| ProcLiteralListener | Proc literals: line, source, assigned constant |
|
|
230
230
|
| QueueAssignmentListener | A queue a class body assigns outside any method: Resque's `@queue = :name`, Que's `self.queue = "name"`, or a `def self.queue` returning one, a literal as its value, anything else as source |
|
|
231
|
-
| HttpClientCallListener | Calls on an HTTP client constant (`Faraday`, `Net::HTTP`, `HTTParty`, `RestClient`, `HTTP`, `Excon`, `Typhoeus`, `URI.open`) with a literal URL, bare, wrapped in `URI(...)`/`URI.parse(...)` or as `url:`, and the host `Net::HTTP.start`/`.new` takes. `
|
|
231
|
+
| HttpClientCallListener | Calls on an HTTP client constant (`Faraday`, `Net::HTTP`, `HTTParty`, `RestClient`, `HTTP`, `Excon`, `Typhoeus`, `URI.open`) with a literal URL, bare, wrapped in `URI(...)`/`URI.parse(...)` or as `url:`, and the host `Net::HTTP.start`/`.new` takes. The `env` section of `rails_get_config` names external services from it |
|
|
232
232
|
| ConstantReferenceListener | References to constants by last name, qualified or not (`ActiveSupport::MessageVerifier`), skipping one that only qualifies a nested constant (`MessageVerifier::InvalidSignature`) and mentions in comments or strings. Used by the ActiveSupport introspector for message verifier and encryptor usage |
|
|
233
233
|
| MethodCallListener | Call sites by name or pattern anywhere in a file, inside a `def`, a lambda or a block included, with arguments, options, receiver, line, offset, the owning class or module, and `constants:` (each argument that is a constant, or builds one with `.new`, mapped to the constant's name). Used by the Turbo introspector for broadcast calls, the ActiveSupport introspector for notification subscriptions, and others |
|
|
234
234
|
|
|
@@ -279,14 +279,14 @@ same wherever it is asked. Those live as their own modules under
|
|
|
279
279
|
| `RetryPolicy` | What a job does when it raises, as a reader would write it: the macro, its exceptions, then `attempts:` and `wait:` whatever order the source put them in |
|
|
280
280
|
| `SourceCalls` | Which other classes a file hands work to, off the call nodes: the verb list, the framework receivers left out, and the call or the class alone |
|
|
281
281
|
| `ServiceClasses` | Which classes under `app/services`, `app/interactions` and `app/interactors` are services and which are only the base of one, for the tool's listing and the generated files' line alike |
|
|
282
|
-
| `EnvReferences` | Every ENV name the app's source reads, file by file, for `
|
|
283
|
-
| `AnywayConfigs` | Each Anyway::Config class under `config/configs` and `app/configs`, every class in a file, with the attributes its own body declares (a nested class keeps its macros) and the env name anyway_config reads each from: `env_prefix`, else `config_name`, else the name before `Config`. `
|
|
282
|
+
| `EnvReferences` | Every ENV name the app's source reads, file by file, for `rails_get_config`'s `env` section and the context file's `env` section alike: `app`, `config` and `lib` Ruby, ERB and config YAML, `config.ru`, `db/seeds` and the `bin/` scripts whose shebang is Ruby, with config YAML on `sensitive_patterns` read for the names in its ERB tags only |
|
|
283
|
+
| `AnywayConfigs` | Each Anyway::Config class under `config/configs` and `app/configs`, every class in a file, with the attributes its own body declares (a nested class keeps its macros) and the env name anyway_config reads each from: `env_prefix`, else `config_name`, else the name before `Config`. `rails_get_config(section:"env")` lists them |
|
|
284
284
|
| `GemfileGems` | The one Gemfile read, off `GemfileDslListener`: its entries with options and groups (the gems section's local gems and groups) and the gem names (every other asker), so a commented-out `gem` line is no gem anywhere; a file named by `eval_gemfile` is followed when it is inside the bundle's directory (the app root, or the directory of the Gemfile `config/boot.rb` points at), and one it cannot read is an `:unknown_gems` entry. GemLock takes the declared Ruby and the gem names from it once the gem is loaded; the walk is kept until one of the files changes. Before the boot, GemLock walks the one Gemfile with `AstWalk` instead and leaves `eval_gemfile` unread |
|
|
285
285
|
| `ModuleAliases` | Which app file a bare JS import specifier names: tsconfig/jsconfig `compilerOptions.paths` followed through `extends` (relative files and installed packages), and a vite/webpack/rspack `resolve.alias` written as a literal object. The Stimulus scan uses it to tie a registration or a base class to the controller file it imports |
|
|
286
286
|
| `HelperNames` | The helper methods a view can call: every method the app's helper modules define in every code root, and those of a module they `include`, found through the app's autoload roots (`lib` among them) or in its enclosing namespace's file (`CanonicalURL::Helpers` in `canonical_url.rb`). `rails_get_partial_interface` uses it so a helper call is not read as a local |
|
|
287
287
|
| `Interaction` | Whether a class runs as an ActiveInteraction, following its superclass chain through the app's own sources, and the filters it takes - inherited ones first, one per name, each carrying the filters nested inside its block. See the **Interaction filter** entry in `CONTEXT.md` |
|
|
288
288
|
| `RecurringSchedules` | The recurring tasks each scheduler reads from its own file: Solid Queue's `config/recurring.yml`, sidekiq-cron's `config/schedule.yml`, sidekiq-scheduler's section of `config/sidekiq.yml`, GoodJob's `config.good_job.cron` and whenever's `config/schedule.rb`. The job introspector hands it its own config walk, so a file it also reads for queue or mailer settings is walked once |
|
|
289
|
-
| `AdminResources` | The models an admin gem exposes (ActiveAdmin, Trestle, Administrate, Avo, Madmin), from the folder each gem's generator writes to, with ActiveAdmin's `permit_params`. `
|
|
289
|
+
| `AdminResources` | The models an admin gem exposes (ActiveAdmin, Trestle, Administrate, Avo, Madmin), from the folder each gem's generator writes to, with ActiveAdmin's `permit_params`. `rails_get_config(section:"conventions")` and `rails_analyze_feature` both ask it |
|
|
290
290
|
| `SchemaDumpPath` | The primary database's dump file as `DatabaseTasks.schema_dump_path` names it: `database.yml`'s `schema_dump` in the configured `schema_format`, then each format's default file, and the secondary databases' dumps. Every schema reader, the doctor and the pending-migration check ask it |
|
|
291
291
|
| `ApartmentConfig` | The models an Apartment initializer keeps in the shared schema (`excluded_models`), or the source of a list the file computes. The model introspector asks it to say which models get one table per tenant |
|
|
292
292
|
| `SchemaReader` | What a `schema.rb` dump declares: tables, columns, defaults, indexes, foreign keys, enum types and check constraints. `SchemaReader.for(root)` answers from whichever source the app committed: `schema.rb`, `structure.sql`, or a migration replay |
|
data/docs/QUICKSTART.md
CHANGED
|
@@ -113,7 +113,7 @@ rails 'ai:tool[search_code]' pattern="your_method_name" match_type=trace
|
|
|
113
113
|
rails 'ai:tool[analyze_feature]' feature=auth
|
|
114
114
|
|
|
115
115
|
# 3. Get your app's actual conventions - not generic Rails patterns
|
|
116
|
-
rails 'ai:tool[
|
|
116
|
+
rails 'ai:tool[config]' section=conventions
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
## What to do next
|
data/docs/RECIPES.md
CHANGED
|
@@ -138,9 +138,9 @@ AI sees the full picture: the parent controller's `authenticate_user!` filter, t
|
|
|
138
138
|
AI sees what already exists before building anything. Then:
|
|
139
139
|
|
|
140
140
|
```
|
|
141
|
-
→
|
|
142
|
-
→
|
|
143
|
-
→ rails_get_schema()
|
|
141
|
+
→ rails_get_config(section: "conventions") # Your app's own patterns
|
|
142
|
+
→ rails_get_config(section: "gems") # Sees ActionMailer, Sidekiq, etc.
|
|
143
|
+
→ rails_get_schema() # Picks the right foreign keys and types
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
AI scaffolds the feature matching your app's actual patterns - not generic Rails conventions from training data.
|
|
@@ -206,7 +206,7 @@ rails_onboard(detail: "full")
|
|
|
206
206
|
rails_dependency_graph(format: "mermaid")
|
|
207
207
|
# → Visual model relationship graph
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
rails_get_config(section: "gems")
|
|
210
210
|
# → Every notable gem with version, category, and config location
|
|
211
211
|
```
|
|
212
212
|
|
|
@@ -306,7 +306,7 @@ rails_search_code(pattern: "include Searchable", match_type: "any")
|
|
|
306
306
|
rails_get_component_catalog(detail: "standard")
|
|
307
307
|
# → ViewComponent/Phlex: props, slots, previews, sidecar assets, usage examples
|
|
308
308
|
|
|
309
|
-
|
|
309
|
+
rails_get_config(section: "frontend")
|
|
310
310
|
# → React/Vue/Svelte, Hotwire, TypeScript, Vite/Webpacker
|
|
311
311
|
```
|
|
312
312
|
|
data/docs/RELEASING.md
CHANGED
|
@@ -32,7 +32,9 @@ pushed.
|
|
|
32
32
|
commit anyway.
|
|
33
33
|
4. **Prose that names the last version goes stale where no check can see it.**
|
|
34
34
|
`docs/COMPATIBILITY.md` names the release its proof sources come from. Grep
|
|
35
|
-
the tree for the previous version before committing.
|
|
35
|
+
the tree for the previous version before committing. The repository's About
|
|
36
|
+
text on GitHub names the tool count, and no check reads it:
|
|
37
|
+
`gh repo edit --description` changes it.
|
|
36
38
|
5. **The copy-paste prompts name a version floor.** `docs/PROMPTS.md` (and the
|
|
37
39
|
README's copy of the recommended prompt) tells the AI tool to install
|
|
38
40
|
`>= 5.35.0`, the first release with the install flags. If the release that
|