@stacksjs/defaults 0.72.102 → 0.73.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 (164) hide show
  1. package/ai/AGENTS.md +25 -4
  2. package/ai/README.md +26 -4
  3. package/ai/skills/stacks-actions/SKILL.md +1 -1
  4. package/ai/skills/stacks-ai/SKILL.md +1 -1
  5. package/ai/skills/stacks-alias/SKILL.md +1 -1
  6. package/ai/skills/stacks-analytics/SKILL.md +1 -1
  7. package/ai/skills/stacks-api/SKILL.md +1 -1
  8. package/ai/skills/stacks-arrays/SKILL.md +1 -1
  9. package/ai/skills/stacks-auto-imports/SKILL.md +1 -1
  10. package/ai/skills/stacks-browse/SKILL.md +1 -1
  11. package/ai/skills/stacks-browser/SKILL.md +1 -1
  12. package/ai/skills/stacks-buddy/SKILL.md +1 -1
  13. package/ai/skills/stacks-build/SKILL.md +79 -5
  14. package/ai/skills/stacks-cache/SKILL.md +1 -1
  15. package/ai/skills/stacks-calendar/SKILL.md +1 -1
  16. package/ai/skills/stacks-chat/SKILL.md +1 -1
  17. package/ai/skills/stacks-cli/SKILL.md +1 -1
  18. package/ai/skills/stacks-cloud/SKILL.md +1 -1
  19. package/ai/skills/stacks-cms/SKILL.md +1 -1
  20. package/ai/skills/stacks-codebase-design/DEEPENING.md +79 -0
  21. package/ai/skills/stacks-codebase-design/DESIGN-IT-TWICE.md +72 -0
  22. package/ai/skills/stacks-codebase-design/SKILL.md +180 -0
  23. package/ai/skills/stacks-collections/SKILL.md +1 -1
  24. package/ai/skills/stacks-commerce/SKILL.md +141 -35
  25. package/ai/skills/stacks-composables/SKILL.md +1 -1
  26. package/ai/skills/stacks-config/SKILL.md +1 -1
  27. package/ai/skills/stacks-configuration/SKILL.md +1 -1
  28. package/ai/skills/stacks-cron/SKILL.md +1 -1
  29. package/ai/skills/stacks-crosswind/SKILL.md +1 -1
  30. package/ai/skills/stacks-database/SKILL.md +1 -1
  31. package/ai/skills/stacks-datetime/SKILL.md +1 -1
  32. package/ai/skills/stacks-dependencies/SKILL.md +1 -1
  33. package/ai/skills/stacks-deploy/SKILL.md +1 -1
  34. package/ai/skills/stacks-desktop/SKILL.md +1 -1
  35. package/ai/skills/stacks-development/SKILL.md +1 -1
  36. package/ai/skills/stacks-dns/SKILL.md +1 -1
  37. package/ai/skills/stacks-docs/SKILL.md +1 -1
  38. package/ai/skills/stacks-domain-modeling/FORMATS.md +123 -0
  39. package/ai/skills/stacks-domain-modeling/SKILL.md +109 -0
  40. package/ai/skills/stacks-enums/SKILL.md +1 -1
  41. package/ai/skills/stacks-error-handling/SKILL.md +1 -1
  42. package/ai/skills/stacks-events/SKILL.md +1 -1
  43. package/ai/skills/stacks-faker/SKILL.md +1 -1
  44. package/ai/skills/stacks-flow/PHASE-BOUNDARIES.md +91 -0
  45. package/ai/skills/stacks-flow/SKILL.md +117 -0
  46. package/ai/skills/stacks-git/SKILL.md +37 -9
  47. package/ai/skills/stacks-grilling/SKILL.md +85 -0
  48. package/ai/skills/stacks-guard/SKILL.md +86 -11
  49. package/ai/skills/stacks-guard/scripts/block-destructive.sh +67 -0
  50. package/ai/skills/stacks-handoff/SKILL.md +70 -0
  51. package/ai/skills/stacks-health/SKILL.md +1 -1
  52. package/ai/skills/stacks-http/SKILL.md +1 -1
  53. package/ai/skills/stacks-i18n/SKILL.md +1 -1
  54. package/ai/skills/stacks-investigate/SKILL.md +234 -106
  55. package/ai/skills/stacks-investigate/scripts/hitl-loop.template.sh +47 -0
  56. package/ai/skills/stacks-jobs/SKILL.md +1 -1
  57. package/ai/skills/stacks-listeners/SKILL.md +1 -1
  58. package/ai/skills/stacks-logging/SKILL.md +1 -1
  59. package/ai/skills/stacks-mail/SKILL.md +1 -1
  60. package/ai/skills/stacks-middleware/SKILL.md +1 -1
  61. package/ai/skills/stacks-migrations/SKILL.md +1 -1
  62. package/ai/skills/stacks-models/SKILL.md +1 -1
  63. package/ai/skills/stacks-new-feature/SKILL.md +65 -5
  64. package/ai/skills/stacks-notifications/SKILL.md +1 -1
  65. package/ai/skills/stacks-objects/SKILL.md +1 -1
  66. package/ai/skills/stacks-office-hours/SKILL.md +16 -2
  67. package/ai/skills/stacks-orm/SKILL.md +1 -1
  68. package/ai/skills/stacks-path/SKILL.md +1 -1
  69. package/ai/skills/stacks-payments/SKILL.md +35 -1
  70. package/ai/skills/stacks-plan-review/SKILL.md +27 -6
  71. package/ai/skills/stacks-plugins/SKILL.md +1 -1
  72. package/ai/skills/stacks-prototype/LOGIC.md +103 -0
  73. package/ai/skills/stacks-prototype/SKILL.md +66 -0
  74. package/ai/skills/stacks-prototype/UI.md +112 -0
  75. package/ai/skills/stacks-push/SKILL.md +1 -1
  76. package/ai/skills/stacks-query-builder/SKILL.md +1 -1
  77. package/ai/skills/stacks-queue/SKILL.md +1 -1
  78. package/ai/skills/stacks-realtime/SKILL.md +1 -1
  79. package/ai/skills/stacks-registry/SKILL.md +1 -1
  80. package/ai/skills/stacks-repl/SKILL.md +1 -1
  81. package/ai/skills/stacks-retro/SKILL.md +121 -75
  82. package/ai/skills/stacks-review/SKILL.md +182 -74
  83. package/ai/skills/stacks-router/SKILL.md +1 -1
  84. package/ai/skills/stacks-routes/SKILL.md +1 -1
  85. package/ai/skills/stacks-scaffolding/SKILL.md +1 -1
  86. package/ai/skills/stacks-scheduler/SKILL.md +1 -1
  87. package/ai/skills/stacks-search-engine/SKILL.md +1 -1
  88. package/ai/skills/stacks-security/SKILL.md +1 -1
  89. package/ai/skills/stacks-security-audit/SKILL.md +1 -1
  90. package/ai/skills/stacks-server/SKILL.md +1 -1
  91. package/ai/skills/stacks-shell/SKILL.md +1 -1
  92. package/ai/skills/stacks-slug/SKILL.md +1 -1
  93. package/ai/skills/stacks-sms/SKILL.md +1 -1
  94. package/ai/skills/stacks-socials/SKILL.md +1 -1
  95. package/ai/skills/stacks-storage/SKILL.md +1 -1
  96. package/ai/skills/stacks-strings/SKILL.md +1 -1
  97. package/ai/skills/stacks-stx/SKILL.md +1 -1
  98. package/ai/skills/stacks-tdd/EXAMPLES.md +136 -0
  99. package/ai/skills/stacks-tdd/SKILL.md +125 -0
  100. package/ai/skills/stacks-testing/SKILL.md +13 -3
  101. package/ai/skills/stacks-tunnel/SKILL.md +1 -1
  102. package/ai/skills/stacks-types/SKILL.md +1 -1
  103. package/ai/skills/stacks-ui/SKILL.md +1 -1
  104. package/ai/skills/stacks-utils/SKILL.md +1 -1
  105. package/ai/skills/stacks-validation/SKILL.md +1 -1
  106. package/ai/skills/stacks-whois/SKILL.md +1 -1
  107. package/ai/skills/stacks-wizard/SKILL.md +127 -0
  108. package/ai/skills/stacks-wizard/scripts/template.sh +208 -0
  109. package/ai/skills/stacks-writing-for-agents/MECHANICS.md +125 -0
  110. package/ai/skills/stacks-writing-for-agents/SKILL.md +218 -0
  111. package/app/Actions/Auth/GenerateTwoFactorSecretAction.ts +12 -2
  112. package/app/Actions/Commerce/Shipping/{DriverDestroyAction.ts → CourierDestroyAction.ts} +6 -6
  113. package/app/Actions/Commerce/Shipping/{DriverIndexAction.ts → CourierIndexAction.ts} +3 -3
  114. package/app/Actions/Commerce/Shipping/CourierPingStoreAction.ts +61 -0
  115. package/app/Actions/Commerce/Shipping/{DriverShowAction.ts → CourierShowAction.ts} +5 -5
  116. package/app/Actions/Commerce/Shipping/{DriverStoreAction.ts → CourierStoreAction.ts} +4 -4
  117. package/app/Actions/Commerce/Shipping/{DriverUpdateAction.ts → CourierUpdateAction.ts} +6 -6
  118. package/app/Actions/Commerce/Shipping/DeliveryRouteStartAction.ts +38 -0
  119. package/app/Actions/Commerce/Shipping/DeliveryStopCompleteAction.ts +40 -0
  120. package/app/Actions/Commerce/Shipping/DeliveryStopFailAction.ts +44 -0
  121. package/app/Actions/Commerce/Shipping/DeliveryStopStartAction.ts +39 -0
  122. package/app/Actions/Commerce/Shipping/courier-session.ts +75 -0
  123. package/app/Actions/Commerce/commerce-action.test.ts +5 -5
  124. package/app/Actions/Dashboard/Commerce/CommerceDeliveryAction.ts +5 -5
  125. package/app/Actions/Dashboard/Commerce/CourierIndexAction.ts +24 -0
  126. package/app/Actions/Dashboard/Commerce/DeliveryRouteIndexAction.ts +7 -7
  127. package/app/Actions/Dashboard/Commerce/commerce-delivery.test.ts +11 -11
  128. package/app/Actions/Dashboard/Commerce/commerce-delivery.ts +29 -29
  129. package/app/Actions/Dashboard/Commerce/{driver-records.test.ts → courier-records.test.ts} +9 -9
  130. package/app/Actions/Dashboard/Commerce/{driver-records.ts → courier-records.ts} +14 -14
  131. package/app/Actions/Dashboard/Commerce/delivery-route-records.test.ts +13 -13
  132. package/app/Actions/Dashboard/Commerce/delivery-route-records.ts +25 -25
  133. package/app/Models/User.ts +1 -1
  134. package/app/Models/commerce/{Driver.ts → Courier.ts} +7 -7
  135. package/app/Models/commerce/{DriverPing.ts → CourierPing.ts} +7 -7
  136. package/app/Models/commerce/DeliveryRoute.ts +6 -6
  137. package/app/Models/commerce/DeliveryStop.ts +31 -8
  138. package/bootstrap.ts +7 -0
  139. package/functions/commerce/shippings/couriers.ts +19 -0
  140. package/ide/vscode/package.json +1 -1
  141. package/package.json +4 -3
  142. package/resources/components/Dashboard/Commerce/Delivery/{DriverDeleteDialog.stx → CourierDeleteDialog.stx} +5 -5
  143. package/resources/components/Dashboard/Commerce/Delivery/{DriverDialog.stx → CourierDialog.stx} +10 -10
  144. package/resources/components/Dashboard/Commerce/Delivery/{DriversDashboard.stx → CouriersDashboard.stx} +43 -43
  145. package/resources/components/Dashboard/Commerce/Delivery/{DriversTable.stx → CouriersTable.stx} +21 -21
  146. package/resources/components/Dashboard/Commerce/Delivery/DeliveryOverviewDashboard.stx +18 -18
  147. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDeleteDialog.stx +2 -2
  148. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDialog.stx +22 -22
  149. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesDashboard.stx +24 -24
  150. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +8 -8
  151. package/resources/components/Dashboard/Commerce/Delivery/TabNavigation.stx +1 -1
  152. package/resources/functions/dashboard/data.ts +1 -1
  153. package/resources/functions/dashboard/sidebar.ts +2 -2
  154. package/routes/dashboard-api.ts +6 -6
  155. package/routes/dashboard.ts +7 -7
  156. package/routes/delivery.ts +24 -0
  157. package/types/defaults.ts +3 -3
  158. package/views/dashboard/.discovered-models.json +18 -18
  159. package/views/dashboard/AUDIT.md +1 -1
  160. package/views/dashboard/commerce/delivery/{drivers.stx → couriers.stx} +2 -2
  161. package/views/dashboard/composables/useChart.ts +16 -2
  162. package/views/dashboard/layouts/default.stx +1 -1
  163. package/app/Actions/Dashboard/Commerce/DriverIndexAction.ts +0 -24
  164. package/functions/commerce/shippings/drivers.ts +0 -19
