aiblueprint-cli 1.4.41 → 1.4.42

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 (81) hide show
  1. package/claude-code-config/skills/apex/SKILL.md +116 -0
  2. package/claude-code-config/skills/{workflow-apex → apex}/scripts/setup-templates.sh +12 -2
  3. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-00-init.md +19 -34
  4. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-00b-interactive.md +13 -1
  5. package/claude-code-config/skills/apex/steps/step-00b-save.md +123 -0
  6. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-01-analyze.md +36 -17
  7. package/claude-code-config/skills/apex/steps/step-02-plan.md +593 -0
  8. package/claude-code-config/skills/apex/steps/step-02b-tasks.md +301 -0
  9. package/claude-code-config/skills/apex/steps/step-03-execute-teams.md +296 -0
  10. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-03-execute.md +1 -0
  11. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-04-validate.md +3 -1
  12. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-05-examine.md +92 -35
  13. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-06-resolve.md +1 -0
  14. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-09-finish.md +32 -2
  15. package/claude-code-config/skills/{workflow-apex → apex}/templates/00-context.md +2 -0
  16. package/claude-code-config/skills/{meta-claude-memory → claude-memory}/SKILL.md +59 -1
  17. package/package.json +1 -1
  18. package/claude-code-config/skills/workflow-apex/SKILL.md +0 -303
  19. package/claude-code-config/skills/workflow-apex/steps/step-02-plan.md +0 -264
  20. /package/claude-code-config/skills/{workflow-apex → apex}/scripts/update-progress.sh +0 -0
  21. /package/claude-code-config/skills/{workflow-apex → apex}/steps/step-00b-branch.md +0 -0
  22. /package/claude-code-config/skills/{workflow-apex → apex}/steps/step-00b-economy.md +0 -0
  23. /package/claude-code-config/skills/{workflow-apex → apex}/steps/step-07-tests.md +0 -0
  24. /package/claude-code-config/skills/{workflow-apex → apex}/steps/step-08-run-tests.md +0 -0
  25. /package/claude-code-config/skills/{workflow-apex → apex}/templates/01-analyze.md +0 -0
  26. /package/claude-code-config/skills/{workflow-apex → apex}/templates/02-plan.md +0 -0
  27. /package/claude-code-config/skills/{workflow-apex → apex}/templates/03-execute.md +0 -0
  28. /package/claude-code-config/skills/{workflow-apex → apex}/templates/04-validate.md +0 -0
  29. /package/claude-code-config/skills/{workflow-apex → apex}/templates/05-examine.md +0 -0
  30. /package/claude-code-config/skills/{workflow-apex → apex}/templates/06-resolve.md +0 -0
  31. /package/claude-code-config/skills/{workflow-apex → apex}/templates/07-tests.md +0 -0
  32. /package/claude-code-config/skills/{workflow-apex → apex}/templates/08-run-tests.md +0 -0
  33. /package/claude-code-config/skills/{workflow-apex → apex}/templates/09-finish.md +0 -0
  34. /package/claude-code-config/skills/{workflow-apex → apex}/templates/README.md +0 -0
  35. /package/claude-code-config/skills/{workflow-apex → apex}/templates/step-complete.md +0 -0
  36. /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/comprehensive-example.md +0 -0
  37. /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/optimize-guide.md +0 -0
  38. /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/project-patterns.md +0 -0
  39. /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/prompting-techniques.md +0 -0
  40. /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/rules-directory-guide.md +0 -0
  41. /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/section-templates.md +0 -0
  42. /package/claude-code-config/skills/{git-commit → commit}/SKILL.md +0 -0
  43. /package/claude-code-config/skills/{git-create-pr → create-pr}/SKILL.md +0 -0
  44. /package/claude-code-config/skills/{utils-fix-errors → fix-errors}/SKILL.md +0 -0
  45. /package/claude-code-config/skills/{utils-fix-grammar → fix-grammar}/SKILL.md +0 -0
  46. /package/claude-code-config/skills/{git-fix-pr-comments → fix-pr-comments}/SKILL.md +0 -0
  47. /package/claude-code-config/skills/{git-merge → merge}/SKILL.md +0 -0
  48. /package/claude-code-config/skills/{utils-oneshot → oneshot}/SKILL.md +0 -0
  49. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/SKILL.md +0 -0
  50. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/anthropic-best-practices.md +0 -0
  51. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/anti-patterns.md +0 -0
  52. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/clarity-principles.md +0 -0
  53. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/context-management.md +0 -0
  54. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/few-shot-patterns.md +0 -0
  55. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/openai-best-practices.md +0 -0
  56. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/prompt-templates.md +0 -0
  57. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/reasoning-techniques.md +0 -0
  58. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/system-prompt-patterns.md +0 -0
  59. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/xml-structure.md +0 -0
  60. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/LICENSE.txt +0 -0
  61. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/SKILL.md +0 -0
  62. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/package.json +0 -0
  63. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/output-patterns.md +0 -0
  64. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/progressive-disclosure-patterns.md +0 -0
  65. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/prompting-integration.md +0 -0
  66. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/real-world-examples.md +0 -0
  67. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/script-patterns.md +0 -0
  68. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/workflows.md +0 -0
  69. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/xml-tag-guide.md +0 -0
  70. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/scripts/init-skill.ts +0 -0
  71. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/scripts/package-skill.ts +0 -0
  72. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/scripts/validate.ts +0 -0
  73. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/SKILL.md +0 -0
  74. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/context-management.md +0 -0
  75. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/debugging-agents.md +0 -0
  76. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/error-handling-and-recovery.md +0 -0
  77. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/evaluation-and-testing.md +0 -0
  78. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/orchestration-patterns.md +0 -0
  79. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/subagents.md +0 -0
  80. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/writing-subagent-prompts.md +0 -0
  81. /package/claude-code-config/skills/{utils-ultrathink → ultrathink}/SKILL.md +0 -0
