cmdx-ruby

Build composable Ruby command objects with the CERO pattern.

15|Updated Mar 3, 2025
One-click install
npx skills add https://github.com/drexed/cmdx --skill cmdx-ruby
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cmdx-ruby
Source: https://github.com/drexed/cmdx/tree/main/docs
Command: npx skills add https://github.com/drexed/cmdx --skill cmdx-ruby

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation of robust, maintainable business logic in Ruby applications, moving complex operations out of controllers and models into dedicated, testable units.

Core Features & Use Cases

  • Composable Tasks: Build single-responsibility operations that can be chained into complex workflows.
  • Type Safety & Validation: Declare inputs with strict types, coercions, and validations to ensure data integrity.
  • Observability: Automatic structured logging with chain correlation IDs for easy debugging and tracing.
  • Use Case: Develop a ProcessPayment task that validates input, charges a credit card via an external API, handles potential network errors with retries, and logs the entire operation, all within a single, testable unit.

Quick Start

Use the cmdx-ruby skill to create a new task named 'ProcessPayment'.

Frequently Asked Questions about cmdx-ruby

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure complex Ruby business logic in service objects?

You can build composable Ruby service objects using the CERO pattern, moving complex operations out of controllers and models into dedicated, testable units. This pattern provides typed attributes, validation, and control flow methods for predictable execution.

What is the best way to chain multi-step operations in Ruby workflows?

Chaining multi-step operations in Ruby workflows is handled through composable command objects. This approach provides control flow methods like fail!, skip!, and throw!, along with callbacks, to orchestrate complex sequences predictably.

How do I add observability and tracing to Ruby service objects?

Observability is built directly into Ruby service objects via automatic structured logging with chain correlation IDs. This provides easy debugging and tracing across multi-step operations without requiring external tracking setup.

Does this Ruby command pattern framework work with Rails?

Yes, the framework supports Rails integration while also remaining framework-agnostic. You can use it to create interactors and command patterns within Rails applications or in standalone Ruby environments.

How do I validate inputs and enforce type safety in Ruby interactors?

Ruby interactors enforce type safety by declaring inputs with strict types and coercions. Built-in validation ensures data integrity before the business logic executes, preventing unexpected type errors.

Why move business logic out of Rails controllers and models?

Moving business logic into dedicated command objects streamlines the creation of robust, maintainable code. It isolates complex operations into single-responsibility units that are independently testable and reusable across workflows.