Skip to content

Install matching rolemodel-skills from generators - #208

Open
OutlawAndy wants to merge 5 commits into
masterfrom
install-agent-skills
Open

OutlawAndy wants to merge 5 commits into
masterfrom
install-agent-skills

Conversation

@OutlawAndy

@OutlawAndy OutlawAndy commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Why?

Several generators leave behind conventions that coding agents break by default. Examples: the modal pattern's 422 and no-layout rules, SoftDestroyable's ban on default scopes, and the rule that dynamic forms go through the turbo_form gem. The generators should hand the agent the matching skill along with the code. Fetching the skills at generate time means nothing gets copied into this gem, so nothing has to be kept in sync.

What Changed

  • GeneratorBase#install_skill(name): extracts skills/<name> from the rolemodel-skills main tarball into .agents/skills. The tarball is downloaded to the app's tmp/rolemodel-skills.tar.gz and reused for 10 minutes, so generators run together (e.g. turbo:all, which runs each generator in its own process) download it once. A skill that's missing upstream shows a tar error but doesn't fail the generator.
  • Skills installed: optics:base → optics-context, testing:rspec → tdd, turbo:modals → turbo-modals, turbo:form → dynamic-forms, soft_destroyable → soft-destroyable
  • Generator specs point SKILLS_ARCHIVE at a local tarball built from a file list (spec/support/helpers/skills_repo_stub.rb), so the suite makes no network calls to GitHub
  • turbo:form now installs the turbo_form gem and runs turbo_form:install, replacing the superseded turbo-form Stimulus controller, its @rails/request.js dependency, and the expect_turbo_form_request spec helper. turbo_form joins the root Gemfile's test-app gems so the installer can boot in the generator specs.
  • New soft_destroyable generator spec covering installation of nested skill files, skill-directory scoping, and the missing-skill path

Pre-merge checklist

Notes

  • Skills install to .agents/skills. Re-running a generator overwrites the installed skill without prompting.
  • Verified live against GitHub: optics-context installed with its assets/ files, after the switch to the tarball. The affected generator specs pass locally. The full suite passes locally (111 examples).

Screenshots

N/A — no UI changes

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

A critical upstream dependency is missing, and skill refresh and download behavior need correction.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Adds automatic installation of matching rolemodel-skills from generators, with local archive-backed specs and documentation updates.

Changes:

  • Adds shared tarball extraction to GeneratorBase.
  • Integrates skills into five generators.
  • Adds generator coverage and documents installed skills.

Review findings:

  • Critical: main does not yet contain turbo-modals and soft-destroyable; merge #60 or use a suitable ref.
  • Moderate: Reruns can leave stale skill files.
  • Moderate: Composite generators repeatedly download the full archive.
  • Nit: Add the frozen-string-literal comment to the new spec.
File Summary
spec/​support/​helpers/​skills_repo_stub.rb Builds local skill archives for tests.
spec/​support/​helpers.rb Configures archive stubbing.
spec/​generators/​rolemodel/​turbo/​modals_generator_spec.rb Tests modal skill installation.
spec/​generators/​rolemodel/​turbo/​form_generator_spec.rb Tests Turbo Fetch skill installation.
spec/​generators/​rolemodel/​testing/​rspec_generator_spec.rb Tests TDD skill installation.
spec/​generators/​rolemodel/​soft_destroyable_generator_spec.rb Tests nested and missing skill behavior.
README.md Documents installed agent skills.
lib/​rolemodel/​generator_base.rb Implements shared skill archive extraction.
lib/​generators/​rolemodel/​turbo/​modals/​README.md Documents the modal skill.
lib/​generators/​rolemodel/​turbo/​modals/​modals_generator.rb Installs turbo-modals.
lib/​generators/​rolemodel/​turbo/​form/​README.md Documents the Turbo Fetch skill.
lib/​generators/​rolemodel/​turbo/​form/​form_generator.rb Installs turbo-fetch.
lib/​generators/​rolemodel/​testing/​rspec/​rspec_generator.rb Installs tdd.
lib/​generators/​rolemodel/​testing/​rspec/​README.md Documents the TDD skill.
lib/​generators/​rolemodel/​soft_destroyable/​soft_destroyable_generator.rb Installs soft-destroyable.
lib/​generators/​rolemodel/​soft_destroyable/​README.md Documents the soft-destroyable skill.
lib/​generators/​rolemodel/​optics/​base/​README.md Documents the optics skill.
lib/​generators/​rolemodel/​optics/​base/​base_generator.rb Installs optics-context.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/rolemodel/generator_base.rb
Comment thread lib/rolemodel/generator_base.rb Outdated
OutlawAndy and others added 5 commits September 29, 2026 11:23
Generators that leave behind conventions an agent must follow now install the
matching skill from RoleModel/rolemodel-skills into .claude/skills.
GeneratorBase#install_skill lists the skill's files with the GitHub trees API
and downloads each with Thor's `get`, so skills are fetched fresh from `main`
and there is nothing to sync into this gem. A skill missing upstream is
reported rather than failing the generator.

- optics:base    -> optics-context
- testing:rspec  -> tdd
- turbo:modals   -> turbo-modals
- turbo:form     -> turbo-fetch
- soft_destroyable -> soft-destroyable

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Replace the GitHub trees API lookup plus per-file `get` with one
`curl | tar` that extracts the skill directory from the rolemodel-skills
tarball. No JSON parsing, no API rate limit, and nested files come along
for free.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Dynamic forms now go through the turbo_form gem instead of the
hand-wired turbo-form Stimulus controller, which rolemodel-skills marks
superseded. The generator adds the gem, runs its installer, and installs
the dynamic-forms skill that replaces turbo-fetch.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bundle_command already runs in Bundler.with_original_env.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generators invoked by an umbrella generator each run in their own
process, so each one downloaded the whole rolemodel-skills tarball.
The archive now lives in the app's tmp/ and is reused for ten minutes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants