agent-browser
Browser automation using Vercel's agent-browser CLI. Use when you need to interact with web pages, fill forms, take screenshots,…
This skill should be used when writing Ruby gems following Andrew Kane's proven patterns and philosophy. It applies when creating new Ruby gems, refactoring existing gems, designing gem APIs, or when clean, minimal, production-ready Ruby library code is needed. Triggers on
Claude Code
$ npx -y skills add davekilleen/Dex --skill andrew-kane-gem-writer --agent claude-code
Codex
$ npx skills add davekilleen/Dex --skill andrew-kane-gem-writer -a codex -y
Cursor
$ npx skills add davekilleen/Dex --skill andrew-kane-gem-writer -a cursor -y
Gemini CLI
$ npx skills add davekilleen/Dex --skill andrew-kane-gem-writer -a gemini-cli -y
GitHub Copilot
$ npx skills add davekilleen/Dex --skill andrew-kane-gem-writer -a github-copilot -y
OpenCode
$ npx skills add davekilleen/Dex --skill andrew-kane-gem-writer -a opencode -y
Windsurf
$ npx skills add davekilleen/Dex --skill andrew-kane-gem-writer -a windsurf -y
name: andrew-kane-gem-writer description: This skill should be used when writing Ruby gems following Andrew Kane's proven patterns and philosophy. It applies when creating new Ruby gems, refactoring existing gems, designing gem APIs, or when clean, minimal, production-ready Ruby library code is needed. Triggers on requests like "create a gem", "write a Ruby library", "design a gem API", or mentions of Andrew Kane's style.
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).
**Simplicity over cleverness.** Zero or minimal dependencies. Explicit code over metaprogramming. Rails integration without Rails coupling. Every pattern serves production use cases.
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
endThe 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**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
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
endSimple 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
# 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
endZero 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
endFor deeper patterns, see:
One personal Dex, built around your work. Keep your priorities, people, meeting notes and tasks in a folder you own. Work with Dex through your AI app to plan the day, prepare for a meeting or follow through on a promise.
Browser automation using Vercel's agent-browser CLI. Use when you need to interact with web pages, fill forms, take screenshots,…
Build applications where agents are first-class citizens. Use this skill when designing autonomous agents, creating MCP tools,…
This skill should be used before implementing features, building components, or making changes. It guides exploring user intent,…
Capture solved problems as categorized documentation with YAML frontmatter for fast lookup
Expert guidance for creating, writing, and refining Claude Code Skills. Use when working with SKILL.md files, authoring new…
This skill should be used when writing Ruby and Rails code in DHH's distinctive 37signals style. It applies when writing Ruby…
Shape output for a reader with ADHD: lead with the next action, number multi-step work, restate state across turns, suppress…
Set up the owner profile so a personal agent knows who it works for (first-run setup, \"get to know me\"), or distill colleague,…