@@ -0,0 +1,123 @@
1
+ # CONTEXT.md and ADR formats
2
+
3
+ ## CONTEXT.md
4
+
5
+ ```md
6
+ # {Context name}
7
+
8
+ {One or two sentences on what this context is and why it exists.}
9
+
10
+ ## Language
11
+
12
+ **Order**:
13
+ A customer's committed request for goods, priced and payable.
14
+ _Avoid_: Purchase, transaction
15
+
16
+ **Invoice**:
17
+ A request for payment sent to a customer after delivery.
18
+ _Avoid_: Bill, payment request
19
+
20
+ **Customer**:
21
+ A person or organization that places orders.
22
+ _Avoid_: Client, buyer, account
23
+ ```
24
+
25
+ Rules:
26
+
27
+ - **Be opinionated.** When several words exist for one concept, pick the best and
28
+ list the others under `_Avoid_`.
29
+ - **Keep definitions tight.** One or two sentences. Define what it *is*, not what
30
+ it does.
31
+ - **Only terms specific to this project.** General programming concepts
32
+ (timeouts, error types, utility patterns) do not belong even if the project
33
+ uses them constantly. Before adding a term, ask whether it is unique to this
34
+ context.
35
+ - **Match the code.** A term here should be the name of the model, the event and
36
+ the route that carry it. Where it is not, either rename the code or fix the
37
+ entry, and say which.
38
+ - **Group under subheadings** when natural clusters emerge. A flat list is fine
39
+ when every term belongs to one cohesive area.
40
+
41
+ ## Single versus multi-context
42
+
43
+ **Single context**, which is almost every repo: one `CONTEXT.md` at the root.
44
+
45
+ **Multiple contexts**: a `CONTEXT-MAP.md` at the root lists them, where they
46
+ live, and how they relate:
47
+
48
+ ```md
49
+ # Context map
50
+
51
+ ## Contexts
52
+
53
+ - [Ordering](./app/Ordering/CONTEXT.md): receives and tracks customer orders
54
+ - [Billing](./app/Billing/CONTEXT.md): generates invoices and processes payments
55
+ - [Fulfillment](./app/Fulfillment/CONTEXT.md): manages picking and shipping
56
+
57
+ ## Relationships
58
+
59
+ - **Ordering to Fulfillment**: Ordering emits `order:placed`, Fulfillment
60
+ consumes it to start picking
61
+ - **Fulfillment to Billing**: Fulfillment emits `shipment:dispatched`, Billing
62
+ consumes it to generate invoices
63
+ - **Ordering and Billing**: share the `CustomerId` and `Money` types
64
+ ```
65
+
66
+ Infer which structure applies: if `CONTEXT-MAP.md` exists, read it to find the
67
+ contexts. If only a root `CONTEXT.md` exists, single context. If neither exists,
68
+ create the root file lazily when the first term is resolved.
69
+
70
+ A Stacks app with 90+ models is not automatically multi-context. Reach for the
71
+ map only when the app genuinely has separate languages, for instance a commerce
72
+ context and a CMS context that both say "author" and mean different things.
73
+
74
+ ## ADRs
75
+
76
+ ADRs live in `docs/adr/` with sequential numbering: `0001-slug.md`,
77
+ `0002-slug.md`. Scan the directory for the highest existing number and increment.
78
+ Create the directory lazily, only when the first ADR is needed.
79
+
80
+ ```md
81
+ # {Short title of the decision}
82
+
83
+ {One to three sentences: the context, what was decided, and why.}
84
+ ```
85
+
86
+ That is the whole template. An ADR can be a single paragraph. The value is in
87
+ recording *that* a decision was made and *why*, not in filling out sections.
88
+
89
+ Optional sections, only when they add genuine value:
90
+
91
+ - **Status** frontmatter (`proposed | accepted | deprecated | superseded by
92
+ ADR-NNNN`), useful when decisions get revisited.
93
+ - **Considered options**, only when the rejected alternatives are worth
94
+ remembering.
95
+ - **Consequences**, only when non-obvious downstream effects need calling out.
96
+
97
+ ### What qualifies
98
+
99
+ - **Architectural shape.** "The write model is event sourced, the read model is
100
+ projected into Postgres."
101
+ - **Integration patterns between contexts.** "Ordering and Billing communicate
102
+ via domain events, not synchronous HTTP."
103
+ - **Technology choices that carry lock-in.** Database, message bus, auth
104
+ provider, deployment target. Not every library, just the ones that would take a
105
+ quarter to swap.
106
+ - **Boundary and scope decisions.** "Customer data is owned by the Customer
107
+ context, other contexts reference it by ID only." The explicit no is as
108
+ valuable as the yes.
109
+ - **Deliberate deviations from the obvious path.** "We hand-write this migration
110
+ instead of generating it because X." Anything where a reasonable reader would
111
+ assume the opposite. These stop the next engineer from fixing something that
112
+ was deliberate.
113
+ - **Constraints not visible in the code.** "We cannot use AWS here for compliance
114
+ reasons." "Responses must stay under 200ms because of the partner contract."
115
+ - **Rejected alternatives when the rejection is non-obvious.** Otherwise someone
116
+ suggests the same thing again in six months.
117
+
118
+ ### What does not
119
+
120
+ Anything easy to reverse, unsurprising, or with no real alternative. If a
121
+ decision is easy to reverse you will just reverse it. If it is not surprising,
122
+ nobody will wonder why. If there was no alternative, there is nothing to record
123
+ beyond "we did the obvious thing".
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: stacks-domain-modeling
3
+ description: Use when building or sharpening a Stacks project's domain language - challenging a fuzzy or overloaded term, naming a model or event, writing or editing CONTEXT.md, or recording an architecture decision as an ADR under docs/adr/.
4
+ license: MIT
5
+ compatibility: Bun >= 1.3.0, TypeScript
6
+ allowed-tools: Read Edit Write Bash Grep Glob
7
+ ---
8
+
9
+ # Domain modeling
10
+
11
+ Actively build and sharpen the project's domain model as you design. This is the
12
+ *active* discipline: challenging terms, inventing edge-case scenarios, and
13
+ writing the glossary and the decisions down the moment they crystallise. Merely
14
+ *reading* `CONTEXT.md` for vocabulary is not this skill, that is a one-line habit
15
+ any skill can do. This skill is for when you are changing the model.
16
+
17
+ In a Stacks app the domain language is not decoration. It becomes the model name,
18
+ the table name, the route URI, the event name (`article:created`), the action
19
+ file name and the stx component name, all at once. A term settled badly is a
20
+ rename across five layers later.
21
+
22
+ Credit: adapted from Matt Pocock's `domain-modeling` skill (MIT),
23
+ <https://github.com/mattpocock/skills>.
24
+
25
+ ## File structure
26
+
27
+ Most repos have a single context:
28
+
29
+ ```
30
+ /
31
+ ├── CONTEXT.md
32
+ ├── docs/
33
+ │ └── adr/
34
+ │ ├── 0001-derive-migrations-from-models.md
35
+ │ └── 0002-sqlite-for-local-development.md
36
+ └── app/
37
+ ```
38
+
39
+ If a `CONTEXT-MAP.md` exists at the root, the repo has several contexts and the
40
+ map points at where each one lives. Create both lazily: only when you have
41
+ something to write. If no `CONTEXT.md` exists, create it when the first term is
42
+ resolved. If no `docs/adr/` exists, create it when the first ADR is needed.
43
+
44
+ Formats for both files: [FORMATS.md](FORMATS.md).
45
+
46
+ ## During the session
47
+
48
+ ### Challenge against the glossary
49
+
50
+ When the user uses a term that conflicts with the existing language in
51
+ `CONTEXT.md`, call it out immediately. "Your glossary defines cancellation as X,
52
+ but you seem to mean Y. Which is it?"
53
+
54
+ ### Sharpen fuzzy language
55
+
56
+ When a term is vague or overloaded, propose a precise canonical one. "You are
57
+ saying account. Do you mean the Customer or the User? Those are different
58
+ things, and this project already has a `User` model."
59
+
60
+ ### Discuss concrete scenarios
61
+
62
+ When domain relationships are on the table, stress-test them with specific
63
+ scenarios. Invent cases that probe the edges and force precision about where one
64
+ concept ends and the next begins.
65
+
66
+ ### Cross-reference with the code
67
+
68
+ The code is a second source of truth for the domain, and in a Stacks project it
69
+ is an unusually legible one. When the user states how something works, check
70
+ whether the models agree:
71
+
72
+ - `app/Models/` and `storage/framework/defaults/app/Models/` for the nouns.
73
+ - The `belongsTo` / `hasMany` / `belongsToMany` declarations for the
74
+ relationships.
75
+ - Model events (`observe: true` emits `<model>:created`, `:updated`, `:deleted`)
76
+ for the verbs.
77
+ - `routes/` for the URIs the outside world sees.
78
+
79
+ If you find a contradiction, surface it. "Your code cancels whole Orders, but you
80
+ just said partial cancellation is possible. Which is right?"
81
+
82
+ A term that lands in `CONTEXT.md` and disagrees with a model name is a bug in one
83
+ of the two. Say which one you think should move.
84
+
85
+ ### Update CONTEXT.md inline
86
+
87
+ When a term is resolved, update `CONTEXT.md` right there. Do not batch these up.
88
+
89
+ `CONTEXT.md` is a glossary and nothing else. Keep it free of implementation
90
+ detail: no file paths, no schemas, no config. Those go stale, and the whole value
91
+ of the file is that it does not.
92
+
93
+ ### Offer ADRs sparingly
94
+
95
+ Only offer to record a decision when all three are true:
96
+
97
+ 1. **Hard to reverse.** The cost of changing your mind later is meaningful.
98
+ 2. **Surprising without context.** A future reader will wonder why it was done
99
+ this way.
100
+ 3. **The result of a real trade-off.** There were genuine alternatives and you
101
+ picked one for specific reasons.
102
+
103
+ If any of the three is missing, skip it.
104
+
105
+ ## Downstream
106
+
107
+ > Reach for `stacks-codebase-design` when the argument is about a module's
108
+ > shape rather than its name, and `stacks-grilling` when the term will not
109
+ > settle without an interview.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: stacks-enums
3
- description: Use when working with framework constants in a Stacks application — NpmScript commands, Action identifiers, or any enumerated constants used across the build system, CLI, and actions. Covers @stacksjs/enums.
3
+ description: Use when working with framework constants in a Stacks application - NpmScript commands, Action identifiers, or any enumerated constants used across the build system, CLI, and actions. Covers @stacksjs/enums.
4
4
  license: MIT
