@allthingsclaude/blueprints 0.2.0 → 0.3.0-beta.10

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.
Files changed (66) hide show
  1. package/README.md +80 -12
  2. package/content/agents/audit.md +40 -25
  3. package/content/agents/bootstrap.md +25 -5
  4. package/content/agents/changelog.md +350 -0
  5. package/content/agents/cleanup.md +155 -0
  6. package/content/agents/commit.md +235 -0
  7. package/content/agents/debug.md +198 -0
  8. package/content/agents/docs.md +344 -0
  9. package/content/agents/{optimize.md → dry.md} +38 -15
  10. package/content/agents/explain.md +195 -0
  11. package/content/agents/finalize.md +20 -5
  12. package/content/agents/handoff.md +11 -5
  13. package/content/agents/imagine.md +2 -2
  14. package/content/agents/implement.md +54 -16
  15. package/content/agents/migrate.md +330 -0
  16. package/content/agents/parallelize.md +21 -4
  17. package/content/agents/plan.md +35 -5
  18. package/content/agents/refactor.md +156 -0
  19. package/content/agents/release.md +502 -0
  20. package/content/agents/research-codebase.md +160 -18
  21. package/content/agents/research-docs.md +135 -19
  22. package/content/agents/research-web.md +149 -19
  23. package/content/agents/secure.md +351 -0
  24. package/content/agents/storyboard.md +11 -5
  25. package/content/agents/test.md +181 -0
  26. package/content/commands/audit.md +15 -24
  27. package/content/commands/auto.md +361 -0
  28. package/content/commands/bootstrap.md +2 -2
  29. package/content/commands/brainstorm.md +63 -9
  30. package/content/commands/challenge.md +7 -0
  31. package/content/commands/changelog.md +50 -0
  32. package/content/commands/cleanup.md +14 -301
  33. package/content/commands/commit.md +45 -0
  34. package/content/commands/critique.md +7 -0
  35. package/content/commands/debug.md +9 -251
  36. package/content/commands/docs.md +48 -0
  37. package/content/commands/dry.md +48 -0
  38. package/content/commands/explain.md +12 -309
  39. package/content/commands/finalize.md +3 -3
  40. package/content/commands/flush.md +9 -14
  41. package/content/commands/handoff.md +1 -1
  42. package/content/commands/implement.md +5 -5
  43. package/content/commands/kickoff.md +7 -4
  44. package/content/commands/migrate.md +54 -0
  45. package/content/commands/parallelize.md +2 -2
  46. package/content/commands/pickup.md +1 -1
  47. package/content/commands/plan.md +2 -2
  48. package/content/commands/refactor.md +21 -379
  49. package/content/commands/release.md +63 -0
  50. package/content/commands/research.md +1 -1
  51. package/content/commands/secure.md +51 -0
  52. package/content/commands/storyboard.md +3 -3
  53. package/content/commands/test.md +15 -201
  54. package/content/commands/verify.md +7 -0
  55. package/dist/cli.js +47 -15
  56. package/dist/cli.js.map +1 -1
  57. package/dist/index.d.ts +1 -1
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/index.js.map +1 -1
  61. package/dist/installer.d.ts +29 -4
  62. package/dist/installer.d.ts.map +1 -1
  63. package/dist/installer.js +120 -17
  64. package/dist/installer.js.map +1 -1
  65. package/package.json +5 -1
  66. package/content/commands/optimize.md +0 -338
@@ -1,18 +1,20 @@
1
1
  ---
2
- description: Safely refactor code with DRY analysis, pattern extraction, and validation
3
- argument-hint: [operation] [target] (e.g., "dry-check", "rename:old:new", "extract:ComponentName")
2
+ description: Safely rename, extract, inline, or move code with validation
3
+ argument-hint: [operation] [target] (e.g., "rename:old:new", "extract:ComponentName", "move:src:dest")
4
4
  author: "@markoradak"
5
5
  ---
6
6
 
7
7
  # Refactor Assistant
8
8
 
