Guidance for AI agents working at the root of the ruby-ui/ruby_ui monorepo.
Two sibling projects, each independent (own Gemfile, package.json, tests, lockfiles):
| Path | What it is |
|---|---|
gem/ |
The ruby_ui gem — Phlex components, generators, gemspec, Minitest suite. Published to RubyGems from here. |
docs/ |
Rails 8 app powering https://rubyui.com. Consumes the local gem via path: "../gem". |
.github/workflows/ci.yml |
Unified CI: gem tests (Ruby 3.3 + 3.4), docs Rails tests, docker build for docs devcontainer. |
Subproject-specific instructions live in gem/AGENTS.md and docs/CLAUDE.md (→ docs/AGENTS.md). Read those before editing inside a subdir.
- Component code →
gem/lib/ruby_ui/<component>/. Tests →gem/test/ruby_ui/<component>_test.rb. - Component docs view →
docs/app/views/docs/<component>.rb. Update in same PR as the component. - Generator/installer logic →
gem/lib/generators/ruby_ui/. Dependency map →gem/lib/generators/ruby_ui/dependencies.yml. - Site chrome, routes, marketing pages →
docs/app/.
Run from the relevant subdir, not root.
# Gem
cd gem
bundle exec rake # tests + standardrb
bundle exec rake test TEST=test/ruby_ui/button_test.rb
bundle exec standardrb --fix
# Docs site
cd docs
bin/setup
bin/dev # local server
pnpm build && pnpm build:css # assets
bin/rails db:test:prepare test
bundle exec standardrb- Ruby 3.2+, 2-space indent,
snake_casefiles/methods,CamelCaseclasses. StandardRB enforced. - Components extend
RubyUI::Base < Phlex::HTML; classes merged viatailwind_merge. Invoke asRubyUI.<Name>()(Phlex::Kit). - Stimulus controllers colocated with components:
<component>_controller.js. JS deps declared ingem/package.jsonand per-component independencies.yml. - Tests extend
ComponentTest; render viaphlex { ... }helper.
- Bracketed prefixes (
[Feature],[Bug Fix],[Documentation]) or scoped conventional (feat(scope): ...). - Imperative, focused commits. Reference issues/PRs as
(#123). - PRs: linked issue, concise description, before/after screenshots for UI changes, explicit test steps.
- Don't run commands from repo root expecting them to work —
cd gemorcd docsfirst. - Don't edit a component without updating its
docs/app/views/docs/<component>.rbcounterpart. - Don't bump the gem version or release from
docs/; releases happen ingem/. - Don't commit secrets; each app uses local env config.