5
5
  compatibility: Bun >= 1.3.0, TypeScript
6
6
  allowed-tools: Read Edit Write Bash Grep Glob
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: stacks-error-handling
3
- description: Use when implementing error handling in Stacks — the Result type (Ok/Err), handleError function, error page rendering (development with stack traces, production with friendly messages), ErrorHandler class, ModelNotFoundException, HTTP error mapping, log file writing, or error configuration. Covers @stacksjs/error-handling and config/errors.ts.
3
+ description: Use when implementing error handling in Stacks - the Result type (Ok/Err), handleError function, error page rendering (development with stack traces, production with friendly messages), ErrorHandler class, ModelNotFoundException, HTTP error mapping, log file writing, or error configuration. Covers @stacksjs/error-handling and config/errors.ts.
4
4
  license: MIT
5
5
  compatibility: Bun >= 1.3.0, TypeScript
6
6
  allowed-tools: Read Edit Write Bash Grep Glob
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: stacks-events
3
- description: Use when working with the event system in a Stacks application — dispatching events, listening for events, model events, wildcard listeners, the event emitter, or event-driven architecture. Covers @stacksjs/events, app/Events.ts, app/Listener.ts, and app/Listeners/.
3
+ description: Use when working with the event system in a Stacks application - dispatching events, listening for events, model events, wildcard listeners, the event emitter, or event-driven architecture. Covers @stacksjs/events, app/Events.ts, app/Listener.ts, and app/Listeners/.
4
4
  license: MIT
