rolemodel-rails 2.6.1 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54ba8996a84dfe7f2f989442444f039ebd5868a9a3f4800f800223d035f6a9d2
4
- data.tar.gz: f79e30570b359cd0dc120b514127d207348589e85eb2f06414b0938aa3cd08d6
3
+ metadata.gz: b95ac3ec58a4a00a09e5777f82d033bedf584615a874de02f32cdfcc353ef5b7
4
+ data.tar.gz: 760c16f159ed100048c949bb01e94f5ac4d4a8e46a2aa3c2d64f5f30ff6ced93
5
5
  SHA512:
6
- metadata.gz: 8b08a3d1b935ca08181f45fb948112194888325c6e60971c3c18b279b4cd8e9073dec7f01d8c26373bc9276e54b071c238fbece40ced0bb60da864f2c20b61c2
7
- data.tar.gz: 96a5ea26590b5074da86fd3059ca6bb04e49bc3bd82fd4e2b56a3f18415dd80f2a807ef31ab396f6313034394d2e90e591eb75711a50f795744d00636ca2b298
6
+ metadata.gz: c72e0e6e196fb8e5b09447cb439126d4112f76746f4f1e017d858cfa93265f2c2131a8a81b35d4181e182f79dc4c1819c76e43a114253dacc43b0a729f96645f
7
+ data.tar.gz: 865f6f41f36e2060d4328ca7756a6688c8ed886d6db9a42ba1975a1c0d0f996a36857227ac862be7e780f1938af1c8d6e8094654009cd3306dbffe9427657b3e
data/README.md CHANGED
@@ -110,6 +110,19 @@ bin/rails g
110
110
  * [Tom Select](./lib/generators/rolemodel/tom_select)
111
111
  * [Lograge](./lib/generators/rolemodel/lograge)
112
112
 
