coding-ruby

Installation
SKILL.md

coding-ruby

Purpose

This skill allows the AI to generate, debug, and optimize Ruby 3.x code, focusing on advanced constructs like blocks, procs, lambdas, metaprogramming, modules, gem management with Bundler, Rails web apps, and RSpec testing.

When to Use

Use this skill for tasks involving Ruby scripting, such as building web applications with Rails, managing dependencies via Bundler, writing unit tests with RSpec, or applying metaprogramming for dynamic code generation. Apply it when users request code for e-commerce sites, API backends, or custom gems.

Key Capabilities

  • Handle blocks and procs: Define and yield blocks in methods, e.g., for iterators.
  • Implement metaprogramming: Use define_method or method_missing for dynamic class creation.
  • Manage modules: Create and include modules for namespacing, like module MyModule; end.
  • Work with Bundler: Install and manage gems via Gemfiles for dependency resolution.
  • Build Rails apps: Generate models, controllers, and routes for MVC architecture.
  • Write RSpec tests: Create specs for behavior-driven development, including matchers and mocks.

Usage Patterns

To accomplish tasks, structure code with Ruby's idioms: use procs for callbacks, modules for reusable code, and metaprogramming for automation. For Rails, follow the MVC pattern; for RSpec, use describe/it blocks. Always check Ruby 3.x syntax, like pattern matching with case statements. To define a lambda: my_lambda = ->(x) { x * 2 }. Invoke it as my_lambda.call(5). For metaprogramming, add methods dynamically: class MyClass; define_method(:greet) { puts 'Hello' }; end. Integrate Bundler by running bundle install after editing Gemfiles.

Related skills
Installs
22
GitHub Stars
5
First Seen
Mar 5, 2026