@withmata/blueprints 0.2.0 → 0.3.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/{.opencode/commands/audit.md → .claude/skills/audit/SKILL.md} +8 -6
- package/.claude/skills/blueprint-catalog/SKILL.md +52 -0
- package/.claude/{commands/discover.md → skills/discover/SKILL.md} +8 -3
- package/{.cursor/commands/new-blueprint.md → .claude/skills/new-blueprint/SKILL.md} +13 -8
- package/{.cursor/commands/new-project.md → .claude/skills/new-project/SKILL.md} +11 -6
- package/.claude/{commands/scaffold-auth.md → skills/scaffold-auth/SKILL.md} +24 -23
- package/{.cursor/commands/scaffold-db.md → .claude/skills/scaffold-db/SKILL.md} +17 -16
- package/.claude/{commands/scaffold-foundation.md → skills/scaffold-foundation/SKILL.md} +17 -16
- package/ENGINEERING.md +2 -2
- package/dist/index.js +210 -166
- package/package.json +6 -7
- package/.claude/commands/audit.md +0 -179
- package/.claude/commands/new-blueprint.md +0 -265
- package/.claude/commands/new-project.md +0 -230
- package/.claude/commands/scaffold-db.md +0 -270
- package/.cursor/commands/audit.md +0 -179
- package/.cursor/commands/discover.md +0 -92
- package/.cursor/commands/scaffold-auth.md +0 -310
- package/.cursor/commands/scaffold-foundation.md +0 -158
- package/.opencode/commands/discover.md +0 -96
- package/.opencode/commands/new-blueprint.md +0 -269
- package/.opencode/commands/new-project.md +0 -234
- package/.opencode/commands/scaffold-auth.md +0 -314
- package/.opencode/commands/scaffold-db.md +0 -274
- package/.opencode/commands/scaffold-foundation.md +0 -162
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
name: audit
|
|
3
|
+
description: Run a project health check against available blueprints (read-only analysis)
|
|
4
|
+
allowed-tools: Read, Glob, Grep, Bash(git *), Bash(ls *)
|
|
3
5
|
---
|
|
4
6
|
|
|
5
7
|
# Project Audit
|
|
@@ -11,18 +13,18 @@ Run a health check against available blueprints. Analyze this project's current
|
|
|
11
13
|
Load all available blueprint specs to understand what is possible:
|
|
12
14
|
|
|
13
15
|
```
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
~/.withmata/blueprints/blueprints/discovery/product-discovery/BLUEPRINT.md
|
|
17
|
+
~/.withmata/blueprints/blueprints/foundation/monorepo-turbo/BLUEPRINT.md
|
|
18
|
+
~/.withmata/blueprints/blueprints/features/auth-better-auth/BLUEPRINT.md
|
|
17
19
|
```
|
|
18
20
|
|
|
19
21
|
Also scan for any additional feature blueprints:
|
|
20
22
|
|
|
21
23
|
```
|
|
22
|
-
|
|
24
|
+
~/.withmata/blueprints/blueprints/features/*/BLUEPRINT.md
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
Only consider a blueprint "available" if its BLUEPRINT.md has `Status: Complete`. If not found
|
|
27
|
+
Only consider a blueprint "available" if its BLUEPRINT.md has `Status: Complete`. If not found, run `npx @withmata/blueprints` to install.
|
|
26
28
|
|
|
27
29
|
## Step 2: Read Project Context
|
|
28
30
|
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blueprint-catalog
|
|
3
|
+
description: >
|
|
4
|
+
Background knowledge about available project blueprints for scaffolding.
|
|
5
|
+
Invoke when user discusses: databases, authentication, project setup,
|
|
6
|
+
monorepo, product ideas, scaffolding, or asks "what should I do next?"
|
|
7
|
+
user-invocable: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Available Blueprints
|
|
11
|
+
|
|
12
|
+
| Blueprint | Tier | What it does | Dependencies | Skill |
|
|
13
|
+
|-----------|------|-------------|--------------|-------|
|
|
14
|
+
| Product Discovery | Discovery | Structured session producing product thesis, user archetypes, and competitive analysis. No code. | None | `/discover` |
|
|
15
|
+
| Monorepo Foundation | Foundation | Turborepo + pnpm monorepo with Next.js, Biome, TypeScript strict, Tailwind v4. | None | `/scaffold-foundation` |
|
|
16
|
+
| Database | Feature | Drizzle ORM + PostgreSQL: schema groups, per-group migrations, seed scripts. | None | `/scaffold-db` |
|
|
17
|
+
| Authentication | Feature | Better Auth + Drizzle + PostgreSQL: social login, email/password, organizations, role-based permissions. | Database | `/scaffold-auth` |
|
|
18
|
+
|
|
19
|
+
## Project Context
|
|
20
|
+
|
|
21
|
+
!`cat .project-context.md 2>/dev/null || echo "No .project-context.md found — no blueprints have been installed in this project yet."`
|
|
22
|
+
|
|
23
|
+
## When to Recommend
|
|
24
|
+
|
|
25
|
+
Suggest a blueprint when you observe these signals. Be helpful, not pushy — mention it once, then follow the user's lead.
|
|
26
|
+
|
|
27
|
+
**`/discover`** — User describes a new product idea, asks "what should I build", is unsure about scope or target users, is non-technical or building their first product, or project has no product documentation.
|
|
28
|
+
|
|
29
|
+
**`/scaffold-foundation`** — User wants to set up a monorepo, mentions Turborepo or project structure, or project has no `turbo.json` / `pnpm-workspace.yaml`. Best after discovery. Skip for single-repo apps.
|
|
30
|
+
|
|
31
|
+
**`/scaffold-db`** — User mentions database, Drizzle, PostgreSQL, schemas, migrations, or needs a structured db layer. Or is writing raw SQL or using an ORM without organized schemas.
|
|
32
|
+
|
|
33
|
+
**`/scaffold-auth`** — User mentions login, signup, users, accounts, teams, organizations, permissions, or authentication. Or is implementing auth from scratch. Recommend `/scaffold-db` first if not already installed.
|
|
34
|
+
|
|
35
|
+
**`/audit`** — User asks "what should I do next?", wants to understand their project's state, or has hand-rolled infrastructure that a blueprint could improve.
|
|
36
|
+
|
|
37
|
+
## Lifecycle & Dependencies
|
|
38
|
+
|
|
39
|
+
Discovery → Foundation → Features is the recommended flow, but blueprints can be applied at any stage.
|
|
40
|
+
|
|
41
|
+
- **New project, no code:** Start with `/discover` (especially for non-technical users) or `/scaffold-foundation` (for monorepos)
|
|
42
|
+
- **Single-repo project:** Skip foundation — go directly to feature blueprints (`/scaffold-db`, `/scaffold-auth`)
|
|
43
|
+
- **Has monorepo, missing features:** Suggest specific feature blueprints
|
|
44
|
+
- **Existing project:** Feature blueprints adapt to existing structures — no foundation required
|
|
45
|
+
- **Dependencies:** `/scaffold-auth` works best after `/scaffold-db` (auth builds on db patterns). Install dependencies first.
|
|
46
|
+
|
|
47
|
+
## Important
|
|
48
|
+
|
|
49
|
+
- Check `.project-context.md` first — do not recommend blueprints already recorded there.
|
|
50
|
+
- Read the full BLUEPRINT.md before scaffolding. Follow ENGINEERING.md for coding conventions.
|
|
51
|
+
- Only recommend blueprints listed above. Other blueprints are in development and not yet available.
|
|
52
|
+
- Blueprints location: `~/.withmata/blueprints/`
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: discover
|
|
3
|
+
description: Run a structured product discovery session producing product documentation (no code)
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Run Product Discovery
|
|
2
7
|
|
|
3
8
|
Run a rigorous product discovery session. This produces product documentation — no code is generated. The session is a structured 60-minute deep dive that transforms a raw idea into a defensible product strategy.
|
|
@@ -7,11 +12,11 @@ Run a rigorous product discovery session. This produces product documentation
|
|
|
7
12
|
Read the full discovery blueprint and all templates:
|
|
8
13
|
|
|
9
14
|
```
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
~/.withmata/blueprints/blueprints/discovery/product-discovery/BLUEPRINT.md
|
|
16
|
+
~/.withmata/blueprints/blueprints/discovery/product-discovery/templates/*
|
|
12
17
|
```
|
|
13
18
|
|
|
14
|
-
If not found
|
|
19
|
+
If not found, run `npx @withmata/blueprints` to install.
|
|
15
20
|
|
|
16
21
|
The BLUEPRINT.md contains the full methodology: phased session structure, frameworks, operating principles, research strategy, challenge patterns, and quality checkpoints. Follow it precisely.
|
|
17
22
|
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: new-blueprint
|
|
3
|
+
description: Add a new blueprint to the withmata blueprints repository
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Add a New Blueprint
|
|
2
7
|
|
|
3
8
|
Guide the user through adding a new blueprint to this repo. This command ensures every blueprint follows the established conventions and is fully wired up.
|
|
@@ -214,11 +219,11 @@ Before considering the BLUEPRINT.md done, verify:
|
|
|
214
219
|
- [ ] Code files use `{{SCOPE}}`, `{{APP_NAME}}`, and `// CONFIGURE:` markers
|
|
215
220
|
- [ ] References link to official docs
|
|
216
221
|
|
|
217
|
-
## Step 5: Create the Scaffold
|
|
222
|
+
## Step 5: Create the Scaffold Skill
|
|
218
223
|
|
|
219
|
-
Create the
|
|
224
|
+
Create the skill as `.claude/skills/scaffold-{name}/SKILL.md`. Follow the pattern from existing skills (read `.claude/skills/scaffold-auth/SKILL.md` as the model). Add YAML frontmatter with `name` and `description` fields.
|
|
220
225
|
|
|
221
|
-
|
|
226
|
+
Every scaffold skill must:
|
|
222
227
|
|
|
223
228
|
1. **Read the blueprint** — BLUEPRINT.md and all files
|
|
224
229
|
2. **Read project context** — `.project-context.md` for existing state
|
|
@@ -226,14 +231,14 @@ Follow the pattern from existing commands (read `.claude/commands/scaffold-auth.
|
|
|
226
231
|
4. **Ask clarifying questions** — based on the blueprint's configurable options
|
|
227
232
|
5. **Adapt and scaffold** — replace placeholders, adapt to project structure
|
|
228
233
|
6. **Update project context** — append to `.project-context.md`
|
|
229
|
-
7. **
|
|
234
|
+
7. **Create maintenance skill** — as the final step, create a project-level maintenance skill at `<project>/.claude/skills/{name}-maintenance/SKILL.md` with `user-invocable: false` containing the blueprint's maintenance hooks
|
|
230
235
|
8. **Summarize** — packages to install, env vars to set, manual steps remaining
|
|
231
236
|
|
|
232
|
-
The
|
|
237
|
+
The skill should reference the BLUEPRINT.md as the source of truth for methodology and not duplicate its content.
|
|
233
238
|
|
|
234
239
|
## Step 6: Update the Repo
|
|
235
240
|
|
|
236
|
-
After the blueprint and
|
|
241
|
+
After the blueprint and skill are created:
|
|
237
242
|
|
|
238
243
|
1. **Update README.md** — Add the new blueprint to the appropriate table (Complete or Planned) in the "Available blueprints" section. Add a scaffold command entry to the "Available commands" table.
|
|
239
244
|
|
|
@@ -243,14 +248,14 @@ After the blueprint and command are created:
|
|
|
243
248
|
|
|
244
249
|
4. **Check for a planned blueprint placeholder** — If `blueprints/features/{name}/BLUEPRINT.md` already existed as a planned placeholder, replace it entirely with the full BLUEPRINT.md. Don't try to preserve the placeholder content.
|
|
245
250
|
|
|
246
|
-
5. **Ensure
|
|
251
|
+
5. **Ensure the new scaffold skill exists at `.claude/skills/scaffold-{name}/SKILL.md`.**
|
|
247
252
|
|
|
248
253
|
## Step 7: Verify
|
|
249
254
|
|
|
250
255
|
Before considering the blueprint done:
|
|
251
256
|
|
|
252
257
|
1. Read back the BLUEPRINT.md and verify it meets the quality checklist from Step 4
|
|
253
|
-
2. Read the scaffold
|
|
258
|
+
2. Read the scaffold skill and verify it follows the pattern from Step 5
|
|
254
259
|
3. Verify all files in files/ use proper placeholders (no hardcoded scopes or app names)
|
|
255
260
|
4. Verify README.md and CHANGELOG.md are updated
|
|
256
261
|
5. Show the user a summary of everything that was created
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: new-project
|
|
3
|
+
description: Take a product from idea to running code using the full blueprint lifecycle
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# New Project
|
|
2
7
|
|
|
3
8
|
Take a product from idea to running code. This command walks through the full lifecycle — defining the product, setting up the codebase to support it, and wiring in the capabilities it needs. You're a product partner with deep engineering expertise: the product strategy drives every technical decision.
|
|
@@ -7,19 +12,19 @@ Take a product from idea to running code. This command walks through the full li
|
|
|
7
12
|
Load all available blueprints so you understand what's possible:
|
|
8
13
|
|
|
9
14
|
```
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
~/.withmata/blueprints/blueprints/discovery/product-discovery/BLUEPRINT.md
|
|
16
|
+
~/.withmata/blueprints/blueprints/discovery/product-discovery/templates/*
|
|
17
|
+
~/.withmata/blueprints/blueprints/foundation/monorepo-turbo/BLUEPRINT.md
|
|
18
|
+
~/.withmata/blueprints/blueprints/foundation/monorepo-turbo/files/**/*
|
|
14
19
|
```
|
|
15
20
|
|
|
16
21
|
Also scan for available feature blueprints:
|
|
17
22
|
|
|
18
23
|
```
|
|
19
|
-
|
|
24
|
+
~/.withmata/blueprints/blueprints/features/*/BLUEPRINT.md
|
|
20
25
|
```
|
|
21
26
|
|
|
22
|
-
Only consider a feature blueprint "available" if its BLUEPRINT.md has `Status: Complete` (not a placeholder). If not found
|
|
27
|
+
Only consider a feature blueprint "available" if its BLUEPRINT.md has `Status: Complete` (not a placeholder). If not found, run `npx @withmata/blueprints` to install.
|
|
23
28
|
|
|
24
29
|
## Step 2: Assess Current State
|
|
25
30
|
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scaffold-auth
|
|
3
|
+
description: Scaffold Better Auth + Drizzle authentication into the current project
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Scaffold Auth Blueprint
|
|
2
7
|
|
|
3
8
|
Scaffold the `auth-better-auth` blueprint into the current project. Read the full blueprint first, then adapt it to this project's stack.
|
|
@@ -7,11 +12,11 @@ Scaffold the `auth-better-auth` blueprint into the current project. Read the ful
|
|
|
7
12
|
Read the full BLUEPRINT.md and all code files from the auth blueprint:
|
|
8
13
|
|
|
9
14
|
```
|
|
10
|
-
blueprints/features/auth-better-auth/BLUEPRINT.md
|
|
11
|
-
blueprints/features/auth-better-auth/files/**/*
|
|
15
|
+
~/.withmata/blueprints/blueprints/features/auth-better-auth/BLUEPRINT.md
|
|
16
|
+
~/.withmata/blueprints/blueprints/features/auth-better-auth/files/**/*
|
|
12
17
|
```
|
|
13
18
|
|
|
14
|
-
If
|
|
19
|
+
If not found at these paths, run `npx @withmata/blueprints` to install.
|
|
15
20
|
|
|
16
21
|
## Step 1.5: Read Project Context
|
|
17
22
|
|
|
@@ -115,13 +120,13 @@ Based on the project structure, project context, and user answers, adapt the blu
|
|
|
115
120
|
### 4a. Database Layer
|
|
116
121
|
|
|
117
122
|
**If monorepo:**
|
|
118
|
-
- Copy/adapt `files/db/drizzle.config.ts`
|
|
123
|
+
- Copy/adapt `files/db/drizzle.config.ts` -> `packages/db/drizzle/auth/drizzle.config.ts`
|
|
119
124
|
- Copy `files/db/auth-schema.ts` as a reference (the actual schema will be auto-generated)
|
|
120
125
|
- Add the `"./auth"` export to `packages/db/package.json`
|
|
121
126
|
- Add `auth:generate` and `auth:migrate` scripts to `packages/db/package.json`
|
|
122
127
|
|
|
123
128
|
**If single-repo:**
|
|
124
|
-
- Copy/adapt `files/db/drizzle.config.ts`
|
|
129
|
+
- Copy/adapt `files/db/drizzle.config.ts` -> `drizzle/auth/drizzle.config.ts` (at project root)
|
|
125
130
|
- Adjust schema paths to `"./src/db/auth/schema.ts"` (relative to root)
|
|
126
131
|
- Create `src/db/auth/` directory for auth schema
|
|
127
132
|
- No separate package.json export needed — use direct imports
|
|
@@ -129,17 +134,17 @@ Based on the project structure, project context, and user answers, adapt the blu
|
|
|
129
134
|
### 4b. Server Layer
|
|
130
135
|
|
|
131
136
|
**If monorepo:**
|
|
132
|
-
- Copy/adapt `files/server/auth.ts`
|
|
137
|
+
- Copy/adapt `files/server/auth.ts` -> `apis/server/src/auth/index.ts`
|
|
133
138
|
- Replace `{{APP_NAME}}`, `{{EMAIL_FROM}}`, `{{SCOPE}}`
|
|
134
|
-
- Copy/adapt `files/server/auth-db.ts`
|
|
135
|
-
- Copy/adapt `files/server/middleware.ts`
|
|
139
|
+
- Copy/adapt `files/server/auth-db.ts` -> `apis/server/src/db/auth.ts`
|
|
140
|
+
- Copy/adapt `files/server/middleware.ts` -> `apis/server/src/middleware/auth.ts`
|
|
136
141
|
- Merge auth env vars into `apis/server/src/env.ts`
|
|
137
142
|
|
|
138
143
|
**If single-repo:**
|
|
139
|
-
- Copy/adapt `files/server/auth.ts`
|
|
144
|
+
- Copy/adapt `files/server/auth.ts` -> `src/lib/auth/index.ts`
|
|
140
145
|
- Replace `{{APP_NAME}}`, `{{EMAIL_FROM}}`
|
|
141
146
|
- Adjust DB import to use direct path: `import { db } from "@/db/auth/client"` or `#db/auth/client`
|
|
142
|
-
- Copy/adapt `files/server/auth-db.ts`
|
|
147
|
+
- Copy/adapt `files/server/auth-db.ts` -> `src/lib/db/auth.ts`
|
|
143
148
|
- Default to Next.js API routes (no separate Hono server)
|
|
144
149
|
- Merge auth env vars into existing `env.ts` (or create one)
|
|
145
150
|
|
|
@@ -221,21 +226,19 @@ If `.project-context.md` does not exist, create it with the standard header and
|
|
|
221
226
|
|
|
222
227
|
Also append any significant architectural decisions to the `## Architecture Decisions` section.
|
|
223
228
|
|
|
224
|
-
###
|
|
229
|
+
### Create Maintenance Skill
|
|
225
230
|
|
|
226
|
-
|
|
231
|
+
Create a project-level maintenance skill for the auth blueprint:
|
|
227
232
|
|
|
228
|
-
|
|
229
|
-
2. If `AGENTS.md` exists in the target project → append rules there
|
|
230
|
-
3. If both exist → append to both (keep them in sync)
|
|
231
|
-
4. If neither exists → ask the user which AI coding tool(s) they use:
|
|
232
|
-
- Claude Code → create CLAUDE.md with a `## Maintenance Rules` section
|
|
233
|
-
- OpenCode or Cursor → create AGENTS.md with a `## Maintenance Rules` section (both tools read AGENTS.md)
|
|
234
|
-
- Multiple tools → create all applicable files
|
|
233
|
+
**File:** `<project>/.claude/skills/auth-maintenance/SKILL.md`
|
|
235
234
|
|
|
236
|
-
|
|
235
|
+
```yaml
|
|
236
|
+
---
|
|
237
|
+
name: auth-maintenance
|
|
238
|
+
description: Maintenance rules for Better Auth. Invoke when modifying auth config, providers, session settings, or auth schema.
|
|
239
|
+
user-invocable: false
|
|
240
|
+
---
|
|
237
241
|
|
|
238
|
-
```markdown
|
|
239
242
|
### auth-better-auth maintenance
|
|
240
243
|
- After modifying Better Auth server config, plugins, or providers: run `pnpm auth:generate && pnpm auth:migrate`
|
|
241
244
|
- After updating `better-auth` package: run `pnpm auth:generate`, check for schema changes, migrate if needed
|
|
@@ -245,8 +248,6 @@ The maintenance rules content is identical regardless of which file it goes into
|
|
|
245
248
|
- Never edit the auto-generated auth schema directly — modify the Better Auth config and regenerate
|
|
246
249
|
```
|
|
247
250
|
|
|
248
|
-
If the `## Maintenance Rules` heading already exists (from another blueprint), only add the `### auth-better-auth maintenance` subsection — do not duplicate the heading.
|
|
249
|
-
|
|
250
251
|
## Step 6: Output Summary
|
|
251
252
|
|
|
252
253
|
After scaffolding, provide the user with a clear summary:
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scaffold-db
|
|
3
|
+
description: Scaffold Drizzle ORM + PostgreSQL database package into the current project
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Scaffold DB Blueprint
|
|
2
7
|
|
|
3
8
|
Scaffold the `db-drizzle-postgres` blueprint into the current project. Read the full blueprint first, then adapt it to this project's stack.
|
|
@@ -7,11 +12,11 @@ Scaffold the `db-drizzle-postgres` blueprint into the current project. Read the
|
|
|
7
12
|
Read the full BLUEPRINT.md and all template files from the db blueprint:
|
|
8
13
|
|
|
9
14
|
```
|
|
10
|
-
blueprints/features/db-drizzle-postgres/BLUEPRINT.md
|
|
11
|
-
blueprints/features/db-drizzle-postgres/files/**/*
|
|
15
|
+
~/.withmata/blueprints/blueprints/features/db-drizzle-postgres/BLUEPRINT.md
|
|
16
|
+
~/.withmata/blueprints/blueprints/features/db-drizzle-postgres/files/**/*
|
|
12
17
|
```
|
|
13
18
|
|
|
14
|
-
If
|
|
19
|
+
If not found at these paths, run `npx @withmata/blueprints` to install.
|
|
15
20
|
|
|
16
21
|
## Step 1.5: Read Project Context
|
|
17
22
|
|
|
@@ -188,21 +193,19 @@ scripts_added:
|
|
|
188
193
|
|
|
189
194
|
If `.project-context.md` does not exist, create it with the standard header and the Installed Blueprints section. Log a note: "No discovery or foundation context found. Consider running `/discover` and `/scaffold-foundation` for a complete project context."
|
|
190
195
|
|
|
191
|
-
###
|
|
196
|
+
### Create Maintenance Skill
|
|
192
197
|
|
|
193
|
-
|
|
198
|
+
Create a project-level maintenance skill for the database blueprint:
|
|
194
199
|
|
|
195
|
-
|
|
196
|
-
2. If `AGENTS.md` exists in the target project -> append rules there
|
|
197
|
-
3. If both exist -> append to both (keep them in sync)
|
|
198
|
-
4. If neither exists -> ask the user which AI coding tool(s) they use:
|
|
199
|
-
- Claude Code -> create CLAUDE.md with a `## Maintenance Rules` section
|
|
200
|
-
- OpenCode or Cursor -> create AGENTS.md with a `## Maintenance Rules` section (both tools read AGENTS.md)
|
|
201
|
-
- Multiple tools -> create all applicable files
|
|
200
|
+
**File:** `<project>/.claude/skills/db-maintenance/SKILL.md`
|
|
202
201
|
|
|
203
|
-
|
|
202
|
+
```yaml
|
|
203
|
+
---
|
|
204
|
+
name: db-maintenance
|
|
205
|
+
description: Maintenance rules for Drizzle + PostgreSQL database. Invoke when modifying schemas, adding entities, or running migrations.
|
|
206
|
+
user-invocable: false
|
|
207
|
+
---
|
|
204
208
|
|
|
205
|
-
```markdown
|
|
206
209
|
### db-drizzle-postgres maintenance
|
|
207
210
|
- After creating a new schema file: add it to `drizzle/<group>/drizzle.config.ts` schema array AND the group's `index.ts` barrel export
|
|
208
211
|
- After any schema change: run `pnpm <group>:generate && pnpm <group>:migrate`
|
|
@@ -211,8 +214,6 @@ The maintenance rules content is identical regardless of which file it goes into
|
|
|
211
214
|
- Never use glob patterns in drizzle.config.ts schema — always list files explicitly, excluding index.ts
|
|
212
215
|
```
|
|
213
216
|
|
|
214
|
-
If the `## Maintenance Rules` heading already exists (from another blueprint), only add the `### db-drizzle-postgres maintenance` subsection — do not duplicate the heading.
|
|
215
|
-
|
|
216
217
|
## Step 6: Output Summary
|
|
217
218
|
|
|
218
219
|
After scaffolding, provide the user with a clear summary:
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scaffold-foundation
|
|
3
|
+
description: Set up a Turborepo + pnpm monorepo skeleton (skip for single-repo apps)
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Scaffold Foundation
|
|
2
7
|
|
|
3
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.
|
|
@@ -7,11 +12,11 @@ Set up the monorepo project skeleton using the foundation blueprint. **For singl
|
|
|
7
12
|
Read the full foundation blueprint and all template files:
|
|
8
13
|
|
|
9
14
|
```
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
~/.withmata/blueprints/blueprints/foundation/monorepo-turbo/BLUEPRINT.md
|
|
16
|
+
~/.withmata/blueprints/blueprints/foundation/monorepo-turbo/files/**/*
|
|
12
17
|
```
|
|
13
18
|
|
|
14
|
-
If not found
|
|
19
|
+
If not found, run `npx @withmata/blueprints` to install.
|
|
15
20
|
|
|
16
21
|
The BLUEPRINT.md contains the full architecture documentation, naming conventions, folder conventions, and file manifest. Follow it precisely.
|
|
17
22
|
|
|
@@ -114,22 +119,18 @@ foundation_completed: <date>
|
|
|
114
119
|
|
|
115
120
|
If `.project-context.md` does not exist, create it with the standard header and the Foundation section.
|
|
116
121
|
|
|
117
|
-
###
|
|
118
|
-
|
|
119
|
-
Append the condensed maintenance rules to the target project's rules file(s):
|
|
122
|
+
### Create Maintenance Skill
|
|
120
123
|
|
|
121
|
-
|
|
122
|
-
2. If `AGENTS.md` exists in the target project → append rules there
|
|
123
|
-
3. If both exist → append to both (keep them in sync)
|
|
124
|
-
4. If neither exists → ask the user which AI coding tool(s) they use:
|
|
125
|
-
- Claude Code → create CLAUDE.md with a `## Maintenance Rules` section
|
|
126
|
-
- OpenCode or Cursor → create AGENTS.md with a `## Maintenance Rules` section (both tools read AGENTS.md)
|
|
127
|
-
- Multiple tools → create all applicable files
|
|
124
|
+
Create a project-level maintenance skill for the monorepo foundation:
|
|
128
125
|
|
|
129
|
-
|
|
126
|
+
**File:** `<project>/.claude/skills/monorepo-maintenance/SKILL.md`
|
|
130
127
|
|
|
131
|
-
```
|
|
132
|
-
|
|
128
|
+
```yaml
|
|
129
|
+
---
|
|
130
|
+
name: monorepo-maintenance
|
|
131
|
+
description: Maintenance rules for the Turborepo monorepo foundation. Invoke when modifying workspace configs, shared packages, or Turbo tasks.
|
|
132
|
+
user-invocable: false
|
|
133
|
+
---
|
|
133
134
|
|
|
134
135
|
### Monorepo maintenance
|
|
135
136
|
- After every code change: format with Biome (`pnpm biome check --write .`) before considering work complete
|
package/ENGINEERING.md
CHANGED
|
@@ -41,7 +41,7 @@ These preferences apply to ALL blueprints in this repo and to any project scaffo
|
|
|
41
41
|
- **Project types:** Blueprints support both `monorepo` and `single-repo` project types. Monorepo conventions (workspaces, Turbo, shared config packages) are conditional on project type. Single-repo apps skip Foundation and go directly to Features.
|
|
42
42
|
- **Blueprint dependencies:** Declared in `## Blueprint Dependencies` in each BLUEPRINT.md. Two types: `required` (checked during scaffolding, user prompted) and `recommended` (mentioned once). Auth requires DB. See individual BLUEPRINT.md files for the full dependency graph.
|
|
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
|
|
46
|
+
- **Available skills:** `/new-project`, `/discover`, `/scaffold-foundation`, `/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.
|