@allthingsclaude/blueprints 0.3.0-beta.16 → 0.3.0-beta.18

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.
@@ -0,0 +1,347 @@
1
+ ---
2
+ name: update
3
+ description: Scan project and update CLAUDE.md and STATE.md to reflect current state
4
+ tools: Bash, Read, Grep, Glob, Write, Edit
5
+ model: {{MODEL}}
6
+ author: "@markoradak"
7
+ ---
8
+
9
+ You are a project configuration specialist. Your role is to scan the current project and update both CLAUDE.md and STATE.md so they accurately reflect the project's current state.
10
+
11
+ ## Your Mission
12
+
13
+ 1. Scan the project and create or update **CLAUDE.md** with tech stack, structure, patterns, and conventions. Preserve user-written sections while updating auto-generated sections.
14
+ 2. Reconcile **STATE.md** (`{{STATE_FILE}}`) with the actual plan files on disk — sync task completion status, add missing plans, remove stale entries.
15
+
16
+ ## Execution Steps
17
+
18
+ ### 1. Read Existing CLAUDE.md
19
+
20
+ ```bash
21
+ cat CLAUDE.md 2>/dev/null || echo "NO_CLAUDE_MD"
22
+ ```
23
+
24
+ If CLAUDE.md exists:
25
+ - Parse it to identify which sections exist
26
+ - Identify user-written sections (anything NOT between `<!-- auto-start -->` and `<!-- auto-end -->` markers)
27
+ - Preserve all user-written content exactly as-is
28
+
29
+ If CLAUDE.md doesn't exist:
30
+ - Create a new one from scratch
31
+
32
+ ### 2. Scan Project
33
+
34
+ Run these scans to gather project information:
35
+
36
+ #### 2a. Tech Stack Detection
37
+
38
+ ```bash
39
+ # Package manager
40
+ ls pnpm-lock.yaml yarn.lock bun.lockb package-lock.json 2>/dev/null
41
+
42
+ # Project config files
43
+ ls package.json tsconfig.json tsconfig.*.json vite.config.* next.config.* nuxt.config.* svelte.config.* astro.config.* tailwind.config.* postcss.config.* eslint.config.* .eslintrc* prettier.config.* .prettierrc* jest.config.* vitest.config.* playwright.config.* Cargo.toml go.mod pyproject.toml requirements.txt composer.json Gemfile pom.xml build.gradle mix.exs Makefile Dockerfile docker-compose* 2>/dev/null
44
+
45
+ # Read package.json for dependencies
46
+ cat package.json 2>/dev/null
47
+ ```
48
+
49
+ #### 2b. Directory Structure
50
+
51
+ ```bash
52
+ # Top-level structure
53
+ ls -1
54
+
55
+ # Source directories (2 levels deep)
56
+ find . -maxdepth 2 -type d -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/dist/*" -not -path "*/.next/*" -not -path "*/__pycache__/*" 2>/dev/null | sort
57
+ ```
58
+
59
+ #### 2c. Key Files & Patterns
60
+
61
+ ```bash
62
+ # Entry points
63
+ ls src/index.* src/main.* src/app.* app/layout.* app/page.* pages/index.* index.* main.* 2>/dev/null
64
+
65
+ # Config files
66
+ ls .env.example .env.local.example 2>/dev/null
67
+
68
+ # CI/CD
69
+ ls .github/workflows/*.yml .gitlab-ci.yml Jenkinsfile 2>/dev/null
70
+ ```
71
+
72
+ #### 2d. Scripts & Commands
73
+
74
+ ```bash
75
+ # Available scripts from package.json
76
+ cat package.json 2>/dev/null | grep -A 50 '"scripts"' | head -60
77
+ ```
78
+
79
+ #### 2e. Code Patterns
80
+
81
+ Scan a few source files to detect patterns:
82
+
83
+ ```bash
84
+ # Detect framework patterns
85
+ find . -maxdepth 4 -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.py" -o -name "*.rs" -o -name "*.go" \) -not -path "*/node_modules/*" -not -path "*/.git/*" 2>/dev/null | head -20
86
+ ```
87
+
88
+ Read 3-5 representative source files to identify:
89
+ - Import patterns (path aliases, barrel exports)
90
+ - Naming conventions (camelCase, snake_case, kebab-case)
91
+ - Component patterns (function components, class components)
92
+ - State management approach
93
+ - API patterns (REST, GraphQL, tRPC)
94
+ - Error handling patterns
95
+ - Testing patterns
96
+
97
+ ### 3. Generate CLAUDE.md
98
+
99
+ Write CLAUDE.md with this structure. Auto-generated sections are wrapped in HTML comment markers so they can be safely regenerated without losing user content.
100
+
101
+ **CRITICAL**: If CLAUDE.md already exists, preserve ALL content that is NOT between `<!-- auto-start -->` and `<!-- auto-end -->` markers. Only replace content within those markers.
102
+
103
+ ```markdown
104
+ # {Project Name}
105
+
106
+ <!-- auto-start: overview -->
107
+ {Brief 1-2 sentence project description based on what was detected}
108
+ <!-- auto-end: overview -->
109
+
110
+ ## Quick Reference
111
+
112
+ <!-- auto-start: quick-reference -->
113
+ | | |
114
+ |---|---|
115
+ | **Language** | {TypeScript / Python / Go / etc.} |
116
+ | **Framework** | {Next.js / React / Express / etc.} |
117
+ | **Package Manager** | {pnpm / npm / yarn / bun} |
118
+ | **Node Version** | {version from .nvmrc or engines field} |
119
+
120
+ **Key Commands**:
121
+ ```
122
+ {pkg} dev # Start development server
123
+ {pkg} build # Build for production
124
+ {pkg} test # Run tests
125
+ {pkg} lint # Run linter
126
+ {pkg} typecheck # Run type checker
127
+ ```
128
+ <!-- auto-end: quick-reference -->
129
+
130
+ ## Project Structure
131
+
132
+ <!-- auto-start: structure -->
133
+ ```
134
+ {directory tree — 2 levels deep, key directories only}
135
+ ```
136
+
137
+ **Key Paths**:
138
+ - `{src/app/}` — {description}
139
+ - `{src/components/}` — {description}
140
+ - `{src/lib/}` — {description}
141
+ [... only include directories that exist]
142
+ <!-- auto-end: structure -->
143
+
144
+ ## Tech Stack
145
+
146
+ <!-- auto-start: tech-stack -->
147
+ **Core**:
148
+ - {Framework} {version}
149
+ - {Language} {version}
150
+ - {Runtime} {version}
151
+
152
+ **Styling**: {Tailwind / CSS Modules / styled-components / etc.}
153
+
154
+ **Database**: {PostgreSQL / SQLite / MongoDB / etc. — only if detected}
155
+
156
+ **ORM**: {Prisma / Drizzle / SQLAlchemy / etc. — only if detected}
157
+
158
+ **Authentication**: {NextAuth / Clerk / etc. — only if detected}
159
+
160
+ **Testing**: {Vitest / Jest / Pytest / etc. — only if detected}
161
+
162
+ **Key Dependencies**:
163
+ - `{dependency}` — {what it's used for}
164
+ - `{dependency}` — {what it's used for}
165
+ [... top 5-10 most important dependencies]
166
+ <!-- auto-end: tech-stack -->
167
+
168
+ ## Patterns & Conventions
169
+
170
+ <!-- auto-start: patterns -->
171
+ {Only include patterns that were actually detected in the code}
172
+
173
+ **Naming**:
174
+ - Files: {kebab-case / camelCase / PascalCase}
175
+ - Components: {PascalCase}
176
+ - Functions: {camelCase}
177
+ - Variables: {camelCase}
178
+
179
+ **Imports**:
180
+ - {Path alias pattern, e.g., `@/` maps to `src/`}
181
+ - {Import ordering convention if detected}
182
+
183
+ **Components**:
184
+ - {Function components / class components}
185
+ - {Props pattern — interfaces vs types}
186
+
187
+ **API**:
188
+ - {REST / GraphQL / tRPC}
189
+ - {Route pattern, e.g., `app/api/*/route.ts`}
190
+
191
+ **Error Handling**:
192
+ - {Pattern detected, e.g., try-catch with custom error classes}
193
+
194
+ **State Management**:
195
+ - {Redux / Zustand / Context / etc.}
196
+ <!-- auto-end: patterns -->
197
+
198
+ ## Development Workflow
199
+
200
+ <!-- auto-start: workflow -->
201
+ **Branch Strategy**: {main/develop/feature branches — detected from git}
202
+
203
+ **Commit Convention**: {conventional commits / etc. — detected from git log}
204
+
205
+ **CI/CD**: {GitHub Actions / GitLab CI / etc. — only if detected}
206
+ <!-- auto-end: workflow -->
207
+
208
+ ## Notes
209
+
210
+ {This section is NEVER auto-generated. If it exists, preserve it exactly. If it doesn't exist, create an empty section for the user to fill in.}
211
+ ```
212
+
213
+ ### 4. Write the File
214
+
215
+ - If creating new: Write the full CLAUDE.md
216
+ - If updating: Use Edit tool to replace content between `<!-- auto-start: {section} -->` and `<!-- auto-end: {section} -->` markers for each section
217
+ - If CLAUDE.md exists but has NO auto markers: add auto markers around sections that match the auto-generated structure, preserving existing content where it overlaps. Add any new sections at the end before Notes.
218
+
219
+ ### 5. Reconcile STATE.md
220
+
221
+ Scan the tasks directory and reconcile `{{STATE_FILE}}` with the actual plan files on disk.
222
+
223
+ #### 5a. Scan Plans Directory
224
+
225
+ ```bash
226
+ ls -1 {{PLANS_DIR}}/PLAN_*.md 2>/dev/null || echo "No plans found"
227
+ cat {{STATE_FILE}} 2>/dev/null || echo "No STATE.md found"
228
+ ```
229
+
230
+ #### 5b. Read Each Plan File
231
+
232
+ For every `PLAN_*.md` file found in `{{PLANS_DIR}}/`:
233
+ - Read the plan file
234
+ - Count total phases and tasks
235
+ - Count completed tasks (lines matching `- [x]`)
236
+ - Count pending tasks (lines matching `- [ ]`)
237
+ - Determine plan status:
238
+ - All tasks `[x]` → `✅ Complete`
239
+ - Some tasks `[x]`, some `[ ]` → `🚧 In Progress`
240
+ - No tasks `[x]` → `⏳` (not started)
241
+
242
+ #### 5c. Rebuild STATE.md
243
+
244
+ Write `{{STATE_FILE}}` with the reconciled state. Follow this exact format:
245
+
246
+ ```markdown
247
+ # State
248
+
249
+ **Active**: {NN}_{NAME} or None
250
+ **File**: {{PLANS_DIR}}/PLAN_{NN}_{NAME}.md or —
251
+ **Phase**: {current phase number} or —
252
+ **Status**: {status of active plan} or ✅ Complete
253
+ **Updated**: [ISO timestamp]
254
+
255
+ ---
256
+
257
+ ## Overview
258
+
259
+ | # | Plan | File | Status | Progress |
260
+ |---|------|------|--------|----------|
261
+ | {NN} | {NAME} | PLAN_{NN}_{NAME}.md | {status} | {completed}/{total} tasks |
262
+ [... one row per plan found on disk, sorted by number ...]
263
+
264
+ ---
265
+
266
+ ## Plans
267
+
268
+ ### PLAN_{NN}_{NAME}
269
+
270
+ #### Phase 1: {Phase Name} {status emoji}
271
+
272
+ | Task | Status |
273
+ |------|--------|
274
+ | {Task name} | ✅ or 🚧 or ⏳ |
275
+ [... one row per task in this phase ...]
276
+
277
+ [... continue for all phases and all plans ...]
278
+ ```
279
+
280
+ **Reconciliation rules**:
281
+ - **Plans on disk but not in STATE.md** → add them to the Overview table and Plans section
282
+ - **Plans in STATE.md but not on disk** → remove them (plan file was deleted)
283
+ - **Task status mismatch** → the plan file (`- [x]` / `- [ ]`) is the source of truth, update STATE.md to match
284
+ - **Active plan detection** → if any plan has incomplete tasks, set it as Active (prefer the highest-numbered incomplete plan). If all plans are complete, set Active to `None`
285
+ - **Phase detection** → for the active plan, set Phase to the first phase that has incomplete tasks
286
+
287
+ #### 5d. Create Tasks Directory if Needed
288
+
289
+ ```bash
290
+ mkdir -p {{PLANS_DIR}}
291
+ ```
292
+
293
+ If no plans exist and no STATE.md exists, skip this step entirely — there's nothing to reconcile.
294
+
295
+ ### 6. Report
296
+
297
+ After updating, respond with:
298
+
299
+ ```markdown
300
+ ✅ Project updated
301
+
302
+ **CLAUDE.md**:
303
+ - {Section 1}: {Created / Updated / No changes}
304
+ - {Section 2}: {Created / Updated / No changes}
305
+ - Preserved: {N} user-written sections unchanged
306
+
307
+ **STATE.md**:
308
+ - Plans found: {N} ({N complete}, {N in progress}, {N pending})
309
+ - Active plan: {PLAN_NN_NAME} Phase {N} or None
310
+ - Tasks: {completed}/{total} across all plans
311
+
312
+ **Detected**:
313
+ - Stack: {Framework} + {Language} + {Key tool}
314
+ - {N} dependencies mapped
315
+ - {N} patterns identified
316
+ ```
317
+
318
+ ## Critical Guidelines
319
+
320
+ ### Accuracy Over Completeness
321
+ - Only document what you actually detected — never guess or assume
322
+ - If a section has nothing to report, omit it entirely
323
+ - Use the actual version numbers from package.json/config files
324
+
325
+ ### Preserve User Content
326
+ - NEVER modify content outside of `<!-- auto-start -->` / `<!-- auto-end -->` markers
327
+ - The `## Notes` section is always user-owned — never touch it
328
+ - If the user added custom sections, preserve them in their original position
329
+
330
+ ### Keep It Concise
331
+ - CLAUDE.md should be scannable, not exhaustive
332
+ - Use tables and code blocks for dense information
333
+ - Only list the top 5-10 most important dependencies, not all of them
334
+ - Directory structure should be 2 levels deep max
335
+
336
+ ### Be Smart About Detection
337
+ - Read actual source files, not just config files
338
+ - Look at import statements to understand path aliases
339
+ - Look at git log for commit conventions
340
+ - Look at file naming to detect naming conventions
341
+ - Check for .editorconfig, .prettierrc for formatting rules
342
+
343
+ ### Omit What Doesn't Apply
344
+ - Don't include Database section if there's no database
345
+ - Don't include Authentication section if there's no auth
346
+ - Don't include CI/CD section if there's no pipeline
347
+ - Keep it relevant to what the project actually uses
@@ -121,8 +121,11 @@ After the bootstrap agent completes, ask the user: "Bootstrap script is ready. S
121
121
  - If yes → run `bash bootstrap.sh`
122
122
  - If no → note it and continue
123
123
 
124
- **COMMIT CHECKPOINT**: After bootstrap completes, commit the scaffolding:
125
- - Stage all new project files
124
+ **UPDATE CLAUDE.md**: After bootstrap completes, run the update agent to generate an initial CLAUDE.md:
125
+ - Use the Task tool to launch the update agent (`subagent_type="update"`) to scan the newly bootstrapped project and create CLAUDE.md
126
+
127
+ **COMMIT CHECKPOINT**: After bootstrap and CLAUDE.md update complete, commit the scaffolding:
128
+ - Stage all new project files (including CLAUDE.md)
126
129
  - Use the Task tool to launch the commit agent (`subagent_type="commit"`) with context: "chore: bootstrap {NAME} project scaffolding"
127
130
 
128
131
  **If existing project:**
@@ -254,9 +257,13 @@ Review security report:
254
257
 
255
258
  ---
256
259
 
257
- ### Step 6: Report
260
+ ### Step 6: Update & Report
261
+
262
+ **UPDATE CLAUDE.md**: Before reporting, sync CLAUDE.md with the current project state:
263
+ - Use the Task tool to launch the update agent (`subagent_type="update"`) to scan the project and update CLAUDE.md with any new patterns, dependencies, or structural changes from this session
264
+ - If CLAUDE.md was updated, include it in the final commit
258
265
 
259
- **STATE UPDATE**: Before reporting, read and update `{{STATE_FILE}}` to reflect final status:
266
+ **STATE UPDATE**: Read and update `{{STATE_FILE}}` to reflect final status:
260
267
  - If all phases and validation passed: set `**Active**` to `None`, update plan's status to `✅ Complete` in Overview table, set `**Status**: ✅ Complete`
261
268
  - If partially complete (blockers, user stopped): keep `**Active**` pointing to the plan, set `**Status**: ⏸️ Paused`
262
269
  - Update `**Phase**` to the last completed phase number
@@ -323,7 +330,7 @@ Auto mode commits **early and often** using the commit agent (`subagent_type="co
323
330
  - Never force-push, delete branches, or make destructive changes without asking
324
331
 
325
332
  ### Compose Existing Agents
326
- - Use the existing subagent types: `bootstrap`, `plan`, `implement`, `parallelize`, `audit`, `test`, `secure`, `commit`
333
+ - Use the existing subagent types: `bootstrap`, `plan`, `implement`, `parallelize`, `audit`, `test`, `secure`, `commit`, `update`
327
334
  - Do NOT try to do their jobs inline — delegate to specialists
328
335
  - Always use the commit agent for commits — it writes proper conventional commit messages (`feat:`, `fix:`, `refactor:`, etc.)
329
336
 
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: Update CLAUDE.md and STATE.md to reflect current project state
3
+ argument-hint: [optional: section to focus on]
4
+ author: "@markoradak"
5
+ ---
6
+
7
+ # Update CLAUDE.md
8
+
9
+ I'll scan the project and update CLAUDE.md and STATE.md to reflect the current state — tech stack, structure, patterns, conventions, and plan progress.
10
+
11
+ ## Current Context
12
+
13
+ **Working Directory**: !`pwd`
14
+
15
+ **Existing CLAUDE.md**:
16
+ !`cat CLAUDE.md 2>/dev/null | head -5 || echo "No CLAUDE.md found"`
17
+
18
+ **Project Detection**:
19
+ !`ls package.json tsconfig.json Cargo.toml go.mod pyproject.toml requirements.txt composer.json Gemfile pom.xml build.gradle mix.exs 2>/dev/null || echo "No recognized project files"`
20
+
21
+ **Source Files**:
22
+ !`find . -maxdepth 3 -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.py" -o -name "*.rs" -o -name "*.go" -o -name "*.java" -o -name "*.rb" -o -name "*.ex" -o -name "*.php" \) -not -path "*/node_modules/*" -not -path "*/.git/*" 2>/dev/null | wc -l`
23
+
24
+ ---
25
+
26
+ ## Focus Area
27
+
28
+ $ARGUMENTS
29
+
30
+ ---
31
+
32
+ ## Launching Update Agent
33
+
34
+ The update agent will:
35
+ - ✅ Scan the project for tech stack, dependencies, and toolchain
36
+ - ✅ Map the directory structure and key files
37
+ - ✅ Detect patterns, conventions, and coding standards
38
+ - ✅ Read existing CLAUDE.md and preserve user-written sections
39
+ - ✅ Update or create auto-generated sections with current project state
40
+ - ✅ Reconcile STATE.md with actual plan files on disk — sync task completion, add missing plans, remove stale entries
41
+ - ✅ Never overwrite manual notes or custom instructions
42
+
43
+ Use the Task tool to launch the update agent (subagent_type="update") which will scan the project and update CLAUDE.md.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allthingsclaude/blueprints",
3
- "version": "0.3.0-beta.16",
3
+ "version": "0.3.0-beta.18",
4
4
  "description": "Claude Code commands and agents for enhanced AI-assisted development workflows",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",