@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.
@@ -1,270 +0,0 @@
1
- ---
2
- name: new-blueprint
3
- description: Add a new blueprint to the withmata blueprints repository
4
- ---
5
-
6
- # Add a New Blueprint
7
-
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.
9
-
10
- ## Step 1: Understand the Conventions
11
-
12
- Read these files to understand the system you're adding to:
13
-
14
- ```
15
- ENGINEERING.md # Engineering preferences
16
- README.md # System overview and blueprint anatomy
17
- CHANGELOG.md # To update when done
18
- ```
19
-
20
- Also scan existing complete blueprints to understand the quality bar:
21
-
22
- ```
23
- blueprints/features/auth-better-auth/BLUEPRINT.md # Best example of a feature blueprint
24
- blueprints/foundation/monorepo-turbo/BLUEPRINT.md # Best example of a foundation blueprint
25
- blueprints/discovery/product-discovery/BLUEPRINT.md # Best example of a discovery blueprint
26
- ```
27
-
28
- ## Step 2: Gather Information
29
-
30
- Ask the user:
31
-
32
- 1. **"What pattern are you extracting?"** — What does it do? (e.g., "shared database layer with Drizzle", "Stripe billing integration", "email service with Resend")
33
-
34
- 2. **"Which tier?"** — Discovery (produces docs), Foundation (project skeleton), or Feature (plugs into existing project)? Most new blueprints are Features.
35
-
36
- 3. **"Is there an existing project to extract from?"** — If yes, get the path. If no, we're building from scratch — which is fine but harder.
37
-
38
- 4. **"What should it be called?"** — Suggest a name following the convention: `{domain}-{tool}` for features (e.g., `auth-better-auth`, `db-drizzle-postgres`, `billing-stripe`, `email-resend`). Foundation and discovery blueprints use `{purpose}-{tool}` (e.g., `monorepo-turbo`, `product-discovery`).
39
-
40
- ## Step 3: Extract or Build
41
-
42
- ### If extracting from an existing project:
43
-
44
- Read the relevant code in the source project. Understand:
45
- - What files are involved
46
- - How they connect to each other
47
- - What's project-specific vs what's the reusable pattern
48
- - What dependencies are needed
49
- - What environment variables are required
50
- - How it integrates with the monorepo (workspace deps, turbo tasks, root scripts)
51
-
52
- Then create the blueprint:
53
-
54
- 1. Create the directory: `blueprints/{tier}/{name}/`
55
- 2. Create `files/` with the extracted code — generalize project-specific values:
56
- - Replace npm scopes with `{{SCOPE}}`
57
- - Replace app names with `{{APP_NAME}}`
58
- - Replace project-specific emails, URLs, etc. with `{{PLACEHOLDER}}` and `// CONFIGURE:` comments
59
- - Remove any business logic that's not part of the pattern
60
- 3. Create `BLUEPRINT.md` following the structure below
61
-
62
- ### If building from scratch:
63
-
64
- 1. Create the directory: `blueprints/{tier}/{name}/`
65
- 2. Build the code files in `files/`, following the conventions in ENGINEERING.md
66
- 3. Create `BLUEPRINT.md` following the structure below
67
-
68
- ## Step 4: Write the BLUEPRINT.md
69
-
70
- This is the most important file. It's what makes AI-assisted scaffolding intelligent rather than mechanical. Follow this structure:
71
-
72
- ### Required sections (all tiers):
73
-
74
- ```markdown
75
- # [Name] Blueprint — [Short Description]
76
-
77
- ## Tier
78
- [Discovery | Foundation | Feature]
79
-
80
- ## Status
81
- [Complete | In Progress | Planned]
82
-
83
- ## Problem
84
- [What problem does this blueprint solve? Be specific about the pain point.]
85
- ```
86
-
87
- ### Additional sections for Feature blueprints:
88
-
89
- ```markdown
90
- ## Blueprint Dependencies
91
-
92
- [Does this blueprint require or recommend other blueprints be installed first?
93
- List them in a table with columns: Blueprint, Type (required/recommended), Why.
94
- If required, include a subsection explaining fallback behavior if the dependency is absent.
95
- If no dependencies, write "None."]
96
-
97
- ## Single-Repo Adaptation
98
-
99
- [How does file placement, imports, and scripts differ for standalone (non-monorepo) apps?
100
- Include a path mapping table (monorepo vs single-repo) and a single-repo scripts example.
101
- Document what core patterns stay the same regardless of project type.]
102
-
103
- ## Architecture
104
-
105
- ### Core Pattern
106
- [How does this work at a high level?]
107
-
108
- ### Key Decisions
109
- [For each major decision, document WHAT you chose and WHY. This is what lets the AI coding tool adapt intelligently.]
110
-
111
- - **[Decision 1]** (recommended/required) — [Explanation of what and why. Include alternatives if relevant.]
112
- - **[Decision 2]** (optional) — [Explanation]
113
-
114
- ## Hard Requirements vs Recommended Defaults
115
-
116
- **Hard requirements:**
117
- - [Things that can't change]
118
-
119
- **Recommended defaults — ask during scaffolding:**
120
-
121
- | Choice | Recommended | Alternatives |
122
- |---|---|---|
123
- | [Choice 1] | [Default] | [Options] |
124
-
125
- ## Dependencies
126
-
127
- ### npm packages
128
-
129
- **Server:**
130
- | Package | Version | Purpose |
131
- |---|---|---|
132
- | [pkg] | [version] | [why] |
133
-
134
- **Client:**
135
- | Package | Version | Purpose |
136
- |---|---|---|
137
-
138
- ### Environment Variables
139
-
140
- | Variable | Where | Description |
141
- |---|---|---|
142
- | [VAR] | [Server/Client] | [What it's for] |
143
-
144
- ## Monorepo Wiring
145
-
146
- [How does this integrate across workspaces? Package exports, workspace deps, turbo tasks, root scripts. This section is critical — it's the hardest part to figure out from scratch.]
147
-
148
- ## File Manifest
149
-
150
- | File | Purpose | Target Location |
151
- |---|---|---|
152
- | [file path in files/] | [what it does] | [where it goes in target project] |
153
-
154
- ## Integration Steps
155
-
156
- [Ordered phases for scaffolding. Group related steps.]
157
-
158
- ### Phase 1: [Name]
159
- 1. [Step]
160
- 2. [Step]
161
-
162
- ### Phase 2: [Name]
163
- ...
164
-
165
- ## Maintenance Hooks
166
-
167
- [What needs to happen after changes to keep this working?]
168
-
169
- ### Condensed Rules for project rules file
170
-
171
- ```markdown
172
- ### [name] maintenance
173
- - [rule 1]
174
- - [rule 2]
175
- ```
176
-
177
- ## References
178
-
179
- - [Links to docs, repos, etc.]
180
- ```
181
-
182
- ### Additional sections for Discovery blueprints:
183
-
184
- ```markdown
185
- ## Output
186
- [What documents are generated and where]
187
-
188
- ## Process
189
- [The conversational flow — phases, frameworks, quality gates]
190
- ```
191
-
192
- ### Additional sections for Foundation blueprints:
193
-
194
- ```markdown
195
- ## Output
196
- [What project structure is generated — show the directory tree]
197
-
198
- ## Architecture
199
- [Key structural decisions: why this tool, why this config, why this convention]
200
-
201
- ## Expects from Discovery
202
- [What info it reads from the discovery context, if anything]
203
- ```
204
-
205
- ### Quality checklist for BLUEPRINT.md:
206
-
207
- Before considering the BLUEPRINT.md done, verify:
208
-
209
- - [ ] Every architectural decision explains WHY, not just WHAT
210
- - [ ] Configurable vs opinionated choices are clearly separated
211
- - [ ] Blueprint Dependencies section is present (even if "None")
212
- - [ ] Single-Repo Adaptation section documents path mapping and script differences
213
- - [ ] File manifest covers every file in files/ with both monorepo and single-repo target locations
214
- - [ ] Integration steps are ordered and phased, with conditional monorepo/single-repo phases
215
- - [ ] Dependencies list specific versions
216
- - [ ] Environment variables are documented with descriptions
217
- - [ ] Monorepo wiring is documented (this is always the hardest part)
218
- - [ ] Maintenance hooks define trigger-action pairs
219
- - [ ] Code files use `{{SCOPE}}`, `{{APP_NAME}}`, and `// CONFIGURE:` markers
220
- - [ ] References link to official docs
221
-
222
- ## Step 5: Create the Scaffold Skill
223
-
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.
225
-
226
- Every scaffold skill must:
227
-
228
- 1. **Read the blueprint** — BLUEPRINT.md and all files
229
- 2. **Read project context** — `.project-context.md` for existing state
230
- 3. **Explore the target project** — understand current structure
231
- 4. **Ask clarifying questions** — based on the blueprint's configurable options
232
- 5. **Adapt and scaffold** — replace placeholders, adapt to project structure
233
- 6. **Update project context** — append to `.project-context.md`
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
235
- 8. **Summarize** — packages to install, env vars to set, manual steps remaining
236
-
237
- The skill should reference the BLUEPRINT.md as the source of truth for methodology and not duplicate its content.
238
-
239
- ## Step 6: Update the Repo
240
-
241
- After the blueprint and skill are created:
242
-
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.
244
-
245
- 2. **Update CHANGELOG.md** — Add an entry under [Unreleased] → Added describing the new blueprint.
246
-
247
- 3. **Update the directory structure** in README.md if it's shown there.
248
-
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.
250
-
251
- 5. **Ensure the new scaffold skill exists at `.claude/skills/scaffold-{name}/SKILL.md`.**
252
-
253
- ## Step 7: Verify
254
-
255
- Before considering the blueprint done:
256
-
257
- 1. Read back the BLUEPRINT.md and verify it meets the quality checklist from Step 4
258
- 2. Read the scaffold skill and verify it follows the pattern from Step 5
259
- 3. Verify all files in files/ use proper placeholders (no hardcoded scopes or app names)
260
- 4. Verify README.md and CHANGELOG.md are updated
261
- 5. Show the user a summary of everything that was created
262
-
263
- ## Tips for Good Blueprints
264
-
265
- - **Extract from real projects** — Blueprints that come from battle-tested code are always better than theoretical ones.
266
- - **Document the WHY** — The code is the easy part. The decisions and reasoning are what make AI-assisted scaffolding intelligent.
267
- - **Keep it focused** — One blueprint, one problem. If you're tempted to add "and also X", that's probably a separate blueprint.
268
- - **Include the monorepo wiring** — Package exports, workspace dependencies, turbo tasks, root scripts. This is always the part people get wrong, and it's where the blueprint adds the most value.
269
- - **Think about maintenance** — What breaks silently if you forget to run something? Those are your maintenance hooks.
270
- - **Use existing blueprints as your quality bar** — Read auth-better-auth before writing yours. Match that level of detail.