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.
- package/LICENSE +21 -0
- package/README.ja-JP.md +834 -0
- package/README.ko-KR.md +823 -0
- package/README.md +937 -0
- package/README.pt-BR.md +452 -0
- package/README.zh-CN.md +800 -0
- package/agents/gsd-advisor-researcher.md +104 -0
- package/agents/gsd-annotator.md +148 -0
- package/agents/gsd-arc-executor.md +537 -0
- package/agents/gsd-arc-planner.md +374 -0
- package/agents/gsd-assumptions-analyzer.md +105 -0
- package/agents/gsd-code-planner.md +155 -0
- package/agents/gsd-codebase-mapper.md +770 -0
- package/agents/gsd-debugger.md +1373 -0
- package/agents/gsd-executor.md +509 -0
- package/agents/gsd-integration-checker.md +443 -0
- package/agents/gsd-nyquist-auditor.md +176 -0
- package/agents/gsd-phase-researcher.md +698 -0
- package/agents/gsd-plan-checker.md +773 -0
- package/agents/gsd-planner.md +1354 -0
- package/agents/gsd-project-researcher.md +654 -0
- package/agents/gsd-prototyper.md +161 -0
- package/agents/gsd-research-synthesizer.md +247 -0
- package/agents/gsd-roadmapper.md +679 -0
- package/agents/gsd-ui-auditor.md +439 -0
- package/agents/gsd-ui-checker.md +300 -0
- package/agents/gsd-ui-researcher.md +357 -0
- package/agents/gsd-user-profiler.md +171 -0
- package/agents/gsd-verifier.md +700 -0
- package/bin/install.js +5009 -0
- package/commands/gsd/add-backlog.md +76 -0
- package/commands/gsd/add-phase.md +43 -0
- package/commands/gsd/add-tests.md +41 -0
- package/commands/gsd/add-todo.md +47 -0
- package/commands/gsd/annotate.md +54 -0
- package/commands/gsd/audit-milestone.md +36 -0
- package/commands/gsd/audit-uat.md +24 -0
- package/commands/gsd/autonomous.md +41 -0
- package/commands/gsd/check-todos.md +45 -0
- package/commands/gsd/cleanup.md +18 -0
- package/commands/gsd/complete-milestone.md +136 -0
- package/commands/gsd/debug.md +173 -0
- package/commands/gsd/deep-plan.md +52 -0
- package/commands/gsd/discuss-phase.md +64 -0
- package/commands/gsd/do.md +30 -0
- package/commands/gsd/execute-phase.md +59 -0
- package/commands/gsd/extract-plan.md +35 -0
- package/commands/gsd/fast.md +30 -0
- package/commands/gsd/forensics.md +56 -0
- package/commands/gsd/health.md +22 -0
- package/commands/gsd/help.md +22 -0
- package/commands/gsd/insert-phase.md +32 -0
- package/commands/gsd/iterate.md +124 -0
- package/commands/gsd/join-discord.md +18 -0
- package/commands/gsd/list-phase-assumptions.md +46 -0
- package/commands/gsd/list-workspaces.md +19 -0
- package/commands/gsd/manager.md +39 -0
- package/commands/gsd/map-codebase.md +71 -0
- package/commands/gsd/milestone-summary.md +51 -0
- package/commands/gsd/new-milestone.md +44 -0
- package/commands/gsd/new-project.md +42 -0
- package/commands/gsd/new-workspace.md +44 -0
- package/commands/gsd/next.md +24 -0
- package/commands/gsd/note.md +34 -0
- package/commands/gsd/pause-work.md +38 -0
- package/commands/gsd/plan-milestone-gaps.md +34 -0
- package/commands/gsd/plan-phase.md +47 -0
- package/commands/gsd/plant-seed.md +28 -0
- package/commands/gsd/pr-branch.md +25 -0
- package/commands/gsd/profile-user.md +46 -0
- package/commands/gsd/progress.md +24 -0
- package/commands/gsd/prototype.md +56 -0
- package/commands/gsd/quick.md +47 -0
- package/commands/gsd/reapply-patches.md +123 -0
- package/commands/gsd/remove-phase.md +31 -0
- package/commands/gsd/remove-workspace.md +26 -0
- package/commands/gsd/research-phase.md +195 -0
- package/commands/gsd/resume-work.md +40 -0
- package/commands/gsd/review-backlog.md +61 -0
- package/commands/gsd/review.md +37 -0
- package/commands/gsd/session-report.md +19 -0
- package/commands/gsd/set-mode.md +41 -0
- package/commands/gsd/set-profile.md +12 -0
- package/commands/gsd/settings.md +36 -0
- package/commands/gsd/ship.md +23 -0
- package/commands/gsd/stats.md +18 -0
- package/commands/gsd/thread.md +127 -0
- package/commands/gsd/ui-phase.md +34 -0
- package/commands/gsd/ui-review.md +32 -0
- package/commands/gsd/update.md +37 -0
- package/commands/gsd/validate-phase.md +35 -0
- package/commands/gsd/verify-work.md +38 -0
- package/commands/gsd/workstreams.md +63 -0
- package/get-shit-done/bin/gsd-tools.cjs +946 -0
- package/get-shit-done/bin/lib/arc-scanner.cjs +341 -0
- package/get-shit-done/bin/lib/commands.cjs +959 -0
- package/get-shit-done/bin/lib/config.cjs +466 -0
- package/get-shit-done/bin/lib/core.cjs +1230 -0
- package/get-shit-done/bin/lib/frontmatter.cjs +336 -0
- package/get-shit-done/bin/lib/init.cjs +1442 -0
- package/get-shit-done/bin/lib/milestone.cjs +252 -0
- package/get-shit-done/bin/lib/model-profiles.cjs +68 -0
- package/get-shit-done/bin/lib/phase.cjs +888 -0
- package/get-shit-done/bin/lib/profile-output.cjs +952 -0
- package/get-shit-done/bin/lib/profile-pipeline.cjs +539 -0
- package/get-shit-done/bin/lib/roadmap.cjs +329 -0
- package/get-shit-done/bin/lib/security.cjs +382 -0
- package/get-shit-done/bin/lib/state.cjs +1031 -0
- package/get-shit-done/bin/lib/template.cjs +222 -0
- package/get-shit-done/bin/lib/uat.cjs +282 -0
- package/get-shit-done/bin/lib/verify.cjs +888 -0
- package/get-shit-done/bin/lib/workstream.cjs +491 -0
- package/get-shit-done/commands/gsd/workstreams.md +63 -0
- package/get-shit-done/references/arc-standard.md +315 -0
- package/get-shit-done/references/checkpoints.md +778 -0
- package/get-shit-done/references/continuation-format.md +249 -0
- package/get-shit-done/references/decimal-phase-calculation.md +64 -0
- package/get-shit-done/references/git-integration.md +295 -0
- package/get-shit-done/references/git-planning-commit.md +38 -0
- package/get-shit-done/references/model-profile-resolution.md +36 -0
- package/get-shit-done/references/model-profiles.md +139 -0
- package/get-shit-done/references/phase-argument-parsing.md +61 -0
- package/get-shit-done/references/planning-config.md +202 -0
- package/get-shit-done/references/questioning.md +162 -0
- package/get-shit-done/references/tdd.md +263 -0
- package/get-shit-done/references/ui-brand.md +160 -0
- package/get-shit-done/references/user-profiling.md +681 -0
- package/get-shit-done/references/verification-patterns.md +612 -0
- package/get-shit-done/references/workstream-flag.md +58 -0
- package/get-shit-done/templates/DEBUG.md +164 -0
- package/get-shit-done/templates/UAT.md +265 -0
- package/get-shit-done/templates/UI-SPEC.md +100 -0
- package/get-shit-done/templates/VALIDATION.md +76 -0
- package/get-shit-done/templates/claude-md.md +122 -0
- package/get-shit-done/templates/codebase/architecture.md +255 -0
- package/get-shit-done/templates/codebase/concerns.md +310 -0
- package/get-shit-done/templates/codebase/conventions.md +307 -0
- package/get-shit-done/templates/codebase/integrations.md +280 -0
- package/get-shit-done/templates/codebase/stack.md +186 -0
- package/get-shit-done/templates/codebase/structure.md +285 -0
- package/get-shit-done/templates/codebase/testing.md +480 -0
- package/get-shit-done/templates/config.json +44 -0
- package/get-shit-done/templates/context.md +352 -0
- package/get-shit-done/templates/continue-here.md +78 -0
- package/get-shit-done/templates/copilot-instructions.md +7 -0
- package/get-shit-done/templates/debug-subagent-prompt.md +91 -0
- package/get-shit-done/templates/dev-preferences.md +21 -0
- package/get-shit-done/templates/discovery.md +146 -0
- package/get-shit-done/templates/discussion-log.md +63 -0
- package/get-shit-done/templates/milestone-archive.md +123 -0
- package/get-shit-done/templates/milestone.md +115 -0
- package/get-shit-done/templates/phase-prompt.md +610 -0
- package/get-shit-done/templates/planner-subagent-prompt.md +117 -0
- package/get-shit-done/templates/project.md +186 -0
- package/get-shit-done/templates/requirements.md +231 -0
- package/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
- package/get-shit-done/templates/research-project/FEATURES.md +147 -0
- package/get-shit-done/templates/research-project/PITFALLS.md +200 -0
- package/get-shit-done/templates/research-project/STACK.md +120 -0
- package/get-shit-done/templates/research-project/SUMMARY.md +170 -0
- package/get-shit-done/templates/research.md +552 -0
- package/get-shit-done/templates/retrospective.md +54 -0
- package/get-shit-done/templates/roadmap.md +202 -0
- package/get-shit-done/templates/state.md +176 -0
- package/get-shit-done/templates/summary-complex.md +59 -0
- package/get-shit-done/templates/summary-minimal.md +41 -0
- package/get-shit-done/templates/summary-standard.md +48 -0
- package/get-shit-done/templates/summary.md +248 -0
- package/get-shit-done/templates/user-profile.md +146 -0
- package/get-shit-done/templates/user-setup.md +311 -0
- package/get-shit-done/templates/verification-report.md +322 -0
- package/get-shit-done/workflows/add-phase.md +112 -0
- package/get-shit-done/workflows/add-tests.md +351 -0
- package/get-shit-done/workflows/add-todo.md +158 -0
- package/get-shit-done/workflows/audit-milestone.md +340 -0
- package/get-shit-done/workflows/audit-uat.md +109 -0
- package/get-shit-done/workflows/autonomous.md +891 -0
- package/get-shit-done/workflows/check-todos.md +177 -0
- package/get-shit-done/workflows/cleanup.md +152 -0
- package/get-shit-done/workflows/complete-milestone.md +767 -0
- package/get-shit-done/workflows/diagnose-issues.md +231 -0
- package/get-shit-done/workflows/discovery-phase.md +289 -0
- package/get-shit-done/workflows/discuss-phase-assumptions.md +653 -0
- package/get-shit-done/workflows/discuss-phase.md +1049 -0
- package/get-shit-done/workflows/do.md +104 -0
- package/get-shit-done/workflows/execute-phase.md +846 -0
- package/get-shit-done/workflows/execute-plan.md +514 -0
- package/get-shit-done/workflows/fast.md +105 -0
- package/get-shit-done/workflows/forensics.md +265 -0
- package/get-shit-done/workflows/health.md +181 -0
- package/get-shit-done/workflows/help.md +634 -0
- package/get-shit-done/workflows/insert-phase.md +130 -0
- package/get-shit-done/workflows/list-phase-assumptions.md +178 -0
- package/get-shit-done/workflows/list-workspaces.md +56 -0
- package/get-shit-done/workflows/manager.md +362 -0
- package/get-shit-done/workflows/map-codebase.md +377 -0
- package/get-shit-done/workflows/milestone-summary.md +223 -0
- package/get-shit-done/workflows/new-milestone.md +486 -0
- package/get-shit-done/workflows/new-project.md +1250 -0
- package/get-shit-done/workflows/new-workspace.md +237 -0
- package/get-shit-done/workflows/next.md +97 -0
- package/get-shit-done/workflows/node-repair.md +92 -0
- package/get-shit-done/workflows/note.md +156 -0
- package/get-shit-done/workflows/pause-work.md +176 -0
- package/get-shit-done/workflows/plan-milestone-gaps.md +273 -0
- package/get-shit-done/workflows/plan-phase.md +859 -0
- package/get-shit-done/workflows/plant-seed.md +169 -0
- package/get-shit-done/workflows/pr-branch.md +129 -0
- package/get-shit-done/workflows/profile-user.md +450 -0
- package/get-shit-done/workflows/progress.md +507 -0
- package/get-shit-done/workflows/quick.md +757 -0
- package/get-shit-done/workflows/remove-phase.md +155 -0
- package/get-shit-done/workflows/remove-workspace.md +90 -0
- package/get-shit-done/workflows/research-phase.md +82 -0
- package/get-shit-done/workflows/resume-project.md +326 -0
- package/get-shit-done/workflows/review.md +228 -0
- package/get-shit-done/workflows/session-report.md +146 -0
- package/get-shit-done/workflows/settings.md +283 -0
- package/get-shit-done/workflows/ship.md +228 -0
- package/get-shit-done/workflows/stats.md +60 -0
- package/get-shit-done/workflows/transition.md +671 -0
- package/get-shit-done/workflows/ui-phase.md +302 -0
- package/get-shit-done/workflows/ui-review.md +165 -0
- package/get-shit-done/workflows/update.md +323 -0
- package/get-shit-done/workflows/validate-phase.md +174 -0
- package/get-shit-done/workflows/verify-phase.md +254 -0
- package/get-shit-done/workflows/verify-work.md +637 -0
- package/hooks/dist/gsd-check-update.js +114 -0
- package/hooks/dist/gsd-context-monitor.js +156 -0
- package/hooks/dist/gsd-prompt-guard.js +96 -0
- package/hooks/dist/gsd-statusline.js +119 -0
- package/hooks/dist/gsd-workflow-guard.js +94 -0
- package/package.json +52 -0
- package/scripts/base64-scan.sh +262 -0
- package/scripts/build-hooks.js +82 -0
- package/scripts/prompt-injection-scan.sh +198 -0
- package/scripts/run-tests.cjs +29 -0
- package/scripts/secret-scan.sh +227 -0
|
@@ -0,0 +1,377 @@
|
|
|
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
|
+
<available_agent_types>
|
|
10
|
+
Valid GSD subagent types (use exact names — do not fall back to 'general-purpose'):
|
|
11
|
+
- gsd-codebase-mapper — Maps project structure and dependencies
|
|
12
|
+
</available_agent_types>
|
|
13
|
+
|
|
14
|
+
<philosophy>
|
|
15
|
+
**Why dedicated mapper agents:**
|
|
16
|
+
- Fresh context per domain (no token contamination)
|
|
17
|
+
- Agents write documents directly (no context transfer back to orchestrator)
|
|
18
|
+
- Orchestrator only summarizes what was created (minimal context usage)
|
|
19
|
+
- Faster execution (agents run simultaneously)
|
|
20
|
+
|
|
21
|
+
**Document quality over length:**
|
|
22
|
+
Include enough detail to be useful as reference. Prioritize practical examples (especially code patterns) over arbitrary brevity.
|
|
23
|
+
|
|
24
|
+
**Always include file paths:**
|
|
25
|
+
Documents are reference material for Claude when planning/executing. Always include actual file paths formatted with backticks: `src/services/user.ts`.
|
|
26
|
+
</philosophy>
|
|
27
|
+
|
|
28
|
+
<process>
|
|
29
|
+
|
|
30
|
+
<step name="init_context" priority="first">
|
|
31
|
+
Load codebase mapping context:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init map-codebase)
|
|
35
|
+
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
|
36
|
+
AGENT_SKILLS_MAPPER=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" agent-skills gsd-codebase-mapper 2>/dev/null)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Extract from init JSON: `mapper_model`, `commit_docs`, `codebase_dir`, `existing_maps`, `has_maps`, `codebase_dir_exists`.
|
|
40
|
+
</step>
|
|
41
|
+
|
|
42
|
+
<step name="check_existing">
|
|
43
|
+
Check if .planning/codebase/ already exists using `has_maps` from init context.
|
|
44
|
+
|
|
45
|
+
If `codebase_dir_exists` is true:
|
|
46
|
+
```bash
|
|
47
|
+
ls -la .planning/codebase/
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**If exists:**
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
.planning/codebase/ already exists with these documents:
|
|
54
|
+
[List files found]
|
|
55
|
+
|
|
56
|
+
What's next?
|
|
57
|
+
1. Refresh - Delete existing and remap codebase
|
|
58
|
+
2. Update - Keep existing, only update specific documents
|
|
59
|
+
3. Skip - Use existing codebase map as-is
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Wait for user response.
|
|
63
|
+
|
|
64
|
+
If "Refresh": Delete .planning/codebase/, continue to create_structure
|
|
65
|
+
If "Update": Ask which documents to update, continue to spawn_agents (filtered)
|
|
66
|
+
If "Skip": Exit workflow
|
|
67
|
+
|
|
68
|
+
**If doesn't exist:**
|
|
69
|
+
Continue to create_structure.
|
|
70
|
+
</step>
|
|
71
|
+
|
|
72
|
+
<step name="create_structure">
|
|
73
|
+
Create .planning/codebase/ directory:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
mkdir -p .planning/codebase
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Expected output files:**
|
|
80
|
+
- STACK.md (from tech mapper)
|
|
81
|
+
- INTEGRATIONS.md (from tech mapper)
|
|
82
|
+
- ARCHITECTURE.md (from arch mapper)
|
|
83
|
+
- STRUCTURE.md (from arch mapper)
|
|
84
|
+
- CONVENTIONS.md (from quality mapper)
|
|
85
|
+
- TESTING.md (from quality mapper)
|
|
86
|
+
- CONCERNS.md (from concerns mapper)
|
|
87
|
+
|
|
88
|
+
Continue to spawn_agents.
|
|
89
|
+
</step>
|
|
90
|
+
|
|
91
|
+
<step name="detect_runtime_capabilities">
|
|
92
|
+
Before spawning agents, detect whether the current runtime supports the `Task` tool for subagent delegation.
|
|
93
|
+
|
|
94
|
+
**How to detect:** Check if you have access to a `Task` tool (may be capitalized as `Task` or lowercase as `task` depending on runtime). If you do NOT have a `Task`/`task` tool (or only have tools like `browser_subagent` which is for web browsing, NOT code analysis):
|
|
95
|
+
|
|
96
|
+
→ **Skip `spawn_agents` and `collect_confirmations`** — go directly to `sequential_mapping` instead.
|
|
97
|
+
|
|
98
|
+
**CRITICAL:** Never use `browser_subagent` or `Explore` as a substitute for `Task`. The `browser_subagent` tool is exclusively for web page interaction and will fail for codebase analysis. If `Task` is unavailable, perform the mapping sequentially in-context.
|
|
99
|
+
</step>
|
|
100
|
+
|
|
101
|
+
<step name="spawn_agents" condition="Task tool is available">
|
|
102
|
+
Spawn 4 parallel gsd-codebase-mapper agents.
|
|
103
|
+
|
|
104
|
+
Use Task tool with `subagent_type="gsd-codebase-mapper"`, `model="{mapper_model}"`, and `run_in_background=true` for parallel execution.
|
|
105
|
+
|
|
106
|
+
**CRITICAL:** Use the dedicated `gsd-codebase-mapper` agent, NOT `Explore` or `browser_subagent`. The mapper agent writes documents directly.
|
|
107
|
+
|
|
108
|
+
**Agent 1: Tech Focus**
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
Task(
|
|
112
|
+
subagent_type="gsd-codebase-mapper",
|
|
113
|
+
model="{mapper_model}",
|
|
114
|
+
run_in_background=true,
|
|
115
|
+
description="Map codebase tech stack",
|
|
116
|
+
prompt="Focus: tech
|
|
117
|
+
|
|
118
|
+
Analyze this codebase for technology stack and external integrations.
|
|
119
|
+
|
|
120
|
+
Write these documents to .planning/codebase/:
|
|
121
|
+
- STACK.md - Languages, runtime, frameworks, dependencies, configuration
|
|
122
|
+
- INTEGRATIONS.md - External APIs, databases, auth providers, webhooks
|
|
123
|
+
|
|
124
|
+
Explore thoroughly. Write documents directly using templates. Return confirmation only.
|
|
125
|
+
${AGENT_SKILLS_MAPPER}"
|
|
126
|
+
)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Agent 2: Architecture Focus**
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Task(
|
|
133
|
+
subagent_type="gsd-codebase-mapper",
|
|
134
|
+
model="{mapper_model}",
|
|
135
|
+
run_in_background=true,
|
|
136
|
+
description="Map codebase architecture",
|
|
137
|
+
prompt="Focus: arch
|
|
138
|
+
|
|
139
|
+
Analyze this codebase architecture and directory structure.
|
|
140
|
+
|
|
141
|
+
Write these documents to .planning/codebase/:
|
|
142
|
+
- ARCHITECTURE.md - Pattern, layers, data flow, abstractions, entry points
|
|
143
|
+
- STRUCTURE.md - Directory layout, key locations, naming conventions
|
|
144
|
+
|
|
145
|
+
Explore thoroughly. Write documents directly using templates. Return confirmation only.
|
|
146
|
+
${AGENT_SKILLS_MAPPER}"
|
|
147
|
+
)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Agent 3: Quality Focus**
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
Task(
|
|
154
|
+
subagent_type="gsd-codebase-mapper",
|
|
155
|
+
model="{mapper_model}",
|
|
156
|
+
run_in_background=true,
|
|
157
|
+
description="Map codebase conventions",
|
|
158
|
+
prompt="Focus: quality
|
|
159
|
+
|
|
160
|
+
Analyze this codebase for coding conventions and testing patterns.
|
|
161
|
+
|
|
162
|
+
Write these documents to .planning/codebase/:
|
|
163
|
+
- CONVENTIONS.md - Code style, naming, patterns, error handling
|
|
164
|
+
- TESTING.md - Framework, structure, mocking, coverage
|
|
165
|
+
|
|
166
|
+
Explore thoroughly. Write documents directly using templates. Return confirmation only.
|
|
167
|
+
${AGENT_SKILLS_MAPPER}"
|
|
168
|
+
)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Agent 4: Concerns Focus**
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
Task(
|
|
175
|
+
subagent_type="gsd-codebase-mapper",
|
|
176
|
+
model="{mapper_model}",
|
|
177
|
+
run_in_background=true,
|
|
178
|
+
description="Map codebase concerns",
|
|
179
|
+
prompt="Focus: concerns
|
|
180
|
+
|
|
181
|
+
Analyze this codebase for technical debt, known issues, and areas of concern.
|
|
182
|
+
|
|
183
|
+
Write this document to .planning/codebase/:
|
|
184
|
+
- CONCERNS.md - Tech debt, bugs, security, performance, fragile areas
|
|
185
|
+
|
|
186
|
+
Explore thoroughly. Write document directly using template. Return confirmation only.
|
|
187
|
+
${AGENT_SKILLS_MAPPER}"
|
|
188
|
+
)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Continue to collect_confirmations.
|
|
192
|
+
</step>
|
|
193
|
+
|
|
194
|
+
<step name="collect_confirmations">
|
|
195
|
+
Wait for all 4 agents to complete using TaskOutput tool.
|
|
196
|
+
|
|
197
|
+
**For each agent task_id returned by the Agent tool calls above:**
|
|
198
|
+
```
|
|
199
|
+
TaskOutput tool:
|
|
200
|
+
task_id: "{task_id from Agent result}"
|
|
201
|
+
block: true
|
|
202
|
+
timeout: 300000
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Call TaskOutput for all 4 agents in parallel (single message with 4 TaskOutput calls).
|
|
206
|
+
|
|
207
|
+
Once all TaskOutput calls return, read each agent's output file to collect confirmations.
|
|
208
|
+
|
|
209
|
+
**Expected confirmation format from each agent:**
|
|
210
|
+
```
|
|
211
|
+
## Mapping Complete
|
|
212
|
+
|
|
213
|
+
**Focus:** {focus}
|
|
214
|
+
**Documents written:**
|
|
215
|
+
- `.planning/codebase/{DOC1}.md` ({N} lines)
|
|
216
|
+
- `.planning/codebase/{DOC2}.md` ({N} lines)
|
|
217
|
+
|
|
218
|
+
Ready for orchestrator summary.
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**What you receive:** Just file paths and line counts. NOT document contents.
|
|
222
|
+
|
|
223
|
+
If any agent failed, note the failure and continue with successful documents.
|
|
224
|
+
|
|
225
|
+
Continue to verify_output.
|
|
226
|
+
</step>
|
|
227
|
+
|
|
228
|
+
<step name="sequential_mapping" condition="Task tool is NOT available (e.g. Antigravity, Gemini CLI, Codex)">
|
|
229
|
+
When the `Task` tool is unavailable, perform codebase mapping sequentially in the current context. This replaces `spawn_agents` and `collect_confirmations`.
|
|
230
|
+
|
|
231
|
+
**IMPORTANT:** Do NOT use `browser_subagent`, `Explore`, or any browser-based tool. Use only file system tools (Read, Bash, Write, Grep, Glob, list_dir, view_file, grep_search, or equivalent tools available in your runtime).
|
|
232
|
+
|
|
233
|
+
Perform all 4 mapping passes sequentially:
|
|
234
|
+
|
|
235
|
+
**Pass 1: Tech Focus**
|
|
236
|
+
- Explore package.json/Cargo.toml/go.mod/requirements.txt, config files, dependency trees
|
|
237
|
+
- Write `.planning/codebase/STACK.md` — Languages, runtime, frameworks, dependencies, configuration
|
|
238
|
+
- Write `.planning/codebase/INTEGRATIONS.md` — External APIs, databases, auth providers, webhooks
|
|
239
|
+
|
|
240
|
+
**Pass 2: Architecture Focus**
|
|
241
|
+
- Explore directory structure, entry points, module boundaries, data flow
|
|
242
|
+
- Write `.planning/codebase/ARCHITECTURE.md` — Pattern, layers, data flow, abstractions, entry points
|
|
243
|
+
- Write `.planning/codebase/STRUCTURE.md` — Directory layout, key locations, naming conventions
|
|
244
|
+
|
|
245
|
+
**Pass 3: Quality Focus**
|
|
246
|
+
- Explore code style, error handling patterns, test files, CI config
|
|
247
|
+
- Write `.planning/codebase/CONVENTIONS.md` — Code style, naming, patterns, error handling
|
|
248
|
+
- Write `.planning/codebase/TESTING.md` — Framework, structure, mocking, coverage
|
|
249
|
+
|
|
250
|
+
**Pass 4: Concerns Focus**
|
|
251
|
+
- Explore TODOs, known issues, fragile areas, security patterns
|
|
252
|
+
- Write `.planning/codebase/CONCERNS.md` — Tech debt, bugs, security, performance, fragile areas
|
|
253
|
+
|
|
254
|
+
Use the same document templates as the `gsd-codebase-mapper` agent. Include actual file paths formatted with backticks.
|
|
255
|
+
|
|
256
|
+
Continue to verify_output.
|
|
257
|
+
</step>
|
|
258
|
+
|
|
259
|
+
<step name="verify_output">
|
|
260
|
+
Verify all documents created successfully:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
ls -la .planning/codebase/
|
|
264
|
+
wc -l .planning/codebase/*.md
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**Verification checklist:**
|
|
268
|
+
- All 7 documents exist
|
|
269
|
+
- No empty documents (each should have >20 lines)
|
|
270
|
+
|
|
271
|
+
If any documents missing or empty, note which agents may have failed.
|
|
272
|
+
|
|
273
|
+
Continue to scan_for_secrets.
|
|
274
|
+
</step>
|
|
275
|
+
|
|
276
|
+
<step name="scan_for_secrets">
|
|
277
|
+
**CRITICAL SECURITY CHECK:** Scan output files for accidentally leaked secrets before committing.
|
|
278
|
+
|
|
279
|
+
Run secret pattern detection:
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# Check for common API key patterns in generated docs
|
|
283
|
+
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
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**If SECRETS_FOUND=true:**
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
⚠️ SECURITY ALERT: Potential secrets detected in codebase documents!
|
|
290
|
+
|
|
291
|
+
Found patterns that look like API keys or tokens in:
|
|
292
|
+
[show grep output]
|
|
293
|
+
|
|
294
|
+
This would expose credentials if committed.
|
|
295
|
+
|
|
296
|
+
**Action required:**
|
|
297
|
+
1. Review the flagged content above
|
|
298
|
+
2. If these are real secrets, they must be removed before committing
|
|
299
|
+
3. Consider adding sensitive files to Claude Code "Deny" permissions
|
|
300
|
+
|
|
301
|
+
Pausing before commit. Reply "safe to proceed" if the flagged content is not actually sensitive, or edit the files first.
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Wait for user confirmation before continuing to commit_codebase_map.
|
|
305
|
+
|
|
306
|
+
**If SECRETS_FOUND=false:**
|
|
307
|
+
|
|
308
|
+
Continue to commit_codebase_map.
|
|
309
|
+
</step>
|
|
310
|
+
|
|
311
|
+
<step name="commit_codebase_map">
|
|
312
|
+
Commit the codebase map:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs: map existing codebase" --files .planning/codebase/*.md
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Continue to offer_next.
|
|
319
|
+
</step>
|
|
320
|
+
|
|
321
|
+
<step name="offer_next">
|
|
322
|
+
Present completion summary and next steps.
|
|
323
|
+
|
|
324
|
+
**Get line counts:**
|
|
325
|
+
```bash
|
|
326
|
+
wc -l .planning/codebase/*.md
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
**Output format:**
|
|
330
|
+
|
|
331
|
+
```
|
|
332
|
+
Codebase mapping complete.
|
|
333
|
+
|
|
334
|
+
Created .planning/codebase/:
|
|
335
|
+
- STACK.md ([N] lines) - Technologies and dependencies
|
|
336
|
+
- ARCHITECTURE.md ([N] lines) - System design and patterns
|
|
337
|
+
- STRUCTURE.md ([N] lines) - Directory layout and organization
|
|
338
|
+
- CONVENTIONS.md ([N] lines) - Code style and patterns
|
|
339
|
+
- TESTING.md ([N] lines) - Test structure and practices
|
|
340
|
+
- INTEGRATIONS.md ([N] lines) - External services and APIs
|
|
341
|
+
- CONCERNS.md ([N] lines) - Technical debt and issues
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## ▶ Next Up
|
|
347
|
+
|
|
348
|
+
**Initialize project** — use codebase context for planning
|
|
349
|
+
|
|
350
|
+
`/gsd:new-project`
|
|
351
|
+
|
|
352
|
+
<sub>`/clear` first → fresh context window</sub>
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
**Also available:**
|
|
357
|
+
- Re-run mapping: `/gsd:map-codebase`
|
|
358
|
+
- Review specific file: `cat .planning/codebase/STACK.md`
|
|
359
|
+
- Edit any document before proceeding
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
End workflow.
|
|
365
|
+
</step>
|
|
366
|
+
|
|
367
|
+
</process>
|
|
368
|
+
|
|
369
|
+
<success_criteria>
|
|
370
|
+
- .planning/codebase/ directory created
|
|
371
|
+
- If Task tool available: 4 parallel gsd-codebase-mapper agents spawned with run_in_background=true
|
|
372
|
+
- If Task tool NOT available: 4 sequential mapping passes performed inline (never using browser_subagent)
|
|
373
|
+
- All 7 codebase documents exist
|
|
374
|
+
- No empty documents (each should have >20 lines)
|
|
375
|
+
- Clear completion summary with line counts
|
|
376
|
+
- User offered clear next steps in GSD style
|
|
377
|
+
</success_criteria>
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# Milestone Summary Workflow
|
|
2
|
+
|
|
3
|
+
Generate a comprehensive, human-friendly project summary from completed milestone artifacts.
|
|
4
|
+
Designed for team onboarding — a new contributor can read the output and understand the entire project.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Step 1: Resolve Version
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
VERSION="$ARGUMENTS"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
If `$ARGUMENTS` is empty:
|
|
15
|
+
1. Check `.planning/STATE.md` for current milestone version
|
|
16
|
+
2. Check `.planning/milestones/` for the latest archived version
|
|
17
|
+
3. If neither found, check if `.planning/ROADMAP.md` exists (project may be mid-milestone)
|
|
18
|
+
4. If nothing found: error "No milestone found. Run /gsd:new-project or /gsd:new-milestone first."
|
|
19
|
+
|
|
20
|
+
Set `VERSION` to the resolved version (e.g., "1.0").
|
|
21
|
+
|
|
22
|
+
## Step 2: Locate Artifacts
|
|
23
|
+
|
|
24
|
+
Determine whether the milestone is **archived** or **current**:
|
|
25
|
+
|
|
26
|
+
**Archived milestone** (`.planning/milestones/v{VERSION}-ROADMAP.md` exists):
|
|
27
|
+
```
|
|
28
|
+
ROADMAP_PATH=".planning/milestones/v${VERSION}-ROADMAP.md"
|
|
29
|
+
REQUIREMENTS_PATH=".planning/milestones/v${VERSION}-REQUIREMENTS.md"
|
|
30
|
+
AUDIT_PATH=".planning/milestones/v${VERSION}-MILESTONE-AUDIT.md"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Current/in-progress milestone** (no archive yet):
|
|
34
|
+
```
|
|
35
|
+
ROADMAP_PATH=".planning/ROADMAP.md"
|
|
36
|
+
REQUIREMENTS_PATH=".planning/REQUIREMENTS.md"
|
|
37
|
+
AUDIT_PATH=".planning/v${VERSION}-MILESTONE-AUDIT.md"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Note: The audit file moves to `.planning/milestones/` on archive (per `complete-milestone` workflow). Check both locations as a fallback.
|
|
41
|
+
|
|
42
|
+
**Always available:**
|
|
43
|
+
```
|
|
44
|
+
PROJECT_PATH=".planning/PROJECT.md"
|
|
45
|
+
RETRO_PATH=".planning/RETROSPECTIVE.md"
|
|
46
|
+
STATE_PATH=".planning/STATE.md"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Read all files that exist. Missing files are fine — the summary adapts to what's available.
|
|
50
|
+
|
|
51
|
+
## Step 3: Discover Phase Artifacts
|
|
52
|
+
|
|
53
|
+
Find all phase directories:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
gsd-tools.cjs init progress
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This returns phase metadata. For each phase in the milestone scope:
|
|
60
|
+
|
|
61
|
+
- Read `{phase_dir}/{padded}-SUMMARY.md` if it exists — extract `one_liner`, `accomplishments`, `decisions`
|
|
62
|
+
- Read `{phase_dir}/{padded}-VERIFICATION.md` if it exists — extract status, gaps, deferred items
|
|
63
|
+
- Read `{phase_dir}/{padded}-CONTEXT.md` if it exists — extract key decisions from `<decisions>` section
|
|
64
|
+
- Read `{phase_dir}/{padded}-RESEARCH.md` if it exists — note what was researched
|
|
65
|
+
|
|
66
|
+
Track which phases have which artifacts.
|
|
67
|
+
|
|
68
|
+
**If no phase directories exist** (empty milestone or pre-build state): skip to Step 5 and generate a minimal summary noting "No phases have been executed yet." Do not error — the summary should still capture PROJECT.md and ROADMAP.md content.
|
|
69
|
+
|
|
70
|
+
## Step 4: Gather Git Statistics
|
|
71
|
+
|
|
72
|
+
Try each method in order until one succeeds:
|
|
73
|
+
|
|
74
|
+
**Method 1 — Tagged milestone** (check first):
|
|
75
|
+
```bash
|
|
76
|
+
git tag -l "v${VERSION}" | head -1
|
|
77
|
+
```
|
|
78
|
+
If the tag exists:
|
|
79
|
+
```bash
|
|
80
|
+
git log v${VERSION} --oneline | wc -l
|
|
81
|
+
git diff --stat $(git log --format=%H --reverse v${VERSION} | head -1)..v${VERSION}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Method 2 — STATE.md date range** (if no tag):
|
|
85
|
+
Read STATE.md and extract the `started_at` or earliest session date. Use it as the `--since` boundary:
|
|
86
|
+
```bash
|
|
87
|
+
git log --oneline --since="<started_at_date>" | wc -l
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Method 3 — Earliest phase commit** (if STATE.md has no date):
|
|
91
|
+
Find the earliest `.planning/phases/` commit:
|
|
92
|
+
```bash
|
|
93
|
+
git log --oneline --diff-filter=A -- ".planning/phases/" | tail -1
|
|
94
|
+
```
|
|
95
|
+
Use that commit's date as the start boundary.
|
|
96
|
+
|
|
97
|
+
**Method 4 — Skip stats** (if none of the above work):
|
|
98
|
+
Report "Git statistics unavailable — no tag or date range could be determined." This is not an error — the summary continues without the Stats section.
|
|
99
|
+
|
|
100
|
+
Extract (when available):
|
|
101
|
+
- Total commits in milestone
|
|
102
|
+
- Files changed, insertions, deletions
|
|
103
|
+
- Timeline (start date → end date)
|
|
104
|
+
- Contributors (from git log authors)
|
|
105
|
+
|
|
106
|
+
## Step 5: Generate Summary Document
|
|
107
|
+
|
|
108
|
+
Write to `.planning/reports/MILESTONE_SUMMARY-v${VERSION}.md`:
|
|
109
|
+
|
|
110
|
+
```markdown
|
|
111
|
+
# Milestone v{VERSION} — Project Summary
|
|
112
|
+
|
|
113
|
+
**Generated:** {date}
|
|
114
|
+
**Purpose:** Team onboarding and project review
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 1. Project Overview
|
|
119
|
+
|
|
120
|
+
{From PROJECT.md: "What This Is", core value proposition, target users}
|
|
121
|
+
{If mid-milestone: note which phases are complete vs in-progress}
|
|
122
|
+
|
|
123
|
+
## 2. Architecture & Technical Decisions
|
|
124
|
+
|
|
125
|
+
{From CONTEXT.md files across phases: key technical choices}
|
|
126
|
+
{From SUMMARY.md decisions: patterns, libraries, frameworks chosen}
|
|
127
|
+
{From PROJECT.md: tech stack if documented}
|
|
128
|
+
|
|
129
|
+
Present as a bulleted list of decisions with brief rationale:
|
|
130
|
+
- **Decision:** {what was chosen}
|
|
131
|
+
- **Why:** {rationale from CONTEXT.md}
|
|
132
|
+
- **Phase:** {which phase made this decision}
|
|
133
|
+
|
|
134
|
+
## 3. Phases Delivered
|
|
135
|
+
|
|
136
|
+
| Phase | Name | Status | One-Liner |
|
|
137
|
+
|-------|------|--------|-----------|
|
|
138
|
+
{For each phase: number, name, status (complete/in-progress/planned), one_liner from SUMMARY.md}
|
|
139
|
+
|
|
140
|
+
## 4. Requirements Coverage
|
|
141
|
+
|
|
142
|
+
{From REQUIREMENTS.md: list each requirement with status}
|
|
143
|
+
- ✅ {Requirement met}
|
|
144
|
+
- ⚠️ {Requirement partially met — note gap}
|
|
145
|
+
- ❌ {Requirement not met — note reason}
|
|
146
|
+
|
|
147
|
+
{If MILESTONE-AUDIT.md exists: include audit verdict}
|
|
148
|
+
|
|
149
|
+
## 5. Key Decisions Log
|
|
150
|
+
|
|
151
|
+
{Aggregate from all CONTEXT.md <decisions> sections}
|
|
152
|
+
{Each decision with: ID, description, phase, rationale}
|
|
153
|
+
|
|
154
|
+
## 6. Tech Debt & Deferred Items
|
|
155
|
+
|
|
156
|
+
{From VERIFICATION.md files: gaps found, anti-patterns noted}
|
|
157
|
+
{From RETROSPECTIVE.md: lessons learned, what to improve}
|
|
158
|
+
{From CONTEXT.md <deferred> sections: ideas parked for later}
|
|
159
|
+
|
|
160
|
+
## 7. Getting Started
|
|
161
|
+
|
|
162
|
+
{Entry points for new contributors:}
|
|
163
|
+
- **Run the project:** {from PROJECT.md or SUMMARY.md}
|
|
164
|
+
- **Key directories:** {from codebase structure}
|
|
165
|
+
- **Tests:** {test command from PROJECT.md or CLAUDE.md}
|
|
166
|
+
- **Where to look first:** {main entry points, core modules}
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Stats
|
|
171
|
+
|
|
172
|
+
- **Timeline:** {start} → {end} ({duration})
|
|
173
|
+
- **Phases:** {count complete} / {count total}
|
|
174
|
+
- **Commits:** {count}
|
|
175
|
+
- **Files changed:** {count} (+{insertions} / -{deletions})
|
|
176
|
+
- **Contributors:** {list}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Step 6: Write and Commit
|
|
180
|
+
|
|
181
|
+
**Overwrite guard:** If `.planning/reports/MILESTONE_SUMMARY-v${VERSION}.md` already exists, ask the user:
|
|
182
|
+
> "A milestone summary for v{VERSION} already exists. Overwrite it, or view the existing one?"
|
|
183
|
+
If "view": display existing file and skip to Step 8 (interactive mode). If "overwrite": proceed.
|
|
184
|
+
|
|
185
|
+
Create the reports directory if needed:
|
|
186
|
+
```bash
|
|
187
|
+
mkdir -p .planning/reports
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Write the summary, then commit:
|
|
191
|
+
```bash
|
|
192
|
+
gsd-tools.cjs commit "docs(v${VERSION}): generate milestone summary for onboarding" \
|
|
193
|
+
--files ".planning/reports/MILESTONE_SUMMARY-v${VERSION}.md"
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Step 7: Present Summary
|
|
197
|
+
|
|
198
|
+
Display the full summary document inline.
|
|
199
|
+
|
|
200
|
+
## Step 8: Offer Interactive Mode
|
|
201
|
+
|
|
202
|
+
After presenting the summary:
|
|
203
|
+
|
|
204
|
+
> "Summary written to `.planning/reports/MILESTONE_SUMMARY-v{VERSION}.md`.
|
|
205
|
+
>
|
|
206
|
+
> I have full context from the build artifacts. Want to ask anything about the project?
|
|
207
|
+
> Architecture decisions, specific phases, requirements, tech debt — ask away."
|
|
208
|
+
|
|
209
|
+
If the user asks questions:
|
|
210
|
+
- Answer from the artifacts already loaded (CONTEXT.md, SUMMARY.md, VERIFICATION.md, etc.)
|
|
211
|
+
- Reference specific files and decisions
|
|
212
|
+
- Stay grounded in what was actually built (not speculation)
|
|
213
|
+
|
|
214
|
+
If the user is done:
|
|
215
|
+
- Suggest next steps: `/gsd:new-milestone`, `/gsd:progress`, or sharing the summary with the team
|
|
216
|
+
|
|
217
|
+
## Step 9: Update STATE.md
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
gsd-tools.cjs state record-session \
|
|
221
|
+
--stopped-at "Milestone v${VERSION} summary generated" \
|
|
222
|
+
--resume-file ".planning/reports/MILESTONE_SUMMARY-v${VERSION}.md"
|
|
223
|
+
```
|