andrew-kane-gem-writer

Create Ruby gems with minimal dependencies and Rails-safe integration.

24.1k|2.0k|Updated Oct 9, 2025
One-click install
npx skills add https://github.com/EveryInc/compound-engineering-plugin --skill andrew-kane-gem-writer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: andrew-kane-gem-writer
Source: https://github.com/EveryInc/compound-engineering-plugin/tree/main/plugins/compound-engineering/skills/andrew-kane-gem-writer
Command: npx skills add https://github.com/EveryInc/compound-engineering-plugin --skill andrew-kane-gem-writer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

Guides building clean, production-grade Ruby gems following Andrew Kane's patterns, with minimal dependencies and Rails-friendly integration.

Core Features & Use Cases

  • Clear gem entry point and versioning patterns
  • Class macro DSL pattern for clean API configuration
  • Rails on_load integration and Rails patterns
  • Opinionated error handling and testing patterns

Quick Start

Initialize a minimal gem skeleton and a basic gem class following Kane's patterns.

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 create a production-ready Ruby gem with minimal dependencies?

Build a Ruby gem following Andrew Kane's patterns by defining a clear entry point, using class macro DSLs for configuration, and avoiding heavy metaprogramming. This approach yields clean, maintainable gems with explicit APIs and minimal external dependencies.

What's the best way to structure error handling in a Ruby gem?

Implement a simple, informative error hierarchy in your gem so users can distinguish failure modes and handle them appropriately. Kane's pattern emphasizes explicit, predictable error types over generic exceptions.

How do I integrate a Ruby gem with Rails using ActiveSupport.on_load?

Use ActiveSupport.on_load to hook your gem into Rails without forcing it as a hard dependency. This pattern loads gem features only when Rails is present, enabling Rails-friendly integration while keeping the gem usable standalone.

Can I test a Ruby gem with Minitest following production patterns?

Yes. Kane's gem patterns standardize on Minitest-based testing, providing a lightweight, convention-driven test structure that aligns with Ruby's ecosystem and avoids external test framework dependencies.

What are common anti-patterns to avoid when designing a Ruby gem API?

Avoid heavy metaprogramming, implicit side effects, and unclear entry points. Kane's approach prioritizes explicit Ruby APIs, single-purpose macro DSLs, and straightforward class structures that remain readable and maintainable long-term.

Does this approach work for refactoring an existing Ruby gem?

Yes. The patterns apply to refactoring existing gems into Kane-style architecture—streamlining APIs, reducing dependencies, clarifying entry points, and adopting consistent error and testing conventions.