gsd-code-first 1.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 (238) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja-JP.md +834 -0
  3. package/README.ko-KR.md +823 -0
  4. package/README.md +937 -0
  5. package/README.pt-BR.md +452 -0
  6. package/README.zh-CN.md +800 -0
  7. package/agents/gsd-advisor-researcher.md +104 -0
  8. package/agents/gsd-annotator.md +148 -0
  9. package/agents/gsd-arc-executor.md +537 -0
  10. package/agents/gsd-arc-planner.md +374 -0
  11. package/agents/gsd-assumptions-analyzer.md +105 -0
  12. package/agents/gsd-code-planner.md +155 -0
  13. package/agents/gsd-codebase-mapper.md +770 -0
  14. package/agents/gsd-debugger.md +1373 -0
  15. package/agents/gsd-executor.md +509 -0
  16. package/agents/gsd-integration-checker.md +443 -0
  17. package/agents/gsd-nyquist-auditor.md +176 -0
  18. package/agents/gsd-phase-researcher.md +698 -0
  19. package/agents/gsd-plan-checker.md +773 -0
  20. package/agents/gsd-planner.md +1354 -0
  21. package/agents/gsd-project-researcher.md +654 -0
  22. package/agents/gsd-prototyper.md +161 -0
  23. package/agents/gsd-research-synthesizer.md +247 -0
  24. package/agents/gsd-roadmapper.md +679 -0
  25. package/agents/gsd-ui-auditor.md +439 -0
  26. package/agents/gsd-ui-checker.md +300 -0
  27. package/agents/gsd-ui-researcher.md +357 -0
  28. package/agents/gsd-user-profiler.md +171 -0
  29. package/agents/gsd-verifier.md +700 -0
  30. package/bin/install.js +5009 -0
  31. package/commands/gsd/add-backlog.md +76 -0
  32. package/commands/gsd/add-phase.md +43 -0
  33. package/commands/gsd/add-tests.md +41 -0
  34. package/commands/gsd/add-todo.md +47 -0
  35. package/commands/gsd/annotate.md +54 -0
  36. package/commands/gsd/audit-milestone.md +36 -0
  37. package/commands/gsd/audit-uat.md +24 -0
  38. package/commands/gsd/autonomous.md +41 -0
  39. package/commands/gsd/check-todos.md +45 -0
  40. package/commands/gsd/cleanup.md +18 -0
  41. package/commands/gsd/complete-milestone.md +136 -0
  42. package/commands/gsd/debug.md +173 -0
  43. package/commands/gsd/deep-plan.md +52 -0
  44. package/commands/gsd/discuss-phase.md +64 -0
  45. package/commands/gsd/do.md +30 -0
  46. package/commands/gsd/execute-phase.md +59 -0
  47. package/commands/gsd/extract-plan.md +35 -0
  48. package/commands/gsd/fast.md +30 -0
  49. package/commands/gsd/forensics.md +56 -0
  50. package/commands/gsd/health.md +22 -0
  51. package/commands/gsd/help.md +22 -0
  52. package/commands/gsd/insert-phase.md +32 -0
  53. package/commands/gsd/iterate.md +124 -0
  54. package/commands/gsd/join-discord.md +18 -0
  55. package/commands/gsd/list-phase-assumptions.md +46 -0
  56. package/commands/gsd/list-workspaces.md +19 -0
  57. package/commands/gsd/manager.md +39 -0
  58. package/commands/gsd/map-codebase.md +71 -0
  59. package/commands/gsd/milestone-summary.md +51 -0
  60. package/commands/gsd/new-milestone.md +44 -0
  61. package/commands/gsd/new-project.md +42 -0
  62. package/commands/gsd/new-workspace.md +44 -0
  63. package/commands/gsd/next.md +24 -0
  64. package/commands/gsd/note.md +34 -0
  65. package/commands/gsd/pause-work.md +38 -0
  66. package/commands/gsd/plan-milestone-gaps.md +34 -0
  67. package/commands/gsd/plan-phase.md +47 -0
  68. package/commands/gsd/plant-seed.md +28 -0
  69. package/commands/gsd/pr-branch.md +25 -0
  70. package/commands/gsd/profile-user.md +46 -0
  71. package/commands/gsd/progress.md +24 -0
  72. package/commands/gsd/prototype.md +56 -0
  73. package/commands/gsd/quick.md +47 -0
  74. package/commands/gsd/reapply-patches.md +123 -0
  75. package/commands/gsd/remove-phase.md +31 -0
  76. package/commands/gsd/remove-workspace.md +26 -0
  77. package/commands/gsd/research-phase.md +195 -0
  78. package/commands/gsd/resume-work.md +40 -0
  79. package/commands/gsd/review-backlog.md +61 -0
  80. package/commands/gsd/review.md +37 -0
  81. package/commands/gsd/session-report.md +19 -0
  82. package/commands/gsd/set-mode.md +41 -0
  83. package/commands/gsd/set-profile.md +12 -0
  84. package/commands/gsd/settings.md +36 -0
  85. package/commands/gsd/ship.md +23 -0
  86. package/commands/gsd/stats.md +18 -0
  87. package/commands/gsd/thread.md +127 -0
  88. package/commands/gsd/ui-phase.md +34 -0
  89. package/commands/gsd/ui-review.md +32 -0
  90. package/commands/gsd/update.md +37 -0
  91. package/commands/gsd/validate-phase.md +35 -0
  92. package/commands/gsd/verify-work.md +38 -0
  93. package/commands/gsd/workstreams.md +63 -0
  94. package/get-shit-done/bin/gsd-tools.cjs +946 -0
  95. package/get-shit-done/bin/lib/arc-scanner.cjs +341 -0
  96. package/get-shit-done/bin/lib/commands.cjs +959 -0
  97. package/get-shit-done/bin/lib/config.cjs +466 -0
  98. package/get-shit-done/bin/lib/core.cjs +1230 -0
  99. package/get-shit-done/bin/lib/frontmatter.cjs +336 -0
  100. package/get-shit-done/bin/lib/init.cjs +1442 -0
  101. package/get-shit-done/bin/lib/milestone.cjs +252 -0
  102. package/get-shit-done/bin/lib/model-profiles.cjs +68 -0
  103. package/get-shit-done/bin/lib/phase.cjs +888 -0
  104. package/get-shit-done/bin/lib/profile-output.cjs +952 -0
  105. package/get-shit-done/bin/lib/profile-pipeline.cjs +539 -0
  106. package/get-shit-done/bin/lib/roadmap.cjs +329 -0
  107. package/get-shit-done/bin/lib/security.cjs +382 -0
  108. package/get-shit-done/bin/lib/state.cjs +1031 -0
  109. package/get-shit-done/bin/lib/template.cjs +222 -0
  110. package/get-shit-done/bin/lib/uat.cjs +282 -0
  111. package/get-shit-done/bin/lib/verify.cjs +888 -0
  112. package/get-shit-done/bin/lib/workstream.cjs +491 -0
  113. package/get-shit-done/commands/gsd/workstreams.md +63 -0
  114. package/get-shit-done/references/arc-standard.md +315 -0
  115. package/get-shit-done/references/checkpoints.md +778 -0
  116. package/get-shit-done/references/continuation-format.md +249 -0
  117. package/get-shit-done/references/decimal-phase-calculation.md +64 -0
  118. package/get-shit-done/references/git-integration.md +295 -0
  119. package/get-shit-done/references/git-planning-commit.md +38 -0
  120. package/get-shit-done/references/model-profile-resolution.md +36 -0
  121. package/get-shit-done/references/model-profiles.md +139 -0
  122. package/get-shit-done/references/phase-argument-parsing.md +61 -0
  123. package/get-shit-done/references/planning-config.md +202 -0
  124. package/get-shit-done/references/questioning.md +162 -0
  125. package/get-shit-done/references/tdd.md +263 -0
  126. package/get-shit-done/references/ui-brand.md +160 -0
  127. package/get-shit-done/references/user-profiling.md +681 -0
  128. package/get-shit-done/references/verification-patterns.md +612 -0
  129. package/get-shit-done/references/workstream-flag.md +58 -0
  130. package/get-shit-done/templates/DEBUG.md +164 -0
  131. package/get-shit-done/templates/UAT.md +265 -0
  132. package/get-shit-done/templates/UI-SPEC.md +100 -0
  133. package/get-shit-done/templates/VALIDATION.md +76 -0
  134. package/get-shit-done/templates/claude-md.md +122 -0
  135. package/get-shit-done/templates/codebase/architecture.md +255 -0
  136. package/get-shit-done/templates/codebase/concerns.md +310 -0
  137. package/get-shit-done/templates/codebase/conventions.md +307 -0
  138. package/get-shit-done/templates/codebase/integrations.md +280 -0
  139. package/get-shit-done/templates/codebase/stack.md +186 -0
  140. package/get-shit-done/templates/codebase/structure.md +285 -0
  141. package/get-shit-done/templates/codebase/testing.md +480 -0
  142. package/get-shit-done/templates/config.json +44 -0
  143. package/get-shit-done/templates/context.md +352 -0
  144. package/get-shit-done/templates/continue-here.md +78 -0
  145. package/get-shit-done/templates/copilot-instructions.md +7 -0
  146. package/get-shit-done/templates/debug-subagent-prompt.md +91 -0
  147. package/get-shit-done/templates/dev-preferences.md +21 -0
  148. package/get-shit-done/templates/discovery.md +146 -0
  149. package/get-shit-done/templates/discussion-log.md +63 -0
  150. package/get-shit-done/templates/milestone-archive.md +123 -0
  151. package/get-shit-done/templates/milestone.md +115 -0
  152. package/get-shit-done/templates/phase-prompt.md +610 -0
  153. package/get-shit-done/templates/planner-subagent-prompt.md +117 -0
  154. package/get-shit-done/templates/project.md +186 -0
  155. package/get-shit-done/templates/requirements.md +231 -0
  156. package/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
  157. package/get-shit-done/templates/research-project/FEATURES.md +147 -0
  158. package/get-shit-done/templates/research-project/PITFALLS.md +200 -0
  159. package/get-shit-done/templates/research-project/STACK.md +120 -0
  160. package/get-shit-done/templates/research-project/SUMMARY.md +170 -0
  161. package/get-shit-done/templates/research.md +552 -0
  162. package/get-shit-done/templates/retrospective.md +54 -0
  163. package/get-shit-done/templates/roadmap.md +202 -0
  164. package/get-shit-done/templates/state.md +176 -0
  165. package/get-shit-done/templates/summary-complex.md +59 -0
  166. package/get-shit-done/templates/summary-minimal.md +41 -0
  167. package/get-shit-done/templates/summary-standard.md +48 -0
  168. package/get-shit-done/templates/summary.md +248 -0
  169. package/get-shit-done/templates/user-profile.md +146 -0
  170. package/get-shit-done/templates/user-setup.md +311 -0
  171. package/get-shit-done/templates/verification-report.md +322 -0
  172. package/get-shit-done/workflows/add-phase.md +112 -0
  173. package/get-shit-done/workflows/add-tests.md +351 -0
  174. package/get-shit-done/workflows/add-todo.md +158 -0
  175. package/get-shit-done/workflows/audit-milestone.md +340 -0
  176. package/get-shit-done/workflows/audit-uat.md +109 -0
  177. package/get-shit-done/workflows/autonomous.md +891 -0
  178. package/get-shit-done/workflows/check-todos.md +177 -0
  179. package/get-shit-done/workflows/cleanup.md +152 -0
  180. package/get-shit-done/workflows/complete-milestone.md +767 -0
  181. package/get-shit-done/workflows/diagnose-issues.md +231 -0
  182. package/get-shit-done/workflows/discovery-phase.md +289 -0
  183. package/get-shit-done/workflows/discuss-phase-assumptions.md +653 -0
  184. package/get-shit-done/workflows/discuss-phase.md +1049 -0
  185. package/get-shit-done/workflows/do.md +104 -0
  186. package/get-shit-done/workflows/execute-phase.md +846 -0
  187. package/get-shit-done/workflows/execute-plan.md +514 -0
  188. package/get-shit-done/workflows/fast.md +105 -0
  189. package/get-shit-done/workflows/forensics.md +265 -0
  190. package/get-shit-done/workflows/health.md +181 -0
  191. package/get-shit-done/workflows/help.md +634 -0
  192. package/get-shit-done/workflows/insert-phase.md +130 -0
  193. package/get-shit-done/workflows/list-phase-assumptions.md +178 -0
  194. package/get-shit-done/workflows/list-workspaces.md +56 -0
  195. package/get-shit-done/workflows/manager.md +362 -0
  196. package/get-shit-done/workflows/map-codebase.md +377 -0
  197. package/get-shit-done/workflows/milestone-summary.md +223 -0
  198. package/get-shit-done/workflows/new-milestone.md +486 -0
  199. package/get-shit-done/workflows/new-project.md +1250 -0
  200. package/get-shit-done/workflows/new-workspace.md +237 -0
  201. package/get-shit-done/workflows/next.md +97 -0
  202. package/get-shit-done/workflows/node-repair.md +92 -0
  203. package/get-shit-done/workflows/note.md +156 -0
  204. package/get-shit-done/workflows/pause-work.md +176 -0
  205. package/get-shit-done/workflows/plan-milestone-gaps.md +273 -0
  206. package/get-shit-done/workflows/plan-phase.md +859 -0
  207. package/get-shit-done/workflows/plant-seed.md +169 -0
  208. package/get-shit-done/workflows/pr-branch.md +129 -0
  209. package/get-shit-done/workflows/profile-user.md +450 -0
  210. package/get-shit-done/workflows/progress.md +507 -0
  211. package/get-shit-done/workflows/quick.md +757 -0
  212. package/get-shit-done/workflows/remove-phase.md +155 -0
  213. package/get-shit-done/workflows/remove-workspace.md +90 -0
  214. package/get-shit-done/workflows/research-phase.md +82 -0
  215. package/get-shit-done/workflows/resume-project.md +326 -0
  216. package/get-shit-done/workflows/review.md +228 -0
  217. package/get-shit-done/workflows/session-report.md +146 -0
  218. package/get-shit-done/workflows/settings.md +283 -0
  219. package/get-shit-done/workflows/ship.md +228 -0
  220. package/get-shit-done/workflows/stats.md +60 -0
  221. package/get-shit-done/workflows/transition.md +671 -0
  222. package/get-shit-done/workflows/ui-phase.md +302 -0
  223. package/get-shit-done/workflows/ui-review.md +165 -0
  224. package/get-shit-done/workflows/update.md +323 -0
  225. package/get-shit-done/workflows/validate-phase.md +174 -0
  226. package/get-shit-done/workflows/verify-phase.md +254 -0
  227. package/get-shit-done/workflows/verify-work.md +637 -0
  228. package/hooks/dist/gsd-check-update.js +114 -0
  229. package/hooks/dist/gsd-context-monitor.js +156 -0
  230. package/hooks/dist/gsd-prompt-guard.js +96 -0
  231. package/hooks/dist/gsd-statusline.js +119 -0
  232. package/hooks/dist/gsd-workflow-guard.js +94 -0
  233. package/package.json +52 -0
  234. package/scripts/base64-scan.sh +262 -0
  235. package/scripts/build-hooks.js +82 -0
  236. package/scripts/prompt-injection-scan.sh +198 -0
  237. package/scripts/run-tests.cjs +29 -0
  238. package/scripts/secret-scan.sh +227 -0
