Ruby
v1.9.0Advanced Ruby skills for object-oriented programming, metaprogramming, blocks, and gems.
Installation
Install han binary (required for hooks to work):
curl -fsSL https://han.guru/install.sh | bashThen install this plugin:
han plugin install jutsu-rubyOverview
Advanced Ruby programming skills covering object-oriented programming, metaprogramming, blocks, closures, gems, and the standard library.
What This Jutsu 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 jutsu 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 with npx (no installation required):
han plugin install jutsu-ruby
Usage
Once installed, this jutsu 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
Token Usage Notice
Hooks run automatically during Claude Code sessions and their output is sent to the model for processing. This may increase token usage and associated costs. Consider disabling hooks you don't need via han-config.yml.
Stop
Runs when the main Claude Code agent has finished responding. Can verify task completion, check quality gates, or ensure documentation requirements are met before the session ends.
SubagentStop
Runs when a Claude Code subagent (Task tool call) has finished responding. Can validate subagent outputs, enforce quality standards, or trigger additional workflows after delegated tasks complete.