@howlil/ez-agents 2.0.0

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 (183) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +845 -0
  3. package/README.zh-CN.md +702 -0
  4. package/agents/ez-codebase-mapper.md +770 -0
  5. package/agents/ez-debugger.md +1255 -0
  6. package/agents/ez-executor.md +487 -0
  7. package/agents/ez-integration-checker.md +443 -0
  8. package/agents/ez-nyquist-auditor.md +176 -0
  9. package/agents/ez-phase-researcher.md +553 -0
  10. package/agents/ez-plan-checker.md +706 -0
  11. package/agents/ez-planner.md +1307 -0
  12. package/agents/ez-project-researcher.md +629 -0
  13. package/agents/ez-research-synthesizer.md +247 -0
  14. package/agents/ez-roadmapper.md +650 -0
  15. package/agents/ez-ui-auditor.md +441 -0
  16. package/agents/ez-ui-checker.md +302 -0
  17. package/agents/ez-ui-researcher.md +355 -0
  18. package/agents/ez-verifier.md +579 -0
  19. package/bin/install.js +2862 -0
  20. package/bin/update.js +214 -0
  21. package/commands/ez/add-phase.md +43 -0
  22. package/commands/ez/add-tests.md +41 -0
  23. package/commands/ez/add-todo.md +47 -0
  24. package/commands/ez/audit-milestone.md +36 -0
  25. package/commands/ez/autonomous.md +41 -0
  26. package/commands/ez/check-todos.md +45 -0
  27. package/commands/ez/cleanup.md +18 -0
  28. package/commands/ez/complete-milestone.md +136 -0
  29. package/commands/ez/debug.md +168 -0
  30. package/commands/ez/discuss-phase.md +90 -0
  31. package/commands/ez/execute-phase.md +41 -0
  32. package/commands/ez/health.md +22 -0
  33. package/commands/ez/help.md +22 -0
  34. package/commands/ez/insert-phase.md +32 -0
  35. package/commands/ez/join-discord.md +18 -0
  36. package/commands/ez/list-phase-assumptions.md +46 -0
  37. package/commands/ez/map-codebase.md +71 -0
  38. package/commands/ez/new-milestone.md +44 -0
  39. package/commands/ez/new-project.md +42 -0
  40. package/commands/ez/pause-work.md +38 -0
  41. package/commands/ez/plan-milestone-gaps.md +34 -0
  42. package/commands/ez/plan-phase.md +45 -0
  43. package/commands/ez/progress.md +24 -0
  44. package/commands/ez/quick.md +45 -0
  45. package/commands/ez/reapply-patches.md +124 -0
  46. package/commands/ez/remove-phase.md +31 -0
  47. package/commands/ez/research-phase.md +190 -0
  48. package/commands/ez/resume-work.md +40 -0
  49. package/commands/ez/set-profile.md +34 -0
  50. package/commands/ez/settings.md +36 -0
  51. package/commands/ez/stats.md +18 -0
  52. package/commands/ez/ui-phase.md +34 -0
  53. package/commands/ez/ui-review.md +32 -0
  54. package/commands/ez/update.md +37 -0
  55. package/commands/ez/validate-phase.md +35 -0
  56. package/commands/ez/verify-work.md +38 -0
  57. package/get-shit-done/bin/ez-tools.cjs +598 -0
  58. package/get-shit-done/bin/lib/assistant-adapter.cjs +205 -0
  59. package/get-shit-done/bin/lib/audit-exec.cjs +150 -0
  60. package/get-shit-done/bin/lib/auth.cjs +175 -0
  61. package/get-shit-done/bin/lib/circuit-breaker.cjs +118 -0
  62. package/get-shit-done/bin/lib/commands.cjs +666 -0
  63. package/get-shit-done/bin/lib/config.cjs +183 -0
  64. package/get-shit-done/bin/lib/core.cjs +495 -0
  65. package/get-shit-done/bin/lib/file-lock.cjs +236 -0
  66. package/get-shit-done/bin/lib/frontmatter.cjs +299 -0
  67. package/get-shit-done/bin/lib/fs-utils.cjs +153 -0
  68. package/get-shit-done/bin/lib/git-utils.cjs +203 -0
  69. package/get-shit-done/bin/lib/health-check.cjs +163 -0
  70. package/get-shit-done/bin/lib/index.cjs +113 -0
  71. package/get-shit-done/bin/lib/init.cjs +710 -0
  72. package/get-shit-done/bin/lib/logger.cjs +117 -0
  73. package/get-shit-done/bin/lib/milestone.cjs +241 -0
  74. package/get-shit-done/bin/lib/model-provider.cjs +146 -0
  75. package/get-shit-done/bin/lib/phase.cjs +908 -0
  76. package/get-shit-done/bin/lib/retry.cjs +119 -0
  77. package/get-shit-done/bin/lib/roadmap.cjs +305 -0
  78. package/get-shit-done/bin/lib/safe-exec.cjs +128 -0
  79. package/get-shit-done/bin/lib/safe-path.cjs +130 -0
  80. package/get-shit-done/bin/lib/state.cjs +721 -0
  81. package/get-shit-done/bin/lib/temp-file.cjs +239 -0
  82. package/get-shit-done/bin/lib/template.cjs +222 -0
  83. package/get-shit-done/bin/lib/test-file-lock.cjs +112 -0
  84. package/get-shit-done/bin/lib/test-graceful.cjs +93 -0
  85. package/get-shit-done/bin/lib/test-logger.cjs +60 -0
  86. package/get-shit-done/bin/lib/test-safe-exec.cjs +38 -0
  87. package/get-shit-done/bin/lib/test-safe-path.cjs +33 -0
  88. package/get-shit-done/bin/lib/test-temp-file.cjs +125 -0
  89. package/get-shit-done/bin/lib/timeout-exec.cjs +62 -0
  90. package/get-shit-done/bin/lib/verify.cjs +820 -0
  91. package/get-shit-done/references/checkpoints.md +776 -0
  92. package/get-shit-done/references/continuation-format.md +249 -0
  93. package/get-shit-done/references/decimal-phase-calculation.md +65 -0
  94. package/get-shit-done/references/git-integration.md +248 -0
  95. package/get-shit-done/references/git-planning-commit.md +38 -0
  96. package/get-shit-done/references/model-profile-resolution.md +34 -0
  97. package/get-shit-done/references/model-profiles.md +93 -0
  98. package/get-shit-done/references/phase-argument-parsing.md +61 -0
  99. package/get-shit-done/references/planning-config.md +200 -0
  100. package/get-shit-done/references/questioning.md +162 -0
  101. package/get-shit-done/references/tdd.md +263 -0
  102. package/get-shit-done/references/ui-brand.md +160 -0
  103. package/get-shit-done/references/verification-patterns.md +612 -0
  104. package/get-shit-done/templates/DEBUG.md +164 -0
  105. package/get-shit-done/templates/UAT.md +247 -0
  106. package/get-shit-done/templates/UI-SPEC.md +100 -0
  107. package/get-shit-done/templates/VALIDATION.md +76 -0
  108. package/get-shit-done/templates/codebase/architecture.md +255 -0
  109. package/get-shit-done/templates/codebase/concerns.md +310 -0
  110. package/get-shit-done/templates/codebase/conventions.md +307 -0
  111. package/get-shit-done/templates/codebase/integrations.md +280 -0
  112. package/get-shit-done/templates/codebase/stack.md +186 -0
  113. package/get-shit-done/templates/codebase/structure.md +285 -0
  114. package/get-shit-done/templates/codebase/testing.md +480 -0
  115. package/get-shit-done/templates/config.json +37 -0
  116. package/get-shit-done/templates/context.md +352 -0
  117. package/get-shit-done/templates/continue-here.md +78 -0
  118. package/get-shit-done/templates/copilot-instructions.md +7 -0
  119. package/get-shit-done/templates/debug-subagent-prompt.md +91 -0
  120. package/get-shit-done/templates/discovery.md +146 -0
  121. package/get-shit-done/templates/milestone-archive.md +123 -0
  122. package/get-shit-done/templates/milestone.md +115 -0
  123. package/get-shit-done/templates/phase-prompt.md +610 -0
  124. package/get-shit-done/templates/planner-subagent-prompt.md +117 -0
  125. package/get-shit-done/templates/project.md +184 -0
  126. package/get-shit-done/templates/requirements.md +231 -0
  127. package/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
  128. package/get-shit-done/templates/research-project/FEATURES.md +147 -0
  129. package/get-shit-done/templates/research-project/PITFALLS.md +200 -0
  130. package/get-shit-done/templates/research-project/STACK.md +120 -0
  131. package/get-shit-done/templates/research-project/SUMMARY.md +170 -0
  132. package/get-shit-done/templates/research.md +552 -0
  133. package/get-shit-done/templates/retrospective.md +54 -0
  134. package/get-shit-done/templates/roadmap.md +202 -0
  135. package/get-shit-done/templates/state.md +176 -0
  136. package/get-shit-done/templates/summary-complex.md +59 -0
  137. package/get-shit-done/templates/summary-minimal.md +41 -0
  138. package/get-shit-done/templates/summary-standard.md +48 -0
  139. package/get-shit-done/templates/summary.md +248 -0
  140. package/get-shit-done/templates/user-setup.md +311 -0
  141. package/get-shit-done/templates/verification-report.md +322 -0
  142. package/get-shit-done/workflows/add-phase.md +112 -0
  143. package/get-shit-done/workflows/add-tests.md +351 -0
  144. package/get-shit-done/workflows/add-todo.md +158 -0
  145. package/get-shit-done/workflows/audit-milestone.md +332 -0
  146. package/get-shit-done/workflows/autonomous.md +743 -0
  147. package/get-shit-done/workflows/check-todos.md +177 -0
  148. package/get-shit-done/workflows/cleanup.md +152 -0
  149. package/get-shit-done/workflows/complete-milestone.md +766 -0
  150. package/get-shit-done/workflows/diagnose-issues.md +219 -0
  151. package/get-shit-done/workflows/discovery-phase.md +289 -0
  152. package/get-shit-done/workflows/discuss-phase.md +762 -0
  153. package/get-shit-done/workflows/execute-phase.md +468 -0
  154. package/get-shit-done/workflows/execute-plan.md +483 -0
  155. package/get-shit-done/workflows/health.md +159 -0
  156. package/get-shit-done/workflows/help.md +492 -0
  157. package/get-shit-done/workflows/insert-phase.md +130 -0
  158. package/get-shit-done/workflows/list-phase-assumptions.md +178 -0
  159. package/get-shit-done/workflows/map-codebase.md +316 -0
  160. package/get-shit-done/workflows/new-milestone.md +384 -0
  161. package/get-shit-done/workflows/new-project.md +1111 -0
  162. package/get-shit-done/workflows/node-repair.md +92 -0
  163. package/get-shit-done/workflows/pause-work.md +122 -0
  164. package/get-shit-done/workflows/plan-milestone-gaps.md +274 -0
  165. package/get-shit-done/workflows/plan-phase.md +651 -0
  166. package/get-shit-done/workflows/progress.md +382 -0
  167. package/get-shit-done/workflows/quick.md +610 -0
  168. package/get-shit-done/workflows/remove-phase.md +155 -0
  169. package/get-shit-done/workflows/research-phase.md +74 -0
  170. package/get-shit-done/workflows/resume-project.md +307 -0
  171. package/get-shit-done/workflows/set-profile.md +81 -0
  172. package/get-shit-done/workflows/settings.md +242 -0
  173. package/get-shit-done/workflows/stats.md +57 -0
  174. package/get-shit-done/workflows/transition.md +544 -0
  175. package/get-shit-done/workflows/ui-phase.md +290 -0
  176. package/get-shit-done/workflows/ui-review.md +157 -0
  177. package/get-shit-done/workflows/update.md +320 -0
  178. package/get-shit-done/workflows/validate-phase.md +167 -0
  179. package/get-shit-done/workflows/verify-phase.md +243 -0
  180. package/get-shit-done/workflows/verify-work.md +584 -0
  181. package/package.json +55 -0
  182. package/scripts/build-hooks.js +43 -0
  183. package/scripts/run-tests.cjs +29 -0
