plutonium 0.45.3 → 0.46.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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/skills/plutonium/SKILL.md +146 -0
  3. data/.claude/skills/plutonium-assets/SKILL.md +248 -157
  4. data/.claude/skills/{plutonium-rodauth → plutonium-auth}/SKILL.md +195 -229
  5. data/.claude/skills/plutonium-controller/SKILL.md +9 -2
  6. data/.claude/skills/plutonium-create-resource/SKILL.md +22 -1
  7. data/.claude/skills/plutonium-definition/SKILL.md +521 -7
  8. data/.claude/skills/plutonium-entity-scoping/SKILL.md +317 -0
  9. data/.claude/skills/plutonium-forms/SKILL.md +8 -1
  10. data/.claude/skills/plutonium-installation/SKILL.md +25 -2
  11. data/.claude/skills/plutonium-interaction/SKILL.md +9 -2
  12. data/.claude/skills/plutonium-invites/SKILL.md +11 -7
  13. data/.claude/skills/plutonium-model/SKILL.md +50 -50
  14. data/.claude/skills/plutonium-nested-resources/SKILL.md +8 -1
  15. data/.claude/skills/plutonium-package/SKILL.md +8 -1
  16. data/.claude/skills/plutonium-policy/SKILL.md +69 -78
  17. data/.claude/skills/plutonium-portal/SKILL.md +26 -70
  18. data/.claude/skills/plutonium-views/SKILL.md +9 -2
  19. data/CHANGELOG.md +28 -0
  20. data/app/assets/plutonium.css +1 -1
  21. data/app/views/rodauth/_login_form.html.erb +0 -3
  22. data/app/views/rodauth/confirm_password.html.erb +0 -4
  23. data/app/views/rodauth/create_account.html.erb +0 -3
  24. data/app/views/rodauth/logout.html.erb +0 -3
  25. data/docs/superpowers/plans/2026-04-08-plutonium-skills-overhaul.md +481 -0
  26. data/docs/superpowers/specs/2026-04-08-plutonium-skills-overhaul-design.md +236 -0
  27. data/gemfiles/rails_7.gemfile.lock +1 -1
  28. data/gemfiles/rails_8.0.gemfile.lock +1 -1
  29. data/gemfiles/rails_8.1.gemfile.lock +1 -1
  30. data/lib/generators/pu/core/update/update_generator.rb +8 -0
  31. data/lib/generators/pu/gem/active_shrine/active_shrine_generator.rb +56 -0
  32. data/lib/generators/pu/invites/install_generator.rb +8 -1
  33. data/lib/generators/pu/lib/plutonium_generators/concerns/actions.rb +43 -0
  34. data/lib/generators/pu/profile/concerns/profile_arguments.rb +10 -4
  35. data/lib/generators/pu/profile/conn_generator.rb +9 -12
  36. data/lib/generators/pu/profile/install_generator.rb +5 -2
  37. data/lib/generators/pu/rodauth/templates/app/rodauth/account_rodauth_plugin.rb.tt +3 -0
  38. data/lib/generators/pu/saas/portal_generator.rb +4 -9
  39. data/lib/generators/pu/saas/welcome/templates/app/views/welcome/onboarding.html.erb.tt +2 -2
  40. data/lib/plutonium/engine.rb +18 -5
  41. data/lib/plutonium/ui/layout/rodauth_layout.rb +6 -1
  42. data/lib/plutonium/version.rb +1 -1
  43. data/package.json +1 -1
  44. metadata +7 -8
  45. data/.claude/skills/plutonium/skill.md +0 -130
  46. data/.claude/skills/plutonium-definition-actions/SKILL.md +0 -424
  47. data/.claude/skills/plutonium-definition-query/SKILL.md +0 -364
  48. data/.claude/skills/plutonium-profile/SKILL.md +0 -276
  49. data/.claude/skills/plutonium-theming/SKILL.md +0 -424
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: adff2d0da15de9c822272e3c4e7f8827539f26f9a7c9a95e29be1e26463ae3f3
4
- data.tar.gz: 596559461f696d34852618a46a8a5529ddfa4c048816d60d3f8a699684c875b4
3
+ metadata.gz: f603d6d8cf1a941e6880307ac384bf03c4d81a90a3c71fe6be6b2397a509de93
4
+ data.tar.gz: 58cf196911c99bb2d91d06f784a6336c3fbf7371189faa9d626eab2b5db4e11e
5
5
  SHA512:
