gsd-remix 1.0.2 → 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.
- package/README.md +13 -81
- package/README.zh-CN.md +13 -57
- package/agents/gsd-debugger.md +0 -3
- package/agents/gsd-executor.md +5 -11
- package/agents/gsd-phase-researcher.md +3 -107
- package/agents/gsd-plan-checker.md +0 -61
- package/agents/gsd-planner.md +4 -63
- package/agents/gsd-roadmapper.md +0 -29
- package/agents/gsd-security-auditor.md +62 -114
- package/agents/gsd-verifier.md +0 -3
- package/bin/install.js +20 -118
- package/commands/gsd/complete-milestone.md +0 -22
- package/commands/gsd/plan-phase.md +1 -2
- package/get-shit-done/bin/gsd-tools.cjs +5 -224
- package/get-shit-done/bin/lib/claude-md.cjs +427 -0
- package/get-shit-done/bin/lib/config-schema.cjs +2 -12
- package/get-shit-done/bin/lib/config.cjs +3 -12
- package/get-shit-done/bin/lib/core.cjs +4 -5
- package/get-shit-done/bin/lib/init.cjs +0 -163
- package/get-shit-done/bin/lib/model-profiles.cjs +12 -18
- package/get-shit-done/bin/lib/verify.cjs +0 -66
- package/get-shit-done/references/agent-contracts.md +0 -6
- package/get-shit-done/references/artifact-types.md +0 -30
- package/get-shit-done/references/continuation-format.md +0 -1
- package/get-shit-done/references/model-profiles.md +39 -37
- package/get-shit-done/references/planning-config.md +7 -12
- package/get-shit-done/references/verification-overrides.md +1 -1
- package/get-shit-done/templates/README.md +2 -9
- package/get-shit-done/templates/claude-md.md +0 -14
- package/get-shit-done/templates/config.json +5 -19
- package/get-shit-done/workflows/autonomous.md +9 -141
- package/get-shit-done/workflows/complete-milestone.md +3 -4
- package/get-shit-done/workflows/discuss-phase-assumptions.md +1 -18
- package/get-shit-done/workflows/discuss-phase.md +10 -104
- package/get-shit-done/workflows/do.md +1 -5
- package/get-shit-done/workflows/execute-phase.md +53 -103
- package/get-shit-done/workflows/execute-plan.md +4 -4
- package/get-shit-done/workflows/health.md +2 -5
- package/get-shit-done/workflows/help.md +0 -165
- package/get-shit-done/workflows/new-milestone.md +0 -51
- package/get-shit-done/workflows/new-project.md +2 -63
- package/get-shit-done/workflows/next.md +0 -23
- package/get-shit-done/workflows/pause-work.md +7 -15
- package/get-shit-done/workflows/plan-phase.md +20 -304
- package/get-shit-done/workflows/pr-branch.md +0 -1
- package/get-shit-done/workflows/progress.md +1 -68
- package/get-shit-done/workflows/quick.md +0 -3
- package/get-shit-done/workflows/research-phase.md +0 -1
- package/get-shit-done/workflows/settings.md +1 -57
- package/get-shit-done/workflows/transition.md +3 -86
- package/get-shit-done/workflows/verify-work.md +0 -64
- package/package.json +1 -1
- package/scripts/build-hooks.js +0 -2
- package/sdk/prompts/agents/gsd-executor.md +2 -0
- package/sdk/prompts/agents/gsd-plan-checker.md +0 -3
- package/sdk/prompts/agents/gsd-roadmapper.md +0 -29
- package/sdk/src/config.ts +4 -5
- package/sdk/src/golden/golden-integration-covered.ts +0 -2
- package/sdk/src/golden/golden-policy.ts +1 -1
- package/sdk/src/golden/golden.integration.test.ts +0 -27
- package/sdk/src/golden/read-only-golden-rows.ts +0 -15
- package/sdk/src/query/QUERY-HANDLERS.md +3 -34
- package/sdk/src/query/claude-md.ts +421 -0
- package/sdk/src/query/commit.test.ts +155 -1
- package/sdk/src/query/commit.ts +71 -17
- package/sdk/src/query/config-gates.test.ts +1 -2
- package/sdk/src/query/config-gates.ts +1 -5
- package/sdk/src/query/config-mutation.test.ts +0 -1
- package/sdk/src/query/config-mutation.ts +5 -6
- package/sdk/src/query/config-query.test.ts +2 -2
- package/sdk/src/query/config-query.ts +12 -18
- package/sdk/src/query/decomposed-handlers.test.ts +0 -64
- package/sdk/src/query/index.ts +4 -68
- package/sdk/src/query/init.test.ts +0 -64
- package/sdk/src/query/init.ts +0 -189
- package/sdk/src/query/normalize-query-command.ts +0 -2
- package/sdk/src/query/profile.test.ts +0 -43
- package/sdk/src/query/profile.ts +1 -141
- package/sdk/src/query/state-mutation.ts +18 -0
- package/sdk/src/runtime-health.ts +3 -3
- package/agents/gsd-ai-researcher.md +0 -133
- package/agents/gsd-doc-classifier.md +0 -168
- package/agents/gsd-doc-synthesizer.md +0 -204
- package/agents/gsd-doc-verifier.md +0 -217
- package/agents/gsd-doc-writer.md +0 -615
- package/agents/gsd-domain-researcher.md +0 -153
- package/agents/gsd-eval-auditor.md +0 -191
- package/agents/gsd-eval-planner.md +0 -154
- package/agents/gsd-framework-selector.md +0 -160
- package/agents/gsd-intel-updater.md +0 -334
- package/agents/gsd-nyquist-auditor.md +0 -203
- package/agents/gsd-ui-auditor.md +0 -495
- package/agents/gsd-ui-checker.md +0 -309
- package/agents/gsd-ui-researcher.md +0 -380
- package/agents/gsd-user-profiler.md +0 -171
- package/commands/gsd/ai-integration-phase.md +0 -36
- package/commands/gsd/analyze-dependencies.md +0 -34
- package/commands/gsd/audit-fix.md +0 -33
- package/commands/gsd/audit-milestone.md +0 -36
- package/commands/gsd/audit-uat.md +0 -24
- package/commands/gsd/docs-update.md +0 -48
- package/commands/gsd/eval-review.md +0 -32
- package/commands/gsd/explore.md +0 -27
- package/commands/gsd/extract_learnings.md +0 -22
- package/commands/gsd/forensics.md +0 -56
- package/commands/gsd/from-gsd2.md +0 -47
- package/commands/gsd/graphify.md +0 -201
- package/commands/gsd/import.md +0 -37
- package/commands/gsd/inbox.md +0 -38
- package/commands/gsd/ingest-docs.md +0 -42
- package/commands/gsd/intel.md +0 -179
- package/commands/gsd/join-discord.md +0 -19
- package/commands/gsd/list-phase-assumptions.md +0 -46
- package/commands/gsd/list-workspaces.md +0 -19
- package/commands/gsd/manager.md +0 -40
- package/commands/gsd/milestone-summary.md +0 -51
- package/commands/gsd/new-workspace.md +0 -44
- package/commands/gsd/plan-milestone-gaps.md +0 -34
- package/commands/gsd/plan-review-convergence.md +0 -52
- package/commands/gsd/plant-seed.md +0 -28
- package/commands/gsd/profile-user.md +0 -46
- package/commands/gsd/reapply-patches.md +0 -331
- package/commands/gsd/remove-workspace.md +0 -26
- package/commands/gsd/review.md +0 -40
- package/commands/gsd/scan.md +0 -26
- package/commands/gsd/secure-phase.md +0 -35
- package/commands/gsd/session-report.md +0 -19
- package/commands/gsd/set-profile.md +0 -12
- package/commands/gsd/ship.md +0 -23
- package/commands/gsd/sketch-wrap-up.md +0 -31
- package/commands/gsd/sketch.md +0 -49
- package/commands/gsd/spec-phase.md +0 -62
- package/commands/gsd/spike-wrap-up.md +0 -31
- package/commands/gsd/spike.md +0 -46
- package/commands/gsd/stats.md +0 -18
- package/commands/gsd/sync-skills.md +0 -19
- package/commands/gsd/thread.md +0 -227
- package/commands/gsd/ui-phase.md +0 -34
- package/commands/gsd/ui-review.md +0 -32
- package/commands/gsd/ultraplan-phase.md +0 -33
- package/commands/gsd/update.md +0 -37
- package/commands/gsd/validate-phase.md +0 -35
- package/commands/gsd/workstreams.md +0 -69
- package/get-shit-done/bin/lib/docs.cjs +0 -267
- package/get-shit-done/bin/lib/graphify.cjs +0 -494
- package/get-shit-done/bin/lib/gsd2-import.cjs +0 -511
- package/get-shit-done/bin/lib/intel.cjs +0 -639
- package/get-shit-done/bin/lib/profile-output.cjs +0 -1080
- package/get-shit-done/bin/lib/profile-pipeline.cjs +0 -539
- package/get-shit-done/bin/lib/workstream.cjs +0 -495
- package/get-shit-done/references/ai-evals.md +0 -156
- package/get-shit-done/references/ai-frameworks.md +0 -186
- package/get-shit-done/references/doc-conflict-engine.md +0 -91
- package/get-shit-done/references/model-profile-resolution.md +0 -38
- package/get-shit-done/references/planner-reviews.md +0 -39
- package/get-shit-done/references/sketch-interactivity.md +0 -41
- package/get-shit-done/references/sketch-theme-system.md +0 -94
- package/get-shit-done/references/sketch-tooling.md +0 -45
- package/get-shit-done/references/sketch-variant-patterns.md +0 -81
- package/get-shit-done/references/thinking-models-debug.md +0 -44
- package/get-shit-done/references/thinking-models-execution.md +0 -50
- package/get-shit-done/references/thinking-models-planning.md +0 -62
- package/get-shit-done/references/thinking-models-research.md +0 -50
- package/get-shit-done/references/thinking-models-verification.md +0 -55
- package/get-shit-done/references/thinking-partner.md +0 -96
- package/get-shit-done/references/user-profiling.md +0 -681
- package/get-shit-done/references/workstream-flag.md +0 -111
- package/get-shit-done/templates/AI-SPEC.md +0 -246
- package/get-shit-done/templates/SECURITY.md +0 -61
- package/get-shit-done/templates/UI-SPEC.md +0 -100
- package/get-shit-done/templates/VALIDATION.md +0 -76
- package/get-shit-done/templates/dev-preferences.md +0 -21
- package/get-shit-done/templates/user-profile.md +0 -146
- package/get-shit-done/workflows/ai-integration-phase.md +0 -284
- package/get-shit-done/workflows/analyze-dependencies.md +0 -96
- package/get-shit-done/workflows/audit-fix.md +0 -175
- package/get-shit-done/workflows/audit-milestone.md +0 -340
- package/get-shit-done/workflows/audit-uat.md +0 -109
- package/get-shit-done/workflows/docs-update.md +0 -1155
- package/get-shit-done/workflows/eval-review.md +0 -155
- package/get-shit-done/workflows/explore.md +0 -141
- package/get-shit-done/workflows/extract_learnings.md +0 -242
- package/get-shit-done/workflows/forensics.md +0 -265
- package/get-shit-done/workflows/import.md +0 -246
- package/get-shit-done/workflows/inbox.md +0 -387
- package/get-shit-done/workflows/ingest-docs.md +0 -328
- package/get-shit-done/workflows/list-phase-assumptions.md +0 -178
- package/get-shit-done/workflows/list-workspaces.md +0 -56
- package/get-shit-done/workflows/manager.md +0 -365
- package/get-shit-done/workflows/milestone-summary.md +0 -223
- package/get-shit-done/workflows/new-workspace.md +0 -239
- package/get-shit-done/workflows/plan-milestone-gaps.md +0 -273
- package/get-shit-done/workflows/plan-review-convergence.md +0 -254
- package/get-shit-done/workflows/plant-seed.md +0 -172
- package/get-shit-done/workflows/profile-user.md +0 -452
- package/get-shit-done/workflows/remove-workspace.md +0 -92
- package/get-shit-done/workflows/review.md +0 -344
- package/get-shit-done/workflows/scan.md +0 -102
- package/get-shit-done/workflows/secure-phase.md +0 -166
- package/get-shit-done/workflows/session-report.md +0 -146
- package/get-shit-done/workflows/ship.md +0 -302
- package/get-shit-done/workflows/sketch-wrap-up.md +0 -283
- package/get-shit-done/workflows/sketch.md +0 -286
- package/get-shit-done/workflows/spec-phase.md +0 -262
- package/get-shit-done/workflows/spike-wrap-up.md +0 -281
- package/get-shit-done/workflows/spike.md +0 -362
- package/get-shit-done/workflows/stats.md +0 -60
- package/get-shit-done/workflows/sync-skills.md +0 -182
- package/get-shit-done/workflows/ui-phase.md +0 -323
- package/get-shit-done/workflows/ui-review.md +0 -190
- package/get-shit-done/workflows/ultraplan-phase.md +0 -189
- package/get-shit-done/workflows/update.md +0 -587
- package/get-shit-done/workflows/validate-phase.md +0 -176
- package/hooks/dist/gsd-check-update-worker.js +0 -108
- package/hooks/dist/gsd-check-update.js +0 -63
- package/hooks/gsd-check-update-worker.js +0 -108
- package/hooks/gsd-check-update.js +0 -63
- package/sdk/src/golden/fixtures/profile-sample-sessions/demo-project/sample.jsonl +0 -3
- package/sdk/src/query/docs-init.ts +0 -257
- package/sdk/src/query/intel.test.ts +0 -90
- package/sdk/src/query/intel.ts +0 -404
- package/sdk/src/query/profile-extract-messages.ts +0 -247
- package/sdk/src/query/profile-output.ts +0 -908
- package/sdk/src/query/profile-questionnaire-data.ts +0 -181
- package/sdk/src/query/profile-sample.ts +0 -184
- package/sdk/src/query/profile-scan-sessions.ts +0 -174
- package/sdk/src/query/workspace.test.ts +0 -119
- package/sdk/src/query/workspace.ts +0 -131
- package/sdk/src/query/workstream.test.ts +0 -51
- package/sdk/src/query/workstream.ts +0 -434
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
<purpose>
|
|
2
|
-
Generate a post-session summary document capturing work performed, outcomes achieved, and estimated resource usage. Writes SESSION_REPORT.md to .planning/reports/ for human review and stakeholder sharing.
|
|
3
|
-
</purpose>
|
|
4
|
-
|
|
5
|
-
<required_reading>
|
|
6
|
-
Read all files referenced by the invoking prompt's execution_context before starting.
|
|
7
|
-
</required_reading>
|
|
8
|
-
|
|
9
|
-
<process>
|
|
10
|
-
|
|
11
|
-
<step name="gather_session_data">
|
|
12
|
-
Collect session data from available sources:
|
|
13
|
-
|
|
14
|
-
1. **STATE.md** — current phase, milestone, progress, blockers, decisions
|
|
15
|
-
2. **Git log** — commits made during this session (last 24h or since last report)
|
|
16
|
-
3. **Plan/Summary files** — plans executed, summaries written
|
|
17
|
-
4. **ROADMAP.md** — milestone context and phase goals
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
# Get recent commits (last 24 hours)
|
|
21
|
-
git log --oneline --since="24 hours ago" --no-merges 2>/dev/null || echo "No recent commits"
|
|
22
|
-
|
|
23
|
-
# Count files changed
|
|
24
|
-
git diff --stat HEAD~10 HEAD 2>/dev/null | tail -1 || echo "No diff available"
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Read `.planning/STATE.md` to get:
|
|
28
|
-
- Current milestone and phase
|
|
29
|
-
- Progress percentage
|
|
30
|
-
- Active blockers
|
|
31
|
-
- Recent decisions
|
|
32
|
-
|
|
33
|
-
Read `.planning/ROADMAP.md` to get milestone name and goals.
|
|
34
|
-
|
|
35
|
-
Check for existing reports:
|
|
36
|
-
```bash
|
|
37
|
-
ls -la .planning/reports/SESSION_REPORT*.md 2>/dev/null || echo "No previous reports"
|
|
38
|
-
```
|
|
39
|
-
</step>
|
|
40
|
-
|
|
41
|
-
<step name="estimate_usage">
|
|
42
|
-
Estimate token usage from observable signals:
|
|
43
|
-
|
|
44
|
-
- Count of tool calls is not directly available, so estimate from git activity and file operations
|
|
45
|
-
- Note: This is an **estimate** — exact token counts require API-level instrumentation not available to hooks
|
|
46
|
-
|
|
47
|
-
Estimation heuristics:
|
|
48
|
-
- Each commit ≈ 1 plan cycle (research + plan + execute + verify)
|
|
49
|
-
- Each plan file ≈ 2,000-5,000 tokens of agent context
|
|
50
|
-
- Each summary file ≈ 1,000-2,000 tokens generated
|
|
51
|
-
- Subagent spawns multiply by ~1.5x per agent type used
|
|
52
|
-
</step>
|
|
53
|
-
|
|
54
|
-
<step name="generate_report">
|
|
55
|
-
Create the report directory and file:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
mkdir -p .planning/reports
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Write `.planning/reports/SESSION_REPORT.md` (or `.planning/reports/YYYYMMDD-session-report.md` if previous reports exist):
|
|
62
|
-
|
|
63
|
-
```markdown
|
|
64
|
-
# GSD Session Report
|
|
65
|
-
|
|
66
|
-
**Generated:** [timestamp]
|
|
67
|
-
**Project:** [from PROJECT.md title or directory name]
|
|
68
|
-
**Milestone:** [N] — [milestone name from ROADMAP.md]
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Session Summary
|
|
73
|
-
|
|
74
|
-
**Duration:** [estimated from first to last commit timestamp, or "Single session"]
|
|
75
|
-
**Phase Progress:** [from STATE.md]
|
|
76
|
-
**Plans Executed:** [count of summaries written this session]
|
|
77
|
-
**Commits Made:** [count from git log]
|
|
78
|
-
|
|
79
|
-
## Work Performed
|
|
80
|
-
|
|
81
|
-
### Phases Touched
|
|
82
|
-
[List phases worked on with brief description of what was done]
|
|
83
|
-
|
|
84
|
-
### Key Outcomes
|
|
85
|
-
[Bullet list of concrete deliverables: files created, features implemented, bugs fixed]
|
|
86
|
-
|
|
87
|
-
### Decisions Made
|
|
88
|
-
[From STATE.md decisions table, if any were added this session]
|
|
89
|
-
|
|
90
|
-
## Files Changed
|
|
91
|
-
|
|
92
|
-
[Summary of files modified, created, deleted — from git diff stat]
|
|
93
|
-
|
|
94
|
-
## Blockers & Open Items
|
|
95
|
-
|
|
96
|
-
[Active blockers from STATE.md]
|
|
97
|
-
[Any TODO items created during session]
|
|
98
|
-
|
|
99
|
-
## Estimated Resource Usage
|
|
100
|
-
|
|
101
|
-
| Metric | Estimate |
|
|
102
|
-
|--------|----------|
|
|
103
|
-
| Commits | [N] |
|
|
104
|
-
| Files changed | [N] |
|
|
105
|
-
| Plans executed | [N] |
|
|
106
|
-
| Subagents spawned | [estimated] |
|
|
107
|
-
|
|
108
|
-
> **Note:** Token and cost estimates require API-level instrumentation.
|
|
109
|
-
> These metrics reflect observable session activity only.
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
*Generated by `/gsd-session-report`*
|
|
114
|
-
```
|
|
115
|
-
</step>
|
|
116
|
-
|
|
117
|
-
<step name="display_result">
|
|
118
|
-
Show the user:
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
## Session Report Generated
|
|
122
|
-
|
|
123
|
-
📄 `.planning/reports/[filename].md`
|
|
124
|
-
|
|
125
|
-
### Highlights
|
|
126
|
-
- **Commits:** [N]
|
|
127
|
-
- **Files changed:** [N]
|
|
128
|
-
- **Phase progress:** [X]%
|
|
129
|
-
- **Plans executed:** [N]
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
If this is the first report, mention:
|
|
133
|
-
```
|
|
134
|
-
💡 Run `/gsd-session-report` at the end of each session to build a history of project activity.
|
|
135
|
-
```
|
|
136
|
-
</step>
|
|
137
|
-
|
|
138
|
-
</process>
|
|
139
|
-
|
|
140
|
-
<success_criteria>
|
|
141
|
-
- [ ] Session data gathered from STATE.md, git log, and plan files
|
|
142
|
-
- [ ] Report written to .planning/reports/
|
|
143
|
-
- [ ] Report includes work summary, outcomes, and file changes
|
|
144
|
-
- [ ] Filename includes date to prevent overwrites
|
|
145
|
-
- [ ] Result summary displayed to user
|
|
146
|
-
</success_criteria>
|
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
<purpose>
|
|
2
|
-
Create a pull request from completed phase/milestone work, generate a rich PR body from planning artifacts, optionally run code review, and prepare for merge. Closes the plan → execute → verify → ship loop.
|
|
3
|
-
</purpose>
|
|
4
|
-
|
|
5
|
-
<required_reading>
|
|
6
|
-
Read all files referenced by the invoking prompt's execution_context before starting.
|
|
7
|
-
</required_reading>
|
|
8
|
-
|
|
9
|
-
<process>
|
|
10
|
-
|
|
11
|
-
<step name="initialize">
|
|
12
|
-
Parse arguments and load project state:
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
INIT=$(gsd-remix-sdk query init.phase-op "${PHASE_ARG}")
|
|
16
|
-
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Parse from init JSON: `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `padded_phase`, `commit_docs`.
|
|
20
|
-
|
|
21
|
-
Also load config for branching strategy:
|
|
22
|
-
```bash
|
|
23
|
-
CONFIG=$(gsd-remix-sdk query state.load)
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Extract: `branching_strategy`, `branch_name`.
|
|
27
|
-
|
|
28
|
-
Detect base branch for PRs and merges:
|
|
29
|
-
```bash
|
|
30
|
-
BASE_BRANCH=$(gsd-remix-sdk query config-get git.base_branch 2>/dev/null || echo "")
|
|
31
|
-
if [ -z "$BASE_BRANCH" ] || [ "$BASE_BRANCH" = "null" ]; then
|
|
32
|
-
BASE_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|^refs/remotes/origin/||')
|
|
33
|
-
BASE_BRANCH="${BASE_BRANCH:-main}"
|
|
34
|
-
fi
|
|
35
|
-
```
|
|
36
|
-
</step>
|
|
37
|
-
|
|
38
|
-
<step name="preflight_checks">
|
|
39
|
-
Verify the work is ready to ship:
|
|
40
|
-
|
|
41
|
-
1. **Verification passed?**
|
|
42
|
-
```bash
|
|
43
|
-
VERIFICATION=$(cat ${PHASE_DIR}/*-VERIFICATION.md 2>/dev/null)
|
|
44
|
-
```
|
|
45
|
-
Check for `status: passed` or `status: human_needed` (with human approval).
|
|
46
|
-
If no VERIFICATION.md or status is `gaps_found`: warn and ask user to confirm.
|
|
47
|
-
|
|
48
|
-
2. **Clean working tree?**
|
|
49
|
-
```bash
|
|
50
|
-
git status --short
|
|
51
|
-
```
|
|
52
|
-
If uncommitted changes exist: ask user to commit or stash first.
|
|
53
|
-
|
|
54
|
-
3. **On correct branch?**
|
|
55
|
-
```bash
|
|
56
|
-
CURRENT_BRANCH=$(git branch --show-current)
|
|
57
|
-
```
|
|
58
|
-
If on `${BASE_BRANCH}`: warn — should be on a feature branch.
|
|
59
|
-
If branching_strategy is `none`: offer to create a branch now.
|
|
60
|
-
|
|
61
|
-
4. **Remote configured?**
|
|
62
|
-
```bash
|
|
63
|
-
git remote -v | head -2
|
|
64
|
-
```
|
|
65
|
-
Detect `origin` remote. If no remote: error — can't create PR.
|
|
66
|
-
|
|
67
|
-
5. **`gh` CLI available?**
|
|
68
|
-
```bash
|
|
69
|
-
which gh && gh auth status 2>&1
|
|
70
|
-
```
|
|
71
|
-
If `gh` not found or not authenticated: provide setup instructions and exit.
|
|
72
|
-
</step>
|
|
73
|
-
|
|
74
|
-
<step name="push_branch">
|
|
75
|
-
Push the current branch to remote:
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
git push origin ${CURRENT_BRANCH} 2>&1
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
If push fails (e.g., no upstream): set upstream:
|
|
82
|
-
```bash
|
|
83
|
-
git push --set-upstream origin ${CURRENT_BRANCH} 2>&1
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Report: "Pushed `{branch}` to origin ({commit_count} commits ahead of ${BASE_BRANCH})"
|
|
87
|
-
</step>
|
|
88
|
-
|
|
89
|
-
<step name="generate_pr_body">
|
|
90
|
-
Auto-generate a rich PR body from planning artifacts:
|
|
91
|
-
|
|
92
|
-
**1. Title:**
|
|
93
|
-
```
|
|
94
|
-
Phase {phase_number}: {phase_name}
|
|
95
|
-
```
|
|
96
|
-
Or for milestone: `Milestone {version}: {name}`
|
|
97
|
-
|
|
98
|
-
**2. Summary section:**
|
|
99
|
-
Read ROADMAP.md for phase goal. Read VERIFICATION.md for verification status.
|
|
100
|
-
|
|
101
|
-
```markdown
|
|
102
|
-
## Summary
|
|
103
|
-
|
|
104
|
-
**Phase {N}: {Name}**
|
|
105
|
-
**Goal:** {goal from ROADMAP.md}
|
|
106
|
-
**Status:** Verified ✓
|
|
107
|
-
|
|
108
|
-
{One paragraph synthesized from SUMMARY.md files — what was built}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
**3. Changes section:**
|
|
112
|
-
For each SUMMARY.md in the phase directory:
|
|
113
|
-
```markdown
|
|
114
|
-
## Changes
|
|
115
|
-
|
|
116
|
-
### Plan {plan_id}: {plan_name}
|
|
117
|
-
{one_liner from SUMMARY.md frontmatter}
|
|
118
|
-
|
|
119
|
-
**Key files:**
|
|
120
|
-
{key-files.created and key-files.modified from SUMMARY.md frontmatter}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
**4. Requirements section:**
|
|
124
|
-
```markdown
|
|
125
|
-
## Requirements Addressed
|
|
126
|
-
|
|
127
|
-
{REQ-IDs from plan frontmatter, linked to REQUIREMENTS.md descriptions}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
**5. Testing section:**
|
|
131
|
-
```markdown
|
|
132
|
-
## Verification
|
|
133
|
-
|
|
134
|
-
- [x] Automated verification: {pass/fail from VERIFICATION.md}
|
|
135
|
-
- {human verification items from VERIFICATION.md, if any}
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
**6. Decisions section:**
|
|
139
|
-
```markdown
|
|
140
|
-
## Key Decisions
|
|
141
|
-
|
|
142
|
-
{Decisions from STATE.md accumulated context relevant to this phase}
|
|
143
|
-
```
|
|
144
|
-
</step>
|
|
145
|
-
|
|
146
|
-
<step name="create_pr">
|
|
147
|
-
Create the PR using the generated body:
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
gh pr create \
|
|
151
|
-
--title "Phase ${PHASE_NUMBER}: ${PHASE_NAME}" \
|
|
152
|
-
--body "${PR_BODY}" \
|
|
153
|
-
--base ${BASE_BRANCH}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
If `--draft` flag was passed: add `--draft`.
|
|
157
|
-
|
|
158
|
-
Report: "PR #{number} created: {url}"
|
|
159
|
-
</step>
|
|
160
|
-
|
|
161
|
-
<step name="optional_review">
|
|
162
|
-
|
|
163
|
-
**External code review command (automated sub-step):**
|
|
164
|
-
|
|
165
|
-
Before prompting the user, check if an external review command is configured:
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
REVIEW_CMD=$(gsd-remix-sdk query config-get workflow.code_review_command 2>/dev/null | jq -r '.' 2>/dev/null || echo "")
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
If `REVIEW_CMD` is non-empty and not `"null"`, run the external review:
|
|
172
|
-
|
|
173
|
-
1. **Generate diff and stats:**
|
|
174
|
-
```bash
|
|
175
|
-
DIFF=$(git diff ${BASE_BRANCH}...HEAD)
|
|
176
|
-
DIFF_STATS=$(git diff --stat ${BASE_BRANCH}...HEAD)
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
2. **Load phase context from STATE.md:**
|
|
180
|
-
```bash
|
|
181
|
-
STATE_STATUS=$(gsd-remix-sdk query state.load 2>/dev/null | head -20)
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
3. **Build review prompt and pipe to command via stdin:**
|
|
185
|
-
Construct a review prompt containing the diff, diff stats, and phase context, then pipe it to the configured command:
|
|
186
|
-
```bash
|
|
187
|
-
REVIEW_PROMPT="You are reviewing a pull request.\n\nDiff stats:\n${DIFF_STATS}\n\nPhase context:\n${STATE_STATUS}\n\nFull diff:\n${DIFF}\n\nRespond with JSON: { \"verdict\": \"APPROVED\" or \"REVISE\", \"confidence\": 0-100, \"summary\": \"...\", \"issues\": [{\"severity\": \"...\", \"file\": \"...\", \"line_range\": \"...\", \"description\": \"...\", \"suggestion\": \"...\"}] }"
|
|
188
|
-
REVIEW_OUTPUT=$(echo "${REVIEW_PROMPT}" | timeout 120 ${REVIEW_CMD} 2>/tmp/gsd-review-stderr.log)
|
|
189
|
-
REVIEW_EXIT=$?
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
4. **Handle timeout (120s) and failure:**
|
|
193
|
-
If `REVIEW_EXIT` is non-zero or the command times out:
|
|
194
|
-
```bash
|
|
195
|
-
if [ $REVIEW_EXIT -ne 0 ]; then
|
|
196
|
-
REVIEW_STDERR=$(cat /tmp/gsd-review-stderr.log 2>/dev/null)
|
|
197
|
-
echo "WARNING: External review command failed (exit ${REVIEW_EXIT}). stderr: ${REVIEW_STDERR}"
|
|
198
|
-
echo "Continuing with manual review flow..."
|
|
199
|
-
fi
|
|
200
|
-
```
|
|
201
|
-
On failure, warn with stderr output and fall through to the manual review flow below.
|
|
202
|
-
|
|
203
|
-
5. **Parse JSON result:**
|
|
204
|
-
If the command succeeded, parse the JSON output and report the verdict:
|
|
205
|
-
```bash
|
|
206
|
-
# Parse verdict and summary from REVIEW_OUTPUT JSON
|
|
207
|
-
VERDICT=$(echo "${REVIEW_OUTPUT}" | node -e "
|
|
208
|
-
let d=''; process.stdin.on('data',c=>d+=c); process.stdin.on('end',()=>{
|
|
209
|
-
try { const r=JSON.parse(d); console.log(r.verdict); }
|
|
210
|
-
catch(e) { console.log('INVALID_JSON'); }
|
|
211
|
-
});
|
|
212
|
-
")
|
|
213
|
-
```
|
|
214
|
-
- If `verdict` is `"APPROVED"`: report approval with confidence and summary.
|
|
215
|
-
- If `verdict` is `"REVISE"`: report issues found, list each issue with severity, file, line_range, description, and suggestion.
|
|
216
|
-
- If JSON is invalid (`INVALID_JSON`): warn "External review returned invalid JSON" with stderr and continue.
|
|
217
|
-
|
|
218
|
-
Regardless of the external review result, fall through to the manual review options below.
|
|
219
|
-
|
|
220
|
-
---
|
|
221
|
-
|
|
222
|
-
**Manual review options:**
|
|
223
|
-
|
|
224
|
-
Ask if user wants to trigger a code review:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
**Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `AskUserQuestion` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-Claude runtimes (OpenAI Codex, Gemini CLI, etc.) where `AskUserQuestion` is not available.
|
|
228
|
-
|
|
229
|
-
```
|
|
230
|
-
AskUserQuestion:
|
|
231
|
-
question: "PR created. Run a code review before merge?"
|
|
232
|
-
options:
|
|
233
|
-
- label: "Skip review"
|
|
234
|
-
description: "PR is ready — merge when CI passes"
|
|
235
|
-
- label: "Self-review"
|
|
236
|
-
description: "I'll review the diff in the PR myself"
|
|
237
|
-
- label: "Request review"
|
|
238
|
-
description: "Request review from a teammate"
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
**If "Request review":**
|
|
242
|
-
```bash
|
|
243
|
-
gh pr edit ${PR_NUMBER} --add-reviewer "${REVIEWER}"
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
**If "Self-review":**
|
|
247
|
-
Report the PR URL and suggest: "Review the diff at {url}/files"
|
|
248
|
-
</step>
|
|
249
|
-
|
|
250
|
-
<step name="track_shipping">
|
|
251
|
-
Update STATE.md to reflect the shipping action:
|
|
252
|
-
|
|
253
|
-
```bash
|
|
254
|
-
gsd-remix-sdk query state.update "Last Activity" "$(date +%Y-%m-%d)"
|
|
255
|
-
gsd-remix-sdk query state.update "Status" "Phase ${PHASE_NUMBER} shipped — PR #${PR_NUMBER}"
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
If `commit_docs` is true:
|
|
259
|
-
```bash
|
|
260
|
-
gsd-remix-sdk query commit "docs(${padded_phase}): ship phase ${PHASE_NUMBER} — PR #${PR_NUMBER}" .planning/STATE.md
|
|
261
|
-
```
|
|
262
|
-
</step>
|
|
263
|
-
|
|
264
|
-
<step name="report">
|
|
265
|
-
```
|
|
266
|
-
───────────────────────────────────────────────────────────────
|
|
267
|
-
|
|
268
|
-
## ✓ Phase {X}: {Name} — Shipped
|
|
269
|
-
|
|
270
|
-
PR: #{number} ({url})
|
|
271
|
-
Branch: {branch} → ${BASE_BRANCH}
|
|
272
|
-
Commits: {count}
|
|
273
|
-
Verification: ✓ Passed
|
|
274
|
-
Requirements: {N} REQ-IDs addressed
|
|
275
|
-
|
|
276
|
-
Next steps:
|
|
277
|
-
- Review/approve PR
|
|
278
|
-
- Merge when CI passes
|
|
279
|
-
- /gsd-complete-milestone (if last phase in milestone)
|
|
280
|
-
- /gsd-progress (to see what's next)
|
|
281
|
-
|
|
282
|
-
───────────────────────────────────────────────────────────────
|
|
283
|
-
```
|
|
284
|
-
</step>
|
|
285
|
-
|
|
286
|
-
</process>
|
|
287
|
-
|
|
288
|
-
<offer_next>
|
|
289
|
-
After shipping:
|
|
290
|
-
|
|
291
|
-
- /gsd-complete-milestone — if all phases in milestone are done
|
|
292
|
-
- /gsd-progress — see overall project state
|
|
293
|
-
- /gsd-execute-phase {next} — continue to next phase
|
|
294
|
-
</offer_next>
|
|
295
|
-
|
|
296
|
-
<success_criteria>
|
|
297
|
-
- [ ] Preflight checks passed (verification, clean tree, branch, remote, gh)
|
|
298
|
-
- [ ] Branch pushed to remote
|
|
299
|
-
- [ ] PR created with rich auto-generated body
|
|
300
|
-
- [ ] STATE.md updated with shipping status
|
|
301
|
-
- [ ] User knows PR number and next steps
|
|
302
|
-
</success_criteria>
|