Ruby
Advanced Ruby skills for object-oriented programming, metaprogramming, blocks, and gems.
Installation
First, install the Han CLI tool:
npm install -g @thebushidocollective/hanThen install the plugin:
han plugin install buki-rubyOverview
Advanced Ruby programming skills covering object-oriented programming, metaprogramming, blocks, closures, gems, and the standard library.
What This Buki Provides
Validation Hooks
- Ruby Syntax Validation: Runs
ruby -cto check syntax before completion - Automatic Quality Checks: Validates Ruby code when Claude Code or agents finish work
Skills
This buki provides the following skills:
- ruby-oop: Object-oriented programming including classes, modules, inheritance, mixins, and method visibility
- ruby-blocks-procs-lambdas: Blocks, procs, lambdas, closures, and functional programming patterns
- ruby-metaprogramming: Dynamic method definition, method_missing, reflection, DSLs, and runtime code generation
- ruby-gems-bundler: Gem management, Bundler, dependency resolution, creating and publishing gems
- ruby-standard-library: Enumerable, File I/O, Time/Date, Regular Expressions, Arrays, Hashes, and core classes
Installation
Install via the Han marketplace:
npx @thebushidocollective/han install
Or install manually:
claude plugin marketplace add thebushidocollective/han
claude plugin install buki-ruby@han
Usage
Once installed, this buki automatically validates your Ruby code:
- When you finish a conversation with Claude Code
- When Claude Code agents complete their work
- Syntax checking ensures code is valid before completion
Requirements
- Ruby 3.0 or higher recommended
- Bundler for dependency management (when working with gems)
Skills Overview
Object-Oriented Programming
Learn Ruby's elegant OOP features:
- Classes, modules, and inheritance
- Mixins and composition patterns
- Method visibility (public, private, protected)
- Class and instance variables
- Struct and OpenStruct
Blocks, Procs, and Lambdas
Master Ruby's functional programming:
- Block syntax and yielding
- Procs vs Lambdas
- Closures and scope
- Higher-order functions
- Currying and partial application
Metaprogramming
Harness Ruby's dynamic nature:
- Dynamic method definition
- method_missing and const_missing
- Reflection and introspection
- Hook methods
- DSL creation
Gems and Bundler
Manage dependencies effectively:
- Gemfile and Bundler commands
- Creating and publishing gems
- Gemspec configuration
- Version constraints
- Private gem sources
Standard Library
Utilize Ruby's built-in power:
- Enumerable methods (map, select, reduce, etc.)
- Arrays and Hashes
- File I/O and directories
- Regular expressions
- Time and Date handling
- Ranges and Sets
Contributing
See CONTRIBUTING.md for guidelines.
License
MIT License - See LICENSE for details.
Skills
ruby-blocks-procs-lambdas
Use when working with Ruby blocks, procs, lambdas, and functional programming patterns including closures and higher-order functions.
ruby-gems-bundler
Use when working with Ruby gems, Bundler for dependency management, creating gemspecs, and publishing gems to RubyGems.
ruby-metaprogramming
Use when working with Ruby metaprogramming features including dynamic method definition, method_missing, class_eval, define_method, and reflection.
ruby-oop
Use when working with Ruby's object-oriented programming features including classes, modules, inheritance, mixins, and method visibility.
ruby-standard-library
Use when working with Ruby's standard library including Enumerable, File I/O, Time/Date, Regular Expressions, and core classes.
Hooks
Stop
Runs when the main Claude Code agent has finished responding.
npx -y @thebushidocollective/han hook run --fail-fast --dirs-with Gemfile -- ruby -cSubagentStop
Runs when a Claude Code subagent (Task tool call) has finished responding.
npx -y @thebushidocollective/han hook run --fail-fast --dirs-with Gemfile -- ruby -c