9
- I'll help you safely refactor code with a focus on DRY principles, pattern extraction, and thorough validation.
9
+ I'll help you safely restructure code renaming, extracting, inlining, or moving with validation after every change.
10
+
11
+ > **When to use**: You know what structural change you want to make. Use `/dry` to find and consolidate duplications, `/cleanup` to remove dead/unused code, or `/audit` to review changes before committing.
10
12
 
11
13
  ## Current State
12
14
 
13
15
  **Working Directory**: !`pwd`
14
16
 
15
- **Branch**: !`git branch --show-current`
17
+ **Branch**: !`git branch --show-current 2>/dev/null || echo "Not a git repository"`
16
18
 
17
19
  **Status**:
18
20
  !`git status --short`
@@ -25,382 +27,22 @@ $ARGUMENTS
25
27
 
26
28
  ---
27
29
 
28
- ## Refactoring Operations
29
-
30
- ### `dry-check` or no argument
31
- Analyze codebase for DRY violations and duplication opportunities.
32
-
33
- ### `rename:oldName:newName`
34
- Safely rename a function, component, variable, or type across the codebase.
35
-
36
- ### `extract:Name`
37
- Extract repeated code into a reusable function, component, or hook.
38
-
39
- ### `inline:Name`
40
- Inline a function/component that's only used once or adds unnecessary abstraction.
41
-
42
- ### `move:source:destination`
43
- Move a function/component to a different file with all imports updated.
44
-
45
- ### `consolidate:pattern`
46
- Find and consolidate similar implementations into one.
47
-
48
- ---
49
-
50
- ## DRY Analysis Framework
51
-
52
- ### Duplication Categories
53
-
54
- **1. Exact Duplication**
55
- - Copy-pasted code blocks
56
- - Identical functions in different files
57
- - Repeated component structures
58
-
59
- **2. Structural Duplication**
60
- - Same pattern with different values
61
- - Similar functions with minor variations
62
- - Components that differ only in props
63
-
64
- **3. Logical Duplication**
65
- - Same business logic in multiple places
66
- - Repeated validation patterns
67
- - Similar error handling
68
-
69
- **4. Data Duplication**
70
- - Repeated constants/magic values
71
- - Similar type definitions
72
- - Duplicate API endpoint definitions
73
-
74
- ### Detection Strategy
75
-
76
- ```bash
77
- # Find similar code blocks (requires manual review)
78
- # Look for repeated patterns
79
- grep -rn "pattern" src/ --include="*.ts" --include="*.tsx"
80
-
81
- # Find duplicate function names
82
- grep -rn "function functionName\|const functionName" src/
83
-
84
- # Find similar component structures
85
- grep -rn "className=\"similar-class\"" src/
86
- ```
87
-
88
- ---
89
-
90
- ## DRY Check Output Format
91
-
92
- ```markdown
93
- # DRY Analysis Report
94
-
95
- **Scanned**: [X] files
96
- **Duplications Found**: [Y] instances
97
- **Estimated Lines Saveable**: [Z]
98
-
99
- ---
100
-
101
- ## High Priority (Extract Immediately)
102
-
103
- ### 1. [Duplication Name]
104
-
105
- **Type**: Exact / Structural / Logical
106
-
107
- **Occurrences**:
108
- - `src/components/A.tsx:23-45` (22 lines)
109
- - `src/components/B.tsx:67-89` (22 lines)
110
- - `src/pages/C.tsx:12-34` (22 lines)
111
-
112
- **Current Code** (from first occurrence):
113
- ```typescript
114
- // Repeated code block
115
- ```
116
-
117
- **Proposed Extraction**:
118
-
119
- **New File**: `src/lib/extracted.ts` or `src/components/Shared.tsx`
120
-
121
- ```typescript
122
- // Extracted reusable code
123
- export function extractedFunction() {
124
- // ...
125
- }
126
- ```
127
-
128
- **Refactored Usage**:
129
- ```typescript
130
- import { extractedFunction } from '@/lib/extracted'
131
-
132
- // Use it
133
- extractedFunction()
134
- ```
135
-
136
- **Impact**:
137
- - Lines removed: [X]
138
- - Files affected: [Y]
139
- - Maintainability: Improved (single source of truth)
140
-
141
- ---
142
-
143
- ## Medium Priority (Consider Extracting)
144
-
145
- ### 2. [Duplication Name]
146
-
147
- **Type**: Structural
148
-
149
- **Occurrences**: 2 places
150
-
151
- **Pattern**:
152
- ```typescript
153
- // Similar structure, different values
154
- ```
155
-
156
- **Options**:
157
- 1. **Extract with parameters**: Create function with configurable parts
158
- 2. **Leave as-is**: If variations are likely to diverge
159
- 3. **Create factory**: If generating similar structures
160
-
161
- **Recommendation**: [Which option and why]
162
-
163
- ---
164
-
165
- ## Low Priority (Monitor)
166
-
167
- ### 3. [Duplication Name]
168
-
169
- **Note**: Only 2 occurrences, may diverge in future
170
-
171
- ---
172
-
173
- ## Type/Interface Duplication
174
-
175
- | Type | Locations | Recommendation |
176
- |------|-----------|----------------|
177
- | `UserData` | `types/user.ts`, `api/users.ts` | Consolidate to `types/user.ts` |
178
- | `ApiResponse` | 5 different files | Create shared `types/api.ts` |
179
-
180
- ---
181
-
182
- ## Constants Duplication
183
-
184
- | Value | Occurrences | Recommendation |
185
- |-------|-------------|----------------|
186
- | `"api/v1"` | 12 files | Extract to `lib/constants.ts` |
187
- | `3000` | 4 files | Extract as `DEFAULT_PORT` |
188
-
189
- ---
190
-
191
- ## Summary
192
-
193
- | Priority | Count | Lines Saveable |
194
- |----------|-------|----------------|
195
- | High | X | ~Y lines |
196
- | Medium | X | ~Y lines |
197
- | Low | X | ~Y lines |
198
-
199
- **Total Potential Reduction**: ~[Z] lines ([N]% of codebase)
200
-
201
- ---
202
-
203
- ## Recommended Actions
204
-
205
- 1. [ ] Extract [high priority item 1]
206
- 2. [ ] Extract [high priority item 2]
207
- 3. [ ] Consolidate types to shared location
208
- 4. [ ] Create constants file for repeated values
209
-
210
- Would you like me to perform any of these extractions?
211
- ```
212
-
213
- ---
214
-
215
- ## Rename Operation
216
-
217
- ### Safety Protocol
218
-
219
- 1. **Find all references** (not just text matches):
220
- - Variable/function declarations
221
- - Import statements
222
- - Type references
223
- - String literals (if component name)
224
- - Test files
225
- - Documentation/comments
226
-
227
- 2. **Validate scope**:
228
- - Is this a local or exported symbol?
229
- - Are there name conflicts with new name?
230
- - Will imports need updating?
231
-
232
- 3. **Execute rename**:
233
- - Update declaration
234
- - Update all usages
235
- - Update imports/exports
236
- - Update related test files
237
-
238
- 4. **Verify**:
239
- - Run typecheck
240
- - Run lint
241
- - Run related tests
242
-
243
- ### Rename Output
244
-
245
- ```markdown
246
- # Rename: `oldName` -> `newName`
247
-
248
- ## Scope Analysis
249
-
250
- **Symbol Type**: [function/component/type/variable]
251
- **Defined In**: `src/lib/file.ts:23`
252
- **Exported**: [Yes/No]
253
-
254
- ## References Found
255
-
256
- | File | Line | Context |
257
- |------|------|---------|
258
- | `src/lib/file.ts` | 23 | Definition |
259
- | `src/components/A.tsx` | 5 | Import |
260
- | `src/components/A.tsx` | 34 | Usage |
261
- | `src/tests/file.test.ts` | 12 | Test |
262
-
263
- **Total**: [X] references in [Y] files
264
-
265
- ## Changes to Make
266
-
267
- ### `src/lib/file.ts`
268
- - Line 23: `export function oldName` -> `export function newName`
269
-
270
- ### `src/components/A.tsx`
271
- - Line 5: `import { oldName }` -> `import { newName }`
272
- - Line 34: `oldName()` -> `newName()`
273
-
274
- ## Verification Plan
275
-
276
- 1. [ ] Apply all changes
277
- 2. [ ] Run `pnpm typecheck`
278
- 3. [ ] Run `pnpm lint`
279
- 4. [ ] Run `pnpm test [related]`
280
-
281
- Proceed with rename?
282
- ```
283
-
284
- ---
285
-
286
- ## Extract Operation
287
-
288
- ### Extraction Checklist
289
-
290
- 1. **Identify boundaries**:
291
- - What are the inputs?
292
- - What are the outputs?
293
- - What are the side effects?
294
-
295
- 2. **Choose location**:
296
- - Same file (private helper)?
297
- - `lib/` (utility function)?
298
- - `components/` (React component)?
299
- - `hooks/` (custom hook)?
300
-
301
- 3. **Define interface**:
302
- - Function signature
303
- - Props interface (for components)
304
- - Return type
305
-
306
- 4. **Extract and replace**:
307
- - Create new function/component
308
- - Replace original code with call
309
- - Update imports
310
-
311
- 5. **Verify**:
312
- - Types match at call sites
313
- - Behavior unchanged
314
- - Tests pass
315
-
316
- ### Extract Output
317
-
318
- ```markdown
319
- # Extract: `NewComponentName`
320
-
321
- ## Source Analysis
322
-
323
- **Extracting from**: `src/components/Large.tsx:45-78`
324
- **Reason**: [DRY violation / Reusability / Clarity]
325
-
326
- ## Extracted Code
327
-
328
- **New File**: `src/components/NewComponentName.tsx`
329
-
330
- ```typescript
331
- interface NewComponentNameProps {
332
- // Inferred from usage
333
- }
334
-
335
- export function NewComponentName({ ... }: NewComponentNameProps) {
336
- // Extracted code
337
- }
338
- ```
339
-
340
- ## Updated Original
341
-
342
- **File**: `src/components/Large.tsx`
343
-
344
- ```typescript
345
- import { NewComponentName } from './NewComponentName'
346
-
347
- // ...
348
- <NewComponentName {...props} />
349
- ```
350
-
351
- ## Other Usages to Update
352
-
353
- - `src/components/Other.tsx:34` - Same pattern exists
354
- - `src/pages/Page.tsx:56` - Similar code
355
-
356
- Proceed with extraction?
357
- ```
358
-
359
- ---
360
-
361
- ## Validation Requirements
362
-
363
- After ANY refactoring operation:
364
-
365
- ```bash
366
- # Type check - MUST pass
367
- pnpm typecheck
368
-
369
- # Lint - MUST pass
370
- pnpm lint
371
-
372
- # Tests - MUST pass
373
- pnpm test:run
374
-
375
- # Build - Should pass
376
- pnpm build
377
- ```
378
-
379
- **If any fail**: Revert changes and investigate.
380
-
381
- ---
382
-
383
- ## Refactoring Principles
30
+ ## Supported Operations
384
31
 