@@ -0,0 +1,450 @@
1
+ <purpose>
2
+ Orchestrate the full developer profiling flow: consent, session analysis (or questionnaire fallback), profile generation, result display, and artifact creation.
3
+
4
+ This workflow wires Phase 1 (session pipeline) and Phase 2 (profiling engine) into a cohesive user-facing experience. All heavy lifting is done by existing gsd-tools.cjs subcommands and the gsd-user-profiler agent -- this workflow orchestrates the sequence, handles branching, and provides the UX.
5
+ </purpose>
6
+
7
+ <required_reading>
8
+ Read all files referenced by the invoking prompt's execution_context before starting.
9
+
10
+ Key references:
11
+ - @$HOME/.claude/get-shit-done/references/ui-brand.md (display patterns)
12
+ - @$HOME/.claude/get-shit-done/agents/gsd-user-profiler.md (profiler agent definition)
13
+ - @$HOME/.claude/get-shit-done/references/user-profiling.md (profiling reference doc)
14
+ </required_reading>
15
+
16
+ <process>
17
+
18
+ ## 1. Initialize
19
+
20
+ Parse flags from $ARGUMENTS:
21
+ - Detect `--questionnaire` flag (skip session analysis, questionnaire-only)
22
+ - Detect `--refresh` flag (rebuild profile even when one exists)
23
+
24
+ Check for existing profile:
25
+
26
+ ```bash
27
+ PROFILE_PATH="$HOME/.claude/get-shit-done/USER-PROFILE.md"
28
+ [ -f "$PROFILE_PATH" ] && echo "EXISTS" || echo "NOT_FOUND"
29
+ ```
30
+
31
+ **If profile exists AND --refresh NOT set AND --questionnaire NOT set:**
32
+
33
+ Use AskUserQuestion:
34
+ - header: "Existing Profile"
35
+ - question: "You already have a profile. What would you like to do?"
36
+ - options:
37
+ - "View it" -- Display summary card from existing profile data, then exit
38
+ - "Refresh it" -- Continue with --refresh behavior
39
+ - "Cancel" -- Exit workflow
40
+
41
+ If "View it": Read USER-PROFILE.md, display its content formatted as a summary card, then exit.
42
+ If "Refresh it": Set --refresh behavior and continue.
43
+ If "Cancel": Display "No changes made." and exit.
44
+
45
+ **If profile exists AND --refresh IS set:**
46
+
47
+ Backup existing profile:
48
+ ```bash
49
+ cp "$HOME/.claude/get-shit-done/USER-PROFILE.md" "$HOME/.claude/get-shit-done/USER-PROFILE.backup.md"
50
+ ```
51
+
52
+ Display: "Re-analyzing your sessions to update your profile."
53
+ Continue to step 2.
54
+
55
+ **If no profile exists:** Continue to step 2.
56
+
57
+ ---
58
+
59
+ ## 2. Consent Gate (ACTV-06)
60
+
61
+ **Skip if** `--questionnaire` flag is set (no JSONL reading occurs -- jump directly to step 4b).
62
+
63
+ Display consent screen:
64
+
65
+ ```
66
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
67
+ GSD > PROFILE YOUR CODING STYLE
68
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
69
+
70
+ Claude starts every conversation generic. A profile teaches Claude
71
+ how YOU actually work -- not how you think you work.
72
+
73
+ ## What We'll Analyze
74
+
75
+ Your recent Claude Code sessions, looking for patterns in these
76
+ 8 behavioral dimensions:
77
+
78
+ | Dimension | What It Measures |
79
+ |----------------------|---------------------------------------------|
80
+ | Communication Style | How you phrase requests (terse vs. detailed) |
81
+ | Decision Speed | How you choose between options |
82
+ | Explanation Depth | How much explanation you want with code |
83
+ | Debugging Approach | How you tackle errors and bugs |
84
+ | UX Philosophy | How much you care about design vs. function |
85
+ | Vendor Philosophy | How you evaluate libraries and tools |
86
+ | Frustration Triggers | What makes you correct Claude |
87
+ | Learning Style | How you prefer to learn new things |
88
+
89
+ ## Data Handling
90
+
91
+ ✓ Reads session files locally (read-only, nothing modified)
92
+ ✓ Analyzes message patterns (not content meaning)
93
+ ✓ Stores profile at $HOME/.claude/get-shit-done/USER-PROFILE.md
94
+ ✗ Nothing is sent to external services
95
+ ✗ Sensitive content (API keys, passwords) is automatically excluded
96
+ ```
97
+
98
+ **If --refresh path:**
99
+ Show abbreviated consent instead:
100
+
101
+ ```
102
+ Re-analyzing your sessions to update your profile.
103
+ Your existing profile has been backed up to USER-PROFILE.backup.md.
104
+ ```
105
+
106
+ Use AskUserQuestion:
107
+ - header: "Refresh"
108
+ - question: "Continue with profile refresh?"
109
+ - options:
110
+ - "Continue" -- Proceed to step 3
111
+ - "Cancel" -- Exit workflow
112
+
113
+ **If default (no --refresh) path:**
114
+
115
+ Use AskUserQuestion:
116
+ - header: "Ready?"
117
+ - question: "Ready to analyze your sessions?"
118
+ - options:
119
+ - "Let's go" -- Proceed to step 3 (session analysis)
120
+ - "Use questionnaire instead" -- Jump to step 4b (questionnaire path)
121
+ - "Not now" -- Display "No worries. Run /gsd:profile-user when ready." and exit
122
+
123
+ ---
124
+
125
+ ## 3. Session Scan
126
+
127
+ Display: "◆ Scanning sessions..."
128
+
129
+ Run session scan:
130
+ ```bash
131
+ SCAN_RESULT=$(node $HOME/.claude/get-shit-done/bin/gsd-tools.cjs scan-sessions --json 2>/dev/null)
132
+ ```
133
+
134
+ Parse the JSON output to get session count and project count.
135
+
136
+ Display: "✓ Found N sessions across M projects"
137
+
138
+ **Determine data sufficiency:**
139
+ - Count total messages available from the scan result (sum sessions across projects)
140
+ - If 0 sessions found: Display "No sessions found. Switching to questionnaire." and jump to step 4b
141
+ - If sessions found: Continue to step 4a
142
+
143
+ ---
144
+
145
+ ## 4a. Session Analysis Path
146
+
147
+ Display: "◆ Sampling messages..."
148
+
149
+ Run profile sampling:
150
+ ```bash
151
+ SAMPLE_RESULT=$(node $HOME/.claude/get-shit-done/bin/gsd-tools.cjs profile-sample --json 2>/dev/null)
152
+ ```
153
+
154
+ Parse the JSON output to get the temp directory path and message count.
155
+
156
+ Display: "✓ Sampled N messages from M projects"
157
+
158
+ Display: "◆ Analyzing patterns..."
159
+
160
+ **Spawn gsd-user-profiler agent using Task tool:**
161
+
162
+ Use the Task tool to spawn the `gsd-user-profiler` agent. Provide it with:
163
+ - The sampled JSONL file path from profile-sample output
164
+ - The user-profiling reference doc at `$HOME/.claude/get-shit-done/references/user-profiling.md`
165
+
166
+ The agent prompt should follow this structure:
167
+ ```
168
+ Read the profiling reference document and the sampled session messages, then analyze the developer's behavioral patterns across all 8 dimensions.
169
+
170
+ Reference: @$HOME/.claude/get-shit-done/references/user-profiling.md
171
+ Session data: @{temp_dir}/profile-sample.jsonl
172
+
173
+ Analyze these messages and return your analysis in the <analysis> JSON format specified in the reference document.
174
+ ```
175
+
176
+ **Parse the agent's output:**
177
+ - Extract the `<analysis>` JSON block from the agent's response
178
+ - Save analysis JSON to a temp file (in the same temp directory created by profile-sample)
179
+
180
+ ```bash
181
+ ANALYSIS_PATH="{temp_dir}/analysis.json"
182
+ ```
183
+
184
+ Write the analysis JSON to `$ANALYSIS_PATH`.
185
+
186
+ Display: "✓ Analysis complete (N dimensions scored)"
187
+
188
+ **Check for thin data:**
189
+ - Read the analysis JSON and check the total message count
190
+ - If < 50 messages were analyzed: Note that a questionnaire supplement could improve accuracy. Display: "Note: Limited session data (N messages). Results may have lower confidence."
191
+
192
+ Continue to step 5.
193
+
194
+ ---
195
+
196
+ ## 4b. Questionnaire Path
197
+
198
+ Display: "Using questionnaire to build your profile."
199
+
200
+ **Get questions:**
201
+ ```bash
202
+ QUESTIONS=$(node $HOME/.claude/get-shit-done/bin/gsd-tools.cjs profile-questionnaire --json 2>/dev/null)
203
+ ```
204
+
205
+ Parse the questions JSON. It contains 8 questions, one per dimension.
206
+
207
+ **Present each question to the user via AskUserQuestion:**
208
+
209
+ For each question in the questions array:
210
+ - header: The dimension name (e.g., "Communication Style")
211
+ - question: The question text
212
+ - options: The answer options from the question definition
213
+
214
+ Collect all answers into an answers JSON object mapping dimension keys to selected answer values.
215
+
216
+ **Save answers to temp file:**
217
+ ```bash
218
+ ANSWERS_PATH=$(mktemp /tmp/gsd-profile-answers-XXXXXX.json)
219
+ ```
220
+
221
+ Write the answers JSON to `$ANSWERS_PATH`.
222
+
223
+ **Convert answers to analysis:**
224
+ ```bash
225
+ ANALYSIS_RESULT=$(node $HOME/.claude/get-shit-done/bin/gsd-tools.cjs profile-questionnaire --answers "$ANSWERS_PATH" --json 2>/dev/null)
226
+ ```
227
+
228
+ Parse the analysis JSON from the result.
229
+
230
+ Save analysis JSON to a temp file:
231
+ ```bash
232
+ ANALYSIS_PATH=$(mktemp /tmp/gsd-profile-analysis-XXXXXX.json)
233
+ ```
234
+
235
+ Write the analysis JSON to `$ANALYSIS_PATH`.
236
+
237
+ Continue to step 5 (skip split resolution since questionnaire handles ambiguity internally).
238
+
239
+ ---
240
+
241
+ ## 5. Split Resolution
242
+
243
+ **Skip if** questionnaire-only path (splits already handled internally).
244
+
245
+ Read the analysis JSON from `$ANALYSIS_PATH`.
246
+
247
+ Check each dimension for `cross_project_consistent: false`.
248
+
249
+ **For each split detected:**
250
+
251
+ Use AskUserQuestion:
252
+ - header: The dimension name (e.g., "Communication Style")
253
+ - question: "Your sessions show different patterns:" followed by the split context (e.g., "CLI/backend projects -> terse-direct, Frontend/UI projects -> detailed-structured")
254
+ - options:
255
+ - Rating option A (e.g., "terse-direct")
256
+ - Rating option B (e.g., "detailed-structured")
257
+ - "Context-dependent (keep both)"
258
+
259
+ **If user picks a specific rating:** Update the dimension's `rating` field in the analysis JSON to the selected value.
260
+
261
+ **If user picks "Context-dependent":** Keep the dominant rating in the `rating` field. Add a `context_note` to the dimension's summary describing the split (e.g., "Context-dependent: terse in CLI projects, detailed in frontend projects").
262
+
263
+ Write updated analysis JSON back to `$ANALYSIS_PATH`.
264
+
265
+ ---
266
+
267
+ ## 6. Profile Write
268
+
269
+ Display: "◆ Writing profile..."
270
+
271
+ ```bash
272
+ node $HOME/.claude/get-shit-done/bin/gsd-tools.cjs write-profile --input "$ANALYSIS_PATH" --json 2>/dev/null
273
+ ```
274
+
275
+ Display: "✓ Profile written to $HOME/.claude/get-shit-done/USER-PROFILE.md"
276
+
277
+ ---
278
+
279
+ ## 7. Result Display
280
+
281
+ Read the analysis JSON from `$ANALYSIS_PATH` to build the display.
282
+
283
+ **Show report card table:**
284
+
285
+ ```
286
+ ## Your Profile
287
+
288
+ | Dimension | Rating | Confidence |
289
+ |----------------------|----------------------|------------|
290
+ | Communication Style | detailed-structured | HIGH |
291
+ | Decision Speed | deliberate-informed | MEDIUM |
292
+ | Explanation Depth | concise | HIGH |
293
+ | Debugging Approach | hypothesis-driven | MEDIUM |
294
+ | UX Philosophy | pragmatic | LOW |
295
+ | Vendor Philosophy | thorough-evaluator | HIGH |
296
+ | Frustration Triggers | scope-creep | MEDIUM |
297
+ | Learning Style | self-directed | HIGH |
298
+ ```
299
+
300
+ (Populate with actual values from the analysis JSON.)
301
+
302
+ **Show highlight reel:**
303
+
304
+ Pick 3-4 dimensions with the highest confidence and most evidence signals. Format as:
305
+
306
+ ```
307
+ ## Highlights
308
+
309
+ - **Communication (HIGH):** You consistently provide structured context with
310
+ headers and problem statements before making requests
311
+ - **Vendor Choices (HIGH):** You research alternatives thoroughly -- comparing
312
+ docs, GitHub activity, and bundle sizes before committing
313
+ - **Frustrations (MEDIUM):** You correct Claude most often for doing things
314
+ you didn't ask for -- scope creep is your primary trigger
315
+ ```
316
+
317
+ Build highlights from the `evidence` array and `summary` fields in the analysis JSON. Use the most compelling evidence quotes. Format each as "You tend to..." or "You consistently..." with evidence attribution.
318
+
319
+ **Offer full profile view:**
320
+
321
+ Use AskUserQuestion:
322
+ - header: "Profile"
323
+ - question: "Want to see the full profile?"
324
+ - options:
325
+ - "Yes" -- Read and display the full USER-PROFILE.md content, then continue to step 8
326
+ - "Continue to artifacts" -- Proceed directly to step 8
327
+
328
+ ---
329
+
330
+ ## 8. Artifact Selection (ACTV-05)
331
+
332
+ Use AskUserQuestion with multiSelect:
333
+ - header: "Artifacts"
334
+ - question: "Which artifacts should I generate?"
335
+ - options (ALL pre-selected by default):
336
+ - "/gsd:dev-preferences command file" -- "Load your preferences in any session"
337
+ - "CLAUDE.md profile section" -- "Add profile to this project's CLAUDE.md"
338
+ - "Global CLAUDE.md" -- "Add profile to $HOME/.claude/CLAUDE.md for all projects"
339
+
340
+ **If no artifacts selected:** Display "No artifacts generated. Your profile is saved at $HOME/.claude/get-shit-done/USER-PROFILE.md" and jump to step 10.
341
+
342
+ ---
343
+
344
+ ## 9. Artifact Generation
345
+
346
+ Generate selected artifacts sequentially (file I/O is fast, no benefit from parallel agents):
347
+
348
+ **For /gsd:dev-preferences (if selected):**
349
+
350
+ ```bash
351
+ node $HOME/.claude/get-shit-done/bin/gsd-tools.cjs generate-dev-preferences --analysis "$ANALYSIS_PATH" --json 2>/dev/null
352
+ ```
353
+
354
+ Display: "✓ Generated /gsd:dev-preferences at $HOME/.claude/commands/gsd/dev-preferences.md"
355
+
356
+ **For CLAUDE.md profile section (if selected):**
357
+
358
+ ```bash
359
+ node $HOME/.claude/get-shit-done/bin/gsd-tools.cjs generate-claude-profile --analysis "$ANALYSIS_PATH" --json 2>/dev/null
360
+ ```
361
+
362
+ Display: "✓ Added profile section to CLAUDE.md"
363
+
364
+ **For Global CLAUDE.md (if selected):**
365
+
366
+ ```bash
367
+ node $HOME/.claude/get-shit-done/bin/gsd-tools.cjs generate-claude-profile --analysis "$ANALYSIS_PATH" --global --json 2>/dev/null
368
+ ```
369
+
370
+ Display: "✓ Added profile section to $HOME/.claude/CLAUDE.md"
371
+
372
+ **Error handling:** If any gsd-tools.cjs call fails, display the error message and use AskUserQuestion to offer "Retry" or "Skip this artifact". On retry, re-run the command. On skip, continue to next artifact.
373
+
374
+ ---
375
+
376
+ ## 10. Summary & Refresh Diff
377
+
378
+ **If --refresh path:**
379
+
380
+ Read both old backup and new analysis to compare dimension ratings/confidence.
381
+
382
+ Read the backed-up profile:
383
+ ```bash
384
+ BACKUP_PATH="$HOME/.claude/get-shit-done/USER-PROFILE.backup.md"
385
+ ```
386
+
387
+ Compare each dimension's rating and confidence between old and new. Display diff table showing only changed dimensions:
388
+
389
+ ```
390
+ ## Changes
391
+
392
+ | Dimension | Before | After |
393
+ |-----------------|-----------------------------|-----------------------------|
394
+ | Communication | terse-direct (LOW) | detailed-structured (HIGH) |
395
+ | Debugging | fix-first (MEDIUM) | hypothesis-driven (MEDIUM) |
396
+ ```
397
+
398
+ If nothing changed: Display "No changes detected -- your profile is already up to date."
399
+
400
+ **Display final summary:**
401
+
402
+ ```
403
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
404
+ GSD > PROFILE COMPLETE ✓
405
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
406
+
407
+ Your profile: $HOME/.claude/get-shit-done/USER-PROFILE.md
408
+ ```
409
+
410
+ Then list paths for each generated artifact:
411
+ ```
412
+ Artifacts:
413
+ ✓ /gsd:dev-preferences $HOME/.claude/commands/gsd/dev-preferences.md
414
+ ✓ CLAUDE.md section ./CLAUDE.md
415
+ ✓ Global CLAUDE.md $HOME/.claude/CLAUDE.md
416
+ ```
417
+
418
+ (Only show artifacts that were actually generated.)
419
+
420
+ **Clean up temp files:**
421
+
422
+ Remove the temp directory created by profile-sample (contains sample JSONL and analysis JSON):
423
+ ```bash
424
+ rm -rf "$TEMP_DIR"
425
+ ```
426
+
427
+ Also remove any standalone temp files created for questionnaire answers:
428
+ ```bash
429
+ rm -f "$ANSWERS_PATH" 2>/dev/null
430
+ rm -f "$ANALYSIS_PATH" 2>/dev/null
431
+ ```
432
+
433
+ (Only clean up temp paths that were actually created during this workflow run.)
434
+
435
+ </process>
436
+
437
+ <success_criteria>
438
+ - [ ] Initialization detects existing profile and handles all three responses (view/refresh/cancel)
439
+ - [ ] Consent gate shown for session analysis path, skipped for questionnaire path
440
+ - [ ] Session scan discovers sessions and reports statistics
441
+ - [ ] Session analysis path: samples messages, spawns profiler agent, extracts analysis JSON
442
+ - [ ] Questionnaire path: presents 8 questions, collects answers, converts to analysis JSON
443
+ - [ ] Split resolution presents context-dependent splits with user resolution options
444
+ - [ ] Profile written to USER-PROFILE.md via write-profile subcommand
445
+ - [ ] Result display shows report card table and highlight reel with evidence
446
+ - [ ] Artifact selection uses multiSelect with all options pre-selected
447
+ - [ ] Artifacts generated sequentially via gsd-tools.cjs subcommands
448
+ - [ ] Refresh diff shows changed dimensions when --refresh was used
449
+ - [ ] Temp files cleaned up on completion
450
+ </success_criteria>