Skip to content

docs: Replace placeholder README with comprehensive API documentation#51

Open
wheeyls wants to merge 1 commit intomainfrom
docs/comprehensive-readme
Open

docs: Replace placeholder README with comprehensive API documentation#51
wheeyls wants to merge 1 commit intomainfrom
docs/comprehensive-readme

Conversation

@wheeyls
Copy link
Member

@wheeyls wheeyls commented Mar 17, 2026

Summary

The README has had TODO: Write usage instructions here since the gem was created. This replaces it with comprehensive documentation derived from reading the gem source and studying real usage patterns across 1000+ commands in the ue codebase.

What's documented

  • Defining commandsinclude Command, option, execute
  • Running commands.run (monadic result) vs .run! (unwrap-or-raise)
  • Declaring inputs — Required, optional with defaults, proc context
  • Type system — Reference table of common Types:: usage (String, Integer, Bool, Instance, Interface, enum, Coercible, optional)
  • Validations — ActiveModel validations before and during execute, errors.add
  • Composing commandscompose with automatic error propagation via Command::Interrupt
  • Input middlewareActionController::Parameters handling, key symbolization
  • API reference — Tables for class methods, instance methods, result objects
  • Complete example — End-to-end with controller and job calling patterns
  • RSpec helpercreate_outcome for stubbing in tests

All examples are derived from real patterns in production (e.g., OrganizationAdmin::FindOrCreateCompetitors for compose, Votes::Exceeded for typed options with defaults).

The README had 'TODO: Write usage instructions here' since the gem was
created. Replace with full documentation covering:

- Defining commands (include Command, option, execute)
- Running commands (.run vs .run! with monadic results)
- Declaring inputs (required, optional, defaults)
- Type system (Types::String, Types.Instance, Types::Interface, etc.)
- ActiveModel validations (before and during execute)
- Composing commands (compose with error propagation)
- Input middleware (ActionController::Parameters, symbolization)
- API reference table (class methods, instance methods, result objects)
- Complete end-to-end example with controller/job usage
- RSpec helper with stubbing patterns

All examples are derived from real usage patterns in the ue codebase.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant