andrew-kane-gem-writer

Scaffold Ruby gems with explicit configuration and Rails on_load integration.

1|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/AskTinNguyen/vesper-team-skills --skill andrew-kane-gem-writer-asktinnguyen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: andrew-kane-gem-writer
Source: https://github.com/AskTinNguyen/vesper-team-skills/tree/main/andrew-kane-gem-writer
Command: npx skills add https://github.com/AskTinNguyen/vesper-team-skills --skill andrew-kane-gem-writer-asktinnguyen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Ruby gem authors often struggle to implement production-ready gems that align with Kane's established patterns. This skill provides a structured approach, templates, and guidance to ensure clean design, proper Rails integration, and reliable maintenance.

Core Features & Use Cases

  • Scaffold a gem following Andrew Kane's battle-tested patterns and philosophy.
  • Enforce explicit configuration, Rails integration via on_load, and minimal dependencies.
  • Organize code with a clear entry-point structure, versioning, and engine/railtie patterns for Rails apps.

Quick Start

Run the Kane gem writer to scaffold a new gem following Andrew Kane's patterns and then customize the generated files for your project.

Frequently Asked Questions about andrew-kane-gem-writer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Ruby gem for clean Rails integration?

Structure a Ruby gem for Rails integration by using an engine or railtie scaffold, adhering to on_load hooks, and avoiding direct Rails requires. This prevents load order issues and ensures reliable initialization across Rails environments.

What is the on_load pattern in Rails gem development?

The on_load pattern in Rails gem development hooks into framework loading events via ActiveSupport::LazyLoadHooks rather than requiring Rails directly. This defers initialization until the framework is ready, preventing dependency conflicts.

How do I scaffold a new Ruby gem with explicit configuration?

Scaffold a Ruby gem with explicit configuration by defining class accessors for settings. This enforces a clean interface, allowing users to configure your gem explicitly within their application setup without global variables.

When should I use a railtie versus an engine in a Ruby gem?

Use a railtie in a Ruby gem to add initializers or configuration without application components. Use an engine when your gem provides controllers, models, or views that integrate directly into the host Rails application routing.

Why should my Ruby gem avoid direct Rails requires?

Your Ruby gem should avoid direct Rails requires to prevent loading the entire framework prematurely. Relying on on_load hooks keeps your gem modular, reduces load times, and prevents runtime conflicts.

Can I refactor existing Ruby code into a modular gem component?

You can refactor existing Ruby code into a modular gem component by extracting logic into a clean entry-point structure with explicit versioning. This isolates dependencies and establishes a clear interface for Rails environments.