aiblueprint-cli 1.4.88 → 1.4.89

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 (55) hide show
  1. package/agents-config/skills/agents-manager/SKILL.md +14 -3
  2. package/agents-config/skills/agents-manager/references/writing-agent-prompts.md +1 -1
  3. package/agents-config/skills/apex/SKILL.md +116 -55
  4. package/agents-config/skills/apex/scripts/setup-templates.sh +154 -0
  5. package/agents-config/skills/apex/scripts/update-progress.sh +80 -0
  6. package/agents-config/skills/apex/steps/step-00-init.md +278 -0
  7. package/agents-config/skills/apex/steps/step-00b-branch.md +126 -0
  8. package/agents-config/skills/apex/steps/step-00b-economy.md +247 -0
  9. package/agents-config/skills/apex/steps/step-00b-interactive.md +170 -0
  10. package/agents-config/skills/apex/steps/step-00b-save.md +125 -0
  11. package/agents-config/skills/apex/steps/step-01-analyze.md +388 -0
  12. package/agents-config/skills/apex/steps/step-02-plan.md +593 -0
  13. package/agents-config/skills/apex/steps/step-02b-tasks.md +301 -0
  14. package/agents-config/skills/apex/steps/step-03-execute-teams.md +296 -0
  15. package/agents-config/skills/apex/steps/step-03-execute.md +240 -0
  16. package/agents-config/skills/apex/steps/step-04-validate.md +272 -0
  17. package/agents-config/skills/apex/steps/step-05-examine.md +400 -0
  18. package/agents-config/skills/apex/steps/step-06-resolve.md +239 -0
  19. package/agents-config/skills/apex/steps/step-07-tests.md +250 -0
  20. package/agents-config/skills/apex/steps/step-08-run-tests.md +314 -0
  21. package/agents-config/skills/apex/steps/step-09-finish.md +223 -0
  22. package/agents-config/skills/apex/steps/step-10-verify.md +296 -0
  23. package/agents-config/skills/apex/templates/00-context.md +55 -0
  24. package/agents-config/skills/apex/templates/01-analyze.md +10 -0
  25. package/agents-config/skills/apex/templates/02-plan.md +10 -0
  26. package/agents-config/skills/apex/templates/03-execute.md +10 -0
  27. package/agents-config/skills/apex/templates/04-validate.md +10 -0
  28. package/agents-config/skills/apex/templates/05-examine.md +10 -0
  29. package/agents-config/skills/apex/templates/06-resolve.md +10 -0
  30. package/agents-config/skills/apex/templates/07-tests.md +10 -0
  31. package/agents-config/skills/apex/templates/08-run-tests.md +10 -0
  32. package/agents-config/skills/apex/templates/09-finish.md +10 -0
  33. package/agents-config/skills/apex/templates/10-verify.md +9 -0
  34. package/agents-config/skills/apex/templates/README.md +195 -0
  35. package/agents-config/skills/apex/templates/step-complete.md +7 -0
  36. package/agents-config/skills/appstore-connect/SKILL.md +3 -9
  37. package/agents-config/skills/environments-manager/SKILL.md +86 -94
  38. package/agents-config/skills/environments-manager/examples/{skills/dev/SKILL.md → claude/commands/dev.md} +1 -2
  39. package/agents-config/skills/environments-manager/examples/{skills/lint/SKILL.md → claude/commands/lint.md} +1 -2
  40. package/agents-config/skills/environments-manager/examples/{skills/test/SKILL.md → claude/commands/test.md} +1 -2
  41. package/agents-config/skills/environments-manager/examples/{skills/typecheck/SKILL.md → claude/commands/typecheck.md} +1 -2
  42. package/agents-config/skills/environments-manager/examples/scripts/worktree-down.sh +5 -12
  43. package/agents-config/skills/environments-manager/examples/scripts/worktree-up.sh +11 -21
  44. package/agents-config/skills/environments-manager/references/claude.md +9 -13
  45. package/agents-config/skills/environments-manager/references/convex.md +120 -0
  46. package/agents-config/skills/environments-manager/references/cursor.md +2 -2
  47. package/agents-config/skills/environments-manager/references/postgresql.md +89 -0
  48. package/agents-config/skills/oneshot/SKILL.md +21 -37
  49. package/agents-config/skills/rules-manager/SKILL.md +15 -2
  50. package/agents-config/skills/skill-manager/SKILL.md +30 -2
  51. package/agents-config/skills/ultrathink/SKILL.md +1 -1
  52. package/agents-config/skills/use-fable/SKILL.md +64 -0
  53. package/package.json +1 -1
  54. package/agents-config/skills/appstore-connect/references/setup.md +0 -156
  55. package/agents-config/skills/appstore-connect/references/testflight.md +0 -212
