get-research-done 1.1.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 (127) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +560 -0
  3. package/agents/grd-architect.md +789 -0
  4. package/agents/grd-codebase-mapper.md +738 -0
  5. package/agents/grd-critic.md +1065 -0
  6. package/agents/grd-debugger.md +1203 -0
  7. package/agents/grd-evaluator.md +948 -0
  8. package/agents/grd-executor.md +784 -0
  9. package/agents/grd-explorer.md +2063 -0
  10. package/agents/grd-graduator.md +484 -0
  11. package/agents/grd-integration-checker.md +423 -0
  12. package/agents/grd-phase-researcher.md +641 -0
  13. package/agents/grd-plan-checker.md +745 -0
  14. package/agents/grd-planner.md +1386 -0
  15. package/agents/grd-project-researcher.md +865 -0
  16. package/agents/grd-research-synthesizer.md +256 -0
  17. package/agents/grd-researcher.md +2361 -0
  18. package/agents/grd-roadmapper.md +605 -0
  19. package/agents/grd-verifier.md +778 -0
  20. package/bin/install.js +1294 -0
  21. package/commands/grd/add-phase.md +207 -0
  22. package/commands/grd/add-todo.md +193 -0
  23. package/commands/grd/architect.md +283 -0
  24. package/commands/grd/audit-milestone.md +277 -0
  25. package/commands/grd/check-todos.md +228 -0
  26. package/commands/grd/complete-milestone.md +136 -0
  27. package/commands/grd/debug.md +169 -0
  28. package/commands/grd/discuss-phase.md +86 -0
  29. package/commands/grd/evaluate.md +1095 -0
  30. package/commands/grd/execute-phase.md +339 -0
  31. package/commands/grd/explore.md +258 -0
  32. package/commands/grd/graduate.md +323 -0
  33. package/commands/grd/help.md +482 -0
  34. package/commands/grd/insert-phase.md +227 -0
  35. package/commands/grd/insights.md +231 -0
  36. package/commands/grd/join-discord.md +18 -0
  37. package/commands/grd/list-phase-assumptions.md +50 -0
  38. package/commands/grd/map-codebase.md +71 -0
  39. package/commands/grd/new-milestone.md +721 -0
  40. package/commands/grd/new-project.md +1008 -0
  41. package/commands/grd/pause-work.md +134 -0
  42. package/commands/grd/plan-milestone-gaps.md +295 -0
  43. package/commands/grd/plan-phase.md +525 -0
  44. package/commands/grd/progress.md +364 -0
  45. package/commands/grd/quick-explore.md +236 -0
  46. package/commands/grd/quick.md +309 -0
  47. package/commands/grd/remove-phase.md +349 -0
  48. package/commands/grd/research-phase.md +200 -0
  49. package/commands/grd/research.md +681 -0
  50. package/commands/grd/resume-work.md +40 -0
  51. package/commands/grd/set-profile.md +106 -0
  52. package/commands/grd/settings.md +136 -0
  53. package/commands/grd/update.md +172 -0
  54. package/commands/grd/verify-work.md +219 -0
  55. package/get-research-done/config/default.json +15 -0
  56. package/get-research-done/references/checkpoints.md +1078 -0
  57. package/get-research-done/references/continuation-format.md +249 -0
  58. package/get-research-done/references/git-integration.md +254 -0
  59. package/get-research-done/references/model-profiles.md +73 -0
  60. package/get-research-done/references/planning-config.md +94 -0
  61. package/get-research-done/references/questioning.md +141 -0
  62. package/get-research-done/references/tdd.md +263 -0
  63. package/get-research-done/references/ui-brand.md +160 -0
  64. package/get-research-done/references/verification-patterns.md +612 -0
  65. package/get-research-done/templates/DEBUG.md +159 -0
  66. package/get-research-done/templates/UAT.md +247 -0
  67. package/get-research-done/templates/archive-reason.md +195 -0
  68. package/get-research-done/templates/codebase/architecture.md +255 -0
  69. package/get-research-done/templates/codebase/concerns.md +310 -0
  70. package/get-research-done/templates/codebase/conventions.md +307 -0
  71. package/get-research-done/templates/codebase/integrations.md +280 -0
  72. package/get-research-done/templates/codebase/stack.md +186 -0
  73. package/get-research-done/templates/codebase/structure.md +285 -0
  74. package/get-research-done/templates/codebase/testing.md +480 -0
  75. package/get-research-done/templates/config.json +35 -0
  76. package/get-research-done/templates/context.md +283 -0
  77. package/get-research-done/templates/continue-here.md +78 -0
  78. package/get-research-done/templates/critic-log.md +288 -0
  79. package/get-research-done/templates/data-report.md +173 -0
  80. package/get-research-done/templates/debug-subagent-prompt.md +91 -0
  81. package/get-research-done/templates/decision-log.md +58 -0
  82. package/get-research-done/templates/decision.md +138 -0
  83. package/get-research-done/templates/discovery.md +146 -0
  84. package/get-research-done/templates/experiment-readme.md +104 -0
  85. package/get-research-done/templates/graduated-script.md +180 -0
  86. package/get-research-done/templates/iteration-summary.md +234 -0
  87. package/get-research-done/templates/milestone-archive.md +123 -0
  88. package/get-research-done/templates/milestone.md +115 -0
  89. package/get-research-done/templates/objective.md +271 -0
  90. package/get-research-done/templates/phase-prompt.md +567 -0
  91. package/get-research-done/templates/planner-subagent-prompt.md +117 -0
  92. package/get-research-done/templates/project.md +184 -0
  93. package/get-research-done/templates/requirements.md +231 -0
  94. package/get-research-done/templates/research-project/ARCHITECTURE.md +204 -0
  95. package/get-research-done/templates/research-project/FEATURES.md +147 -0
  96. package/get-research-done/templates/research-project/PITFALLS.md +200 -0
  97. package/get-research-done/templates/research-project/STACK.md +120 -0
  98. package/get-research-done/templates/research-project/SUMMARY.md +170 -0
  99. package/get-research-done/templates/research.md +529 -0
  100. package/get-research-done/templates/roadmap.md +202 -0
  101. package/get-research-done/templates/scorecard.json +113 -0
  102. package/get-research-done/templates/state.md +287 -0
  103. package/get-research-done/templates/summary.md +246 -0
  104. package/get-research-done/templates/user-setup.md +311 -0
  105. package/get-research-done/templates/verification-report.md +322 -0
  106. package/get-research-done/workflows/complete-milestone.md +756 -0
  107. package/get-research-done/workflows/diagnose-issues.md +231 -0
  108. package/get-research-done/workflows/discovery-phase.md +289 -0
  109. package/get-research-done/workflows/discuss-phase.md +433 -0
  110. package/get-research-done/workflows/execute-phase.md +657 -0
  111. package/get-research-done/workflows/execute-plan.md +1844 -0
  112. package/get-research-done/workflows/list-phase-assumptions.md +178 -0
  113. package/get-research-done/workflows/map-codebase.md +322 -0
  114. package/get-research-done/workflows/resume-project.md +307 -0
  115. package/get-research-done/workflows/transition.md +556 -0
  116. package/get-research-done/workflows/verify-phase.md +628 -0
  117. package/get-research-done/workflows/verify-work.md +596 -0
  118. package/hooks/dist/grd-check-update.js +61 -0
  119. package/hooks/dist/grd-statusline.js +84 -0
  120. package/package.json +47 -0
  121. package/scripts/audit-help-commands.sh +115 -0
  122. package/scripts/build-hooks.js +42 -0
  123. package/scripts/verify-all-commands.sh +246 -0
  124. package/scripts/verify-architect-warning.sh +35 -0
  125. package/scripts/verify-insights-mode.sh +40 -0
  126. package/scripts/verify-quick-mode.sh +20 -0
  127. package/scripts/verify-revise-data-routing.sh +139 -0
