rolemodel-rails 2.6.1 → 2.7.0

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: 30fe14227c2e8b6871de0ae74dd94bb58a204fd1d1db523cbd34c006f81b3d08
4
+ data.tar.gz: 03c31aa3406bb87521c205bfe4e60a21834710e81a6bc40672291bf5ce7760dd
5
5
  SHA512:
6
- metadata.gz: 8b08a3d1b935ca08181f45fb948112194888325c6e60971c3c18b279b4cd8e9073dec7f01d8c26373bc9276e54b071c238fbece40ced0bb60da864f2c20b61c2
7
- data.tar.gz: 96a5ea26590b5074da86fd3059ca6bb04e49bc3bd82fd4e2b56a3f18415dd80f2a807ef31ab396f6313034394d2e90e591eb75711a50f795744d00636ca2b298
6
+ metadata.gz: 02b574434c6cd1ecc72ed48a8b64205a5ac3430a708eabaf1529f2cd49261ec6bf15257af4e04c06cf7eb21331e674cdba104ee3f3ebe2c2692bcd2b614968c1
7
+ data.tar.gz: 331e633f75a0b959c76a81d082f9a3f983a09838d5ff29258e544271e2ff98302bee2bace098c6f409136247bb6f7a248a1cacb433f34a046a2ec1fb798640dd
data/README.md CHANGED
@@ -110,6 +110,18 @@ 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
+
113
125
  ## Utilities
114
126
 
115
127
  ### `Rolemodel::Utility::TaskTools`
@@ -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
-
@@ -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
@@ -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.0'
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.0
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