385
- ### DO
386
- - Extract when 3+ occurrences exist
387
- - Keep extracted units focused (single responsibility)
388
- - Name clearly based on purpose
389
- - Maintain backwards compatibility when possible
390
- - Test before and after
32
+ - `rename:oldName:newName` — Safe rename across all references
33
+ - `extract:Name` — Extract repeated code into reusable unit
34
+ - `inline:Name` Inline unnecessary abstraction
35
+ - `move:source:destination` Move with all imports updated
36
+ - `consolidate:pattern` Consolidate similar implementations
391
37
 
392
- ### DON'T
393
- - Extract prematurely (wait for patterns to emerge)
394
- - Create abstractions for 1-2 usages
395
- - Mix concerns in extracted units
396
- - Change behavior during refactoring
397
- - Skip validation steps
38
+ ## Launching Refactor Agent
398
39
 
399
- ### DRY Balance
400
- - **Too DRY**: Over-abstracted, hard to understand
401
- - **Too WET**: Maintenance nightmare, inconsistencies
402
- - **Just Right**: Clear abstractions, obvious where to change things
403
-
404
- ---
40
+ The refactor agent will:
41
+ - Detect your toolchain (package manager, available scripts)
42
+ - Capture a baseline (typecheck, lint, tests)
43
+ - Analyze code and present a plan before making changes
44
+ - Apply changes one at a time with validation after each
45
+ - Revert immediately if any validation fails
46
+ - Guarantee zero behavior change
405
47
 