@@ -21,10 +21,12 @@ next_step: steps/step-06-resolve.md
21
21
 
22
22
  ## EXECUTION PROTOCOLS:
23
23
 
24
- - 🎯 Launch parallel review agents (unless economy_mode)
24
+ - 🎯 Launch 3+ parallel review agents via Task tool in ONE message (unless economy_mode)
25
+ - 🛑 NEVER launch only 1 review agent — you MUST launch Security + Logic + Clean Code as separate agents
25
26
  - 💾 Document all findings with severity
26
27
  - 📖 Create todos for each finding
27
28
  - 🚫 FORBIDDEN to skip security analysis
29
+ - 🚫 FORBIDDEN to combine review categories into a single agent
28
30
 
29
31
  ## CONTEXT BOUNDARIES:
30
32
 
@@ -32,6 +34,7 @@ next_step: steps/step-06-resolve.md
32
34
  - All tests pass
33
35
  - Now looking for issues that tests miss
34
36
  - Adversarial mindset - assume bugs exist
37
+ - **If `{teams_mode}` = true:** Agent team is still alive. Do NOT shutdown teammates — that happens in step-09-finish only.
35
38
 
36
39
  ## YOUR TASK:
37
40
 
@@ -102,38 +105,80 @@ Group files: source, tests, config, other.
102
105
  ```
103
106
 
104
107
  **If `{economy_mode}` = false:**
105
- → Launch parallel review agents
108
+ → Launch parallel review agents using the **Task tool**
106
109
 
107
- **CRITICAL: Launch ALL in a SINGLE message:**
110
+ **🛑 CRITICAL: You MUST launch ALL 3 agents (or 4 if Next.js) in a SINGLE message using MULTIPLE Task tool calls. DO NOT launch them one at a time. DO NOT use only 1 agent. Each agent reviews a DIFFERENT aspect.**
108
111
 
109
- **Agent 1: Security** (`code-reviewer`)
112
+ First, gather the list of modified files:
113
+ ```bash
114
+ git diff --name-only HEAD~1
110
115
  ```
111
- Review for OWASP Top 10:
112
- - Injection flaws
113
- - Auth/authz issues
114
- - Data exposure
115
- - Security misconfiguration
116
+
117
+ Then, in **ONE message with 3+ parallel Task tool calls**, launch:
118
+
119
+ ---
120
+
121
+ **Agent 1: Security Review** — `subagent_type: "code-reviewer"`
122
+ ```
123
+ prompt: |
124
+ You are a SECURITY reviewer. Review ONLY the following files for security vulnerabilities:
125
+ {list of modified files}
126
+
127
+ Focus exclusively on:
128
+ - OWASP Top 10: injection flaws (SQL, command, XSS)
129
+ - Authentication and authorization issues
130
+ - Sensitive data exposure (secrets, tokens, PII in logs)
131
+ - Security misconfiguration
132
+ - Insecure deserialization
133
+ - Missing input validation at system boundaries
134
+
135
+ For each finding, provide: file:line, severity (CRITICAL/HIGH/MEDIUM/LOW), description, and suggested fix.
136
+ If no security issues found, explicitly state "No security issues found."
116
137
  ```
117
138
 
118
- **Agent 2: Logic** (`code-reviewer`)
139
+ ---
140
+
141
+ **Agent 2: Logic & Edge Cases Review** — `subagent_type: "code-reviewer"`
119
142
  ```
