aiblueprint-cli 1.4.40 → 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.
- package/claude-code-config/skills/apex/SKILL.md +116 -0
- package/claude-code-config/skills/{workflow-apex → apex}/scripts/setup-templates.sh +12 -2
- package/claude-code-config/skills/{workflow-apex → apex}/steps/step-00-init.md +19 -34
- package/claude-code-config/skills/{workflow-apex → apex}/steps/step-00b-interactive.md +13 -1
- package/claude-code-config/skills/apex/steps/step-00b-save.md +123 -0
- package/claude-code-config/skills/{workflow-apex → apex}/steps/step-01-analyze.md +36 -17
- package/claude-code-config/skills/apex/steps/step-02-plan.md +593 -0
- package/claude-code-config/skills/apex/steps/step-02b-tasks.md +301 -0
- package/claude-code-config/skills/apex/steps/step-03-execute-teams.md +296 -0
- package/claude-code-config/skills/{workflow-apex → apex}/steps/step-03-execute.md +1 -0
- package/claude-code-config/skills/{workflow-apex → apex}/steps/step-04-validate.md +3 -1
- package/claude-code-config/skills/{workflow-apex → apex}/steps/step-05-examine.md +92 -35
- package/claude-code-config/skills/{workflow-apex → apex}/steps/step-06-resolve.md +1 -0
- package/claude-code-config/skills/{workflow-apex → apex}/steps/step-09-finish.md +32 -2
- package/claude-code-config/skills/{workflow-apex → apex}/templates/00-context.md +2 -0
- package/claude-code-config/skills/{meta-claude-memory → claude-memory}/SKILL.md +59 -1
- package/dist/cli.js +84 -37
- package/package.json +1 -1
- package/claude-code-config/skills/workflow-apex/SKILL.md +0 -303
- package/claude-code-config/skills/workflow-apex/steps/step-02-plan.md +0 -264
- /package/claude-code-config/skills/{workflow-apex → apex}/scripts/update-progress.sh +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/steps/step-00b-branch.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/steps/step-00b-economy.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/steps/step-07-tests.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/steps/step-08-run-tests.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/templates/01-analyze.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/templates/02-plan.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/templates/03-execute.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/templates/04-validate.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/templates/05-examine.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/templates/06-resolve.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/templates/07-tests.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/templates/08-run-tests.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/templates/09-finish.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/templates/README.md +0 -0
- /package/claude-code-config/skills/{workflow-apex → apex}/templates/step-complete.md +0 -0
- /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/comprehensive-example.md +0 -0
- /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/optimize-guide.md +0 -0
- /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/project-patterns.md +0 -0
- /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/prompting-techniques.md +0 -0
- /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/rules-directory-guide.md +0 -0
- /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/section-templates.md +0 -0
- /package/claude-code-config/skills/{git-commit → commit}/SKILL.md +0 -0
- /package/claude-code-config/skills/{git-create-pr → create-pr}/SKILL.md +0 -0
- /package/claude-code-config/skills/{utils-fix-errors → fix-errors}/SKILL.md +0 -0
- /package/claude-code-config/skills/{utils-fix-grammar → fix-grammar}/SKILL.md +0 -0
- /package/claude-code-config/skills/{git-fix-pr-comments → fix-pr-comments}/SKILL.md +0 -0
- /package/claude-code-config/skills/{git-merge → merge}/SKILL.md +0 -0
- /package/claude-code-config/skills/{utils-oneshot → oneshot}/SKILL.md +0 -0
- /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/SKILL.md +0 -0
- /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/anthropic-best-practices.md +0 -0
- /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/anti-patterns.md +0 -0
- /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/clarity-principles.md +0 -0
- /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/context-management.md +0 -0
- /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/few-shot-patterns.md +0 -0
- /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/openai-best-practices.md +0 -0
- /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/prompt-templates.md +0 -0
- /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/reasoning-techniques.md +0 -0
- /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/system-prompt-patterns.md +0 -0
- /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/xml-structure.md +0 -0
- /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/LICENSE.txt +0 -0
- /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/SKILL.md +0 -0
- /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/package.json +0 -0
- /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/output-patterns.md +0 -0
- /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/progressive-disclosure-patterns.md +0 -0
- /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/prompting-integration.md +0 -0
- /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/real-world-examples.md +0 -0
- /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/script-patterns.md +0 -0
- /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/workflows.md +0 -0
- /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/xml-tag-guide.md +0 -0
- /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/scripts/init-skill.ts +0 -0
- /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/scripts/package-skill.ts +0 -0
- /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/scripts/validate.ts +0 -0
- /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/SKILL.md +0 -0
- /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/context-management.md +0 -0
- /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/debugging-agents.md +0 -0
- /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/error-handling-and-recovery.md +0 -0
- /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/evaluation-and-testing.md +0 -0
- /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/orchestration-patterns.md +0 -0
- /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/subagents.md +0 -0
- /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/writing-subagent-prompts.md +0 -0
- /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
|
-
|
|
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
|
-
|
|
112
|
+
First, gather the list of modified files:
|
|
113
|
+
```bash
|
|
114
|
+
git diff --name-only HEAD~1
|
|
110
115
|
```
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
**Agent 2: Logic & Edge Cases Review** — `subagent_type: "code-reviewer"`
|
|
119
142
|
```
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
**Agent 3: Clean Code & Quality Review** — `subagent_type: "code-reviewer"`
|
|
128
162
|
```
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
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
|
-
|
|
151
|
-
```
|
|
152
|
-
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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/dist/cli.js
CHANGED
|
@@ -5,15 +5,29 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
function __accessProp(key) {
|
|
9
|
+
return this[key];
|
|
10
|
+
}
|
|
11
|
+
var __toESMCache_node;
|
|
12
|
+
var __toESMCache_esm;
|
|
8
13
|
var __toESM = (mod, isNodeMode, target) => {
|
|
14
|
+
var canCache = mod != null && typeof mod === "object";
|
|
15
|
+
if (canCache) {
|
|
16
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
17
|
+
var cached = cache.get(mod);
|
|
18
|
+
if (cached)
|
|
19
|
+
return cached;
|
|
20
|
+
}
|
|
9
21
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
22
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
23
|
for (let key of __getOwnPropNames(mod))
|
|
12
24
|
if (!__hasOwnProp.call(to, key))
|
|
13
25
|
__defProp(to, key, {
|
|
14
|
-
get: (
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
15
27
|
enumerable: true
|
|
16
28
|
});
|
|
29
|
+
if (canCache)
|
|
30
|
+
cache.set(mod, to);
|
|
17
31
|
return to;
|
|
18
32
|
};
|
|
19
33
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
@@ -32921,45 +32935,78 @@ async function setupOpenCodeSymlink(claudeDir, customOpenCodeFolder, customClaud
|
|
|
32921
32935
|
import { execSync } from "child_process";
|
|
32922
32936
|
import path4 from "path";
|
|
32923
32937
|
import os5 from "os";
|
|
32924
|
-
|
|
32925
|
-
|
|
32926
|
-
|
|
32927
|
-
|
|
32928
|
-
|
|
32929
|
-
|
|
32938
|
+
var isWindows = os5.platform() === "win32";
|
|
32939
|
+
function checkCommand(cmd) {
|
|
32940
|
+
try {
|
|
32941
|
+
const whichCmd = isWindows ? `where ${cmd}` : `which ${cmd}`;
|
|
32942
|
+
execSync(whichCmd, { stdio: "ignore" });
|
|
32943
|
+
return true;
|
|
32944
|
+
} catch {
|
|
32945
|
+
return false;
|
|
32946
|
+
}
|
|
32947
|
+
}
|
|
32948
|
+
function silentExec(command, options) {
|
|
32949
|
+
try {
|
|
32950
|
+
execSync(command, {
|
|
32951
|
+
stdio: "pipe",
|
|
32952
|
+
timeout: options?.timeout ?? 60000,
|
|
32953
|
+
cwd: options?.cwd,
|
|
32954
|
+
env: { ...process.env, CI: "true" }
|
|
32955
|
+
});
|
|
32956
|
+
return true;
|
|
32957
|
+
} catch {
|
|
32958
|
+
return false;
|
|
32959
|
+
}
|
|
32960
|
+
}
|
|
32961
|
+
function installBun() {
|
|
32962
|
+
if (!isWindows) {
|
|
32963
|
+
if (silentExec("curl -fsSL https://bun.sh/install | bash", { timeout: 120000 })) {
|
|
32930
32964
|
return true;
|
|
32931
|
-
} catch {
|
|
32932
|
-
return false;
|
|
32933
32965
|
}
|
|
32934
|
-
}
|
|
32966
|
+
}
|
|
32967
|
+
return silentExec("npm install -g bun");
|
|
32968
|
+
}
|
|
32969
|
+
function installCcusage() {
|
|
32970
|
+
return silentExec("npm install -g ccusage");
|
|
32971
|
+
}
|
|
32972
|
+
function logSkipped(name) {
|
|
32973
|
+
console.log(source_default.gray(` ${name} already installed, skipping...`));
|
|
32974
|
+
}
|
|
32975
|
+
function logInstalling(name) {
|
|
32976
|
+
console.log(source_default.yellow(`
|
|
32977
|
+
Installing ${name}...`));
|
|
32978
|
+
}
|
|
32979
|
+
function logInstalled(name) {
|
|
32980
|
+
console.log(source_default.green(` ✓ ${name} installed`));
|
|
32981
|
+
}
|
|
32982
|
+
function logInstallFailed(name, manualCommand) {
|
|
32983
|
+
console.log("");
|
|
32984
|
+
console.log(source_default.yellow(` ⚠ Could not install ${name} automatically`));
|
|
32985
|
+
console.log(source_default.gray(` This is usually a permissions issue with npm global installs.`));
|
|
32986
|
+
console.log(source_default.gray(` Run this manually to fix it:
|
|
32987
|
+
`));
|
|
32988
|
+
console.log(source_default.white(` ${manualCommand}`));
|
|
32989
|
+
console.log("");
|
|
32990
|
+
}
|
|
32991
|
+
async function checkAndInstallDependencies() {
|
|
32935
32992
|
if (checkCommand("bun")) {
|
|
32936
|
-
|
|
32993
|
+
logSkipped("bun");
|
|
32937
32994
|
} else {
|
|
32938
|
-
|
|
32939
|
-
|
|
32940
|
-
|
|
32941
|
-
|
|
32942
|
-
|
|
32943
|
-
timeout: 60000,
|
|
32944
|
-
env: { ...process.env, CI: "true" }
|
|
32945
|
-
});
|
|
32946
|
-
} catch {
|
|
32947
|
-
console.log(source_default.yellow(" ⚠ Failed to install bun. Please install it manually: npm install -g bun"));
|
|
32995
|
+
logInstalling("bun");
|
|
32996
|
+
if (installBun()) {
|
|
32997
|
+
logInstalled("bun");
|
|
32998
|
+
} else {
|
|
32999
|
+
logInstallFailed("bun", isWindows ? "npm install -g bun" : "curl -fsSL https://bun.sh/install | bash");
|
|
32948
33000
|
}
|
|
32949
33001
|
}
|
|
32950
33002
|
if (checkCommand("ccusage")) {
|
|
32951
|
-
|
|
33003
|
+
logSkipped("ccusage");
|
|
32952
33004
|
} else {
|
|
32953
|
-
|
|
32954
|
-
|
|
32955
|
-
|
|
32956
|
-
|
|
32957
|
-
|
|
32958
|
-
timeout: 60000,
|
|
32959
|
-
env: { ...process.env, CI: "true" }
|
|
32960
|
-
});
|
|
32961
|
-
} catch {
|
|
32962
|
-
console.log(source_default.yellow(" ⚠ Failed to install ccusage. Please install it manually: npm install -g ccusage"));
|
|
33005
|
+
logInstalling("ccusage");
|
|
33006
|
+
if (installCcusage()) {
|
|
33007
|
+
logInstalled("ccusage");
|
|
33008
|
+
} else {
|
|
33009
|
+
logInstallFailed("ccusage", "sudo npm install -g ccusage");
|
|
32963
33010
|
}
|
|
32964
33011
|
}
|
|
32965
33012
|
}
|
|
@@ -32970,7 +33017,7 @@ async function installScriptsDependencies(claudeDir) {
|
|
|
32970
33017
|
try {
|
|
32971
33018
|
execSync("bun install --no-save", {
|
|
32972
33019
|
cwd: scriptsDir,
|
|
32973
|
-
stdio: "
|
|
33020
|
+
stdio: "pipe",
|
|
32974
33021
|
timeout: 60000,
|
|
32975
33022
|
env: {
|
|
32976
33023
|
...process.env,
|
|
@@ -36510,10 +36557,10 @@ import { spawn as spawn2 } from "child_process";
|
|
|
36510
36557
|
import { execSync as execSync4 } from "child_process";
|
|
36511
36558
|
import path21 from "path";
|
|
36512
36559
|
import os19 from "os";
|
|
36513
|
-
function
|
|
36560
|
+
function checkCommand2(cmd) {
|
|
36514
36561
|
try {
|
|
36515
|
-
const
|
|
36516
|
-
const whichCmd =
|
|
36562
|
+
const isWindows2 = os19.platform() === "win32";
|
|
36563
|
+
const whichCmd = isWindows2 ? `where ${cmd}` : `which ${cmd}`;
|
|
36517
36564
|
execSync4(whichCmd, { stdio: "ignore" });
|
|
36518
36565
|
return true;
|
|
36519
36566
|
} catch {
|
|
@@ -36534,7 +36581,7 @@ Usage: aiblueprint ${prefix} <action>`));
|
|
|
36534
36581
|
`));
|
|
36535
36582
|
}
|
|
36536
36583
|
async function executeScript(scriptName, claudeDir) {
|
|
36537
|
-
if (!
|
|
36584
|
+
if (!checkCommand2("bun")) {
|
|
36538
36585
|
console.error(source_default.red("Bun is not installed. Install with: npm install -g bun"));
|
|
36539
36586
|
return 1;
|
|
36540
36587
|
}
|