rails_dependency_graph
Generates a dependency graph of Rails model associations as Mermaid or text to map architecture, trace data flow, and plan refactors.
Instructions
Generates a dependency graph showing how models connect through their associations. Output as Mermaid diagram syntax or plain text. Use when: understanding feature architecture, tracing data flow, planning refactors. Key params: model (center graph on model), depth (1-3), format (mermaid/text).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | How many hops from the center model (1-3, default: 2) | |
| model | No | Center the graph on this model (e.g., 'User'). Without this, shows every model up to a cap of 50 nodes. | |
| format | No | Output format: mermaid (diagram syntax) or text (plain) | |
| show_sti | No | Show Single Table Inheritance hierarchies (default: false) | |
| show_cycles | No | Detect and display circular dependency cycles (default: false) |