120
- Review for:
121
- - Edge cases not handled
122
- - Race conditions
123
- - Null handling
124
- - Incorrect logic
143
+ prompt: |
144
+ You are a LOGIC reviewer. Review ONLY the following files for logic correctness:
145
+ {list of modified files}
146
+
147
+ Focus exclusively on:
148
+ - Edge cases not handled (empty arrays, null/undefined, boundary values)
149
+ - Race conditions and concurrency issues
150
+ - Incorrect conditional logic or off-by-one errors
151
+ - Missing error handling for failure modes
152
+ - State management bugs
153
+ - Incorrect assumptions about data shape or types
154
+
155
+ For each finding, provide: file:line, severity (CRITICAL/HIGH/MEDIUM/LOW), description, and suggested fix.
156
+ If no logic issues found, explicitly state "No logic issues found."
125
157
  ```
126
158
 
127
- **Agent 3: Clean Code** (`code-reviewer`)
159
+ ---
160
+
161
+ **Agent 3: Clean Code & Quality Review** — `subagent_type: "code-reviewer"`
128
162
  ```
129
- Review for:
130
- - SOLID violations
131
- - Code smells
132
- - Complexity issues
133
- - Duplication >20 lines
163
+ prompt: |
164
+ You are a CLEAN CODE reviewer. Review ONLY the following files for code quality:
165
+ {list of modified files}
166
+
167
+ Focus exclusively on:
168
+ - SOLID principle violations
169
+ - Code smells (long methods, god objects, feature envy)
170
+ - Cyclomatic complexity > 10
171
+ - Code duplication > 20 lines
172
+ - Naming that doesn't communicate intent
173
+ - Functions doing too many things
174
+
175
+ For each finding, provide: file:line, severity (CRITICAL/HIGH/MEDIUM/LOW), description, and suggested fix.
176
+ If no quality issues found, explicitly state "No quality issues found."
134
177
  ```
135
178
 
136
- **Agent 4: Vercel/Next.js Best Practices** (CONDITIONAL)
179
+ ---
180
+
181
+ **Agent 4: Vercel/Next.js Best Practices** (CONDITIONAL — launch alongside Agents 1-3)
137
182
 
138
183
  → **Detection:** Check if modified files match Next.js/Vercel patterns:
139
184
  ```
@@ -145,22 +190,32 @@ Review for:
145
190
  - Server components, client components
146
191
  ```
147
192
 
148
- → **If Next.js/Vercel code detected:**
193
+ → **If Next.js/Vercel code detected:** Add a 4th parallel Task tool call:
149
194
 
150
- Launch additional agent using Skill tool:
151
- ```yaml
152
- skill: "vercel-react-best-practices"
195
+ `subagent_type: "code-reviewer"`
196
+ ```
197
+ prompt: |
198
+ You are a NEXT.JS / REACT PERFORMANCE reviewer. Review ONLY the following files:
199
+ {list of modified files}
200
+
201
+ Focus exclusively on:
202
+ - Sequential awaits that should use Promise.all for parallel fetching
203
+ - Barrel imports causing bundle bloat (import from index files)
204
+ - Missing dynamic imports for heavy client components
205
+ - Server-side caching opportunities (React cache, unstable_cache)
206
+ - Unnecessary re-renders (missing memo, useMemo, useCallback)
207
+ - Wrong Server vs Client component boundaries
208
+ - Data fetching patterns (preloading, parallel fetching, waterfall detection)
209
+
210
+ For each finding, provide: file:line, severity (CRITICAL/HIGH/MEDIUM/LOW), description, and suggested fix.
211
+ If no performance issues found, explicitly state "No performance issues found."
153
212
  ```
154
213
 
155
- This agent reviews for:
156
- - Async parallel patterns (Promise.all vs sequential awaits)
157
- - Bundle optimization (barrel imports, dynamic imports)
158
- - Server-side caching (React cache, unstable_cache)
159
- - Re-render optimization (memo, useMemo, useCallback usage)
160
- - Server vs Client component boundaries
161
- - Data fetching patterns (preloading, parallel fetching)
214
+ **If NOT Next.js/Vercel code:** Skip this agent (launch only Agents 1-3)
215
+
216
+ ---
162
217
 
