andrew-kane-gem-writer

Write Ruby gems following Andrew Kane's patterns with minimal dependencies.

1|Updated Jan 11, 2025
One-click install
npx skills add https://github.com/krbylit/dotfiles --skill andrew-kane-gem-writer-krbylit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: andrew-kane-gem-writer
Source: https://github.com/krbylit/dotfiles/tree/main/cm-util/pkg-backups/beads-compound/0.6.8/gemini/skills/andrew-kane-gem-writer
Command: npx skills add https://github.com/krbylit/dotfiles --skill andrew-kane-gem-writer-krbylit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a disciplined blueprint for creating production-ready Ruby gems by applying Andrew Kane's patterns, ensuring minimal dependencies and explicit structure.

Core Features & Use Cases

  • Structured gem skeleton: provides a canonical lib/gemname.rb layout and module organization.
  • Pattern-driven API design: demonstrates a class macro DSL approach and Rails integration without tight Rails coupling.
  • Quality and safety guidance: includes error handling, anti-patterns to avoid, and testing recommendations.

Quick Start

Scaffold a new gem using the canonical Andrew Kane gem-writer pattern and implement the standard skeleton in lib/gemname.rb.

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 to keep dependencies minimal?

Structure a Ruby gem using a canonical lib/gemname.rb layout with explicit module organization to enforce minimal dependencies and maintain production-readiness.

What is pattern-driven API design for Ruby gems?

Pattern-driven API design uses a class macro DSL approach to provide clear structure and enforce simplicity when creating or refactoring Ruby gems.

Can I integrate a Ruby gem with Rails without tight framework coupling?

Yes, you can integrate a Ruby gem with Rails using an on_load railtie mechanism, ensuring pattern-driven configuration without tight Rails coupling.

What's the best way to handle errors in a Ruby gem?

The best way to handle errors in a Ruby gem is through explicit error handling patterns, following quality and safety guidance to avoid common anti-patterns.

Does this Ruby gem pattern work for non-Rails contexts?

Yes, this Ruby gem pattern works for API design across both Rails and non-Rails contexts, ensuring a disciplined blueprint and clear structure regardless of framework.

When should I not use a class macro DSL in my Ruby gem?

You should avoid a class macro DSL when it introduces unnecessary complexity, violating the explicit error handling and minimal dependency patterns required for production-ready gems.