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,169 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Capture a forward-looking idea as a structured seed file with trigger conditions.
|
|
3
|
+
Seeds auto-surface during /gsd:new-milestone when trigger conditions match the
|
|
4
|
+
new milestone's scope.
|
|
5
|
+
|
|
6
|
+
Seeds beat deferred items because they:
|
|
7
|
+
- Preserve WHY the idea matters (not just WHAT)
|
|
8
|
+
- Define WHEN to surface (trigger conditions, not manual scanning)
|
|
9
|
+
- Track breadcrumbs (code references, related decisions)
|
|
10
|
+
- Auto-present at the right time via new-milestone scan
|
|
11
|
+
</purpose>
|
|
12
|
+
|
|
13
|
+
<process>
|
|
14
|
+
|
|
15
|
+
<step name="parse_idea">
|
|
16
|
+
Parse `$ARGUMENTS` for the idea summary.
|
|
17
|
+
|
|
18
|
+
If empty, ask:
|
|
19
|
+
```
|
|
20
|
+
What's the idea? (one sentence)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Store as `$IDEA`.
|
|
24
|
+
</step>
|
|
25
|
+
|
|
26
|
+
<step name="create_seed_dir">
|
|
27
|
+
```bash
|
|
28
|
+
mkdir -p .planning/seeds
|
|
29
|
+
```
|
|
30
|
+
</step>
|
|
31
|
+
|
|
32
|
+
<step name="gather_context">
|
|
33
|
+
Ask focused questions to build a complete seed:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
AskUserQuestion(
|
|
37
|
+
header: "Trigger",
|
|
38
|
+
question: "When should this idea surface? (e.g., 'when we add user accounts', 'next major version', 'when performance becomes a priority')",
|
|
39
|
+
options: [] // freeform
|
|
40
|
+
)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Store as `$TRIGGER`.
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
AskUserQuestion(
|
|
47
|
+
header: "Why",
|
|
48
|
+
question: "Why does this matter? What problem does it solve or what opportunity does it create?",
|
|
49
|
+
options: []
|
|
50
|
+
)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Store as `$WHY`.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
AskUserQuestion(
|
|
57
|
+
header: "Scope",
|
|
58
|
+
question: "How big is this? (rough estimate)",
|
|
59
|
+
options: [
|
|
60
|
+
{ label: "Small", description: "A few hours — could be a quick task" },
|
|
61
|
+
{ label: "Medium", description: "A phase or two — needs planning" },
|
|
62
|
+
{ label: "Large", description: "A full milestone — significant effort" }
|
|
63
|
+
]
|
|
64
|
+
)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Store as `$SCOPE`.
|
|
68
|
+
</step>
|
|
69
|
+
|
|
70
|
+
<step name="collect_breadcrumbs">
|
|
71
|
+
Search the codebase for relevant references:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Find files related to the idea keywords
|
|
75
|
+
grep -rl "$KEYWORD" --include="*.ts" --include="*.js" --include="*.md" . 2>/dev/null | head -10
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Also check:
|
|
79
|
+
- Current STATE.md for related decisions
|
|
80
|
+
- ROADMAP.md for related phases
|
|
81
|
+
- todos/ for related captured ideas
|
|
82
|
+
|
|
83
|
+
Store relevant file paths as `$BREADCRUMBS`.
|
|
84
|
+
</step>
|
|
85
|
+
|
|
86
|
+
<step name="generate_seed_id">
|
|
87
|
+
```bash
|
|
88
|
+
# Find next seed number
|
|
89
|
+
EXISTING=$( (ls .planning/seeds/SEED-*.md 2>/dev/null || true) | wc -l )
|
|
90
|
+
NEXT=$((EXISTING + 1))
|
|
91
|
+
PADDED=$(printf "%03d" $NEXT)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Generate slug from idea summary.
|
|
95
|
+
</step>
|
|
96
|
+
|
|
97
|
+
<step name="write_seed">
|
|
98
|
+
Write `.planning/seeds/SEED-{PADDED}-{slug}.md`:
|
|
99
|
+
|
|
100
|
+
```markdown
|
|
101
|
+
---
|
|
102
|
+
id: SEED-{PADDED}
|
|
103
|
+
status: dormant
|
|
104
|
+
planted: {ISO date}
|
|
105
|
+
planted_during: {current milestone/phase from STATE.md}
|
|
106
|
+
trigger_when: {$TRIGGER}
|
|
107
|
+
scope: {$SCOPE}
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
# SEED-{PADDED}: {$IDEA}
|
|
111
|
+
|
|
112
|
+
## Why This Matters
|
|
113
|
+
|
|
114
|
+
{$WHY}
|
|
115
|
+
|
|
116
|
+
## When to Surface
|
|
117
|
+
|
|
118
|
+
**Trigger:** {$TRIGGER}
|
|
119
|
+
|
|
120
|
+
This seed should be presented during `/gsd:new-milestone` when the milestone
|
|
121
|
+
scope matches any of these conditions:
|
|
122
|
+
- {trigger condition 1}
|
|
123
|
+
- {trigger condition 2}
|
|
124
|
+
|
|
125
|
+
## Scope Estimate
|
|
126
|
+
|
|
127
|
+
**{$SCOPE}** — {elaboration based on scope choice}
|
|
128
|
+
|
|
129
|
+
## Breadcrumbs
|
|
130
|
+
|
|
131
|
+
Related code and decisions found in the current codebase:
|
|
132
|
+
|
|
133
|
+
{list of $BREADCRUMBS with file paths}
|
|
134
|
+
|
|
135
|
+
## Notes
|
|
136
|
+
|
|
137
|
+
{any additional context from the current session}
|
|
138
|
+
```
|
|
139
|
+
</step>
|
|
140
|
+
|
|
141
|
+
<step name="commit_seed">
|
|
142
|
+
```bash
|
|
143
|
+
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs: plant seed — {$IDEA}" --files .planning/seeds/SEED-{PADDED}-{slug}.md
|
|
144
|
+
```
|
|
145
|
+
</step>
|
|
146
|
+
|
|
147
|
+
<step name="confirm">
|
|
148
|
+
```
|
|
149
|
+
✅ Seed planted: SEED-{PADDED}
|
|
150
|
+
|
|
151
|
+
"{$IDEA}"
|
|
152
|
+
Trigger: {$TRIGGER}
|
|
153
|
+
Scope: {$SCOPE}
|
|
154
|
+
File: .planning/seeds/SEED-{PADDED}-{slug}.md
|
|
155
|
+
|
|
156
|
+
This seed will surface automatically when you run /gsd:new-milestone
|
|
157
|
+
and the milestone scope matches the trigger condition.
|
|
158
|
+
```
|
|
159
|
+
</step>
|
|
160
|
+
|
|
161
|
+
</process>
|
|
162
|
+
|
|
163
|
+
<success_criteria>
|
|
164
|
+
- [ ] Seed file created in .planning/seeds/
|
|
165
|
+
- [ ] Frontmatter includes status, trigger, scope
|
|
166
|
+
- [ ] Breadcrumbs collected from codebase
|
|
167
|
+
- [ ] Committed to git
|
|
168
|
+
- [ ] User shown confirmation with trigger info
|
|
169
|
+
</success_criteria>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Create a clean branch for pull requests by filtering out .planning/ commits.
|
|
3
|
+
The PR branch contains only code changes — reviewers don't see GSD artifacts
|
|
4
|
+
(PLAN.md, SUMMARY.md, STATE.md, CONTEXT.md, etc.).
|
|
5
|
+
|
|
6
|
+
Uses git cherry-pick with path filtering to rebuild a clean history.
|
|
7
|
+
</purpose>
|
|
8
|
+
|
|
9
|
+
<process>
|
|
10
|
+
|
|
11
|
+
<step name="detect_state">
|
|
12
|
+
Parse `$ARGUMENTS` for target branch (default: `main`).
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
CURRENT_BRANCH=$(git branch --show-current)
|
|
16
|
+
TARGET=${1:-main}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Check preconditions:
|
|
20
|
+
- Must be on a feature branch (not main/master)
|
|
21
|
+
- Must have commits ahead of target
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
AHEAD=$(git rev-list --count "$TARGET".."$CURRENT_BRANCH" 2>/dev/null)
|
|
25
|
+
if [ "$AHEAD" = "0" ]; then
|
|
26
|
+
echo "No commits ahead of $TARGET — nothing to filter."
|
|
27
|
+
exit 0
|
|
28
|
+
fi
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Display:
|
|
32
|
+
```
|
|
33
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
34
|
+
GSD ► PR BRANCH
|
|
35
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
36
|
+
|
|
37
|
+
Branch: {CURRENT_BRANCH}
|
|
38
|
+
Target: {TARGET}
|
|
39
|
+
Commits: {AHEAD} ahead
|
|
40
|
+
```
|
|
41
|
+
</step>
|
|
42
|
+
|
|
43
|
+
<step name="analyze_commits">
|
|
44
|
+
Classify commits:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Get all commits ahead of target
|
|
48
|
+
git log --oneline "$TARGET".."$CURRENT_BRANCH" --no-merges
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For each commit, check if it ONLY touches .planning/ files:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# For each commit hash
|
|
55
|
+
FILES=$(git diff-tree --no-commit-id --name-only -r $HASH)
|
|
56
|
+
ALL_PLANNING=$(echo "$FILES" | grep -v "^\.planning/" | wc -l)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Classify:
|
|
60
|
+
- **Code commits**: Touch at least one non-.planning/ file → INCLUDE
|
|
61
|
+
- **Planning-only commits**: Touch only .planning/ files → EXCLUDE
|
|
62
|
+
- **Mixed commits**: Touch both → INCLUDE (planning changes come along)
|
|
63
|
+
|
|
64
|
+
Display analysis:
|
|
65
|
+
```
|
|
66
|
+
Commits to include: {N} (code changes)
|
|
67
|
+
Commits to exclude: {N} (planning-only)
|
|
68
|
+
Mixed commits: {N} (code + planning — included)
|
|
69
|
+
```
|
|
70
|
+
</step>
|
|
71
|
+
|
|
72
|
+
<step name="create_pr_branch">
|
|
73
|
+
```bash
|
|
74
|
+
PR_BRANCH="${CURRENT_BRANCH}-pr"
|
|
75
|
+
|
|
76
|
+
# Create PR branch from target
|
|
77
|
+
git checkout -b "$PR_BRANCH" "$TARGET"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Cherry-pick only code commits (in order):
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
for HASH in $CODE_COMMITS; do
|
|
84
|
+
git cherry-pick "$HASH" --no-commit
|
|
85
|
+
# Remove any .planning/ files that came along in mixed commits
|
|
86
|
+
git rm -r --cached .planning/ 2>/dev/null || true
|
|
87
|
+
git commit -C "$HASH"
|
|
88
|
+
done
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Return to original branch:
|
|
92
|
+
```bash
|
|
93
|
+
git checkout "$CURRENT_BRANCH"
|
|
94
|
+
```
|
|
95
|
+
</step>
|
|
96
|
+
|
|
97
|
+
<step name="verify">
|
|
98
|
+
```bash
|
|
99
|
+
# Verify no .planning/ files in PR branch
|
|
100
|
+
PLANNING_FILES=$(git diff --name-only "$TARGET".."$PR_BRANCH" | grep "^\.planning/" | wc -l)
|
|
101
|
+
TOTAL_FILES=$(git diff --name-only "$TARGET".."$PR_BRANCH" | wc -l)
|
|
102
|
+
PR_COMMITS=$(git rev-list --count "$TARGET".."$PR_BRANCH")
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Display results:
|
|
106
|
+
```
|
|
107
|
+
✅ PR branch created: {PR_BRANCH}
|
|
108
|
+
|
|
109
|
+
Original: {AHEAD} commits, {ORIGINAL_FILES} files
|
|
110
|
+
PR branch: {PR_COMMITS} commits, {TOTAL_FILES} files
|
|
111
|
+
Planning files: {PLANNING_FILES} (should be 0)
|
|
112
|
+
|
|
113
|
+
Next steps:
|
|
114
|
+
git push origin {PR_BRANCH}
|
|
115
|
+
gh pr create --base {TARGET} --head {PR_BRANCH}
|
|
116
|
+
|
|
117
|
+
Or use /gsd:ship to create the PR automatically.
|
|
118
|
+
```
|
|
119
|
+
</step>
|
|
120
|
+
|
|
121
|
+
</process>
|
|
122
|
+
|
|
123
|
+
<success_criteria>
|
|
124
|
+
- [ ] PR branch created from target
|
|
125
|
+
- [ ] Planning-only commits excluded
|
|
126
|
+
- [ ] No .planning/ files in PR branch diff
|
|
127
|
+
- [ ] Commit messages preserved from original
|
|
128
|
+
- [ ] User shown next steps
|
|
129
|
+
</success_criteria>
|