163
- **If NOT Next.js/Vercel code:** Skip this agent
218
+ **🛑 REMINDER: You MUST have 3+ Task tool calls in a SINGLE response. If you only launched 1 agent, you are doing it WRONG. Go back and launch all agents.**
164
219
 
165
220
  ### 4. Classify Findings
166
221
 
@@ -257,10 +312,12 @@ Append to `{output_dir}/05-examine.md`:
257
312
 
258
313
  ## FAILURE MODES:
259
314
 
315
+ ❌ **CRITICAL**: Launching only 1 review agent instead of 3+ — each category (Security, Logic, Clean Code) MUST be a separate agent
316
+ ❌ Combining multiple review categories into a single agent prompt
260
317
  ❌ Skipping security review
261
318
  ❌ Not classifying by severity
262
319
  ❌ Auto-dismissing findings
263
- ❌ Launching agents sequentially
320
+ ❌ Launching agents sequentially instead of in parallel
264
321
  ❌ Using subagents when economy_mode
265
322
  ❌ Skipping Vercel/Next.js review when React/Next.js files are modified
266
323
  ❌ **CRITICAL**: Not using AskUserQuestion for review → resolve/test transition
@@ -31,6 +31,7 @@ next_step: COMPLETE
31
31
  - Some are Real, some Noise, some Uncertain
32
32
  - User may want different resolution strategies
33
33
  - Must validate after any changes
34
+ - **If `{teams_mode}` = true:** Agent team is still alive. Do NOT shutdown teammates — that happens in step-09-finish only.
34
35
 
35
36
  ## YOUR TASK:
36
37
 
@@ -25,7 +25,7 @@ previous_step: step-08-run-tests.md (or step-04-validate.md if no tests)
25
25
 
26
26
  ## CONTEXT BOUNDARIES:
27
27
 
28
- - Variables available: `{task_id}`, `{task_description}`, `{branch_name}`, `{pr_mode}`, `{auto_mode}`, `{save_mode}`, `{output_dir}`
28
+ - Variables available: `{task_id}`, `{task_description}`, `{branch_name}`, `{pr_mode}`, `{auto_mode}`, `{save_mode}`, `{teams_mode}`, `{output_dir}`
29
29
  - Previous steps completed: analyze, plan, execute, validate (+ optional: tests, examine)
30
30
  - All implementation should be done at this point
31
31
 
@@ -37,6 +37,32 @@ Finalize the APEX workflow by committing remaining changes, pushing to remote, a
37
37
 
38
38
  ## EXECUTION SEQUENCE:
39
39
 
40
+ ### 0. Shutdown Agent Team (if teams_mode)
41
+
42
+ <critical>
43
+ This is the ONLY step where team shutdown should happen.
44
+ All previous steps (validate, examine, resolve) keep the team alive.
45
+ </critical>
46
+
47
+ **If `{teams_mode}` = true:**
48
+
49
+ 1. Send shutdown_request to each teammate:
50
+ ```
51
+ SendMessage:
52
+ type: "shutdown_request"
53
+ recipient: "impl-{name}"
54
+ content: "APEX workflow complete. Shutting down team."
55
+ ```
56
+
57
+ 2. Wait for all teammates to confirm shutdown.
58
+
59
+ 3. Delete the team:
60
+ ```
61
+ TeamDelete
62
+ ```
63
+
64
+ → This cleans up team files and task directories.
65
+
40
66
  ### 1. Verify Git Status
41
67
 
