Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Custom Rails Generators in RubyEvents (Rails Wo...

Avatar for ChaelCodes ChaelCodes
September 15, 2026

Custom Rails Generators in RubyEvents (Rails World 2026)

At RubyEvents.org, we generate a lot of YAML. Contributors need an easy, idiomatic way to generate event files to the latest standards in an unfamiliar codebase. AI needs to generate files from unstructured data without drifting. These feel like different problems, but custom Rails generators can solve both.

Rails generators power rails generate — a built-in tool for creating and modifying files from the command line. Custom generators feel natural for anyone familiar with Rails and allow you to extend Rails' conventions with your own.

This will be a deep dive into how to build a custom generator — templates, mutating files, testing, and everything we learned the hard way at RubyEvents.

Avatar for ChaelCodes

ChaelCodes

September 15, 2026

More Decks by ChaelCodes

Other Decks in Technology

Transcript

  1. Inherited architectural decision Why do you use yaml? Allows us

    to review events Allows any developer to update events Historical Record
  2. Invented Keys Problem: AI is super-smart, but it doesn't know

    our system. Used old/deprecated format No # TODO comments Useful keys like `canceled` or `original_title` neglected Spends lots of tokens understanding examples
  3. Invented Typo Keys Problem: Contributors are super-smart, but they don't

    know our system. Used old/deprecated format No # TODO comments Useful keys like `canceled` or `original_title` neglected Spends lots of tokens time understanding examples
  4. MCP SKILL + CLI AI-native SDK that fetches context or

    executes commands for a model Markdown documentation discoverable by AI paired with a normal CLI Preferred by AI Usable without tokens Context consumed in describing MCP tool Documentation and Context in Skill Context = Tokens ($) Validations in Skill
  5. application_name = rubyevents class_name = CFP edit_helper = edit_cfp_url(@cfp) NamedBase

    file_path = cfp fixture_file_name = cfps human_name = CFP i18n_scope = cfp index_helper = cfps
  6. model_resource_name = cfp new_helper = new_cfp_url plural_file_name = cfps NamedBase

    plural_name = cfps plural_route_name = cfps plural_table_name = cfps redirect_resource_name = @cfp show_helper = cfp_url(@cfp)
  7. NamedBase Base Accepts one argument - name No arguments Tons

    of simple helper methods based on name No helper methods Inherits from base No name
  8. arguments argument :event, type: :string, desc: "event slug" bin/rails g

    cfp rails-world-2026 required or default dependent on order
  9. class_option :event, type: :string, desc: "event-slug" options bin/rails g cfp

    --event rails-world-2026 Required, default, or optional Order independent
  10. Argument Option argument :event, type: :string, desc: "event slug" class_option

    :event, type: :string, desc: "event-slug" bin/rails g cfp rails-world-2026 bin/rails g cfp --event rails-world-2026 Required or Default Required, default, or optional Order-dependent Order independent
  11. MCP SKILL + CLI AI-native SDK that fetches context for

    a model Markdown documentation discoverable by AI paired with a normal CLI Preferred by AI Usable without tokens Context consumed in describing MCP tool Documentation and Context in Skill Context = Tokens ($) Validations in Skill
  12. How'd it go? Method AI - no g AI -

    g SKILL + CLI MCP Tokens Mistakes
  13. GPT 5.4 - No Skill, No Generator, No MCP "Add

    Rails World 2026, which is described at RAILS_WORLD_2026.md . Use bin/rails validate:all to validate." Old sponsors logos from 2023 1password instead of 1Password Tablecheck vs TableCheck Added a url for the palmer events center 4 Errors
  14. How'd it go? Method Tokens Mistakes AI - no g

    136,479 ($1.83) 4 Errors AI - g SKILL + CLI MCP
  15. GPT 5.4 - No Skill, Generators "Using custom generators, add

    Rails World 2026, which is described at RAILS_WORLD_2026.md . Use bin/rails validate:all to validate." Forgot PlanetScale Replaced em-dash with hyphens for descriptions 2 Errors
  16. How'd it go? Method Tokens Mistakes AI - no g

    136,479 ($1.83) 4 Errors AI - g 131,307 ($1.37) 2 Errors SKILL + CLI MCP
  17. GPT 5.4 - SKILL, Generators "/event-data add Rails World 2026,

    which is described at RAILS_WORLD_2026.md . Use bin/rails validate:all to validate." Replace em-dash in descriptions with hyphens 1 Error
  18. How'd it go? Method Tokens Mistakes AI - no g

    136,479 ($1.83) 4 Errors AI - g 131,307 ($1.37) 2 Errors SKILL + CLI 153,325 ($1.91) 1 Error MCP
  19. GPT 5.4 "Using rubyevents mcp, add Rails World 2026, which

    is described at RAILS_WORLD_2026.md . Use bin/rails validate:all to validate." No videos. No schedule. No sponsors. 3 Major Errors
  20. How'd it go? Method Tokens Mistakes AI - no g

    136,479 ($1.83) 4 Errors AI - g 131,307 ($1.37) 2 Errors SKILL + CLI 153,325 ($1.91) 1 Error MCP 56,632 ($0.43) 3 Major Errors
  21. How'd it go? Method Tokens Mistakes AI - no g

    126,726 ($0.35) 3 Major Errors AI - g 106,753 ($0.41) 2 Errors, 2 Mistakes SKILL + CLI 113,807 ($0.39) 0 Mistakes MCP 65,717 ($0.27) 2 Errors
  22. How'd it go? Method Tokens Mistakes AI - no g

    52,951 ($0.04) 2 Errors AI - g 57,785 ($0.04) 2 Errors SKILL + CLI 93,374 ($0.13) 1 Error MCP 43,082 ($0.03) 2 Errors
  23. Build a custom generator! Remind your agents to use Rails

    generators. Takeaways Use a small model with better tools. Customize existing generator templates! Build for humans too.