406
- Analyze the refactoring request and execute the appropriate operation. Use Grep to find patterns, Read to understand context, Edit to make changes, and Bash to validate. Always show the plan before executing.
48
+ Use the Task tool to launch the refactor agent (subagent_type="refactor") with the refactoring request and any additional context from arguments.
@@ -0,0 +1,63 @@
1
+ ---
2
+ description: Create a release — version bump, changelog, tag, and publish
3
+ argument-hint: [optional: major | minor | patch | version number | --dry-run]
4
+ author: "@markoradak"
5
+ ---
6
+
7
+ # Release
8
+
9
+ I'll orchestrate a complete release for your project — detecting existing release scripts and tooling first.
10
+
11
+ > **When to use**: You're ready to cut a release. This handles version bumping, changelog updates, git tagging, and optionally GitHub Releases or publishing. Use `/changelog` if you only want to generate a changelog without releasing. Use `/commit` for a simple commit without release semantics.
12
+
13
+ ## Current State
14
+
15
+ **Working Directory**: !`pwd`
16
+
17
+ **Branch**: !`git branch --show-current 2>/dev/null || echo "Not a git repository"`
18
+
19
+ **Status**:
20
+ !`git status --short`
21
+
22
+ **Current Version**:
23
+ !`cat package.json 2>/dev/null | grep '"version"' | head -1 || cat Cargo.toml 2>/dev/null | grep '^version' | head -1 || cat pyproject.toml 2>/dev/null | grep '^version' | head -1 || echo "Could not detect version"`
24
+
25
+ **Latest Tags**:
26
+ !`git tag --sort=-version:refname 2>/dev/null | head -5 || echo "No tags found"`
27
+
28
+ **Commits Since Last Tag**:
29
+ !`git log $(git describe --tags --abbrev=0 2>/dev/null)..HEAD --oneline 2>/dev/null | head -15 || git log --oneline -10 2>/dev/null`
30
+
31
+ **Release Scripts Detected**:
32
+ !`cat package.json 2>/dev/null | grep -E '"(release|version|bump|publish|prepublish|postpublish|preversion|postversion|prepublishOnly)"' || echo "None in package.json"`
33
+ !`ls .release-it.* .changeset/ .versionrc* lerna.json .releaserc* release.config.* 2>/dev/null || echo "No release tool configs found"`
34
+ !`ls scripts/release* scripts/publish* scripts/version* Makefile 2>/dev/null || echo "No release scripts found"`
35
+
36
+ ---
37
+
38
+ ## Release Scope
39
+
40
+ $ARGUMENTS
41
+
42
+ ---
43
+
44
+ ## Launching Release Agent
45
+
46
+ The release agent will:
47
+ 1. **Detect existing release infrastructure** — scripts in package.json, release-it, changesets, semantic-release, standard-version, Makefile targets, scripts/ directory, CI workflows
48
+ 2. **If existing tooling found** — use it, guiding through any interactive steps
49
+ 3. **If no existing tooling** — orchestrate the release manually:
50
+ - Determine version bump from conventional commits (or use the specified version)
51
+ - Update CHANGELOG.md
52
+ - Bump version in manifest files
53
+ - Create git commit and tag
54
+ - Optionally create a GitHub Release
55
+ 4. **Confirm every destructive step** before executing
56
+
57
+ **Workflows**:
58
+ - No argument → Auto-detect version bump from commits (major/minor/patch)
59
+ - `major` / `minor` / `patch` → Explicit bump type
60
+ - `1.2.3` → Explicit version number
61
+ - `--dry-run` → Show what would happen without making changes
62
+
63
+ Use the Task tool to launch the release agent (subagent_type="release") with the scope and any additional context.
@@ -32,7 +32,7 @@ Analyze the query to determine the best research agent:
32
32
  - Check package.json first to see if mentioned library is a project dependency