42
68
  ```bash
@@ -167,6 +193,8 @@ Display workflow completion summary:
167
193
 
168
194
  ## SUCCESS METRICS:
169
195
 
196
+ ✅ Agent team shut down gracefully via SendMessage shutdown_request (if teams_mode)
197
+ ✅ TeamDelete called to clean up team resources (if teams_mode)
170
198
  ✅ All changes committed
171
199
  ✅ Branch pushed to remote
172
200
  ✅ PR created with proper title and description (if pr_mode)
@@ -189,5 +217,7 @@ Display workflow completion summary:
189
217
  This is the final step of the APEX workflow. No next step to load.
190
218
 
191
219
  <critical>
192
- Remember: This step ONLY handles git operations and PR creation. All code changes should have been completed in earlier steps.
220
+ Remember: This step handles git operations, PR creation, AND team shutdown (if teams_mode).
221
+ All code changes should have been completed in earlier steps.
222
+ Team shutdown MUST happen here — step 0 of execution sequence — before git operations.
193
223
  </critical>
@@ -17,6 +17,7 @@
17
17
  | Branch mode (`-b`) | {{branch_mode}} |
18
18
  | PR mode (`-pr`) | {{pr_mode}} |
19
19
  | Interactive mode (`-i`) | {{interactive_mode}} |
20
+ | Tasks mode (`-k`) | {{tasks_mode}} |
20
21
  | Branch name | {{branch_name}} |
21
22
 
22
23
  ---
@@ -42,6 +43,7 @@ _To be defined in step-01-analyze.md_
42
43
  | 00-init | ⏸ Pending | |
43
44
  | 01-analyze | ⏸ Pending | |
44
45
  | 02-plan | ⏸ Pending | |
46
+ | 02b-tasks | {{tasks_status}} | |
45
47
  | 03-execute | ⏸ Pending | |
46
48
  | 04-validate | ⏸ Pending | |
47
49
  | 05-examine | {{examine_status}} | |
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: claude-memory
3
3
  description: Create and optimize CLAUDE.md memory files or .claude/rules/ modular rules for Claude Code projects. Comprehensive guidance on file hierarchy, content structure, path-scoped rules, best practices, and anti-patterns. Use when working with CLAUDE.md files, .claude/rules directories, setting up new projects, or improving Claude Code's context awareness.
4
- argument-hint: [task description or "optimize"]
4
+ argument-hint: [init | optimize | task description]
5
5
  ---
6
6
 
7
7
  <core_principle>
@@ -168,6 +168,64 @@ Before creating or updating memory files, use AskUserQuestion:
168
168
  | Path rules not applying | Verify glob pattern matches target files |
169
169
  </workflow>
170
170
 
171
+ <init_workflow>
172
+ ## `/claude-memory init` — Create Minimal CLAUDE.md
173
+
174
+ When the user argument contains "init", execute this workflow to scaffold a CLAUDE.md with only the essential sections.
175
+
176
+ ### Step 1: Detect project context
177
+
178
+ Read `package.json` (or equivalent: `pyproject.toml`, `Cargo.toml`, `go.mod`, etc.) to detect:
179
+ - Project name
180
+ - Tech stack (framework, language)
181
+ - Available scripts/commands (dev, build, test)
182
+
183
+ Also check for existing linter configs (ESLint, Biome, Prettier, tsconfig) — do NOT include rules they already enforce.
184
+
185
+ ### Step 2: Identify important files
186
+
187
+ Scan for non-obvious architecture-critical files. Look for:
188
+ - Auth config files
189
+ - Server action wrappers, API helpers
190
+ - Database schema files
191
+ - Custom middleware or shared utilities
192
+ - Skip standard framework files (package.json, tsconfig, next.config, etc.)
193
+
194
+ ### Step 3: Generate CLAUDE.md
195
+
196
+ Create the file with ONLY these sections. Each section should be compact — the whole file should be under 50 lines.
197
+
198
+ ```markdown
199
+ # [Project Name]
200
+ [One-line description of what this project is]
201
+
202
+ ## Tech Stack
203
+ - [Only non-obvious technologies — skip deps detectable from config files]
204
+
205
+ ## Commands
206
+ - `[dev command]` - Dev server
207
+ - `[build command]` - Build
208
+ - `[test command]` - Tests
209
+ - [Any non-obvious commands like db:push, seed, etc.]
210
+
211
+ ## Important Files
212
+ - [Only files the agent wouldn't discover naturally]
213
+
214
+ ## Rules
215
+ - [Leave empty with a comment: "Add project-specific rules as you encounter friction"]
216
+ ```
217
+
218
+ ### Step 4: Present and write
219
+
220
+ Show the generated file to the user. Write it to `./CLAUDE.md` after approval.
221
+
222
+ **Rules:**
223
+ - NEVER include directory structure, code style rules, generic best practices, or marketing text
224
+ - NEVER include anything a linter or TypeScript already enforces
225
+ - Target: 20-50 lines. If it's longer, you're including too much
226
+ - The Rules section starts empty — it gets populated over time as mistakes happen
227
+ </init_workflow>
228
+
171
229
  <optimize_workflow>
172
230
  ## `/claude-memory optimize` — Deep CLAUDE.md Cleanup
173
231
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiblueprint-cli",
3
- "version": "1.4.41",
3
+ "version": "1.4.42",
4
4
  "description": "AIBlueprint CLI for setting up Claude Code configurations",
5
5
  "author": "AIBlueprint",
6
6
  "license": "MIT",
@@ -1,303 +0,0 @@
1
- ---
2
- name: apex
3
- description: Systematic implementation using APEX methodology (Analyze-Plan-Execute-eXamine) with parallel agents, self-validation, and optional adversarial review. Use when implementing features, fixing bugs, or making code changes that benefit from structured workflow.
4
- argument-hint: "[-a] [-x] [-s] [-t] [-b] [-pr] [-i] [-r <task-id>] <task description>"
5
- ---
6
-
7
- <objective>
8
- Execute systematic implementation workflows using the APEX methodology. This skill uses progressive step loading to minimize context usage and supports saving outputs for review and resumption.
9
- </objective>
10
-
11
- <quick_start>
12
- **Basic usage:**
13
-
14
- ```bash
15
- /apex add authentication middleware
16
- ```
17
-
18
- **Recommended workflow (autonomous with save):**
19
-
20
- ```bash
21
- /apex -a -s implement user registration
22
- ```
23
-
24
- **With adversarial review:**
25
-
26
- ```bash
27
- /apex -a -x -s fix login bug
28
- ```
29
-
30
- **Flags:**
31
-
32
- - `-a` (auto): Skip confirmations
33
- - `-s` (save): Save outputs to `.claude/output/apex/`
34
- - `-x` (examine): Include adversarial code review
35
- - `-t` (test): Create and run tests
36
- - `-pr` (pull-request): Create PR at end
37
-
38
- See `<parameters>` for complete flag list.
39
- </quick_start>
40
-
41
- <parameters>
42
-
43
- <flags>
44
- **Enable flags (turn ON):**
45
- | Short | Long | Description |
46
- |-------|------|-------------|
47
- | `-a` | `--auto` | Autonomous mode: skip confirmations, auto-approve plans |
48
- | `-x` | `--examine` | Auto-examine mode: proceed to adversarial review |
49
- | `-s` | `--save` | Save mode: output each step to `.claude/output/apex/` |
50
- | `-t` | `--test` | Test mode: include test creation and runner steps |
51
- | `-e` | `--economy` | Economy mode: no subagents, save tokens (for limited plans) |
52
- | `-r` | `--resume` | Resume mode: continue from a previous task |
53
- | `-b` | `--branch` | Branch mode: verify not on main, create branch if needed |
54
- | `-pr` | `--pull-request` | PR mode: create pull request at end (enables -b) |
55
- | `-i` | `--interactive` | Interactive mode: configure flags via AskUserQuestion |
56
-
57
- **Disable flags (turn OFF):**
58
- | Short | Long | Description |
59
- |-------|------|-------------|
60
- | `-A` | `--no-auto` | Disable auto mode |
61
- | `-X` | `--no-examine` | Disable examine mode |
62
- | `-S` | `--no-save` | Disable save mode |
63
- | `-T` | `--no-test` | Disable test mode |
64
- | `-E` | `--no-economy` | Disable economy mode |
65
- | `-B` | `--no-branch` | Disable branch mode |
66
- | `-PR` | `--no-pull-request` | Disable PR mode |
67
- </flags>
68
-
69
- <examples>
70
- ```bash
71
- # Basic
72
- /apex add auth middleware
73
-
74
- # Autonomous (skip confirmations)
75
- /apex -a add auth middleware
76
-
77
- # Save outputs + examine
78
- /apex -a -x -s add auth middleware
79
-
80
- # Full workflow with tests
81
- /apex -a -x -s -t add auth middleware
82
-
83
- # With PR creation
84
- /apex -a -pr add auth middleware
85
-
86
- # Resume previous task
87
- /apex -r 01-auth-middleware
88
- /apex -r 01 # Partial match
89
-
90
- # Economy mode (save tokens)
91
- /apex -e add auth middleware
92
-
93
- # Interactive flag config
94
- /apex -i add auth middleware
95
-
96
- # Disable flags (uppercase)
97
- /apex -A add auth middleware # Disable auto
98
- ```
99
- </examples>
100
-
101
- <parsing_rules>
102
- **Flag parsing:**
103
-
104
- 1. Defaults loaded from `steps/step-00-init.md` `<defaults>` section
105
- 2. Command-line flags override defaults (enable with lowercase `-x`, disable with uppercase `-X`)
106
- 3. Flags removed from input, remainder becomes `{task_description}`
107
- 4. Task ID generated as `NN-kebab-case-description`
108
-
109
- For detailed parsing algorithm, see `steps/step-00-init.md`.
110
- </parsing_rules>
111
-
112
- </parameters>
113
-
114
- <output_structure>
115
- **When `{save_mode}` = true:**
116
-
117
- All outputs saved to PROJECT directory (where Claude Code is running):
118
- ```
119
-
120
- .claude/output/apex/{task-id}/
121
- ├── 00-context.md # Params, user request, timestamp
122
- ├── 01-analyze.md # Analysis findings
123
- ├── 02-plan.md # Implementation plan
124
- ├── 03-execute.md # Execution log
125
- ├── 04-validate.md # Validation results
126
- ├── 05-examine.md # Review findings (if -x)
127
- ├── 06-resolve.md # Resolution log (if -x)
128
- ├── 07-tests.md # Test analysis and creation (if --test)
129
- ├── 08-run-tests.md # Test runner log (if --test)
130
- └── 09-finish.md # Workflow finish and PR creation (if --pull-request)
131
-
132
- ````
133
-
134
- **00-context.md structure:**
135
- ```markdown
136
- # APEX Task: {task_id}
137
-
138
- **Created:** {timestamp}
139
- **Task:** {task_description}
140
-
141
- ## Flags
142
- - Auto mode: {auto_mode}
143
- - Examine mode: {examine_mode}
144
- - Save mode: {save_mode}
145
- - Test mode: {test_mode}
146
-
147
- ## User Request
148
- {original user input}
149
-
150
- ## Acceptance Criteria
151
- - [ ] AC1: {inferred criterion}
152
- - [ ] AC2: {inferred criterion}
153
- ````
154
-
155
- </output_structure>
156
-
157
- <resume_workflow>
158
- **Resume mode (`-r {task-id}`):**
159
-
160
- When provided, step-00 will:
161
-
162
- 1. Locate the task folder in `.claude/output/apex/`
163
- 2. Restore state from `00-context.md`
164
- 3. Find the last completed step
165
- 4. Continue from the next step
166
-
167
- Supports partial matching (e.g., `-r 01` finds `01-add-auth-middleware`).
168
-
169
- For implementation details, see `steps/step-00-init.md`.
170
- </resume_workflow>
171
-
172
- <workflow>
173
- **Standard flow:**
174
- 1. Parse flags and task description
175
- 2. If `-r`: Execute resume workflow
176
- 3. If `-s`: Create output folder and 00-context.md
177
- 4. Load step-01-analyze.md → gather context
178
- 5. Load step-02-plan.md → create strategy
179
- 6. Load step-03-execute.md → implement
180
- 7. Load step-04-validate.md → verify
181
- 8. If `--test`: Load step-07-tests.md → analyze and create tests
182
- 9. If `--test`: Load step-08-run-tests.md → run until green
183
- 10. If `-x` or user requests: Load step-05-examine.md → adversarial review
184
- 11. If findings: Load step-06-resolve.md → fix findings
185
- 12. If `-pr`: Load step-09-finish.md → create pull request
186
- </workflow>
187
-
188
- <state_variables>
189
- **Persist throughout all steps:**
190
-
191
- | Variable | Type | Description |
192
- | ----------------------- | ------- | ------------------------------------------------------ |
193
- | `{task_description}` | string | What to implement (flags removed) |
194
- | `{feature_name}` | string | Kebab-case name without number (e.g., `add-auth-middleware`) |
195
- | `{task_id}` | string | Full identifier with number (e.g., `01-add-auth-middleware`) |
196
- | `{acceptance_criteria}` | list | Success criteria (inferred or explicit) |
197
- | `{auto_mode}` | boolean | Skip confirmations, use recommended options |
198
- | `{examine_mode}` | boolean | Auto-proceed to adversarial review |
199
- | `{save_mode}` | boolean | Save outputs to .claude/output/apex/ |
200
- | `{test_mode}` | boolean | Include test steps (07-08) |
201
- | `{economy_mode}` | boolean | No subagents, direct tool usage only |
202
- | `{branch_mode}` | boolean | Verify not on main, create branch if needed |
203
- | `{pr_mode}` | boolean | Create pull request at end |
204
- | `{interactive_mode}` | boolean | Configure flags interactively |
205
- | `{resume_task}` | string | Task ID to resume (if -r provided) |
206
- | `{output_dir}` | string | Full path to output directory |
207
- | `{branch_name}` | string | Created branch name (if branch_mode) |
208
-
209
- </state_variables>
210
-
211
- <entry_point>
212
-
213
- **FIRST ACTION:** Load `steps/step-00-init.md`
214
-
215
- Step 00 handles:
216
-
217
- - Flag parsing (-a, -x, -s, -r, --test)
218
- - Resume mode detection and task lookup
219
- - Output folder creation (if save_mode)
220
- - 00-context.md creation (if save_mode)
221
- - State variable initialization
222
-
223
- After initialization, step-00 loads step-01-analyze.md.
224
-
225
- </entry_point>
226
-
227
- <step_files>
228
- **Progressive loading - only load current step:**
229
-
230
- | Step | File | Purpose |
231
- | ---- | ---------------------------- | ---------------------------------------------------- |
232
- | 00 | `steps/step-00-init.md` | Parse flags, create output folder, initialize state |
233
- | 01 | `steps/step-01-analyze.md` | Smart context gathering with 1-10 parallel agents based on complexity |
234
- | 02 | `steps/step-02-plan.md` | File-by-file implementation strategy |
235
- | 03 | `steps/step-03-execute.md` | Todo-driven implementation |
236
- | 04 | `steps/step-04-validate.md` | Self-check and validation |
237
- | 05 | `steps/step-05-examine.md` | Adversarial code review (optional) |
238
- | 06 | `steps/step-06-resolve.md` | Finding resolution (optional) |
239
- | 07 | `steps/step-07-tests.md` | Test analysis and creation (if --test) |
240
- | 08 | `steps/step-08-run-tests.md` | Test runner loop until green (if --test) |
241
- | 09 | `steps/step-09-finish.md` | Create pull request (if --pull-request) |
242
-
243
- </step_files>
244
-
245
- <execution_rules>
246
-
247
- - **Load one step at a time** - Only load the current step file
248
- - **ULTRA THINK** before major decisions
249
- - **Persist state variables** across all steps
250
- - **Follow next_step directive** at end of each step
251
- - **Save outputs** if `{save_mode}` = true (append to step file)
252
- - **Use parallel agents** for independent exploration tasks
253
-
254
- ## 🧠 Smart Agent Strategy in Analyze Phase
255
-
256
- The analyze phase (step-01) uses **adaptive agent launching** (unless economy_mode):
257
-
258
- **Available agents:**
259
- - `explore-codebase` - Find existing patterns, files, utilities
260
- - `explore-docs` - Research library docs (use when unfamiliar with API)
261
- - `websearch` - Find approaches, best practices, gotchas
262
-
263
- **Launch 1-10 agents based on task complexity:**
264
-
265
- | Complexity | Agents | When |
266
- |------------|--------|------|
267
- | Simple | 1-2 | Bug fix, small tweak |
268
- | Medium | 2-4 | New feature in familiar stack |
269
- | Complex | 4-7 | Unfamiliar libraries, integrations |
270
- | Major | 6-10 | Multiple systems, many unknowns |
271
-
272
- **BE SMART:** Analyze what you actually need before launching. Don't over-launch for simple tasks, don't under-launch for complex ones.
273
-
274
- </execution_rules>
275
-
276
- <save_output_pattern>
277
- **When `{save_mode}` = true:**
278
-
279
- Step-00 runs `scripts/setup-templates.sh` to initialize all output files from `templates/` directory.
280
-
281
- **Each step then:**
282
-
283
- 1. Run `scripts/update-progress.sh {task_id} {step_num} {step_name} "in_progress"`
284
- 2. Append findings/outputs to the pre-created step file
285
- 3. Run `scripts/update-progress.sh {task_id} {step_num} {step_name} "complete"`
286
-
287
- **Template system benefits:**
288
-
289
- - Reduces token usage by ~75% (1,350 tokens saved per workflow)
290
- - Templates in `templates/` directory (not inline in steps)
291
- - Scripts handle progress tracking automatically
292
- - See `templates/README.md` for details
293
-
294
- </save_output_pattern>
295
-
296
- <success_criteria>
297
-
298
- - Each step loaded progressively
299
- - All validation checks passing
300
- - Outputs saved if `{save_mode}` enabled
301
- - Tests passing if `{test_mode}` enabled
302
- - Clear completion summary provided
303
- </success_criteria>