@@ -0,0 +1,339 @@
1
+ ---
2
+ name: grd:execute-phase
3
+ description: Execute all plans in a phase with wave-based parallelization
4
+ argument-hint: "<phase-number> [--gaps-only]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Glob
10
+ - Grep
11
+ - Bash
12
+ - Task
13
+ - TodoWrite
14
+ - AskUserQuestion
15
+ ---
16
+
17
+ <objective>
18
+ Execute all plans in a phase using wave-based parallel execution.
19
+
20
+ Orchestrator stays lean: discover plans, analyze dependencies, group into waves, spawn subagents, collect results. Each subagent loads the full execute-plan context and handles its own plan.
21
+
22
+ Context budget: ~15% orchestrator, 100% fresh per subagent.
23
+ </objective>
24
+
25
+ <execution_context>
26
+ @~/.claude/get-research-done/references/ui-brand.md
27
+ @~/.claude/get-research-done/workflows/execute-phase.md
28
+ </execution_context>
29
+
30
+ <context>
31
+ Phase: $ARGUMENTS
32
+
33
+ **Flags:**
34
+ - `--gaps-only` — Execute only gap closure plans (plans with `gap_closure: true` in frontmatter). Use after verify-work creates fix plans.
35
+
36
+ @.planning/ROADMAP.md
37
+ @.planning/STATE.md
38
+ </context>
39
+
40
+ <process>
41
+ 0. **Resolve Model Profile**
42
+
43
+ Read model profile for agent spawning:
44
+ ```bash
45
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
46
+ ```
47
+
48
+ Default to "balanced" if not set.
49
+
50
+ **Model lookup table:**
51
+
52
+ | Agent | quality | balanced | budget |
53
+ |-------|---------|----------|--------|
54
+ | grd-executor | opus | sonnet | sonnet |
55
+ | grd-verifier | sonnet | sonnet | haiku |
56
+
57
+ Store resolved models for use in Task calls below.
58
+
59
+ 1. **Validate phase exists**
60
+ - Find phase directory matching argument
61
+ - Count PLAN.md files
62
+ - Error if no plans found
63
+
64
+ 2. **Discover plans**
65
+ - List all *-PLAN.md files in phase directory
66
+ - Check which have *-SUMMARY.md (already complete)
67
+ - If `--gaps-only`: filter to only plans with `gap_closure: true`
68
+ - Build list of incomplete plans
69
+
70
+ 3. **Group by wave**
71
+ - Read `wave` from each plan's frontmatter
72
+ - Group plans by wave number
73
+ - Report wave structure to user
74
+
75
+ 4. **Execute waves**
76
+ For each wave in order:
77
+ - Spawn `grd-executor` for each plan in wave (parallel Task calls)
78
+ - Wait for completion (Task blocks)
79
+ - Verify SUMMARYs created
80
+ - Proceed to next wave
81
+
82
+ 5. **Aggregate results**
83
+ - Collect summaries from all plans
84
+ - Report phase completion status
85
+
86
+ 6. **Commit any orchestrator corrections**
87
+ Check for uncommitted changes before verification:
88
+ ```bash
89
+ git status --porcelain
90
+ ```
91
+
92
+ **If changes exist:** Orchestrator made corrections between executor completions. Commit them:
93
+ ```bash
94
+ git add -u && git commit -m "fix({phase}): orchestrator corrections"
95
+ ```
96
+
97
+ **If clean:** Continue to verification.
98
+
99
+ 7. **Verify phase goal**
100
+ Check config: `WORKFLOW_VERIFIER=$(cat .planning/config.json 2>/dev/null | grep -o '"verifier"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")`
101
+
102
+ **If `workflow.verifier` is `false`:** Skip to step 8 (treat as passed).
103
+
104
+ **Otherwise:**
105
+ - Spawn `grd-verifier` subagent with phase directory and goal
106
+ - Verifier checks must_haves against actual codebase (not SUMMARY claims)
107
+ - Creates VERIFICATION.md with detailed report
108
+ - Route by status:
109
+ - `passed` → continue to step 8
110
+ - `human_needed` → present items, get approval or feedback
111
+ - `gaps_found` → present gaps, offer `/grd:plan-phase {X} --gaps`
112
+
113
+ 8. **Update roadmap and state**
114
+ - Update ROADMAP.md, STATE.md
115
+
116
+ 9. **Update requirements**
117
+ Mark phase requirements as Complete:
118
+ - Read ROADMAP.md, find this phase's `Requirements:` line (e.g., "AUTH-01, AUTH-02")
119
+ - Read REQUIREMENTS.md traceability table
120
+ - For each REQ-ID in this phase: change Status from "Pending" to "Complete"
121
+ - Write updated REQUIREMENTS.md
122
+ - Skip if: REQUIREMENTS.md doesn't exist, or phase has no Requirements line
123
+
124
+ 10. **Commit phase completion**
125
+ Check `COMMIT_PLANNING_DOCS` from config.json (default: true).
126
+ If false: Skip git operations for .planning/ files.
127
+ If true: Bundle all phase metadata updates in one commit:
128
+ - Stage: `git add .planning/ROADMAP.md .planning/STATE.md`
129
+ - Stage REQUIREMENTS.md if updated: `git add .planning/REQUIREMENTS.md`
130
+ - Commit: `docs({phase}): complete {phase-name} phase`
131
+
132
+ 11. **Offer next steps**
133
+ - Route to next action (see `<offer_next>`)
134
+ </process>
135
+
136
+ <offer_next>
137
+ Output this markdown directly (not as a code block). Route based on status:
138
+
139
+ | Status | Route |
140
+ |--------|-------|
141
+ | `gaps_found` | Route C (gap closure) |
142
+ | `human_needed` | Present checklist, then re-route based on approval |
143
+ | `passed` + more phases | Route A (next phase) |
144
+ | `passed` + last phase | Route B (milestone complete) |
145
+
146
+ ---
147
+
148
+ **Route A: Phase verified, more phases remain**
149
+
150
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
151
+ GRD ► PHASE {Z} COMPLETE ✓
152
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
153
+
154
+ **Phase {Z}: {Name}**
155
+
156
+ {Y} plans executed
157
+ Goal verified ✓
158
+
159
+ ───────────────────────────────────────────────────────────────
160
+
161
+ ## ▶ Next Up
162
+
163
+ **Phase {Z+1}: {Name}** — {Goal from ROADMAP.md}
164
+
165
+ /grd:discuss-phase {Z+1} — gather context and clarify approach
166
+
167
+ <sub>/clear first → fresh context window</sub>
168
+
169
+ ───────────────────────────────────────────────────────────────
170
+
171
+ **Also available:**
172
+ - /grd:plan-phase {Z+1} — skip discussion, plan directly
173
+ - /grd:verify-work {Z} — manual acceptance testing before continuing
174
+
175
+ ───────────────────────────────────────────────────────────────
176
+
177
+ ---
178
+
179
+ **Route B: Phase verified, milestone complete**
180
+
181
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
182
+ GRD ► MILESTONE COMPLETE 🎉
183
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
184
+
185
+ **v1.0**
186
+
187
+ {N} phases completed
188
+ All phase goals verified ✓
189
+
190
+ ───────────────────────────────────────────────────────────────
191
+
192
+ ## ▶ Next Up
193
+
194
+ **Audit milestone** — verify requirements, cross-phase integration, E2E flows
195
+
196
+ /grd:audit-milestone
197
+
198
+ <sub>/clear first → fresh context window</sub>
199
+
200
+ ───────────────────────────────────────────────────────────────
201
+
202
+ **Also available:**
203
+ - /grd:verify-work — manual acceptance testing
204
+ - /grd:complete-milestone — skip audit, archive directly
205
+
206
+ ───────────────────────────────────────────────────────────────
207
+
208
+ ---
209
+
210
+ **Route C: Gaps found — need additional planning**
211
+
212
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
213
+ GRD ► PHASE {Z} GAPS FOUND ⚠
214
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
215
+
216
+ **Phase {Z}: {Name}**
217
+
218
+ Score: {N}/{M} must-haves verified
219
+ Report: .planning/phases/{phase_dir}/{phase}-VERIFICATION.md
220
+
221
+ ### What's Missing
222
+
223
+ {Extract gap summaries from VERIFICATION.md}
224
+
225
+ ───────────────────────────────────────────────────────────────
226
+
227
+ ## ▶ Next Up
228
+
229
+ **Plan gap closure** — create additional plans to complete the phase
230
+
231
+ /grd:plan-phase {Z} --gaps
232
+
233
+ <sub>/clear first → fresh context window</sub>
234
+
235
+ ───────────────────────────────────────────────────────────────
236
+
237
+ **Also available:**
238
+ - cat .planning/phases/{phase_dir}/{phase}-VERIFICATION.md — see full report
239
+ - /grd:verify-work {Z} — manual testing before planning
240
+
241
+ ───────────────────────────────────────────────────────────────
242
+
243
+ ---
244
+
245
+ After user runs /grd:plan-phase {Z} --gaps:
246
+ 1. Planner reads VERIFICATION.md gaps
247
+ 2. Creates plans 04, 05, etc. to close gaps
248
+ 3. User runs /grd:execute-phase {Z} again
249
+ 4. Execute-phase runs incomplete plans (04, 05...)
250
+ 5. Verifier runs again → loop until passed
251
+ </offer_next>
252
+
253
+ <wave_execution>
254
+ **Parallel spawning:**
255
+
256
+ Before spawning, read file contents. The `@` syntax does not work across Task() boundaries.
257
+
258
+ ```bash
259
+ # Read each plan and STATE.md
260
+ PLAN_01_CONTENT=$(cat "{plan_01_path}")
261
+ PLAN_02_CONTENT=$(cat "{plan_02_path}")
262
+ PLAN_03_CONTENT=$(cat "{plan_03_path}")
263
+ STATE_CONTENT=$(cat .planning/STATE.md)
264
+ ```
265
+
266
+ Spawn all plans in a wave with a single message containing multiple Task calls, with inlined content:
267
+
268
+ ```
269
+ Task(prompt="Execute plan at {plan_01_path}\n\nPlan:\n{plan_01_content}\n\nProject state:\n{state_content}", subagent_type="grd-executor", model="{executor_model}")
270
+ Task(prompt="Execute plan at {plan_02_path}\n\nPlan:\n{plan_02_content}\n\nProject state:\n{state_content}", subagent_type="grd-executor", model="{executor_model}")
271
+ Task(prompt="Execute plan at {plan_03_path}\n\nPlan:\n{plan_03_content}\n\nProject state:\n{state_content}", subagent_type="grd-executor", model="{executor_model}")
272
+ ```
273
+
274
+ All three run in parallel. Task tool blocks until all complete.
275
+
276
+ **No polling.** No background agents. No TaskOutput loops.
277
+ </wave_execution>
278
+
279
+ <checkpoint_handling>
280
+ Plans with `autonomous: false` have checkpoints. The execute-phase.md workflow handles the full checkpoint flow:
281
+ - Subagent pauses at checkpoint, returns structured state
282
+ - Orchestrator presents to user, collects response
283
+ - Spawns fresh continuation agent (not resume)
284
+
285
+ See `@~/.claude/get-research-done/workflows/execute-phase.md` step `checkpoint_handling` for complete details.
286
+ </checkpoint_handling>
287
+
288
+ <deviation_rules>
289
+ During execution, handle discoveries automatically:
290
+
291
+ 1. **Auto-fix bugs** - Fix immediately, document in Summary
292
+ 2. **Auto-add critical** - Security/correctness gaps, add and document
293
+ 3. **Auto-fix blockers** - Can't proceed without fix, do it and document
294
+ 4. **Ask about architectural** - Major structural changes, stop and ask user
295
+
296
+ Only rule 4 requires user intervention.
297
+ </deviation_rules>
298
+
299
+ <commit_rules>
300
+ **Per-Task Commits:**
301
+
302
+ After each task completes:
303
+ 1. Stage only files modified by that task
304
+ 2. Commit with format: `{type}({phase}-{plan}): {task-name}`
305
+ 3. Types: feat, fix, test, refactor, perf, chore
306
+ 4. Record commit hash for SUMMARY.md
307
+
308
+ **Plan Metadata Commit:**
309
+
310
+ After all tasks in a plan complete:
311
+ 1. Stage plan artifacts only: PLAN.md, SUMMARY.md
312
+ 2. Commit with format: `docs({phase}-{plan}): complete [plan-name] plan`
313
+ 3. NO code files (already committed per-task)
314
+
315
+ **Phase Completion Commit:**
316
+
317
+ After all plans in phase complete (step 7):
318
+ 1. Stage: ROADMAP.md, STATE.md, REQUIREMENTS.md (if updated), VERIFICATION.md
319
+ 2. Commit with format: `docs({phase}): complete {phase-name} phase`
320
+ 3. Bundles all phase-level state updates in one commit
321
+
322
+ **NEVER use:**
323
+ - `git add .`
324
+ - `git add -A`
325
+ - `git add src/` or any broad directory
326
+
327
+ **Always stage files individually.**
328
+ </commit_rules>
329
+
330
+ <success_criteria>
331
+ - [ ] All incomplete plans in phase executed
332
+ - [ ] Each plan has SUMMARY.md
333
+ - [ ] Phase goal verified (must_haves checked against codebase)
334
+ - [ ] VERIFICATION.md created in phase directory
335
+ - [ ] STATE.md reflects phase completion
336
+ - [ ] ROADMAP.md updated
337
+ - [ ] REQUIREMENTS.md updated (phase requirements marked Complete)
338
+ - [ ] User informed of next steps
339
+ </success_criteria>
@@ -0,0 +1,258 @@
1
+ ---
2
+ name: grd:explore
3
+ description: Analyze raw data and generate DATA_REPORT.md with distributions, outliers, anomalies, and leakage detection
4
+ allowed-tools:
5
+ - Read
6
+ - Bash
7
+ - Write
8
+ - Task
9
+ - AskUserQuestion
10
+ ---
11
+
12
+ <objective>
13
+
14
+ Explore and profile raw datasets to surface patterns, anomalies, and potential issues before hypothesis formation.
15
+
16
+ This command performs data reconnaissance—generating a comprehensive DATA_REPORT.md that reveals distributions, outliers, missing data patterns, class imbalance, and potential data leakage risks.
17
+
18
+ **Creates:**
19
+ - `.planning/DATA_REPORT.md` — comprehensive data profile and leakage analysis
20
+
21
+ **Use cases:**
22
+ - New dataset: Understand data characteristics before modeling
23
+ - Suspicious results: Check for leakage or data quality issues
24
+ - Feature engineering: Identify patterns and anomalies to inform feature creation
25
+ - Debugging: Profile data when model behavior is unexpected
26
+
27
+ **After this command:** Review DATA_REPORT.md for issues, then proceed with hypothesis formation and experimentation.
28
+
29
+ </objective>
30
+
31
+ <execution_context>
32
+
33
+ @~/.claude/get-research-done/templates/data-report.md
34
+
35
+ </execution_context>
36
+
37
+ <process>
38
+
39
+ ## Phase 1: Setup and Data Path Resolution
40
+
41
+ **Check if project initialized:**
42
+
43
+ ```bash
44
+ [ ! -f .planning/PROJECT.md ] && echo "ERROR: Project not initialized. Run /grd:new-project first." && exit 1
45
+ ```
46
+
47
+ **Determine data path:**
48
+
49
+ If [path] argument provided:
50
+ - Use it directly
51
+ - Validate path exists
52
+
53
+ If no argument:
54
+ - Check for common data directories (./data/, ./datasets/, ./raw/)
55
+ - If found, list contents and ask user to select
56
+ - If not found, ask user to provide path interactively
57
+
58
+ **Validate data source:**
59
+
60
+ ```bash
61
+ # Check if path exists
62
+ if [ -f "$DATA_PATH" ]; then
63
+ echo "Single file: $DATA_PATH"
64
+ elif [ -d "$DATA_PATH" ]; then
65
+ echo "Directory: $DATA_PATH"
66
+ # List data files
67
+ find "$DATA_PATH" -type f \( -name "*.csv" -o -name "*.parquet" -o -name "*.json" -o -name "*.jsonl" \) | head -20
68
+ else
69
+ echo "ERROR: Path not found: $DATA_PATH"
70
+ exit 1
71
+ fi
72
+ ```
73
+
74
+ **Check for flags:**
75
+
76
+ - `--detailed`: Enable full profiling mode (histograms, percentiles, skewness, correlation heatmaps)
77
+ - Default: Quick profiling (basic stats, outliers, leakage checks)
78
+
79
+ ## Phase 2: Spawn Explorer Agent
80
+
81
+ Display exploration banner:
82
+ ```
83
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
84
+ GRD ► EXPLORING DATA
85
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
86
+
87
+ Analyzing: [data_path]
88
+ Mode: [quick | detailed]
89
+ ```
90
+
91
+ Spawn grd-explorer agent with context:
92
+
93
+ ```
94
+ Task(prompt="
95
+ <data_source>
96
+ Path: [data_path]
97
+ Type: [file | directory]
98
+ </data_source>
99
+
100
+ <profiling_mode>
101
+ [quick | detailed]
102
+
103
+ Quick: Basic stats, distributions, outliers, leakage checks (fast)
104
+ Detailed: Full profiling with histograms, percentiles, skewness, correlation matrices (comprehensive)
105
+ </profiling_mode>
106
+
107
+ <project_context>
108
+ @.planning/PROJECT.md
109
+
110
+ Extract:
111
+ - What this project is about
112
+ - What the target variable might be (if ML project)
113
+ - Any known data characteristics
114
+ </project_context>
115
+
116
+ <instructions>
117
+ Execute data exploration workflow:
118
+
119
+ 1. Load data (handle CSV, Parquet, JSON, JSONL)
120
+ 2. Profile structure and distributions
121
+ 3. Detect missing data patterns (MCAR/MAR/MNAR)
122
+ 4. Find outliers and anomalies
123
+ 5. Check class balance (if target identified)
124
+ 6. Detect potential data leakage
125
+ 7. Generate recommendations
126
+
127
+ Write: .planning/DATA_REPORT.md
128
+ Use template: ~/.claude/get-research-done/templates/data-report.md
129
+ </instructions>
130
+
131
+ <output>
132
+ Return DATA_REPORT.md path when complete.
133
+ </output>
134
+ ", subagent_type="grd-explorer", model="sonnet", description="Explore and profile data")
135
+ ```
136
+
137
+ ## Phase 3: Present Results
138
+
139
+ After agent completes, read DATA_REPORT.md and present key findings:
140
+
141
+ ```
142
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
143
+ GRD ► EXPLORATION COMPLETE ✓
144
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
145
+
146
+ ## Dataset Summary
147
+
148
+ **Rows:** [count] | **Columns:** [count] | **Memory:** [size]
149
+
150
+ ## Key Findings
151
+
152
+ ### Must Address (Blocking)
153
+ [List critical issues from recommendations]
154
+
155
+ ### Should Address (Non-blocking)
156
+ [List recommended fixes]
157
+
158
+ ### Leakage Risks
159
+ [High/medium confidence leakage indicators]
160
+
161
+ ### Data Quality
162
+ [Missing data, outliers, imbalance summary]
163
+
164
+ ---
165
+
166
+ **Full report:** `.planning/DATA_REPORT.md`
167
+
168
+ **Next steps:**
169
+ - Address blocking issues before modeling
170
+ - Consider should-fix items for better results
171
+ - Review leakage risks carefully—high confidence indicates problems
172
+ ```
173
+
174
+ **If critical issues found:**
175
+
176
+ Offer to create tasks/reminders for fixing them:
177
+
178
+ Use AskUserQuestion:
179
+ - header: "Data Issues"
180
+ - question: "Critical data issues detected. Create follow-up tasks?"
181
+ - options:
182
+ - "Yes" — Add to project backlog
183
+ - "No" — I'll handle manually
184
+
185
+ If yes, create TODO entries or add to requirements tracking.
186
+
187
+ </process>
188
+
189
+ <arguments>
190
+
191
+ **[path]** (optional)
192
+ - Path to data file or directory
193
+ - Examples: `./data/train.csv`, `s3://bucket/data.parquet`, `./datasets/`
194
+ - If omitted, will prompt interactively
195
+
196
+ **Flags:**
197
+
198
+ `--detailed`
199
+ - Enable comprehensive profiling
200
+ - Includes: histograms, percentiles, skewness, kurtosis, correlation matrices
201
+ - Use when: Deep analysis needed or investigating specific issues
202
+ - Default: Quick mode (faster, covers essentials)
203
+
204
+ </arguments>
205
+
206
+ <examples>
207
+
208
+ **Explore single file:**
209
+ ```
210
+ /grd:explore ./data/train.csv
211
+ ```
212
+
213
+ **Explore directory:**
214
+ ```
215
+ /grd:explore ./datasets/
216
+ ```
217
+
218
+ **Detailed profiling:**
219
+ ```
220
+ /grd:explore ./data/train.csv --detailed
221
+ ```
222
+
223
+ **Interactive mode (no arguments):**
224
+ ```
225
+ /grd:explore
226
+ # Will prompt for path
227
+ ```
228
+
229
+ **Remote data:**
230
+ ```
231
+ /grd:explore s3://my-bucket/data.parquet
232
+ ```
233
+
234
+ </examples>
235
+
236
+ <output>
237
+
238
+ - `.planning/DATA_REPORT.md` — comprehensive data profile with:
239
+ - Data overview (shape, types, memory)
240
+ - Column summaries (types, nulls, unique values)
241
+ - Distributions and statistics
242
+ - Missing data analysis
243
+ - Outlier detection
244
+ - Class balance (if target specified)
245
+ - Data leakage analysis
246
+ - Recommendations
247
+
248
+ </output>
249
+
250
+ <success_criteria>
251
+
252
+ - [ ] Data path resolved (from argument or user input)
253
+ - [ ] grd-explorer agent spawned with context
254
+ - [ ] DATA_REPORT.md generated in .planning/
255
+ - [ ] Key findings presented to user
256
+ - [ ] Critical issues surfaced with next steps
257
+
258
+ </success_criteria>