@@ -0,0 +1,178 @@
1
+ <purpose>
2
+ Surface Claude's assumptions about a phase before planning, enabling users to correct misconceptions early.
3
+
4
+ Key difference from discuss-phase: This is ANALYSIS of what Claude thinks, not INTAKE of what user knows. No file output - purely conversational to prompt discussion.
5
+ </purpose>
6
+
7
+ <process>
8
+
9
+ <step name="validate_phase" priority="first">
10
+ Phase number: $ARGUMENTS (required)
11
+
12
+ **If argument missing:**
13
+
14
+ ```
15
+ Error: Phase number required.
16
+
17
+ Usage: /ez:list-phase-assumptions [phase-number]
18
+ Example: /ez:list-phase-assumptions 3
19
+ ```
20
+
21
+ Exit workflow.
22
+
23
+ **If argument provided:**
24
+ Validate phase exists in roadmap:
25
+
26
+ ```bash
27
+ cat .planning/ROADMAP.md | grep -i "Phase ${PHASE}"
28
+ ```
29
+
30
+ **If phase not found:**
31
+
32
+ ```
33
+ Error: Phase ${PHASE} not found in roadmap.
34
+
35
+ Available phases:
36
+ [list phases from roadmap]
37
+ ```
38
+
39
+ Exit workflow.
40
+
41
+ **If phase found:**
42
+ Parse phase details from roadmap:
43
+
44
+ - Phase number
45
+ - Phase name
46
+ - Phase description/goal
47
+ - Any scope details mentioned
48
+
49
+ Continue to analyze_phase.
50
+ </step>
51
+
52
+ <step name="analyze_phase">
53
+ Based on roadmap description and project context, identify assumptions across five areas:
54
+
55
+ **1. Technical Approach:**
56
+ What libraries, frameworks, patterns, or tools would Claude use?
57
+ - "I'd use X library because..."
58
+ - "I'd follow Y pattern because..."
59
+ - "I'd structure this as Z because..."
60
+
61
+ **2. Implementation Order:**
62
+ What would Claude build first, second, third?
63
+ - "I'd start with X because it's foundational"
64
+ - "Then Y because it depends on X"
65
+ - "Finally Z because..."
66
+
67
+ **3. Scope Boundaries:**
68
+ What's included vs excluded in Claude's interpretation?
69
+ - "This phase includes: A, B, C"
70
+ - "This phase does NOT include: D, E, F"
71
+ - "Boundary ambiguities: G could go either way"
72
+
73
+ **4. Risk Areas:**
74
+ Where does Claude expect complexity or challenges?
75
+ - "The tricky part is X because..."
76
+ - "Potential issues: Y, Z"
77
+ - "I'd watch out for..."
78
+
79
+ **5. Dependencies:**
80
+ What does Claude assume exists or needs to be in place?
81
+ - "This assumes X from previous phases"
82
+ - "External dependencies: Y, Z"
83
+ - "This will be consumed by..."
84
+
85
+ Be honest about uncertainty. Mark assumptions with confidence levels:
86
+ - "Fairly confident: ..." (clear from roadmap)
87
+ - "Assuming: ..." (reasonable inference)
88
+ - "Unclear: ..." (could go multiple ways)
89
+ </step>
90
+
91
+ <step name="present_assumptions">
92
+ Present assumptions in a clear, scannable format:
93
+
94
+ ```
95
+ ## My Assumptions for Phase ${PHASE}: ${PHASE_NAME}
96
+
97
+ ### Technical Approach
98
+ [List assumptions about how to implement]
99
+
100
+ ### Implementation Order
101
+ [List assumptions about sequencing]
102
+
103
+ ### Scope Boundaries
104
+ **In scope:** [what's included]
105
+ **Out of scope:** [what's excluded]
106
+ **Ambiguous:** [what could go either way]
107
+
108
+ ### Risk Areas
109
+ [List anticipated challenges]
110
+
111
+ ### Dependencies
112
+ **From prior phases:** [what's needed]
113
+ **External:** [third-party needs]
114
+ **Feeds into:** [what future phases need from this]
115
+
116
+ ---
117
+
118
+ **What do you think?**
119
+
120
+ Are these assumptions accurate? Let me know:
121
+ - What I got right
122
+ - What I got wrong
123
+ - What I'm missing
124
+ ```
125
+
126
+ Wait for user response.
127
+ </step>
128
+
129
+ <step name="gather_feedback">
130
+ **If user provides corrections:**
131
+
132
+ Acknowledge the corrections:
133
+
134
+ ```
135
+ Key corrections:
136
+ - [correction 1]
137
+ - [correction 2]
138
+
139
+ This changes my understanding significantly. [Summarize new understanding]
140
+ ```
141
+
142
+ **If user confirms assumptions:**
143
+
144
+ ```
145
+ Assumptions validated.
146
+ ```
147
+
148
+ Continue to offer_next.
149
+ </step>
150
+
151
+ <step name="offer_next">
152
+ Present next steps:
153
+
154
+ ```
155
+ What's next?
156
+ 1. Discuss context (/ez:discuss-phase ${PHASE}) - Let me ask you questions to build comprehensive context
157
+ 2. Plan this phase (/ez:plan-phase ${PHASE}) - Create detailed execution plans
158
+ 3. Re-examine assumptions - I'll analyze again with your corrections
159
+ 4. Done for now
160
+ ```
161
+
162
+ Wait for user selection.
163
+
164
+ If "Discuss context": Note that CONTEXT.md will incorporate any corrections discussed here
165
+ If "Plan this phase": Proceed knowing assumptions are understood
166
+ If "Re-examine": Return to analyze_phase with updated understanding
167
+ </step>
168
+
169
+ </process>
170
+
171
+ <success_criteria>
172
+ - Phase number validated against roadmap
173
+ - Assumptions surfaced across five areas: technical approach, implementation order, scope, risks, dependencies
174
+ - Confidence levels marked where appropriate
175
+ - "What do you think?" prompt presented
176
+ - User feedback acknowledged
177
+ - Clear next steps offered
178
+ </success_criteria>
@@ -0,0 +1,316 @@
1
+ <purpose>
2
+ Orchestrate parallel codebase mapper agents to analyze codebase and produce structured documents in .planning/codebase/
3
+
4
+ Each agent has fresh context, explores a specific focus area, and **writes documents directly**. The orchestrator only receives confirmation + line counts, then writes a summary.
5
+
6
+ Output: .planning/codebase/ folder with 7 structured documents about the codebase state.
7
+ </purpose>
8
+
9
+ <philosophy>
10
+ **Why dedicated mapper agents:**
11
+ - Fresh context per domain (no token contamination)
12
+ - Agents write documents directly (no context transfer back to orchestrator)
13
+ - Orchestrator only summarizes what was created (minimal context usage)
14
+ - Faster execution (agents run simultaneously)
15
+
16
+ **Document quality over length:**
17
+ Include enough detail to be useful as reference. Prioritize practical examples (especially code patterns) over arbitrary brevity.
18
+
19
+ **Always include file paths:**
20
+ Documents are reference material for Claude when planning/executing. Always include actual file paths formatted with backticks: `src/services/user.ts`.
21
+ </philosophy>
22
+
23
+ <process>
24
+
25
+ <step name="init_context" priority="first">
26
+ Load codebase mapping context:
27
+
28
+ ```bash
29
+ INIT=$(node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" init map-codebase)
30
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
31
+ ```
32
+
33
+ Extract from init JSON: `mapper_model`, `commit_docs`, `codebase_dir`, `existing_maps`, `has_maps`, `codebase_dir_exists`.
34
+ </step>
35
+
36
+ <step name="check_existing">
37
+ Check if .planning/codebase/ already exists using `has_maps` from init context.
38
+
39
+ If `codebase_dir_exists` is true:
40
+ ```bash
41
+ ls -la .planning/codebase/
42
+ ```
43
+
44
+ **If exists:**
45
+
46
+ ```
47
+ .planning/codebase/ already exists with these documents:
48
+ [List files found]
49
+
50
+ What's next?
51
+ 1. Refresh - Delete existing and remap codebase
52
+ 2. Update - Keep existing, only update specific documents
53
+ 3. Skip - Use existing codebase map as-is
54
+ ```
55
+
56
+ Wait for user response.
57
+
58
+ If "Refresh": Delete .planning/codebase/, continue to create_structure
59
+ If "Update": Ask which documents to update, continue to spawn_agents (filtered)
60
+ If "Skip": Exit workflow
61
+
62
+ **If doesn't exist:**
63
+ Continue to create_structure.
64
+ </step>
65
+
66
+ <step name="create_structure">
67
+ Create .planning/codebase/ directory:
68
+
69
+ ```bash
70
+ mkdir -p .planning/codebase
71
+ ```
72
+
73
+ **Expected output files:**
74
+ - STACK.md (from tech mapper)
75
+ - INTEGRATIONS.md (from tech mapper)
76
+ - ARCHITECTURE.md (from arch mapper)
77
+ - STRUCTURE.md (from arch mapper)
78
+ - CONVENTIONS.md (from quality mapper)
79
+ - TESTING.md (from quality mapper)
80
+ - CONCERNS.md (from concerns mapper)
81
+
82
+ Continue to spawn_agents.
83
+ </step>
84
+
85
+ <step name="spawn_agents">
86
+ Spawn 4 parallel gsd-codebase-mapper agents.
87
+
88
+ Use Task tool with `subagent_type="ez-codebase-mapper"`, `model="{mapper_model}"`, and `run_in_background=true` for parallel execution.
89
+
90
+ **CRITICAL:** Use the dedicated `gsd-codebase-mapper` agent, NOT `Explore`. The mapper agent writes documents directly.
91
+
92
+ **Agent 1: Tech Focus**
93
+
94
+ ```
95
+ Task(
96
+ subagent_type="ez-codebase-mapper",
97
+ model="{mapper_model}",
98
+ run_in_background=true,
99
+ description="Map codebase tech stack",
100
+ prompt="Focus: tech
101
+
102
+ Analyze this codebase for technology stack and external integrations.
103
+
104
+ Write these documents to .planning/codebase/:
105
+ - STACK.md - Languages, runtime, frameworks, dependencies, configuration
106
+ - INTEGRATIONS.md - External APIs, databases, auth providers, webhooks
107
+
108
+ Explore thoroughly. Write documents directly using templates. Return confirmation only."
109
+ )
110
+ ```
111
+
112
+ **Agent 2: Architecture Focus**
113
+
114
+ ```
115
+ Task(
116
+ subagent_type="ez-codebase-mapper",
117
+ model="{mapper_model}",
118
+ run_in_background=true,
119
+ description="Map codebase architecture",
120
+ prompt="Focus: arch
121
+
122
+ Analyze this codebase architecture and directory structure.
123
+
124
+ Write these documents to .planning/codebase/:
125
+ - ARCHITECTURE.md - Pattern, layers, data flow, abstractions, entry points
126
+ - STRUCTURE.md - Directory layout, key locations, naming conventions
127
+
128
+ Explore thoroughly. Write documents directly using templates. Return confirmation only."
129
+ )
130
+ ```
131
+
132
+ **Agent 3: Quality Focus**
133
+
134
+ ```
135
+ Task(
136
+ subagent_type="ez-codebase-mapper",
137
+ model="{mapper_model}",
138
+ run_in_background=true,
139
+ description="Map codebase conventions",
140
+ prompt="Focus: quality
141
+
142
+ Analyze this codebase for coding conventions and testing patterns.
143
+
144
+ Write these documents to .planning/codebase/:
145
+ - CONVENTIONS.md - Code style, naming, patterns, error handling
146
+ - TESTING.md - Framework, structure, mocking, coverage
147
+
148
+ Explore thoroughly. Write documents directly using templates. Return confirmation only."
149
+ )
150
+ ```
151
+
152
+ **Agent 4: Concerns Focus**
153
+
154
+ ```
155
+ Task(
156
+ subagent_type="ez-codebase-mapper",
157
+ model="{mapper_model}",
158
+ run_in_background=true,
159
+ description="Map codebase concerns",
160
+ prompt="Focus: concerns
161
+
162
+ Analyze this codebase for technical debt, known issues, and areas of concern.
163
+
164
+ Write this document to .planning/codebase/:
165
+ - CONCERNS.md - Tech debt, bugs, security, performance, fragile areas
166
+
167
+ Explore thoroughly. Write document directly using template. Return confirmation only."
168
+ )
169
+ ```
170
+
171
+ Continue to collect_confirmations.
172
+ </step>
173
+
174
+ <step name="collect_confirmations">
175
+ Wait for all 4 agents to complete.
176
+
177
+ Read each agent's output file to collect confirmations.
178
+
179
+ **Expected confirmation format from each agent:**
180
+ ```
181
+ ## Mapping Complete
182
+
183
+ **Focus:** {focus}
184
+ **Documents written:**
185
+ - `.planning/codebase/{DOC1}.md` ({N} lines)
186
+ - `.planning/codebase/{DOC2}.md` ({N} lines)
187
+
188
+ Ready for orchestrator summary.
189
+ ```
190
+
191
+ **What you receive:** Just file paths and line counts. NOT document contents.
192
+
193
+ If any agent failed, note the failure and continue with successful documents.
194
+
195
+ Continue to verify_output.
196
+ </step>
197
+
198
+ <step name="verify_output">
199
+ Verify all documents created successfully:
200
+
201
+ ```bash
202
+ ls -la .planning/codebase/
203
+ wc -l .planning/codebase/*.md
204
+ ```
205
+
206
+ **Verification checklist:**
207
+ - All 7 documents exist
208
+ - No empty documents (each should have >20 lines)
209
+
210
+ If any documents missing or empty, note which agents may have failed.
211
+
212
+ Continue to scan_for_secrets.
213
+ </step>
214
+
215
+ <step name="scan_for_secrets">
216
+ **CRITICAL SECURITY CHECK:** Scan output files for accidentally leaked secrets before committing.
217
+
218
+ Run secret pattern detection:
219
+
220
+ ```bash
221
+ # Check for common API key patterns in generated docs
222
+ grep -E '(sk-[a-zA-Z0-9]{20,}|sk_live_[a-zA-Z0-9]+|sk_test_[a-zA-Z0-9]+|ghp_[a-zA-Z0-9]{36}|gho_[a-zA-Z0-9]{36}|glpat-[a-zA-Z0-9_-]+|AKIA[A-Z0-9]{16}|xox[baprs]-[a-zA-Z0-9-]+|-----BEGIN.*PRIVATE KEY|eyJ[a-zA-Z0-9_-]+\.eyJ[a-zA-Z0-9_-]+\.)' .planning/codebase/*.md 2>/dev/null && SECRETS_FOUND=true || SECRETS_FOUND=false
223
+ ```
224
+
225
+ **If SECRETS_FOUND=true:**
226
+
227
+ ```
228
+ ⚠️ SECURITY ALERT: Potential secrets detected in codebase documents!
229
+
230
+ Found patterns that look like API keys or tokens in:
231
+ [show grep output]
232
+
233
+ This would expose credentials if committed.
234
+
235
+ **Action required:**
236
+ 1. Review the flagged content above
237
+ 2. If these are real secrets, they must be removed before committing
238
+ 3. Consider adding sensitive files to Claude Code "Deny" permissions
239
+
240
+ Pausing before commit. Reply "safe to proceed" if the flagged content is not actually sensitive, or edit the files first.
241
+ ```
242
+
243
+ Wait for user confirmation before continuing to commit_codebase_map.
244
+
245
+ **If SECRETS_FOUND=false:**
246
+
247
+ Continue to commit_codebase_map.
248
+ </step>
249
+
250
+ <step name="commit_codebase_map">
251
+ Commit the codebase map:
252
+
253
+ ```bash
254
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "docs: map existing codebase" --files .planning/codebase/*.md
255
+ ```
256
+
257
+ Continue to offer_next.
258
+ </step>
259
+
260
+ <step name="offer_next">
261
+ Present completion summary and next steps.
262
+
263
+ **Get line counts:**
264
+ ```bash
265
+ wc -l .planning/codebase/*.md
266
+ ```
267
+
268
+ **Output format:**
269
+
270
+ ```
271
+ Codebase mapping complete.
272
+
273
+ Created .planning/codebase/:
274
+ - STACK.md ([N] lines) - Technologies and dependencies
275
+ - ARCHITECTURE.md ([N] lines) - System design and patterns
276
+ - STRUCTURE.md ([N] lines) - Directory layout and organization
277
+ - CONVENTIONS.md ([N] lines) - Code style and patterns
278
+ - TESTING.md ([N] lines) - Test structure and practices
279
+ - INTEGRATIONS.md ([N] lines) - External services and APIs
280
+ - CONCERNS.md ([N] lines) - Technical debt and issues
281
+
282
+
283
+ ---
284
+
285
+ ## ▶ Next Up
286
+
287
+ **Initialize project** — use codebase context for planning
288
+
289
+ `/ez:new-project`
290
+
291
+ <sub>`/clear` first → fresh context window</sub>
292
+
293
+ ---
294
+
295
+ **Also available:**
296
+ - Re-run mapping: `/ez:map-codebase`
297
+ - Review specific file: `cat .planning/codebase/STACK.md`
298
+ - Edit any document before proceeding
299
+
300
+ ---
301
+ ```
302
+
303
+ End workflow.
304
+ </step>
305
+
306
+ </process>
307
+
308
+ <success_criteria>
309
+ - .planning/codebase/ directory created
310
+ - 4 parallel gsd-codebase-mapper agents spawned with run_in_background=true
311
+ - Agents write documents directly (orchestrator doesn't receive document contents)
312
+ - Read agent output files to collect confirmations
313
+ - All 7 codebase documents exist
314
+ - Clear completion summary with line counts
315
+ - User offered clear next steps in GSD style
316
+ </success_criteria>