Project

ai_summary

0.0
A long-lived project that still receives updates
AI Summary is a Ruby gem that inspects your Rails project and generates a developer-friendly summary of your models, tables, controllers, routes, and more. Designed to help AI tools understand your application structure for better code suggestions, onboarding, debugging, or documentation.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 2.4
~> 13.0
~> 3.12

Runtime

>= 7.1, < 9.0
>= 7.1, < 9.0
>= 7.1, < 9.0
 Project Readme

AiSummary

AI-powered summary generator for Ruby on Rails applications.
AiSummary scans your Rails project and creates a structured summary of your models, database tables, associations, controllers, and routes. It’s designed to help AI tools (like ChatGPT or GitHub Copilot) better understand your codebase for debugging, refactoring, onboarding, or generating code.


✨ Features

  • Lists all models and their database columns
  • Extracts ActiveRecord associations (has_many, belongs_to, etc.)
  • Summarizes all controllers and public methods
  • Extracts and maps all routes to their controller actions
  • Outputs a clean .txt file (YAML and JSON output planned)
  • Useful for documentation, developer onboarding, and AI integration

πŸ“¦ Installation

After it's released to RubyGems.org, add it to your Gemfile: bundle add ai_summary Or install it manually: gem install ai_summary If you want to use the gem directly from GitHub before release: gem 'ai_summary', git: 'https://github.com/andersmarkc/ai_summary' Then run: bundle install

πŸš€ Usage

Rails Runner

bundle exec rails runner 'AiSummary::SummaryGenerator.generate'

Rails Console

AiSummary::SummaryGenerator.generate

Rake Task

bundle exec rake ai_summary:generate # Default output: rails_summary.txt bundle exec rake ai_summary:generate[json] # Output: rails_summary.json bundle exec rake ai_summary:generate[yaml] # Output: rails_summary.yaml

By default, this will generate a rails_summary.txt file in your project root.

πŸ“‚ Output Example

MODELS

User (table: users)

  • id: integer
  • email: string
  • created_at: datetime
  • has_many :orders

Order (table: orders)

  • id: integer
  • user_id: integer
  • total_price: decimal
  • belongs_to :user

CONTROLLERS

UsersController

  • index
  • show

OrdersController

  • create
  • update

ROUTES

GET /users => users#index GET /users/:id => users#show POST /orders => orders#create PATCH /orders/:id => orders#update

🀝 Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/andersmarkc/ai_summary

This project is intended to be a safe, welcoming space for collaboration. Contributors are expected to follow the Code of Conduct.

πŸ“œ License

The gem is available as open source under the terms of the MIT License.