@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.
@@ -1,162 +0,0 @@
1
- ---
2
- description: Set up Turborepo + pnpm monorepo skeleton
3
- ---
4
-
5
- # Scaffold Foundation
6
-
7
- 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.
8
-
9
- ## Step 1: Read the Blueprint
10
-
11
- Read the full foundation blueprint and all template files:
12
-
13
- ```
14
- ~/Documents/WithMata/my-blueprints/blueprints/foundation/monorepo-turbo/BLUEPRINT.md
15
- ~/Documents/WithMata/my-blueprints/blueprints/foundation/monorepo-turbo/files/**/*
16
- ```
17
-
18
- If not found at that path, ask the user for the path to their blueprints repo.
19
-
20
- The BLUEPRINT.md contains the full architecture documentation, naming conventions, folder conventions, and file manifest. Follow it precisely.
21
-
22
- ## Step 2: Read Project Context
23
-
24
- Check if `.project-context.md` exists in the target project root:
25
-
26
- - **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.
27
-
28
- - **If it has a Foundation section already**: warn the user. Ask: "Foundation was already set up. Do you want to re-scaffold (destructive — replaces existing structure) or skip?"
29
-
30
- - **If no context file exists**: that is fine. Ask the user directly for the product name and npm scope.
31
-
32
- ## Step 3: Understand Current State
33
-
34
- Explore the target project directory:
35
-
36
- - Is it empty? Fresh start — scaffold everything.
37
- - Does it already have files? Ask before overwriting anything.
38
- - Is there an existing `package.json`? Read it for context.
39
-
40
- ## Step 4: Ask Configuration Questions
41
-
42
- Only three questions — skip any already answered by project context:
43
-
44
- 1. **npm scope** — "What npm scope should internal packages use? (e.g., @acme)" Default: derive from product name.
45
- 2. **Project name** — "What is the human-readable project name?" (for metadata, page titles). Default: from discovery context.
46
- 3. **Node.js version** — "Target Node.js version?" Default: `>=22`.
47
-
48
- ## Step 5: Scaffold
49
-
50
- Create the monorepo skeleton by adapting all files from the blueprint. Replace placeholders:
51
-
52
- - `{{SCOPE}}` -> the npm scope (e.g., `@acme`)
53
- - `{{APP_NAME}}` -> the human-readable name (e.g., `Acme Dashboard`)
54
-
55
- ### 5a. Root Configuration
56
-
57
- From `files/root/`, create at project root:
58
- - `package.json` — root monorepo config
59
- - `turbo.json` — task orchestration
60
- - `pnpm-workspace.yaml` — workspace patterns
61
- - `biome.json` — linting + formatting
62
- - `.gitignore` — from `files/root/gitignore`
63
-
64
- ### 5b. Config Packages
65
-
66
- From `files/config/`, create:
67
- - `config/typescript-config/` — base.json, nextjs.json, react-library.json, package.json
68
- - `config/tailwind-config/` — shared-styles.css, postcss.config.js, package.json
69
-
70
- ### 5c. Next.js App Shell
71
-
72
- From `files/apps/web/`, create:
73
- - `apps/web/package.json`
74
- - `apps/web/tsconfig.json`
75
- - `apps/web/next.config.ts`
76
- - `apps/web/env.ts`
77
- - `apps/web/postcss.config.mjs`
78
- - `apps/web/app/layout.tsx`
79
- - `apps/web/app/page.tsx`
80
- - `apps/web/app/globals.css`
81
-
82
- ### 5d. Empty Workspace Directories
83
-
84
- Create empty directories for feature blueprints:
85
- - `apis/` — backend feature blueprint will add servers here
86
- - `packages/` — feature blueprints will add shared packages here
87
-
88
- ### 5e. Initialize
89
-
90
- After creating all files:
91
- 1. Initialize git if not already a repo: `git init`
92
- 2. Run `pnpm install` to verify the workspace configuration is valid
93
- 3. Verify the dev server starts: `pnpm dev` (briefly — just check it boots)
94
-
95
- ## Step 6: Update Project Context
96
-
97
- Append the `## Foundation` section to `.project-context.md`:
98
-
99
- ```yaml
100
- ## Foundation
101
- monorepo_tool: turborepo
102
- package_manager: pnpm
103
- npm_scope: "<scope>"
104
- node_version: ">=22"
105
- workspaces:
106
- apps: ["web"]
107
- apis: []
108
- packages: []
109
- config: ["typescript-config", "tailwind-config"]
110
- framework: next.js (app router)
111
- typescript: strict
112
- linter: biome
113
- styling: tailwind-v4
114
- env_validation: t3-env + zod
115
- module_resolution: node subpath imports (#prefix)
116
- foundation_completed: <date>
117
- ```
118
-
119
- If `.project-context.md` does not exist, create it with the standard header and the Foundation section.
120
-
121
- ### Inject Maintenance Rules
122
-
123
- Append the condensed maintenance rules to the target project's rules file(s):
124
-
125
- 1. If `CLAUDE.md` exists in the target project → append rules there
126
- 2. If `AGENTS.md` exists in the target project → append rules there
127
- 3. If both exist → append to both (keep them in sync)
128
- 4. If neither exists → ask the user which AI coding tool(s) they use:
129
- - Claude Code → create CLAUDE.md with a `## Maintenance Rules` section
130
- - OpenCode or Cursor → create AGENTS.md with a `## Maintenance Rules` section (both tools read AGENTS.md)
131
- - Multiple tools → create all applicable files
132
-
133
- The maintenance rules content is identical regardless of which file it goes into:
134
-
135
- ```markdown
136
- ## Maintenance Rules
137
-
138
- ### Monorepo maintenance
139
- - After every code change: format with Biome (`pnpm biome check --write .`) before considering work complete
140
- - After adding new workspace packages: verify `pnpm-workspace.yaml` patterns match, run `pnpm install`
141
- - After modifying shared configs (`config/typescript-config/`, `config/tailwind-config/`): verify all consumers still build
142
- - After changing `turbo.json`: verify task ordering with `pnpm turbo run <task> --dry`
143
- - After adding workspace dependencies: run `pnpm install` to create workspace links
144
- - Keep `turbo.json` tasks with `cache: false` for any task with side effects (migrations, code generation)
145
- ```
146
-
147
- ## Step 7: Summarize
148
-
149
- Tell the user:
150
-
151
- - Project structure overview (directory tree)
152
- - What was configured (scope, Node version, tooling)
153
- - How to start development: `pnpm dev`
154
- - Available feature blueprints to install next
155
- - Suggest: "Run `/scaffold-auth` to add authentication. Other feature blueprints: ui-shared-components, tailwind-v4, db-drizzle-postgres."
156
-
157
- ## Important Notes
158
-
159
- - Never overwrite existing files without asking.
160
- - Preserve all `// CONFIGURE:` comments in generated files so the user can find customization points.
161
- - The Tailwind config is intentionally minimal — the UI feature blueprint extends it with shadcn, animations, and component-specific styles.
162
- - Feature blueprints will add scripts to root `package.json` and tasks to `turbo.json` — the foundation provides the base that they extend.