Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .claude/skills/ruby-ui-stimulus/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Building or changing a Stimulus-backed component:
- Importmap apps eager-load `controllers/` — no manifest edit needed.
- esbuild/webpack apps regenerate the manifest with
`rake stimulus:manifest:update` (`docs/app/javascript/controllers/index.js`).
- `docs/app/javascript/controllers/ruby_ui/<component>_controller.js` is a
symlink to the gem file above, not a copy. For a brand-new controller, run
`bin/rails ruby_ui:sync_controller_symlinks` in `docs/` first to create the
symlink, then `stimulus:manifest:update` to register it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The command stimulus:manifest:update is missing its rake or bin/rails prefix, so a developer following these steps verbatim would get a shell error. The earlier bullet in the same section uses rake stimulus:manifest:update — the new instruction should follow that format for consistency.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .claude/skills/ruby-ui-stimulus/SKILL.md, line 47:

<comment>The command `stimulus:manifest:update` is missing its `rake` or `bin/rails` prefix, so a developer following these steps verbatim would get a shell error. The earlier bullet in the same section uses `rake stimulus:manifest:update` — the new instruction should follow that format for consistency.</comment>

<file context>
@@ -41,6 +41,10 @@ Building or changing a Stimulus-backed component:
+   - `docs/app/javascript/controllers/ruby_ui/<component>_controller.js` is a
+     symlink to the gem file above, not a copy. For a brand-new controller, run
+     `bin/rails ruby_ui:sync_controller_symlinks` in `docs/` first to create the
+     symlink, then `stimulus:manifest:update` to register it.
    - New JS packages go in `gem/package.json` **and** per-component in
      `gem/lib/generators/ruby_ui/dependencies.yml`.
</file context>
Suggested change
symlink, then `stimulus:manifest:update` to register it.
symlink, then `rake stimulus:manifest:update` to register it.

- New JS packages go in `gem/package.json` **and** per-component in
`gem/lib/generators/ruby_ui/dependencies.yml`.
5. **Update docs & tests** in the same PR: `<component>_docs.rb` and
Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Subproject-specific instructions live in `gem/AGENTS.md` and `docs/CLAUDE.md` (
- 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/`.
- A component's Stimulus controller lives only in `gem/lib/ruby_ui/<component>/<component>_controller.js`. `docs/app/javascript/controllers/ruby_ui/<component>_controller.js` is a symlink to it, not a copy — editing the gem file is enough for existing components. A brand-new component's controller needs `docs`' `rake ruby_ui:sync_controller_symlinks` to create the symlink, plus `bin/rails stimulus:manifest:update` to register it.

## Common commands

Expand Down
13 changes: 13 additions & 0 deletions docs/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,16 @@ bin/rails site_files:generate
```

Before finishing, review the diff for `public/llms.txt`, `public/llms-full.txt`, and `public/sitemap.xml`. These generated files should be committed with the route/controller/view change so deployed apps expose the updated root files without a manual step.

## Stimulus Controllers

`app/javascript/controllers/ruby_ui/*_controller.js` are symlinks into `gem/lib/ruby_ui/<component>/`, not copies — there is no independent docs version to keep in sync.

Adding a brand-new component's controller:

```bash
bin/rails ruby_ui:sync_controller_symlinks # creates the missing symlink(s)
bin/rails stimulus:manifest:update # registers it in controllers/index.js
```

`sync_controller_symlinks` (in `lib/tasks/ruby_ui.rake`) is idempotent — safe to re-run any time. It only creates/repairs symlinks; it does not touch the manifest, so `stimulus:manifest:update` is still a separate required step for a controller the manifest hasn't seen yet.
97 changes: 0 additions & 97 deletions docs/app/javascript/controllers/ruby_ui/accordion_controller.js

This file was deleted.

This file was deleted.

29 changes: 0 additions & 29 deletions docs/app/javascript/controllers/ruby_ui/avatar_controller.js

This file was deleted.

Loading