ruby-metaprogramming-idiomatic
/ruby-metaprogramming-idiomatic
Use this skill when authoring dynamic Domain-Specific Languages (DSLs), method_missing hooks, and class macros in Ruby.
- Author
- nextboxis ↗
- Repository
- library-skill-agents ↗
- Licence
- MIT
- Last repository change
- 28.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use this skill when authoring dynamic Domain-Specific Languages (DSLs), method_missing hooks, and class macros in Ruby.
Original author description
Use this skill when authoring dynamic Domain-Specific Languages (DSLs), method_missing hooks, and class macros in Ruby.
How it works
- When to use
- Prerequisites
- Step-by-step workflow
- Commands / code examples
- Common mistakes & pitfalls
- Verification checklist
- Related skills
SKILL.md preview
---
name: ruby-metaprogramming-idiomatic
description: Use this skill when authoring dynamic Domain-Specific Languages (DSLs), method_missing hooks, and class macros in Ruby.
---
# Ruby Metaprogramming & DSL Authoring
## When to use
Use this skill when you need to authoring dynamic Domain-Specific Languages (DSLs), method_missing hooks, and class macros in Ruby.
## Prerequisites
- Working knowledge of relevant programming language or database fundamentals.
- Access to testing environment or local runtime instance.
## Step-by-step workflow
1. **Analyze operational requirements**: Review performance boundaries, data integrity constraints, and query patterns.
2. **Design schema / interface**: Define explicit data contracts, types, or indexes supporting planned operations.
3. **Implement core routines**: Construct declarative, type-safe, or parameterized queries and functions.
4. **Validate performance**: Verify execution metrics using profilers, EXPLAIN plans, or benchmark test suites.
5. **Implement defensive controls**: Enforce timeout boundaries, connection pooling limits, and transaction safety.
## Commands / code examples
```ruby
module Validatable
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def validate_presence_of(*fields)
fields.each do |field|
define_method("validate_#{field}!") do
val = send(field)
raise ArgumentError, "#{field} is missing" if val.nil? || val.to_s.strip.empty?
end
end
end
end
end
class User
include Validatable
attr_accessor :email
validate_presence_of :email
end
```
## Common mistakes & pitfalls
- Overlooking indexing strategies on foreign keys and frequently queried filter columns.
- Running unparameterized dynamic queries, creating severe SQL injection vulnerabilities.
- Holding open long-running database transactions during slow external network calls.
## Verification checklist
- [ ] Schema contracts and type signatures are strictly enforced.
- [ ] Queries are fully parameterized against injection vulnerabilities.
- [ ] Profiling or execution plans show optimal resource consumption.
- [ ] Error handling safely releases locks and rolls back aborted transactions.
## Related skills
- postgresql-query-optimization-explain
- sql-anti-patterns-remediation
- acid-transactions-isolation-levels
- secure-code-review-static-analysis-sast
Versions
The database has no other skills named ruby-metaprogramming-idiomatic.
Database snapshot: 13.11.2026 · package version 9e275230addd (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 95ruby-metaprogramming
Use when working with Ruby metaprogramming features including dynamic method definition, method_missing, class_eval, define_method, and reflection. - 90ruby-pro
Write idiomatic Ruby code with metaprogramming, Rails patterns, and performance optimization. Specializes in Ruby on Rails, gem development, and testing frameworks. Use for Ruby refactoring, optimization, or complex Ruby features. - 100ruby
Expert Ruby programming assistance covering blocks, metaprogramming, Bundler, gems, and modern Ruby 3.x features. Use when developing Rails web apps, writing CLI utilities, or managing Ruby gems. - 100ruby-guide
Ruby language guardrails, patterns, and best practices for AI-assisted development. Use when working with Ruby files (.rb), Gemfile, Rakefile, or when the user mentions Ruby. Provides block/proc patterns, metaprogramming guidelines, Bundler conventions, and testing standards… - 100ruby
This skill should be used when writing or reviewing Ruby code, or when the project uses "Ruby", "RSpec", "service objects", "Struct", "Data class", or Ruby class/module patterns. Provides Ruby coding conventions, patterns, and best practices. Project-specific conventions always take priority. - 100ruby-expert
Expert-level Ruby development with Rails, modern features, testing, and best practices. Use when the user mentions Ruby on Rails, RSpec, gem, Sinatra, or metaprogramming, or when the task involves Ruby 3+ Features, Object-Oriented, Functional Features, or Pattern Matching.