andrew-kane-gem-writer
Write Ruby gems following Andrew Kane's proven patterns and philosophy
Install / Use
npx skills add Microck/ordinary-claude-skills --skill andrew-kane-gem-writerInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
MarketingSupported Platforms
Our assessment of andrew-kane-gem-writer
andrew-kane-gem-writer scores 84/100 on our quality scale, 436th of 573 Marketing skills we index.
Its SKILL.md is 4.7 KB long, well organised into 23 sections with 7 code examples: a solid amount of guidance for an agent.
It has 399 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so andrew-kane-gem-writer is actively maintained.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
andrew-kane-gem-writer compared with similar skills
All 4 of these similar skills score higher than andrew-kane-gem-writer; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| andrew-kane-gem-writer (this skill)by Microck | 84 | 399 | 46d ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 101.1k | 2d ago | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 101.0k | 2d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 77.5k | today | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 89.2k | today | MCP Server |
Frequently asked questions
- How do I install andrew-kane-gem-writer?
- Run
npx skills add Microck/ordinary-claude-skills --skill andrew-kane-gem-writer. The install tabs above show the steps for each supported agent. - Which AI agents does andrew-kane-gem-writer work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is andrew-kane-gem-writer safe to use?
- It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is andrew-kane-gem-writer still maintained?
- The repository was last updated about 2 months ago, so andrew-kane-gem-writer is actively maintained.
Skill content
View source on GitHubname: andrew-kane-gem-writer description: Write Ruby gems following Andrew Kane's proven patterns and philosophy. Use when creating new Ruby gems, refactoring existing gems, designing gem APIs, or when the user wants clean, minimal, production-ready Ruby library code. Triggers on requests like "create a gem", "write a Ruby library", "design a gem API", or mentions of Andrew Kane's style.
Andrew Kane Gem Writer
Write Ruby gems following Andrew Kane's battle-tested patterns from 100+ gems with 374M+ downloads (Searchkick, PgHero, Chartkick, Strong Migrations, Lockbox, Ahoy, Blazer, Groupdate, Neighbor, Blind Index).
Core Philosophy
Simplicity over cleverness. Zero or minimal dependencies. Explicit code over metaprogramming. Rails integration without Rails coupling. Every pattern serves production use cases.
Entry Point Structure
Every gem follows this exact pattern in lib/gemname.rb:
# 1. Dependencies (stdlib preferred)
require "forwardable"
# 2. Internal modules
require_relative "gemname/model"
require_relative "gemname/version"
# 3. Conditional Rails (CRITICAL - never require Rails directly)
require_relative "gemname/railtie" if defined?(Rails)
# 4. Module with config and errors
module GemName
class Error < StandardError; end
class InvalidConfigError < Error; end
class << self
attr_accessor :timeout, :logger
attr_writer :client
end
self.timeout = 10 # Defaults set immediately
end
Class Macro DSL Pattern
The signature Kane pattern—single method call configures everything:
# Usage
class Product < ApplicationRecord
searchkick word_start: [:name]
end
# Implementation
module GemName
module Model
def gemname(**options)
unknown = options.keys - KNOWN_KEYWORDS
raise ArgumentError, "unknown keywords: #{unknown.join(", ")}" if unknown.any?
mod = Module.new
mod.module_eval do
define_method :some_method do
# implementation
end unless method_defined?(:some_method)
end
include mod
class_eval do
cattr_reader :gemname_options, instance_reader: false
class_variable_set :@@gemname_options, options.dup
end
end
end
end
Rails Integration
Always use ActiveSupport.on_load—never require Rails gems directly:
# WRONG
require "active_record"
ActiveRecord::Base.include(MyGem::Model)
# CORRECT
ActiveSupport.on_load(:active_record) do
extend GemName::Model
end
# Use prepend for behavior modification
ActiveSupport.on_load(:active_record) do
ActiveRecord::Migration.prepend(GemName::Migration)
end
Configuration Pattern
Use class << self with attr_accessor, not Configuration objects:
module GemName
class << self
attr_accessor :timeout, :logger
attr_writer :master_key
end
def self.master_key
@master_key ||= ENV["GEMNAME_MASTER_KEY"]
end
self.timeout = 10
self.logger = nil
end
Error Handling
Simple hierarchy with informative messages:
module GemName
class Error < StandardError; end
class ConfigError < Error; end
class ValidationError < Error; end
end
# Validate early with ArgumentError
def initialize(key:)
raise ArgumentError, "Key must be 32 bytes" unless key&.bytesize == 32
end
Testing (Minitest Only)
# test/test_helper.rb
require "bundler/setup"
Bundler.require(:default)
require "minitest/autorun"
require "minitest/pride"
# test/model_test.rb
class ModelTest < Minitest::Test
def test_basic_functionality
assert_equal expected, actual
end
end
Gemspec Pattern
Zero runtime dependencies when possible:
Gem::Specification.new do |spec|
spec.name = "gemname"
spec.version = GemName::VERSION
spec.required_ruby_version = ">= 3.1"
spec.files = Dir["*.{md,txt}", "{lib}/**/*"]
spec.require_path = "lib"
# NO add_dependency lines - dev deps go in Gemfile
end
Anti-Patterns to Avoid
method_missing(usedefine_methodinstead)- Configuration objects (use class accessors)
@@class_variables(useclass << self)- Requiring Rails gems directly
- Many runtime dependencies
- Committing Gemfile.lock in gems
- RSpec (use Minitest)
- Heavy DSLs (prefer explicit Ruby)
Reference Files
For deeper patterns, see:
- references/module-organization.md - Directory layouts, method decomposition
- references/rails-integration.md - Railtie, Engine, on_load patterns
- references/database-adapters.md - Multi-database support patterns
- references/testing-patterns.md - Multi-version testing, CI setup
- references/resources.md - Links to Kane's repos and articles
Related Skills
taste-skill
101.1kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
Agent-Reach
101.0kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
77.5kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Scrapling
89.2k🕷️ A Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
