@withmata/blueprints 0.3.2 → 0.3.4
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/.claude/skills/audit/SKILL.md +198 -38
- package/.claude/skills/new-project/SKILL.md +1 -1
- package/.claude/skills/scaffold-auth/SKILL.md +55 -7
- package/.claude/skills/scaffold-db/SKILL.md +47 -5
- package/.claude/skills/scaffold-env/SKILL.md +48 -5
- package/.claude/skills/scaffold-foundation/SKILL.md +236 -21
- package/.claude/skills/scaffold-tailwind/SKILL.md +34 -4
- package/.claude/skills/scaffold-ui/SKILL.md +46 -4
- package/ENGINEERING.md +1 -1
- package/blueprints/features/auth-better-auth/BLUEPRINT.md +4 -0
- package/blueprints/features/db-drizzle-postgres/BLUEPRINT.md +1 -0
- package/blueprints/features/env-t3/BLUEPRINT.md +1 -0
- package/blueprints/features/tailwind-v4/BLUEPRINT.md +1 -0
- package/blueprints/features/ui-shared-components/BLUEPRINT.md +1 -0
- package/blueprints/foundation/monorepo-turbo/BLUEPRINT.md +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/.claude/skills/new-blueprint/SKILL.md +0 -270
|
@@ -7,30 +7,120 @@ description: Set up a Turborepo + pnpm monorepo skeleton (skip for single-repo a
|
|
|
7
7
|
|
|
8
8
|
Set up the monorepo project skeleton using the foundation blueprint. **For single-repo applications** (standalone Next.js, Node, or Bun apps), skip this command and go directly to feature blueprints (`/scaffold-db`, `/scaffold-auth`) — they detect single-repo projects and adapt automatically.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
This skill operates in two modes:
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
- **Install mode** (default) — fresh scaffold of the full monorepo skeleton
|
|
13
|
+
- **Upgrade mode** — detects an existing foundation install and offers to apply updates (new features added to blueprints since the original install)
|
|
14
|
+
|
|
15
|
+
## Step 1: Read the Blueprints
|
|
16
|
+
|
|
17
|
+
Read the foundation blueprint and all template files:
|
|
13
18
|
|
|
14
19
|
```
|
|
15
20
|
~/.withmata/blueprints/blueprints/foundation/monorepo-turbo/BLUEPRINT.md
|
|
16
21
|
~/.withmata/blueprints/blueprints/foundation/monorepo-turbo/files/**/*
|
|
17
22
|
```
|
|
18
23
|
|
|
24
|
+
Also read the feature blueprints that foundation can optionally include:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
~/.withmata/blueprints/blueprints/features/env-t3/BLUEPRINT.md
|
|
28
|
+
~/.withmata/blueprints/blueprints/features/env-t3/files/**/*
|
|
29
|
+
~/.withmata/blueprints/blueprints/features/tailwind-v4/BLUEPRINT.md
|
|
30
|
+
~/.withmata/blueprints/blueprints/features/tailwind-v4/files/**/*
|
|
31
|
+
~/.withmata/blueprints/blueprints/features/ui-shared-components/BLUEPRINT.md
|
|
32
|
+
~/.withmata/blueprints/blueprints/features/ui-shared-components/files/**/*
|
|
33
|
+
```
|
|
34
|
+
|
|
19
35
|
If not found, run `npx @withmata/blueprints` to install.
|
|
20
36
|
|
|
21
|
-
The BLUEPRINT.md
|
|
37
|
+
The BLUEPRINT.md files contain the full architecture documentation, naming conventions, folder conventions, and file manifests. Follow them precisely.
|
|
22
38
|
|
|
23
|
-
## Step
|
|
39
|
+
## Step 1.5: Read Project Context
|
|
24
40
|
|
|
25
41
|
Check if `.project-context.md` exists in the target project root:
|
|
26
42
|
|
|
27
43
|
- **If it has a Discovery section**: use the product name to derive the npm scope (e.g., "Acme Dashboard" -> `@acme`). Use technical constraints to inform any decisions.
|
|
28
44
|
|
|
29
|
-
- **If it has a Foundation section already**:
|
|
45
|
+
- **If it has a Foundation section already**: switch to upgrade mode (Step 1.6).
|
|
46
|
+
|
|
47
|
+
- **If no context file exists**: that is fine. Ask the user directly for the product name and npm scope. Proceed with install mode.
|
|
48
|
+
|
|
49
|
+
## Step 1.6: Upgrade Mode
|
|
50
|
+
|
|
51
|
+
When foundation is already installed, run migrations first, then check for template updates and missing features.
|
|
52
|
+
|
|
53
|
+
### 1.6a: System Migrations
|
|
54
|
+
|
|
55
|
+
Check for legacy patterns from older blueprint versions and offer to migrate them. Run these checks in order:
|
|
56
|
+
|
|
57
|
+
**Migration: Separate maintenance skills → consolidated `project-maintenance/`**
|
|
58
|
+
|
|
59
|
+
Scan `.claude/skills/` in the project for individual maintenance skill directories:
|
|
60
|
+
- `auth-maintenance/`
|
|
61
|
+
- `db-maintenance/`
|
|
62
|
+
- `env-maintenance/`
|
|
63
|
+
- `tailwind-maintenance/`
|
|
64
|
+
- `ui-maintenance/`
|
|
65
|
+
- `monorepo-maintenance/`
|
|
66
|
+
|
|
67
|
+
If any are found:
|
|
68
|
+
1. Read each `SKILL.md` to extract the maintenance rules (the `### {name} maintenance` sections)
|
|
69
|
+
2. Create (or update) `.claude/skills/project-maintenance/SKILL.md` with the consolidated frontmatter and all extracted sections
|
|
70
|
+
3. Remove the old individual directories
|
|
71
|
+
4. Report: "Migrated {n} separate maintenance skills into one `project-maintenance/SKILL.md`"
|
|
72
|
+
|
|
73
|
+
**Migration: `foundation_completed` → `installed_at`**
|
|
74
|
+
|
|
75
|
+
Check `.project-context.md` for `foundation_completed:` under `## Foundation`. If found, rename the field to `installed_at:`.
|
|
76
|
+
|
|
77
|
+
**Future migrations go here.** Each migration should:
|
|
78
|
+
- Check for the legacy pattern
|
|
79
|
+
- Only run if the legacy pattern is detected (idempotent)
|
|
80
|
+
- Report what was changed
|
|
81
|
+
- Be safe to run multiple times (no-op if already migrated)
|
|
30
82
|
|
|
31
|
-
|
|
83
|
+
### 1.6b: Template Updates and Missing Features
|
|
32
84
|
|
|
33
|
-
|
|
85
|
+
After migrations, compare what's currently in the project against what the blueprints now offer:
|
|
86
|
+
|
|
87
|
+
1. **Foundation file updates** — Compare each foundation template file against the installed version. Flag files where the blueprint template has changed (e.g., updated `turbo.json` task structure, new fields in `package.json`).
|
|
88
|
+
|
|
89
|
+
2. **Missing features** — Check `.project-context.md` Installed Blueprints for:
|
|
90
|
+
- `env-t3` — Is it installed? If not, apply it automatically (env validation is not optional).
|
|
91
|
+
- `tailwind-v4` + `ui-shared-components` — Are they installed? If not, flag as available (frontend UI is optional).
|
|
92
|
+
|
|
93
|
+
3. **Present findings to the user:**
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Foundation was installed on <date>. Here's what's available:
|
|
97
|
+
|
|
98
|
+
Migrations applied:
|
|
99
|
+
✓ Consolidated 4 maintenance skills into project-maintenance/SKILL.md
|
|
100
|
+
✓ Renamed foundation_completed → installed_at in project context
|
|
101
|
+
|
|
102
|
+
Updates to existing files:
|
|
103
|
+
☐ turbo.json — new task caching strategy
|
|
104
|
+
☐ apps/web/next.config.ts — updated config pattern
|
|
105
|
+
|
|
106
|
+
Auto-applying:
|
|
107
|
+
✓ Validated environment variables (env-t3) — type-safe env with client/server split
|
|
108
|
+
|
|
109
|
+
New features (not yet installed):
|
|
110
|
+
☐ Frontend UI setup (tailwind-v4 + ui-shared-components) — full design system and shared component library
|
|
111
|
+
|
|
112
|
+
Which would you like to apply?
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
4. Apply only what the user selects. For each selected feature, follow its blueprint's integration steps (adapted to the existing project). Skip configuration questions where the answer is already in `.project-context.md`.
|
|
116
|
+
|
|
117
|
+
5. Update `.project-context.md` with the newly installed features and update `installed_at` date.
|
|
118
|
+
|
|
119
|
+
After upgrade mode completes, skip to Step 7 (Summarize).
|
|
120
|
+
|
|
121
|
+
## Step 2: Understand Current State
|
|
122
|
+
|
|
123
|
+
*(Install mode only — skipped in upgrade mode)*
|
|
34
124
|
|
|
35
125
|
Explore the target project directory:
|
|
36
126
|
|
|
@@ -40,12 +130,20 @@ Explore the target project directory:
|
|
|
40
130
|
|
|
41
131
|
## Step 4: Ask Configuration Questions
|
|
42
132
|
|
|
43
|
-
|
|
133
|
+
*(Install mode only — skipped in upgrade mode)*
|
|
134
|
+
|
|
135
|
+
Core questions — skip any already answered by project context:
|
|
44
136
|
|
|
45
137
|
1. **npm scope** — "What npm scope should internal packages use? (e.g., @acme)" Default: derive from product name.
|
|
46
138
|
2. **Project name** — "What is the human-readable project name?" (for metadata, page titles). Default: from discovery context.
|
|
47
139
|
3. **Node.js version** — "Target Node.js version?" Default: `>=22`.
|
|
48
140
|
|
|
141
|
+
Optional feature question — ask after the core questions:
|
|
142
|
+
|
|
143
|
+
4. **Frontend UI** — "Will this project have frontend work? If yes, I'll set up the full Tailwind design system and a shared UI component library (`packages/ui/`) with shadcn/ui. (Y/n)" Default: yes. If yes, applies both tailwind-v4 and ui-shared-components together.
|
|
144
|
+
|
|
145
|
+
**Note:** Validated environment variables (env-t3) are always set up — not optional. Every app gets type-safe env validation.
|
|
146
|
+
|
|
49
147
|
## Step 5: Scaffold
|
|
50
148
|
|
|
51
149
|
Create the monorepo skeleton by adapting all files from the blueprint. Replace placeholders:
|
|
@@ -66,7 +164,7 @@ From `files/root/`, create at project root:
|
|
|
66
164
|
|
|
67
165
|
From `files/config/`, create:
|
|
68
166
|
- `config/typescript-config/` — base.json, nextjs.json, react-library.json, package.json
|
|
69
|
-
- `config/tailwind-config/` — shared-styles.css, postcss.config.
|
|
167
|
+
- `config/tailwind-config/` — shared-styles.css, postcss.config.mjs, package.json
|
|
70
168
|
|
|
71
169
|
### 5c. Next.js App Shell
|
|
72
170
|
|
|
@@ -93,9 +191,73 @@ After creating all files:
|
|
|
93
191
|
2. Run `pnpm install` to verify the workspace configuration is valid
|
|
94
192
|
3. Verify the dev server starts: `pnpm dev` (briefly — just check it boots)
|
|
95
193
|
|
|
194
|
+
## Step 5.5: Optional Features
|
|
195
|
+
|
|
196
|
+
Apply the optional features the user said yes to in Step 4. Each feature follows its own blueprint's integration steps but within the same session — no need to run separate scaffold commands.
|
|
197
|
+
|
|
198
|
+
### 5.5a. Environment Variables (always applied)
|
|
199
|
+
|
|
200
|
+
Follow the `env-t3` blueprint's integration steps:
|
|
201
|
+
|
|
202
|
+
1. Create `apps/web/src/env/client.ts` and `apps/web/src/env/server.ts` from env-t3 templates
|
|
203
|
+
2. Replace the foundation's `apps/web/env.ts` with the split pattern
|
|
204
|
+
3. Update `apps/web/next.config.ts` — replace `import "./env"` with:
|
|
205
|
+
```typescript
|
|
206
|
+
import "./src/env/server";
|
|
207
|
+
import "./src/env/client";
|
|
208
|
+
```
|
|
209
|
+
4. Create `apps/web/.env.example` from env-t3 template — replace `{{APP_NAME}}`
|
|
210
|
+
5. Create `apps/web/.env.local` (empty)
|
|
211
|
+
6. Ensure `@t3-oss/env-nextjs` and `zod` are in `apps/web/package.json` dependencies
|
|
212
|
+
|
|
213
|
+
### 5.5b. Frontend UI Setup (if opted in)
|
|
214
|
+
|
|
215
|
+
When the user opts in to frontend work, apply both tailwind-v4 and ui-shared-components together as a single step.
|
|
216
|
+
|
|
217
|
+
**Tailwind design system** — follow the `tailwind-v4` blueprint's integration steps:
|
|
218
|
+
|
|
219
|
+
1. Replace `config/tailwind-config/shared-styles.css` with the full version from the tailwind-v4 blueprint (includes `tw-animate-css`, `shadcn/tailwind.css`, `tailwind-scrollbar-hide`, sidebar tokens, chart tokens)
|
|
220
|
+
2. Merge tailwind-v4 dependencies into `config/tailwind-config/package.json`:
|
|
221
|
+
- Add `@tailwindcss/typography`, `shadcn`, `tailwind-scrollbar-hide`, `tw-animate-css` to `dependencies`
|
|
222
|
+
|
|
223
|
+
**Shared UI package** — follow the `ui-shared-components` blueprint's integration steps:
|
|
224
|
+
|
|
225
|
+
1. Create `packages/ui/` with all files from the ui blueprint:
|
|
226
|
+
- `package.json` — replace `{{SCOPE}}`
|
|
227
|
+
- `tsconfig.json` — replace `{{SCOPE}}`
|
|
228
|
+
- `components.json`
|
|
229
|
+
- `styles/globals.css` — replace `{{SCOPE}}`
|
|
230
|
+
- `utils/cn.ts`
|
|
231
|
+
- `utils/cva.ts`
|
|
232
|
+
2. Create empty directories: `packages/ui/components/ui/`, `packages/ui/icons/`, `packages/ui/icons/logos/`
|
|
233
|
+
3. Update `apps/web/app/globals.css` to import UI styles:
|
|
234
|
+
```css
|
|
235
|
+
@import "tailwindcss";
|
|
236
|
+
@import "{{SCOPE}}/tailwind-config";
|
|
237
|
+
@import "{{SCOPE}}/ui/styles";
|
|
238
|
+
@plugin "@tailwindcss/typography";
|
|
239
|
+
|
|
240
|
+
@source "../../packages/ui";
|
|
241
|
+
```
|
|
242
|
+
Compute the `@source` relative path based on the actual directory structure.
|
|
243
|
+
|
|
244
|
+
### 5.5d. Re-install
|
|
245
|
+
|
|
246
|
+
If any optional features were applied:
|
|
247
|
+
1. Run `pnpm install` again to wire new workspace dependencies
|
|
248
|
+
2. Verify `pnpm dev` still boots cleanly
|
|
249
|
+
|
|
96
250
|
## Step 6: Update Project Context
|
|
97
251
|
|
|
98
|
-
|
|
252
|
+
**This step is mandatory.** The `.project-context.md` file is how other blueprints and future runs of `/scaffold-foundation` (upgrade mode) know what's been set up. Without it, every subsequent blueprint runs blind.
|
|
253
|
+
|
|
254
|
+
If `.project-context.md` does not exist, create it now:
|
|
255
|
+
|
|
256
|
+
```markdown
|
|
257
|
+
# Project Context
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Then append the `## Foundation` section:
|
|
99
261
|
|
|
100
262
|
```yaml
|
|
101
263
|
## Foundation
|
|
@@ -103,10 +265,11 @@ monorepo_tool: turborepo
|
|
|
103
265
|
package_manager: pnpm
|
|
104
266
|
npm_scope: "<scope>"
|
|
105
267
|
node_version: ">=22"
|
|
268
|
+
project_type: monorepo
|
|
106
269
|
workspaces:
|
|
107
270
|
apps: ["web"]
|
|
108
271
|
apis: []
|
|
109
|
-
packages: []
|
|
272
|
+
packages: ["ui"] # if frontend UI was applied, otherwise []
|
|
110
273
|
config: ["typescript-config", "tailwind-config"]
|
|
111
274
|
framework: next.js (app router)
|
|
112
275
|
typescript: strict
|
|
@@ -114,24 +277,39 @@ linter: biome
|
|
|
114
277
|
styling: tailwind-v4
|
|
115
278
|
env_validation: t3-env + zod
|
|
116
279
|
module_resolution: node subpath imports (#prefix)
|
|
117
|
-
|
|
280
|
+
installed_at: <date>
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Then append `## Installed Blueprints` with entries for every feature that was applied:
|
|
284
|
+
|
|
285
|
+
```markdown
|
|
286
|
+
## Installed Blueprints
|
|
118
287
|
```
|
|
119
288
|
|
|
120
|
-
|
|
289
|
+
- Always add the `env-t3` project context block (see env-t3 BLUEPRINT.md)
|
|
290
|
+
- If frontend UI was applied: add both the `tailwind-v4` and `ui-shared-components` project context blocks (see their BLUEPRINT.md files)
|
|
291
|
+
|
|
292
|
+
**Verify the file exists and is well-formed before proceeding to Step 7.** If it's missing or empty, that is a bug — fix it before summarizing.
|
|
121
293
|
|
|
122
294
|
### Create Maintenance Skill
|
|
123
295
|
|
|
124
|
-
|
|
296
|
+
All blueprints share a single project-level maintenance skill. Create or append to:
|
|
297
|
+
|
|
298
|
+
**File:** `<project>/.claude/skills/project-maintenance/SKILL.md`
|
|
125
299
|
|
|
126
|
-
|
|
300
|
+
If the file does not exist, create it with the frontmatter header:
|
|
127
301
|
|
|
128
302
|
```yaml
|
|
129
303
|
---
|
|
130
|
-
name:
|
|
131
|
-
description: Maintenance rules for
|
|
304
|
+
name: project-maintenance
|
|
305
|
+
description: Maintenance rules for all installed blueprints. Invoke when modifying schemas, env vars, auth config, workspace configs, UI components, or Tailwind tokens.
|
|
132
306
|
user-invocable: false
|
|
133
307
|
---
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Then append sections for each blueprint applied in this run. Foundation always adds:
|
|
134
311
|
|
|
312
|
+
```markdown
|
|
135
313
|
### Monorepo maintenance
|
|
136
314
|
- After every code change: format with Biome (`pnpm biome check --write .`) before considering work complete
|
|
137
315
|
- After adding new workspace packages: verify `pnpm-workspace.yaml` patterns match, run `pnpm install`
|
|
@@ -139,21 +317,58 @@ user-invocable: false
|
|
|
139
317
|
- After changing `turbo.json`: verify task ordering with `pnpm turbo run <task> --dry`
|
|
140
318
|
- After adding workspace dependencies: run `pnpm install` to create workspace links
|
|
141
319
|
- Keep `turbo.json` tasks with `cache: false` for any task with side effects (migrations, code generation)
|
|
320
|
+
|
|
321
|
+
### env-t3 maintenance
|
|
322
|
+
- After adding a new env var: add it to the env schema file (client.ts or server.ts), `.env.example`, and `.env.local`
|
|
323
|
+
- NEXT_PUBLIC_* vars go in env/client.ts with explicit runtimeEnv mapping; server vars go in env/server.ts
|
|
324
|
+
- After removing an env var: remove from schema, .env.example, and .env.local
|
|
325
|
+
- Never access process.env directly — always use the typed env objects (clientEnv, serverEnv, or env)
|
|
326
|
+
- Keep .env.example documented with section headers and local/production hints
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
If frontend UI was applied, also append:
|
|
330
|
+
|
|
331
|
+
```markdown
|
|
332
|
+
### tailwind-v4 maintenance
|
|
333
|
+
- After adding a new color: add CSS variable to both :root and .dark selectors in shared-styles.css, then map in @theme inline
|
|
334
|
+
- After adding a new app: import the tailwind-config package in the app's globals.css
|
|
335
|
+
- After upgrading Tailwind: check for @import, @theme, or @custom-variant breaking changes
|
|
336
|
+
- Never use tailwind.config.js — all configuration is CSS-based in shared-styles.css
|
|
337
|
+
- Colors use OKLCH color space — do not use hex or RGB
|
|
338
|
+
|
|
339
|
+
### ui-shared-components maintenance
|
|
340
|
+
- Add shadcn components via `pnpm dlx shadcn@latest add <name>` from packages/ui/
|
|
341
|
+
- Use cn() for all className composition — never concatenate class strings manually
|
|
342
|
+
- Internal imports use #prefix (#components/ui/button); cross-package imports use @scope/ui/components/ui/button
|
|
343
|
+
- After adding a new export directory: add to both exports and imports in packages/ui/package.json
|
|
344
|
+
- After adding a new consuming app: add @import and @source directive to the app's globals.css
|
|
142
345
|
```
|
|
143
346
|
|
|
144
347
|
## Step 7: Summarize
|
|
145
348
|
|
|
146
349
|
Tell the user:
|
|
147
350
|
|
|
148
|
-
|
|
351
|
+
### Install Mode Summary
|
|
352
|
+
|
|
353
|
+
- Project structure overview (directory tree — include optional features that were applied)
|
|
149
354
|
- What was configured (scope, Node version, tooling)
|
|
355
|
+
- Which optional features were included
|
|
150
356
|
- How to start development: `pnpm dev`
|
|
151
|
-
-
|
|
152
|
-
-
|
|
357
|
+
- If frontend UI was set up: how to add shadcn components (`cd packages/ui && pnpm dlx shadcn@latest add button`)
|
|
358
|
+
- Available feature blueprints to install next: `/scaffold-db`, `/scaffold-auth`
|
|
359
|
+
|
|
360
|
+
### Upgrade Mode Summary
|
|
361
|
+
|
|
362
|
+
- What was updated (list files that changed)
|
|
363
|
+
- What new features were added (env, tailwind, UI)
|
|
364
|
+
- Any manual steps remaining
|
|
365
|
+
- Suggest next steps based on what's still not installed
|
|
153
366
|
|
|
154
367
|
## Important Notes
|
|
155
368
|
|
|
156
369
|
- Never overwrite existing files without asking.
|
|
157
370
|
- Preserve all `// CONFIGURE:` comments in generated files so the user can find customization points.
|
|
158
|
-
-
|
|
371
|
+
- In upgrade mode, be conservative — only modify files that the blueprints own. Don't touch user-customized files (check for differences from the template before replacing).
|
|
372
|
+
- If the user has customized colors in `shared-styles.css` or added variables to `env.ts`, ask before replacing. Offer to merge their customizations into the new version.
|
|
159
373
|
- Feature blueprints will add scripts to root `package.json` and tasks to `turbo.json` — the foundation provides the base that they extend.
|
|
374
|
+
- The individual `/scaffold-env`, `/scaffold-tailwind`, and `/scaffold-ui` skills still exist for projects that didn't use foundation or want to add features later. The foundation's optional feature steps follow the same blueprints — no duplication.
|
|
@@ -29,6 +29,29 @@ Check if `.project-context.md` exists in the target project root:
|
|
|
29
29
|
- Use this to determine if `config/tailwind-config/` exists
|
|
30
30
|
|
|
31
31
|
- **If it does not exist**: proceed normally — explore the project manually
|
|
32
|
+
- **If `tailwind-v4` is in Installed Blueprints**: switch to upgrade mode (Step 1.6)
|
|
33
|
+
|
|
34
|
+
## Step 1.6: Upgrade Mode
|
|
35
|
+
|
|
36
|
+
If `tailwind-v4` is found in `.project-context.md` under `## Installed Blueprints`, switch to upgrade mode.
|
|
37
|
+
|
|
38
|
+
1. **Read installed state** — from project context, get `files_modified`, `choices`, and `installed_at`
|
|
39
|
+
2. **Compare templates against installed files:**
|
|
40
|
+
- `config/tailwind-config/shared-styles.css` — compare against current blueprint template. Look for new imports (`@import`), new tokens in `@theme inline`, new CSS variables in `:root` and `.dark`, new base layer rules.
|
|
41
|
+
- `config/tailwind-config/package.json` — compare dependencies. Look for new or updated packages.
|
|
42
|
+
3. **Present findings:**
|
|
43
|
+
```
|
|
44
|
+
tailwind-v4 was installed on <date>. Checking for updates...
|
|
45
|
+
|
|
46
|
+
Updated files:
|
|
47
|
+
☐ shared-styles.css — new tokens added (e.g., new sidebar variants, chart colors)
|
|
48
|
+
☐ package.json — new dependency: <package>
|
|
49
|
+
|
|
50
|
+
Apply updates?
|
|
51
|
+
```
|
|
52
|
+
4. **Apply selectively** — `shared-styles.css` is a blueprint-owned file (users customize colors but the structure is ours). For color value changes, ask before overwriting. For new token additions (new `--color-*` vars), safe to append.
|
|
53
|
+
5. **Update project context** — update `installed_at` date
|
|
54
|
+
6. **Skip to Step 6 (Output Summary)**
|
|
32
55
|
|
|
33
56
|
## Step 2: Understand the Target Project
|
|
34
57
|
|
|
@@ -111,6 +134,7 @@ Append an entry to `.project-context.md` under `## Installed Blueprints`:
|
|
|
111
134
|
```yaml
|
|
112
135
|
### tailwind-v4
|
|
113
136
|
blueprint: tailwind-v4
|
|
137
|
+
installed_at: <date>
|
|
114
138
|
choices:
|
|
115
139
|
include_sidebar_tokens: <true|false>
|
|
116
140
|
include_chart_tokens: <true|false>
|
|
@@ -127,17 +151,21 @@ packages_added:
|
|
|
127
151
|
|
|
128
152
|
### Create Maintenance Skill
|
|
129
153
|
|
|
130
|
-
|
|
154
|
+
Append to the shared project-level maintenance skill at `<project>/.claude/skills/project-maintenance/SKILL.md`.
|
|
131
155
|
|
|
132
|
-
|
|
156
|
+
If the file does not exist, create it with frontmatter:
|
|
133
157
|
|
|
134
158
|
```yaml
|
|
135
159
|
---
|
|
136
|
-
name:
|
|
137
|
-
description: Maintenance rules for
|
|
160
|
+
name: project-maintenance
|
|
161
|
+
description: Maintenance rules for all installed blueprints. Invoke when modifying schemas, env vars, auth config, workspace configs, UI components, or Tailwind tokens.
|
|
138
162
|
user-invocable: false
|
|
139
163
|
---
|
|
164
|
+
```
|
|
140
165
|
|
|
166
|
+
Then append:
|
|
167
|
+
|
|
168
|
+
```markdown
|
|
141
169
|
### tailwind-v4 maintenance
|
|
142
170
|
- After adding a new color: add CSS variable to both :root and .dark selectors in shared-styles.css, then map in @theme inline
|
|
143
171
|
- After adding a new app: import the tailwind-config package in the app's globals.css
|
|
@@ -146,6 +174,8 @@ user-invocable: false
|
|
|
146
174
|
- Colors use OKLCH color space — do not use hex or RGB
|
|
147
175
|
```
|
|
148
176
|
|
|
177
|
+
If a `### tailwind-v4 maintenance` section already exists in the file, skip — do not duplicate.
|
|
178
|
+
|
|
149
179
|
## Step 6: Output Summary
|
|
150
180
|
|
|
151
181
|
### Packages Added
|
|
@@ -32,6 +32,41 @@ Check if `.project-context.md` exists in the target project root:
|
|
|
32
32
|
|
|
33
33
|
When project context provides clear answers, skip the corresponding questions in Step 3.
|
|
34
34
|
|
|
35
|
+
If `ui-shared-components` is in Installed Blueprints, switch to upgrade mode (Step 1.6).
|
|
36
|
+
|
|
37
|
+
## Step 1.6: Upgrade Mode
|
|
38
|
+
|
|
39
|
+
If `ui-shared-components` is found in `.project-context.md` under `## Installed Blueprints`, switch to upgrade mode.
|
|
40
|
+
|
|
41
|
+
1. **Read installed state** — from project context, get `files_created`, `choices`, and `installed_at`
|
|
42
|
+
2. **Compare templates against installed files:**
|
|
43
|
+
- `packages/ui/package.json` — compare exports, imports, dependencies. Look for new export patterns, updated deps.
|
|
44
|
+
- `packages/ui/components.json` — compare shadcn config. Look for updated aliases or style changes.
|
|
45
|
+
- `packages/ui/utils/cn.ts` — compare utility implementation.
|
|
46
|
+
- `packages/ui/utils/cva.ts` — compare CVA re-export.
|
|
47
|
+
- `packages/ui/styles/globals.css` — compare style imports.
|
|
48
|
+
- `packages/ui/tsconfig.json` — compare TypeScript config.
|
|
49
|
+
- Check consuming app `globals.css` — verify `@import` and `@source` directives are present and correct.
|
|
50
|
+
3. **Present findings:**
|
|
51
|
+
```
|
|
52
|
+
ui-shared-components was installed on <date>. Checking for updates...
|
|
53
|
+
|
|
54
|
+
Updated files:
|
|
55
|
+
☐ packages/ui/package.json — new export patterns or dependencies
|
|
56
|
+
☐ packages/ui/components.json — updated shadcn configuration
|
|
57
|
+
|
|
58
|
+
New files:
|
|
59
|
+
☐ packages/ui/utils/cva.ts — new utility (didn't exist in previous version)
|
|
60
|
+
|
|
61
|
+
Unchanged:
|
|
62
|
+
✓ packages/ui/utils/cn.ts — no changes
|
|
63
|
+
|
|
64
|
+
Apply updates?
|
|
65
|
+
```
|
|
66
|
+
4. **Apply selectively** — `package.json` exports and `components.json` are blueprint-owned. `components/ui/` files are user-owned (shadcn-generated) — never touch those.
|
|
67
|
+
5. **Update project context** — update `installed_at` date
|
|
68
|
+
6. **Skip to Step 6 (Output Summary)**
|
|
69
|
+
|
|
35
70
|
## Step 2: Understand the Target Project
|
|
36
71
|
|
|
37
72
|
### 2a. Detect Project Type
|
|
@@ -128,6 +163,7 @@ Append an entry to `.project-context.md` under `## Installed Blueprints`:
|
|
|
128
163
|
```yaml
|
|
129
164
|
### ui-shared-components
|
|
130
165
|
blueprint: ui-shared-components
|
|
166
|
+
installed_at: <date>
|
|
131
167
|
choices:
|
|
132
168
|
shadcn_style: <style>
|
|
133
169
|
icon_library: <library>
|
|
@@ -142,17 +178,21 @@ packages_added:
|
|
|
142
178
|
|
|
143
179
|
### Create Maintenance Skill
|
|
144
180
|
|
|
145
|
-
|
|
181
|
+
Append to the shared project-level maintenance skill at `<project>/.claude/skills/project-maintenance/SKILL.md`.
|
|
146
182
|
|
|
147
|
-
|
|
183
|
+
If the file does not exist, create it with frontmatter:
|
|
148
184
|
|
|
149
185
|
```yaml
|
|
150
186
|
---
|
|
151
|
-
name:
|
|
152
|
-
description: Maintenance rules for
|
|
187
|
+
name: project-maintenance
|
|
188
|
+
description: Maintenance rules for all installed blueprints. Invoke when modifying schemas, env vars, auth config, workspace configs, UI components, or Tailwind tokens.
|
|
153
189
|
user-invocable: false
|
|
154
190
|
---
|
|
191
|
+
```
|
|
155
192
|
|
|
193
|
+
Then append:
|
|
194
|
+
|
|
195
|
+
```markdown
|
|
156
196
|
### ui-shared-components maintenance
|
|
157
197
|
- Add shadcn components via `pnpm dlx shadcn@latest add <name>` from packages/ui/
|
|
158
198
|
- Use cn() for all className composition — never concatenate class strings manually
|
|
@@ -161,6 +201,8 @@ user-invocable: false
|
|
|
161
201
|
- After adding a new consuming app: add @import and @source directive to the app's globals.css
|
|
162
202
|
```
|
|
163
203
|
|
|
204
|
+
If a `### ui-shared-components maintenance` section already exists in the file, skip — do not duplicate.
|
|
205
|
+
|
|
164
206
|
## Step 6: Output Summary
|
|
165
207
|
|
|
166
208
|
### Packages to Install
|
package/ENGINEERING.md
CHANGED
|
@@ -43,5 +43,5 @@ These preferences apply to ALL blueprints in this repo and to any project scaffo
|
|
|
43
43
|
- **Project context:** Every blueprint appends to `.project-context.md` in the target project root — tool-agnostic location readable by any AI coding tool
|
|
44
44
|
- **Skills live in `.claude/skills/<name>/SKILL.md`** — single source of truth. Installed globally to `~/.claude/skills/`, `~/.config/opencode/skills/`, `~/.cursor/skills/` via the CLI. OpenCode and Cursor also read `~/.claude/skills/` as a cross-tool fallback.
|
|
45
45
|
- **Rules/preferences are in `ENGINEERING.md`** — tool-specific files (`CLAUDE.md`, `AGENTS.md`, `.cursor/rules/engineering.mdc`) point to it
|
|
46
|
-
- **Available skills:** `/new-project`, `/discover`, `/scaffold-foundation`, `/scaffold-auth`, `/scaffold-db`, `/audit`, plus `blueprint-catalog` (background, auto-invoked)
|
|
46
|
+
- **Available skills:** `/new-project`, `/discover`, `/scaffold-foundation`, `/scaffold-env`, `/scaffold-tailwind`, `/scaffold-ui`, `/scaffold-auth`, `/scaffold-db`, `/audit`, plus `blueprint-catalog` (background, auto-invoked)
|
|
47
47
|
- **BLUEPRINT.md required** in every blueprint directory. Placeholder blueprints must still have a BLUEPRINT.md documenting intended scope.
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Auth Blueprint — Better Auth + Drizzle
|
|
2
2
|
|
|
3
|
+
## Tier
|
|
4
|
+
|
|
5
|
+
Feature
|
|
6
|
+
|
|
3
7
|
## Problem
|
|
4
8
|
|
|
5
9
|
Full authentication and authorization for a TypeScript monorepo: multi-provider social login, email/password with verification, password reset, organization-based multi-tenancy with role-based permissions (owner/admin/member), invitation system, and session management with cookie-based route protection.
|
package/dist/index.js
CHANGED