diff --git a/CHANGELOG.md b/CHANGELOG.md index b4fb94122d..c660a0d61d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +### Fixed +- Progress and phase-complete incorrectly route to milestone-complete when ROADMAP defines phases that have no disk directories yet (#689, #754, #757, #709) + ## [1.21.1] - 2026-02-27 ### Added diff --git a/README.md b/README.md index 91332b8cef..5ed4afb546 100644 --- a/README.md +++ b/README.md @@ -470,6 +470,7 @@ You're never locked in. The system adapts. | `/gsd:discuss-phase [N] [--auto]` | Capture implementation decisions before planning | | `/gsd:plan-phase [N] [--auto]` | Research + plan + verify for a phase | | `/gsd:execute-phase ` | Execute all plans in parallel waves, verify when complete | +| `/gsd:autopilot [N] [N-N]` | Full pipeline (discuss → plan → execute) for remaining phases | | `/gsd:verify-work [N]` | Manual user acceptance testing ¹ | | `/gsd:audit-milestone` | Verify milestone achieved its definition of done | | `/gsd:complete-milestone` | Archive milestone, tag release | diff --git a/commands/gsd/autopilot.md b/commands/gsd/autopilot.md new file mode 100644 index 0000000000..9b2aa1eb9f --- /dev/null +++ b/commands/gsd/autopilot.md @@ -0,0 +1,41 @@ +--- +name: gsd:autopilot +description: Run full pipeline (discuss, plan, execute) for remaining phases automatically +argument-hint: "[phase] [start-end]" +allowed-tools: + - Read + - Write + - Edit + - Glob + - Grep + - Bash + - Task + - AskUserQuestion +--- + +Run the full GSD pipeline for remaining phases in the current milestone — automatically. + +For each incomplete phase: generate context via synthetic multi-agent discuss, then chain through plan → execute → verify → transition. One command, full autopilot. + +**Usage:** +- `/gsd:autopilot` — Run from current phase through end of milestone +- `/gsd:autopilot 5` — Run starting from phase 5 +- `/gsd:autopilot 3-7` — Run phases 3 through 7 + + + +@~/.claude/get-shit-done/workflows/autopilot.md +@~/.claude/get-shit-done/workflows/auto-discuss.md +@~/.claude/get-shit-done/references/ui-brand.md + + + +Arguments: $ARGUMENTS (optional phase number or range) + +Context files are resolved in-workflow using `gsd-tools init progress` and `roadmap analyze`. + + + +Execute the autopilot workflow from @~/.claude/get-shit-done/workflows/autopilot.md end-to-end. +Preserve all workflow gates (phase loop, synthetic discuss, auto-advance chain, stop conditions). + diff --git a/get-shit-done/bin/lib/config.cjs b/get-shit-done/bin/lib/config.cjs index 0d9a9260df..2756ef8731 100644 --- a/get-shit-done/bin/lib/config.cjs +++ b/get-shit-done/bin/lib/config.cjs @@ -58,11 +58,16 @@ function cmdConfigEnsureSection(cwd, raw) { }, parallelization: true, brave_search: hasBraveSearch, + autopilot: { + discuss_agents: 5, + discuss_model: 'sonnet', + }, }; const defaults = { ...hardcoded, ...userDefaults, workflow: { ...hardcoded.workflow, ...(userDefaults.workflow || {}) }, + autopilot: { ...hardcoded.autopilot, ...(userDefaults.autopilot || {}) }, }; try { @@ -97,6 +102,21 @@ function cmdConfigSet(cwd, keyPath, value, raw) { error('Failed to read config.json: ' + err.message); } + // Validate autopilot.discuss_agents must be odd + if (keyPath === 'autopilot.discuss_agents') { + if (typeof parsedValue !== 'number' || parsedValue % 2 === 0 || parsedValue < 3 || parsedValue > 9) { + error('discuss_agents must be odd (3/5/7/9) for consensus.'); + } + } + + // Validate model values + const validModels = ['opus', 'sonnet', 'haiku']; + if (keyPath === 'autopilot.discuss_model') { + if (!validModels.includes(parsedValue)) { + error(`${keyPath} must be one of: ${validModels.join(', ')}`); + } + } + // Set nested value using dot notation (e.g., "workflow.research") const keys = keyPath.split('.'); let current = config; diff --git a/get-shit-done/bin/lib/core.cjs b/get-shit-done/bin/lib/core.cjs index 6ef6ccb2a1..cb7ce25f7b 100644 --- a/get-shit-done/bin/lib/core.cjs +++ b/get-shit-done/bin/lib/core.cjs @@ -351,6 +351,22 @@ function getRoadmapPhaseInternal(cwd, phaseNum) { } } +function getRoadmapPhaseNumbersInternal(cwd) { + const roadmapPath = path.join(cwd, '.planning', 'ROADMAP.md'); + try { + const content = fs.readFileSync(roadmapPath, 'utf-8'); + const pattern = /#{2,4}\s*Phase\s+(\d+[A-Z]?(?:\.\d+)*)\s*:/gi; + const numbers = []; + let m; + while ((m = pattern.exec(content)) !== null) { + numbers.push(m[1]); + } + return numbers.sort((a, b) => comparePhaseNum(a, b)); + } catch { + return []; + } +} + function resolveModelInternal(cwd, agentType) { const config = loadConfig(cwd); @@ -424,6 +440,7 @@ module.exports = { findPhaseInternal, getArchivedPhaseDirs, getRoadmapPhaseInternal, + getRoadmapPhaseNumbersInternal, resolveModelInternal, pathExistsInternal, generateSlugInternal, diff --git a/get-shit-done/bin/lib/init.cjs b/get-shit-done/bin/lib/init.cjs index 7e551a01fb..7661227de7 100644 --- a/get-shit-done/bin/lib/init.cjs +++ b/get-shit-done/bin/lib/init.cjs @@ -5,7 +5,7 @@ const fs = require('fs'); const path = require('path'); const { execSync } = require('child_process'); -const { loadConfig, resolveModelInternal, findPhaseInternal, getRoadmapPhaseInternal, pathExistsInternal, generateSlugInternal, getMilestoneInfo, normalizePhaseName, toPosixPath, output, error } = require('./core.cjs'); +const { loadConfig, resolveModelInternal, findPhaseInternal, getRoadmapPhaseInternal, getRoadmapPhaseNumbersInternal, pathExistsInternal, generateSlugInternal, getMilestoneInfo, normalizePhaseName, toPosixPath, output, error } = require('./core.cjs'); function cmdInitExecutePhase(cwd, phase, raw) { if (!phase) { @@ -35,7 +35,6 @@ function cmdInitExecutePhase(cwd, phase, raw) { phase_branch_template: config.phase_branch_template, milestone_branch_template: config.milestone_branch_template, verifier_enabled: config.verifier, - // Phase info phase_found: !!phaseInfo, phase_dir: phaseInfo?.directory || null, @@ -648,6 +647,8 @@ function cmdInitProgress(cwd, raw) { } } catch {} + const roadmapPhaseCount = getRoadmapPhaseNumbersInternal(cwd).length; + // Check for paused work let pausedAt = null; try { @@ -663,6 +664,8 @@ function cmdInitProgress(cwd, raw) { // Config commit_docs: config.commit_docs, + auto_advance: (config.workflow && config.workflow.auto_advance) || false, + discuss_agents: (config.autopilot && config.autopilot.discuss_agents) || 5, // Milestone milestone_version: milestone.version, @@ -673,6 +676,7 @@ function cmdInitProgress(cwd, raw) { phase_count: phases.length, completed_count: phases.filter(p => p.status === 'complete').length, in_progress_count: phases.filter(p => p.status === 'in_progress').length, + roadmap_phase_count: roadmapPhaseCount, // Current state current_phase: currentPhase, diff --git a/get-shit-done/bin/lib/phase.cjs b/get-shit-done/bin/lib/phase.cjs index 4e4cbff609..d58b313509 100644 --- a/get-shit-done/bin/lib/phase.cjs +++ b/get-shit-done/bin/lib/phase.cjs @@ -4,7 +4,7 @@ const fs = require('fs'); const path = require('path'); -const { escapeRegex, normalizePhaseName, comparePhaseNum, findPhaseInternal, getArchivedPhaseDirs, generateSlugInternal, output, error } = require('./core.cjs'); +const { escapeRegex, normalizePhaseName, comparePhaseNum, findPhaseInternal, getArchivedPhaseDirs, getRoadmapPhaseNumbersInternal, generateSlugInternal, output, error } = require('./core.cjs'); const { extractFrontmatter } = require('./frontmatter.cjs'); const { writeStateMd } = require('./state.cjs'); @@ -806,6 +806,24 @@ function cmdPhaseComplete(cwd, phaseNum, raw) { } } catch {} + if (isLastPhase) { + const roadmapNumbers = getRoadmapPhaseNumbersInternal(cwd); + for (const rmNum of roadmapNumbers) { + if (comparePhaseNum(rmNum, phaseNum) > 0) { + nextPhaseNum = rmNum; + try { + const rmPath = path.join(cwd, '.planning', 'ROADMAP.md'); + const rmContent = fs.readFileSync(rmPath, 'utf-8'); + const escaped = escapeRegex(rmNum); + const nameMatch = rmContent.match(new RegExp(`#{2,4}\\s*Phase\\s+${escaped}:\\s*([^\\n]+)`, 'i')); + if (nameMatch) nextPhaseName = nameMatch[1].replace(/\(INSERTED\)/i, '').trim(); + } catch {} + isLastPhase = false; + break; + } + } + } + // Update STATE.md if (fs.existsSync(statePath)) { let stateContent = fs.readFileSync(statePath, 'utf-8'); diff --git a/get-shit-done/templates/config.json b/get-shit-done/templates/config.json index d67ef30266..67a7a47cfb 100644 --- a/get-shit-done/templates/config.json +++ b/get-shit-done/templates/config.json @@ -30,6 +30,10 @@ "issues_review": true, "confirm_transition": true }, + "autopilot": { + "discuss_agents": 5, + "discuss_model": "sonnet" + }, "safety": { "always_confirm_destructive": true, "always_confirm_external_services": true diff --git a/get-shit-done/workflows/auto-discuss.md b/get-shit-done/workflows/auto-discuss.md new file mode 100644 index 0000000000..f7c1d6a6ba --- /dev/null +++ b/get-shit-done/workflows/auto-discuss.md @@ -0,0 +1,299 @@ + +Generate implementation context for a phase without human input. Spawns an odd number of agents (3/5/7/9) that analyze gray areas from different expert perspectives and converge on decisions via majority consensus. + +Produces CONTEXT.md in the same format as discuss-phase — downstream agents (researcher, planner) consume it identically. + + + +discuss-phase captures the user's vision through Q&A. In autopilot, there's no user. The solution: synthetic debate from multiple expert perspectives. + +This is better than skipping discuss — you get *debated* defaults from multiple expert perspectives, informed by existing project context. It won't capture the user's personal vision, but it will catch things a single agent would miss (edge cases, accessibility, performance tradeoffs). + + + + + +Phase number from argument (required). + +```bash +INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init phase-op "${PHASE}") +``` + +Parse JSON for: `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_context`, `roadmap_exists`. + +**If `phase_found` is false:** Return error — phase not found. + +**If `has_context` is true:** Skip — CONTEXT.md already exists, return early with status. + +Read agent count and model from config: +```bash +AGENT_COUNT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs config-get autopilot.discuss_agents 2>/dev/null || echo "5") +DISCUSS_MODEL=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs config-get autopilot.discuss_model 2>/dev/null || echo "sonnet") +``` + + + +Collect the context each agent needs to make informed decisions. + +**Read these files (paths only — agents read them with fresh context):** + +1. Phase goal from ROADMAP.md: +```bash +ROADMAP_PHASE=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "${PHASE}") +``` + +2. Identify available context files: +- `.planning/PROJECT.md` — project vision +- `.planning/REQUIREMENTS.md` — requirements +- `.planning/codebase/*.md` — codebase patterns (if exists) +- Previous phases' CONTEXT.md files — decisions already made (consistency) + +```bash +PREV_CONTEXTS=$(ls .planning/phases/*-CONTEXT.md 2>/dev/null | sort) +``` + + + +Same logic as discuss-phase's `analyze_phase` step. Read the phase goal and identify domain-specific gray areas. + +**Determine the domain:** +- Something users SEE → layout, density, interactions, states +- Something users CALL → responses, errors, auth, versioning +- Something users RUN → output format, flags, modes, error handling +- Something users READ → structure, tone, depth, flow +- Something being ORGANIZED → criteria, grouping, naming, exceptions + +**Generate 4-6 specific gray areas** for this phase. These become the debate topics. + +Example for "User Authentication" phase: +``` +1. Session handling — JWT lifetime, refresh strategy, concurrent sessions +2. Error responses — generic vs specific, rate limiting feedback +3. Multi-device policy — allow all, limit count, kick oldest +4. Recovery flow — email-only, SMS option, security questions +``` + + + +Each agent gets a distinct expert role based on the configured count: + +**3 agents:** +1. UX Designer — user experience, interaction patterns, accessibility +2. Engineer — technical feasibility, performance, maintainability +3. Product Owner — business value, scope, user impact + +**5 agents (default):** +1-3 above, plus: +4. QA / Edge Cases — error states, boundary conditions, failure modes +5. Devil's Advocate — challenges assumptions, identifies risks + +**7 agents:** +1-5 above, plus: +6. Domain Expert — industry conventions, standards compliance +7. Accessibility Specialist — WCAG, screen readers, keyboard navigation + +**9 agents:** +1-7 above, plus: +8. Security — attack vectors, data protection, auth concerns +9. Performance — load times, caching, resource usage + + + +Spawn all agents in parallel. Each agent independently analyzes gray areas from their perspective. + +**Spawn each agent via Task():** + +``` +For each agent (1 to AGENT_COUNT): + Task( + subagent_type="general-purpose", + model="${DISCUSS_MODEL}", + prompt=" + + You are a ${ROLE_NAME} reviewing implementation decisions for Phase ${PHASE}: ${PHASE_NAME}. + For each gray area, recommend a specific decision and justify it from your perspective. + + + + ${ROLE_DESCRIPTION} + Focus on: ${ROLE_FOCUS_AREAS} + + + + Phase goal: ${PHASE_GOAL} + Phase requirements: ${PHASE_REQUIREMENTS} + + + + Read these files for context: + - .planning/PROJECT.md (project vision) + - .planning/REQUIREMENTS.md (requirements, if exists) + - ${PREV_CONTEXT_FILES} (previous phase decisions, if any) + - .planning/codebase/*.md (codebase patterns, if exists) + + + + For EACH of these gray areas, provide: + 1. Your recommended decision (be specific, not vague) + 2. Your justification from ${ROLE_NAME} perspective (2-3 sentences) + 3. Any caveats or conditions + + ${GRAY_AREAS_LIST} + + + + Return your recommendations as structured text: + + ## Gray Area: [name] + **Decision:** [specific recommendation] + **Justification:** [why, from your perspective] + **Caveats:** [conditions or risks, if any] + + Repeat for each gray area. + + ", + description="${ROLE_NAME} review" + ) +``` + +Spawn all agents in parallel (single message, multiple Task calls). + + + +Tally votes per gray area. Majority wins (odd number = no ties). + +**For each gray area:** + +1. Collect all agent recommendations +2. Group similar recommendations (agents may phrase differently but mean the same thing) +3. Count votes for each distinct position +4. **Majority (>50%)** → Locked Decision +5. **Plurality but no majority** → Claude's Discretion (note the split) +6. **Any agent flags scope creep** → Deferred Idea + +**Build the decision summary:** + +``` +Gray Area: Session Handling +- JWT with 15min access + 7d refresh (3 votes: Engineer, Product, QA) +- JWT with 1hr access + 30d refresh (2 votes: UX, Devil's Advocate) +→ DECISION: JWT with 15min access + 7d refresh (consensus) +→ RATIONALE: Security-performance balance, standard practice + +Gray Area: Error Responses +- Specific error codes with user-friendly messages (2 votes) +- Generic errors in production, specific in dev (2 votes) +- Specific everywhere with rate limit headers (1 vote) +→ DISCRETION: Split between specific and environment-based. Note: majority favors specific errors. +``` + + + +Create CONTEXT.md in the same format as discuss-phase output. + +**Find or create phase directory:** + +Use values from init: `phase_dir`, `phase_slug`, `padded_phase`. + +If `phase_dir` is null: +```bash +mkdir -p ".planning/phases/${padded_phase}-${phase_slug}" +``` + +**File location:** `${phase_dir}/${padded_phase}-CONTEXT.md` + +```markdown +# Phase [X]: [Name] - Context + +**Generated:** [date] +**Method:** Synthetic discuss (${AGENT_COUNT} agents) +**Status:** Ready for planning + + +## Phase Boundary + +[Clear statement of what this phase delivers — from ROADMAP.md goal] + + + + +## Implementation Decisions + +### [Gray Area 1] +- **Decision:** [consensus recommendation] +- **Rationale:** [combined justification from voting agents] +- **Consensus:** [N]/[AGENT_COUNT] agents agreed + +### [Gray Area 2] +- **Decision:** [consensus recommendation] +- **Rationale:** [combined justification] +- **Consensus:** [N]/[AGENT_COUNT] agents agreed + +### Claude's Discretion +[Areas where votes were split — note both positions and let planner decide] +- [Gray Area X]: Split between [option A] and [option B]. [Brief context on tradeoffs.] + + + + +## Specific Ideas + +[Notable recommendations from individual agents worth preserving — e.g., a QA agent flagging an important edge case, or a UX agent suggesting a specific interaction pattern] + + + + +## Deferred Ideas + +[Any scope creep flagged by agents — captured for future phases] + +[If none: "None — all recommendations stayed within phase scope"] + + + +--- + +*Phase: ${padded_phase}-${phase_slug}* +*Context generated: [date] via synthetic discuss* +``` + + + +Commit the generated context: + +```bash +node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs(${padded_phase}): generate synthetic phase context" --files "${phase_dir}/${padded_phase}-CONTEXT.md" +``` + +Update STATE.md: +```bash +node ~/.claude/get-shit-done/bin/gsd-tools.cjs state record-session \ + --stopped-at "Phase ${PHASE} synthetic context generated" \ + --resume-file "${phase_dir}/${padded_phase}-CONTEXT.md" +``` + +Return status to caller: +``` +## CONTEXT GENERATED + +Phase: ${PHASE_NUMBER} - ${PHASE_NAME} +Method: Synthetic discuss (${AGENT_COUNT} agents) +Decisions: [N] locked, [M] discretion, [K] deferred +File: ${phase_dir}/${padded_phase}-CONTEXT.md +``` + + + + + +- [ ] Phase validated against roadmap +- [ ] Gray areas identified through domain analysis (not generic) +- [ ] Correct number of agents spawned (from config) +- [ ] Each agent assigned distinct perspective +- [ ] Majority consensus calculated per gray area +- [ ] CONTEXT.md matches discuss-phase output format +- [ ] Split votes noted as Claude's Discretion (not arbitrary picks) +- [ ] Scope creep flagged as Deferred Ideas +- [ ] Previous phase decisions considered for consistency +- [ ] File committed and state updated + diff --git a/get-shit-done/workflows/autopilot.md b/get-shit-done/workflows/autopilot.md new file mode 100644 index 0000000000..9bdfa632e0 --- /dev/null +++ b/get-shit-done/workflows/autopilot.md @@ -0,0 +1,277 @@ + +Run the full GSD pipeline for remaining phases in the current milestone — automatically. Thin loop that ensures context exists (via synthetic discuss) then spawns the existing auto-advance chain (plan → execute → verify → transition) for each phase. + +This workflow does NOT duplicate logic from discuss-phase, plan-phase, or execute-phase. It's a coordinator that: (a) ensures context exists via synthetic discuss, (b) spawns the existing auto-advance chain, (c) catches return status, and (d) loops. + + + +One command. Full autopilot. The complexity is in the existing workflows — this just chains them together with fresh context between phases. + + + + + +Parse arguments to determine phase range: + +- No argument → run from current phase through end of milestone +- Single number (e.g., `5`) → run starting from phase 5 +- Range (e.g., `3-7`) → run phases 3 through 7 + +```bash +INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init progress) +``` + +Parse JSON for: `phases`, `current_phase`, `milestone_version`, `milestone_name`, `phase_count`, `completed_count`, `roadmap_exists`, `state_exists`. + +**If `roadmap_exists` is false:** Error — no roadmap found. Run `/gsd:new-project` first. + +```bash +ROADMAP=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap analyze) +``` + +Parse roadmap analysis for all phases with goals, status, and completion info. + +**Determine phase list:** + +Filter to incomplete phases within the requested range. Skip phases already marked complete. + +If no incomplete phases remain: +``` +All phases in range are complete. + +Run /gsd:progress to see status, or /gsd:complete-milestone if milestone is done. +``` +Exit. + + + +Persist auto-advance to config so the entire chain honors it: + +```bash +node ~/.claude/get-shit-done/bin/gsd-tools.cjs config-set workflow.auto_advance true +``` + +Display launch banner: +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + GSD ► AUTOPILOT + Milestone: ${milestone_version} ${milestone_name} + Phases: ${start_phase} → ${end_phase} (${remaining_count} remaining) +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + + + +For each incomplete phase in the range: + +``` +For phase in ${INCOMPLETE_PHASES}: + + 1. Display phase header: + ┌─────────────────────────────────────┐ + │ Phase ${N}: ${NAME} │ + │ ${GOAL} │ + └─────────────────────────────────────┘ + + 2. Check if CONTEXT.md exists for this phase + → Use init phase-op or check disk directly + + 3. If no CONTEXT.md → run synthetic discuss (step: run_auto_discuss) + + 4. Spawn auto-advance chain (step: run_phase_chain) + + 5. Check result → continue, stop, or handle error (step: handle_result) +``` + + + +Spawn synthetic discuss when a phase has no CONTEXT.md. + +``` +Task( + prompt=" + + Generate implementation context for Phase ${PHASE}: ${PHASE_NAME} using synthetic multi-agent discuss. + + + + @~/.claude/get-shit-done/workflows/auto-discuss.md + + + + PHASE=${PHASE} + + + + 1. Read auto-discuss.md for your complete workflow + 2. Follow ALL steps: initialize, gather inputs, analyze gray areas, assign perspectives, spawn debate, synthesize, write context + 3. Return: CONTEXT GENERATED (success) or ERROR (failure with details) + + ", + subagent_type="general-purpose", + description="Auto-discuss Phase ${PHASE}" +) +``` + +**Handle result:** +- **CONTEXT GENERATED** → Continue to phase chain +- **ERROR** → Stop autopilot, report which phase failed and why + + + +Spawn the existing auto-advance chain starting from discuss-phase (which chains to plan → execute → verify → transition). + +Since CONTEXT.md now exists (either pre-existing or just generated), we start from plan-phase with auto-advance: + +``` +Task( + prompt=" + + You are the plan-phase orchestrator. Create executable plans for Phase ${PHASE}: ${PHASE_NAME}, then auto-advance to execution. + + + + @~/.claude/get-shit-done/workflows/plan-phase.md + @~/.claude/get-shit-done/references/ui-brand.md + @~/.claude/get-shit-done/references/model-profile-resolution.md + + + + PHASE=${PHASE} + ARGUMENTS='${PHASE} --auto' + + + + 1. Read plan-phase.md from execution_context for your complete workflow + 2. Follow ALL steps: initialize, validate, load context, research, plan, verify, auto-advance + 3. When spawning agents (gsd-phase-researcher, gsd-planner, gsd-plan-checker), use Task with specified subagent_type and model + 4. For step 14 (auto-advance to execute): spawn execute-phase as a Task with DIRECT file reference — tell it to read execute-phase.md. Include @file refs to execute-phase.md, checkpoints.md, tdd.md, model-profile-resolution.md. Pass --no-transition flag so execute-phase returns results instead of chaining further. + 5. Do NOT use the Skill tool or /gsd: commands. Read workflow .md files directly. + 6. Return: PHASE COMPLETE (full pipeline success), PLANNING COMPLETE (planning done but execute failed/skipped), PLANNING INCONCLUSIVE, or GAPS FOUND + + ", + subagent_type="general-purpose", + description="Plan+Execute Phase ${PHASE}" +) +``` + + + +Process the return from the phase chain: + +**PHASE COMPLETE:** +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + ✓ Phase ${PHASE} Complete +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +Run transition to mark complete and advance state: +```bash +# Transition is needed since we used --no-transition in the chain +TRANSITION=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs phase complete "${PHASE}") +``` + +Commit transition: +```bash +node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs(phase-${PHASE}): complete phase execution" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md +``` + +Continue to next phase in the loop. + +**PLANNING COMPLETE (execution didn't finish):** +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + ⚠ Phase ${PHASE}: Planning complete, execution incomplete + Stopping autopilot. +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Continue manually: /gsd:execute-phase ${PHASE} +``` +Stop the loop. + +**GAPS FOUND:** +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + ⚠ Phase ${PHASE}: Verification gaps found + Stopping autopilot. +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Fix gaps: /gsd:plan-phase ${PHASE} --gaps +Then resume: /gsd:autopilot ${NEXT_PHASE} +``` +Stop the loop. + +**CHECKPOINT (human-action):** +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + ⏸ Phase ${PHASE}: Human action required + Stopping autopilot. +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Complete the required action, then resume: /gsd:autopilot ${PHASE} +``` +Stop the loop. + +**Any other failure:** +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + ✗ Phase ${PHASE}: Unexpected failure + Stopping autopilot. +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Check /gsd:progress for current state. +``` +Stop the loop. + + + +When all phases in range complete successfully: + +```bash +# Clear auto-advance at milestone boundary +node ~/.claude/get-shit-done/bin/gsd-tools.cjs config-set workflow.auto_advance false +``` + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + GSD ► AUTOPILOT COMPLETE + Milestone: ${milestone_version} ${milestone_name} + Phases completed: ${completed_list} +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +All phases in range finished successfully. + +Next: /gsd:complete-milestone — archive and prepare for next +``` + + + + + +Autopilot stops when ANY of these occur: +1. **Milestone complete** — all phases in range finished +2. **human-action checkpoint** — requires manual intervention (auth gates, etc.) +3. **Gaps found** — verification failed, needs gap closure +4. **Execution failure** — plan or execution didn't complete +5. **Critical error** — unexpected failure in any step + + + +Each phase gets fresh context via Task() subagents. The autopilot orchestrator stays lean — it only tracks: +- Which phases remain +- The result status from each phase +- Whether to continue or stop + +All heavy lifting happens in subagents with their own 200k context windows. + + + +- [ ] Phase range parsed correctly from arguments +- [ ] Auto-advance config enabled for the chain +- [ ] Each phase gets CONTEXT.md (existing or synthetic) +- [ ] Auto-advance chain spawned correctly per phase +- [ ] Results handled: continue on success, stop on failure/gaps/checkpoint +- [ ] Milestone boundary stops autopilot and clears auto-advance +- [ ] User knows exactly where things stopped and how to resume + diff --git a/get-shit-done/workflows/execute-phase.md b/get-shit-done/workflows/execute-phase.md index 5149594ce0..5ee50b628c 100644 --- a/get-shit-done/workflows/execute-phase.md +++ b/get-shit-done/workflows/execute-phase.md @@ -412,6 +412,8 @@ STOP. Do not proceed to auto-advance or transition. **If `--auto` flag present OR `AUTO_CFG` is true (AND verification passed with no gaps):** +**Auto-chain verify-work:** If `config.workflow.verifier` is true and verification hasn't already run (no VERIFICATION.md), run the automated verification before transitioning. Skip the manual UAT portion — the automated `verify_phase_goal` step already checks that the codebase delivers what the phase promised. + ``` ╔══════════════════════════════════════════╗ ║ AUTO-ADVANCING → TRANSITION ║ diff --git a/get-shit-done/workflows/help.md b/get-shit-done/workflows/help.md index 2991aa18eb..6a8df34b80 100644 --- a/get-shit-done/workflows/help.md +++ b/get-shit-done/workflows/help.md @@ -113,6 +113,20 @@ Execute all plans in a phase. Usage: `/gsd:execute-phase 5` +### Automation + +**`/gsd:autopilot [phase] [start-end]`** +Run full pipeline for remaining phases automatically. + +- Chains discuss → plan → execute → verify for each phase +- Runs from current phase through end of milestone by default +- Pass a single phase number or range to limit scope +- Stops on verification failure or checkpoint requiring human input + +Usage: `/gsd:autopilot` (all remaining phases) +Usage: `/gsd:autopilot 5` (start from phase 5) +Usage: `/gsd:autopilot 3-7` (phases 3 through 7) + ### Quick Mode **`/gsd:quick`** @@ -440,6 +454,13 @@ Example config: /gsd:execute-phase 1 # Execute all plans in phase ``` +**Running phases on autopilot:** + +``` +/gsd:autopilot # All remaining phases +/gsd:autopilot 3-7 # Specific range +``` + **Resuming work after a break:** ``` diff --git a/get-shit-done/workflows/progress.md b/get-shit-done/workflows/progress.md index e1dcc2eb1c..7e7fedd10f 100644 --- a/get-shit-done/workflows/progress.md +++ b/get-shit-done/workflows/progress.md @@ -226,6 +226,7 @@ Check if `{phase_num}-CONTEXT.md` exists in phase directory. **Also available:** - `/gsd:plan-phase {phase}` — skip discussion, plan directly +- `/gsd:autopilot` — run full pipeline automatically (discuss → plan → execute) for remaining phases - `/gsd:list-phase-assumptions {phase}` — see Claude's assumptions --- @@ -299,6 +300,7 @@ Read ROADMAP.md to get the next phase's name and goal. **Also available:** - `/gsd:plan-phase {Z+1}` — skip discussion, plan directly +- `/gsd:autopilot {Z+1}` — run full pipeline automatically for remaining phases - `/gsd:verify-work {Z}` — user acceptance test before continuing --- diff --git a/get-shit-done/workflows/settings.md b/get-shit-done/workflows/settings.md index 9677001db0..2b100219b7 100644 --- a/get-shit-done/workflows/settings.md +++ b/get-shit-done/workflows/settings.md @@ -102,6 +102,27 @@ AskUserQuestion([ { label: "Per Phase", description: "Create branch for each phase (gsd/phase-{N}-{name})" }, { label: "Per Milestone", description: "Create branch for entire milestone (gsd/{version}-{name})" } ] + }, + { + question: "How many agents for synthetic discuss in autopilot?", + header: "Discuss", + multiSelect: false, + options: [ + { label: "3 agents", description: "UX Designer, Engineer, Product Owner — fastest" }, + { label: "5 agents (Recommended)", description: "Adds QA/Edge Cases + Devil's Advocate" }, + { label: "7 agents", description: "Adds Domain Expert + Accessibility" }, + { label: "9 agents", description: "Adds Security + Performance — most thorough" } + ] + }, + { + question: "Model for autopilot discuss subagents?", + header: "Discuss Model", + multiSelect: false, + options: [ + { label: "Sonnet (Recommended)", description: "Best cost/quality balance for parallel agents" }, + { label: "Opus", description: "Highest quality — significantly higher token cost with many agents" }, + { label: "Haiku", description: "Fastest and cheapest — good for simple phases" } + ] } ]) ``` @@ -123,6 +144,10 @@ Merge new settings into existing config.json: }, "git": { "branching_strategy": "none" | "phase" | "milestone" + }, + "autopilot": { + "discuss_agents": 3 | 5 | 7 | 9, + "discuss_model": "sonnet" | "opus" | "haiku" } } ``` @@ -168,6 +193,10 @@ Write `~/.gsd/defaults.json` with: "verifier": , "auto_advance": , "nyquist_validation": + }, + "autopilot": { + "discuss_agents": , + "discuss_model": } } ``` @@ -190,6 +219,8 @@ Display: | Auto-Advance | {On/Off} | | Nyquist Validation | {On/Off} | | Git Branching | {None/Per Phase/Per Milestone} | +| Discuss Agents | {3/5/7/9} | +| Discuss Model | {Sonnet/Opus/Haiku} | | Saved as Defaults | {Yes/No} | These settings apply to future /gsd:plan-phase and /gsd:execute-phase runs. @@ -206,8 +237,8 @@ Quick commands: - [ ] Current config read -- [ ] User presented with 7 settings (profile + 5 workflow toggles + git branching) -- [ ] Config updated with model_profile, workflow, and git sections +- [ ] User presented with 8 settings (profile + 5 workflow toggles + git branching + discuss agents + discuss model) +- [ ] Config updated with model_profile, workflow, git, and autopilot sections - [ ] User offered to save as global defaults (~/.gsd/defaults.json) - [ ] Changes confirmed to user