rolemodel-rails 2.8.0 → 2.9.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 +4 -4
- data/README.md +2 -1
- data/lib/generators/rolemodel/README.md +1 -0
- data/lib/generators/rolemodel/agent_docs/README.md +14 -0
- data/lib/generators/rolemodel/agent_docs/USAGE +10 -0
- data/lib/generators/rolemodel/agent_docs/agent_docs_generator.rb +22 -0
- data/lib/generators/rolemodel/agent_docs/templates/.claude/settings.json +15 -0
- data/lib/generators/rolemodel/agent_docs/templates/.github/instructions/conventions.instructions.md +9 -0
- data/lib/generators/rolemodel/agent_docs/templates/AGENTS.md.tt +26 -0
- data/lib/generators/rolemodel/agent_docs/templates/CLAUDE.md +1 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/CONVENTIONS.md +18 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/callbacks.md +5 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/controllers.md +3 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/eager-loading.md +5 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/logic-in-models.md +7 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/migrations.md +7 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/no-sql-strings.md +11 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/partial-locals.md +3 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/reproduce-the-bug.md +5 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/reuse-scopes.md +3 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/stimulus.md +3 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/string-enums.md +3 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/system-spec-assertions.md +17 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/test-layers.md +3 -0
- data/lib/generators/rolemodel/agent_docs/templates/docs/conventions/views-and-forms.md +9 -0
- data/lib/generators/rolemodel/all_generator.rb +1 -0
- data/lib/generators/rolemodel/core_setup/README.md +3 -0
- data/lib/generators/rolemodel/core_setup/USAGE +4 -4
- data/lib/generators/rolemodel/core_setup/core_setup_generator.rb +3 -1
- data/lib/generators/rolemodel/linters/rubocop/templates/.rubocop.yml +17 -0
- data/lib/rolemodel/engine.rb +2 -0
- data/lib/rolemodel/version.rb +1 -1
- metadata +23 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 63e3a9bfa6cc68d95d3369e5647f9bae6b11e2947083dd8003c2ad86a1db0c89
|
|
4
|
+
data.tar.gz: 29deaf547ab04ea0bae3ff14a8c83079a95c9e1fc5d7f5d2ffe785fa23b62477
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a9a30907245726ad02faff24a72d53931ad607671f4e750d92dcb4f9a35bc89f6bb6c76394e2adf5ef222b1891094d89ca4ba196859897c5d218c95aee27f176
|
|
7
|
+
data.tar.gz: 824b4870b4b0199527fcd17de1bb6be2159c885b211c8315d85d020f0734ca91a33251551ed307ad6cc5d467c8104a285edf966829b3a351769e0d9a7d7dc0e9
|
data/README.md
CHANGED
|
@@ -77,6 +77,7 @@ bin/rails g
|
|
|
77
77
|
## Generators
|
|
78
78
|
|
|
79
79
|
* [Core Setup](./lib/generators/rolemodel/core_setup)
|
|
80
|
+
* [Agent Docs](./lib/generators/rolemodel/agent_docs)
|
|
80
81
|
* [Github](./lib/generators/rolemodel/github)
|
|
81
82
|
* [Heroku](./lib/generators/rolemodel/heroku)
|
|
82
83
|
* [Readme](./lib/generators/rolemodel/readme)
|
|
@@ -129,7 +130,7 @@ Generators that leave behind conventions a coding agent needs to follow also ins
|
|
|
129
130
|
| `rolemodel:turbo:modals` | `turbo-modals` |
|
|
130
131
|
| `rolemodel:turbo:form` | `dynamic-forms` |
|
|
131
132
|
| `rolemodel:soft_destroyable` | `soft-destroyable` |
|
|
132
|
-
| `rolemodel:core_setup` | `polymorphic-parent-resources`, `rake-tasks` |
|
|
133
|
+
| `rolemodel:core_setup` | `controller-patterns`, `polymorphic-parent-resources`, `rake-tasks` |
|
|
133
134
|
|
|
134
135
|
## Utilities
|
|
135
136
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Agent Docs Generator
|
|
2
|
+
|
|
3
|
+
[USAGE](./USAGE)
|
|
4
|
+
|
|
5
|
+
The agent instructions and conventions a new RoleModel app starts with. `rolemodel:core_setup` runs it.
|
|
6
|
+
|
|
7
|
+
## What you get
|
|
8
|
+
|
|
9
|
+
- `AGENTS.md`, with `CLAUDE.md` pointing at it. Fill in its first sentence: what the app is, and the one fact that changes how every task in it is approached.
|
|
10
|
+
- `docs/CONVENTIONS.md`, an index of the files in `docs/conventions/`. Each entry carries a `<!-- paths: -->` glob naming the files it applies to.
|
|
11
|
+
- `.github/instructions/conventions.instructions.md`, which points Copilot (including code review) at the same conventions.
|
|
12
|
+
- `.claude/hooks/surface_conventions.rb`, registered in `.claude/settings.json`. Before Claude Code edits a file, the hook lists the conventions whose globs match it. It's downloaded from the [`scaffold-docs`](https://github.com/RoleModel/skills/tree/main/skills/scaffold-docs) skill, so there's one copy to maintain, and it needs Ruby on the `PATH`.
|
|
13
|
+
|
|
14
|
+
The conventions assume the stack `core_setup` installs (Slim, SimpleForm, Optics, Turbo, RSpec with Playwright) and the [`controller-patterns`](https://github.com/RoleModel/skills/tree/main/skills/controller-patterns) skill. For an existing app, use the `scaffold-docs` and `generate-conventions` skills instead.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Description:
|
|
2
|
+
Adds AGENTS.md and RoleModel's starting conventions for a new app
|
|
3
|
+
|
|
4
|
+
Writes AGENTS.md (with CLAUDE.md pointing at it), docs/CONVENTIONS.md and
|
|
5
|
+
the convention files it indexes, and Copilot instructions that point at
|
|
6
|
+
them. It also installs the surface_conventions hook from RoleModel/skills,
|
|
7
|
+
which shows Claude Code the conventions that apply to each file it edits.
|
|
8
|
+
|
|
9
|
+
Example:
|
|
10
|
+
rails generate rolemodel:agent_docs
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Rolemodel
|
|
2
|
+
class AgentDocsGenerator < GeneratorBase
|
|
3
|
+
HOOK_URL = 'https://raw.githubusercontent.com/RoleModel/skills/main/skills/scaffold-docs/assets/surface_conventions.rb'.freeze
|
|
4
|
+
|
|
5
|
+
source_root File.expand_path('templates', __dir__)
|
|
6
|
+
|
|
7
|
+
def install_docs
|
|
8
|
+
directory '.', '.'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def install_hook
|
|
12
|
+
get HOOK_URL, '.claude/hooks/surface_conventions.rb'
|
|
13
|
+
chmod '.claude/hooks/surface_conventions.rb', 0o755
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def project_name
|
|
19
|
+
Rails.application.class.module_parent_name.titleize
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
data/lib/generators/rolemodel/agent_docs/templates/.github/instructions/conventions.instructions.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: "app/**/*,spec/**/*,db/migrate/**/*,lib/**/*,config/**/*"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Conventions
|
|
6
|
+
|
|
7
|
+
`docs/CONVENTIONS.md` is the source of truth for this repo's conventions. Each entry carries a `<!-- paths: ... -->` comment naming the files it applies to. Read the convention files whose paths match what you're changing, and follow what they say — not the one-line index summary.
|
|
8
|
+
|
|
9
|
+
The branch name or PR title carries a ticket ID like `ABC-123`. Whenever the `linear` MCP server is connected, fetch that issue with `linear-get_issue` and read its description and acceptance criteria before writing or reviewing code — every time, not only when something looks off. Flag changes that contradict the ticket and requirements the diff doesn't address. No ID, or no server: work against these conventions alone and don't block on it.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# <%= project_name %>
|
|
2
|
+
|
|
3
|
+
<One sentence: what this app is, plus the one fact that changes how every task in it is approached.>
|
|
4
|
+
|
|
5
|
+
## How We Build
|
|
6
|
+
|
|
7
|
+
- Deliver the smallest change that adds value. Speculative complexity makes the next change harder, so never pre-solve a hypothetical case; flag real uncertainty in one line and move on.
|
|
8
|
+
- Make the change easy, then make the easy change. When extending something, ask whether it's still the right shape, and reshape it first if not.
|
|
9
|
+
- Think like a Rubyist: prefer polymorphism to conditionals, and Rails conventions to custom machinery.
|
|
10
|
+
- Fix root causes, never symptoms. When reusing a method exposes a bug, fix that method rather than writing a near-copy around it.
|
|
11
|
+
- Testability is a code virtue: write code that looks test-first even when it wasn't. Test behavior, not implementation, and don't over-constrain.
|
|
12
|
+
- Prefer a clearer name or an extracted method to a comment.
|
|
13
|
+
|
|
14
|
+
## Before Editing
|
|
15
|
+
|
|
16
|
+
- Read `docs/CONVENTIONS.md`, then the convention files relevant to the task.
|
|
17
|
+
- No new gems, top-level directories, base classes, or JS libraries without asking. If no existing pattern fits, stop and say so.
|
|
18
|
+
- Keep changes minimal and focused; preserve unrelated work in a dirty tree.
|
|
19
|
+
- Write a focused failing test before implementing feature behavior.
|
|
20
|
+
|
|
21
|
+
## Verification
|
|
22
|
+
|
|
23
|
+
- `bin/setup` once per checkout; `bin/dev` to run the app.
|
|
24
|
+
- `bundle exec rspec spec/path/to_spec.rb` for the specs your change touches. CI runs the full suite; don't run it locally.
|
|
25
|
+
- `bundle exec rubocop -a`
|
|
26
|
+
- `yarn eslint`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Conventions
|
|
2
|
+
|
|
3
|
+
Read the entries below, then the files relevant to the task.
|
|
4
|
+
|
|
5
|
+
- [Controllers follow the controller-patterns skill](conventions/controllers.md) — load the skill before writing a controller or route; no custom actions. <!-- paths: app/controllers/**/*.rb, config/routes.rb -->
|
|
6
|
+
- [Logic lives in models](conventions/logic-in-models.md) — models, POROs and form objects; app/services only for external boundaries; jobs call one method. <!-- paths: app/controllers/**/*.rb, app/jobs/**/*.rb, app/models/**/*.rb, app/forms/**/*.rb, app/services/**/*.rb -->
|
|
7
|
+
- [Callbacks stay guarded](conventions/callbacks.md) — the record, its siblings, or a Turbo refresh; guarded state-transition jobs; never mail or API calls. <!-- paths: app/models/**/*.rb -->
|
|
8
|
+
- [String-backed enums, referenced by key](conventions/string-enums.md) — explicit string values, never a magic string. <!-- paths: app/models/**/*.rb, db/migrate/*.rb, spec/factories/**/*.rb -->
|
|
9
|
+
- [Queries live in model scopes](conventions/reuse-scopes.md) — named scopes, no order/where/group_by in templates. <!-- paths: app/controllers/**/*.rb, app/jobs/**/*.rb, app/models/**/*.rb, app/views/**/*.slim -->
|
|
10
|
+
- [No SQL strings in queries](conventions/no-sql-strings.md) — hashes, ranges, association joins, in_order_of; Arel only as a last resort. <!-- paths: app/**/*.rb, lib/**/*.rb, spec/**/*.rb -->
|
|
11
|
+
- [Eager load in the query that feeds the view](conventions/eager-loading.md) — includes up front; includes plus joins becomes eager_load. <!-- paths: app/controllers/**/*.rb, app/models/**/*.rb, app/jobs/**/*.rb, app/views/**/*.slim -->
|
|
12
|
+
- [Views are Slim; forms are simple_form](conventions/views-and-forms.md) — Slim, simple_form and app/inputs, render records by to_partial_path, shared partials in app/views/application, Optics. <!-- paths: app/views/**/*.slim, app/inputs/**/*.rb, app/helpers/**/*.rb, app/assets/stylesheets/**/*.css -->
|
|
13
|
+
- [Partials declare their locals](conventions/partial-locals.md) — locals on the first line; never an instance variable. <!-- paths: app/views/**/_*.slim -->
|
|
14
|
+
- [Reach for Turbo before Stimulus](conventions/stimulus.md) — TurboForm and Turbo refreshes first; Stimulus only for browser-only interactions. <!-- paths: app/javascript/**/*.js, app/views/**/*.slim -->
|
|
15
|
+
- [Generate migrations; never renumber one](conventions/migrations.md) — generator timestamps, data__ migrations with their own models, schema.rb column order. <!-- paths: db/migrate/*.rb, db/schema.rb -->
|
|
16
|
+
- [Test layers](conventions/test-layers.md) — system specs for flows, request specs for page-less endpoints, no controller specs. <!-- paths: spec/**/*.rb -->
|
|
17
|
+
- [A fix ships with the spec that proves it](conventions/reproduce-the-bug.md) — failing-first specs with factories; don't stub the app's own models. <!-- paths: spec/**/*.rb -->
|
|
18
|
+
- [System specs assert what a user sees](conventions/system-spec-assertions.md) — labels and text for targets, data_test for scoping, flash for success. <!-- paths: spec/system/**/*.rb, app/views/**/*.slim -->
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Callbacks stay guarded
|
|
2
|
+
|
|
3
|
+
A callback derives the record's own attributes, keeps its siblings consistent, or broadcasts a Turbo refresh. It may enqueue a job for a specific state transition, but only behind a guard like `if: -> { saved_change_to_status?(to: 'closed') }`. A callback never sends mail or calls an external API directly.
|
|
4
|
+
|
|
5
|
+
An unguarded side effect runs on every save path, including factories, imports, and the console.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Eager load in the query that feeds the view
|
|
2
|
+
|
|
3
|
+
Load the associations a view or job walks with `includes` in the query that fetches the records, not with per-row lookups.
|
|
4
|
+
|
|
5
|
+
`includes` silently turns into one large joined `eager_load` when the same association is also joined or filtered on.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Logic lives in models
|
|
2
|
+
|
|
3
|
+
Put a business rule or state transition in a named model method, or in a PORO under `app/models/`. Put input spanning several records in a form object in `app/forms/` that includes `ActiveModel::Model` and `ActiveModel::Attributes`.
|
|
4
|
+
|
|
5
|
+
`app/services/` is for boundaries with the outside world (third-party APIs, uploads, webhook consumers). Don't add a service for domain logic.
|
|
6
|
+
|
|
7
|
+
A controller holds control flow only (see the controller-patterns skill). A job loads its records and calls one model method.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Generate migrations; never renumber one
|
|
2
|
+
|
|
3
|
+
Create a migration with `bin/rails generate migration`, never by hand-writing the timestamp: round `...0000` versions collide. The `schema_migrations` table tracks applied migrations by their timestamp prefix alone, so never change a committed migration's timestamp.
|
|
4
|
+
|
|
5
|
+
Generate a migration that changes data as `bin/rails generate migration data__<short_description>`, so data migrations stand apart from schema changes in `db/migrate/`. It declares its own models, so later changes to the app's models can't change what it does. Name each after its table and inherit from `ActiveRecord::Base`: `class Issue < ActiveRecord::Base; end`. A table with a `type` column also needs `self.inheritance_column = nil`. Back-fill with one `update_all` per distinct value rather than one per row.
|
|
6
|
+
|
|
7
|
+
`db/schema.rb` dumps columns in the local database's physical order. Before committing it, check that no column moved without a migration causing it; order follows the order migrations landed on the default branch.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# No SQL strings in queries
|
|
2
|
+
|
|
3
|
+
Build queries from ActiveRecord, never from SQL string fragments. That rules out `select('...')`, `order('...')`, `pluck('...')`, `joins('...')`, `group('...')`, `where('start_date < ?', date)`, string `update_all`, and `Arel.sql(...)`.
|
|
4
|
+
|
|
5
|
+
Use instead:
|
|
6
|
+
|
|
7
|
+
- Hash conditions and open-ended ranges: `where(start_date: ...date)`, `where(archived_at: nil)`.
|
|
8
|
+
- Association joins and nested hashes: `joins(:team).order(teams: { name: :asc })`.
|
|
9
|
+
- `in_order_of(:status, %w[active pending archived])` for a custom sort order.
|
|
10
|
+
|
|
11
|
+
If a query seems to need raw SQL (a JSONB `->>` lookup, Postgres `DISTINCT ON`, `NULLS LAST`), redesign it: store the value in a real column, or narrow the rows with a scope and pick in Ruby. An Arel node is the last resort, and worth a note in the PR.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Reach for Turbo before Stimulus
|
|
2
|
+
|
|
3
|
+
Dynamic page behavior is server-rendered: a dependent or conditional form uses TurboForm (the `dynamic-forms` skill), and a page that changes after an action redirects and morphs with a Turbo refresh. Stimulus is for interactions only the browser can do (drag-and-drop, Tom Select), using the controllers the gem's generators install. No inline JavaScript in templates. A new Stimulus controller is a question to raise in the PR.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# System specs assert what a user sees
|
|
2
|
+
|
|
3
|
+
Select by what the user sees, never by CSS class or DOM structure:
|
|
4
|
+
|
|
5
|
+
- Click targets and form fields by their visible text or label: `click_on "Yes, I'm Sure"`, `fill_in 'Name', with: 'Bob'`. A field without a label uses its name attribute: `fill_in 'user[name]', with: 'Bob'`.
|
|
6
|
+
- Scope to one part of the page with a `data-testid` from `dom_id`, and select it with the `data_test` helper:
|
|
7
|
+
|
|
8
|
+
```slim
|
|
9
|
+
tr data-testid=dom_id(widget)
|
|
10
|
+
td = link_to 'Edit', edit_widget_path(widget)
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
within(data_test(widget)) { click_on 'Edit' }
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
End every interaction with an assertion on its visible result. For a create, update or destroy, that's usually the flash message: `expect(page).to have_content 'Successfully Created Widget'`.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Test layers
|
|
2
|
+
|
|
3
|
+
Cover a user flow with a system spec on the default `rack_test` driver, and add `js: true` (Playwright) only when the behavior needs JavaScript. Cover an endpoint with no page of its own (a webhook, a turbo_stream or JSON endpoint) with a request spec in `spec/requests/`. Don't write controller specs. Unit-test logic in the model that holds it, and policies in `spec/policies/`.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Views are Slim; forms are simple_form
|
|
2
|
+
|
|
3
|
+
Templates are Slim. Build every form with `simple_form_for`, `simple_fields_for` for nested attributes, and `f.association` for `belongs_to` selects. Reach for the custom inputs in `app/inputs/` before adding one.
|
|
4
|
+
|
|
5
|
+
Every input option earns its place: drop options that restate a default. A `label_method` repeated across forms becomes `to_label` on the model; an option every input of a type needs becomes a custom input or wrapper.
|
|
6
|
+
|
|
7
|
+
Render records with `render @widget` or `render @widgets`, which find the partial through `to_partial_path`. Name a partial only when no record owns it.
|
|
8
|
+
|
|
9
|
+
Shared partials live in `app/views/application/`, the fallback lookup path for a bare `render`, never in `app/views/shared/`. Check there and in `app/helpers/` for an existing partial or helper before writing a new one. Style with Optics classes and tokens (the `optics-context` skill), not one-off CSS.
|
|
@@ -20,6 +20,7 @@ module Rolemodel
|
|
|
20
20
|
generate 'rolemodel:saas:all'
|
|
21
21
|
generate 'rolemodel:mailers'
|
|
22
22
|
generate 'rolemodel:linters:all'
|
|
23
|
+
generate 'rolemodel:agent_docs'
|
|
23
24
|
generate 'rolemodel:ui_components:all'
|
|
24
25
|
generate 'rolemodel:source_map'
|
|
25
26
|
generate 'rolemodel:good_job'
|
|
@@ -31,9 +31,12 @@ app you can push straight to Heroku right after generation.
|
|
|
31
31
|
- [GitHub](../github) — standard GitHub configuration
|
|
32
32
|
- [Readme](../readme) — standard project README
|
|
33
33
|
- [Linters](../linters) — Rubocop and ESLint
|
|
34
|
+
- [Agent Docs](../agent_docs) — `AGENTS.md`, conventions, and the hook that surfaces them
|
|
34
35
|
- [Heroku](../heroku) — standard Heroku deployment configuration
|
|
35
36
|
- [Sentry](../sentry) — error monitoring for Ruby and JavaScript
|
|
36
37
|
- [Lograge](../lograge) — condensed request logging
|
|
38
|
+
- The [`controller-patterns`](https://github.com/RoleModel/skills/tree/main/skills/controller-patterns)
|
|
39
|
+
agent skill for RoleModel's controller shapes, installed into `.agents/skills`
|
|
37
40
|
- The [`polymorphic-parent-resources`](https://github.com/RoleModel/skills/tree/main/skills/polymorphic-parent-resources)
|
|
38
41
|
and [`rake-tasks`](https://github.com/RoleModel/skills/tree/main/skills/rake-tasks) agent skills for
|
|
39
42
|
`resource_for` and `Rolemodel::Utility::TaskTools`, installed into `.agents/skills`
|
|
@@ -2,10 +2,10 @@ Description:
|
|
|
2
2
|
Runs the core generators every new Rails app should have
|
|
3
3
|
|
|
4
4
|
Sets up Slim, Webpack, Optics, SimpleForm, Tom Select, testing (RSpec &
|
|
5
|
-
friends), Turbo, flash messages, GitHub config, README, linters,
|
|
6
|
-
deployment, Sentry, and Lograge. It also installs the agent skills for
|
|
7
|
-
resource_for and TaskTools. The result is an app
|
|
8
|
-
directly to Heroku.
|
|
5
|
+
friends), Turbo, flash messages, GitHub config, README, linters, agent
|
|
6
|
+
docs and conventions, Heroku deployment, Sentry, and Lograge. It also installs the agent skills for
|
|
7
|
+
controller patterns, resource_for, and TaskTools. The result is an app
|
|
8
|
+
that is ready to push directly to Heroku.
|
|
9
9
|
|
|
10
10
|
Pass an icon library flag (--material, --phosphor, --tabler, --feather,
|
|
11
11
|
--lucide, or --custom) to choose the Optics icons up front.
|
|
@@ -7,8 +7,9 @@ module Rolemodel
|
|
|
7
7
|
class_option :skip_deployable, type: :boolean, default: false, desc: 'skip generators for app deployment (Heroku, Sentry, Lograge)'
|
|
8
8
|
|
|
9
9
|
def install_agent_skills
|
|
10
|
-
say 'Installing agent skills
|
|
10
|
+
say 'Installing agent skills', :green
|
|
11
11
|
|
|
12
|
+
install_skill 'controller-patterns'
|
|
12
13
|
install_skill 'polymorphic-parent-resources'
|
|
13
14
|
install_skill 'rake-tasks'
|
|
14
15
|
end
|
|
@@ -26,6 +27,7 @@ module Rolemodel
|
|
|
26
27
|
generate 'rolemodel:github'
|
|
27
28
|
generate 'rolemodel:readme'
|
|
28
29
|
generate 'rolemodel:linters:all'
|
|
30
|
+
generate 'rolemodel:agent_docs'
|
|
29
31
|
return if options.skip_deployable?
|
|
30
32
|
|
|
31
33
|
generate 'rolemodel:heroku'
|
|
@@ -70,5 +70,22 @@ Style/EachWithObject:
|
|
|
70
70
|
Style/Documentation:
|
|
71
71
|
Enabled: false
|
|
72
72
|
|
|
73
|
+
Style/ItBlockParameter:
|
|
74
|
+
EnforcedStyle: always
|
|
75
|
+
|
|
76
|
+
Style/EndlessMethod:
|
|
77
|
+
EnforcedStyle: require_single_line
|
|
78
|
+
|
|
79
|
+
Style/TrailingCommaInArrayLiteral:
|
|
80
|
+
EnforcedStyleForMultiline: consistent_comma
|
|
81
|
+
|
|
82
|
+
Style/TrailingCommaInHashLiteral:
|
|
83
|
+
EnforcedStyleForMultiline: consistent_comma
|
|
84
|
+
|
|
85
|
+
# Parent and child setters keep inverted index/new/create conditions,
|
|
86
|
+
# even when the controller doesn't define all three.
|
|
87
|
+
Rails/LexicallyScopedActionFilter:
|
|
88
|
+
Enabled: false
|
|
89
|
+
|
|
73
90
|
Cops/NoChromeTag:
|
|
74
91
|
AutoCorrect: contextual
|
data/lib/rolemodel/engine.rb
CHANGED
data/lib/rolemodel/version.rb
CHANGED
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.
|
|
4
|
+
version: 2.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- RoleModel Software Inc
|
|
@@ -192,6 +192,28 @@ files:
|
|
|
192
192
|
- exe/rmr
|
|
193
193
|
- lib/generators/rolemodel/README.md
|
|
194
194
|
- lib/generators/rolemodel/USAGE
|
|
195
|
+
- lib/generators/rolemodel/agent_docs/README.md
|
|
196
|
+
- lib/generators/rolemodel/agent_docs/USAGE
|
|
197
|
+
- lib/generators/rolemodel/agent_docs/agent_docs_generator.rb
|
|
198
|
+
- lib/generators/rolemodel/agent_docs/templates/.claude/settings.json
|
|
199
|
+
- lib/generators/rolemodel/agent_docs/templates/.github/instructions/conventions.instructions.md
|
|
200
|
+
- lib/generators/rolemodel/agent_docs/templates/AGENTS.md.tt
|
|
201
|
+
- lib/generators/rolemodel/agent_docs/templates/CLAUDE.md
|
|
202
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/CONVENTIONS.md
|
|
203
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/callbacks.md
|
|
204
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/controllers.md
|
|
205
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/eager-loading.md
|
|
206
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/logic-in-models.md
|
|
207
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/migrations.md
|
|
208
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/no-sql-strings.md
|
|
209
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/partial-locals.md
|
|
210
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/reproduce-the-bug.md
|
|
211
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/reuse-scopes.md
|
|
212
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/stimulus.md
|
|
213
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/string-enums.md
|
|
214
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/system-spec-assertions.md
|
|
215
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/test-layers.md
|
|
216
|
+
- lib/generators/rolemodel/agent_docs/templates/docs/conventions/views-and-forms.md
|
|
195
217
|
- lib/generators/rolemodel/all_generator.rb
|
|
196
218
|
- lib/generators/rolemodel/core_setup/README.md
|
|
197
219
|
- lib/generators/rolemodel/core_setup/USAGE
|