@stacksjs/defaults 0.72.103 → 0.73.1
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/app/Actions/Dashboard/Commerce/DriverIndexAction.ts +0 -24
- package/functions/commerce/shippings/drivers.ts +0 -19
package/ai/AGENTS.md
CHANGED
|
@@ -63,12 +63,33 @@ same path under `app/` and it wins.
|
|
|
63
63
|
|
|
64
64
|
## Skills
|
|
65
65
|
|
|
66
|
-
The framework ships
|
|
67
|
-
`storage/framework/defaults/ai/skills
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
The framework ships two kinds of skill under
|
|
67
|
+
`storage/framework/defaults/ai/skills`.
|
|
68
|
+
|
|
69
|
+
**Subsystem reference**, one per area (`stacks-orm`, `stacks-router`,
|
|
70
|
+
`stacks-queue`, ...), each documenting it authoritatively. Read the relevant
|
|
71
|
+
`SKILL.md` before doing non-trivial work rather than guessing at an API.
|
|
72
|
+
|
|
73
|
+
**Engineering craft**, which shape how the work happens:
|
|
74
|
+
|
|
75
|
+
| Situation | Skill |
|
|
76
|
+
|---|---|
|
|
77
|
+
| Which skill fits, and where to cut a session | `stacks-flow` |
|
|
78
|
+
| Stress-test an idea before building it | `stacks-office-hours`, `stacks-grilling` |
|
|
79
|
+
| Answer a design question with throwaway code | `stacks-prototype` |
|
|
80
|
+
| Plan the change: scope, seams, test matrix | `stacks-plan-review`, `stacks-codebase-design` |
|
|
81
|
+
| Name things, keep `CONTEXT.md` and ADRs current | `stacks-domain-modeling` |
|
|
82
|
+
| Build it test-first, one tracer bullet at a time | `stacks-tdd`, `stacks-new-feature` |
|
|
83
|
+
| Something is broken, flaky or slow | `stacks-investigate` |
|
|
84
|
+
| Review the diff on standards and spec | `stacks-review` |
|
|
85
|
+
| A step only a human can take | `stacks-wizard` |
|
|
86
|
+
| Improve the environment for next time | `stacks-retro` |
|
|
87
|
+
| Write a skill or any doc an agent reads | `stacks-writing-for-agents` |
|
|
70
88
|
|
|
71
89
|
Add your own with `app/Skills/<name>/SKILL.md`, then re-run `buddy setup:ai`.
|
|
90
|
+
A project skill shadows a bundled one of the same name. Read
|
|
91
|
+
`stacks-writing-for-agents` first: it covers the frontmatter the validator
|
|
92
|
+
enforces and how to write a description that actually fires.
|
|
72
93
|
|
|
73
94
|
---
|
|
74
95
|
|
package/ai/README.md
CHANGED
|
@@ -38,8 +38,30 @@ reference for a task instead of guessing at an API.
|
|
|
38
38
|
symlinks by default so skills stay in sync when you upgrade the framework. Pass
|
|
39
39
|
`--copy` if you would rather edit them per project.
|
|
40
40
|
|
|
41
|
+
### Two kinds
|
|
42
|
+
|
|
43
|
+
Most bundled skills are **subsystem reference**: one per part of the framework,
|
|
44
|
+
model-invoked, found by the agent from the task at hand. A smaller set are
|
|
45
|
+
**engineering craft** skills that shape how the work happens rather than which
|
|
46
|
+
package it touches: `stacks-flow` routes between them, and `stacks-grilling`,
|
|
47
|
+
`stacks-codebase-design`, `stacks-tdd`, `stacks-domain-modeling`,
|
|
48
|
+
`stacks-prototype`, `stacks-wizard`, `stacks-handoff` and
|
|
49
|
+
`stacks-writing-for-agents` are the rest. Several are adapted from
|
|
50
|
+
[mattpocock/skills](https://github.com/mattpocock/skills) (MIT), with credit in
|
|
51
|
+
each `SKILL.md`.
|
|
52
|
+
|
|
53
|
+
Each skill also has a page in the documentation site, under `docs/skills/`, one
|
|
54
|
+
per skill with a landing page per section. `tests/unit/skills-docs-contract.test.ts`
|
|
55
|
+
fails when a skill gains or loses a page, so the two cannot drift apart.
|
|
56
|
+
|
|
57
|
+
### Adding your own
|
|
58
|
+
|
|
41
59
|
To add a project-specific skill, or to shadow a bundled one, create
|
|
42
|
-
`app/Skills/<name>/SKILL.md`.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
60
|
+
`app/Skills/<name>/SKILL.md`. Read `stacks-writing-for-agents` before you do:
|
|
61
|
+
it covers the frontmatter `validateSkill()` enforces, the invocation choice, and
|
|
62
|
+
how to write a description that fires when it should.
|
|
63
|
+
|
|
64
|
+
`@stacksjs/skills` searches `app/Skills` first and falls back to this directory,
|
|
65
|
+
the same app-overrides-defaults model the rest of the framework uses, and
|
|
66
|
+
`setup:ai` links the winner, so a project skill also wins in the agent's
|
|
67
|
+
directory.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: stacks-actions
|
|
3
|
-
description: Use when working with Stacks server actions
|
|
3
|
+
description: Use when working with Stacks server actions - creating actions in app/Actions/, auto-generated API actions from the useApi model trait, the 80+ default framework actions (auth, dashboard, commerce, content, deployment, jobs), action request/response handling, or action registration. Covers @stacksjs/actions and storage/framework/defaults/app/Actions/.
|
|
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-ai
|
|
3
|
-
description: Use when integrating AI capabilities into a Stacks application
|
|
3
|
+
description: Use when integrating AI capabilities into a Stacks application - using Anthropic/OpenAI/Ollama/AWS Bedrock drivers, image generation (DALL-E), vision analysis, RAG/vector search, embeddings, MCP (Model Context Protocol) clients, text summarization, sentiment analysis, content classification, personalization, or the buddy AI assistant. Covers @stacksjs/ai and config/ai.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-alias
|
|
3
|
-
description: Use when working with path aliases in a Stacks project
|
|
3
|
+
description: Use when working with path aliases in a Stacks project - import resolution, module aliasing, or debugging import paths. Covers @stacksjs/alias which defines 260+ path mappings for the entire framework.
|
|
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-analytics
|
|
3
|
-
description: Use when adding analytics to a Stacks application
|
|
3
|
+
description: Use when adding analytics to a Stacks application - configuring Fathom or self-hosted analytics, generating tracking scripts, privacy-friendly analytics setup, or the analytics configuration. Covers @stacksjs/analytics and config/analytics.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-api
|
|
3
|
-
description: Use when building, modifying, or debugging API endpoints in a Stacks application
|
|
3
|
+
description: Use when building, modifying, or debugging API endpoints in a Stacks application - defining routes, handling requests, API middleware, working with the API server, HTTP client (fetcher), API resources, or OpenAPI generation. Covers both @stacksjs/api utilities and the stacks-api server implementation.
|
|
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-arrays
|
|
3
|
-
description: Use when working with array utilities in Stacks
|
|
3
|
+
description: Use when working with array utilities in Stacks - statistical operations (average, median, mode, standard deviation, z-score, percentile, covariance), array manipulation (unique, flatten, partition, shuffle, sample, move), containment checks, or the Arr facade. Covers @stacksjs/arrays.
|
|
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-auto-imports
|
|
3
|
-
description: Use when working with the Stacks auto-import system
|
|
3
|
+
description: Use when working with the Stacks auto-import system - understanding how browser and server auto-imports work, configuring auto-imported functions/models/composables, the auto-import manifests, type generation, or how globals are injected. Covers the auto-import pipeline at storage/framework/auto-imports/.
|
|
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-browse
|
|
3
|
-
description: Use for headless browser QA on Stacks applications
|
|
3
|
+
description: Use for headless browser QA on Stacks applications - navigation, screenshots, responsive testing, console/network monitoring, and accessibility snapshots. Dependency-free, driving a system browser over the Chrome DevTools Protocol using only Bun (no Playwright/Puppeteer). Invoke with /stacks-browse.
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: Bun >= 1.3.0, TypeScript, a Chromium-family browser on the machine
|
|
6
6
|
allowed-tools: Read Edit Write Bash Grep Glob
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: stacks-browser
|
|
3
|
-
description: Use when working with browser/frontend functionality in Stacks
|
|
3
|
+
description: Use when working with browser/frontend functionality in Stacks - the useAuth composable (login, register, logout, token management), Stripe billing utilities (loadCardElement, confirmPayment), the API fetch client, browser model loading, or auto-imported browser utilities. Covers @stacksjs/browser.
|
|
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-buddy
|
|
3
|
-
description: Use when working with the Stacks CLI (buddy/bud/stacks/stx)
|
|
3
|
+
description: Use when working with the Stacks CLI (buddy/bud/stacks/stx) - understanding all 50+ commands with their flags and options, adding custom commands, the make:* scaffolding commands, development server commands, build commands, deployment commands, email/mail commands, environment management, or domain/DNS commands. Covers @stacksjs/buddy and all CLI command files.
|
|
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-build
|
|
3
|
-
description: Use when working with the Stacks build system
|
|
3
|
+
description: Use when working with the Stacks build system - building component libraries, CLI binaries, server Docker images, documentation, or the framework core. Covers @stacksjs/build, buddy build commands, build actions, and the server build pipeline.
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: Bun >= 1.3.0, TypeScript
|
|
6
6
|
allowed-tools: Read Edit Write Bash Grep Glob
|
|
@@ -29,7 +29,8 @@ actions/src/build/
|
|
|
29
29
|
├── server.ts # Build server Docker image
|
|
30
30
|
├── core.ts # Build all framework core packages
|
|
31
31
|
├── stacks.ts # Orchestrate CLI + core builds
|
|
32
|
-
├── component-libs.ts # Build
|
|
32
|
+
├── component-libs.ts # Build the `components` library packages
|
|
33
|
+
├── libs.ts # Build every configured library package
|
|
33
34
|
├── docs.ts # Build documentation
|
|
34
35
|
├── desktop.ts # Build desktop app
|
|
35
36
|
└── views.ts # Build frontend views
|
|
@@ -40,7 +41,7 @@ actions/src/build/
|
|
|
40
41
|
```typescript
|
|
41
42
|
type BuildOption =
|
|
42
43
|
| 'components' | 'webComponents' | 'elements'
|
|
43
|
-
| 'functions' | 'docs' | 'views' | 'stacks' | 'all' | 'buddy' | 'server'
|
|
44
|
+
| 'functions' | 'libs' | 'docs' | 'views' | 'stacks' | 'all' | 'buddy' | 'server'
|
|
44
45
|
|
|
45
46
|
type BuildOptions = { [key in BuildOption]: boolean } & CliOptions
|
|
46
47
|
|
|
@@ -62,7 +63,8 @@ buddy build # Interactive build
|
|
|
62
63
|
buddy build components # All component libraries
|
|
63
64
|
buddy build:components # Alias
|
|
64
65
|
buddy build:web-components # Web Components library only
|
|
65
|
-
buddy build:functions #
|
|
66
|
+
buddy build:functions # The `functions` library packages
|
|
67
|
+
buddy build:libs # Every configured library package
|
|
66
68
|
buddy build:cli # Buddy CLI binary
|
|
67
69
|
buddy build:server # Server Docker image
|
|
68
70
|
buddy build:core # All framework core packages
|
|
@@ -75,6 +77,7 @@ buddy build:views # Frontend views
|
|
|
75
77
|
buddy build -c # --components
|
|
76
78
|
buddy build -w # --web-components
|
|
77
79
|
buddy build -f # --functions
|
|
80
|
+
buddy build -l # --libs
|
|
78
81
|
buddy build -d # --docs
|
|
79
82
|
buddy build -b # --buddy
|
|
80
83
|
buddy build -s # --stacks
|
|
@@ -101,6 +104,70 @@ const result = await Bun.build({
|
|
|
101
104
|
await outro({ dir: import.meta.dir, startTime, result })
|
|
102
105
|
```
|
|
103
106
|
|
|
107
|
+
## Releasing libraries out of `resources/`
|
|
108
|
+
|
|
109
|
+
`resources/functions` and `resources/components` are not limited to one npm
|
|
110
|
+
package each. `config/library.ts` carries a `packages` array, and each entry
|
|
111
|
+
claims a slice of one of those directories by glob and becomes its own package
|
|
112
|
+
with its own name, manifest, dist and version:
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
// config/library.ts
|
|
116
|
+
packages: [
|
|
117
|
+
// A file may be claimed by more than one package.
|
|
118
|
+
{ name: '@acme/fx', kind: 'functions', include: ['*.ts'], exclude: ['internal/**'] },
|
|
119
|
+
{ name: '@acme/fx-dates', kind: 'functions', include: ['dates/**'] },
|
|
120
|
+
{ name: '@acme/ui', kind: 'components', include: ['ui/**'], prefix: 'acme' },
|
|
121
|
+
{ name: '@acme/elements', kind: 'web-components', include: ['ui/**'], prefix: 'acme' },
|
|
122
|
+
]
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The older single-package `functions` / `webComponents` keys still work: they
|
|
126
|
+
normalize into the same list, so a config written before `packages` existed
|
|
127
|
+
keeps building exactly one package. When `packages` is set, they are ignored.
|
|
128
|
+
|
|
129
|
+
| Kind | Built by | Published entry |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| `functions` | sources staged into the package's `src/`, then `transpilePackage` | `dist/index.js`, one module per source |
|
|
132
|
+
| `components` | stx `buildComponentLibrary` | `dist/index.js`, tree-shakeable per-component modules |
|
|
133
|
+
| `web-components` | the same compile | `dist/bundle.js`, one self-registering script |
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
buddy libs # what each package resolved to, on disk
|
|
137
|
+
buddy libs --json # the same, machine-readable
|
|
138
|
+
buddy build:libs # build them all (also `buddy build --libs`)
|
|
139
|
+
buddy build:functions # just the `functions` packages
|
|
140
|
+
buddy build:components # just the `components` packages
|
|
141
|
+
buddy build:web-components # just the `web-components` packages
|
|
142
|
+
buddy libs:publish --dry-run
|
|
143
|
+
buddy libs:publish # after a build; refuses a package with no dist
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Packages build in `storage/framework/libs/packages/<dir>/`, where `<dir>` is
|
|
147
|
+
the unscoped npm name unless the entry sets `dir`. The whole directory is
|
|
148
|
+
generated and gitignored.
|
|
149
|
+
|
|
150
|
+
### Things that will stop a build, on purpose
|
|
151
|
+
|
|
152
|
+
- **A package that matches no files.** Nearly always a typo'd glob, and the
|
|
153
|
+
alternative is publishing an empty tarball. The release path skips unmatched
|
|
154
|
+
packages instead, so an app that never filled in `resources/` is not blocked.
|
|
155
|
+
- **Two packages that resolve to the same directory** (`@acme/ui` and
|
|
156
|
+
`@other/ui` both unscope to `ui`). Give one an explicit `dir`.
|
|
157
|
+
- **stx ambient globals in a `functions` package.** `state`, `useDark` and the
|
|
158
|
+
rest are injected into an stx page entry and exported by nothing, so a
|
|
159
|
+
bundled copy compiles and then throws `ReferenceError` on the consumer's
|
|
160
|
+
first call. Either import the names explicitly, or set `runtime: 'stx'` on
|
|
161
|
+
the package to declare that it is only ever consumed from inside an stx app.
|
|
162
|
+
|
|
163
|
+
### Release flow
|
|
164
|
+
|
|
165
|
+
`buddy release` runs `generate/lib-entries`, which stages sources and writes
|
|
166
|
+
each manifest without compiling — so a broken library config fails before a tag
|
|
167
|
+
exists rather than after. Versions follow the project version unless a package
|
|
168
|
+
pins its own, which is why the build (not the generate) is what CI runs after
|
|
169
|
+
the bump, and `buddy libs:publish` after that.
|
|
170
|
+
|
|
104
171
|
## Build Utilities (index.ts)
|
|
105
172
|
|
|
106
173
|
```typescript
|
|
@@ -157,7 +224,14 @@ enum Action {
|
|
|
157
224
|
- **Server build mutates import paths** — stage 5 rewrites references in compiled output
|
|
158
225
|
- **Core build is sequential** — packages built one at a time, failures collected and reported
|
|
159
226
|
- **Docker build requires cloud config** — only builds if cloud deployment is enabled
|
|
160
|
-
- **Component libraries
|
|
227
|
+
- **Component libraries compile through stx**, not Vite. `buildComponentLibrary`
|
|
228
|
+
emits its own index and each generated component registers its custom element
|
|
229
|
+
on import, which is why a `web-components` package needs no entry file of its
|
|
230
|
+
own — it publishes `bundle.js` instead of `index.js`.
|
|
231
|
+
- **A library barrel is generated with `.ts` specifiers on purpose.**
|
|
232
|
+
`transpilePackage` rewrites relative `.ts` to `.js` on the way into `dist`. An
|
|
233
|
+
extensionless specifier survives as-is and only resolves under Bun, so the
|
|
234
|
+
package installs cleanly and fails on first import from Node or Vite.
|
|
161
235
|
- **`build:stacks` builds CLI first** — Buddy binary compiled before core packages
|
|
162
236
|
- **Server build cleans aggressively** — deletes app, config, dist, docs, storage before rebuild
|
|
163
237
|
- **The build package has @babel deps** — uses Babel for AST traversal during export cleanup
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: stacks-cache
|
|
3
|
-
description: Use when implementing caching in Stacks
|
|
3
|
+
description: Use when implementing caching in Stacks - memory cache, Redis cache, cache-aside pattern (getOrSet), TTL management, cache stats, or cache configuration. Covers @stacksjs/cache and config/cache.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-calendar
|
|
3
|
-
description: Use when working with calendar functionality in Stacks
|
|
3
|
+
description: Use when working with calendar functionality in Stacks - exporting events to Google Calendar, Outlook, Yahoo, or ICS format, the CalendarLink interface for event definitions, timezone handling, all-day events, or calendar URL generation. Covers @stacksjs/calendar-api.
|
|
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-chat
|
|
3
|
-
description: Use when implementing chat messaging in Stacks
|
|
3
|
+
description: Use when implementing chat messaging in Stacks - sending messages to Slack (webhooks, bot tokens, block kit), Discord (webhooks, bot tokens, embeds), Microsoft Teams (adaptive cards, webhooks), the BaseChatDriver abstraction, retry logic, or multi-channel chat routing. Covers @stacksjs/chat.
|
|
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-cli
|
|
3
|
-
description: Use when building CLI commands or tools with Stacks
|
|
3
|
+
description: Use when building CLI commands or tools with Stacks - the @stacksjs/cli package for creating commands with argument parsing, option handling, colored output, tables, progress indicators, prompts, or integrating with the buddy command system. Covers @stacksjs/cli and app/Commands/.
|
|
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-cloud
|
|
3
|
-
description: Use when deploying or managing cloud infrastructure for Stacks
|
|
3
|
+
description: Use when deploying or managing cloud infrastructure for Stacks - AWS deployment via CloudFormation/CDK, server mode (EC2, ALB, VPC), serverless mode (Lambda, API Gateway, CloudFront), jump boxes, domain management (Route53), S3 storage, SES email, edge computing, security groups, IAM, or the cloud configuration. Covers @stacksjs/cloud, @stacksjs/deploy, storage/framework/cloud/, and cloud/.
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: Bun >= 1.3.0, TypeScript, AWS
|
|
6
6
|
allowed-tools: Read Edit Write Bash Grep Glob
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: stacks-cms
|
|
3
|
-
description: Use when working with the CMS in a Stacks application
|
|
3
|
+
description: Use when working with the CMS in a Stacks application - posts, authors, pages, categories, tags, comments, blog configuration, RSS feeds, or sitemaps. Covers @stacksjs/cms, CMS models, routes, and actions.
|
|
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,79 @@
|
|
|
1
|
+
# Deepening
|
|
2
|
+
|
|
3
|
+
How to deepen a cluster of shallow modules safely, given its dependencies.
|
|
4
|
+
Assumes the vocabulary in [SKILL.md](SKILL.md): **module**, **interface**,
|
|
5
|
+
**seam**, **adapter**.
|
|
6
|
+
|
|
7
|
+
## Dependency categories
|
|
8
|
+
|
|
9
|
+
When assessing a candidate for deepening, classify its dependencies. The
|
|
10
|
+
category decides how the deepened module is tested across its seam.
|
|
11
|
+
|
|
12
|
+
### 1. In-process
|
|
13
|
+
|
|
14
|
+
Pure computation, in-memory state, no I/O. In Stacks: `@stacksjs/strings`,
|
|
15
|
+
`@stacksjs/arrays`, `@stacksjs/collections`, `@stacksjs/datetime`, validation
|
|
16
|
+
rules, most of what lives in `resources/functions/`. Always deepenable. Merge the
|
|
17
|
+
modules and test through the new interface directly. No adapter needed.
|
|
18
|
+
|
|
19
|
+
### 2. Local-substitutable
|
|
20
|
+
|
|
21
|
+
Dependencies with a local test stand-in. In Stacks this is the common case and
|
|
22
|
+
the framework already provides the stand-ins:
|
|
23
|
+
|
|
24
|
+
- The database. `setupDatabase()` / `refreshDatabase()` from `@stacksjs/testing`
|
|
25
|
+
give you a real SQLite instance at `database/stacks_testing.sqlite`.
|
|
26
|
+
- The cache. The `memory` driver stands in for `redis`.
|
|
27
|
+
- The queue. `fake()` / `restore()` from `@stacksjs/queue` stand in for a real
|
|
28
|
+
worker.
|
|
29
|
+
- Storage. The local driver stands in for S3.
|
|
30
|
+
|
|
31
|
+
Deepenable whenever the stand-in exists. The deepened module is tested with the
|
|
32
|
+
stand-in running in the suite. The seam is internal, and no port appears at the
|
|
33
|
+
module's external interface.
|
|
34
|
+
|
|
35
|
+
### 3. Remote but owned (ports and adapters)
|
|
36
|
+
|
|
37
|
+
Your own services across a network boundary. In Stacks this is the API server
|
|
38
|
+
and its typed client, a Lambda in serverless mode, or a second tenant on the same
|
|
39
|
+
box. Define a **port** at the seam. The deep module owns the logic, the transport
|
|
40
|
+
is injected as an **adapter**. Tests use an in-memory adapter, production uses
|
|
41
|
+
the HTTP one.
|
|
42
|
+
|
|
43
|
+
Recommendation shape: *"Define a port at the seam, implement an HTTP adapter for
|
|
44
|
+
production and an in-memory adapter for testing, so the logic sits in one deep
|
|
45
|
+
module even though it is deployed across a network."*
|
|
46
|
+
|
|
47
|
+
### 4. True external (mock)
|
|
48
|
+
|
|
49
|
+
Third-party services you do not control: Stripe, SES, Twilio, Meilisearch,
|
|
50
|
+
Algolia, Anthropic, OpenAI, Route53, Hetzner. The deepened module takes the
|
|
51
|
+
external dependency as an injected port, and tests provide a mock adapter. This
|
|
52
|
+
is what the driver packages already do: `BaseChatDriver`, the email drivers, the
|
|
53
|
+
AI drivers. When you add a fifth external service, add a driver rather than a
|
|
54
|
+
call site.
|
|
55
|
+
|
|
56
|
+
## Seam discipline
|
|
57
|
+
|
|
58
|
+
- **One adapter means a hypothetical seam. Two adapters means a real one.** Do
|
|
59
|
+
not introduce a port unless at least two adapters are justified, typically
|
|
60
|
+
production plus test. A single-adapter seam is just indirection.
|
|
61
|
+
- **Internal seams versus external seams.** A deep module can have internal
|
|
62
|
+
seams, private to its implementation and used by its own tests, as well as the
|
|
63
|
+
external seam at its interface. Do not expose internal seams through the
|
|
64
|
+
interface just because tests use them.
|
|
65
|
+
- **Do not put a seam where the framework already gives you one.** The `app/`
|
|
66
|
+
override model, the driver config in `config/*.ts`, and the model traits are
|
|
67
|
+
existing seams. A hand-rolled indirection beside one of them is a second way to
|
|
68
|
+
do the same thing.
|
|
69
|
+
|
|
70
|
+
## Testing strategy: replace, do not layer
|
|
71
|
+
|
|
72
|
+
- Old unit tests on the shallow modules become waste once tests at the deepened
|
|
73
|
+
module's interface exist. Delete them.
|
|
74
|
+
- Write the new tests at the deepened module's interface. The **interface is the
|
|
75
|
+
test surface**.
|
|
76
|
+
- Assert on observable outcomes through the interface, not internal state.
|
|
77
|
+
- Tests should survive internal refactors because they describe behaviour. If a
|
|
78
|
+
test has to change when the implementation changes, it is testing past the
|
|
79
|
+
interface.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Design it twice
|
|
2
|
+
|
|
3
|
+
When you want to explore alternative interfaces for a chosen deepening
|
|
4
|
+
candidate, use this parallel sub-agent pattern. Based on "Design It Twice"
|
|
5
|
+
(Ousterhout): your first idea is unlikely to be the best.
|
|
6
|
+
|
|
7
|
+
Uses the vocabulary in [SKILL.md](SKILL.md): **module**, **interface**, **seam**,
|
|
8
|
+
**adapter**, **leverage**.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
### 1. Frame the problem space
|
|
13
|
+
|
|
14
|
+
Before spawning sub-agents, write a user-facing explanation of the problem space
|
|
15
|
+
for the chosen candidate:
|
|
16
|
+
|
|
17
|
+
- The constraints any new interface would need to satisfy.
|
|
18
|
+
- The dependencies it relies on, and which category they fall into (see
|
|
19
|
+
[DEEPENING.md](DEEPENING.md)).
|
|
20
|
+
- A rough illustrative code sketch to make the constraints concrete. Not a
|
|
21
|
+
proposal.
|
|
22
|
+
|
|
23
|
+
Show this to the user, then proceed to step 2 immediately. The user reads and
|
|
24
|
+
thinks while the sub-agents work.
|
|
25
|
+
|
|
26
|
+
### 2. Spawn sub-agents
|
|
27
|
+
|
|
28
|
+
Spawn three or more sub-agents in parallel. Each must produce a **radically
|
|
29
|
+
different** interface for the deepened module.
|
|
30
|
+
|
|
31
|
+
Prompt each with a separate technical brief: file paths, coupling details, the
|
|
32
|
+
dependency category, what sits behind the seam. The brief is independent of the
|
|
33
|
+
user-facing explanation in step 1. Give each agent a different design constraint:
|
|
34
|
+
|
|
35
|
+
- Agent 1: minimise the interface. One to three entry points, maximum leverage
|
|
36
|
+
per entry point.
|
|
37
|
+
- Agent 2: maximise flexibility. Support many use cases and extension.
|
|
38
|
+
- Agent 3: optimise for the most common caller. Make the default case trivial.
|
|
39
|
+
- Agent 4, where it applies: design around ports and adapters for the cross-seam
|
|
40
|
+
dependencies.
|
|
41
|
+
|
|
42
|
+
Include both this skill's vocabulary and the project's `CONTEXT.md` vocabulary in
|
|
43
|
+
each brief, so the agents name things consistently with the architecture language
|
|
44
|
+
and the domain language at once.
|
|
45
|
+
|
|
46
|
+
Each sub-agent outputs:
|
|
47
|
+
|
|
48
|
+
1. The interface: types, entry points, params, plus invariants, ordering and
|
|
49
|
+
error modes.
|
|
50
|
+
2. A usage example showing how callers use it.
|
|
51
|
+
3. What the implementation hides behind the seam.
|
|
52
|
+
4. Dependency strategy and adapters.
|
|
53
|
+
5. Trade-offs: where leverage is high, where it is thin.
|
|
54
|
+
|
|
55
|
+
### 3. Present and compare
|
|
56
|
+
|
|
57
|
+
Present the designs one at a time so the user can absorb each, then compare them
|
|
58
|
+
in prose. Contrast by **depth** (leverage at the interface), **locality** (where
|
|
59
|
+
change concentrates) and **seam placement**.
|
|
60
|
+
|
|
61
|
+
Finish with your own recommendation: which design is strongest and why. If
|
|
62
|
+
elements from different designs combine well, propose the hybrid. Be opinionated.
|
|
63
|
+
The user wants a strong read, not a menu.
|
|
64
|
+
|
|
65
|
+
## In a Stacks project
|
|
66
|
+
|
|
67
|
+
Two constraints narrow the design space before you start, so state them in every
|
|
68
|
+
brief:
|
|
69
|
+
|
|
70
|
+
- A capability that varies per environment belongs behind a driver in
|
|
71
|
+
`config/*.ts`, not behind a hand-rolled abstraction.
|
|
72
|
+
- A capability that varies per model belongs in a trait, not in a base class.
|