113
+ ## Agent Skills
114
+
115
+ Generators that leave behind conventions a coding agent needs to follow also install the matching skill from [RoleModel/skills](https://github.com/RoleModel/skills) with [`npx skills`](https://github.com/vercel-labs/skills), without prompting. Skills land in `.agents/skills` (read by Copilot and Codex) and are symlinked into `.claude/skills`, and `skills-lock.json` records what was installed so `npx skills update` can refresh them. If you've picked agents in the skills CLI before, generators install for those agents instead of Claude Code, GitHub Copilot, and Codex.
116
+
117
+ | Generator | Skill |
118
+ |---|---|
119
+ | `rolemodel:optics:base` | `optics-context` |
120
+ | `rolemodel:testing:rspec` | `tdd` |
121
+ | `rolemodel:turbo:modals` | `turbo-modals` |
122
+ | `rolemodel:turbo:form` | `dynamic-forms` |
123
+ | `rolemodel:soft_destroyable` | `soft-destroyable` |
124
+ | `rolemodel:core_setup` | `polymorphic-parent-resources`, `rake-tasks` |
125
+
113
126
  ## Utilities
114
127
 
115
128
  ### `Rolemodel::Utility::TaskTools`
@@ -1,5 +1,7 @@
1
1
  # Core Setup Generator
2
2
 
3
+ [USAGE](./USAGE)
4
+
3
5
  Runs the core generators every new Rails app should have. Unlike
4
6
  `rolemodel:all`, this skips the app-specific extras (React, SaaS/Devise,
5
7
  GoodJob, Kaminari, etc.) so you get just the standard baseline — a new Rails
@@ -9,21 +11,28 @@ app you can push straight to Heroku right after generation.
9
11
 
10
12
  - A freshly generated Rails app
11
13
 
14
+ ## Options
15
+
16
+ - `--material`, `--phosphor`, `--tabler`, `--feather`, `--lucide`, or `--custom`
17
+ picks the Optics icon library up front. Without one, the icons generator asks.
18
+ - `--skip-deployable` skips Heroku, Sentry, and Lograge.
19
+
12
20
  ## What you get
13
21
 
14
- - [GitHub](../github) — standard GitHub configuration
15
- - [Heroku](../heroku) — standard Heroku deployment configuration
16
- - [Readme](../readme) — standard project README
17
- - [Webpack](../webpack) — Webpack v5 for JS and CSS
18
- - [Sentry](../sentry) — error monitoring for Ruby and JavaScript
19
22
  - [Slim](../slim) — Slim templates
20
- - [Optics](../optics) — Optics design system (pass an icon library flag such as
21
- `--material` to choose it up front; otherwise the icons generator asks)
22
- - [Testing](../testing) — RSpec, FactoryBot, parallel_tests, TestProf
23
- (pass `--js-runner` to include jasmine-playwright-runner)
23
+ - [Webpack](../webpack) — Webpack v5 for JS and CSS
24
+ - [Optics](../optics) — Optics design system and icons
24
25
  - [SimpleForm](../simple_form) — SimpleForm with our configuration
25
26
  - [Tom Select](../tom_select) — Tom Select with a Stimulus controller and SimpleForm inputs
27
+ - [Testing](../testing) — RSpec, FactoryBot, parallel_tests, and TestProf
28
+ - [Turbo](../turbo) — Turbo 8 setup, confirm dialogs, modals, and dynamic forms
29
+ - [Flash](../ui_components/flash) — flash messages
30
+ - [GitHub](../github) — standard GitHub configuration
31
+ - [Readme](../readme) — standard project README
26
32
  - [Linters](../linters) — Rubocop and ESLint
27
- - [UI Components](../ui_components) — flash, the modal pattern, & Turbo 8 support
28
- - [Editors](../editors) — EditorConfig and recommended VSCode extensions
33
+ - [Heroku](../heroku) — standard Heroku deployment configuration
34
+ - [Sentry](../sentry) — error monitoring for Ruby and JavaScript
29
35
  - [Lograge](../lograge) — condensed request logging
36
+ - The [`polymorphic-parent-resources`](https://github.com/RoleModel/skills/tree/main/skills/polymorphic-parent-resources)
37
+ and [`rake-tasks`](https://github.com/RoleModel/skills/tree/main/skills/rake-tasks) agent skills for
38
+ `resource_for` and `Rolemodel::Utility::TaskTools`, installed into `.agents/skills`
@@ -1,12 +1,16 @@
1
1
  Description:
2
2
  Runs the core generators every new Rails app should have
3
3
 
4
- Sets up GitHub config, Heroku deployment, README, Webpack, Sentry, Slim,
5
- Optics, testing (RSpec & friends), SimpleForm, linters, Turbo 8+ support,
6
- and Lograge. The result is an app that is ready to push directly to Heroku.
4
+ Sets up Slim, Webpack, Optics, SimpleForm, Tom Select, testing (RSpec &
5
+ friends), Turbo, flash messages, GitHub config, README, linters, Heroku
6
+ deployment, Sentry, and Lograge. It also installs the agent skills for
7
+ resource_for and TaskTools. The result is an app that is ready to push
8
+ directly to Heroku.
7
9
 
8
- Pass --js-runner to also include jasmine-playwright-runner for browser
9
- JS testing.
10
+ Pass an icon library flag (--material, --phosphor, --tabler, --feather,
11
+ --lucide, or --custom) to choose the Optics icons up front.
12
+
13
+ Pass --skip-deployable to skip Heroku, Sentry, and Lograge.
10
14
 
11
15
  Example:
12
- rails generate rolemodel:core_setup
16
+ rails generate rolemodel:core_setup --material
@@ -6,6 +6,13 @@ module Rolemodel
6
6
 
7
7
  class_option :skip_deployable, type: :boolean, default: false, desc: 'skip generators for app deployment (Heroku, Sentry, Lograge)'
8
8
 
9
+ def install_agent_skills
10
+ say 'Installing agent skills for the rolemodel_rails utilities', :green
11
+
12
+ install_skill 'polymorphic-parent-resources'
13
+ install_skill 'rake-tasks'
14
+ end
15
+
9
16
  def run_the_core_generators
10
17
  generate 'rolemodel:slim'
11
18
  generate 'rolemodel:webpack'
@@ -7,3 +7,5 @@ rails g rolemodel:optics:all
7
7
  ## What you get
8
8
 
9
9
  The [Optics](https://docs.optics.rolemodel.design/) design system
10
+
11
+ Plus the [`optics-context`](https://github.com/RoleModel/skills/tree/main/skills/optics-context) agent skill, installed into `.agents/skills`
@@ -16,6 +16,12 @@ module Rolemodel
16
16
  @import '@rolemodel/optics/dist/css/optics';
17
17
  CSS
18
18
  end
19
+
20
+ def install_agent_skill
21
+ say 'Installing the optics-context agent skill', :green
22
+
23
+ install_skill 'optics-context'
24
+ end
19
25
  end
20
26
  end
21
27
  end
@@ -4,5 +4,6 @@
4
4
 
5
5
  * Ruby module for SoftDestroyable
6
6
  * Shared example file for testing your classes
7
+ * The [`soft-destroyable`](https://github.com/RoleModel/skills/tree/main/skills/soft-destroyable) agent skill, installed into `.agents/skills`
7
8
 
8
9
  Adds module for soft destroyable of ActiveRecord classes with configurable cascading of association data
@@ -9,5 +9,11 @@ module Rolemodel
9
9
  def add_shared_example
10
10
  copy_file 'soft_destroyable_behavior.rb', 'spec/support/shared_examples/soft_destroyable_behavior.rb'
11
11
  end
12
+
13
+ def install_agent_skill
14
+ say 'Installing the soft-destroyable agent skill', :green
15
+
16
+ install_skill 'soft-destroyable'
17
+ end
12
18
  end
13
19
  end
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## What you get
4
4
 
5
+ * The [`tdd`](https://github.com/RoleModel/skills/tree/main/skills/tdd) agent skill, installed into `.agents/skills`
6
+
5
7
  ### RSpec Default
6
8
 
7
9
  Based of rspec-rails install generator. Assume all configuration will be placed in `spec/support/*.rb`
@@ -39,6 +39,12 @@ module Rolemodel
39
39
 
40
40
  append_file '.gitignore', 'spec/examples.txt'
41
41
  end
42
+
43
+ def install_agent_skill
44
+ say 'Installing the tdd agent skill', :green
45
+
46
+ install_skill 'tdd'
47
+ end
42
48
  end
43
49
  end
44
50
  end
@@ -5,5 +5,6 @@ Enable dynamic form interactions in new/existing rails apps with the [turbo_form
5
5
  ## What you get
6
6
 
7
7
  - the `turbo_form` gem, set up by its `turbo_form:install` generator
8
+ - the [`dynamic-forms`](https://github.com/RoleModel/skills/tree/main/skills/dynamic-forms) agent skill, installed into `.agents/skills`
8
9
 
9
10
  Draw the `:turbo_form` route concern on each resource with a dynamic form. See the gem's README for usage.
@@ -8,6 +8,12 @@ module Rolemodel
8
8
 
9
9
  generate 'turbo_form:install'
10
10
  end
11
+
12
+ def install_agent_skill
13
+ say 'Installing the dynamic-forms agent skill', :green
14
+
15
+ install_skill 'dynamic-forms'
16
+ end
11
17
  end
12
18
  end
13
19
  end
@@ -11,6 +11,7 @@
11
11
 
12
12
  * RoleModel Modal pattern integration. See Notes below for usage documentation.
13
13
  * RoleModel Panel pattern integration, if run with the `--panels` flag.
14
+ * The [`turbo-modals`](https://github.com/RoleModel/skills/tree/main/skills/turbo-modals) agent skill, installed into `.agents/skills`
14
15
 
15
16
  > [!IMPORTANT]
16
17
  > This generator does not provide RoleModel Panel integration, unless run with the `--panels` flag.
@@ -55,7 +55,12 @@ module Rolemodel
55
55
 
56
56
  rails_command 'stimulus:manifest:update'
57
57
  end
58
+
59
+ def install_agent_skill
60
+ say 'Installing the turbo-modals agent skill', :green
61
+
62
+ install_skill 'turbo-modals'
63
+ end
58
64
  end
59
65
  end
60
66
  end
61
-
@@ -5,5 +5,6 @@
5
5
  ## What you get
6
6
 
7
7
  * [Flash](./flash)
8
- * [Modals](./modals)
9
8
  * [Navbar](./navbar)
9
+
10
+ Modals moved to the [Turbo modals](../turbo/modals) generator.
@@ -3,11 +3,12 @@
3
3
  require 'rails/generators'
4
4
  require 'rails/generators/bundle_helper'
5
5
  require_relative 'replace_content_helper'
6
+ require_relative 'skills_helper'
6
7
  require 'rolemodel/yarn'
7
8
 
8
9
  module Rolemodel
9
10
  class GeneratorBase < ::Rails::Generators::Base
10
- include ::Rails::Generators::BundleHelper, ReplaceContentHelper
11
+ include ::Rails::Generators::BundleHelper, ReplaceContentHelper, SkillsHelper
11
12
 
12
13
  private
13
14
 
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'json'
4
+
5
+ module Rolemodel
6
+ module SkillsHelper
7
+ SKILLS_REPO = 'RoleModel/skills'
8
+ DEFAULT_SKILL_AGENTS = %w[claude-code github-copilot codex].freeze
9
+
10
+ private
11
+
12
+ def install_skill(name)
13
+ inside('.') { run "npx -y skills@latest add #{SKILLS_REPO} --skill #{name} --agent #{skill_agents.join(' ')} -y" }
14
+ end
15
+
16
+ # Agents the user last picked in the skills CLI; it only offers them as defaults interactively.
17
+ def skill_agents
18
+ JSON.parse(File.read(skills_state_path))['lastSelectedAgents'].presence || DEFAULT_SKILL_AGENTS
19
+ rescue Errno::ENOENT, JSON::ParserError
20
+ DEFAULT_SKILL_AGENTS
21
+ end
22
+
23
+ def skills_state_path
24
+ state_home = ENV['XDG_STATE_HOME']
25
+ state_home ? File.join(state_home, 'skills/.skill-lock.json') : File.expand_path('~/.agents/.skill-lock.json')
26
+ end
27
+ end
28
+ end
@@ -62,7 +62,7 @@ module Rolemodel
62
62
  end
63
63
 
64
64
  def to_h
65
- @args.transform_values { it.to_s.strip.match?('_') ? nil : it.to_s.strip }.compact
65
+ @args.transform_values { it.to_s.strip.presence unless it.to_s.strip == '_' }.compact
66
66
  end
67
67
  end
68
68
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rolemodel
4
- VERSION = '2.6.1'
4
+ VERSION = '2.7.1'
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rolemodel
4
- NODE_VERSION = '24.12.0'
4
+ NODE_VERSION = '26.13.0'
5
5
 
6
6
  GEM_LIB = File.expand_path(__dir__)
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rolemodel-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - RoleModel Software Inc
@@ -460,6 +460,7 @@ files:
460
460
  - lib/rolemodel/optics/tabler_icon_builder.rb
461
461
  - lib/rolemodel/replace_content_helper.rb
462
462
  - lib/rolemodel/resource_for/controller_extension.rb
463
+ - lib/rolemodel/skills_helper.rb
463
464
  - lib/rolemodel/utility.rb
464
465
  - lib/rolemodel/utility/task_tools.rb
465
466
  - lib/rolemodel/version.rb