Skip to content

Install matching rolemodel-skills from generators - #208

Merged
OutlawAndy merged 2 commits into
masterfrom
install-agent-skills
Nov 4, 2026
Merged

OutlawAndy merged 2 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
  • New soft_destroyable generator spec covering installation of nested skill files, skill-directory scoping, and the missing-skill path

Pre-merge checklist

Notes

  • Stacked on Install the turbo_form gem from the turbo:form generator #214, which switches turbo:form to the turbo_form gem. This PR keeps the agent-skill installation, including dynamic-forms for turbo:form.
  • 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 Resolved
Comment thread lib/rolemodel/generator_base.rb Resolved
@OutlawAndy
OutlawAndy force-pushed the install-agent-skills branch from eb28648 to 443269b Compare October 12, 2026 18:20
@OutlawAndy
OutlawAndy changed the base branch from master to turbo-form-gem October 12, 2026 18:21
@OutlawAndy
OutlawAndy force-pushed the install-agent-skills branch from 443269b to d2b4f15 Compare October 18, 2026 18:00
@OutlawAndy
OutlawAndy changed the base branch from turbo-form-gem to master October 18, 2026 18:01
Comment thread lib/rolemodel/generator_base.rb Resolved
Generators that leave conventions behind now hand the agent the matching
skill. GeneratorBase#install_skill extracts skills/<name> from the
rolemodel-skills tarball into .agents/skills, caching the archive for
generators run together. Specs build a local tarball, so they make no
network calls.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@OutlawAndy
OutlawAndy force-pushed the install-agent-skills branch from d2b4f15 to d7caf7a Compare November 4, 2026 16:22
The tarball download only wrote .agents/skills, so Claude Code never saw
the skills. `npx skills add` runs unattended with --skill, --agent, and -y,
puts the files in .agents/skills for Copilot and Codex, symlinks them into
.claude/skills, and records them in skills-lock.json so `npx skills update`
can refresh them. Each generator installs its own skill, so the shared
archive cache goes away.

Generators install for the agents the user last picked in the skills CLI,
falling back to Claude Code, GitHub Copilot, and Codex. The CLI only uses
that list as interactive defaults, so SkillsHelper reads it directly.

Specs put a fake npx on PATH and point XDG_STATE_HOME at a temp dir, so
they make no network calls and ignore the developer's own CLI state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OutlawAndy
OutlawAndy merged commit 8a8e12c into master Nov 4, 2026
2 checks passed
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.

3 participants