5
5
  compatibility: Bun >= 1.3.0, TypeScript
6
6
  allowed-tools: Read Edit Write Bash Grep Glob
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: stacks-faker
3
- description: Use when working with fake data generation in a Stacks application — seeding databases, generating test data, model factories, or using faker utilities. Covers @stacksjs/faker (wrapper around ts-mocker) and its integration with the database seeder.
3
+ description: Use when working with fake data generation in a Stacks application - seeding databases, generating test data, model factories, or using faker utilities. Covers @stacksjs/faker (wrapper around ts-mocker) and its integration with the database seeder.
4
4
  license: MIT
5
5
  compatibility: Bun >= 1.3.0, TypeScript
6
6
  allowed-tools: Read Edit Write Bash Grep Glob
@@ -0,0 +1,91 @@
1
+ # Phase boundaries
2
+
3
+ A **phase** is a chunk of work inside a session: the grilling, the
4
+ implementation, the QA. The definition is fuzzy on purpose, because a phase ends
5
+ when you think "ok, we are done with that".
6
+
7
+ The **phase boundary** is the gap between two phases, and it is the only place
8
+ this decision belongs. Mid-phase there is no decision to make: continue, or split
9
+ what is left into subagents. Compacting mid-phase makes the agent lose the
10
+ thread.
11
+
12
+ Credit: adapted from Matt Pocock's `ask-matt` skill (MIT),
13
+ <https://github.com/mattpocock/skills>.
14
+
15
+ ## The five options
16
+
17
+ | Option | What it does |
18
+ |---|---|
19
+ | **Continue** | Stay in the session. No context switch at all. |
20
+ | **Clear** | Empty the context window and start from nothing. |
21
+ | **Handoff** | Write a portable markdown file and seed a session anywhere with it. |
22
+ | **Subagent** | Send the task to its own context window and get a report back. |
23
+ | **Compact** | Compress this context and seed a fresh session with the summary. |
24
+
25
+ ## The tree
26
+
27
+ Work top to bottom at the boundary. The first yes wins.
28
+
29
+ **1. Can you continue in this session?** Two things make the answer yes: the next
30
+ phase needs this one as a **primary source**, or you have enough window left for
31
+ the next phase to fit. Design to implementation is the standard yes, because the
32
+ implementation wants the reasoning verbatim, not a summary of it. Continue costs
33
+ nothing and loses nothing, so rule it out before anything else.
34
+
35
+ **2. Is the context irrelevant to what comes next?** If everything here (the
36
+ exploration, the decisions, the dead ends) is disposable, **clear**. It is the
37
+ cheapest move on the board: no time, and the whole window handed back. The cost
38
+ of getting it wrong is one-way, though. Clear a *relevant* context and you lose
39
+ the why behind what you built, and no amount of reading the diff back returns it.
40
+
41
+ **3. Do you need to hand off?** `/stacks-handoff` is narrow. You need it only
42
+ when you are swapping to a different harness, moving to a different directory or
43
+ repo, sending the work to a colleague, or forking a side task you found
44
+ mid-phase. That list is the whole clause. What a handoff buys is **portability**.
45
+ If nothing is travelling, you do not need it.
46
+
47
+ **4. Can the task be done with you away from the keyboard?** Scoped tightly
48
+ enough to run with no steering? Send it to a **subagent** and leave this session
49
+ untouched. Automated review is the standard case: the agent reads the diff and
50
+ reports, and you are not needed while it does.
51
+
52
+ **5. Otherwise, compact.** Relevant context, same harness, same directory, and
53
+ you need to stay in the loop. This is where the tree lands, and it lands here
54
+ often. Pass an instruction with it so the summary keeps what the next phase
55
+ needs.
56
+
57
+ Compact is the **default, not the first reach**. It sits at the bottom because
58
+ the four questions above it are all cheaper or more precise. The failure mode
59
+ when people start here is a fresh session that is confidently wrong about a
60
+ decision the summary flattened.
61
+
62
+ ## Primary and secondary sources
63
+
64
+ Every move except Continue turns a **primary source** into a **secondary**
65
+ source: the session as it happened, replaced by a summary of it. The trade is
66
+ always the same shape.
67
+
68
+ | Source | Information | Noise | Room to move |
69
+ |---|---|---|---|
70
+ | Primary (continue) | Full | Lots | Little |
71
+ | Secondary (compact, handoff) | Lossy | Less | Lots |
72
+
73
+ This is why question 1 comes first. You only pay the lossiness when staying costs
74
+ more than it saves.
75
+
76
+ ## In a Stacks session specifically
77
+
78
+ Two boundaries recur, and both usually answer the same way:
79
+
80
+ - **Migration generation to review.** `buddy generate:migrations` writes SQL you
81
+ then have to read. Continue: the model change you just made is the primary
82
+ source for judging the SQL.
83
+ - **Implementation to review.** `/stacks-review` reads a diff and needs no
84
+ exploration, so it is the textbook subagent. Sending it out keeps the
85
+ implementation context intact for the fixes that follow.
86
+
87
+ ## These are judgement calls
88
+
89
+ The questions are not objective. Each has taste in it, and the same boundary can
90
+ go two ways on two days. The value is in asking them in order, at the boundary
91
+ rather than in the middle of the work.
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: stacks-flow
3
+ description: Ask which Stacks skill or flow fits the situation. A router over the bundled skills.
4
+ disable-model-invocation: true
5
+ license: MIT
6
+ compatibility: Bun >= 1.3.0, TypeScript
7
+ allowed-tools: Read Edit Write Bash Grep Glob
8
+ ---
9
+
10
+ # Stacks flow
11
+
12
+ Stacks ships more than a hundred skills. You do not remember them all, so ask.
13
+
14
+ Two kinds live in that set, and they are reached differently:
15
+
16
+ - **Subsystem reference**: `stacks-orm`, `stacks-router`, `stacks-queue`,
17
+ `stacks-cms`, one per part of the framework. These are model-invoked, so the
18
+ agent finds them on its own from the task. You rarely need to name one, and the
19
+ full index is the feature-to-skill table in `AGENTS.md`.
20
+ - **Craft skills**: the ones below. These shape *how* the work happens, and this
21
+ is the map of them.
22
+
23
+ Credit: the flow model here is adapted from Matt Pocock's `ask-matt` skill
24
+ (MIT), <https://github.com/mattpocock/skills>.
25
+
26
+ ## The main flow: idea to shipped
27
+
28
+ The route most work travels.
29
+
30
+ 1. **`/stacks-office-hours`** turns an idea into a design document. It runs the
31
+ `stacks-grilling` interview underneath, so vague answers get pushed on. Start
32
+ here when the question is still "should we build this, and what exactly".
33
+ 2. **Branch: can every question be settled in conversation?** If one needs a
34
+ runnable answer (a state model, a UI direction), detour through
35
+ **`/stacks-prototype`**, then come back with the verdict.
36
+ 3. **`/stacks-plan-review`** turns the design into scope, data flow,
37
+ architecture, a test matrix and an implementation plan. This is where
38
+ `stacks-codebase-design` gets used, because the plan is where seams are chosen.
39
+ 4. **`/stacks-new-feature`** slices the plan into **tracer bullets** and builds
40
+ them in the model to migration to action to route to test order, one vertical
41
+ slice at a time. It drives **`/stacks-tdd`** inside each slice.
42
+ 5. **`/stacks-review`** reviews the diff on two axes, standards and spec, before
43
+ anything merges.
44
+ 6. **`/stacks-browse`** QAs the result in a real browser when the slice has a UI.
45
+ 7. **`/stacks-retro`** looks back at the session and improves the environment the
46
+ next one runs in.
47
+
48
+ ### Context hygiene
49
+
50
+ Keep steps 1 to 4 in one unbroken context window where you can, so the grilling,
51
+ the plan and the slicing all build on the same thinking. Each slice in step 4 can
52
+ then start fresh from its own ticket. When a session is running long, make the
53
+ cut at a phase boundary rather than mid-phase: [PHASE-BOUNDARIES.md](PHASE-BOUNDARIES.md)
54
+ has the ordered tree.
55
+
56
+ ## On-ramps
57
+
58
+ A starting situation that generates work, then merges onto the main flow.
59
+
60
+ - **Something is broken** goes to **`/stacks-investigate`**. It refuses to
61
+ theorise until it has a **tight** feedback loop, one command that already goes
62
+ red on *this* bug, then fixes with a regression test. When the real finding is
63
+ that there is no good seam to lock the bug down, it hands off to
64
+ `stacks-codebase-design`.
65
+ - **A visual surface needs to be built or lifted** goes to
66
+ **`/stacks-design-taste`**, or `/stacks-redesign` when the UI already exists
67
+ and needs auditing first. Those two carry their own flow, including the
68
+ aesthetic presets and the image-first pipeline.
69
+ - **Something needs a human's hands** goes to **`/stacks-wizard`**, which turns
70
+ the manual procedure into a script the human runs once.
71
+
72
+ ## Codebase health
73
+
74
+ Not feature work, upkeep.
75
+
76
+ - **`/stacks-codebase-design`** is the bench you design a module's shape on:
77
+ module, interface, depth, seam, adapter, leverage, locality. Reach for it when
78
+ the argument is about where a seam goes or how much a trait should hide.
79
+ - **`/stacks-security-audit`** for OWASP, STRIDE and attack-surface work.
80
+ - **`/stacks-registry`** and the other subsystem skills for the auditing patterns
81
+ specific to one part of the framework.
82
+
83
+ ## Vocabulary underneath
84
+
85
+ Two model-invoked references that run *beneath* the other skills, each the single
86
+ source of truth for its vocabulary. Reach for them directly when the **words**,
87
+ not the process, are the problem.
88
+
89
+ - **`/stacks-domain-modeling`** sharpens the project's *domain* language:
90
+ challenge a fuzzy term, resolve an overloaded one, record a hard-to-reverse
91
+ decision as an ADR. In a Stacks app that language becomes model names, table
92
+ names, route URIs and event names, so it is load-bearing.
93
+ - **`/stacks-codebase-design`** is the deep-module vocabulary for a module's
94
+ *shape*. `stacks-tdd` and `stacks-plan-review` both speak it.
95
+
96
+ ## Standalone
97
+
98
+ - **`/stacks-grilling`** is the interview primitive: rounds, the frontier, facts
99
+ are the agent's job and decisions are yours. Reach for it directly when you
100
+ want the interview with no wrapper.
101
+ - **`/stacks-guard`** is the safety layer: destructive-command detection, freeze
102
+ mode, and the Claude Code hook that blocks the worst of it before it runs.
103
+ - **`/stacks-handoff`** compacts the conversation into a portable document.
104
+ Narrow: only when something is actually travelling to a new harness, a new
105
+ directory, or a colleague.
106
+ - **`/stacks-prototype`** answers one design question with throwaway code and
107
+ keeps the artifact on a `prototype/<name>` branch.
108
+ - **`/stacks-writing-for-agents`** is the reference for writing any document an
109
+ agent reads, including the skills themselves. Read it before adding anything to
110
+ `app/Skills/`.
111
+ - `/stacks-repl`, `/stacks-shell` and `/stacks-buddy` drive the toolchain
112
+ itself.
113
+
114
+ ## Precondition
115
+
116
+ Nothing to run first. `buddy setup:ai <agent>` links these into your agent's
117
+ directory, and `app/Skills/<name>/SKILL.md` shadows any of them per project.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: stacks-git
3
- description: Use when working with git in a Stacks application — commit conventions, git hooks, changelog generation, commit scopes/types, or GitHub API types. Covers @stacksjs/git, config/git.ts, config/commit.ts, and the git hooks system.
3
+ description: Use when working with git in a Stacks application - commit conventions, git hooks, changelog generation, commit scopes and types, GitHub API types, or resolving an in-progress merge or rebase conflict. Covers @stacksjs/git, config/git.ts, config/commit.ts, and the git hooks system.
4
4
  license: MIT
