@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.
- package/ai/AGENTS.md +25 -4
- package/ai/README.md +26 -4
- package/ai/skills/stacks-actions/SKILL.md +1 -1
- package/ai/skills/stacks-ai/SKILL.md +1 -1
- package/ai/skills/stacks-alias/SKILL.md +1 -1
- package/ai/skills/stacks-analytics/SKILL.md +1 -1
- package/ai/skills/stacks-api/SKILL.md +1 -1
- package/ai/skills/stacks-arrays/SKILL.md +1 -1
- package/ai/skills/stacks-auto-imports/SKILL.md +1 -1
- package/ai/skills/stacks-browse/SKILL.md +1 -1
- package/ai/skills/stacks-browser/SKILL.md +1 -1
- package/ai/skills/stacks-buddy/SKILL.md +1 -1
- package/ai/skills/stacks-build/SKILL.md +79 -5
- package/ai/skills/stacks-cache/SKILL.md +1 -1
- package/ai/skills/stacks-calendar/SKILL.md +1 -1
- package/ai/skills/stacks-chat/SKILL.md +1 -1
- package/ai/skills/stacks-cli/SKILL.md +1 -1
- package/ai/skills/stacks-cloud/SKILL.md +1 -1
- package/ai/skills/stacks-cms/SKILL.md +1 -1
- package/ai/skills/stacks-codebase-design/DEEPENING.md +79 -0
- package/ai/skills/stacks-codebase-design/DESIGN-IT-TWICE.md +72 -0
- package/ai/skills/stacks-codebase-design/SKILL.md +180 -0
- package/ai/skills/stacks-collections/SKILL.md +1 -1
- package/ai/skills/stacks-commerce/SKILL.md +141 -35
- package/ai/skills/stacks-composables/SKILL.md +1 -1
- package/ai/skills/stacks-config/SKILL.md +1 -1
- package/ai/skills/stacks-configuration/SKILL.md +1 -1
- package/ai/skills/stacks-cron/SKILL.md +1 -1
- package/ai/skills/stacks-crosswind/SKILL.md +1 -1
- package/ai/skills/stacks-database/SKILL.md +1 -1
- package/ai/skills/stacks-datetime/SKILL.md +1 -1
- package/ai/skills/stacks-dependencies/SKILL.md +1 -1
- package/ai/skills/stacks-deploy/SKILL.md +1 -1
- package/ai/skills/stacks-desktop/SKILL.md +1 -1
- package/ai/skills/stacks-development/SKILL.md +1 -1
- package/ai/skills/stacks-dns/SKILL.md +1 -1
- package/ai/skills/stacks-docs/SKILL.md +1 -1
- package/ai/skills/stacks-domain-modeling/FORMATS.md +123 -0
- package/ai/skills/stacks-domain-modeling/SKILL.md +109 -0
- package/ai/skills/stacks-enums/SKILL.md +1 -1
- package/ai/skills/stacks-error-handling/SKILL.md +1 -1
- package/ai/skills/stacks-events/SKILL.md +1 -1
- package/ai/skills/stacks-faker/SKILL.md +1 -1
- package/ai/skills/stacks-flow/PHASE-BOUNDARIES.md +91 -0
- package/ai/skills/stacks-flow/SKILL.md +117 -0
- package/ai/skills/stacks-git/SKILL.md +37 -9
- package/ai/skills/stacks-grilling/SKILL.md +85 -0
- package/ai/skills/stacks-guard/SKILL.md +86 -11
- package/ai/skills/stacks-guard/scripts/block-destructive.sh +67 -0
- package/ai/skills/stacks-handoff/SKILL.md +70 -0
- package/ai/skills/stacks-health/SKILL.md +1 -1
- package/ai/skills/stacks-http/SKILL.md +1 -1
- package/ai/skills/stacks-i18n/SKILL.md +1 -1
- package/ai/skills/stacks-investigate/SKILL.md +234 -106
- package/ai/skills/stacks-investigate/scripts/hitl-loop.template.sh +47 -0
- package/ai/skills/stacks-jobs/SKILL.md +1 -1
- package/ai/skills/stacks-listeners/SKILL.md +1 -1
- package/ai/skills/stacks-logging/SKILL.md +1 -1
- package/ai/skills/stacks-mail/SKILL.md +1 -1
- package/ai/skills/stacks-middleware/SKILL.md +1 -1
- package/ai/skills/stacks-migrations/SKILL.md +1 -1
- package/ai/skills/stacks-models/SKILL.md +1 -1
- package/ai/skills/stacks-new-feature/SKILL.md +65 -5
- package/ai/skills/stacks-notifications/SKILL.md +1 -1
- package/ai/skills/stacks-objects/SKILL.md +1 -1
- package/ai/skills/stacks-office-hours/SKILL.md +16 -2
- package/ai/skills/stacks-orm/SKILL.md +1 -1
- package/ai/skills/stacks-path/SKILL.md +1 -1
- package/ai/skills/stacks-payments/SKILL.md +35 -1
- package/ai/skills/stacks-plan-review/SKILL.md +27 -6
- package/ai/skills/stacks-plugins/SKILL.md +1 -1
- package/ai/skills/stacks-prototype/LOGIC.md +103 -0
- package/ai/skills/stacks-prototype/SKILL.md +66 -0
- package/ai/skills/stacks-prototype/UI.md +112 -0
- package/ai/skills/stacks-push/SKILL.md +1 -1
- package/ai/skills/stacks-query-builder/SKILL.md +1 -1
- package/ai/skills/stacks-queue/SKILL.md +1 -1
- package/ai/skills/stacks-realtime/SKILL.md +1 -1
- package/ai/skills/stacks-registry/SKILL.md +1 -1
- package/ai/skills/stacks-repl/SKILL.md +1 -1
- package/ai/skills/stacks-retro/SKILL.md +121 -75
- package/ai/skills/stacks-review/SKILL.md +182 -74
- package/ai/skills/stacks-router/SKILL.md +1 -1
- package/ai/skills/stacks-routes/SKILL.md +1 -1
- package/ai/skills/stacks-scaffolding/SKILL.md +1 -1
- package/ai/skills/stacks-scheduler/SKILL.md +1 -1
- package/ai/skills/stacks-search-engine/SKILL.md +1 -1
- package/ai/skills/stacks-security/SKILL.md +1 -1
- package/ai/skills/stacks-security-audit/SKILL.md +1 -1
- package/ai/skills/stacks-server/SKILL.md +1 -1
- package/ai/skills/stacks-shell/SKILL.md +1 -1
- package/ai/skills/stacks-slug/SKILL.md +1 -1
- package/ai/skills/stacks-sms/SKILL.md +1 -1
- package/ai/skills/stacks-socials/SKILL.md +1 -1
- package/ai/skills/stacks-storage/SKILL.md +1 -1
- package/ai/skills/stacks-strings/SKILL.md +1 -1
- package/ai/skills/stacks-stx/SKILL.md +1 -1
- package/ai/skills/stacks-tdd/EXAMPLES.md +136 -0
- package/ai/skills/stacks-tdd/SKILL.md +125 -0
- package/ai/skills/stacks-testing/SKILL.md +13 -3
- package/ai/skills/stacks-tunnel/SKILL.md +1 -1
- package/ai/skills/stacks-types/SKILL.md +1 -1
- package/ai/skills/stacks-ui/SKILL.md +1 -1
- package/ai/skills/stacks-utils/SKILL.md +1 -1
- package/ai/skills/stacks-validation/SKILL.md +1 -1
- package/ai/skills/stacks-whois/SKILL.md +1 -1
- package/ai/skills/stacks-wizard/SKILL.md +127 -0
- package/ai/skills/stacks-wizard/scripts/template.sh +208 -0
- package/ai/skills/stacks-writing-for-agents/MECHANICS.md +125 -0
- package/ai/skills/stacks-writing-for-agents/SKILL.md +218 -0
- package/app/Actions/Auth/GenerateTwoFactorSecretAction.ts +12 -2
- package/app/Actions/Commerce/Shipping/{DriverDestroyAction.ts → CourierDestroyAction.ts} +6 -6
- package/app/Actions/Commerce/Shipping/{DriverIndexAction.ts → CourierIndexAction.ts} +3 -3
- package/app/Actions/Commerce/Shipping/CourierPingStoreAction.ts +61 -0
- package/app/Actions/Commerce/Shipping/{DriverShowAction.ts → CourierShowAction.ts} +5 -5
- package/app/Actions/Commerce/Shipping/{DriverStoreAction.ts → CourierStoreAction.ts} +4 -4
- package/app/Actions/Commerce/Shipping/{DriverUpdateAction.ts → CourierUpdateAction.ts} +6 -6
- package/app/Actions/Commerce/Shipping/DeliveryRouteStartAction.ts +38 -0
- package/app/Actions/Commerce/Shipping/DeliveryStopCompleteAction.ts +40 -0
- package/app/Actions/Commerce/Shipping/DeliveryStopFailAction.ts +44 -0
- package/app/Actions/Commerce/Shipping/DeliveryStopStartAction.ts +39 -0
- package/app/Actions/Commerce/Shipping/courier-session.ts +75 -0
- package/app/Actions/Commerce/commerce-action.test.ts +5 -5
- package/app/Actions/Dashboard/Commerce/CommerceDeliveryAction.ts +5 -5
- package/app/Actions/Dashboard/Commerce/CourierIndexAction.ts +24 -0
- package/app/Actions/Dashboard/Commerce/DeliveryRouteIndexAction.ts +7 -7
- package/app/Actions/Dashboard/Commerce/commerce-delivery.test.ts +11 -11
- package/app/Actions/Dashboard/Commerce/commerce-delivery.ts +29 -29
- package/app/Actions/Dashboard/Commerce/{driver-records.test.ts → courier-records.test.ts} +9 -9
- package/app/Actions/Dashboard/Commerce/{driver-records.ts → courier-records.ts} +14 -14
- package/app/Actions/Dashboard/Commerce/delivery-route-records.test.ts +13 -13
- package/app/Actions/Dashboard/Commerce/delivery-route-records.ts +25 -25
- package/app/Models/User.ts +1 -1
- package/app/Models/commerce/{Driver.ts → Courier.ts} +7 -7
- package/app/Models/commerce/{DriverPing.ts → CourierPing.ts} +7 -7
- package/app/Models/commerce/DeliveryRoute.ts +6 -6
- package/app/Models/commerce/DeliveryStop.ts +31 -8
- package/bootstrap.ts +7 -0
- package/functions/commerce/shippings/couriers.ts +19 -0
- package/ide/vscode/package.json +1 -1
- package/package.json +4 -3
- package/resources/components/Dashboard/Commerce/Delivery/{DriverDeleteDialog.stx → CourierDeleteDialog.stx} +5 -5
- package/resources/components/Dashboard/Commerce/Delivery/{DriverDialog.stx → CourierDialog.stx} +10 -10
- package/resources/components/Dashboard/Commerce/Delivery/{DriversDashboard.stx → CouriersDashboard.stx} +43 -43
- package/resources/components/Dashboard/Commerce/Delivery/{DriversTable.stx → CouriersTable.stx} +21 -21
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryOverviewDashboard.stx +18 -18
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDeleteDialog.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDialog.stx +22 -22
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesDashboard.stx +24 -24
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +8 -8
- package/resources/components/Dashboard/Commerce/Delivery/TabNavigation.stx +1 -1
- package/resources/functions/dashboard/data.ts +1 -1
- package/resources/functions/dashboard/sidebar.ts +2 -2
- package/routes/dashboard-api.ts +6 -6
- package/routes/dashboard.ts +7 -7
- package/routes/delivery.ts +24 -0
- package/types/defaults.ts +3 -3
- package/views/dashboard/.discovered-models.json +18 -18
- package/views/dashboard/AUDIT.md +1 -1
- package/views/dashboard/commerce/delivery/{drivers.stx → couriers.stx} +2 -2
- package/views/dashboard/composables/useChart.ts +16 -2
- package/views/dashboard/layouts/default.stx +1 -1
- package/app/Actions/Dashboard/Commerce/DriverIndexAction.ts +0 -24
- package/functions/commerce/shippings/drivers.ts +0 -19
|
@@ -1,122 +1,168 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: stacks-retro
|
|
3
|
-
description: Use for
|
|
3
|
+
description: Use for a retrospective on Stacks work - proposing concrete improvements to the agent's environment (navigation pointers, automated checks, AGENTS.md, skills, tool economy) from what actually went wrong, backed by git-derived session data. Invoke with /stacks-retro.
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: Bun >= 1.3.0, TypeScript
|
|
6
6
|
allowed-tools: Read Edit Write Bash Grep Glob
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
# /stacks-retro
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
# /stacks-retro - session retrospective
|
|
10
|
+
|
|
11
|
+
A retrospective here is not a report card. You are proposing improvements to the
|
|
12
|
+
**environment** the next session runs in, so that the mistakes this session made
|
|
13
|
+
become impossible or cheap to catch. Pass 1 finds the improvements. Pass 2 backs
|
|
14
|
+
them with data from git.
|
|
15
|
+
|
|
16
|
+
Call the Skill tool with `stacks-writing-for-agents` before proposing any change
|
|
17
|
+
to a document. Half the candidates below are edits to files agents read, and a
|
|
18
|
+
retro that adds sediment to `AGENTS.md` has made things worse.
|
|
19
|
+
|
|
20
|
+
Credit: the environment-improvement framing is adapted from Matt Pocock's `retro`
|
|
21
|
+
skill (MIT), <https://github.com/mattpocock/skills>.
|
|
22
|
+
|
|
23
|
+
## Pass 1: environment improvements
|
|
24
|
+
|
|
25
|
+
### Read the primary sources
|
|
26
|
+
|
|
27
|
+
Read the session the user names, defaulting to the current one. Where the session
|
|
28
|
+
is not in context, reconstruct it from the diff, the commits, and any session
|
|
29
|
+
logs on this machine. Work from what actually happened, not from a summary.
|
|
30
|
+
|
|
31
|
+
### Look for candidates in these categories
|
|
32
|
+
|
|
33
|
+
- **Navigation.** How easy was it to find the right file? Are there hidden
|
|
34
|
+
dependencies between files? Would a **navigation pointer** in `AGENTS.md`, or a
|
|
35
|
+
`Key paths` block in the relevant skill, have shortened it? *Use when* the
|
|
36
|
+
session spent a long time hunting for one piece of information.
|
|
37
|
+
- **Automated checks.** Could a check have caught this mistake? `pickier` rules,
|
|
38
|
+
a type, a test, a contract test in `tests/unit/`, a `buddy` command that
|
|
39
|
+
validates a registry. *Use when* the agent made a mistake a machine could have
|
|
40
|
+
caught. This is the strongest category, because a check does not depend on
|
|
41
|
+
anyone reading anything.
|
|
42
|
+
- **Coding standards.** Should the review get a new rule to enforce, or should an
|
|
43
|
+
existing one be removed or clarified? *Use when* `/stacks-review` missed
|
|
44
|
+
something it should have caught.
|
|
45
|
+
- **AGENTS.md.** Are there steering instructions that belong in a check or a
|
|
46
|
+
skill instead? Is anything in it a **no-op**, an instruction the model already
|
|
47
|
+
obeys by default? *Use when* the file is large and unwieldy, in the repo or in
|
|
48
|
+
the user's global scope.
|
|
49
|
+
- **Skills.** Did the agent guess at an API a skill documents? Then the skill's
|
|
50
|
+
**description** is the bug, not its body: the pointer did not fire. Did the
|
|
51
|
+
agent read a skill and still get it wrong? Then the body is the bug. Did the
|
|
52
|
+
work touch a subsystem with no skill? That is a new one under `app/Skills/`.
|
|
53
|
+
- **Tool economy.** Did the agent make expensive calls that could be streamlined?
|
|
54
|
+
Is a custom command or MCP server particularly token-inefficient? *Use when*
|
|
55
|
+
one call dominated the session.
|
|
56
|
+
- **Information access.** Could the agent have been given more? Teeing
|
|
57
|
+
`buddy dev` output to a file it can read, `storage/logs/stacks.log`, read-only
|
|
58
|
+
access to a dashboard or a third-party console. *Use when* a crucial fact was
|
|
59
|
+
simply not reachable.
|
|
60
|
+
- **Generated artifacts going stale.** Did the session trip over
|
|
61
|
+
`storage/framework/types/*.d.ts`, an auto-import manifest, or a migration that
|
|
62
|
+
no longer matched its model? The fix is usually a check that regenerates and
|
|
63
|
+
diffs in CI, not a line asking someone to remember.
|
|
64
|
+
|
|
65
|
+
### Present them
|
|
66
|
+
|
|
67
|
+
In order of severity, each as: what happened, which category, the specific change
|
|
68
|
+
to make, and where it goes. Be concrete. "Add a note about migrations" is not a
|
|
69
|
+
candidate. "Add a contract test in `tests/unit/` that fails when
|
|
70
|
+
`database/types.d.ts` is missing a table any migration creates" is.
|
|
71
|
+
|
|
72
|
+
Ask before writing any of them.
|
|
73
|
+
|
|
74
|
+
## Pass 2: the data
|
|
75
|
+
|
|
76
|
+
Back the observations with git rather than impressions.
|
|
77
|
+
|
|
78
|
+
### Session detection
|
|
79
|
+
|
|
80
|
+
Detect sessions with a **45-minute gap threshold** between commits.
|
|
16
81
|
|
|
17
82
|
```bash
|
|
18
83
|
git log --all --format="%H|%ai|%an|%s" --since="7 days ago"
|
|
19
84
|
```
|
|
20
85
|
|
|
21
|
-
Adjust `--since`
|
|
86
|
+
Adjust `--since` for the range the user asked for. Default to 7 days.
|
|
22
87
|
|
|
23
|
-
|
|
88
|
+
### Commit categorization
|
|
24
89
|
|
|
25
90
|
| Category | Indicators | Icon |
|
|
26
|
-
|
|
91
|
+
|---|---|---|
|
|
27
92
|
| Feature | `feat:`, new files, new exports | 🟢 |
|
|
28
|
-
| Fix | `fix
|
|
29
|
-
| Refactor | `refactor
|
|
93
|
+
| Fix | `fix:` | 🔴 |
|
|
94
|
+
| Refactor | `refactor:` | 🔵 |
|
|
30
95
|
| Test | `test:`, test file changes | 🟡 |
|
|
31
96
|
| Docs | `docs:`, README changes | 📝 |
|
|
32
97
|
| Chore | `chore:`, deps, config, CI | ⚙️ |
|
|
33
98
|
| Style | `style:`, formatting, lint | 🎨 |
|
|
34
99
|
|
|
35
|
-
Parse
|
|
100
|
+
Parse the conventional-commit prefixes and the scopes from `config/git.ts`.
|
|
36
101
|
|
|
37
|
-
|
|
102
|
+
### Focus
|
|
38
103
|
|
|
39
|
-
### Focus Score (0-100)
|
|
40
104
|
```
|
|
41
|
-
|
|
105
|
+
focus = (commits in the primary area / total commits) × 100
|
|
42
106
|
```
|
|
43
107
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
- **50-79**: Moderate focus
|
|
48
|
-
- **0-49**: Scattered
|
|
108
|
+
The primary area is the most-touched `storage/framework/core/*/` package or
|
|
109
|
+
top-level directory. 80+ is deep focus, 50 to 79 is moderate, below 50 is
|
|
110
|
+
scattered.
|
|
49
111
|
|
|
50
112
|
```
|
|
51
|
-
### Session [N]: [start]
|
|
52
|
-
**Focus**: [score]/100
|
|
53
|
-
**Primary area**: [package
|
|
113
|
+
### Session [N]: [start] to [end] ([duration])
|
|
114
|
+
**Focus**: [score]/100
|
|
115
|
+
**Primary area**: [package or directory]
|
|
54
116
|
**Commits**: [count]
|
|
55
117
|
|
|
56
118
|
| Time | Category | Message | Files |
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
**Observation**: [one behavioral insight]
|
|
119
|
+
|---|---|---|---|
|
|
60
120
|
```
|
|
61
121
|
|
|
62
|
-
|
|
122
|
+
### Signals worth reading
|
|
63
123
|
|
|
64
|
-
|
|
65
|
-
git log --all --format="%ad" --date=short | sort -u
|
|
66
|
-
```
|
|
124
|
+
A pattern in the data is only interesting when it points at a Pass 1 candidate:
|
|
67
125
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
| Contributor | Commits | Primary Focus | Top Category | Avg Focus |
|
|
79
|
-
|-------------|---------|---------------|--------------|-----------|
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Step 6: Behavioral Observations
|
|
83
|
-
|
|
84
|
-
2-4 observations backed by data:
|
|
85
|
-
|
|
86
|
-
- "You wrote 12 fix commits after the auth refactor — consider adding tests before next refactor session."
|
|
87
|
-
- "Focus score drops in afternoon sessions. Morning sessions average 85."
|
|
88
|
-
- "No test commits this week despite 8 feature commits. Test debt accumulating."
|
|
89
|
-
- "3/4 sessions started with chore commits. Consider batching into a maintenance session."
|
|
126
|
+
- A run of `fix:` commits after one `refactor:` is a missing check or a missing
|
|
127
|
+
test at that seam.
|
|
128
|
+
- Feature commits with no test commits is accumulating debt with a name and a
|
|
129
|
+
location.
|
|
130
|
+
- Repeated chore commits at the start of every session is a setup step that wants
|
|
131
|
+
automating.
|
|
132
|
+
- A low focus score across a week where each session is individually focused is
|
|
133
|
+
usually a navigation problem, not a discipline one.
|
|
90
134
|
|
|
91
135
|
## Output
|
|
92
136
|
|
|
93
137
|
```
|
|
94
|
-
# Retrospective: [
|
|
138
|
+
# Retrospective: [range]
|
|
95
139
|
|
|
96
|
-
##
|
|
97
|
-
|
|
98
|
-
- **Sessions**: [count]
|
|
99
|
-
- **Total commits**: [count]
|
|
140
|
+
## Improvements
|
|
141
|
+
[candidates, most severe first, each with its category and the exact change]
|
|
100
142
|
|
|
101
|
-
##
|
|
102
|
-
|
|
143
|
+
## Data
|
|
144
|
+
- Period, sessions, commits
|
|
145
|
+
- Category breakdown
|
|
146
|
+
- Sessions and focus
|
|
147
|
+
- Signals
|
|
103
148
|
|
|
104
|
-
##
|
|
105
|
-
[session details]
|
|
106
|
-
|
|
107
|
-
## Streaks
|
|
108
|
-
[streak data]
|
|
109
|
-
|
|
110
|
-
## Observations
|
|
111
|
-
[behavioral insights]
|
|
112
|
-
|
|
113
|
-
## Suggested Focus for Next Session
|
|
149
|
+
## Next session
|
|
114
150
|
[one specific suggestion]
|
|
115
151
|
```
|
|
116
152
|
|
|
117
153
|
## Rules
|
|
118
154
|
|
|
119
|
-
- **
|
|
120
|
-
- **
|
|
121
|
-
|
|
122
|
-
- **
|
|
155
|
+
- **Every observation is backed by a commit, a diff or a log line.** No vibes.
|
|
156
|
+
- **Propose environment changes, not personal ones.** No comment on when someone
|
|
157
|
+
works or how fast.
|
|
158
|
+
- **Prefer a check to a sentence.** A rule nobody reads is a rule that does not
|
|
159
|
+
exist.
|
|
160
|
+
- **Deleting counts.** A no-op line removed from `AGENTS.md` is as good a
|
|
161
|
+
candidate as a new one added.
|
|
162
|
+
- **Handle messy history gracefully.** Squash, merge and rebase distort session
|
|
163
|
+
boundaries. Say so rather than inventing precision.
|
|
164
|
+
|
|
165
|
+
## Downstream
|
|
166
|
+
|
|
167
|
+
> Candidate accepted? `/stacks-writing-for-agents` for anything that lands in a
|
|
168
|
+
> document, `/stacks-tdd` for anything that lands as a test.
|
|
@@ -1,135 +1,243 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: stacks-review
|
|
3
|
-
description: Use when reviewing code changes in
|
|
3
|
+
description: Use when reviewing code changes in a Stacks project - a PR, a branch, staged work, or the diff since a fixed point. Reviews on two axes, Standards (does it follow this repo's rules and avoid the smell baseline) and Spec (does it do what was asked), plus a test coverage audit and an auto-fix pass. Invoke with /stacks-review.
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: Bun >= 1.3.0, TypeScript
|
|
6
6
|
allowed-tools: Read Edit Write Bash Grep Glob
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
# /stacks-review
|
|
9
|
+
# /stacks-review - code review
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Two-axis review of a diff. Be direct, specific and opinionated. Every finding
|
|
12
|
+
references a file and a line.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
- **Standards**: does the code follow this repo's rules, and is it free of the
|
|
15
|
+
smell baseline below?
|
|
16
|
+
- **Spec**: does the code faithfully implement what the originating issue, spec
|
|
17
|
+
or conversation asked for?
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
A change can pass one axis and fail the other. Code that follows every rule and
|
|
20
|
+
implements the wrong thing passes Standards and fails Spec. Code that does
|
|
21
|
+
exactly what the issue asked while breaking the project's conventions does the
|
|
22
|
+
reverse. Reporting them separately stops one axis from masking the other, so
|
|
23
|
+
**do not merge or rerank across axes**.
|
|
18
24
|
|
|
19
|
-
|
|
25
|
+
Credit: the two-axis structure and the Fowler smell baseline are adapted from
|
|
26
|
+
Matt Pocock's `code-review` skill (MIT), <https://github.com/mattpocock/skills>.
|
|
20
27
|
|
|
21
|
-
##
|
|
28
|
+
## 1. Pin the scope
|
|
22
29
|
|
|
23
|
-
|
|
30
|
+
1. If the user gives a PR number, branch, tag or commit, that is the fixed point.
|
|
31
|
+
Diff with `git diff <fixed-point>...HEAD` (three dots, so the comparison is
|
|
32
|
+
against the merge base) and list the commits with
|
|
33
|
+
`git log <fixed-point>..HEAD --oneline`.
|
|
34
|
+
2. If no scope is given, review staged changes (`git diff --cached`). If nothing
|
|
35
|
+
is staged, review unstaged (`git diff`).
|
|
36
|
+
3. If there are no changes at all, ask what to review.
|
|
24
37
|
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
- Missing auth/authorization checks on API routes
|
|
29
|
-
- Unsafe deserialization or eval usage
|
|
30
|
-
- Improper input validation at system boundaries
|
|
38
|
+
Confirm the ref resolves (`git rev-parse <fixed-point>`) and the diff is
|
|
39
|
+
non-empty before going further. A bad ref should fail here, not inside two
|
|
40
|
+
parallel sub-agents.
|
|
31
41
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- Off-by-one errors, null/undefined access without guards
|
|
35
|
-
- Resource leaks (unclosed database connections, missing `db.close()`)
|
|
36
|
-
- Incorrect error handling (swallowed errors, wrong error types)
|
|
37
|
-
- Logic errors in ORM model definitions or migration files
|
|
42
|
+
Read the changed files in full. A diff without its surrounding context produces
|
|
43
|
+
confident nonsense.
|
|
38
44
|
|
|
39
|
-
|
|
40
|
-
- Incorrect model attribute definitions (wrong validator types, missing `factory` for seeder)
|
|
41
|
-
- Broken route definitions (missing middleware, wrong action paths)
|
|
42
|
-
- Misconfigured `config/*.ts` files
|
|
43
|
-
- Breaking changes to `@stacksjs/*` package exports
|
|
44
|
-
- Migration files that won't work on SQLite (check preprocessing quirks)
|
|
45
|
+
## 2. Identify the spec source
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
Look for what the change was supposed to do, in this order:
|
|
48
|
+
|
|
49
|
+
1. Issue references in the commit messages (`#123`, `Closes #45`), fetched with
|
|
50
|
+
`gh issue view`.
|
|
51
|
+
2. A path the user passed as an argument.
|
|
52
|
+
3. A spec or plan under `docs/`, `.scratch/`, or a design document from
|
|
53
|
+
`/stacks-office-hours` or `/stacks-plan-review`.
|
|
54
|
+
4. The conversation itself, if the work happened in this session.
|
|
55
|
+
|
|
56
|
+
If nothing is found, ask. If the user says there is no spec, the Spec axis
|
|
57
|
+
reports "no spec available" and you review Standards only.
|
|
58
|
+
|
|
59
|
+
## 3. Run both axes
|
|
60
|
+
|
|
61
|
+
Both axes run as **parallel sub-agents** so they do not pollute each other's
|
|
62
|
+
context, then this skill aggregates. Give each the diff command, the commit list,
|
|
63
|
+
and its own brief.
|
|
64
|
+
|
|
65
|
+
### Standards axis
|
|
66
|
+
|
|
67
|
+
Sources, in order of authority:
|
|
68
|
+
|
|
69
|
+
1. `AGENTS.md` at the repo root. It is the project's own rules and it **wins over
|
|
70
|
+
everything below**.
|
|
71
|
+
2. The relevant `stacks-*` skill for whatever the diff touches. A model change is
|
|
72
|
+
reviewed against `stacks-models`, a route change against `stacks-router`.
|
|
73
|
+
3. The smell baseline below, which applies even where nothing is documented.
|
|
74
|
+
|
|
75
|
+
Skip anything tooling already enforces. `pickier` catches formatting and lint,
|
|
76
|
+
`tsgo` catches types, so a finding that repeats them is noise.
|
|
77
|
+
|
|
78
|
+
#### Critical findings
|
|
79
|
+
|
|
80
|
+
Must be fixed before merge. Only flag at confidence 8/10 or higher.
|
|
81
|
+
|
|
82
|
+
**Security**: SQL injection, XSS, command injection, path traversal. Hardcoded
|
|
83
|
+
secrets, keys or tokens (check `config/services.ts` and anything env-shaped).
|
|
84
|
+
Missing auth or authorization on a route. Unsafe deserialization or `eval`.
|
|
85
|
+
Missing validation at a system boundary.
|
|
86
|
+
|
|
87
|
+
**Correctness**: races and missing `await`. Off-by-one. Null or undefined access
|
|
88
|
+
with no guard. Resource leaks, including unclosed database connections. Swallowed
|
|
89
|
+
errors and wrong error types. Logic errors in model definitions or migrations.
|
|
90
|
+
|
|
91
|
+
**Stacks-specific**:
|
|
92
|
+
|
|
93
|
+
- Model attributes with the wrong validator type, or a fillable attribute with no
|
|
94
|
+
`factory` where `useSeeder` is on.
|
|
95
|
+
- A model change with no regenerated migration, or a generated migration nobody
|
|
96
|
+
read.
|
|
97
|
+
- Routes pointing at an action path that does not resolve, or missing the
|
|
98
|
+
middleware their siblings carry.
|
|
99
|
+
- A registry that silently drops the entry: `app/Routes.ts`, `app/Events.ts`,
|
|
100
|
+
`app/Middleware.ts`, `app/Listener.ts`, `app/Scheduler.ts`. These fail by doing
|
|
101
|
+
nothing.
|
|
102
|
+
- Breaking changes to a `@stacksjs/*` package's public exports, and relative type
|
|
103
|
+
imports that escape the package, which degrade consumers to `any`.
|
|
104
|
+
- Migrations that will not run on SQLite.
|
|
105
|
+
- Vanilla JS in an stx template (`var`, `document.*`, `window.*`), a hand-rolled
|
|
106
|
+
SVG icon path, a new icon or animation dependency.
|
|
107
|
+
- An em-dash in any user-visible string.
|
|
47
108
|
|
|
48
109
|
```
|
|
49
110
|
🔴 CRITICAL: [title]
|
|
50
111
|
File: [path]:[line]
|
|
51
112
|
Issue: [specific description]
|
|
52
|
-
Impact: [what
|
|
53
|
-
Fix: [concrete fix
|
|
113
|
+
Impact: [what goes wrong]
|
|
114
|
+
Fix: [the concrete fix]
|
|
54
115
|
```
|
|
55
116
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
117
|
+
#### Smell baseline
|
|
118
|
+
|
|
119
|
+
A fixed set of Fowler code smells (*Refactoring*, ch.3) that applies even when a
|
|
120
|
+
repo documents nothing. Two rules bind it: **the repo overrides**, so where
|
|
121
|
+
`AGENTS.md` or a `stacks-*` skill endorses something the baseline would flag,
|
|
122
|
+
suppress it. And each smell is **always a judgement call**, a labelled heuristic
|
|
123
|
+
("possible feature envy"), never a hard violation.
|
|
124
|
+
|
|
125
|
+
Each reads *what it is* then *how to fix*. Match against the diff:
|
|
126
|
+
|
|
127
|
+
- **Mysterious name**: a function, variable or type whose name does not reveal
|
|
128
|
+
what it does. Rename it, and if no honest name comes, the design is murky.
|
|
129
|
+
- **Duplicated code**: the same logic shape in more than one hunk or file.
|
|
130
|
+
Extract the shape and call it from both. In this framework, the fifth
|
|
131
|
+
near-identical action usually wants to be a trait.
|
|
132
|
+
- **Feature envy**: a method reaching into another object's data more than its
|
|
133
|
+
own. Move it onto the data it envies.
|
|
134
|
+
- **Data clumps**: the same few fields travelling together, a type wanting to be
|
|
135
|
+
born. Bundle them.
|
|
136
|
+
- **Primitive obsession**: a string or number standing in for a domain concept.
|
|
137
|
+
Give the concept its own small type, and its own name in `CONTEXT.md`.
|
|
138
|
+
- **Repeated switches**: the same cascade on the same type recurring across the
|
|
139
|
+
change. Replace with polymorphism, a driver, or one shared map.
|
|
140
|
+
- **Shotgun surgery**: one logical change forcing scattered edits across many
|
|
141
|
+
files. Gather what changes together.
|
|
142
|
+
- **Divergent change**: one file edited for several unrelated reasons. Split so
|
|
143
|
+
each module changes for one reason.
|
|
144
|
+
- **Speculative generality**: abstraction, params or hooks added for needs the
|
|
145
|
+
spec does not have. Delete it. One adapter is a hypothetical seam.
|
|
146
|
+
- **Message chains**: long `a.b().c().d()` navigation the caller should not
|
|
147
|
+
depend on. Hide the walk behind one method.
|
|
148
|
+
- **Middle man**: a class or function that mostly delegates onward. Call the real
|
|
149
|
+
target.
|
|
150
|
+
- **Refused bequest**: a subclass that ignores most of what it inherits. Use
|
|
151
|
+
composition.
|
|
70
152
|
|
|
71
153
|
```
|
|
72
154
|
🟡 INFO: [title]
|
|
73
155
|
File: [path]:[line]
|
|
74
|
-
Note: [observation]
|
|
156
|
+
Note: [observation, and which smell if it is one]
|
|
75
157
|
Suggestion: [improvement]
|
|
76
158
|
```
|
|
77
159
|
|
|
78
|
-
|
|
160
|
+
Also flag here: `any` where a discriminated union or `satisfies` would do,
|
|
161
|
+
misleading names, errors that lose their stack, dead code introduced by the
|
|
162
|
+
change, N+1 queries through a relationship, and a PR title that fails the
|
|
163
|
+
conventional-commit rules in `config/commit.ts`.
|
|
164
|
+
|
|
165
|
+
### Spec axis
|
|
79
166
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
167
|
+
Report:
|
|
168
|
+
|
|
169
|
+
- Requirements the spec asked for that are **missing or partial**.
|
|
170
|
+
- Behaviour in the diff that **was not asked for**, which is scope creep.
|
|
171
|
+
- Requirements that look implemented but where the implementation looks **wrong**.
|
|
172
|
+
|
|
173
|
+
Quote the spec line for each finding. Keep it under 400 words.
|
|
174
|
+
|
|
175
|
+
## 4. Test coverage audit
|
|
176
|
+
|
|
177
|
+
1. Identify every changed function, action, model attribute and route.
|
|
178
|
+
2. Search `tests/` for existing coverage.
|
|
179
|
+
3. List the untested paths.
|
|
83
180
|
|
|
84
181
|
```
|
|
85
|
-
## Test
|
|
182
|
+
## Test coverage
|
|
86
183
|
|
|
87
|
-
| Changed
|
|
88
|
-
|
|
89
|
-
| [function] | [
|
|
184
|
+
| Changed | Test file | Covered? |
|
|
185
|
+
|---|---|---|
|
|
186
|
+
| [function or route] | [path or "none"] | ✅ / ❌ |
|
|
90
187
|
|
|
91
188
|
Missing coverage:
|
|
92
189
|
- [untested path or edge case]
|
|
93
190
|
```
|
|
94
191
|
|
|
95
|
-
|
|
192
|
+
Judge the tests you find, not just their existence. A test that mocks an internal
|
|
193
|
+
collaborator or recomputes its own expected value is worse than no test, because
|
|
194
|
+
it reports green. `stacks-tdd` has the anti-pattern list.
|
|
96
195
|
|
|
97
|
-
|
|
196
|
+
## 5. Auto-fix
|
|
98
197
|
|
|
99
|
-
|
|
198
|
+
After presenting the findings, ask:
|
|
100
199
|
|
|
101
|
-
|
|
200
|
+
> Want me to fix the mechanical issues? Formatting, imports, simple type fixes.
|
|
102
201
|
|
|
103
|
-
|
|
202
|
+
If yes, fix **only** mechanical issues, then run `./buddy lint:fix` and
|
|
203
|
+
`./buddy typecheck`. Never auto-fix architectural decisions, logic changes, or
|
|
204
|
+
anything with several valid approaches.
|
|
104
205
|
|
|
105
|
-
## Output
|
|
206
|
+
## Output
|
|
106
207
|
|
|
107
208
|
```
|
|
108
|
-
# Code
|
|
209
|
+
# Code review: [brief description]
|
|
109
210
|
|
|
110
|
-
##
|
|
111
|
-
[findings
|
|
211
|
+
## Standards
|
|
212
|
+
[critical findings, then informational]
|
|
112
213
|
|
|
113
|
-
##
|
|
114
|
-
[findings]
|
|
214
|
+
## Spec
|
|
215
|
+
[findings, or "no spec available"]
|
|
115
216
|
|
|
116
|
-
## Test
|
|
217
|
+
## Test coverage
|
|
117
218
|
[table]
|
|
118
219
|
|
|
119
220
|
## Summary
|
|
120
|
-
-
|
|
121
|
-
-
|
|
221
|
+
- Standards: [count], worst: [issue]
|
|
222
|
+
- Spec: [count], worst: [issue]
|
|
122
223
|
- Test gaps: [count]
|
|
123
224
|
```
|
|
124
225
|
|
|
226
|
+
The summary names the worst issue **within each axis**. Do not pick a single
|
|
227
|
+
winner across axes, because that is the reranking the separation exists to
|
|
228
|
+
prevent.
|
|
229
|
+
|
|
125
230
|
## Rules
|
|
126
231
|
|
|
127
|
-
- Never say "consider" or "you might want to"
|
|
128
|
-
- Every finding
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
|
|
232
|
+
- Never say "consider" or "you might want to". It is a problem or it is not.
|
|
233
|
+
- Every finding carries a concrete fix.
|
|
234
|
+
- Do not flag what `pickier` or `tsgo` already catches.
|
|
235
|
+
- Do not review generated files, lock files, `storage/framework/types/*.d.ts`, or
|
|
236
|
+
anything under a `dist/`.
|
|
237
|
+
- For monorepo changes, check cross-package impact. A change in
|
|
238
|
+
`storage/framework/core/` can reach 15+ downstream packages.
|
|
132
239
|
|
|
133
240
|
## Downstream
|
|
134
241
|
|
|
135
|
-
> **Review complete.** Run `/stacks-browse` to QA in the browser, or
|
|
242
|
+
> **Review complete.** Run `/stacks-browse` to QA in the browser, or
|
|
243
|
+
> `/stacks-retro` to turn the findings into environment improvements.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: stacks-router
|
|
3
|
-
description: Use when working with routing in a Stacks application
|
|
3
|
+
description: Use when working with routing in a Stacks application - defining routes, HTTP methods, route groups, middleware, named routes, URL generation, request enhancement (Laravel-style input/query/file helpers), response helpers, error responses, route model binding, or rate limiting. Covers @stacksjs/router, routes/, and app/Routes.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-routes
|
|
3
|
-
description: Use when defining or organizing route files in a Stacks application
|
|
3
|
+
description: Use when defining or organizing route files in a Stacks application - creating route files in routes/, registering them in app/Routes.ts, using route prefixes and middleware groups, or the default API routes structure. For the router API itself (request helpers, response helpers, middleware classes), see stacks-router.
|
|
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-scaffolding
|
|
3
|
-
description: Use when generating new code with Stacks
|
|
3
|
+
description: Use when generating new code with Stacks - buddy make commands, project scaffolding, component/page/store/layout generation, or project templates. Covers buddy make:* commands and STX scaffolding utilities.
|
|
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-scheduler
|
|
3
|
-
description: Use when scheduling tasks in a Stacks application
|
|
3
|
+
description: Use when scheduling tasks in a Stacks application - defining scheduled tasks, cron-like scheduling, or task automation. Covers @stacksjs/scheduler, @stacksjs/cron, and app/Scheduler.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-search-engine
|
|
3
|
-
description: Use when implementing search in Stacks
|
|
3
|
+
description: Use when implementing search in Stacks - full-text search with Meilisearch or Algolia backends, document indexing, search settings management, the useSearch model trait for automatic indexing, or search driver configuration. Covers @stacksjs/search-engine and config/search-engine.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-security
|
|
3
|
-
description: Use when implementing security in Stacks
|
|
3
|
+
description: Use when implementing security in Stacks - password hashing (bcrypt/argon2), app key generation, AES encryption/decryption, hash verification, rehashing detection, or security configuration (firewall, rate limiting, IP allowlists). Covers @stacksjs/security and config/security.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-security-audit
|
|
3
|
-
description: Use when performing security analysis on a Stacks application
|
|
3
|
+
description: Use when performing security analysis on a Stacks application - OWASP Top 10, STRIDE threat modeling, attack surface mapping, dependency audit. Requires concrete exploit scenarios. Invoke with /stacks-security-audit.
|
|
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-server
|
|
3
|
-
description: Use when working with the Stacks development or production server
|
|
3
|
+
description: Use when working with the Stacks development or production server - server configuration, server middleware, or server startup. Covers @stacksjs/server and storage/framework/server/.
|
|
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-shell
|
|
3
|
-
description: Use when executing shell commands in a Stacks application
|
|
3
|
+
description: Use when executing shell commands in a Stacks application - running system commands, process management, or using the shell operator. Covers @stacksjs/shell which wraps Bun's native $ operator.
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: Bun >= 1.3.0, TypeScript
|
|
6
6
|
allowed-tools: Read Edit Write Bash Grep Glob
|