refactor: update commands, workflows, agents for gsd-tools integration
Commands (15): audit-milestone, complete-milestone, debug, execute-phase, help, insert-phase, new-milestone, new-project, plan-milestone-gaps, plan-phase, progress, quick, remove-phase, research-phase, verify-work Workflows (22): execute-plan (69% reduction), verify-phase (55%), others Agents (14): All updated for new workflow structure Total token savings: ~22k chars (75.6% in affected sections) Ported from: get-shit-done-v2@d1fb2d5, 7f79a9b
This commit is contained in:
@@ -1,15 +1,11 @@
|
||||
<purpose>
|
||||
|
||||
Mark a shipped version (v1.0, v1.1, v2.0) as complete. This creates a historical record in MILESTONES.md, performs full PROJECT.md evolution review, reorganizes ROADMAP.md with milestone groupings, and tags the release in git.
|
||||
|
||||
This is the ritual that separates "development" from "shipped."
|
||||
Mark a shipped version (v1.0, v1.1, v2.0) as complete. Creates historical record in MILESTONES.md, performs full PROJECT.md evolution review, reorganizes ROADMAP.md with milestone groupings, and tags the release in git.
|
||||
|
||||
</purpose>
|
||||
|
||||
<required_reading>
|
||||
|
||||
**Read these files NOW:**
|
||||
|
||||
1. templates/milestone.md
|
||||
2. templates/milestone-archive.md
|
||||
3. `.planning/ROADMAP.md`
|
||||
@@ -20,28 +16,20 @@ This is the ritual that separates "development" from "shipped."
|
||||
|
||||
<archival_behavior>
|
||||
|
||||
When a milestone completes, this workflow:
|
||||
When a milestone completes:
|
||||
|
||||
1. Extracts full milestone details to `.planning/milestones/v[X.Y]-ROADMAP.md`
|
||||
2. Archives requirements to `.planning/milestones/v[X.Y]-REQUIREMENTS.md`
|
||||
3. Updates ROADMAP.md to replace milestone details with one-line summary
|
||||
4. Deletes REQUIREMENTS.md (fresh one created for next milestone)
|
||||
5. Performs full PROJECT.md evolution review
|
||||
6. Offers to create next milestone inline
|
||||
1. Extract full milestone details to `.planning/milestones/v[X.Y]-ROADMAP.md`
|
||||
2. Archive requirements to `.planning/milestones/v[X.Y]-REQUIREMENTS.md`
|
||||
3. Update ROADMAP.md — replace milestone details with one-line summary
|
||||
4. Delete REQUIREMENTS.md (fresh one for next milestone)
|
||||
5. Perform full PROJECT.md evolution review
|
||||
6. Offer to create next milestone inline
|
||||
|
||||
**Context Efficiency:** Archives keep ROADMAP.md constant-size and REQUIREMENTS.md milestone-scoped.
|
||||
|
||||
**Archive Format:**
|
||||
**ROADMAP archive** uses `templates/milestone-archive.md` — includes milestone header (status, phases, date), full phase details, milestone summary (decisions, issues, tech debt).
|
||||
|
||||
**ROADMAP archive** uses `templates/milestone-archive.md` template with:
|
||||
- Milestone header (status, phases, date)
|
||||
- Full phase details from roadmap
|
||||
- Milestone summary (decisions, issues, technical debt)
|
||||
|
||||
**REQUIREMENTS archive** contains:
|
||||
- All v1 requirements marked complete with outcomes
|
||||
- Traceability table with final status
|
||||
- Notes on any requirements that changed during milestone
|
||||
**REQUIREMENTS archive** contains all requirements marked complete with outcomes, traceability table with final status, notes on changed requirements.
|
||||
|
||||
</archival_behavior>
|
||||
|
||||
@@ -49,26 +37,25 @@ When a milestone completes, this workflow:
|
||||
|
||||
<step name="verify_readiness">
|
||||
|
||||
Check if milestone is truly complete:
|
||||
Check milestone completion:
|
||||
|
||||
```bash
|
||||
cat .planning/ROADMAP.md
|
||||
ls .planning/phases/*/SUMMARY.md 2>/dev/null | wc -l
|
||||
```
|
||||
|
||||
**Questions to ask:**
|
||||
|
||||
Verify:
|
||||
- Which phases belong to this milestone?
|
||||
- Are all those phases complete (all plans have summaries)?
|
||||
- Has the work been tested/validated?
|
||||
- Is this ready to ship/tag?
|
||||
- All phases complete (all plans have summaries)?
|
||||
- Work tested/validated?
|
||||
- Ready to ship/tag?
|
||||
|
||||
Present:
|
||||
|
||||
```
|
||||
Milestone: [Name from user, e.g., "v1.0 MVP"]
|
||||
Milestone: [Name, e.g., "v1.0 MVP"]
|
||||
|
||||
Appears to include:
|
||||
Includes:
|
||||
- Phase 1: Foundation (2/2 plans complete)
|
||||
- Phase 2: Authentication (2/2 plans complete)
|
||||
- Phase 3: Core Features (3/3 plans complete)
|
||||
@@ -89,13 +76,11 @@ cat .planning/config.json 2>/dev/null
|
||||
|
||||
```
|
||||
⚡ Auto-approved: Milestone scope verification
|
||||
|
||||
[Show breakdown summary without prompting]
|
||||
|
||||
Proceeding to stats gathering...
|
||||
```
|
||||
|
||||
Proceed directly to gather_stats step.
|
||||
Proceed to gather_stats.
|
||||
|
||||
</if>
|
||||
|
||||
@@ -107,9 +92,8 @@ Ready to mark this milestone as shipped?
|
||||
```
|
||||
|
||||
Wait for confirmation.
|
||||
|
||||
If "adjust scope": Ask which phases should be included.
|
||||
If "wait": Stop, user will return when ready.
|
||||
- "adjust scope": Ask which phases to include.
|
||||
- "wait": Stop, user returns when ready.
|
||||
|
||||
</if>
|
||||
|
||||
@@ -120,30 +104,20 @@ If "wait": Stop, user will return when ready.
|
||||
Calculate milestone statistics:
|
||||
|
||||
```bash
|
||||
# Count phases and plans in milestone
|
||||
# (user specified or detected from roadmap)
|
||||
|
||||
# Find git range
|
||||
git log --oneline --grep="feat(" | head -20
|
||||
|
||||
# Count files modified in range
|
||||
git diff --stat FIRST_COMMIT..LAST_COMMIT | tail -1
|
||||
|
||||
# Count LOC (adapt to language)
|
||||
find . -name "*.swift" -o -name "*.ts" -o -name "*.py" | xargs wc -l 2>/dev/null
|
||||
|
||||
# Calculate timeline
|
||||
git log --format="%ai" FIRST_COMMIT | tail -1 # Start date
|
||||
git log --format="%ai" LAST_COMMIT | head -1 # End date
|
||||
git log --format="%ai" FIRST_COMMIT | tail -1
|
||||
git log --format="%ai" LAST_COMMIT | head -1
|
||||
```
|
||||
|
||||
Present summary:
|
||||
Present:
|
||||
|
||||
```
|
||||
Milestone Stats:
|
||||
- Phases: [X-Y]
|
||||
- Plans: [Z] total
|
||||
- Tasks: [N] total (estimated from phase summaries)
|
||||
- Tasks: [N] total (from phase summaries)
|
||||
- Files modified: [M]
|
||||
- Lines of code: [LOC] [language]
|
||||
- Timeline: [Days] days ([Start] → [End])
|
||||
@@ -162,9 +136,7 @@ cat .planning/phases/02-*/02-*-SUMMARY.md
|
||||
# ... for each phase in milestone
|
||||
```
|
||||
|
||||
From summaries, extract 4-6 key accomplishments.
|
||||
|
||||
Present:
|
||||
Extract 4-6 key accomplishments. Present:
|
||||
|
||||
```
|
||||
Key accomplishments for this milestone:
|
||||
@@ -181,15 +153,7 @@ Key accomplishments for this milestone:
|
||||
|
||||
Create or update `.planning/MILESTONES.md`.
|
||||
|
||||
If file doesn't exist:
|
||||
|
||||
```markdown
|
||||
# Project Milestones: [Project Name from PROJECT.md]
|
||||
|
||||
[New entry]
|
||||
```
|
||||
|
||||
If exists, prepend new entry (reverse chronological order).
|
||||
If file doesn't exist, create with project name header. If exists, prepend new entry (reverse chronological).
|
||||
|
||||
Use template from `templates/milestone.md`:
|
||||
|
||||
@@ -209,7 +173,7 @@ Use template from `templates/milestone.md`:
|
||||
- [Files] files created/modified
|
||||
- [LOC] lines of [language]
|
||||
- [Phases] phases, [Plans] plans, [Tasks] tasks
|
||||
- [Days] days from [start milestone or start project] to ship
|
||||
- [Days] days from [start] to ship
|
||||
|
||||
**Git range:** `feat(XX-XX)` → `feat(YY-YY)`
|
||||
|
||||
@@ -222,9 +186,9 @@ Use template from `templates/milestone.md`:
|
||||
|
||||
<step name="evolve_project_full_review">
|
||||
|
||||
Perform full PROJECT.md evolution review at milestone completion.
|
||||
Full PROJECT.md evolution review at milestone completion.
|
||||
|
||||
**Read all phase summaries in this milestone:**
|
||||
Read all phase summaries:
|
||||
|
||||
```bash
|
||||
cat .planning/phases/*-*/*-SUMMARY.md
|
||||
@@ -233,48 +197,43 @@ cat .planning/phases/*-*/*-SUMMARY.md
|
||||
**Full review checklist:**
|
||||
|
||||
1. **"What This Is" accuracy:**
|
||||
- Read current description
|
||||
- Compare to what was actually built
|
||||
- Update if the product has meaningfully changed
|
||||
- Compare current description to what was built
|
||||
- Update if product has meaningfully changed
|
||||
|
||||
2. **Core Value check:**
|
||||
- Is the stated core value still the right priority?
|
||||
- Did shipping reveal a different core value?
|
||||
- Still the right priority? Did shipping reveal a different core value?
|
||||
- Update if the ONE thing has shifted
|
||||
|
||||
3. **Requirements audit:**
|
||||
|
||||
**Validated section:**
|
||||
- All Active requirements shipped in this milestone → Move to Validated
|
||||
- All Active requirements shipped this milestone → Move to Validated
|
||||
- Format: `- ✓ [Requirement] — v[X.Y]`
|
||||
|
||||
**Active section:**
|
||||
- Remove requirements that moved to Validated
|
||||
- Add any new requirements for next milestone
|
||||
- Keep requirements that weren't addressed yet
|
||||
- Remove requirements moved to Validated
|
||||
- Add new requirements for next milestone
|
||||
- Keep unaddressed requirements
|
||||
|
||||
**Out of Scope audit:**
|
||||
- Review each item — is the reasoning still valid?
|
||||
- Remove items that are no longer relevant
|
||||
- Add any requirements invalidated during this milestone
|
||||
- Review each item — reasoning still valid?
|
||||
- Remove irrelevant items
|
||||
- Add requirements invalidated during milestone
|
||||
|
||||
4. **Context update:**
|
||||
- Current codebase state (LOC, tech stack)
|
||||
- User feedback themes (if any)
|
||||
- Known issues or technical debt to address
|
||||
- Known issues or technical debt
|
||||
|
||||
5. **Key Decisions audit:**
|
||||
- Extract all decisions from milestone phase summaries
|
||||
- Add to Key Decisions table with outcomes where known
|
||||
- Mark ✓ Good, ⚠️ Revisit, or — Pending for each
|
||||
- Add to Key Decisions table with outcomes
|
||||
- Mark ✓ Good, ⚠️ Revisit, or — Pending
|
||||
|
||||
6. **Constraints check:**
|
||||
- Any constraints that changed during development?
|
||||
- Update as needed
|
||||
- Any constraints changed during development? Update as needed
|
||||
|
||||
**Update PROJECT.md:**
|
||||
|
||||
Make all edits inline. Update "Last updated" footer:
|
||||
Update PROJECT.md inline. Update "Last updated" footer:
|
||||
|
||||
```markdown
|
||||
---
|
||||
@@ -366,9 +325,7 @@ Initial user testing showed demand for shape tools.
|
||||
|
||||
<step name="reorganize_roadmap">
|
||||
|
||||
Update `.planning/ROADMAP.md` to group completed milestone phases.
|
||||
|
||||
Add milestone headers and collapse completed work:
|
||||
Update `.planning/ROADMAP.md` — group completed milestone phases:
|
||||
|
||||
```markdown
|
||||
# Roadmap: [Project Name]
|
||||
@@ -412,89 +369,53 @@ Add milestone headers and collapse completed work:
|
||||
|
||||
<step name="archive_milestone">
|
||||
|
||||
Extract completed milestone details and create archive file.
|
||||
|
||||
**Process:**
|
||||
|
||||
1. Create archive file path: `.planning/milestones/v[X.Y]-ROADMAP.md`
|
||||
Extract completed milestone details to archive.
|
||||
|
||||
1. Create `.planning/milestones/v[X.Y]-ROADMAP.md`
|
||||
2. Read `~/.claude/get-shit-done/templates/milestone-archive.md` template
|
||||
|
||||
3. Extract data from current ROADMAP.md:
|
||||
- All phases belonging to this milestone (by phase number range)
|
||||
- Full phase details (goals, plans, dependencies, status)
|
||||
- Phase plan lists with completion checkmarks
|
||||
|
||||
4. Extract data from PROJECT.md:
|
||||
- Key decisions made during this milestone
|
||||
- Requirements that were validated
|
||||
|
||||
5. Fill template {{PLACEHOLDERS}}:
|
||||
- {{VERSION}} — Milestone version (e.g., "1.0")
|
||||
- {{MILESTONE_NAME}} — From ROADMAP.md milestone header
|
||||
- {{DATE}} — Today's date
|
||||
- {{PHASE_START}} — First phase number in milestone
|
||||
- {{PHASE_END}} — Last phase number in milestone
|
||||
- {{TOTAL_PLANS}} — Count of all plans in milestone
|
||||
- {{MILESTONE_DESCRIPTION}} — From ROADMAP.md overview
|
||||
- {{PHASES_SECTION}} — Full phase details extracted
|
||||
- {{DECISIONS_FROM_PROJECT}} — Key decisions from PROJECT.md
|
||||
- {{ISSUES_RESOLVED_DURING_MILESTONE}} — From summaries
|
||||
|
||||
6. Write filled template to `.planning/milestones/v[X.Y]-ROADMAP.md`
|
||||
|
||||
7. Delete ROADMAP.md (fresh one created for next milestone):
|
||||
3. Extract from ROADMAP.md: all phases in milestone (by number range), full phase details, plan lists with checkmarks
|
||||
4. Extract from PROJECT.md: key decisions, validated requirements
|
||||
5. Fill template placeholders: {{VERSION}}, {{MILESTONE_NAME}}, {{DATE}}, {{PHASE_START}}, {{PHASE_END}}, {{TOTAL_PLANS}}, {{MILESTONE_DESCRIPTION}}, {{PHASES_SECTION}}, {{DECISIONS_FROM_PROJECT}}, {{ISSUES_RESOLVED_DURING_MILESTONE}}
|
||||
6. Write to `.planning/milestones/v[X.Y]-ROADMAP.md`
|
||||
7. Delete ROADMAP.md:
|
||||
```bash
|
||||
rm .planning/ROADMAP.md
|
||||
```
|
||||
|
||||
8. Verify archive exists:
|
||||
8. Verify:
|
||||
```bash
|
||||
ls .planning/milestones/v[X.Y]-ROADMAP.md
|
||||
```
|
||||
|
||||
9. Confirm roadmap archive complete:
|
||||
|
||||
9. Confirm:
|
||||
```
|
||||
✅ v[X.Y] roadmap archived to milestones/v[X.Y]-ROADMAP.md
|
||||
✅ ROADMAP.md deleted (fresh one for next milestone)
|
||||
```
|
||||
|
||||
**Note:** Phase directories (`.planning/phases/`) are NOT deleted. They accumulate across milestones as the raw execution history. Phase numbering continues (v1.0 phases 1-4, v1.1 phases 5-8, etc.).
|
||||
**Note:** Phase directories (`.planning/phases/`) are NOT deleted — they accumulate across milestones as raw execution history. Phase numbering continues (v1.0 phases 1-4, v1.1 phases 5-8, etc.).
|
||||
|
||||
</step>
|
||||
|
||||
<step name="archive_requirements">
|
||||
|
||||
Archive requirements and prepare for fresh requirements in next milestone.
|
||||
Archive requirements for next milestone.
|
||||
|
||||
**Process:**
|
||||
|
||||
1. Read current REQUIREMENTS.md:
|
||||
1. Read REQUIREMENTS.md:
|
||||
```bash
|
||||
cat .planning/REQUIREMENTS.md
|
||||
```
|
||||
|
||||
2. Create archive file: `.planning/milestones/v[X.Y]-REQUIREMENTS.md`
|
||||
2. Create `.planning/milestones/v[X.Y]-REQUIREMENTS.md`
|
||||
|
||||
3. Transform requirements for archive:
|
||||
- Mark all v1 requirements as `[x]` complete
|
||||
- Add outcome notes where relevant (validated, adjusted, dropped)
|
||||
- Update traceability table status to "Complete" for all shipped requirements
|
||||
- Add "Milestone Summary" section with:
|
||||
- Total requirements shipped
|
||||
- Any requirements that changed scope during milestone
|
||||
- Any requirements dropped and why
|
||||
3. Transform: mark all requirements `[x]` complete, add outcome notes, update traceability table to "Complete", add milestone summary (total shipped, scope changes, drops)
|
||||
|
||||
4. Write archive file with header:
|
||||
4. Write archive with header:
|
||||
```markdown
|
||||
# Requirements Archive: v[X.Y] [Milestone Name]
|
||||
|
||||
**Archived:** [DATE]
|
||||
**Status:** ✅ SHIPPED
|
||||
|
||||
This is the archived requirements specification for v[X.Y].
|
||||
For current requirements, see `.planning/REQUIREMENTS.md` (created for next milestone).
|
||||
For current requirements, see `.planning/REQUIREMENTS.md`.
|
||||
|
||||
---
|
||||
|
||||
@@ -504,15 +425,15 @@ Archive requirements and prepare for fresh requirements in next milestone.
|
||||
|
||||
## Milestone Summary
|
||||
|
||||
**Shipped:** [X] of [Y] v1 requirements
|
||||
**Adjusted:** [list any requirements that changed during implementation]
|
||||
**Dropped:** [list any requirements removed and why]
|
||||
**Shipped:** [X] of [Y] requirements
|
||||
**Adjusted:** [list any that changed]
|
||||
**Dropped:** [list any removed and why]
|
||||
|
||||
---
|
||||
*Archived: [DATE] as part of v[X.Y] milestone completion*
|
||||
```
|
||||
|
||||
5. Delete original REQUIREMENTS.md:
|
||||
5. Delete original:
|
||||
```bash
|
||||
rm .planning/REQUIREMENTS.md
|
||||
```
|
||||
@@ -520,34 +441,31 @@ Archive requirements and prepare for fresh requirements in next milestone.
|
||||
6. Confirm:
|
||||
```
|
||||
✅ Requirements archived to milestones/v[X.Y]-REQUIREMENTS.md
|
||||
✅ REQUIREMENTS.md deleted (fresh one needed for next milestone)
|
||||
✅ REQUIREMENTS.md deleted (fresh one for next milestone)
|
||||
```
|
||||
|
||||
**Important:** The next milestone workflow starts with `/gsd:new-milestone` which includes requirements definition. PROJECT.md's Validated section carries the cumulative record across milestones.
|
||||
**Note:** Next milestone starts with `/gsd:new-milestone` which includes requirements definition. PROJECT.md's Validated section carries cumulative record across milestones.
|
||||
|
||||
</step>
|
||||
|
||||
<step name="archive_audit">
|
||||
|
||||
Move the milestone audit file to the archive (if it exists):
|
||||
Move audit file to archive (if exists):
|
||||
|
||||
```bash
|
||||
# Move audit to milestones folder (if exists)
|
||||
[ -f .planning/v[X.Y]-MILESTONE-AUDIT.md ] && mv .planning/v[X.Y]-MILESTONE-AUDIT.md .planning/milestones/
|
||||
AUDIT_EXISTS=$(node ~/.claude/get-shit-done/bin/gsd-tools.js verify-path-exists .planning/v[X.Y]-MILESTONE-AUDIT.md --raw)
|
||||
[ "$AUDIT_EXISTS" = "true" ] && mv .planning/v[X.Y]-MILESTONE-AUDIT.md .planning/milestones/
|
||||
```
|
||||
|
||||
Confirm:
|
||||
```
|
||||
✅ Audit archived to milestones/v[X.Y]-MILESTONE-AUDIT.md
|
||||
```
|
||||
Confirm: `✅ Audit archived to milestones/v[X.Y]-MILESTONE-AUDIT.md`
|
||||
|
||||
(Skip silently if no audit file exists — audit is optional)
|
||||
Skip silently if no audit file — audit is optional.
|
||||
|
||||
</step>
|
||||
|
||||
<step name="update_state">
|
||||
|
||||
Update STATE.md to reflect milestone completion.
|
||||
Update STATE.md for milestone completion.
|
||||
|
||||
**Project Reference:**
|
||||
|
||||
@@ -572,7 +490,6 @@ Progress: [updated progress bar]
|
||||
```
|
||||
|
||||
**Accumulated Context:**
|
||||
|
||||
- Clear decisions summary (full log in PROJECT.md)
|
||||
- Clear resolved blockers
|
||||
- Keep open blockers for next milestone
|
||||
@@ -581,95 +498,63 @@ Progress: [updated progress bar]
|
||||
|
||||
<step name="handle_branches">
|
||||
|
||||
Check if branching was used and offer merge options.
|
||||
|
||||
**Check branching strategy:**
|
||||
Check branching strategy and offer merge options.
|
||||
|
||||
```bash
|
||||
# Get branching strategy from config
|
||||
BRANCHING_STRATEGY=$(cat .planning/config.json 2>/dev/null | grep -o '"branching_strategy"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*:.*"\([^"]*\)"/\1/' || echo "none")
|
||||
GSD_CONFIG=$(node ~/.claude/get-shit-done/bin/gsd-tools.js state load --raw)
|
||||
BRANCHING_STRATEGY=$(echo "$GSD_CONFIG" | grep '^branching_strategy=' | cut -d= -f2)
|
||||
PHASE_BRANCH_TEMPLATE=$(echo "$GSD_CONFIG" | grep '^phase_branch_template=' | cut -d= -f2)
|
||||
MILESTONE_BRANCH_TEMPLATE=$(echo "$GSD_CONFIG" | grep '^milestone_branch_template=' | cut -d= -f2)
|
||||
```
|
||||
|
||||
**If strategy is "none":** Skip to git_tag step.
|
||||
**If "none":** Skip to git_tag.
|
||||
|
||||
**For "phase" strategy — find phase branches:**
|
||||
**For "phase" strategy:**
|
||||
|
||||
```bash
|
||||
PHASE_BRANCH_TEMPLATE=$(cat .planning/config.json 2>/dev/null | grep -o '"phase_branch_template"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*:.*"\([^"]*\)"/\1/' || echo "gsd/phase-{phase}-{slug}")
|
||||
|
||||
# Extract prefix from template (before first variable)
|
||||
BRANCH_PREFIX=$(echo "$PHASE_BRANCH_TEMPLATE" | sed 's/{.*//')
|
||||
|
||||
# Find all phase branches for this milestone
|
||||
PHASE_BRANCHES=$(git branch --list "${BRANCH_PREFIX}*" 2>/dev/null | sed 's/^\*//' | tr -d ' ')
|
||||
```
|
||||
|
||||
**For "milestone" strategy — find milestone branch:**
|
||||
**For "milestone" strategy:**
|
||||
|
||||
```bash
|
||||
MILESTONE_BRANCH_TEMPLATE=$(cat .planning/config.json 2>/dev/null | grep -o '"milestone_branch_template"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*:.*"\([^"]*\)"/\1/' || echo "gsd/{milestone}-{slug}")
|
||||
|
||||
# Extract prefix from template
|
||||
BRANCH_PREFIX=$(echo "$MILESTONE_BRANCH_TEMPLATE" | sed 's/{.*//')
|
||||
|
||||
# Find milestone branch
|
||||
MILESTONE_BRANCH=$(git branch --list "${BRANCH_PREFIX}*" 2>/dev/null | sed 's/^\*//' | tr -d ' ' | head -1)
|
||||
```
|
||||
|
||||
**If no branches found:** Skip to git_tag step.
|
||||
**If no branches found:** Skip to git_tag.
|
||||
|
||||
**If branches exist — present merge options:**
|
||||
**If branches exist:**
|
||||
|
||||
```
|
||||
## Git Branches Detected
|
||||
|
||||
Branching strategy: {phase/milestone}
|
||||
|
||||
Branches found:
|
||||
{list of branches}
|
||||
Branches: {list}
|
||||
|
||||
Options:
|
||||
1. **Merge to main** — Merge branch(es) to main
|
||||
2. **Delete without merging** — Branches already merged or not needed
|
||||
2. **Delete without merging** — Already merged or not needed
|
||||
3. **Keep branches** — Leave for manual handling
|
||||
```
|
||||
|
||||
Use AskUserQuestion:
|
||||
AskUserQuestion with options: Squash merge (Recommended), Merge with history, Delete without merging, Keep branches.
|
||||
|
||||
```
|
||||
AskUserQuestion([
|
||||
{
|
||||
question: "How should branches be handled?",
|
||||
header: "Branches",
|
||||
multiSelect: false,
|
||||
options: [
|
||||
{ label: "Squash merge (Recommended)", description: "Squash all commits into one clean commit on main" },
|
||||
{ label: "Merge with history", description: "Preserve all individual commits (--no-ff)" },
|
||||
{ label: "Delete without merging", description: "Branches already merged or not needed" },
|
||||
{ label: "Keep branches", description: "Leave branches for manual handling later" }
|
||||
]
|
||||
}
|
||||
])
|
||||
```
|
||||
|
||||
**If "Squash merge":**
|
||||
**Squash merge:**
|
||||
|
||||
```bash
|
||||
CURRENT_BRANCH=$(git branch --show-current)
|
||||
git checkout main
|
||||
|
||||
# For phase strategy - squash merge each phase branch
|
||||
if [ "$BRANCHING_STRATEGY" = "phase" ]; then
|
||||
for branch in $PHASE_BRANCHES; do
|
||||
echo "Squash merging $branch..."
|
||||
git merge --squash "$branch"
|
||||
git commit -m "feat: $branch for v[X.Y]"
|
||||
done
|
||||
fi
|
||||
|
||||
# For milestone strategy - squash merge milestone branch
|
||||
if [ "$BRANCHING_STRATEGY" = "milestone" ]; then
|
||||
echo "Squash merging $MILESTONE_BRANCH..."
|
||||
git merge --squash "$MILESTONE_BRANCH"
|
||||
git commit -m "feat: $MILESTONE_BRANCH for v[X.Y]"
|
||||
fi
|
||||
@@ -677,34 +562,26 @@ fi
|
||||
git checkout "$CURRENT_BRANCH"
|
||||
```
|
||||
|
||||
Report: "Squash merged branches to main"
|
||||
|
||||
**If "Merge with history":**
|
||||
**Merge with history:**
|
||||
|
||||
```bash
|
||||
CURRENT_BRANCH=$(git branch --show-current)
|
||||
git checkout main
|
||||
|
||||
# For phase strategy - merge each phase branch
|
||||
if [ "$BRANCHING_STRATEGY" = "phase" ]; then
|
||||
for branch in $PHASE_BRANCHES; do
|
||||
echo "Merging $branch..."
|
||||
git merge --no-ff "$branch" -m "Merge branch '$branch' for v[X.Y]"
|
||||
done
|
||||
fi
|
||||
|
||||
# For milestone strategy - merge milestone branch
|
||||
if [ "$BRANCHING_STRATEGY" = "milestone" ]; then
|
||||
echo "Merging $MILESTONE_BRANCH..."
|
||||
git merge --no-ff "$MILESTONE_BRANCH" -m "Merge branch '$MILESTONE_BRANCH' for v[X.Y]"
|
||||
fi
|
||||
|
||||
git checkout "$CURRENT_BRANCH"
|
||||
```
|
||||
|
||||
Report: "Merged branches to main with full history"
|
||||
|
||||
**If "Delete without merging":**
|
||||
**Delete without merging:**
|
||||
|
||||
```bash
|
||||
if [ "$BRANCHING_STRATEGY" = "phase" ]; then
|
||||
@@ -718,17 +595,13 @@ if [ "$BRANCHING_STRATEGY" = "milestone" ]; then
|
||||
fi
|
||||
```
|
||||
|
||||
Report: "Deleted branches"
|
||||
|
||||
**If "Keep branches":**
|
||||
|
||||
Report: "Branches preserved for manual handling"
|
||||
**Keep branches:** Report "Branches preserved for manual handling"
|
||||
|
||||
</step>
|
||||
|
||||
<step name="git_tag">
|
||||
|
||||
Create git tag for milestone:
|
||||
Create git tag:
|
||||
|
||||
```bash
|
||||
git tag -a v[X.Y] -m "$(cat <<'EOF'
|
||||
@@ -751,7 +624,6 @@ Confirm: "Tagged: v[X.Y]"
|
||||
Ask: "Push tag to remote? (y/n)"
|
||||
|
||||
If yes:
|
||||
|
||||
```bash
|
||||
git push origin v[X.Y]
|
||||
```
|
||||
@@ -760,54 +632,11 @@ git push origin v[X.Y]
|
||||
|
||||
<step name="git_commit_milestone">
|
||||
|
||||
Commit milestone completion including archive files and deletions.
|
||||
|
||||
**Check planning config:**
|
||||
Commit milestone completion.
|
||||
|
||||
```bash
|
||||
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
||||
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.js commit "chore: complete v[X.Y] milestone" --files .planning/milestones/v[X.Y]-ROADMAP.md .planning/milestones/v[X.Y]-REQUIREMENTS.md .planning/milestones/v[X.Y]-MILESTONE-AUDIT.md .planning/MILESTONES.md .planning/PROJECT.md .planning/STATE.md
|
||||
```
|
||||
|
||||
**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations
|
||||
|
||||
**If `COMMIT_PLANNING_DOCS=true` (default):**
|
||||
|
||||
```bash
|
||||
# Stage archive files (new)
|
||||
git add .planning/milestones/v[X.Y]-ROADMAP.md
|
||||
git add .planning/milestones/v[X.Y]-REQUIREMENTS.md
|
||||
git add .planning/milestones/v[X.Y]-MILESTONE-AUDIT.md 2>/dev/null || true
|
||||
|
||||
# Stage updated files
|
||||
git add .planning/MILESTONES.md
|
||||
git add .planning/PROJECT.md
|
||||
git add .planning/STATE.md
|
||||
|
||||
# Stage deletions
|
||||
git add -u .planning/
|
||||
|
||||
# Commit with descriptive message
|
||||
git commit -m "$(cat <<'EOF'
|
||||
chore: complete v[X.Y] milestone
|
||||
|
||||
Archived:
|
||||
- milestones/v[X.Y]-ROADMAP.md
|
||||
- milestones/v[X.Y]-REQUIREMENTS.md
|
||||
- milestones/v[X.Y]-MILESTONE-AUDIT.md (if audit was run)
|
||||
|
||||
Deleted (fresh for next milestone):
|
||||
- ROADMAP.md
|
||||
- REQUIREMENTS.md
|
||||
|
||||
Updated:
|
||||
- MILESTONES.md (new entry)
|
||||
- PROJECT.md (requirements → Validated)
|
||||
- STATE.md (reset for next milestone)
|
||||
|
||||
Tagged: v[X.Y]
|
||||
EOF
|
||||
)"
|
||||
```
|
||||
|
||||
Confirm: "Committed: chore: complete v[X.Y] milestone"
|
||||
@@ -851,35 +680,20 @@ Tag: v[X.Y]
|
||||
|
||||
**Version conventions:**
|
||||
- **v1.0** — Initial MVP
|
||||
- **v1.1, v1.2, v1.3** — Minor updates, new features, fixes
|
||||
- **v2.0, v3.0** — Major rewrites, breaking changes, significant new direction
|
||||
- **v1.1, v1.2** — Minor updates, new features, fixes
|
||||
- **v2.0, v3.0** — Major rewrites, breaking changes, new direction
|
||||
|
||||
**Name conventions:**
|
||||
- v1.0 MVP
|
||||
- v1.1 Security
|
||||
- v1.2 Performance
|
||||
- v2.0 Redesign
|
||||
- v2.0 iOS Launch
|
||||
|
||||
Keep names short (1-2 words describing the focus).
|
||||
**Names:** Short 1-2 words (v1.0 MVP, v1.1 Security, v1.2 Performance, v2.0 Redesign).
|
||||
|
||||
</milestone_naming>
|
||||
|
||||
<what_qualifies>
|
||||
|
||||
**Create milestones for:**
|
||||
- Initial release (v1.0)
|
||||
- Public releases
|
||||
- Major feature sets shipped
|
||||
- Before archiving planning
|
||||
**Create milestones for:** Initial release, public releases, major feature sets shipped, before archiving planning.
|
||||
|
||||
**Don't create milestones for:**
|
||||
- Every phase completion (too granular)
|
||||
- Work in progress (wait until shipped)
|
||||
- Internal dev iterations (unless truly shipped internally)
|
||||
**Don't create milestones for:** Every phase completion (too granular), work in progress, internal dev iterations (unless truly shipped).
|
||||
|
||||
If uncertain, ask: "Is this deployed/usable/shipped in some form?"
|
||||
If yes → milestone. If no → keep working.
|
||||
Heuristic: "Is this deployed/usable/shipped?" If yes → milestone. If no → keep working.
|
||||
|
||||
</what_qualifies>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user