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

Custom Rails Generators in RubyEvents (WNB.rb E...

Custom Rails Generators in RubyEvents (WNB.rb Edition)

Avatar for ChaelCodes

ChaelCodes

August 26, 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: Used old/deprecated format AI is super-smart, but

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

    but they don't know our system. Useful keys like `canceled` or `original_title` neglected No # TODO comments Spends lots of tokens time understanding examples
  4. How to teach them about RubyEvents? 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
  5. Why Generators? Familiar pattern for Rails devs Arguments and options

    Templating and file generation Documentation Testing File conflicts
  6. application_name = rubyevents class_name = CFP edit_helper = edit_cfp_url(@cfp) NamedBase

    Requires one argument file_path = cfp fixture_file_name = cfps human_name = CFP i18n_scope = cfp index_helper = cfps
  7. model_resource_name = cfp new_helper = new_cfp_url plural_file_name = cfps NamedBase

    Requires one argument plural_name = cfps plural_route_name = cfps plural_table_name = cfps redirect_resource_name = @cfp show_helper = cfp_url(@cfp)
  8. arguments argument :event, type: :string, desc: "event slug" required or

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

    optional Order independent bin/rails g cfp --event rails-world-2026
  10. Testing Generators The generated test is a TRAP Use RAILS_LOG_TO_STDOUT=true

    to see output Replace destination_root with a tmp directory Don't prepare_destination
  11. How to teach them about RubyEvents? 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 in @ai-test/RAILS_WORLD.md" Use deprecated event_name field (Mistake) Added invalid schedule.yml (Error) Keys in the wrong order (Error) No TODOs (Mistake)
  14. How'd it go? Method Tokens Mistakes AI - no g

    127,452 ($1.68) 2 Errors, 2 Mistakes AI - g SKILL + CLI MCP
  15. GPT 5.4 - No Skill, Generators "Using custom rails generators

    - add Rails World 2026, which is described in @ai-test/RAILS_WORLD.md" Didn't call validations - missing custom colors (Error) Missing TODOs (Mistake)
  16. How'd it go? Method Tokens Mistakes AI - no g

    127,452 ($1.68) 2 Errors, 2 Mistakes AI - g 77,246 ($0.84) 1 Error, 1 Mistake SKILL + CLI MCP
  17. GPT 5.4 - SKILL, Generators "Using /event-data - add Rails

    World 2026, which is described in @ai-test/RAILS_WORLD.md" Ran my generator once and then copied and pasted Ran the validations Added deprecated event_name (Mistake) Deleted my TODOs (Mistake)
  18. How'd it go? Method Tokens Mistakes AI - no g

    127,452 ($1.68) 2 Errors, 2 Mistakes AI - g 77,246 ($0.84) 1 Error, 1 Mistake SKILL + CLI 109,852 ($1.24) 2 Mistakes MCP
  19. GPT 5.4 "Using rubyevents MCP tools - add Rails World

    2026, which is described in @ai-test/RAILS_WORLD.md" Didn't call validations - missing custom colors (Error) Tweaked everyone's descriptions (Error) Deleted my TODOs (Mistake)
  20. How'd it go? Method Tokens Mistakes AI - no g

    127,452 ($1.68) 2 Errors, 2 Mistakes AI - g 77,246 ($0.84) 1 Error, 1 Mistake SKILL + CLI 109,852 ($1.24) 2 Mistakes MCP 88,324 ($1.88) 2 Errors, 1 Mistake
  21. How'd it go? Method Tokens Mistakes AI - no g

    95,532 ($0.31) 3 Errors, 1 Mistake AI - g 98,440 ($0.31) 1 Failed Attempt, Forgot to generate talks SKILL + CLI 123,958 ($0.49) 0 MCP 55,707 ($0.18) 0
  22. How'd it go? Method Tokens Mistakes AI - no g

    47,073 ($0.03) 0 Errors/Mistakes AI - g 82,601 ($0.10) 0 Errors/Mistakes SKILL + CLI 54,935 ($0.04) 0 Errors/Mistakes MCP 43,278 ($0.03) 0 Errors/Mistakes
  23. Build a custom generator! Takeaways Remind your robots to use

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