33
33
 
34
34
  **Use `web-research` agent when:**
35
- - Query asks for "latest", "best practices", "how to do X in 2025"
35
+ - Query asks for "latest", "best practices", "how to do X"
36
36
  - Looking for online tutorials, guides, or examples
37
37
  - Researching industry standards or modern approaches
38
38
  - No specific library mentioned, or general "how to" questions
@@ -0,0 +1,51 @@
1
+ ---
2
+ description: Run a focused security scan on your codebase
3
+ argument-hint: [optional: file/folder path, or focus area like "deps", "auth", "api"]
4
+ author: "@markoradak"
5
+ ---
6
+
7
+ # Security Scan
8
+
9
+ I'll perform a focused security audit of your codebase, checking for vulnerabilities, exposed secrets, and insecure patterns.
10
+
11
+ > **When to use**: You want a dedicated security review — not a general code review. Use `/audit` for broad code quality review, or `/cleanup` to remove dead code.
12
+
13
+ ## Current State
14
+
15
+ **Working Directory**: !`pwd`
16
+
17
+ **Branch**: !`git branch --show-current 2>/dev/null || echo "Not a git repository"`
18
+
19
+ **Status**:
20
+ !`git status --short`
21
+
22
+ **Dependencies**:
23
+ !`cat package.json 2>/dev/null | grep -c '"dependencies\|"devDependencies"' || echo "No package.json"`
24
+
25
+ ---
26
+
27
+ ## Focus Area
28
+
29
+ $ARGUMENTS
30
+
31
+ ---
32
+
33
+ ## Launching Security Agent
34
+
35
+ The security agent will:
36
+ - Scan source code for OWASP Top 10 vulnerabilities
37
+ - Check for hardcoded secrets, API keys, and credentials
38
+ - Audit dependencies for known vulnerabilities
39
+ - Review authentication and authorization patterns
40
+ - Check input validation and output encoding
41
+ - Identify injection vectors (SQL, XSS, command, path traversal)
42
+ - Provide a severity-ranked report with specific remediation steps
43
+
44
+ **Scoping options**:
45
+ - No argument → Full codebase security scan
46
+ - `deps` → Dependency vulnerability audit only
47
+ - `auth` → Authentication and authorization review
48
+ - `api` → API endpoint security review
49
+ - File/folder path → Scoped scan
50
+
51
+ Use the Task tool to launch the secure agent (subagent_type="secure") which will perform a comprehensive security analysis and provide actionable remediation guidance.
@@ -30,15 +30,15 @@ This command extracts key frames from a screen recording or prototype demo using
30
30
  2. Extract key frames using scene-change detection (captures actual UI state changes)
31
31
  3. Read and analyze each frame to identify UI elements, states, and layout
32
32
  4. Compare consecutive frames to detect transitions and user actions
33
- 5. Write structured interaction spec to `.claude/temp/`
33
+ 5. Write structured interaction spec to `{{SESSIONS_DIR}}/`
34
34
 
35
35
  ### Output
36
36
 
37
- A `INTERACTION_SPEC_{NAME}.md` file in `.claude/temp/` containing:
37
+ A `INTERACTION_SPEC_{NAME}.md` file in `{{SESSIONS_DIR}}/` containing:
38
38
  - All detected UI states with element descriptions
39
39
  - Transitions between states with user actions and animation notes
40
40
  - Implementation checklist ready for `/implement`
41
41
 
42
42
  ---
43
43
 
44
- Use the Task tool to launch the storyboard agent (subagent_type="general-purpose") with the video file path and any additional context from arguments. The agent needs the full path to the video file to process it.
44
+ Use the Task tool to launch the storyboard agent (subagent_type="storyboard") with the video file path and any additional context from arguments. The agent needs the full path to the video file to process it.