@@ -0,0 +1,170 @@
1
+ ---
2
+ name: step-00b-interactive
3
+ description: Interactively configure APEX workflow flags
4
+ returns_to: step-00-init.md
5
+ ---
6
+
7
+ # Step 0b: Interactive Configuration
8
+
9
+ ## MANDATORY EXECUTION RULES (READ FIRST):
10
+
11
+ - 🛑 NEVER skip the interactive menu
12
+ - 🛑 NEVER assume user preferences
13
+ - ✅ ALWAYS use AskUserQuestion for flag selection
14
+ - ✅ ALWAYS update all flag variables before returning
15
+ - 📋 YOU ARE A CONFIGURATOR, not an implementer
16
+ - 💬 FOCUS on flag configuration only
17
+ - 🚫 FORBIDDEN to start any workflow steps
18
+
19
+ ## CONTEXT BOUNDARIES:
20
+
21
+ - Variables available: All current flag values from step-00-init
22
+ - This sub-step updates: All flag variables based on user selection
23
+ - Return to step-00-init.md after completion
24
+
25
+ ## YOUR TASK:
26
+
27
+ Present an interactive menu for the user to enable/disable workflow flags.
28
+
29
+ ---
30
+
31
+ ## EXECUTION SEQUENCE:
32
+
33
+ ### 1. Display Current Configuration
34
+
35
+ Show current flag values:
36
+ ```
37
+ **Current APEX Configuration:**
38
+
39
+ | Flag | Status | Description |
40
+ |------|--------|-------------|
41
+ | Auto (`-a`) | {auto_mode ? "✓ ON" : "✗ OFF"} | Skip confirmations |
42
+ | Examine (`-x`) | {examine_mode ? "✓ ON" : "✗ OFF"} | Adversarial review |
43
+ | Save (`-s`) | {save_mode ? "✓ ON" : "✗ OFF"} | Save outputs to files |
44
+ | Test (`-t`) | {test_mode ? "✓ ON" : "✗ OFF"} | Include test steps |
45
+ | Verify (`-v`) | {verify_mode ? "✓ ON" : "✗ OFF"} | Launch & verify feature |
46
+ | Economy (`-e`) | {economy_mode ? "✓ ON" : "✗ OFF"} | No subagents |
47
+ | Branch (`-b`) | {branch_mode ? "✓ ON" : "✗ OFF"} | Verify/create branch |
48
+ | PR (`-pr`) | {pr_mode ? "✓ ON" : "✗ OFF"} | Create pull request |
49
+ | Teams (`-m`) | {teams_mode ? "✓ ON" : "✗ OFF"} | Agent Teams parallel execution |
50
+ ```
51
+
52
+ ### 2. Ask for Flag Changes
53
+
54
+ Use AskUserQuestion with multiSelect:
55
+ ```yaml
56
+ questions:
57
+ - header: "Configure"
58
+ question: "Select flags to TOGGLE (currently shown flags will flip their state):"
59
+ options:
60
+ - label: "Auto mode"
61
+ description: "{auto_mode ? 'Disable' : 'Enable'} - skip confirmations"
62
+ - label: "Examine mode"
63
+ description: "{examine_mode ? 'Disable' : 'Enable'} - adversarial review at end"
64
+ - label: "Save mode"
65
+ description: "{save_mode ? 'Disable' : 'Enable'} - save outputs to .claude/output/"
66
+ - label: "Test mode"
67
+ description: "{test_mode ? 'Disable' : 'Enable'} - include test creation/runner"
68
+ - label: "Verify mode"
69
+ description: "{verify_mode ? 'Disable' : 'Enable'} - launch app and verify feature works"
70
+ multiSelect: true
71
+ ```
72
+
73
+ ### 3. Ask for Additional Flags
74
+
75
+ Use AskUserQuestion with multiSelect:
76
+ ```yaml
77
+ questions:
78
+ - header: "More"
79
+ question: "Select additional flags to TOGGLE:"
80
+ options:
81
+ - label: "Economy mode"
82
+ description: "{economy_mode ? 'Disable' : 'Enable'} - no subagents, save tokens"
83
+ - label: "Branch mode"
84
+ description: "{branch_mode ? 'Disable' : 'Enable'} - verify/create git branch"
85
+ - label: "PR mode"
86
+ description: "{pr_mode ? 'Disable' : 'Enable'} - create pull request at end"
87
+ - label: "Teams mode"
88
+ description: "{teams_mode ? 'Disable' : 'Enable'} - Agent Teams parallel execution"
89
+ - label: "Done - keep current"
90
+ description: "No more changes, proceed with workflow"
91
+ multiSelect: true
92
+ ```
93
+
94
+ ### 4. Apply Changes
95
+
96
+ For each selected flag, toggle its value:
97
+ ```
98
+ IF "Auto mode" selected → {auto_mode} = !{auto_mode}
99
+ IF "Examine mode" selected → {examine_mode} = !{examine_mode}
100
+ IF "Save mode" selected → {save_mode} = !{save_mode}
101
+ IF "Test mode" selected → {test_mode} = !{test_mode}
102
+ IF "Verify mode" selected → {verify_mode} = !{verify_mode}
103
+ IF "Economy mode" selected → {economy_mode} = !{economy_mode}
104
+ IF "Branch mode" selected → {branch_mode} = !{branch_mode}
105
+ IF "PR mode" selected → {pr_mode} = !{pr_mode}
106
+ IF "Teams mode" selected → {teams_mode} = !{teams_mode}
107
+ ```
108
+
109
+ **Special rules:**
110
+
111
+ If Teams mode enabled, auto-enable tasks mode (teams requires task breakdown):
112
+ ```
113
+ IF {teams_mode} = true → {tasks_mode} = true
114
+ ```
115
+
116
+ If PR mode enabled, auto-enable branch mode:
117
+ ```
118
+ IF {pr_mode} = true → {branch_mode} = true
119
+ ```
120
+
121
+ ### 5. Show Final Configuration
122
+
123
+ Display updated configuration:
124
+ ```
125
+ **Updated APEX Configuration:**
126
+
127
+ | Flag | Status |
128
+ |------|--------|
129
+ | Auto | {auto_mode ? "✓ ON" : "✗ OFF"} |
130
+ | Examine | {examine_mode ? "✓ ON" : "✗ OFF"} |
131
+ | Save | {save_mode ? "✓ ON" : "✗ OFF"} |
132
+ | Test | {test_mode ? "✓ ON" : "✗ OFF"} |
133
+ | Verify | {verify_mode ? "✓ ON" : "✗ OFF"} |
134
+ | Economy | {economy_mode ? "✓ ON" : "✗ OFF"} |
135
+ | Branch | {branch_mode ? "✓ ON" : "✗ OFF"} |
136
+ | PR | {pr_mode ? "✓ ON" : "✗ OFF"} |
137
+ | Teams | {teams_mode ? "✓ ON" : "✗ OFF"} |
138
+ ```
139
+
140
+ ### 6. Return
141
+
142
+ → Return to step-00-init.md with all flags updated
143
+
144
+ ---
145
+
146
+ ## SUCCESS METRICS:
147
+
148
+ ✅ Current configuration displayed
149
+ ✅ User able to toggle any flag
150
+ ✅ All selected flags properly toggled
151
+ ✅ PR mode auto-enables branch mode
152
+ ✅ Final configuration shown
153
+
154
+ ## FAILURE MODES:
155
+
156
+ ❌ Not showing current flag states
157
+ ❌ Forgetting to toggle selected flags
158
+ ❌ Not enabling branch_mode when pr_mode selected
159
+ ❌ Starting workflow instead of returning
160
+ ❌ **CRITICAL**: Using plain text prompts instead of AskUserQuestion
161
+
162
+ ---
163
+
164
+ ## RETURN:
165
+
166
+ After configuration complete, return to `./step-00-init.md` to continue initialization.
167
+
168
+ <critical>
169
+ Remember: This sub-step ONLY handles flag configuration. Return immediately after updating flags.
170
+ </critical>
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: step-00b-save
3
+ description: Setup save output structure for APEX workflow
4
+ returns_to: step-00-init.md
5
+ ---
6
+
7
+ # Step 0b: Save Mode Setup
8
+
9
+ ## MANDATORY EXECUTION RULES (READ FIRST):
10
+
11
+ - 🛑 NEVER start analysis or implementation
12
+ - ✅ ALWAYS run the setup script to create output structure
13
+ - ✅ ALWAYS capture the generated `{task_id}` from the script output
14
+ - 📋 YOU ARE A SETUP MANAGER, not an implementer
15
+ - 🚫 FORBIDDEN to start any analysis work
16
+
17
+ ## CONTEXT BOUNDARIES:
18
+
19
+ - Variables available: `{feature_name}`, `{task_description}`, all flag variables, `{branch_name}`
20
+ - This sub-step sets: `{task_id}`, `{output_dir}`
21
+ - Return to step-00-init.md after completion
22
+
23
+ ## YOUR TASK:
24
+
25
+ Create the output directory structure and initialize all output files for the APEX workflow.
26
+
27
+ ---
28
+
29
+ ## OUTPUT STRUCTURE:
30
+
31
+ When save_mode is enabled, all outputs go to the PROJECT directory:
32
+
33
+ ```
34
+ .claude/output/apex/{task-id}/
35
+ ├── 00-context.md # Params, user request, timestamp
36
+ ├── 01-analyze.md # Analysis findings
37
+ ├── 02-plan.md # Implementation plan
38
+ ├── 03-execute.md # Execution log
39
+ ├── 04-validate.md # Validation results
40
+ ├── 02b-tasks/ # Task breakdown (if -k or -m)
41
+ │ ├── README.md
42
+ │ └── task-NN-*.md
43
+ ├── 05-examine.md # Review findings (if -x)
44
+ ├── 06-resolve.md # Resolution log (if -x)
45
+ ├── 07-tests.md # Test analysis (if -t)
46
+ ├── 08-run-tests.md # Test runner log (if -t)
47
+ ├── 10-verify.md # Feature verification (if -v)
48
+ └── 09-finish.md # PR creation (if -pr)
49
+ ```
50
+
51
+ ## EXECUTION SEQUENCE:
52
+
53
+ ### 1. Run Template Setup Script
54
+
55
+ ```bash
56
+ bash {skill_dir}/scripts/setup-templates.sh \
57
+ "{feature_name}" \
58
+ "{task_description}" \
59
+ "{auto_mode}" \
60
+ "{examine_mode}" \
61
+ "{save_mode}" \
62
+ "{test_mode}" \
63
+ "{economy_mode}" \
64
+ "{branch_mode}" \
65
+ "{pr_mode}" \
66
+ "{interactive_mode}" \
67
+ "{tasks_mode}" \
68
+ "{verify_mode}" \
69
+ "{branch_name}" \
70
+ "{original_input}"
71
+ ```
72
+
73
+ **Note:** Pass `{feature_name}` (without number prefix), NOT `{task_id}`.
74
+
75
+ The script:
76
+ - Auto-generates `{task_id}` = `NN-{feature_name}` (next available number)
77
+ - Creates `.claude/output/apex/{task_id}/` directory
78
+ - Initializes `00-context.md` with configuration and progress table
79
+ - Pre-creates all step files from templates
80
+ - Only creates files for enabled steps (examine, tests, PR)
81
+ - Outputs the generated `{task_id}`
82
+
83
+ ### 2. Capture Output Variables
84
+
85
+ From the script output, set:
86
+ - `{task_id}` = the generated ID (e.g., `01-add-auth-middleware`)
87
+ - `{output_dir}` = `.claude/output/apex/{task_id}`
88
+
89
+ ### 3. Return
90
+
91
+ → Return to step-00-init.md with `{task_id}` and `{output_dir}` set
92
+
93
+ ---
94
+
95
+ ## SAVE OUTPUT PATTERN (for all subsequent steps):
96
+
97
+ Each step uses this pattern:
98
+
99
+ 1. `bash {skill_dir}/scripts/update-progress.sh "{task_id}" "{step_num}" "{step_name}" "in_progress"`
100
+ 2. Append findings/outputs to the pre-created step file
101
+ 3. `bash {skill_dir}/scripts/update-progress.sh "{task_id}" "{step_num}" "{step_name}" "complete"`
102
+
103
+ ---
104
+
105
+ ## SUCCESS METRICS:
106
+
107
+ ✅ Output directory created
108
+ ✅ `{task_id}` generated and captured
109
+ ✅ `{output_dir}` set
110
+ ✅ All template files initialized
111
+
112
+ ## FAILURE MODES:
113
+
114
+ ❌ Not capturing `{task_id}` from script output
115
+ ❌ Starting analysis before returning
116
+
117
+ ---
118
+
119
+ ## RETURN:
120
+
121
+ After setup complete, return to `./step-00-init.md` to continue initialization.
122
+
123
+ <critical>
124
+ Remember: This sub-step ONLY creates the output structure. Return immediately after setting {task_id} and {output_dir}.
125
+ </critical>
@@ -0,0 +1,388 @@
1
+ ---
2
+ name: step-01-analyze
3
+ description: Pure context gathering - explore codebase to understand WHAT EXISTS
4
+ next_step: steps/step-02-plan.md
5
+ ---
6
+
7
+ # Step 1: Analyze (Context Gathering)
8
+
9
+ ## MANDATORY EXECUTION RULES (READ FIRST):
10
+
11
+ - 🛑 NEVER plan or design solutions - that's step 2
12
+ - 🛑 NEVER create todos or implementation tasks
13
+ - 🛑 NEVER decide HOW to implement anything
14
+ - 🛑 NEVER mark analyze as "complete" BEFORE writing findings to `{output_dir}/01-analyze.md` (if save_mode)
15
+ - ✅ ALWAYS focus on discovering WHAT EXISTS
16
+ - ✅ ALWAYS report findings with file paths and line numbers
17
+ - ✅ IF save_mode: ALWAYS use Edit tool to append ALL findings to `{output_dir}/01-analyze.md` BEFORE proceeding
18
+ - 📋 YOU ARE AN EXPLORER, not a planner
19
+ - 💬 FOCUS on "What is here?" NOT "What should we build?"
20
+ - 🚫 FORBIDDEN to suggest implementations or approaches
21
+ - 🚫 FORBIDDEN to skip file saving when save_mode is true
22
+
23
+ ## 🧠 SMART AGENT STRATEGY
24
+
25
+ <critical>
26
+ **ADAPTIVE AGENT LAUNCHING** (unless economy_mode is true)
27
+
28
+ Before exploring, THINK about what information you need and launch the RIGHT agents - between 1 and 10 depending on task complexity.
29
+
30
+ **DO NOT blindly launch all agents. BE SMART.**
31
+ </critical>
32
+
33
+ ## EXECUTION PROTOCOLS:
34
+
35
+ - 🎯 Launch parallel exploration agents (unless economy_mode)
36
+ - 💾 IF save_mode: Use Edit tool to append findings to `{output_dir}/01-analyze.md` AFTER agents complete and BEFORE showing summary
37
+ - 📖 Document patterns with specific file:line references
38
+ - 🚫 FORBIDDEN to proceed until context is complete
39
+ - 🚫 FORBIDDEN to proceed to step-02 without saving findings first (if save_mode)
40
+
41
+ ## CONTEXT BOUNDARIES:
42
+
43
+ - Variables from step-00-init are available
44
+ - No implementation decisions have been made yet
45
+ - Codebase state is unknown - must be discovered
46
+ - Don't assume knowledge about the codebase
47
+
48
+ ## YOUR TASK:
49
+
50
+ Gather ALL relevant context about WHAT CURRENTLY EXISTS in the codebase related to the task.
51
+
52
+ ---
53
+
54
+ <available_state>
55
+ From step-00-init:
56
+
57
+ | Variable | Description |
58
+ |----------|-------------|
59
+ | `{task_description}` | What to implement |
60
+ | `{task_id}` | Kebab-case identifier |
61
+ | `{auto_mode}` | Skip confirmations |
62
+ | `{examine_mode}` | Auto-proceed to review |
63
+ | `{save_mode}` | Save outputs to files |
64
+ | `{test_mode}` | Include test steps |
65
+ | `{economy_mode}` | No subagents, direct tools |
66
+ | `{output_dir}` | Path to output (if save_mode) |
67
+ </available_state>
68
+
69
+ ---
70
+
71
+ ## EXECUTION SEQUENCE:
72
+
73
+ ### 1. Initialize Save Output (if save_mode)
74
+
75
+ **If `{save_mode}` = true:**
76
+
77
+ ```bash
78
+ bash {skill_dir}/scripts/update-progress.sh "{task_id}" "01" "analyze" "in_progress"
79
+ ```
80
+
81
+ Append findings to `{output_dir}/01-analyze.md` as you work.
82
+
83
+ ### 2. Extract Search Keywords
84
+
85
+ From the task description, identify:
86
+ - **Domain terms**: auth, user, payment, etc.
87
+ - **Technical terms**: API, route, component, etc.
88
+ - **Action hints**: create, update, fix, add, etc.
89
+
90
+ These keywords guide exploration - NOT planning.
91
+
92
+ ### 3. Explore Codebase
93
+
94
+ **If `{economy_mode}` = true:**
95
+ → Use direct tools (see step-00b-economy.md for rules)
96
+
97
+ ```
98
+ 1. Glob to find files: **/*{keyword}*
99
+ 2. Grep to search content in likely locations
100
+ 3. Read the most relevant 3-5 files
101
+ 4. Skip online research unless stuck. If needed, use find-docs for technical docs and exa-search for broader web research.
102
+ ```
103
+
104
+ **If `{economy_mode}` = false:**
105
+ → Use SMART agent strategy below
106
+
107
+ ---
108
+
109
+ ### 🧠 STEP 3A: ANALYZE TASK COMPLEXITY
110
+
111
+ **Before launching agents, THINK:**
112
+
113
+ ```
114
+ Task: {task_description}
115
+
116
+ 1. SCOPE: How many areas of the codebase are affected?
117
+ - Single file/function → Low
118
+ - Multiple related files → Medium
119
+ - Cross-cutting concerns → High
120
+
121
+ 2. LIBRARIES: Which external libraries are involved?
122
+ - None or well-known basics → Skip docs
123
+ - Unfamiliar library or specific API needed → Need docs
124
+ - Multiple libraries interacting → Need multiple doc agents
125
+
126
+ 3. PATTERNS: Do I need to understand existing patterns?
127
+ - Simple addition → Maybe skip codebase exploration
128
+ - Must integrate with existing code → Need codebase exploration
129
+
130
+ 4. UNCERTAINTY: What am I unsure about?
131
+ - Clear requirements, known approach → Fewer agents
132
+ - Unclear approach, unfamiliar territory → More agents
133
+ ```
134
+
135
+ ---
136
+
137
+ ### 🎯 STEP 3B: CHOOSE YOUR AGENTS (1-10)
138
+
139
+ **Available Agent Types:**
140
+
141
+ | Agent | Use When |
142
+ |-------|----------|
143
+ | `explore-codebase` | Need to find existing patterns, related files, utilities |
144
+ | `explore-docs` | Unfamiliar library API, current syntax, complex feature. Must use `/Users/melvynx/.agents/skills/find-docs/SKILL.md`, with `/Users/melvynx/.agents/skills/exa-search/SKILL.md` only as fallback for source discovery. |
145
+ | `websearch` | Common approaches, best practices, gotchas, recent context. Must use `/Users/melvynx/.agents/skills/exa-search/SKILL.md`, with `/Users/melvynx/.agents/skills/find-docs/SKILL.md` first for technical docs. |
146
+
147
+ **Decision Matrix:**
148
+
149
+ | Task Type | Agents Needed | Example |
150
+ |-----------|---------------|---------|
151
+ | **Simple fix** | 1-2 | Bug fix in known file → 1x explore-codebase |
152
+ | **Add feature (familiar stack)** | 2-3 | Add button → 1x explore-codebase + 1x websearch |
153
+ | **Add feature (unfamiliar library)** | 3-5 | Add Stripe → 1x codebase + 1x explore-docs (Stripe) + 1x websearch |
154
+ | **Complex integration** | 5-8 | Auth + payments → 1x codebase + 2-3x explore-docs + 1-2x websearch |
155
+ | **Major feature (multiple systems)** | 6-10 | Full e-commerce → Multiple codebase areas + multiple docs + research |
156
+
157
+ ---
158
+
159
+ ### 🚀 STEP 3C: LAUNCH AGENTS IN PARALLEL
160
+
161
+ **Launch ALL chosen agents in ONE message.**
162
+
163
+ **Agent Prompts:**
164
+
165
+ **`explore-codebase`** - Use for finding existing code:
166
+ ```
167
+ Find existing code related to: {specific_area}
168
+
169
+ Report:
170
+ 1. Files with paths and line numbers
171
+ 2. Patterns used for similar features
172
+ 3. Relevant utilities
173
+ 4. Test patterns
174
+
175
+ DO NOT suggest implementations.
176
+ ```
177
+
178
+ **`explore-docs`** - Use ONLY when you need specific library knowledge:
179
+ ```
180
+ Research {library_name} documentation for: {specific_question}
181
+
182
+ Find:
183
+ 1. Current API for {specific_feature}
184
+ 2. Code examples
185
+ 3. Configuration needed
186
+
187
+ Required tool routing:
188
+ - Use /Users/melvynx/.agents/skills/find-docs/SKILL.md first.
189
+ - Use /Users/melvynx/.agents/skills/exa-search/SKILL.md only if docs are missing or broader source discovery is needed.
190
+ ```
191
+
192
+ **`websearch`** - Use for approaches and gotchas:
193
+ ```
194
+ Search: {specific_question_or_approach}
195
+
196
+ Find common patterns and pitfalls.
197
+
198
+ Required tool routing:
199
+ - Use /Users/melvynx/.agents/skills/exa-search/SKILL.md first.
200
+ - Use /Users/melvynx/.agents/skills/find-docs/SKILL.md first instead when the question is about a specific library, framework, SDK, CLI, cloud service, API, or code example.
201
+ ```
202
+
203
+ ---
204
+
205
+ ### 📋 EXAMPLE AGENT LAUNCHES
206
+
207
+ **Simple task** (fix button styling) → 1 agent:
208
+ ```
209
+ [Sub-agent: explore-codebase - find button components and styling patterns]
210
+ ```
211
+
212
+ **Medium task** (add user profile page) → 3 agents:
213
+ ```
214
+ [Sub-agent: explore-codebase - find user-related components and data fetching patterns]
215
+ [Sub-agent: explore-codebase - find page layout and routing patterns]
216
+ [Sub-agent: websearch - Next.js profile page best practices]
217
+ ```
218
+
219
+ **Complex task** (add Stripe subscriptions) → 6 agents:
220
+ ```
221
+ [Sub-agent: explore-codebase - find existing payment/billing code]
222
+ [Sub-agent: explore-codebase - find user account and settings patterns]
223
+ [Sub-agent: explore-docs - Stripe subscription API and webhooks]
224
+ [Sub-agent: explore-docs - Stripe Customer Portal integration]
225
+ [Sub-agent: websearch - Stripe subscriptions Next.js implementation]
226
+ [Sub-agent: websearch - Stripe webhook security best practices]
227
+ ```
228
+
229
+ ### 4. Synthesize Findings + Save to File
230
+
231
+ <critical>
232
+ **IF `{save_mode}` = true: You MUST write findings to the file BEFORE presenting the summary or proceeding.**
233
+ This is the most commonly skipped step. DO NOT skip it.
234
+ </critical>
235
+
236
+ Combine all agent results into structured context using this format:
237
+
238
+ ```markdown
239
+ ## Codebase Context
240
+
241
+ ### Related Files Found
242
+ | File | Lines | Contains |
243
+ |------|-------|----------|
244
+ | `src/auth/login.ts` | 1-150 | Existing login implementation |
245
+ | `src/utils/validate.ts` | 20-45 | Email validation helper |
246
+
247
+ ### Patterns Observed
248
+ - **Route pattern**: Uses Next.js App Router with `route.ts`
249
+ - **Validation**: Uses zod schemas in `schemas/` folder
250
+ - **Error handling**: Throws custom ApiError classes
251
+
252
+ ### Utilities Available
253
+ - `src/lib/auth.ts` - JWT sign/verify functions
254
+ - `src/lib/db.ts` - Prisma client instance
255
+
256
+ ### Similar Implementations
257
+ - `src/auth/login.ts:42` - Login flow (reference for patterns)
258
+
259
+ ### Test Patterns
260
+ - Tests in `__tests__/` folders
261
+ - Uses vitest with testing-library
262
+
263
+ ## Documentation Insights
264
+
265
+ ### Libraries Used
266
+ - **jose**: JWT library - uses `SignJWT` class
267
+ - **prisma**: ORM - uses `prisma.user.create()` pattern
268
+
269
+ ## Research Findings
270
+
271
+ ### Common Approaches
272
+ - Registration: validate → hash → create → issue token
273
+ - Use httpOnly cookies for tokens
274
+ ```
275
+
276
+ **IF `{save_mode}` = true (MANDATORY - DO THIS NOW):**
277
+
278
+ Use the **Edit tool** to append the full synthesis to `{output_dir}/01-analyze.md`. Replace the placeholder text `_Findings will be appended here as exploration progresses..._` with all the structured findings above.
279
+
280
+ ### 5. Infer Acceptance Criteria
281
+
282
+ Based on task and context, infer success criteria:
283
+
284
+ ```markdown
285
+ ## Inferred Acceptance Criteria
286
+
287
+ Based on "{task_description}" and existing patterns:
288
+
289
+ - [ ] AC1: [specific measurable outcome]
290
+ - [ ] AC2: [specific measurable outcome]
291
+ - [ ] AC3: [specific measurable outcome]
292
+
293
+ _These will be refined in the planning step._
294
+ ```
295
+
296
+ **If `{save_mode}` = true:** Append acceptance criteria to `{output_dir}/01-analyze.md` using Edit tool.
297
+
298
+ ### 6. Complete Save Output (if save_mode)
299
+
300
+ <critical>
301
+ **This step MUST happen BEFORE presenting the summary to the user.**
302
+ The file must already contain all findings before you proceed.
303
+ </critical>
304
+
305
+ **If `{save_mode}` = true:**
306
+
307
+ 1. Verify `{output_dir}/01-analyze.md` contains the full analysis (Read it to confirm)
308
+ 2. Update progress:
309
+
310
+ ```bash
311
+ bash {skill_dir}/scripts/update-progress.sh "{task_id}" "01" "analyze" "complete"
312
+ bash {skill_dir}/scripts/update-progress.sh "{task_id}" "02" "plan" "in_progress"
313
+ ```
314
+
315
+ ### 7. Present Context Summary
316
+
317
+ **Always (regardless of auto_mode):**
318
+
319
+ Present summary and proceed directly to planning:
320
+
321
+ ```
322
+ **Context Gathering Complete**
323
+
324
+ **Files analyzed:** {count}
325
+ **Patterns identified:** {count}
326
+ **Utilities found:** {count}
327
+
328
+ **Key findings:**
329
+ - {summary of relevant files}
330
+ - {patterns that will guide implementation}
331
+
332
+ → Proceeding to planning phase...
333
+ ```
334
+
335
+ <critical>
336
+ Do NOT ask for user confirmation here - always proceed directly to step-02-plan.
337
+ </critical>
338
+
339
+ ---
340
+
341
+ ## SUCCESS METRICS:
342
+
343
+ ✅ Related files identified with paths and line numbers
344
+ ✅ Existing patterns documented with specific examples
345
+ ✅ Available utilities noted
346
+ ✅ Dependencies listed
347
+ ✅ Acceptance criteria inferred
348
+ ✅ NO planning or implementation decisions made
349
+ ✅ Output saved (if save_mode)
350
+ ✅ Task complexity analyzed BEFORE launching agents
351
+ ✅ Right NUMBER of agents launched (1-10 based on complexity)
352
+ ✅ Right TYPE of agents chosen for the task
353
+ ✅ All agents launched in PARALLEL (single message)
354
+
355
+ ## FAILURE MODES:
356
+
357
+ ❌ **CRITICAL**: Skipping file save when save_mode is true (proceeding to plan without writing to 01-analyze.md)
358
+ ❌ Starting to plan or design (that's step 2!)
359
+ ❌ Suggesting implementations or approaches
360
+ ❌ Missing obvious related files
361
+ ❌ Not documenting patterns with file:line references
362
+ ❌ Launching agents sequentially instead of parallel
363
+ ❌ Using subagents when economy_mode is true
364
+ ❌ **CRITICAL**: Blocking workflow with unnecessary confirmation prompts
365
+ ❌ Launching too many agents for a simple task (wasteful)
366
+ ❌ Launching too few agents for a complex task (insufficient context)
367
+ ❌ Not analyzing task complexity before choosing agents
368
+ ❌ Skipping `explore-docs` when genuinely unfamiliar with a library API
369
+
370
+ ## ANALYZE PROTOCOLS:
371
+
372
+ - This step is ONLY about discovery
373
+ - Report what EXISTS, not what SHOULD BE
374
+ - Include file paths and line numbers for all findings
375
+ - Don't assume - verify by reading files
376
+ - In economy mode, use direct tools only
377
+
378
+ ---
379
+
380
+ ## NEXT STEP:
381
+
382
+ Always proceed directly to `./step-02-plan.md` after presenting context summary.
383
+
384
+ <critical>
385
+ Remember: Analysis is ONLY about "What exists?" - save all planning for step-02!
386
+ Do NOT ask for confirmation - proceed directly!
387
+ IF save_mode = true: The 01-analyze.md file MUST contain all findings BEFORE you load step-02-plan.md.
388
+ </critical>