6
- metadata.gz: 5e37336f90d349363629761185724a219608ae90a265ca687f7af81d7c018dd3d122c19f8418b6263c91ad00c67131d6d5841b4d16286aff12ee3431b6428ff6
7
- data.tar.gz: 9ec1703fbada1cc98af1961c9a108a84539dcddfeaea5a18a1a1751a752f020fbc421a10959cd4c175932989b0a44e2708a40959ed2afa2a0d0b620fce985fa0
6
+ metadata.gz: 5d9af8748fda86912aad6a2a64deeb9536ad17d08cae17a7fe8d61ab72e8f19c2c0668851e52ba1288a386dbb71eb4e0c2075f8af6955e4b5a491abaa25701d4
7
+ data.tar.gz: f99fdb5497ef022daeab3147d556aa6e37ca5c4bb2812a4660afbe449b6666474fd36d1db70f36912778b85f156ec20984bf9a1d02ef6be7357c89b60cb2f46a
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: plutonium
3
+ description: Use BEFORE starting any Plutonium work — new app, new feature, or first edit in an unfamiliar area. Routes you to the right skills and bootstraps greenfield work.
4
+ ---
5
+
6
+ # Plutonium — Router & Bootstrapper
7
+
8
+ This skill is the entry point for all Plutonium work. It does three things:
9
+
10
+ 1. Surfaces the **most expensive mistakes** up front (🚨 below).
11
+ 2. Tells you which foundational skills to load for **greenfield** work.
12
+ 3. Maps specific "about to…" actions to the right **targeted skill** (router table).
13
+
14
+ Read this first. Then follow the pointers.
15
+
16
+ ## 🚨 Critical (read first)
17
+
18
+ - **Plutonium is generator-driven.** Almost every file you'd hand-write has a `pu:*` generator. Use it. Hand-written files drift from conventions and break future generator runs.
19
+ - **For greenfield** (new app, substantial new feature, first resource in a new domain) — load the **bootstrap bundle** below before writing code.
20
+ - **For targeted edits** — use the **router table** to jump straight to the right skill.
21
+ - **For anything touching tenant scoping** — load `plutonium-entity-scoping`. Don't reach for `where(organization: ...)` in a policy; fix the model instead.
22
+ - **Unattended execution:** always pass `--dest=`, `--force` (when re-running meta-generators), `--auth=`, `--skip-bundle`, and `--quiet` so generators don't block on prompts. See [Unattended execution](#unattended-execution).
23
+
24
+ ## Greenfield bootstrap bundle
25
+
26
+ Triggers: installing Plutonium, building a new app, adding the first resource in a new domain, setting up a new portal or package, "build me a Y app", "set up X from scratch".
27
+
28
+ **Load ALL of these before writing code:**
29
+
30
+ 1. **`plutonium-installation`** — `pu:core:install`, Rails template vs existing app, base classes.
31
+ 2. **`plutonium-create-resource`** — `pu:res:scaffold` syntax, field types, destinations.
32
+ 3. **`plutonium-model`** — model structure, associations, `has_cents`, labeling, routing.
33
+ 4. **`plutonium-policy`** — authorization actions, `permitted_attributes_for_*`, derived methods.
34
+ 5. **`plutonium-entity-scoping`** — `associated_with`, `default_relation_scope`, model shapes for multi-tenancy.
35
+ 6. **`plutonium-portal`** — `pu:pkg:portal`, mounting, resource connection, entity strategies.
36
+ 7. **`plutonium-definition`** — fields, inputs, displays, search, filters, scopes, actions.
37
+
38
+ Optional additions when relevant:
39
+ - **`plutonium-auth`** for login / accounts / profile.
40
+ - **`plutonium-invites`** for membership-based onboarding.
41
+ - **`plutonium-package`** when splitting logic across feature packages.
42
+ - **`plutonium-assets`** when customizing Tailwind / Stimulus / tokens.
43
+
44
+ ## Router table
45
+
46
+ | About to… | Load |
47
+ |---|---|
48
+ | Write/edit a model, add associations, use `has_cents` | `plutonium-model` |
49
+ | Scope a model to a tenant, write `associated_with`, deal with multi-tenancy | **`plutonium-entity-scoping`** |
50
+ | Write `relation_scope`, `permitted_attributes`, override a policy | `plutonium-policy` (+ `plutonium-entity-scoping` if scoping) |
51
+ | Create a new resource via `pu:res:scaffold` | `plutonium-create-resource` |
52
+ | Add fields, inputs, displays, search, filters, scopes, custom actions, or bulk actions | `plutonium-definition` |
53
+ | Write an interaction class for business logic | `plutonium-interaction` |
54
+ | Customize a controller action, hook, redirect, or param | `plutonium-controller` |
55
+ | Build a custom page, panel, table, layout, Phlex component | `plutonium-views` |
56
+ | Customize forms, field builders, inputs, submit buttons | `plutonium-forms` |
57
+ | Configure Tailwind, register a Stimulus controller, edit design tokens | `plutonium-assets` |
58
+ | Set up Rodauth, accounts, login flows, or profile / settings page | `plutonium-auth` |
59
+ | Set up user invitations or entity membership | `plutonium-invites` (+ `plutonium-entity-scoping`) |
60
+ | Configure parent/child resources, nested routes | `plutonium-nested-resources` |
61
+ | Create a portal or feature package | `plutonium-portal` / `plutonium-package` |
62
+ | Mount a portal, configure entity strategies, route portal resources | `plutonium-portal` (+ `plutonium-entity-scoping` for tenancy) |
63
+ | Install Plutonium in a Rails app | `plutonium-installation` |
64
+
65
+ ## Generator catalog
66
+
67
+ Every Plutonium generator is discoverable via `rails g pu:<tab>`. Always pass `--dest=` to skip prompts.
68
+
69
+ | Generator | Purpose | Covered by |
70
+ |---|---|---|
71
+ | `pu:core:install` | Initial Plutonium setup (base controller/policy/definition/layout) | `plutonium-installation` |
72
+ | `pu:core:assets` | Install custom Tailwind + Stimulus toolchain | `plutonium-assets` |
73
+ | `pu:res:scaffold NAME field:type ...` | Create a new resource (model, migration, controller, policy, definition) | `plutonium-create-resource` |
74
+ | `pu:res:conn RESOURCE --dest=PORTAL` | Connect a resource to a portal | `plutonium-portal` |
75
+ | `pu:pkg:package NAME` | Create a feature package | `plutonium-package` |
76
+ | `pu:pkg:portal NAME --auth=... --scope=...` | Create a portal package | `plutonium-portal` |
77
+ | `pu:rodauth:install` | Install Rodauth base | `plutonium-auth` |
78
+ | `pu:rodauth:account NAME` | Create a basic Rodauth account | `plutonium-auth` |
79
+ | `pu:rodauth:admin NAME` | Create a hardened admin account (2FA, lockout, audit) | `plutonium-auth` |
80
+ | `pu:saas:setup --user ... --entity ...` | Meta-generator: user + entity + membership + portal + profile + welcome + invites | `plutonium-auth` + `plutonium-invites` |
81
+ | `pu:saas:user / :entity / :membership` | Individual SaaS pieces | `plutonium-auth` |
82
+ | `pu:saas:portal / :welcome` | SaaS portal & onboarding | `plutonium-auth` + `plutonium-portal` |
83
+ | `pu:profile:install / :setup / :conn` | User profile resource + security section | `plutonium-auth` |
84
+ | `pu:invites:install` | User invitations package | `plutonium-invites` |
85
+ | `pu:invites:invitable NAME` | Mark a model as invitable | `plutonium-invites` |
86
+ | `pu:field:input NAME` | Custom form input component | `plutonium-forms` |
87
+ | `pu:field:renderer NAME` | Custom display renderer | `plutonium-definition` |
88
+ | `pu:eject:layout` | Eject the base layout for customization | `plutonium-views` |
89
+ | `pu:skills:sync` | Sync Plutonium Claude skills into the project | `plutonium` |
90
+
91
+ ## Resource architecture at a glance
92
+
93
+ A **resource** is four cooperating layers:
94
+
95
+ | Layer | File | Purpose | Edit when… |
96
+ |---|---|---|---|
97
+ | **Model** | `app/models/post.rb` | Data, validations, associations | Adding domain data/logic |
98
+ | **Definition** | `app/definitions/post_definition.rb` | UI — fields, filters, actions | Changing how it looks/behaves |
99
+ | **Policy** | `app/policies/post_policy.rb` | Authorization — who, what | Restricting access |
100
+ | **Controller** | `app/controllers/posts_controller.rb` | Request handling | Rarely — use hooks |
101
+
102
+ ```
103
+ ┌───────────────────────────────────────────────────────────────┐
104
+ │ Resource │
105
+ ├───────────────────────────────────────────────────────────────┤
106
+ │ Model │ Definition │ Policy │ Controller │
107
+ │ (WHAT) │ (HOW it looks) │ (WHO) │ (HOW it │
108
+ │ │ │ │ responds)│
109
+ ├───────────────────────────────────────────────────────────────┤
110
+ │ - attributes │ - field types │ - actions │ - CRUD │
111
+ │ - associations │ - inputs/forms │ - attributes │ - hooks │
112
+ │ - validations │ - displays │ - scoping │ - redirects│
113
+ │ - scopes │ - filters │ │ - params │
114
+ └───────────────────────────────────────────────────────────────┘
115
+ ```
116
+
117
+ Auto-detection fills most of these in from your model — you only declare when **overriding defaults**.
118
+
119
+ ## Unattended execution
120
+
121
+ Plutonium generators are interactive by default. For scripts, agents, or CI, pass these flags:
122
+
123
+ | Flag | Generators | Purpose |
124
+ |---|---|---|
125
+ | `--dest=main_app` / `--dest=package_name` | `pu:res:scaffold`, `pu:res:conn`, package-targeted generators | Skips "Select destination feature" prompt |
126
+ | `--force` | any | Overwrites conflicting files (needed when re-running `pu:saas:setup` or meta-generators) |
127
+ | `--auth=<account>` / `--public` / `--byo` | `pu:pkg:portal` | Skips auth-type prompt |
128
+ | `--skip-bundle` | gem-installing generators | Avoids mid-run `bundle install` |
129
+ | `--quiet` | most | Reduces output noise |
130
+
131
+ Meta-generators (`pu:saas:setup`) propagate these flags to the generators they chain. Always pass `--force` when re-running a meta-generator on an app that already has some of its outputs.
132
+
133
+ ## Workflow summary
134
+
135
+ 1. **Load the bootstrap bundle** (or the targeted skill from the router table).
136
+ 2. **Generate** — `rails g pu:res:scaffold Model field:type ... --dest=main_app`.
137
+ 3. **Migrate** — `rails db:migrate`.
138
+ 4. **Connect** — `rails g pu:res:conn Model --dest=portal_name`.
139
+ 5. **Customize** — edit definition / policy as needed.
140
+ 6. **Verify** — hit the route in the browser.
141
+
142
+ ## See also
143
+
144
+ - `plutonium-installation` · `plutonium-create-resource` · `plutonium-model` · `plutonium-policy` · `plutonium-entity-scoping` · `plutonium-portal` · `plutonium-definition`
145
+ - `plutonium-controller` · `plutonium-interaction` · `plutonium-views` · `plutonium-forms` · `plutonium-assets`
146
+ - `plutonium-auth` · `plutonium-invites` · `plutonium-package` · `plutonium-nested-resources`