5
5
  compatibility: Bun >= 1.3.0, TypeScript
6
6
  allowed-tools: Read Edit Write Bash Grep Glob
@@ -147,12 +147,40 @@ interface WorkflowRun {
147
147
  }
148
148
  ```
149
149
 
150
+ ## Resolving a merge or rebase conflict
151
+
152
+ Resolve by **intent**, traced back to each side's primary source, never by
153
+ picking lines that look plausible.
154
+
155
+ 1. **See the current state.** `git status`, `git log --oneline --graph -20`, and
156
+ the conflicting files. Know which operation you are in the middle of, a merge
157
+ or a rebase, before touching anything.
158
+ 2. **Find the primary source for each side.** Read the commit messages, the PR,
159
+ the issue. Understand deeply why each change was made and what it was for. A
160
+ conflict is two intents colliding, and you cannot resolve it while you only
161
+ know one.
162
+ 3. **Resolve each hunk.** Preserve both intents where possible. Where they are
163
+ genuinely incompatible, pick the one matching the merge's stated goal and note
164
+ the trade-off. Do not invent new behaviour to bridge them. Always resolve,
165
+ never `--abort`.
166
+ 4. **Run the checks.** `./buddy lint`, `./buddy typecheck`, `./buddy test`. In
167
+ this framework two conflict classes survive a clean textual merge and only
168
+ show up here: a model changed on both sides, where the generated migrations
169
+ diverged and one has to be regenerated, and a registry file
170
+ (`app/Routes.ts`, `app/Events.ts`, `app/Middleware.ts`) where a dropped entry
171
+ fails silently rather than failing to compile.
172
+ 5. **Finish the operation.** Stage everything and commit, or continue the rebase
173
+ until every commit is replayed.
174
+
175
+ Credit: adapted from Matt Pocock's `resolving-merge-conflicts` skill (MIT),
176
+ <https://github.com/mattpocock/skills>.
177
+
150
178
  ## Gotchas
151
- - **`@stacksjs/git` is mostly re-exports** — actual functionality in `@stacksjs/gitlint`, `@stacksjs/gitit`, `bun-git-hooks`
152
- - **Pre-commit runs lint-staged** — the only default hook
153
- - **Emoji disabled by default** — `useEmoji: false` but emoji mappings exist for each type
154
- - **`buddy commit` runs `npm run commit`** — delegates to commitizen/cz-git flow
155
- - **Scopes dynamically extended** — component and function names merged into scopes at runtime
156
- - **Breaking changes only for feat/fix** — `allowBreakingChanges: ['feat', 'fix']`
157
- - **No max header length** — `maxHeaderLength: Infinity`
158
- - **Git hooks config re-exports** — `git-hooks.config.ts` just re-exports from `config/git.ts`
179
+ - **`@stacksjs/git` is mostly re-exports** - actual functionality in `@stacksjs/gitlint`, `@stacksjs/gitit`, `bun-git-hooks`
180
+ - **Pre-commit runs lint-staged** - the only default hook
181
+ - **Emoji disabled by default** - `useEmoji: false` but emoji mappings exist for each type
182
+ - **`buddy commit` runs `npm run commit`** - delegates to commitizen/cz-git flow
183
+ - **Scopes dynamically extended** - component and function names merged into scopes at runtime
184
+ - **Breaking changes only for feat/fix** - `allowBreakingChanges: ['feat', 'fix']`
185
+ - **No max header length** - `maxHeaderLength: Infinity`
186
+ - **Git hooks config re-exports** - `git-hooks.config.ts` just re-exports from `config/git.ts`
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: stacks-grilling
3
+ description: Use when a plan, design or decision needs stress-testing before any code is written, when the user asks to be grilled or to have their thinking challenged, or when another skill needs the round-and-frontier interview primitive. Produces a shared understanding, never code.
4
+ license: MIT
5
+ compatibility: Bun >= 1.3.0, TypeScript
6
+ allowed-tools: Read Edit Write Bash Grep Glob
7
+ ---
8
+
9
+ # Grilling
10
+
11
+ Interview the user relentlessly until you reach a shared understanding. Map the
12
+ work as a **design tree**: every decision branches into the decisions that hang
13
+ off it.
14
+
15
+ This is the interview primitive. `stacks-office-hours` runs it to shape a
16
+ product idea, `stacks-plan-review` runs it to settle an architecture, and
17
+ `stacks-redesign` runs it to pin down an aesthetic direction. Reach for it
18
+ directly when you want the interview with no wrapper around it.
19
+
20
+ Credit: adapted from Matt Pocock's `grilling` skill (MIT),
21
+ <https://github.com/mattpocock/skills>.
22
+
23
+ ## Rounds and the frontier
24
+
25
+ Work the tree in **rounds**. The **frontier** is every decision whose
26
+ prerequisites are already settled: the questions you can ask *now* without
27
+ guessing at answers you have not heard yet.
28
+
29
+ Ask the whole frontier in one round. Number each question and give your
30
+ recommended answer. Then wait for the user's answers before the next round.
31
+
32
+ ```
33
+ ❓ **Q1** - **<question title>**: <question body, possibly several paragraphs,
34
+ including the options you see>
35
+
36
+ ➡️ <your recommended answer>
37
+
38
+ ---
39
+
40
+ ❓ **Q2** - **<question title>**: <question body>
41
+
42
+ ➡️ <your recommended answer>
43
+ ```
44
+
45
+ Each round of answers reshapes the tree. Settled decisions push the frontier
46
+ outward and unblock questions that depended on them. Recompute the frontier and
47
+ ask the next round. A question whose answer depends on another question still
48
+ open in this round belongs to a *later* round, not this one.
49
+
50
+ ## Facts are your job, decisions are the user's
51
+
52
+ Finding *facts* is never the user's job. When a frontier question needs a fact
53
+ from the environment, go get it. In a Stacks project that means reading rather
54
+ than asking:
55
+
56
+ - `config/*.ts` for what is already configured, and which driver is selected.
57
+ - `app/Models/` and `storage/framework/defaults/app/Models/` for what the domain
58
+ already models.
59
+ - `routes/` for the surface that already exists.
60
+ - `buddy list` and `buddy <command> --help` for what the CLI already does.
61
+ - `CONTEXT.md` for the terms already settled.
62
+ - The relevant `stacks-*` skill for how a subsystem actually behaves.
63
+
64
+ Do not block on the lookup. A running exploration is an unsettled prerequisite,
65
+ so only the questions downstream of it wait. Ask the rest of the frontier now.
66
+
67
+ The *decisions* are the user's. Put each to them and wait.
68
+
69
+ ## Done
70
+
71
+ The session is done when the frontier is empty: every branch of the design tree
72
+ visited, nothing left silently assumed. Do not act on it until the user confirms
73
+ you have reached a shared understanding.
74
+
75
+ ## Do not build
76
+
77
+ No code during a grilling session. If the user reaches for an implementation
78
+ mid-interview, note the decision it implies, add it to the tree, and carry on.
79
+ Where a question genuinely cannot be settled in conversation because it needs a
80
+ runnable answer, reach for `stacks-prototype` and bring the result back.
81
+
82
+ ## Downstream
83
+
84
+ > Frontier empty? `/stacks-plan-review` turns the understanding into an
85
+ > implementation plan, or `/stacks-new-feature` slices it into tracer bullets.