gsd-antigravity-kit 1.32.0 → 2.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/.agent/skills/gsd/SKILL.md +152 -123
- package/.agent/skills/gsd/VERSION +1 -0
- package/.agent/skills/gsd/assets/templates/user-profile.md +8 -8
- package/.agent/skills/gsd/bin/gsd-tools.cjs +81 -3
- package/.agent/skills/gsd/bin/help-manifest.json +24 -1
- package/.agent/skills/gsd/bin/hooks/gsd-check-update.js +15 -5
- package/.agent/skills/gsd/bin/hooks/gsd-context-monitor.js +1 -1
- package/.agent/skills/gsd/bin/hooks/gsd-phase-boundary.sh +27 -0
- package/.agent/skills/gsd/bin/hooks/gsd-prompt-guard.js +2 -1
- package/.agent/skills/gsd/bin/hooks/gsd-read-guard.js +1 -1
- package/.agent/skills/gsd/bin/hooks/gsd-session-state.sh +33 -0
- package/.agent/skills/gsd/bin/hooks/gsd-statusline.js +5 -5
- package/.agent/skills/gsd/bin/hooks/gsd-validate-commit.sh +47 -0
- package/.agent/skills/gsd/bin/hooks/gsd-workflow-guard.js +1 -1
- package/.agent/skills/gsd/bin/lib/config.cjs +31 -10
- package/.agent/skills/gsd/bin/lib/core.cjs +48 -13
- package/.agent/skills/gsd/bin/lib/frontmatter.cjs +34 -2
- package/.agent/skills/gsd/bin/lib/intel.cjs +660 -0
- package/.agent/skills/gsd/bin/lib/learnings.cjs +378 -0
- package/.agent/skills/gsd/bin/lib/milestone.cjs +13 -4
- package/.agent/skills/gsd/bin/lib/model-profiles.cjs +17 -17
- package/.agent/skills/gsd/bin/lib/profile-output.cjs +31 -31
- package/.agent/skills/gsd/bin/lib/security.cjs +119 -0
- package/.agent/skills/gsd/bin/lib/verify.cjs +15 -15
- package/.agent/skills/gsd/migration_report.md +7 -0
- package/.agent/skills/gsd/references/agents/gsd-code-fixer.md +516 -0
- package/.agent/skills/gsd/references/agents/gsd-code-reviewer.md +355 -0
- package/.agent/skills/gsd/references/agents/gsd-debugger.md +10 -1
- package/.agent/skills/gsd/references/agents/gsd-executor.md +3 -0
- package/.agent/skills/gsd/references/agents/gsd-intel-updater.md +314 -0
- package/.agent/skills/gsd/references/agents/gsd-phase-researcher.md +3 -0
- package/.agent/skills/gsd/references/agents/gsd-plan-checker.md +16 -4
- package/.agent/skills/gsd/references/agents/gsd-planner.md +7 -0
- package/.agent/skills/gsd/references/agents/gsd-user-profiler.md +5 -5
- package/.agent/skills/gsd/references/agents/gsd-verifier.md +55 -1
- package/.agent/skills/gsd/references/agents/profiles/dev.md +21 -0
- package/.agent/skills/gsd/references/agents/profiles/research.md +22 -0
- package/.agent/skills/gsd/references/agents/profiles/review.md +22 -0
- package/.agent/skills/gsd/references/commands/{gsd-add-todo.md → atomic/add-todo.md} +5 -4
- package/.agent/skills/gsd/references/commands/{gsd-check-todos.md → atomic/check-todos.md} +5 -4
- package/.agent/skills/gsd/references/commands/{gsd-cleanup.md → atomic/cleanup.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-do.md → atomic/do.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-help.md → atomic/help.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-join-discord.md → atomic/join-discord.md} +21 -19
- package/.agent/skills/gsd/references/commands/{gsd-note.md → atomic/note.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-session-report.md → atomic/session-report.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-ship.md → atomic/ship.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-stats.md → atomic/stats.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-thread.md → atomic/thread.md} +7 -6
- package/.agent/skills/gsd/references/commands/atomic/undo.md +36 -0
- package/.agent/skills/gsd/references/commands/{gsd-add-backlog.md → milestone/add-backlog.md} +8 -7
- package/.agent/skills/gsd/references/commands/{gsd-audit-milestone.md → milestone/audit-milestone.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-complete-milestone.md → milestone/complete-milestone.md} +6 -4
- package/.agent/skills/gsd/references/commands/{gsd-milestone-summary.md → milestone/milestone-summary.md} +5 -3
- package/.agent/skills/gsd/references/commands/{gsd-new-milestone.md → milestone/new-milestone.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-plan-milestone-gaps.md → milestone/plan-milestone-gaps.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-plant-seed.md → milestone/plant-seed.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-review-backlog.md → milestone/review-backlog.md} +6 -5
- package/.agent/skills/gsd/references/commands/misc/audit-fix.md +35 -0
- package/.agent/skills/gsd/references/commands/{gsd-audit-uat.md → misc/audit-uat.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-next.md → misc/next.md} +6 -3
- package/.agent/skills/gsd/references/commands/{gsd-progress.md → misc/progress.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-verify-work.md → misc/verify-work.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-add-phase.md → phase/add-phase.md} +5 -4
- package/.agent/skills/gsd/references/commands/{gsd-add-tests.md → phase/add-tests.md} +8 -3
- package/.agent/skills/gsd/references/commands/{gsd-discuss-phase.md → phase/discuss-phase.md} +5 -4
- package/.agent/skills/gsd/references/commands/{gsd-execute-phase.md → phase/execute-phase.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-insert-phase.md → phase/insert-phase.md} +5 -4
- package/.agent/skills/gsd/references/commands/{gsd-list-phase-assumptions.md → phase/list-phase-assumptions.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-plan-phase.md → phase/plan-phase.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-remove-phase.md → phase/remove-phase.md} +5 -4
- package/.agent/skills/gsd/references/commands/{gsd-research-phase.md → phase/research-phase.md} +7 -6
- package/.agent/skills/gsd/references/commands/{gsd-secure-phase.md → phase/secure-phase.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-ui-phase.md → phase/ui-phase.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-ui-review.md → phase/ui-review.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-validate-phase.md → phase/validate-phase.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-workstreams.md → phase/workstreams.md} +71 -70
- package/.agent/skills/gsd/references/commands/{gsd-analyze-dependencies.md → project/analyze-dependencies.md} +5 -4
- package/.agent/skills/gsd/references/commands/project/explore.md +29 -0
- package/.agent/skills/gsd/references/commands/project/import.md +38 -0
- package/.agent/skills/gsd/references/commands/project/intel.md +181 -0
- package/.agent/skills/gsd/references/commands/{gsd-list-workspaces.md → project/list-workspaces.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-map-codebase.md → project/map-codebase.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-new-project.md → project/new-project.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-new-workspace.md → project/new-workspace.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-remove-workspace.md → project/remove-workspace.md} +4 -3
- package/.agent/skills/gsd/references/commands/project/scan.md +28 -0
- package/.agent/skills/gsd/references/commands/{gsd-autonomous.md → system/autonomous.md} +4 -3
- package/.agent/skills/gsd/references/commands/system/code-review-fix.md +54 -0
- package/.agent/skills/gsd/references/commands/system/code-review.md +57 -0
- package/.agent/skills/gsd/references/commands/{gsd-debug.md → system/debug.md} +7 -6
- package/.agent/skills/gsd/references/commands/{gsd-docs-update.md → system/docs-update.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-fast.md → system/fast.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-forensics.md → system/forensics.md} +5 -3
- package/.agent/skills/gsd/references/commands/{gsd-health.md → system/health.md} +5 -4
- package/.agent/skills/gsd/references/commands/{gsd-manager.md → system/manager.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-pause-work.md → system/pause-work.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-pr-branch.md → system/pr-branch.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-profile-user.md → system/profile-user.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-quick.md → system/quick.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-reapply-patches.md → system/reapply-patches.md} +25 -7
- package/.agent/skills/gsd/references/commands/{gsd-resume-work.md → system/resume-work.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-review.md → system/review.md} +4 -3
- package/.agent/skills/gsd/references/commands/system/set-profile.md +14 -0
- package/.agent/skills/gsd/references/commands/{gsd-settings.md → system/settings.md} +4 -3
- package/.agent/skills/gsd/references/commands/{gsd-update.md → system/update.md} +4 -3
- package/.agent/skills/gsd/references/docs/agent-contracts.md +79 -0
- package/.agent/skills/gsd/references/docs/common-bug-patterns.md +114 -0
- package/.agent/skills/gsd/references/docs/context-budget.md +49 -0
- package/.agent/skills/gsd/references/docs/domain-probes.md +125 -0
- package/.agent/skills/gsd/references/docs/few-shot-examples/plan-checker.md +73 -0
- package/.agent/skills/gsd/references/docs/few-shot-examples/verifier.md +109 -0
- package/.agent/skills/gsd/references/docs/gate-prompts.md +100 -0
- package/.agent/skills/gsd/references/docs/gates.md +70 -0
- package/.agent/skills/gsd/references/docs/model-profile-resolution.md +2 -0
- package/.agent/skills/gsd/references/docs/model-profiles.md +20 -14
- package/.agent/skills/gsd/references/docs/planning-config.md +216 -1
- package/.agent/skills/gsd/references/docs/revision-loop.md +97 -0
- package/.agent/skills/gsd/references/docs/thinking-models-debug.md +44 -0
- package/.agent/skills/gsd/references/docs/thinking-models-execution.md +50 -0
- package/.agent/skills/gsd/references/docs/thinking-models-planning.md +62 -0
- package/.agent/skills/gsd/references/docs/thinking-models-research.md +50 -0
- package/.agent/skills/gsd/references/docs/thinking-models-verification.md +55 -0
- package/.agent/skills/gsd/references/docs/thinking-partner.md +96 -0
- package/.agent/skills/gsd/references/docs/universal-anti-patterns.md +58 -0
- package/.agent/skills/gsd/references/docs/user-profiling.md +10 -10
- package/.agent/skills/gsd/references/docs/verification-overrides.md +227 -0
- package/.agent/skills/gsd/references/docs/workstream-flag.md +2 -2
- package/.agent/skills/gsd/references/mapping.md +11 -21
- package/.agent/skills/gsd/references/workflows/analyze-dependencies.md +3 -3
- package/.agent/skills/gsd/references/workflows/audit-fix.md +157 -0
- package/.agent/skills/gsd/references/workflows/autonomous.md +22 -1
- package/.agent/skills/gsd/references/workflows/code-review-fix.md +497 -0
- package/.agent/skills/gsd/references/workflows/code-review.md +515 -0
- package/.agent/skills/gsd/references/workflows/discuss-phase-power.md +3 -3
- package/.agent/skills/gsd/references/workflows/discuss-phase.md +20 -0
- package/.agent/skills/gsd/references/workflows/execute-phase.md +103 -0
- package/.agent/skills/gsd/references/workflows/explore.md +139 -0
- package/.agent/skills/gsd/references/workflows/import.md +274 -0
- package/.agent/skills/gsd/references/workflows/inbox.md +384 -0
- package/.agent/skills/gsd/references/workflows/manager.md +5 -5
- package/.agent/skills/gsd/references/workflows/new-milestone.md +1 -1
- package/.agent/skills/gsd/references/workflows/next.md +56 -0
- package/.agent/skills/gsd/references/workflows/plan-phase.md +48 -1
- package/.agent/skills/gsd/references/workflows/quick.md +96 -2
- package/.agent/skills/gsd/references/workflows/review.md +23 -3
- package/.agent/skills/gsd/references/workflows/scan.md +102 -0
- package/.agent/skills/gsd/references/workflows/settings.md +1 -1
- package/.agent/skills/gsd/references/workflows/ui-review.md +2 -2
- package/.agent/skills/gsd/references/workflows/undo.md +312 -0
- package/.agent/skills/gsd/references/workflows/update.md +5 -5
- package/.agent/skills/gsd-converter/SKILL.md +67 -59
- package/.agent/skills/gsd-converter/assets/migration-manifest.json +74 -0
- package/.agent/skills/gsd-converter/references/mapping.md +6 -16
- package/.agent/skills/gsd-converter/scripts/convert.py +419 -80
- package/.agent/skills/gsd-converter/scripts/regression_test.py +33 -0
- package/.agent/skills/selectpaste-update/SKILL.md +46 -0
- package/.agent/skills/selectpaste-update/scripts/sync-commands.py +317 -0
- package/README.md +4 -2
- package/bin/install.js +116 -116
- package/package.json +1 -1
- package/.agent/skills/gsd/references/commands/gsd-set-profile.md +0 -12
- /package/.agent/skills/gsd/references/commands/{gsd-tools.md → system/gsd-tools.md} +0 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Triage and review all open GitHub issues and PRs against project contribution templates.
|
|
3
|
+
Produces a structured report showing compliance status for each item, flags missing
|
|
4
|
+
required fields, identifies label gaps, and optionally takes action (label, comment, close).
|
|
5
|
+
</purpose>
|
|
6
|
+
|
|
7
|
+
<required_reading>
|
|
8
|
+
Before starting, read these project files to understand the review criteria:
|
|
9
|
+
- `.github/ISSUE_TEMPLATE/feature_request.yml` — required fields for feature issues
|
|
10
|
+
- `.github/ISSUE_TEMPLATE/enhancement.yml` — required fields for enhancement issues
|
|
11
|
+
- `.github/ISSUE_TEMPLATE/chore.yml` — required fields for chore issues
|
|
12
|
+
- `.github/ISSUE_TEMPLATE/bug_report.yml` — required fields for bug reports
|
|
13
|
+
- `.github/PULL_REQUEST_TEMPLATE/feature.md` — required checklist for feature PRs
|
|
14
|
+
- `.github/PULL_REQUEST_TEMPLATE/enhancement.md` — required checklist for enhancement PRs
|
|
15
|
+
- `.github/PULL_REQUEST_TEMPLATE/fix.md` — required checklist for fix PRs
|
|
16
|
+
- `CONTRIBUTING.md` — the issue-first rule and approval gates
|
|
17
|
+
</required_reading>
|
|
18
|
+
|
|
19
|
+
<process>
|
|
20
|
+
|
|
21
|
+
<step name="preflight">
|
|
22
|
+
Verify prerequisites:
|
|
23
|
+
|
|
24
|
+
1. **`gh` CLI available and authenticated?**
|
|
25
|
+
```bash
|
|
26
|
+
which gh && gh auth status 2>&1
|
|
27
|
+
```
|
|
28
|
+
If not available: print setup instructions and exit.
|
|
29
|
+
|
|
30
|
+
2. **Detect repository:**
|
|
31
|
+
If `--repo` flag provided, use that. Otherwise:
|
|
32
|
+
```bash
|
|
33
|
+
gh repo view --json nameWithOwner -q '.nameWithOwner' 2>/dev/null
|
|
34
|
+
```
|
|
35
|
+
If no repo detected: error — must be in a git repo with a GitHub remote.
|
|
36
|
+
|
|
37
|
+
3. **Parse flags:**
|
|
38
|
+
- `--issues` → set REVIEW_ISSUES=true, REVIEW_PRS=false
|
|
39
|
+
- `--prs` → set REVIEW_ISSUES=false, REVIEW_PRS=true
|
|
40
|
+
- `--label` → set AUTO_LABEL=true
|
|
41
|
+
- `--close-incomplete` → set AUTO_CLOSE=true
|
|
42
|
+
- Default (no flags): review both issues and PRs, report only (no auto-actions)
|
|
43
|
+
</step>
|
|
44
|
+
|
|
45
|
+
<step name="fetch_issues">
|
|
46
|
+
Skip if REVIEW_ISSUES=false.
|
|
47
|
+
|
|
48
|
+
Fetch all open issues:
|
|
49
|
+
```bash
|
|
50
|
+
gh issue list --state open --json number,title,labels,body,author,createdAt,updatedAt --limit 100
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
For each issue, classify by labels and body content:
|
|
54
|
+
|
|
55
|
+
| Label/Pattern | Type | Template |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| `feature-request` | Feature | feature_request.yml |
|
|
58
|
+
| `enhancement` | Enhancement | enhancement.yml |
|
|
59
|
+
| `bug` | Bug | bug_report.yml |
|
|
60
|
+
| `type: chore` | Chore | chore.yml |
|
|
61
|
+
| No matching label | Unknown | Flag for manual triage |
|
|
62
|
+
|
|
63
|
+
If an issue has no type label, attempt to classify from the body content:
|
|
64
|
+
- Contains "### Feature name" → likely Feature
|
|
65
|
+
- Contains "### What existing feature" → likely Enhancement
|
|
66
|
+
- Contains "### What happened?" → likely Bug
|
|
67
|
+
- Contains "### What is the maintenance task?" → likely Chore
|
|
68
|
+
- Cannot determine → mark as `needs-triage`
|
|
69
|
+
</step>
|
|
70
|
+
|
|
71
|
+
<step name="review_issues">
|
|
72
|
+
Skip if REVIEW_ISSUES=false.
|
|
73
|
+
|
|
74
|
+
For each classified issue, review against its template requirements.
|
|
75
|
+
|
|
76
|
+
**Feature Request Review Checklist:**
|
|
77
|
+
- [ ] Pre-submission checklist present (4 checkboxes)
|
|
78
|
+
- [ ] Feature name provided
|
|
79
|
+
- [ ] Type of addition selected
|
|
80
|
+
- [ ] Problem statement filled (not placeholder text)
|
|
81
|
+
- [ ] What is being added described with examples
|
|
82
|
+
- [ ] Full scope of changes listed (files created/modified/systems)
|
|
83
|
+
- [ ] User stories present (minimum 2)
|
|
84
|
+
- [ ] Acceptance criteria present (testable conditions)
|
|
85
|
+
- [ ] Applicable runtimes selected
|
|
86
|
+
- [ ] Breaking changes assessment present
|
|
87
|
+
- [ ] Maintenance burden described
|
|
88
|
+
- [ ] Alternatives considered (not empty)
|
|
89
|
+
- **Label check:** Has `needs-review` label? Has `approved-feature` label?
|
|
90
|
+
- **Gate check:** If PR exists linking this issue, does issue have `approved-feature`?
|
|
91
|
+
|
|
92
|
+
**Enhancement Review Checklist:**
|
|
93
|
+
- [ ] Pre-submission checklist present (4 checkboxes)
|
|
94
|
+
- [ ] What is being improved identified
|
|
95
|
+
- [ ] Current behavior described with examples
|
|
96
|
+
- [ ] Proposed behavior described with examples
|
|
97
|
+
- [ ] Reason and benefit articulated (not vague)
|
|
98
|
+
- [ ] Scope of changes listed
|
|
99
|
+
- [ ] Breaking changes assessed
|
|
100
|
+
- [ ] Alternatives considered
|
|
101
|
+
- [ ] Area affected selected
|
|
102
|
+
- **Label check:** Has `needs-review` label? Has `approved-enhancement` label?
|
|
103
|
+
- **Gate check:** If PR exists linking this issue, does issue have `approved-enhancement`?
|
|
104
|
+
|
|
105
|
+
**Bug Report Review Checklist:**
|
|
106
|
+
- [ ] GSD Version provided
|
|
107
|
+
- [ ] Runtime selected
|
|
108
|
+
- [ ] OS selected
|
|
109
|
+
- [ ] Node.js version provided
|
|
110
|
+
- [ ] Description of what happened
|
|
111
|
+
- [ ] Expected behavior described
|
|
112
|
+
- [ ] Steps to reproduce provided
|
|
113
|
+
- [ ] Frequency selected
|
|
114
|
+
- [ ] Severity/impact selected
|
|
115
|
+
- [ ] PII checklist confirmed
|
|
116
|
+
- **Label check:** Has `needs-triage` or `confirmed-bug` label?
|
|
117
|
+
|
|
118
|
+
**Chore Review Checklist:**
|
|
119
|
+
- [ ] Pre-submission checklist confirmed (no user-facing changes)
|
|
120
|
+
- [ ] Maintenance task described
|
|
121
|
+
- [ ] Type of maintenance selected
|
|
122
|
+
- [ ] Current state described with specifics
|
|
123
|
+
- [ ] Proposed work listed
|
|
124
|
+
- [ ] Acceptance criteria present
|
|
125
|
+
- [ ] Area affected selected
|
|
126
|
+
- **Label check:** Has `needs-triage` label?
|
|
127
|
+
|
|
128
|
+
**Scoring:** For each issue, calculate a completeness percentage:
|
|
129
|
+
- Count required fields present vs. total required fields
|
|
130
|
+
- Score = (present / total) * 100
|
|
131
|
+
- Status: COMPLETE (100%), MOSTLY COMPLETE (75-99%), INCOMPLETE (50-74%), REJECT (<50%)
|
|
132
|
+
</step>
|
|
133
|
+
|
|
134
|
+
<step name="fetch_prs">
|
|
135
|
+
Skip if REVIEW_PRS=false.
|
|
136
|
+
|
|
137
|
+
Fetch all open PRs:
|
|
138
|
+
```bash
|
|
139
|
+
gh pr list --state open --json number,title,labels,body,author,headRefName,baseRefName,isDraft,createdAt,reviewDecision,statusCheckRollup --limit 100
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
For each PR, classify by body content and linked issue:
|
|
143
|
+
|
|
144
|
+
| Body Pattern | Type | Template |
|
|
145
|
+
|---|---|---|
|
|
146
|
+
| Contains "## Feature PR" or "## Feature summary" | Feature PR | feature.md |
|
|
147
|
+
| Contains "## Enhancement PR" or "## What this enhancement improves" | Enhancement PR | enhancement.md |
|
|
148
|
+
| Contains "## Fix PR" or "## What was broken" | Fix PR | fix.md |
|
|
149
|
+
| Uses default template | Wrong Template | Flag — must use typed template |
|
|
150
|
+
| Cannot determine | Unknown | Flag for manual review |
|
|
151
|
+
|
|
152
|
+
Also check for linked issues:
|
|
153
|
+
```bash
|
|
154
|
+
gh pr view {number} --json body -q '.body' | grep -oE '(Closes|Fixes|Resolves) #[0-9]+'
|
|
155
|
+
```
|
|
156
|
+
</step>
|
|
157
|
+
|
|
158
|
+
<step name="review_prs">
|
|
159
|
+
Skip if REVIEW_PRS=false.
|
|
160
|
+
|
|
161
|
+
For each classified PR, review against its template requirements.
|
|
162
|
+
|
|
163
|
+
**Feature PR Review Checklist:**
|
|
164
|
+
- [ ] Uses feature PR template (not default)
|
|
165
|
+
- [ ] Issue linked with `Closes #NNN`
|
|
166
|
+
- [ ] Linked issue exists and has `approved-feature` label
|
|
167
|
+
- [ ] Feature summary present
|
|
168
|
+
- [ ] New files table filled
|
|
169
|
+
- [ ] Modified files table filled
|
|
170
|
+
- [ ] Implementation notes present
|
|
171
|
+
- [ ] Spec compliance checklist present (acceptance criteria from issue)
|
|
172
|
+
- [ ] Test coverage described
|
|
173
|
+
- [ ] Platforms tested checked (macOS, Windows, Linux)
|
|
174
|
+
- [ ] Runtimes tested checked
|
|
175
|
+
- [ ] Scope confirmation checked
|
|
176
|
+
- [ ] Full checklist completed
|
|
177
|
+
- [ ] Breaking changes section filled
|
|
178
|
+
- **CI check:** All status checks passing?
|
|
179
|
+
- **Review check:** Has review approval?
|
|
180
|
+
|
|
181
|
+
**Enhancement PR Review Checklist:**
|
|
182
|
+
- [ ] Uses enhancement PR template (not default)
|
|
183
|
+
- [ ] Issue linked with `Closes #NNN`
|
|
184
|
+
- [ ] Linked issue exists and has `approved-enhancement` label
|
|
185
|
+
- [ ] What is improved described
|
|
186
|
+
- [ ] Before/after provided
|
|
187
|
+
- [ ] Implementation approach described
|
|
188
|
+
- [ ] Verification method described
|
|
189
|
+
- [ ] Platforms tested checked
|
|
190
|
+
- [ ] Runtimes tested checked
|
|
191
|
+
- [ ] Scope confirmation checked
|
|
192
|
+
- [ ] Full checklist completed
|
|
193
|
+
- [ ] Breaking changes section filled
|
|
194
|
+
- **CI check:** All status checks passing?
|
|
195
|
+
|
|
196
|
+
**Fix PR Review Checklist:**
|
|
197
|
+
- [ ] Uses fix PR template (not default)
|
|
198
|
+
- [ ] Issue linked with `Fixes #NNN`
|
|
199
|
+
- [ ] Linked issue exists and has `confirmed-bug` label
|
|
200
|
+
- [ ] What was broken described
|
|
201
|
+
- [ ] What the fix does described
|
|
202
|
+
- [ ] Root cause explained
|
|
203
|
+
- [ ] Verification method described
|
|
204
|
+
- [ ] Regression test added (or explained why not)
|
|
205
|
+
- [ ] Platforms tested checked
|
|
206
|
+
- [ ] Runtimes tested checked
|
|
207
|
+
- [ ] Full checklist completed
|
|
208
|
+
- [ ] Breaking changes section filled
|
|
209
|
+
- **CI check:** All status checks passing?
|
|
210
|
+
|
|
211
|
+
**Cross-cutting PR Checks (all types):**
|
|
212
|
+
- [ ] PR title is descriptive (not just "fix" or "update")
|
|
213
|
+
- [ ] One concern per PR (not mixing fix + enhancement)
|
|
214
|
+
- [ ] No unrelated formatting changes visible in diff
|
|
215
|
+
- [ ] CHANGELOG.md updated
|
|
216
|
+
- [ ] Not using `--no-verify` or skipping hooks
|
|
217
|
+
|
|
218
|
+
**Scoring:** Same as issues — completeness percentage per PR.
|
|
219
|
+
</step>
|
|
220
|
+
|
|
221
|
+
<step name="check_gates">
|
|
222
|
+
Cross-reference issues and PRs to enforce the issue-first rule:
|
|
223
|
+
|
|
224
|
+
For each open PR:
|
|
225
|
+
1. Extract linked issue number from body
|
|
226
|
+
2. If no linked issue: **GATE VIOLATION** — PR has no issue
|
|
227
|
+
3. If linked issue exists, check its labels:
|
|
228
|
+
- Feature PR → issue must have `approved-feature`
|
|
229
|
+
- Enhancement PR → issue must have `approved-enhancement`
|
|
230
|
+
- Fix PR → issue must have `confirmed-bug`
|
|
231
|
+
4. If label is missing: **GATE VIOLATION** — PR opened before approval
|
|
232
|
+
|
|
233
|
+
Report gate violations prominently — these are the most important findings because
|
|
234
|
+
the project auto-closes PRs without proper approval gates.
|
|
235
|
+
</step>
|
|
236
|
+
|
|
237
|
+
<step name="generate_report">
|
|
238
|
+
Produce a structured triage report:
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
===================================================================
|
|
242
|
+
GSD INBOX TRIAGE — {repo} — {date}
|
|
243
|
+
===================================================================
|
|
244
|
+
|
|
245
|
+
SUMMARY
|
|
246
|
+
-------
|
|
247
|
+
Open issues: {count} Open PRs: {count}
|
|
248
|
+
Features: {n} Feature PRs: {n}
|
|
249
|
+
Enhancements:{n} Enhancement PRs: {n}
|
|
250
|
+
Bugs: {n} Fix PRs: {n}
|
|
251
|
+
Chores: {n} Wrong template: {n}
|
|
252
|
+
Unclassified:{n} No linked issue: {n}
|
|
253
|
+
|
|
254
|
+
GATE VIOLATIONS (action required)
|
|
255
|
+
---------------------------------
|
|
256
|
+
{For each violation:}
|
|
257
|
+
PR #{number}: {title}
|
|
258
|
+
Problem: {description — e.g., "No approved-feature label on linked issue #45"}
|
|
259
|
+
Action: {what to do — e.g., "Close PR or approve issue #45 first"}
|
|
260
|
+
|
|
261
|
+
ISSUES NEEDING ATTENTION
|
|
262
|
+
------------------------
|
|
263
|
+
{For each issue sorted by completeness score, lowest first:}
|
|
264
|
+
#{number} [{type}] {title}
|
|
265
|
+
Score: {percentage}% complete
|
|
266
|
+
Missing: {list of missing required fields}
|
|
267
|
+
Labels: {current labels} → Suggested: {recommended labels}
|
|
268
|
+
Age: {days since created}
|
|
269
|
+
|
|
270
|
+
PRS NEEDING ATTENTION
|
|
271
|
+
---------------------
|
|
272
|
+
{For each PR sorted by completeness score, lowest first:}
|
|
273
|
+
#{number} [{type}] {title}
|
|
274
|
+
Score: {percentage}% complete
|
|
275
|
+
Missing: {list of missing checklist items}
|
|
276
|
+
CI: {passing/failing/pending}
|
|
277
|
+
Review: {approved/changes_requested/none}
|
|
278
|
+
Linked issue: #{issue_number} ({issue_status})
|
|
279
|
+
Age: {days since created}
|
|
280
|
+
|
|
281
|
+
READY TO MERGE
|
|
282
|
+
--------------
|
|
283
|
+
{PRs that are 100% complete, CI passing, approved:}
|
|
284
|
+
#{number} {title} — ready
|
|
285
|
+
|
|
286
|
+
STALE ITEMS (>30 days, no activity)
|
|
287
|
+
------------------------------------
|
|
288
|
+
{Issues and PRs with no updates in 30+ days}
|
|
289
|
+
|
|
290
|
+
===================================================================
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Write this report to `.planning/INBOX-TRIAGE.md` if a `.planning/` directory exists,
|
|
294
|
+
otherwise print to console only.
|
|
295
|
+
</step>
|
|
296
|
+
|
|
297
|
+
<step name="auto_actions">
|
|
298
|
+
Only execute if `--label` or `--close-incomplete` flags were set.
|
|
299
|
+
|
|
300
|
+
**If --label:**
|
|
301
|
+
For each issue/PR where labels are missing or incorrect:
|
|
302
|
+
```bash
|
|
303
|
+
gh issue edit {number} --add-label "{label}"
|
|
304
|
+
```
|
|
305
|
+
Or:
|
|
306
|
+
```bash
|
|
307
|
+
gh pr edit {number} --add-label "{label}"
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Label recommendations:
|
|
311
|
+
- Unclassified issues → add `needs-triage`
|
|
312
|
+
- Feature issues without review → add `needs-review`
|
|
313
|
+
- Enhancement issues without review → add `needs-review`
|
|
314
|
+
- Bug reports without triage → add `needs-triage`
|
|
315
|
+
- PRs with gate violations → add `gate-violation`
|
|
316
|
+
|
|
317
|
+
**If --close-incomplete:**
|
|
318
|
+
For issues scoring below 50% completeness:
|
|
319
|
+
```bash
|
|
320
|
+
gh issue close {number} --comment "Closed by GSD inbox triage: this issue is missing required fields per the issue template. Missing: {list}. Please reopen with a complete submission. See CONTRIBUTING.md for requirements."
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
For PRs with gate violations:
|
|
324
|
+
```bash
|
|
325
|
+
gh pr close {number} --comment "Closed by GSD inbox triage: this PR does not meet the issue-first requirement. {specific violation}. See CONTRIBUTING.md for the correct process."
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Always confirm with the user before closing anything:
|
|
329
|
+
```
|
|
330
|
+
AskUserQuestion:
|
|
331
|
+
question: "Found {N} items to close. Review the list above — proceed with closing?"
|
|
332
|
+
options:
|
|
333
|
+
- label: "Close all"
|
|
334
|
+
description: "Close all {N} non-compliant items with explanation comments"
|
|
335
|
+
- label: "Let me pick"
|
|
336
|
+
description: "I'll choose which ones to close"
|
|
337
|
+
- label: "Skip"
|
|
338
|
+
description: "Don't close anything — report only"
|
|
339
|
+
```
|
|
340
|
+
</step>
|
|
341
|
+
|
|
342
|
+
<step name="report">
|
|
343
|
+
```
|
|
344
|
+
───────────────────────────────────────────────────────────────
|
|
345
|
+
|
|
346
|
+
## Inbox Triage Complete
|
|
347
|
+
|
|
348
|
+
Reviewed: {issue_count} issues, {pr_count} PRs
|
|
349
|
+
Gate violations: {violation_count}
|
|
350
|
+
Ready to merge: {ready_count}
|
|
351
|
+
Needing attention: {attention_count}
|
|
352
|
+
Stale (30+ days): {stale_count}
|
|
353
|
+
{If report saved: "Report saved to .planning/INBOX-TRIAGE.md"}
|
|
354
|
+
|
|
355
|
+
Next steps:
|
|
356
|
+
- Review gate violations first — these block the contribution pipeline
|
|
357
|
+
- Address incomplete submissions (comment or close)
|
|
358
|
+
- Merge ready PRs
|
|
359
|
+
- Triage unclassified issues
|
|
360
|
+
|
|
361
|
+
───────────────────────────────────────────────────────────────
|
|
362
|
+
```
|
|
363
|
+
</step>
|
|
364
|
+
|
|
365
|
+
</process>
|
|
366
|
+
|
|
367
|
+
<offer_next>
|
|
368
|
+
After triage:
|
|
369
|
+
|
|
370
|
+
- /gsd-review — Run cross-AI peer review on a specific phase plan
|
|
371
|
+
- /gsd-ship — Create a PR from completed work
|
|
372
|
+
- /gsd-progress — See overall project state
|
|
373
|
+
- /gsd-inbox --label — Re-run with auto-labeling enabled
|
|
374
|
+
</offer_next>
|
|
375
|
+
|
|
376
|
+
<success_criteria>
|
|
377
|
+
- [ ] All open issues fetched and classified by type
|
|
378
|
+
- [ ] Each issue reviewed against its template requirements
|
|
379
|
+
- [ ] All open PRs fetched and classified by type
|
|
380
|
+
- [ ] Each PR reviewed against its template checklist
|
|
381
|
+
- [ ] Issue-first gate violations identified
|
|
382
|
+
- [ ] Structured report generated with scores and action items
|
|
383
|
+
- [ ] Auto-actions executed only when flagged and user-confirmed
|
|
384
|
+
</success_criteria>
|
|
@@ -26,7 +26,7 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
|
|
26
26
|
Parse JSON for: `milestone_version`, `milestone_name`, `phase_count`, `completed_count`, `in_progress_count`, `phases`, `recommended_actions`, `all_complete`, `waiting_signal`, `manager_flags`.
|
|
27
27
|
|
|
28
28
|
`manager_flags` contains per-step passthrough flags from config:
|
|
29
|
-
- `manager_flags.discuss` — appended to `/gsd
|
|
29
|
+
- `manager_flags.discuss` — appended to `/gsd-discuss-phase` args (e.g. `"--auto --analyze"`)
|
|
30
30
|
- `manager_flags.plan` — appended to plan agent init command
|
|
31
31
|
- `manager_flags.execute` — appended to execute agent init command
|
|
32
32
|
|
|
@@ -113,8 +113,8 @@ If `all_complete` is true:
|
|
|
113
113
|
╚══════════════════════════════════════════════════════════════╝
|
|
114
114
|
|
|
115
115
|
All {phase_count} phases done. Ready for final steps:
|
|
116
|
-
→ /gsd
|
|
117
|
-
→ /gsd
|
|
116
|
+
→ /gsd-verify-work — run acceptance testing
|
|
117
|
+
→ /gsd-complete-milestone — archive and wrap up
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
Ask user via AskUserQuestion:
|
|
@@ -335,11 +335,11 @@ Display final status with progress bar:
|
|
|
335
335
|
{milestone_version} — {milestone_name}
|
|
336
336
|
{PROGRESS_BAR} {progress_pct}% ({completed_count}/{phase_count} phases)
|
|
337
337
|
|
|
338
|
-
Resume anytime: /gsd
|
|
338
|
+
Resume anytime: /gsd-manager
|
|
339
339
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
340
340
|
```
|
|
341
341
|
|
|
342
|
-
**Note:** Any background agents still running will continue to completion. Their results will be visible on next `/gsd
|
|
342
|
+
**Note:** Any background agents still running will continue to completion. Their results will be visible on next `/gsd-manager` or `/gsd-progress` invocation.
|
|
343
343
|
|
|
344
344
|
</step>
|
|
345
345
|
|
|
@@ -140,7 +140,7 @@ Delete MILESTONE-CONTEXT.md if exists (consumed).
|
|
|
140
140
|
Clear leftover phase directories from the previous milestone:
|
|
141
141
|
|
|
142
142
|
```bash
|
|
143
|
-
.agent/skills/gsd/bin/gsd-tools.cjs" phases clear
|
|
143
|
+
.agent/skills/gsd/bin/gsd-tools.cjs" phases clear --confirm
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
```bash
|
|
@@ -34,6 +34,62 @@ No GSD project detected. Run `/gsd-new-project` to get started.
|
|
|
34
34
|
Exit.
|
|
35
35
|
</step>
|
|
36
36
|
|
|
37
|
+
<step name="safety_gates">
|
|
38
|
+
Run hard-stop checks before routing. Exit on first hit unless `--force` was passed.
|
|
39
|
+
|
|
40
|
+
If `--force` flag was passed, skip all gates and the consecutive guard.
|
|
41
|
+
Print a one-line warning: `⚠ --force: skipping safety gates`
|
|
42
|
+
Then proceed directly to `determine_next_action`.
|
|
43
|
+
|
|
44
|
+
**Gate 1: Unresolved checkpoint**
|
|
45
|
+
Check if `.planning/.continue-here.md` exists:
|
|
46
|
+
```bash
|
|
47
|
+
[ -f .planning/.continue-here.md ]
|
|
48
|
+
```
|
|
49
|
+
If found:
|
|
50
|
+
```
|
|
51
|
+
⛔ Hard stop: Unresolved checkpoint
|
|
52
|
+
|
|
53
|
+
`.planning/.continue-here.md` exists — a previous session left
|
|
54
|
+
unfinished work that needs manual review before advancing.
|
|
55
|
+
|
|
56
|
+
Read the file, resolve the issue, then delete it to continue.
|
|
57
|
+
Use `--force` to bypass this check.
|
|
58
|
+
```
|
|
59
|
+
Exit (do not route).
|
|
60
|
+
|
|
61
|
+
**Gate 2: Error state**
|
|
62
|
+
Check if STATE.md contains `status: error` or `status: failed`:
|
|
63
|
+
If found:
|
|
64
|
+
```
|
|
65
|
+
⛔ Hard stop: Project in error state
|
|
66
|
+
|
|
67
|
+
STATE.md shows status: {status}. Resolve the error before advancing.
|
|
68
|
+
Run `/gsd-health` to diagnose, or manually fix STATE.md.
|
|
69
|
+
Use `--force` to bypass this check.
|
|
70
|
+
```
|
|
71
|
+
Exit.
|
|
72
|
+
|
|
73
|
+
**Gate 3: Unchecked verification**
|
|
74
|
+
Check if the current phase has a VERIFICATION.md with any `FAIL` items that don't have overrides:
|
|
75
|
+
If found:
|
|
76
|
+
```
|
|
77
|
+
⛔ Hard stop: Unchecked verification failures
|
|
78
|
+
|
|
79
|
+
VERIFICATION.md for phase {N} has {count} unresolved FAIL items.
|
|
80
|
+
Address the failures or add overrides before advancing to the next phase.
|
|
81
|
+
Use `--force` to bypass this check.
|
|
82
|
+
```
|
|
83
|
+
Exit.
|
|
84
|
+
|
|
85
|
+
**Consecutive-call guard:**
|
|
86
|
+
After passing all gates, check a counter file `.planning/.next-call-count`:
|
|
87
|
+
- If file exists and count >= 6: prompt "You've called /gsd-next {N} times consecutively. Continue? [y/N]"
|
|
88
|
+
- If user says no, exit
|
|
89
|
+
- Increment the counter
|
|
90
|
+
- The counter file is deleted by any non-`/gsd-next` command (convention — other workflows don't need to implement this, the note here is sufficient)
|
|
91
|
+
</step>
|
|
92
|
+
|
|
37
93
|
<step name="determine_next_action">
|
|
38
94
|
Apply routing rules based on state:
|
|
39
95
|
|
|
@@ -6,6 +6,10 @@ Create executable phase prompts (PLAN.md files) for a roadmap phase with integra
|
|
|
6
6
|
Read all files referenced by the invoking prompt's execution_context before starting.
|
|
7
7
|
|
|
8
8
|
@references/docs/ui-brand.md
|
|
9
|
+
@references/docs/revision-loop.md
|
|
10
|
+
@references/docs/gate-prompts.md
|
|
11
|
+
@references/docs/agent-contracts.md
|
|
12
|
+
@references/docs/gates.md
|
|
9
13
|
</required_reading>
|
|
10
14
|
|
|
11
15
|
<available_agent_types>
|
|
@@ -769,13 +773,56 @@ Task(
|
|
|
769
773
|
- **`## VERIFICATION PASSED`:** Display confirmation, proceed to step 13.
|
|
770
774
|
- **`## ISSUES FOUND`:** Display issues, check iteration count, proceed to step 12.
|
|
771
775
|
|
|
776
|
+
**Thinking partner for architectural tradeoffs (conditional):**
|
|
777
|
+
If `features.thinking_partner` is enabled, scan the checker's issues for architectural tradeoff keywords
|
|
778
|
+
("architecture", "approach", "strategy", "pattern", "vs", "alternative"). If found:
|
|
779
|
+
|
|
780
|
+
```
|
|
781
|
+
The plan-checker flagged an architectural decision point:
|
|
782
|
+
{issue description}
|
|
783
|
+
|
|
784
|
+
Brief analysis:
|
|
785
|
+
- Option A: {approach_from_plan} — {pros/cons}
|
|
786
|
+
- Option B: {alternative_approach} — {pros/cons}
|
|
787
|
+
- Recommendation: {choice} aligned with {phase_goal}
|
|
788
|
+
|
|
789
|
+
Apply this to the revision? [Yes] / [No, I'll decide]
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
If yes: include the recommendation in the revision prompt. If no: proceed to revision loop as normal.
|
|
793
|
+
If thinking_partner disabled: skip this block entirely.
|
|
794
|
+
|
|
772
795
|
## 12. Revision Loop (Max 3 Iterations)
|
|
773
796
|
|
|
774
797
|
Track `iteration_count` (starts at 1 after initial plan + check).
|
|
798
|
+
Track `prev_issue_count` (initialized to `Infinity` before the loop begins).
|
|
799
|
+
Track `stall_reentry_count` (starts at 0; incremented each time "Adjust approach" re-enters step 8).
|
|
775
800
|
|
|
776
801
|
**If iteration_count < 3:**
|
|
777
802
|
|
|
778
|
-
|
|
803
|
+
Parse issue count from checker return: count BLOCKER + WARNING entries in the YAML issues block (structured output from gsd-plan-checker). If the checker's return contains no YAML issues block (i.e., the plan was approved with no issues), treat `issue_count` as 0 and skip the stall check — the plan passed. Proceed to step 13.
|
|
804
|
+
|
|
805
|
+
Display: `Revision iteration {N}/3 -- {blocker_count} blockers, {warning_count} warnings`
|
|
806
|
+
|
|
807
|
+
**Stall detection:** If `issue_count >= prev_issue_count`:
|
|
808
|
+
Display: `Revision loop stalled — issue count not decreasing ({issue_count} issues remain after {N} iterations)`
|
|
809
|
+
|
|
810
|
+
**If `stall_reentry_count < 2`:**
|
|
811
|
+
Ask user:
|
|
812
|
+
Question: "Issues remain after {N} revision attempts with no progress. Proceed with current output?"
|
|
813
|
+
Options: "Proceed anyway" | "Adjust approach"
|
|
814
|
+
If "Proceed anyway": accept current plans and continue to step 13.
|
|
815
|
+
If "Adjust approach": increment `stall_reentry_count`, open freeform discussion, then re-enter step 8 (full replanning). Note: re-entry resets `iteration_count` and `prev_issue_count` but `stall_reentry_count` persists across re-entries and is capped at 2.
|
|
816
|
+
|
|
817
|
+
**If `stall_reentry_count >= 2`:**
|
|
818
|
+
Display: `Stall persists after 2 re-planning attempts. The following issues could not be resolved automatically:`
|
|
819
|
+
List the remaining issues from the checker.
|
|
820
|
+
Suggest: "Consider resolving these issues manually or running `/gsd-debug` to investigate root causes."
|
|
821
|
+
Options: "Proceed anyway" | "Abandon"
|
|
822
|
+
If "Proceed anyway": accept current plans and continue to step 13.
|
|
823
|
+
If "Abandon": stop workflow.
|
|
824
|
+
|
|
825
|
+
Set `prev_issue_count = issue_count`.
|
|
779
826
|
|
|
780
827
|
Revision prompt:
|
|
781
828
|
|
|
@@ -23,6 +23,7 @@ Valid GSD subagent types (use exact names — do not fall back to 'general-purpo
|
|
|
23
23
|
- gsd-plan-checker — Reviews plan quality before execution
|
|
24
24
|
- gsd-executor — Executes plan tasks, commits, creates SUMMARY.md
|
|
25
25
|
- gsd-verifier — Verifies phase completion, checks quality gates
|
|
26
|
+
- gsd-code-reviewer — Reviews source files for bugs, security issues, and code quality
|
|
26
27
|
</available_agent_types>
|
|
27
28
|
|
|
28
29
|
<process>
|
|
@@ -603,7 +604,44 @@ After executor returns:
|
|
|
603
604
|
for WT in $WORKTREES; do
|
|
604
605
|
WT_BRANCH=$(git -C "$WT" rev-parse --abbrev-ref HEAD 2>/dev/null)
|
|
605
606
|
if [ -n "$WT_BRANCH" ] && [ "$WT_BRANCH" != "HEAD" ]; then
|
|
606
|
-
|
|
607
|
+
# --- Orchestrator file protection (#1756) ---
|
|
608
|
+
# Backup STATE.md and ROADMAP.md before merge (main always wins)
|
|
609
|
+
STATE_BACKUP=$(mktemp)
|
|
610
|
+
ROADMAP_BACKUP=$(mktemp)
|
|
611
|
+
git show HEAD:.planning/STATE.md > "$STATE_BACKUP" 2>/dev/null || true
|
|
612
|
+
git show HEAD:.planning/ROADMAP.md > "$ROADMAP_BACKUP" 2>/dev/null || true
|
|
613
|
+
|
|
614
|
+
# Snapshot files on main to detect resurrections
|
|
615
|
+
PRE_MERGE_FILES=$(git ls-files .planning/)
|
|
616
|
+
|
|
617
|
+
git merge "$WT_BRANCH" --no-edit -m "chore: merge quick task worktree ($WT_BRANCH)" 2>&1 || {
|
|
618
|
+
echo "⚠ Merge conflict — resolve manually"
|
|
619
|
+
rm -f "$STATE_BACKUP" "$ROADMAP_BACKUP"
|
|
620
|
+
continue
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
# Restore orchestrator-owned files
|
|
624
|
+
if [ -s "$STATE_BACKUP" ]; then cp "$STATE_BACKUP" .planning/STATE.md; fi
|
|
625
|
+
if [ -s "$ROADMAP_BACKUP" ]; then cp "$ROADMAP_BACKUP" .planning/ROADMAP.md; fi
|
|
626
|
+
rm -f "$STATE_BACKUP" "$ROADMAP_BACKUP"
|
|
627
|
+
|
|
628
|
+
# Remove files deleted on main but re-added by worktree
|
|
629
|
+
DELETED_FILES=$(git diff --diff-filter=A --name-only HEAD~1 -- .planning/ 2>/dev/null || true)
|
|
630
|
+
for RESURRECTED in $DELETED_FILES; do
|
|
631
|
+
if ! echo "$PRE_MERGE_FILES" | grep -qxF "$RESURRECTED"; then
|
|
632
|
+
git rm -f "$RESURRECTED" 2>/dev/null || true
|
|
633
|
+
fi
|
|
634
|
+
done
|
|
635
|
+
|
|
636
|
+
if ! git diff --quiet .planning/STATE.md .planning/ROADMAP.md 2>/dev/null || \
|
|
637
|
+
[ -n "$DELETED_FILES" ]; then
|
|
638
|
+
.agent/skills/gsd/bin/gsd-tools.cjs" config-get commit_docs 2>/dev/null || echo "true")
|
|
639
|
+
if [ "$COMMIT_DOCS" != "false" ]; then
|
|
640
|
+
git add .planning/STATE.md .planning/ROADMAP.md 2>/dev/null || true
|
|
641
|
+
git commit --amend --no-edit 2>/dev/null || true
|
|
642
|
+
fi
|
|
643
|
+
fi
|
|
644
|
+
|
|
607
645
|
git worktree remove "$WT" --force 2>/dev/null || true
|
|
608
646
|
git branch -D "$WT_BRANCH" 2>/dev/null || true
|
|
609
647
|
fi
|
|
@@ -622,6 +660,55 @@ Note: For quick tasks producing multiple plans (rare), spawn executors in parall
|
|
|
622
660
|
|
|
623
661
|
---
|
|
624
662
|
|
|
663
|
+
**Step 6.25: Code review (auto)**
|
|
664
|
+
|
|
665
|
+
Skip this step entirely if `$FULL_MODE` is false.
|
|
666
|
+
|
|
667
|
+
**Config gate:**
|
|
668
|
+
```bash
|
|
669
|
+
.agent/skills/gsd/bin/gsd-tools.cjs" config-get workflow.code_review 2>/dev/null || echo "true")
|
|
670
|
+
```
|
|
671
|
+
If `"false"`, skip with message "Code review skipped (workflow.code_review=false)".
|
|
672
|
+
|
|
673
|
+
**Scope files from executor's commits:**
|
|
674
|
+
```bash
|
|
675
|
+
# Find the diff base: last commit before quick task started
|
|
676
|
+
# Use git log to find commits referencing the quick task id, then take the parent of the oldest
|
|
677
|
+
QUICK_COMMITS=$(git log --oneline --format="%H" --grep="${quick_id}" 2>/dev/null)
|
|
678
|
+
if [ -n "$QUICK_COMMITS" ]; then
|
|
679
|
+
DIFF_BASE=$(echo "$QUICK_COMMITS" | tail -1)^
|
|
680
|
+
# Verify parent exists (guard against first commit in repo)
|
|
681
|
+
git rev-parse "${DIFF_BASE}" >/dev/null 2>&1 || DIFF_BASE=$(echo "$QUICK_COMMITS" | tail -1)
|
|
682
|
+
else
|
|
683
|
+
# No commits found for this quick task — skip review
|
|
684
|
+
DIFF_BASE=""
|
|
685
|
+
fi
|
|
686
|
+
|
|
687
|
+
if [ -n "$DIFF_BASE" ]; then
|
|
688
|
+
CHANGED_FILES=$(git diff --name-only "${DIFF_BASE}..HEAD" -- . ':!.planning' 2>/dev/null | tr '\n' ' ')
|
|
689
|
+
else
|
|
690
|
+
CHANGED_FILES=""
|
|
691
|
+
fi
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
If `CHANGED_FILES` is empty, skip with "No source files changed — skipping code review."
|
|
695
|
+
|
|
696
|
+
**Invoke review:**
|
|
697
|
+
```
|
|
698
|
+
Task(
|
|
699
|
+
prompt="Review these files for bugs, security issues, and code quality.
|
|
700
|
+
Files: ${CHANGED_FILES}
|
|
701
|
+
Output: ${QUICK_DIR}/${quick_id}-REVIEW.md
|
|
702
|
+
Depth: quick",
|
|
703
|
+
subagent_type="gsd-code-reviewer",
|
|
704
|
+
model="{executor_model}"
|
|
705
|
+
)
|
|
706
|
+
```
|
|
707
|
+
|
|
708
|
+
If review produces findings, display advisory message. **Error handling:** Failures are non-blocking — catch and proceed.
|
|
709
|
+
|
|
710
|
+
---
|
|
711
|
+
|
|
625
712
|
**Step 6.5: Verification (only when `$VALIDATE_MODE`)**
|
|
626
713
|
|
|
627
714
|
Skip this step entirely if NOT `$VALIDATE_MODE`.
|
|
@@ -739,7 +826,14 @@ Build file list:
|
|
|
739
826
|
```bash
|
|
740
827
|
# Explicitly stage all artifacts before commit — PLAN.md may be untracked
|
|
741
828
|
# if the executor ran without worktree isolation and committed docs early
|
|
742
|
-
|
|
829
|
+
# Filter .planning/ files from staging if commit_docs is disabled (#1783)
|
|
830
|
+
.agent/skills/gsd/bin/gsd-tools.cjs" config-get commit_docs 2>/dev/null || echo "true")
|
|
831
|
+
if [ "$COMMIT_DOCS" = "false" ]; then
|
|
832
|
+
file_list_filtered=$(echo "${file_list}" | tr ' ' '\n' | grep -v '^\.planning/' | tr '\n' ' ')
|
|
833
|
+
git add ${file_list_filtered} 2>/dev/null
|
|
834
|
+
else
|
|
835
|
+
git add ${file_list} 2>/dev/null
|
|
836
|
+
fi
|
|
743
837
|
.agent/skills/gsd/bin/gsd-tools.cjs" commit "docs(quick-${quick_id}): ${DESCRIPTION}" --files ${file_list}
|
|
744
838
|
```
|
|
745
839
|
|