Merge upstream/main and resolve conflicts
Integrate upstream workspace features (new-workspace, list-workspaces, remove-workspace) alongside manager feature. Bump copilot skill count 53 → 54 and agent count to 18 to account for both upstream additions and the new manager skill. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
645
get-shit-done/workflows/discuss-phase-assumptions.md
Normal file
645
get-shit-done/workflows/discuss-phase-assumptions.md
Normal file
@@ -0,0 +1,645 @@
|
||||
<purpose>
|
||||
Extract implementation decisions that downstream agents need — using codebase-first analysis
|
||||
and assumption surfacing instead of interview-style questioning.
|
||||
|
||||
You are a thinking partner, not an interviewer. Analyze the codebase deeply, surface what you
|
||||
believe based on evidence, and ask the user only to correct what's wrong.
|
||||
</purpose>
|
||||
|
||||
<downstream_awareness>
|
||||
**CONTEXT.md feeds into:**
|
||||
|
||||
1. **gsd-phase-researcher** — Reads CONTEXT.md to know WHAT to research
|
||||
2. **gsd-planner** — Reads CONTEXT.md to know WHAT decisions are locked
|
||||
|
||||
**Your job:** Capture decisions clearly enough that downstream agents can act on them
|
||||
without asking the user again. Output is identical to discuss mode — same CONTEXT.md format.
|
||||
</downstream_awareness>
|
||||
|
||||
<philosophy>
|
||||
**Assumptions mode philosophy:**
|
||||
|
||||
The user is a visionary, not a codebase archaeologist. They need enough context to evaluate
|
||||
whether your assumptions match their intent — not to answer questions you could figure out
|
||||
by reading the code.
|
||||
|
||||
- Read the codebase FIRST, form opinions SECOND, ask ONLY about what's genuinely unclear
|
||||
- Every assumption must cite evidence (file paths, patterns found)
|
||||
- Every assumption must state consequences if wrong
|
||||
- Minimize user interactions: ~2-4 corrections vs ~15-20 questions
|
||||
</philosophy>
|
||||
|
||||
<scope_guardrail>
|
||||
**CRITICAL: No scope creep.**
|
||||
|
||||
The phase boundary comes from ROADMAP.md and is FIXED. Discussion clarifies HOW to implement
|
||||
what's scoped, never WHETHER to add new capabilities.
|
||||
|
||||
When user suggests scope creep:
|
||||
"[Feature X] would be a new capability — that's its own phase.
|
||||
Want me to note it for the roadmap backlog? For now, let's focus on [phase domain]."
|
||||
|
||||
Capture the idea in "Deferred Ideas". Don't lose it, don't act on it.
|
||||
</scope_guardrail>
|
||||
|
||||
<answer_validation>
|
||||
**IMPORTANT: Answer validation** — After every AskUserQuestion call, check if the response
|
||||
is empty or whitespace-only. If so:
|
||||
1. Retry the question once with the same parameters
|
||||
2. If still empty, present the options as a plain-text numbered list
|
||||
|
||||
**Text mode (`workflow.text_mode: true` in config or `--text` flag):**
|
||||
When text mode is active, do not use AskUserQuestion at all. Present every question as a
|
||||
plain-text numbered list and ask the user to type their choice number.
|
||||
</answer_validation>
|
||||
|
||||
<process>
|
||||
|
||||
<step name="initialize" priority="first">
|
||||
Phase number from argument (required).
|
||||
|
||||
```bash
|
||||
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init phase-op "${PHASE}")
|
||||
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
||||
```
|
||||
|
||||
Parse JSON for: `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`,
|
||||
`phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `has_verification`,
|
||||
`plan_count`, `roadmap_exists`, `planning_exists`.
|
||||
|
||||
**If `phase_found` is false:**
|
||||
```
|
||||
Phase [X] not found in roadmap.
|
||||
|
||||
Use /gsd:progress to see available phases.
|
||||
```
|
||||
Exit workflow.
|
||||
|
||||
**If `phase_found` is true:** Continue to check_existing.
|
||||
|
||||
**Auto mode** — If `--auto` is present in ARGUMENTS:
|
||||
- In `check_existing`: auto-select "Update it" (if context exists) or continue without prompting
|
||||
- In `present_assumptions`: skip confirmation gate, proceed directly to write CONTEXT.md
|
||||
- In `correct_assumptions`: auto-select recommended option for each correction
|
||||
- Log each auto-selected choice inline
|
||||
- After completion, auto-advance to plan-phase
|
||||
</step>
|
||||
|
||||
<step name="check_existing">
|
||||
Check if CONTEXT.md already exists using `has_context` from init.
|
||||
|
||||
```bash
|
||||
ls ${phase_dir}/*-CONTEXT.md 2>/dev/null
|
||||
```
|
||||
|
||||
**If exists:**
|
||||
|
||||
**If `--auto`:** Auto-select "Update it". Log: `[auto] Context exists — updating with assumption-based analysis.`
|
||||
|
||||
**Otherwise:** Use AskUserQuestion:
|
||||
- header: "Context"
|
||||
- question: "Phase [X] already has context. What do you want to do?"
|
||||
- options:
|
||||
- "Update it" — Re-analyze codebase and refresh assumptions
|
||||
- "View it" — Show me what's there
|
||||
- "Skip" — Use existing context as-is
|
||||
|
||||
If "Update": Load existing, continue to load_prior_context
|
||||
If "View": Display CONTEXT.md, then offer update/skip
|
||||
If "Skip": Exit workflow
|
||||
|
||||
**If doesn't exist:**
|
||||
|
||||
Check `has_plans` and `plan_count` from init. **If `has_plans` is true:**
|
||||
|
||||
**If `--auto`:** Auto-select "Continue and replan after". Log: `[auto] Plans exist — continuing with assumption analysis, will replan after.`
|
||||
|
||||
**Otherwise:** Use AskUserQuestion:
|
||||
- header: "Plans exist"
|
||||
- question: "Phase [X] already has {plan_count} plan(s) created without user context. Your decisions here won't affect existing plans unless you replan."
|
||||
- options:
|
||||
- "Continue and replan after"
|
||||
- "View existing plans"
|
||||
- "Cancel"
|
||||
|
||||
If "Continue and replan after": Continue to load_prior_context.
|
||||
If "View existing plans": Display plan files, then offer "Continue" / "Cancel".
|
||||
If "Cancel": Exit workflow.
|
||||
|
||||
**If `has_plans` is false:** Continue to load_prior_context.
|
||||
</step>
|
||||
|
||||
<step name="load_prior_context">
|
||||
Read project-level and prior phase context to avoid re-asking decided questions.
|
||||
|
||||
**Step 1: Read project-level files**
|
||||
```bash
|
||||
cat .planning/PROJECT.md 2>/dev/null
|
||||
cat .planning/REQUIREMENTS.md 2>/dev/null
|
||||
cat .planning/STATE.md 2>/dev/null
|
||||
```
|
||||
|
||||
Extract from these:
|
||||
- **PROJECT.md** — Vision, principles, non-negotiables, user preferences
|
||||
- **REQUIREMENTS.md** — Acceptance criteria, constraints
|
||||
- **STATE.md** — Current progress, any flags
|
||||
|
||||
**Step 2: Read all prior CONTEXT.md files**
|
||||
```bash
|
||||
find .planning/phases -name "*-CONTEXT.md" 2>/dev/null | sort
|
||||
```
|
||||
|
||||
For each CONTEXT.md where phase number < current phase:
|
||||
- Read the `<decisions>` section — these are locked preferences
|
||||
- Read `<specifics>` — particular references or "I want it like X" moments
|
||||
- Note patterns (e.g., "user consistently prefers minimal UI")
|
||||
|
||||
**Step 3: Build internal `<prior_decisions>` context**
|
||||
|
||||
Structure the extracted information for use in assumption generation.
|
||||
|
||||
**If no prior context exists:** Continue without — expected for early phases.
|
||||
</step>
|
||||
|
||||
<step name="cross_reference_todos">
|
||||
Check if any pending todos are relevant to this phase's scope.
|
||||
|
||||
```bash
|
||||
TODO_MATCHES=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" todo match-phase "${PHASE_NUMBER}")
|
||||
```
|
||||
|
||||
Parse JSON for: `todo_count`, `matches[]`.
|
||||
|
||||
**If `todo_count` is 0:** Skip silently.
|
||||
|
||||
**If matches found:** Present matched todos, use AskUserQuestion (multiSelect) to fold relevant ones into scope.
|
||||
|
||||
**For selected (folded) todos:** Store as `<folded_todos>` for CONTEXT.md `<decisions>` section.
|
||||
**For unselected:** Store as `<reviewed_todos>` for CONTEXT.md `<deferred>` section.
|
||||
|
||||
**Auto mode (`--auto`):** Fold all todos with score >= 0.4 automatically. Log the selection.
|
||||
</step>
|
||||
|
||||
<step name="scout_codebase">
|
||||
Lightweight scan of existing code to inform assumption generation.
|
||||
|
||||
**Step 1: Check for existing codebase maps**
|
||||
```bash
|
||||
ls .planning/codebase/*.md 2>/dev/null
|
||||
```
|
||||
|
||||
**If codebase maps exist:** Read relevant ones (CONVENTIONS.md, STRUCTURE.md, STACK.md). Extract reusable components, patterns, integration points. Skip to Step 3.
|
||||
|
||||
**Step 2: If no codebase maps, do targeted grep**
|
||||
|
||||
Extract key terms from phase goal, search for related files.
|
||||
|
||||
```bash
|
||||
grep -rl "{term1}\|{term2}" src/ app/ --include="*.ts" --include="*.tsx" 2>/dev/null | head -10
|
||||
```
|
||||
|
||||
Read the 3-5 most relevant files.
|
||||
|
||||
**Step 3: Build internal `<codebase_context>`**
|
||||
|
||||
Identify reusable assets, established patterns, integration points, and creative options. Store internally for use in deep_codebase_analysis.
|
||||
</step>
|
||||
|
||||
<step name="deep_codebase_analysis">
|
||||
Spawn a `gsd-assumptions-analyzer` agent to deeply analyze the codebase for this phase. This
|
||||
keeps raw file contents out of the main context window, protecting token budget.
|
||||
|
||||
**Resolve calibration tier (if USER-PROFILE.md exists):**
|
||||
|
||||
```bash
|
||||
PROFILE_PATH="$HOME/.claude/get-shit-done/USER-PROFILE.md"
|
||||
```
|
||||
|
||||
If file exists at PROFILE_PATH:
|
||||
- Priority 1: Read config.json > preferences.vendor_philosophy (project-level override)
|
||||
- Priority 2: Read USER-PROFILE.md Vendor Choices/Philosophy rating (global)
|
||||
- Priority 3: Default to "standard"
|
||||
|
||||
Map to calibration tier:
|
||||
- conservative OR thorough-evaluator → full_maturity (more alternatives, detailed evidence)
|
||||
- opinionated → minimal_decisive (fewer alternatives, decisive recommendations)
|
||||
- pragmatic-fast OR any other value → standard
|
||||
|
||||
If no USER-PROFILE.md: calibration_tier = "standard"
|
||||
|
||||
**Spawn Explore subagent:**
|
||||
|
||||
```
|
||||
Task(subagent_type="gsd-assumptions-analyzer", prompt="""
|
||||
Analyze the codebase for Phase {PHASE}: {phase_name}.
|
||||
|
||||
Phase goal: {roadmap_description}
|
||||
Prior decisions: {prior_decisions_summary}
|
||||
Codebase scout hints: {codebase_context_summary}
|
||||
Calibration: {calibration_tier}
|
||||
|
||||
Your job:
|
||||
1. Read ROADMAP.md phase {PHASE} description
|
||||
2. Read any prior CONTEXT.md files from earlier phases
|
||||
3. Glob/Grep for files related to: {phase_relevant_terms}
|
||||
4. Read 5-15 most relevant source files
|
||||
5. Return structured assumptions
|
||||
|
||||
## Output Format
|
||||
|
||||
Return EXACTLY this structure:
|
||||
|
||||
## Assumptions
|
||||
|
||||
### [Area Name] (e.g., "Technical Approach")
|
||||
- **Assumption:** [Decision statement]
|
||||
- **Why this way:** [Evidence from codebase — cite file paths]
|
||||
- **If wrong:** [Concrete consequence of this being wrong]
|
||||
- **Confidence:** Confident | Likely | Unclear
|
||||
|
||||
(3-5 areas, calibrated by tier:
|
||||
- full_maturity: 3-5 areas, 2-3 alternatives per Likely/Unclear item
|
||||
- standard: 3-4 areas, 2 alternatives per Likely/Unclear item
|
||||
- minimal_decisive: 2-3 areas, decisive single recommendation per item)
|
||||
|
||||
## Needs External Research
|
||||
[Topics where codebase alone is insufficient — library version compatibility,
|
||||
ecosystem best practices, etc. Leave empty if codebase provides enough evidence.]
|
||||
""")
|
||||
```
|
||||
|
||||
Parse the subagent's response. Extract:
|
||||
- `assumptions[]` — each with area, statement, evidence, consequence, confidence
|
||||
- `needs_research[]` — topics requiring external research (may be empty)
|
||||
|
||||
**Initialize canonical refs accumulator:**
|
||||
- Source 1: Copy `Canonical refs:` from ROADMAP.md for this phase, expand to full paths
|
||||
- Source 2: Check REQUIREMENTS.md and PROJECT.md for specs/ADRs referenced
|
||||
- Source 3: Add any docs referenced in codebase scout results
|
||||
</step>
|
||||
|
||||
<step name="external_research">
|
||||
**Skip if:** `needs_research` from deep_codebase_analysis is empty.
|
||||
|
||||
If research topics were flagged, spawn a general-purpose research agent:
|
||||
|
||||
```
|
||||
Task(subagent_type="general-purpose", prompt="""
|
||||
Research the following topics for Phase {PHASE}: {phase_name}.
|
||||
|
||||
Topics needing research:
|
||||
{needs_research_content}
|
||||
|
||||
For each topic, return:
|
||||
- **Finding:** [What you learned]
|
||||
- **Source:** [URL or library docs reference]
|
||||
- **Confidence impact:** [Which assumption this resolves and to what confidence level]
|
||||
|
||||
Use Context7 (resolve-library-id then query-docs) for library-specific questions.
|
||||
Use WebSearch for ecosystem/best-practice questions.
|
||||
""")
|
||||
```
|
||||
|
||||
Merge findings back into assumptions:
|
||||
- Update confidence levels where research resolves ambiguity
|
||||
- Add source attribution to affected assumptions
|
||||
- Store research findings for DISCUSSION-LOG.md
|
||||
|
||||
**If no gaps flagged:** Skip entirely. Most phases will skip this step.
|
||||
</step>
|
||||
|
||||
<step name="present_assumptions">
|
||||
Display all assumptions grouped by area with confidence badges.
|
||||
|
||||
**Format for display:**
|
||||
|
||||
```
|
||||
## Phase {PHASE}: {phase_name} — Assumptions
|
||||
|
||||
Based on codebase analysis, here's what I'd go with:
|
||||
|
||||
### {Area Name}
|
||||
{Confidence badge} **{Assumption statement}**
|
||||
↳ Evidence: {file paths cited}
|
||||
↳ If wrong: {consequence}
|
||||
|
||||
### {Area Name 2}
|
||||
...
|
||||
|
||||
[If external research was done:]
|
||||
### External Research Applied
|
||||
- {Topic}: {Finding} (Source: {URL})
|
||||
```
|
||||
|
||||
**If `--auto`:**
|
||||
- If all assumptions are Confident or Likely: log assumptions, skip to write_context.
|
||||
Log: `[auto] All assumptions Confident/Likely — proceeding to context capture.`
|
||||
- If any assumptions are Unclear: log a warning, auto-select recommended alternative for
|
||||
each Unclear item. Log: `[auto] {N} Unclear assumptions auto-resolved with recommended defaults.`
|
||||
Proceed to write_context.
|
||||
|
||||
**Otherwise:** Use AskUserQuestion:
|
||||
- header: "Assumptions"
|
||||
- question: "These all look right?"
|
||||
- options:
|
||||
- "Yes, proceed" — Write CONTEXT.md with these assumptions as decisions
|
||||
- "Let me correct some" — Select which assumptions to change
|
||||
|
||||
**If "Yes, proceed":** Skip to write_context.
|
||||
**If "Let me correct some":** Continue to correct_assumptions.
|
||||
</step>
|
||||
|
||||
<step name="correct_assumptions">
|
||||
The assumptions are already displayed above from present_assumptions.
|
||||
|
||||
Present a multiSelect where each option's label is the assumption statement and description
|
||||
is the "If wrong" consequence:
|
||||
|
||||
Use AskUserQuestion (multiSelect):
|
||||
- header: "Corrections"
|
||||
- question: "Which assumptions need correcting?"
|
||||
- options: [one per assumption, label = assumption statement, description = "If wrong: {consequence}"]
|
||||
|
||||
For each selected correction, ask ONE focused question:
|
||||
|
||||
Use AskUserQuestion:
|
||||
- header: "{Area Name}"
|
||||
- question: "What should we do instead for: {assumption statement}?"
|
||||
- options: [2-3 concrete alternatives describing user-visible outcomes, recommended option first]
|
||||
|
||||
Record each correction:
|
||||
- Original assumption
|
||||
- User's chosen alternative
|
||||
- Reason (if provided via "Other" free text)
|
||||
|
||||
After all corrections processed, continue to write_context with updated assumptions.
|
||||
|
||||
**Auto mode:** Should not reach this step (--auto skips from present_assumptions).
|
||||
</step>
|
||||
|
||||
<step name="write_context">
|
||||
Create phase directory if needed. Write CONTEXT.md using the standard 6-section format.
|
||||
|
||||
**File:** `${phase_dir}/${padded_phase}-CONTEXT.md`
|
||||
|
||||
Map assumptions to CONTEXT.md sections:
|
||||
- Assumptions → `<decisions>` (each assumption becomes a locked decision: D-01, D-02, etc.)
|
||||
- Corrections → override the original assumption in `<decisions>`
|
||||
- Areas where all assumptions were Confident → marked as locked decisions
|
||||
- Areas with corrections → include user's chosen alternative as the decision
|
||||
- Folded todos → included in `<decisions>` under "### Folded Todos"
|
||||
|
||||
```markdown
|
||||
# Phase {PHASE}: {phase_name} - Context
|
||||
|
||||
**Gathered:** {date} (assumptions mode)
|
||||
**Status:** Ready for planning
|
||||
|
||||
<domain>
|
||||
## Phase Boundary
|
||||
|
||||
{Domain boundary from ROADMAP.md — clear statement of scope anchor}
|
||||
</domain>
|
||||
|
||||
<decisions>
|
||||
## Implementation Decisions
|
||||
|
||||
### {Area Name 1}
|
||||
- **D-01:** {Decision — from assumption or correction}
|
||||
- **D-02:** {Decision}
|
||||
|
||||
### {Area Name 2}
|
||||
- **D-03:** {Decision}
|
||||
|
||||
### Claude's Discretion
|
||||
{Any assumptions where the user confirmed "you decide" or left as-is with Likely confidence}
|
||||
|
||||
### Folded Todos
|
||||
{If any todos were folded into scope}
|
||||
</decisions>
|
||||
|
||||
<canonical_refs>
|
||||
## Canonical References
|
||||
|
||||
**Downstream agents MUST read these before planning or implementing.**
|
||||
|
||||
{Accumulated canonical refs from analyze step — full relative paths}
|
||||
|
||||
[If no external specs: "No external specs — requirements fully captured in decisions above"]
|
||||
</canonical_refs>
|
||||
|
||||
<code_context>
|
||||
## Existing Code Insights
|
||||
|
||||
### Reusable Assets
|
||||
{From codebase scout + Explore subagent findings}
|
||||
|
||||
### Established Patterns
|
||||
{Patterns that constrain/enable this phase}
|
||||
|
||||
### Integration Points
|
||||
{Where new code connects to existing system}
|
||||
</code_context>
|
||||
|
||||
<specifics>
|
||||
## Specific Ideas
|
||||
|
||||
{Any particular references from corrections or user input}
|
||||
|
||||
[If none: "No specific requirements — open to standard approaches"]
|
||||
</specifics>
|
||||
|
||||
<deferred>
|
||||
## Deferred Ideas
|
||||
|
||||
{Ideas mentioned during corrections that are out of scope}
|
||||
|
||||
### Reviewed Todos (not folded)
|
||||
{Todos reviewed but not folded — with reason}
|
||||
|
||||
[If none: "None — analysis stayed within phase scope"]
|
||||
</deferred>
|
||||
```
|
||||
|
||||
Write file.
|
||||
</step>
|
||||
|
||||
<step name="write_discussion_log">
|
||||
Write audit trail of assumptions and corrections.
|
||||
|
||||
**File:** `${phase_dir}/${padded_phase}-DISCUSSION-LOG.md`
|
||||
|
||||
```markdown
|
||||
# Phase {PHASE}: {phase_name} - Discussion Log (Assumptions Mode)
|
||||
|
||||
> **Audit trail only.** Do not use as input to planning, research, or execution agents.
|
||||
> Decisions captured in CONTEXT.md — this log preserves the analysis.
|
||||
|
||||
**Date:** {ISO date}
|
||||
**Phase:** {padded_phase}-{phase_name}
|
||||
**Mode:** assumptions
|
||||
**Areas analyzed:** {comma-separated area names}
|
||||
|
||||
## Assumptions Presented
|
||||
|
||||
### {Area Name}
|
||||
| Assumption | Confidence | Evidence |
|
||||
|------------|-----------|----------|
|
||||
| {Statement} | {Confident/Likely/Unclear} | {file paths} |
|
||||
|
||||
{Repeat for each area}
|
||||
|
||||
## Corrections Made
|
||||
|
||||
{If corrections were made:}
|
||||
|
||||
### {Area Name}
|
||||
- **Original assumption:** {what Claude assumed}
|
||||
- **User correction:** {what the user chose instead}
|
||||
- **Reason:** {user's rationale, if provided}
|
||||
|
||||
{If no corrections: "No corrections — all assumptions confirmed."}
|
||||
|
||||
## Auto-Resolved
|
||||
|
||||
{If --auto and Unclear items existed:}
|
||||
- {Assumption}: auto-selected {recommended option}
|
||||
|
||||
{If not applicable: omit this section}
|
||||
|
||||
## External Research
|
||||
|
||||
{If research was performed:}
|
||||
- {Topic}: {Finding} (Source: {URL})
|
||||
|
||||
{If no research: omit this section}
|
||||
```
|
||||
|
||||
Write file.
|
||||
</step>
|
||||
|
||||
<step name="git_commit">
|
||||
Commit phase context and discussion log:
|
||||
|
||||
```bash
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs(${padded_phase}): capture phase context (assumptions mode)" --files "${phase_dir}/${padded_phase}-CONTEXT.md" "${phase_dir}/${padded_phase}-DISCUSSION-LOG.md"
|
||||
```
|
||||
|
||||
Confirm: "Committed: docs(${padded_phase}): capture phase context (assumptions mode)"
|
||||
</step>
|
||||
|
||||
<step name="update_state">
|
||||
Update STATE.md with session info:
|
||||
|
||||
```bash
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" state record-session \
|
||||
--stopped-at "Phase ${PHASE} context gathered (assumptions mode)" \
|
||||
--resume-file "${phase_dir}/${padded_phase}-CONTEXT.md"
|
||||
```
|
||||
|
||||
Commit STATE.md:
|
||||
|
||||
```bash
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs(state): record phase ${PHASE} context session" --files .planning/STATE.md
|
||||
```
|
||||
</step>
|
||||
|
||||
<step name="confirm_creation">
|
||||
Present summary and next steps:
|
||||
|
||||
```
|
||||
Created: .planning/phases/${PADDED_PHASE}-${SLUG}/${PADDED_PHASE}-CONTEXT.md
|
||||
|
||||
## Decisions Captured (Assumptions Mode)
|
||||
|
||||
### {Area Name}
|
||||
- {Key decision} (from assumption / corrected)
|
||||
|
||||
{Repeat per area}
|
||||
|
||||
[If corrections were made:]
|
||||
## Corrections Applied
|
||||
- {Area}: {original} → {corrected}
|
||||
|
||||
[If deferred ideas exist:]
|
||||
## Noted for Later
|
||||
- {Deferred idea} — future phase
|
||||
|
||||
---
|
||||
|
||||
## ▶ Next Up
|
||||
|
||||
**Phase ${PHASE}: {phase_name}** — {Goal from ROADMAP.md}
|
||||
|
||||
`/gsd:plan-phase ${PHASE}`
|
||||
|
||||
<sub>`/clear` first → fresh context window</sub>
|
||||
|
||||
---
|
||||
|
||||
**Also available:**
|
||||
- `/gsd:plan-phase ${PHASE} --skip-research` — plan without research
|
||||
- `/gsd:ui-phase ${PHASE}` — generate UI design contract (if frontend work)
|
||||
- Review/edit CONTEXT.md before continuing
|
||||
|
||||
---
|
||||
```
|
||||
</step>
|
||||
|
||||
<step name="auto_advance">
|
||||
Check for auto-advance trigger:
|
||||
|
||||
1. Parse `--auto` flag from $ARGUMENTS
|
||||
2. Sync chain flag:
|
||||
```bash
|
||||
if [[ ! "$ARGUMENTS" =~ --auto ]]; then
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-set workflow._auto_chain_active false 2>/dev/null
|
||||
fi
|
||||
```
|
||||
3. Read chain flag and user preference:
|
||||
```bash
|
||||
AUTO_CHAIN=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get workflow._auto_chain_active 2>/dev/null || echo "false")
|
||||
AUTO_CFG=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get workflow.auto_advance 2>/dev/null || echo "false")
|
||||
```
|
||||
|
||||
**If `--auto` flag present AND `AUTO_CHAIN` is not true:**
|
||||
```bash
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-set workflow._auto_chain_active true
|
||||
```
|
||||
|
||||
**If `--auto` flag present OR `AUTO_CHAIN` is true OR `AUTO_CFG` is true:**
|
||||
|
||||
Display banner:
|
||||
```
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
GSD ► AUTO-ADVANCING TO PLAN
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
Context captured (assumptions mode). Launching plan-phase...
|
||||
```
|
||||
|
||||
Launch: `Skill(skill="gsd:plan-phase", args="${PHASE} --auto")`
|
||||
|
||||
Handle return: PHASE COMPLETE / PLANNING COMPLETE / INCONCLUSIVE / GAPS FOUND
|
||||
(identical handling to discuss-phase.md auto_advance step)
|
||||
|
||||
**If neither `--auto` nor config enabled:**
|
||||
Route to confirm_creation step.
|
||||
</step>
|
||||
|
||||
</process>
|
||||
|
||||
<success_criteria>
|
||||
- Phase validated against roadmap
|
||||
- Prior context loaded (no re-asking decided questions)
|
||||
- Codebase deeply analyzed via Explore subagent (5-15 files read)
|
||||
- Assumptions surfaced with evidence and confidence levels
|
||||
- User confirmed or corrected assumptions (~2-4 interactions max)
|
||||
- Scope creep redirected to deferred ideas
|
||||
- CONTEXT.md captures actual decisions (identical format to discuss mode)
|
||||
- CONTEXT.md includes canonical_refs with full file paths (MANDATORY)
|
||||
- CONTEXT.md includes code_context from codebase analysis
|
||||
- DISCUSSION-LOG.md records assumptions and corrections as audit trail
|
||||
- STATE.md updated with session info
|
||||
- User knows next steps
|
||||
</success_criteria>
|
||||
@@ -362,6 +362,33 @@ Analyze the phase to identify gray areas worth discussing. **Use both `prior_dec
|
||||
|
||||
4. **Skip assessment** — If no meaningful gray areas exist (pure infrastructure, clear-cut implementation, or all already decided in prior phases), the phase may not need discussion.
|
||||
|
||||
**Advisor Mode Detection:**
|
||||
|
||||
Check if advisor mode should activate:
|
||||
|
||||
1. Check for USER-PROFILE.md:
|
||||
```bash
|
||||
PROFILE_PATH="$HOME/.claude/get-shit-done/USER-PROFILE.md"
|
||||
```
|
||||
ADVISOR_MODE = file exists at PROFILE_PATH → true, otherwise → false
|
||||
|
||||
2. If ADVISOR_MODE is true, resolve vendor_philosophy calibration tier:
|
||||
- Priority 1: Read config.json > preferences.vendor_philosophy (project-level override)
|
||||
- Priority 2: Read USER-PROFILE.md Vendor Choices/Philosophy rating (global)
|
||||
- Priority 3: Default to "standard" if neither has a value or value is UNSCORED
|
||||
|
||||
Map to calibration tier:
|
||||
- conservative OR thorough-evaluator → full_maturity
|
||||
- opinionated → minimal_decisive
|
||||
- pragmatic-fast OR any other value OR empty → standard
|
||||
|
||||
3. Resolve model for advisor agents:
|
||||
```bash
|
||||
ADVISOR_MODEL=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" resolve-model gsd-advisor-researcher --raw)
|
||||
```
|
||||
|
||||
If ADVISOR_MODE is false, skip all advisor-specific steps — workflow proceeds with existing conversational flow unchanged.
|
||||
|
||||
**Output your analysis internally, then present to user.**
|
||||
|
||||
Example analysis for "Post Feed" phase (with code and prior context):
|
||||
@@ -451,10 +478,96 @@ For "Organize photo library" (organization task):
|
||||
☐ Folder structure — Flat, nested by year, or by category?
|
||||
```
|
||||
|
||||
Continue to discuss_areas with selected areas.
|
||||
Continue to discuss_areas with selected areas (or advisor_research if ADVISOR_MODE is true).
|
||||
</step>
|
||||
|
||||
<step name="advisor_research">
|
||||
**Advisor Research** (only when ADVISOR_MODE is true)
|
||||
|
||||
After user selects gray areas in present_gray_areas, spawn parallel research agents.
|
||||
|
||||
1. Display brief status: "Researching {N} areas..."
|
||||
|
||||
2. For EACH user-selected gray area, spawn a Task() in parallel:
|
||||
|
||||
Task(
|
||||
prompt="First, read @~/.claude/agents/gsd-advisor-researcher.md for your role and instructions.
|
||||
|
||||
<gray_area>{area_name}: {area_description from gray area identification}</gray_area>
|
||||
<phase_context>{phase_goal and description from ROADMAP.md}</phase_context>
|
||||
<project_context>{project name and brief description from PROJECT.md}</project_context>
|
||||
<calibration_tier>{resolved calibration tier: full_maturity | standard | minimal_decisive}</calibration_tier>
|
||||
|
||||
Research this gray area and return a structured comparison table with rationale.",
|
||||
subagent_type="general-purpose",
|
||||
model="{ADVISOR_MODEL}",
|
||||
description="Research: {area_name}"
|
||||
)
|
||||
|
||||
All Task() calls spawn simultaneously — do NOT wait for one before starting the next.
|
||||
|
||||
3. After ALL agents return, SYNTHESIZE results before presenting:
|
||||
For each agent's return:
|
||||
a. Parse the markdown comparison table and rationale paragraph
|
||||
b. Verify all 5 columns present (Option | Pros | Cons | Complexity | Recommendation) — fill any missing columns rather than showing broken table
|
||||
c. Verify option count matches calibration tier:
|
||||
- full_maturity: 3-5 options acceptable
|
||||
- standard: 2-4 options acceptable
|
||||
- minimal_decisive: 1-2 options acceptable
|
||||
If agent returned too many, trim least viable. If too few, accept as-is.
|
||||
d. Rewrite rationale paragraph to weave in project context and ongoing discussion context that the agent did not have access to
|
||||
e. If agent returned only 1 option, convert from table format to direct recommendation: "Standard approach for {area}: {option}. {rationale}"
|
||||
|
||||
4. Store synthesized tables for use in discuss_areas.
|
||||
|
||||
**If ADVISOR_MODE is false:** Skip this step entirely — proceed directly from present_gray_areas to discuss_areas.
|
||||
</step>
|
||||
|
||||
<step name="discuss_areas">
|
||||
Discuss each selected area with the user. Flow depends on advisor mode.
|
||||
|
||||
**If ADVISOR_MODE is true:**
|
||||
|
||||
Table-first discussion flow — present research-backed comparison tables, then capture user picks.
|
||||
|
||||
**For each selected area:**
|
||||
|
||||
1. **Present the synthesized comparison table + rationale paragraph** (from advisor_research step)
|
||||
|
||||
2. **Use AskUserQuestion:**
|
||||
- header: "{area_name}"
|
||||
- question: "Which approach for {area_name}?"
|
||||
- options: Extract from the table's Option column (AskUserQuestion adds "Other" automatically)
|
||||
|
||||
3. **Record the user's selection:**
|
||||
- If user picks from table options → record as locked decision for that area
|
||||
- If user picks "Other" → receive their input, reflect it back for confirmation, record
|
||||
|
||||
4. **After recording pick, Claude decides whether follow-up questions are needed:**
|
||||
- If the pick has ambiguity that would affect downstream planning → ask 1-2 targeted follow-up questions using AskUserQuestion
|
||||
- If the pick is clear and self-contained → move to next area
|
||||
- Do NOT ask the standard 4 questions — the table already provided the context
|
||||
|
||||
5. **After all areas processed:**
|
||||
- header: "Done"
|
||||
- question: "That covers [list areas]. Ready to create context?"
|
||||
- options: "Create context" / "Revisit an area"
|
||||
|
||||
**Scope creep handling (advisor mode):**
|
||||
If user mentions something outside the phase domain:
|
||||
```
|
||||
"[Feature] sounds like a new capability — that belongs in its own phase.
|
||||
I'll note it as a deferred idea.
|
||||
|
||||
Back to [current area]: [return to current question]"
|
||||
```
|
||||
|
||||
Track deferred ideas internally.
|
||||
|
||||
---
|
||||
|
||||
**If ADVISOR_MODE is false:**
|
||||
|
||||
For each selected area, conduct a focused discussion loop.
|
||||
|
||||
**Research-before-questions mode:** Check if `research_questions` is enabled in config (from init context or `.planning/config.json`). When enabled, before presenting questions for each area:
|
||||
@@ -650,11 +763,11 @@ mkdir -p ".planning/phases/${padded_phase}-${phase_slug}"
|
||||
## Implementation Decisions
|
||||
|
||||
### [Category 1 that was discussed]
|
||||
- [Decision or preference captured]
|
||||
- [Another decision if applicable]
|
||||
- **D-01:** [Decision or preference captured]
|
||||
- **D-02:** [Another decision if applicable]
|
||||
|
||||
### [Category 2 that was discussed]
|
||||
- [Decision or preference captured]
|
||||
- **D-03:** [Decision or preference captured]
|
||||
|
||||
### Claude's Discretion
|
||||
[Areas where user said "you decide" — note that Claude has flexibility here]
|
||||
|
||||
@@ -47,6 +47,16 @@ Always use the exact name from this list — do not fall back to 'general-purpos
|
||||
|
||||
<process>
|
||||
|
||||
<step name="parse_args" priority="first">
|
||||
Parse `$ARGUMENTS` before loading any context:
|
||||
|
||||
- First positional token → `PHASE_ARG`
|
||||
- Optional `--wave N` → `WAVE_FILTER`
|
||||
- Optional `--gaps-only` keeps its current meaning
|
||||
|
||||
If `--wave` is absent, preserve the current behavior of executing all incomplete waves in the phase.
|
||||
</step>
|
||||
|
||||
<step name="initialize" priority="first">
|
||||
Load all context in one call:
|
||||
|
||||
@@ -162,13 +172,19 @@ PLAN_INDEX=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" phase-plan-ind
|
||||
|
||||
Parse JSON for: `phase`, `plans[]` (each with `id`, `wave`, `autonomous`, `objective`, `files_modified`, `task_count`, `has_summary`), `waves` (map of wave number → plan IDs), `incomplete`, `has_checkpoints`.
|
||||
|
||||
**Filtering:** Skip plans where `has_summary: true`. If `--gaps-only`: also skip non-gap_closure plans. If all filtered: "No matching incomplete plans" → exit.
|
||||
**Filtering:** Skip plans where `has_summary: true`. If `--gaps-only`: also skip non-gap_closure plans. If `WAVE_FILTER` is set: also skip plans whose `wave` does not equal `WAVE_FILTER`.
|
||||
|
||||
**Wave safety check:** If `WAVE_FILTER` is set and there are still incomplete plans in any lower wave that match the current execution mode, STOP and tell the user to finish earlier waves first. Do not let Wave 2+ execute while prerequisite earlier-wave plans remain incomplete.
|
||||
|
||||
If all filtered: "No matching incomplete plans" → exit.
|
||||
|
||||
Report:
|
||||
```
|
||||
## Execution Plan
|
||||
|
||||
**Phase {X}: {Name}** — {total_plans} plans across {wave_count} waves
|
||||
**Phase {X}: {Name}** — {total_plans} matching plans across {wave_count} wave(s)
|
||||
|
||||
{If WAVE_FILTER is set: `Wave filter active: executing only Wave {WAVE_FILTER}`.}
|
||||
|
||||
| Wave | Plans | What it builds |
|
||||
|------|-------|----------------|
|
||||
@@ -178,7 +194,7 @@ Report:
|
||||
</step>
|
||||
|
||||
<step name="execute_waves">
|
||||
Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`, sequential if `false`.
|
||||
Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`, sequential if `false`.
|
||||
|
||||
**For each wave:**
|
||||
|
||||
@@ -418,6 +434,37 @@ After all waves:
|
||||
```
|
||||
</step>
|
||||
|
||||
<step name="handle_partial_wave_execution">
|
||||
If `WAVE_FILTER` was used, re-run plan discovery after execution:
|
||||
|
||||
```bash
|
||||
POST_PLAN_INDEX=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" phase-plan-index "${PHASE_NUMBER}")
|
||||
```
|
||||
|
||||
Apply the same "incomplete" filtering rules as earlier:
|
||||
- ignore plans with `has_summary: true`
|
||||
- if `--gaps-only`, only consider `gap_closure: true` plans
|
||||
|
||||
**If incomplete plans still remain anywhere in the phase:**
|
||||
- STOP here
|
||||
- Do NOT run phase verification
|
||||
- Do NOT mark the phase complete in ROADMAP/STATE
|
||||
- Present:
|
||||
|
||||
```markdown
|
||||
## Wave {WAVE_FILTER} Complete
|
||||
|
||||
Selected wave finished successfully. This phase still has incomplete plans, so phase-level verification and completion were intentionally skipped.
|
||||
|
||||
/gsd:execute-phase {phase} # Continue remaining waves
|
||||
/gsd:execute-phase {phase} --wave {next} # Run the next wave explicitly
|
||||
```
|
||||
|
||||
**If no incomplete plans remain after the selected wave finishes:**
|
||||
- continue with the normal phase-level verification and completion flow below
|
||||
- this means the selected wave happened to be the last remaining work in the phase
|
||||
</step>
|
||||
|
||||
<step name="close_parent_artifacts">
|
||||
**For decimal/polish phases only (X.Y pattern):** Close the feedback loop by resolving parent UAT and debug artifacts.
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init execute-phase "
|
||||
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
||||
```
|
||||
|
||||
Extract from init JSON: `executor_model`, `commit_docs`, `phase_dir`, `phase_number`, `plans`, `summaries`, `incomplete_plans`, `state_path`, `config_path`.
|
||||
Extract from init JSON: `executor_model`, `commit_docs`, `sub_repos`, `phase_dir`, `phase_number`, `plans`, `summaries`, `incomplete_plans`, `state_path`, `config_path`.
|
||||
|
||||
If `.planning/` missing: error.
|
||||
</step>
|
||||
@@ -276,6 +276,20 @@ git add src/types/user.ts
|
||||
|
||||
**4. Format:** `{type}({phase}-{plan}): {description}` with bullet points for key changes.
|
||||
|
||||
<sub_repos_commit_flow>
|
||||
**Sub-repos mode:** If `sub_repos` is configured (non-empty array from init context), use `commit-to-subrepo` instead of standard git commit. This routes files to their correct sub-repo based on path prefix.
|
||||
|
||||
```bash
|
||||
node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit-to-subrepo "{type}({phase}-{plan}): {description}" --files file1 file2 ...
|
||||
```
|
||||
|
||||
The command groups files by sub-repo prefix and commits atomically to each. Returns JSON: `{ committed: true, repos: { "backend": { hash: "abc", files: [...] }, ... } }`.
|
||||
|
||||
Record hashes from each repo in the response for SUMMARY tracking.
|
||||
|
||||
**If `sub_repos` is empty or not set:** Use standard git commit flow below.
|
||||
</sub_repos_commit_flow>
|
||||
|
||||
**5. Record hash:**
|
||||
```bash
|
||||
TASK_COMMIT=$(git rev-parse --short HEAD)
|
||||
|
||||
@@ -107,14 +107,16 @@ Result: Creates `.planning/phases/01-foundation/01-01-PLAN.md`
|
||||
### Execution
|
||||
|
||||
**`/gsd:execute-phase <phase-number>`**
|
||||
Execute all plans in a phase.
|
||||
Execute all plans in a phase, or run a specific wave.
|
||||
|
||||
- Groups plans by wave (from frontmatter), executes waves sequentially
|
||||
- Plans within each wave run in parallel via Task tool
|
||||
- Optional `--wave N` flag executes only Wave `N` and stops unless the phase is now fully complete
|
||||
- Verifies phase goal after all plans complete
|
||||
- Updates REQUIREMENTS.md, ROADMAP.md, STATE.md
|
||||
|
||||
Usage: `/gsd:execute-phase 5`
|
||||
Usage: `/gsd:execute-phase 5 --wave 2`
|
||||
|
||||
### Smart Router
|
||||
|
||||
|
||||
56
get-shit-done/workflows/list-workspaces.md
Normal file
56
get-shit-done/workflows/list-workspaces.md
Normal file
@@ -0,0 +1,56 @@
|
||||
<purpose>
|
||||
List all GSD workspaces found in ~/gsd-workspaces/ with their status.
|
||||
</purpose>
|
||||
|
||||
<required_reading>
|
||||
Read all files referenced by the invoking prompt's execution_context before starting.
|
||||
</required_reading>
|
||||
|
||||
<process>
|
||||
|
||||
## 1. Setup
|
||||
|
||||
```bash
|
||||
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init list-workspaces)
|
||||
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
||||
```
|
||||
|
||||
Parse JSON for: `workspace_base`, `workspaces`, `workspace_count`.
|
||||
|
||||
## 2. Display
|
||||
|
||||
**If `workspace_count` is 0:**
|
||||
|
||||
```
|
||||
No workspaces found in ~/gsd-workspaces/
|
||||
|
||||
Create one with:
|
||||
/gsd:new-workspace --name my-workspace --repos repo1,repo2
|
||||
```
|
||||
|
||||
Done.
|
||||
|
||||
**If workspaces exist:**
|
||||
|
||||
Display a table:
|
||||
|
||||
```
|
||||
GSD Workspaces (~/gsd-workspaces/)
|
||||
|
||||
| Name | Repos | Strategy | GSD Project |
|
||||
|------|-------|----------|-------------|
|
||||
| feature-a | 3 | worktree | Yes |
|
||||
| feature-b | 2 | clone | No |
|
||||
|
||||
Manage:
|
||||
cd ~/gsd-workspaces/<name> # Enter a workspace
|
||||
/gsd:remove-workspace <name> # Remove a workspace
|
||||
```
|
||||
|
||||
For each workspace, show:
|
||||
- **Name** — directory name
|
||||
- **Repos** — count from init data
|
||||
- **Strategy** — from WORKSPACE.md
|
||||
- **GSD Project** — whether `.planning/PROJECT.md` exists (Yes/No)
|
||||
|
||||
</process>
|
||||
@@ -43,6 +43,38 @@ If the flag is absent, keep the current behavior of continuing phase numbering f
|
||||
- Suggest next version (v1.0 → v1.1, or v2.0 for major)
|
||||
- Confirm with user
|
||||
|
||||
## 3.5. Verify Milestone Understanding
|
||||
|
||||
Before writing any files, present a summary of what was gathered and ask for confirmation.
|
||||
|
||||
```
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
GSD ► MILESTONE SUMMARY
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
**Milestone v[X.Y]: [Name]**
|
||||
|
||||
**Goal:** [One sentence]
|
||||
|
||||
**Target features:**
|
||||
- [Feature 1]
|
||||
- [Feature 2]
|
||||
- [Feature 3]
|
||||
|
||||
**Key context:** [Any important constraints, decisions, or notes from questioning]
|
||||
```
|
||||
|
||||
AskUserQuestion:
|
||||
- header: "Confirm?"
|
||||
- question: "Does this capture what you want to build in this milestone?"
|
||||
- options:
|
||||
- "Looks good" — Proceed to write PROJECT.md
|
||||
- "Adjust" — Let me correct or add details
|
||||
|
||||
**If "Adjust":** Ask what needs changing (plain text, NOT AskUserQuestion). Incorporate changes, re-present the summary. Loop until "Looks good" is selected.
|
||||
|
||||
**If "Looks good":** Proceed to Step 4.
|
||||
|
||||
## 4. Update PROJECT.md
|
||||
|
||||
Add/update:
|
||||
|
||||
@@ -7,11 +7,13 @@ Read all files referenced by the invoking prompt's execution_context before star
|
||||
</required_reading>
|
||||
|
||||
<auto_mode>
|
||||
|
||||
## Auto Mode Detection
|
||||
|
||||
Check if `--auto` flag is present in $ARGUMENTS.
|
||||
|
||||
**If auto mode:**
|
||||
|
||||
- Skip brownfield mapping offer (assume greenfield)
|
||||
- Skip deep questioning (extract context from provided document)
|
||||
- Config: YOLO mode is implicit (skip that question), but ask granularity/git/agents FIRST (Step 2a)
|
||||
@@ -23,6 +25,7 @@ Check if `--auto` flag is present in $ARGUMENTS.
|
||||
|
||||
**Document requirement:**
|
||||
Auto mode requires an idea document — either:
|
||||
|
||||
- File reference: `/gsd:new-project --auto @prd.md`
|
||||
- Pasted/written text in the prompt
|
||||
|
||||
@@ -37,6 +40,7 @@ Usage:
|
||||
|
||||
The document should describe what you want to build.
|
||||
```
|
||||
|
||||
</auto_mode>
|
||||
|
||||
<process>
|
||||
@@ -55,6 +59,7 @@ Parse JSON for: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `co
|
||||
**If `project_exists` is true:** Error — project already initialized. Use `/gsd:progress`.
|
||||
|
||||
**If `has_git` is false:** Initialize git:
|
||||
|
||||
```bash
|
||||
git init
|
||||
```
|
||||
@@ -66,6 +71,7 @@ git init
|
||||
**If `needs_codebase_map` is true** (from init — existing code detected but no codebase map):
|
||||
|
||||
Use AskUserQuestion:
|
||||
|
||||
- header: "Codebase"
|
||||
- question: "I detected existing code in this directory. Would you like to map the codebase first?"
|
||||
- options:
|
||||
@@ -73,9 +79,11 @@ Use AskUserQuestion:
|
||||
- "Skip mapping" — Proceed with project initialization
|
||||
|
||||
**If "Map codebase first":**
|
||||
|
||||
```
|
||||
Run `/gsd:map-codebase` first, then return to `/gsd:new-project`
|
||||
```
|
||||
|
||||
Exit command.
|
||||
|
||||
**If "Skip mapping" OR `needs_codebase_map` is false:** Continue to Step 3.
|
||||
@@ -166,23 +174,11 @@ AskUserQuestion([
|
||||
])
|
||||
```
|
||||
|
||||
Create `.planning/config.json` with mode set to "yolo":
|
||||
Create `.planning/config.json` with all settings (CLI fills in remaining defaults automatically):
|
||||
|
||||
```json
|
||||
{
|
||||
"mode": "yolo",
|
||||
"granularity": "[selected]",
|
||||
"parallelization": true|false,
|
||||
"commit_docs": true|false,
|
||||
"model_profile": "quality|balanced|budget|inherit",
|
||||
"workflow": {
|
||||
"research": true|false,
|
||||
"plan_check": true|false,
|
||||
"verifier": true|false,
|
||||
"nyquist_validation": depth !== "quick",
|
||||
"auto_advance": true
|
||||
}
|
||||
}
|
||||
```bash
|
||||
mkdir -p .planning
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-new-project '{"mode":"yolo","granularity":"[selected]","parallelization":true|false,"commit_docs":true|false,"model_profile":"quality|balanced|budget|inherit","workflow":{"research":true|false,"plan_check":true|false,"verifier":true|false,"nyquist_validation":true|false,"auto_advance":true}}'
|
||||
```
|
||||
|
||||
**If commit_docs = No:** Add `.planning/` to `.gitignore`.
|
||||
@@ -223,6 +219,7 @@ Ask inline (freeform, NOT AskUserQuestion):
|
||||
Wait for their response. This gives you the context needed to ask intelligent follow-up questions.
|
||||
|
||||
**Research-before-questions mode:** Check if `research_questions` is enabled in `.planning/config.json` (or the config from init context). When enabled, before asking follow-up questions about a topic area:
|
||||
|
||||
1. Do a brief web search for best practices related to what the user described
|
||||
2. Mention key findings naturally as you ask questions (e.g., "Most projects like this use X — is that what you're thinking, or something different?")
|
||||
3. This makes questions more informed without changing the conversational flow
|
||||
@@ -234,6 +231,7 @@ When disabled (default), ask questions directly as before.
|
||||
Based on what they said, ask follow-up questions that dig into their response. Use AskUserQuestion with options that probe what they mentioned — interpretations, clarifications, concrete examples.
|
||||
|
||||
Keep following threads. Each answer opens new threads to explore. Ask about:
|
||||
|
||||
- What excited them
|
||||
- What problem sparked this
|
||||
- What they mean by vague terms
|
||||
@@ -241,6 +239,7 @@ Keep following threads. Each answer opens new threads to explore. Ask about:
|
||||
- What's already decided
|
||||
|
||||
Consult `questioning.md` for techniques:
|
||||
|
||||
- Challenge vagueness
|
||||
- Make abstract concrete
|
||||
- Surface assumptions
|
||||
@@ -495,29 +494,22 @@ questions: [
|
||||
]
|
||||
```
|
||||
|
||||
Create `.planning/config.json` with all settings:
|
||||
Create `.planning/config.json` with all settings (CLI fills in remaining defaults automatically):
|
||||
|
||||
```json
|
||||
{
|
||||
"mode": "yolo|interactive",
|
||||
"granularity": "coarse|standard|fine",
|
||||
"parallelization": true|false,
|
||||
"commit_docs": true|false,
|
||||
"model_profile": "quality|balanced|budget|inherit",
|
||||
"workflow": {
|
||||
"research": true|false,
|
||||
"plan_check": true|false,
|
||||
"verifier": true|false,
|
||||
"nyquist_validation": depth !== "quick"
|
||||
}
|
||||
}
|
||||
```bash
|
||||
mkdir -p .planning
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-new-project '{"mode":"[yolo|interactive]","granularity":"[selected]","parallelization":true|false,"commit_docs":true|false,"model_profile":"quality|balanced|budget|inherit","workflow":{"research":true|false,"plan_check":true|false,"verifier":true|false,"nyquist_validation":[false if granularity=coarse, true otherwise]}}'
|
||||
```
|
||||
|
||||
**Note:** Run `/gsd:settings` anytime to update model profile, workflow agents, branching strategy, and other preferences.
|
||||
|
||||
**If commit_docs = No:**
|
||||
|
||||
- Set `commit_docs: false` in config.json
|
||||
- Add `.planning/` to `.gitignore` (create if needed)
|
||||
|
||||
**If commit_docs = Yes:**
|
||||
|
||||
- No additional gitignore entries needed
|
||||
|
||||
**Commit config.json:**
|
||||
@@ -526,7 +518,37 @@ Create `.planning/config.json` with all settings:
|
||||
node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "chore: add project config" --files .planning/config.json
|
||||
```
|
||||
|
||||
**Note:** Run `/gsd:settings` anytime to update these preferences.
|
||||
## 5.1. Sub-Repo Detection
|
||||
|
||||
**Detect multi-repo workspace:**
|
||||
|
||||
Check for directories with their own `.git` folders (separate repos within the workspace):
|
||||
|
||||
```bash
|
||||
find . -maxdepth 1 -type d -not -name ".*" -not -name "node_modules" -exec test -d "{}/.git" \; -print
|
||||
```
|
||||
|
||||
**If sub-repos found:**
|
||||
|
||||
Strip the `./` prefix to get directory names (e.g., `./backend` → `backend`).
|
||||
|
||||
Use AskUserQuestion:
|
||||
|
||||
- header: "Multi-Repo Workspace"
|
||||
- question: "I detected separate git repos in this workspace. Which directories contain code that GSD should commit to?"
|
||||
- multiSelect: true
|
||||
- options: one option per detected directory
|
||||
- "[directory name]" — Separate git repo
|
||||
|
||||
**If user selects one or more directories:**
|
||||
|
||||
- Set `planning.sub_repos` in config.json to the selected directory names array (e.g., `["backend", "frontend"]`)
|
||||
- Auto-set `planning.commit_docs` to `false` (planning docs stay local in multi-repo workspaces)
|
||||
- Add `.planning/` to `.gitignore` if not already present
|
||||
|
||||
Config changes are saved locally — no commit needed since `commit_docs` is `false` in multi-repo mode.
|
||||
|
||||
**If no sub-repos found or user selects none:** Continue with no changes to config.
|
||||
|
||||
## 5.5. Resolve Model Profile
|
||||
|
||||
@@ -537,6 +559,7 @@ Use models from init: `researcher_model`, `synthesizer_model`, `roadmapper_model
|
||||
**If auto mode:** Default to "Research first" without asking.
|
||||
|
||||
Use AskUserQuestion:
|
||||
|
||||
- header: "Research"
|
||||
- question: "Research the domain ecosystem before defining requirements?"
|
||||
- options:
|
||||
@@ -546,6 +569,7 @@ Use AskUserQuestion:
|
||||
**If "Research first":**
|
||||
|
||||
Display stage banner:
|
||||
|
||||
```
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
GSD ► RESEARCHING
|
||||
@@ -555,6 +579,7 @@ Researching [domain] ecosystem...
|
||||
```
|
||||
|
||||
Create research directory:
|
||||
|
||||
```bash
|
||||
mkdir -p .planning/research
|
||||
```
|
||||
@@ -562,10 +587,12 @@ mkdir -p .planning/research
|
||||
**Determine milestone context:**
|
||||
|
||||
Check if this is greenfield or subsequent milestone:
|
||||
|
||||
- If no "Validated" requirements in PROJECT.md → Greenfield (building from scratch)
|
||||
- If "Validated" requirements exist → Subsequent milestone (adding to existing app)
|
||||
|
||||
Display spawning indicator:
|
||||
|
||||
```
|
||||
◆ Spawning 4 researchers in parallel...
|
||||
→ Stack research
|
||||
@@ -754,6 +781,7 @@ Commit after writing.
|
||||
```
|
||||
|
||||
Display research complete banner and key findings:
|
||||
|
||||
```
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
GSD ► RESEARCH COMPLETE ✓
|
||||
@@ -773,6 +801,7 @@ Files: `.planning/research/`
|
||||
## 7. Define Requirements
|
||||
|
||||
Display stage banner:
|
||||
|
||||
```
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
GSD ► DEFINING REQUIREMENTS
|
||||
@@ -782,6 +811,7 @@ Display stage banner:
|
||||
**Load context:**
|
||||
|
||||
Read PROJECT.md and extract:
|
||||
|
||||
- Core value (the ONE thing that must work)
|
||||
- Stated constraints (budget, timeline, tech limitations)
|
||||
- Any explicit scope boundaries
|
||||
@@ -789,6 +819,7 @@ Read PROJECT.md and extract:
|
||||
**If research exists:** Read research/FEATURES.md and extract feature categories.
|
||||
|
||||
**If auto mode:**
|
||||
|
||||
- Auto-include all table stakes features (users expect these)
|
||||
- Include features explicitly mentioned in provided document
|
||||
- Auto-defer differentiators not mentioned in document
|
||||
@@ -827,6 +858,7 @@ Here are the features for [domain]:
|
||||
Ask: "What are the main things users need to be able to do?"
|
||||
|
||||
For each capability mentioned:
|
||||
|
||||
- Ask clarifying questions to make it specific
|
||||
- Probe for related capabilities
|
||||
- Group into categories
|
||||
@@ -845,6 +877,7 @@ For each category, use AskUserQuestion:
|
||||
- "None for v1" — Defer entire category
|
||||
|
||||
Track responses:
|
||||
|
||||
- Selected features → v1 requirements
|
||||
- Unselected table stakes → v2 (users expect these)
|
||||
- Unselected differentiators → out of scope
|
||||
@@ -852,6 +885,7 @@ Track responses:
|
||||
**Identify gaps:**
|
||||
|
||||
Use AskUserQuestion:
|
||||
|
||||
- header: "Additions"
|
||||
- question: "Any requirements research missed? (Features specific to your vision)"
|
||||
- options:
|
||||
@@ -865,6 +899,7 @@ Cross-check requirements against Core Value from PROJECT.md. If gaps detected, s
|
||||
**Generate REQUIREMENTS.md:**
|
||||
|
||||
Create `.planning/REQUIREMENTS.md` with:
|
||||
|
||||
- v1 Requirements grouped by category (checkboxes, REQ-IDs)
|
||||
- v2 Requirements (deferred)
|
||||
- Out of Scope (explicit exclusions with reasoning)
|
||||
@@ -875,12 +910,14 @@ Create `.planning/REQUIREMENTS.md` with:
|
||||
**Requirement quality criteria:**
|
||||
|
||||
Good requirements are:
|
||||
|
||||
- **Specific and testable:** "User can reset password via email link" (not "Handle password reset")
|
||||
- **User-centric:** "User can X" (not "System does Y")
|
||||
- **Atomic:** One capability per requirement (not "User can login and manage profile")
|
||||
- **Independent:** Minimal dependencies on other requirements
|
||||
|
||||
Reject vague requirements. Push for specificity:
|
||||
|
||||
- "Handle authentication" → "User can log in with email/password and stay logged in across sessions"
|
||||
- "Support sharing" → "User can share post via link that opens in recipient's browser"
|
||||
|
||||
@@ -918,6 +955,7 @@ node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" commit "docs: define v1 req
|
||||
## 8. Create Roadmap
|
||||
|
||||
Display stage banner:
|
||||
|
||||
```
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
GSD ► CREATING ROADMAP
|
||||
@@ -958,6 +996,7 @@ Write files first, then return. This ensures artifacts persist even if context i
|
||||
**Handle roadmapper return:**
|
||||
|
||||
**If `## ROADMAP BLOCKED`:**
|
||||
|
||||
- Present blocker information
|
||||
- Work with user to resolve
|
||||
- Re-spawn when resolved
|
||||
@@ -1007,6 +1046,7 @@ Success criteria:
|
||||
**CRITICAL: Ask for approval before committing (interactive mode only):**
|
||||
|
||||
Use AskUserQuestion:
|
||||
|
||||
- header: "Roadmap"
|
||||
- question: "Does this roadmap structure work for you?"
|
||||
- options:
|
||||
@@ -1017,8 +1057,10 @@ Use AskUserQuestion:
|
||||
**If "Approve":** Continue to commit.
|
||||
|
||||
**If "Adjust phases":**
|
||||
|
||||
- Get user's adjustment notes
|
||||
- Re-spawn roadmapper with revision context:
|
||||
|
||||
```
|
||||
Task(prompt="
|
||||
<revision>
|
||||
@@ -1034,6 +1076,7 @@ Use AskUserQuestion:
|
||||
</revision>
|
||||
", subagent_type="gsd-roadmapper", model="{roadmapper_model}", description="Revise roadmap")
|
||||
```
|
||||
|
||||
- Present revised roadmap
|
||||
- Loop until user approves
|
||||
|
||||
|
||||
237
get-shit-done/workflows/new-workspace.md
Normal file
237
get-shit-done/workflows/new-workspace.md
Normal file
@@ -0,0 +1,237 @@
|
||||
<purpose>
|
||||
Create an isolated workspace directory with git repo copies (worktrees or clones) and an independent `.planning/` directory. Supports multi-repo orchestration and single-repo feature branch isolation.
|
||||
</purpose>
|
||||
|
||||
<required_reading>
|
||||
Read all files referenced by the invoking prompt's execution_context before starting.
|
||||
</required_reading>
|
||||
|
||||
<process>
|
||||
|
||||
## 1. Setup
|
||||
|
||||
**MANDATORY FIRST STEP — Execute init command:**
|
||||
|
||||
```bash
|
||||
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init new-workspace)
|
||||
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
||||
```
|
||||
|
||||
Parse JSON for: `default_workspace_base`, `child_repos`, `child_repo_count`, `worktree_available`, `is_git_repo`, `cwd_repo_name`, `project_root`.
|
||||
|
||||
## 2. Parse Arguments
|
||||
|
||||
Extract from $ARGUMENTS:
|
||||
- `--name` → `WORKSPACE_NAME` (required)
|
||||
- `--repos` → `REPO_LIST` (comma-separated paths or names)
|
||||
- `--path` → `TARGET_PATH` (defaults to `$default_workspace_base/$WORKSPACE_NAME`)
|
||||
- `--strategy` → `STRATEGY` (defaults to `worktree`)
|
||||
- `--branch` → `BRANCH_NAME` (defaults to `workspace/$WORKSPACE_NAME`)
|
||||
- `--auto` → skip interactive questions
|
||||
|
||||
**If `--name` is missing and not `--auto`:**
|
||||
|
||||
Use AskUserQuestion:
|
||||
- header: "Workspace Name"
|
||||
- question: "What should this workspace be called?"
|
||||
- requireAnswer: true
|
||||
|
||||
## 3. Select Repos
|
||||
|
||||
**If `--repos` is provided:** Parse comma-separated values. For each value:
|
||||
- If it's an absolute path, use it directly
|
||||
- If it's a relative path or name, resolve against `$project_root`
|
||||
- Special case: `.` means current repo (use `$project_root`, name it `$cwd_repo_name`)
|
||||
|
||||
**If `--repos` is NOT provided and not `--auto`:**
|
||||
|
||||
**If `child_repo_count` > 0:**
|
||||
|
||||
Present child repos for selection:
|
||||
|
||||
Use AskUserQuestion:
|
||||
- header: "Select Repos"
|
||||
- question: "Which repos should be included in the workspace?"
|
||||
- options: List each child repo from `child_repos` array by name
|
||||
- multiSelect: true
|
||||
|
||||
**If `child_repo_count` is 0 and `is_git_repo` is true:**
|
||||
|
||||
Use AskUserQuestion:
|
||||
- header: "Current Repo"
|
||||
- question: "No child repos found. Create a workspace with the current repo?"
|
||||
- options:
|
||||
- "Yes — create workspace with current repo" → use current repo
|
||||
- "Cancel" → exit
|
||||
|
||||
**If `child_repo_count` is 0 and `is_git_repo` is false:**
|
||||
|
||||
Error:
|
||||
```
|
||||
No git repos found in the current directory and this is not a git repo.
|
||||
|
||||
Run this command from a directory containing git repos, or specify repos explicitly:
|
||||
/gsd:new-workspace --name my-workspace --repos /path/to/repo1,/path/to/repo2
|
||||
```
|
||||
Exit.
|
||||
|
||||
**If `--auto` and `--repos` is NOT provided:**
|
||||
|
||||
Error:
|
||||
```
|
||||
Error: --auto requires --repos to specify which repos to include.
|
||||
|
||||
Usage:
|
||||
/gsd:new-workspace --name my-workspace --repos repo1,repo2 --auto
|
||||
```
|
||||
Exit.
|
||||
|
||||
## 4. Select Strategy
|
||||
|
||||
**If `--strategy` is provided:** Use it (validate: must be `worktree` or `clone`).
|
||||
|
||||
**If `--strategy` is NOT provided and not `--auto`:**
|
||||
|
||||
Use AskUserQuestion:
|
||||
- header: "Strategy"
|
||||
- question: "How should repos be copied into the workspace?"
|
||||
- options:
|
||||
- "Worktree (recommended) — lightweight, shares .git objects with source repo" → `worktree`
|
||||
- "Clone — fully independent copy, no connection to source repo" → `clone`
|
||||
|
||||
**If `--auto`:** Default to `worktree`.
|
||||
|
||||
## 5. Validate
|
||||
|
||||
Before creating anything, validate:
|
||||
|
||||
1. **Target path** — must not exist or must be empty:
|
||||
```bash
|
||||
if [ -d "$TARGET_PATH" ] && [ "$(ls -A "$TARGET_PATH" 2>/dev/null)" ]; then
|
||||
echo "Error: Target path already exists and is not empty: $TARGET_PATH"
|
||||
echo "Choose a different --name or --path."
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
2. **Source repos exist and are git repos** — for each repo path:
|
||||
```bash
|
||||
if [ ! -d "$REPO_PATH/.git" ]; then
|
||||
echo "Error: Not a git repo: $REPO_PATH"
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
3. **Worktree availability** — if strategy is `worktree` and `worktree_available` is false:
|
||||
```
|
||||
Error: git is not available. Install git or use --strategy clone.
|
||||
```
|
||||
|
||||
Report all validation errors at once, not one at a time.
|
||||
|
||||
## 6. Create Workspace
|
||||
|
||||
```bash
|
||||
mkdir -p "$TARGET_PATH"
|
||||
```
|
||||
|
||||
### For each repo:
|
||||
|
||||
**Worktree strategy:**
|
||||
```bash
|
||||
cd "$SOURCE_REPO_PATH"
|
||||
git worktree add "$TARGET_PATH/$REPO_NAME" -b "$BRANCH_NAME" 2>&1
|
||||
```
|
||||
|
||||
If `git worktree add` fails because the branch already exists, try with a timestamped branch:
|
||||
```bash
|
||||
TIMESTAMP=$(date +%Y%m%d%H%M%S)
|
||||
git worktree add "$TARGET_PATH/$REPO_NAME" -b "${BRANCH_NAME}-${TIMESTAMP}" 2>&1
|
||||
```
|
||||
|
||||
If that also fails, report the error and continue with remaining repos.
|
||||
|
||||
**Clone strategy:**
|
||||
```bash
|
||||
git clone "$SOURCE_REPO_PATH" "$TARGET_PATH/$REPO_NAME" 2>&1
|
||||
cd "$TARGET_PATH/$REPO_NAME"
|
||||
git checkout -b "$BRANCH_NAME" 2>&1
|
||||
```
|
||||
|
||||
Track results: which repos succeeded, which failed, what branch was used.
|
||||
|
||||
## 7. Write WORKSPACE.md
|
||||
|
||||
Write the workspace manifest at `$TARGET_PATH/WORKSPACE.md`:
|
||||
|
||||
```markdown
|
||||
# Workspace: $WORKSPACE_NAME
|
||||
|
||||
Created: $DATE
|
||||
Strategy: $STRATEGY
|
||||
|
||||
## Member Repos
|
||||
|
||||
| Repo | Source | Branch | Strategy |
|
||||
|------|--------|--------|----------|
|
||||
| $REPO_NAME | $SOURCE_PATH | $BRANCH | $STRATEGY |
|
||||
...for each repo...
|
||||
|
||||
## Notes
|
||||
|
||||
[Add context about what this workspace is for]
|
||||
```
|
||||
|
||||
## 8. Initialize .planning/
|
||||
|
||||
```bash
|
||||
mkdir -p "$TARGET_PATH/.planning"
|
||||
```
|
||||
|
||||
## 9. Report and Next Steps
|
||||
|
||||
**If all repos succeeded:**
|
||||
|
||||
```
|
||||
Workspace created: $TARGET_PATH
|
||||
|
||||
Repos: $REPO_COUNT
|
||||
Strategy: $STRATEGY
|
||||
Branch: $BRANCH_NAME
|
||||
|
||||
Next steps:
|
||||
cd $TARGET_PATH
|
||||
/gsd:new-project # Initialize GSD in the workspace
|
||||
```
|
||||
|
||||
**If some repos failed:**
|
||||
|
||||
```
|
||||
Workspace created with $SUCCESS_COUNT of $TOTAL_COUNT repos: $TARGET_PATH
|
||||
|
||||
Succeeded: repo1, repo2
|
||||
Failed: repo3 (branch already exists), repo4 (not a git repo)
|
||||
|
||||
Next steps:
|
||||
cd $TARGET_PATH
|
||||
/gsd:new-project # Initialize GSD in the workspace
|
||||
```
|
||||
|
||||
**Offer to initialize GSD (if not `--auto`):**
|
||||
|
||||
Use AskUserQuestion:
|
||||
- header: "Initialize GSD"
|
||||
- question: "Would you like to initialize a GSD project in the new workspace?"
|
||||
- options:
|
||||
- "Yes — run /gsd:new-project" → tell user to `cd $TARGET_PATH` first, then run `/gsd:new-project`
|
||||
- "No — I'll set it up later" → done
|
||||
|
||||
</process>
|
||||
|
||||
<success_criteria>
|
||||
- [ ] Workspace directory created at target path
|
||||
- [ ] All specified repos copied (worktree or clone) into workspace
|
||||
- [ ] WORKSPACE.md manifest written with correct repo table
|
||||
- [ ] `.planning/` directory initialized at workspace root
|
||||
- [ ] User informed of workspace path and next steps
|
||||
</success_criteria>
|
||||
@@ -26,15 +26,15 @@ INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init plan-phase "$PH
|
||||
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
||||
```
|
||||
|
||||
Parse JSON for: `researcher_model`, `planner_model`, `checker_model`, `research_enabled`, `plan_checker_enabled`, `nyquist_validation_enabled`, `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `plan_count`, `planning_exists`, `roadmap_exists`, `phase_req_ids`.
|
||||
Parse JSON for: `researcher_model`, `planner_model`, `checker_model`, `research_enabled`, `plan_checker_enabled`, `nyquist_validation_enabled`, `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_reviews`, `has_plans`, `plan_count`, `planning_exists`, `roadmap_exists`, `phase_req_ids`.
|
||||
|
||||
**File paths (for <files_to_read> blocks):** `state_path`, `roadmap_path`, `requirements_path`, `context_path`, `research_path`, `verification_path`, `uat_path`. These are null if files don't exist.
|
||||
**File paths (for <files_to_read> blocks):** `state_path`, `roadmap_path`, `requirements_path`, `context_path`, `research_path`, `verification_path`, `uat_path`, `reviews_path`. These are null if files don't exist.
|
||||
|
||||
**If `planning_exists` is false:** Error — run `/gsd:new-project` first.
|
||||
|
||||
## 2. Parse and Normalize Arguments
|
||||
|
||||
Extract from $ARGUMENTS: phase number (integer or decimal like `2.1`), flags (`--research`, `--skip-research`, `--gaps`, `--skip-verify`, `--prd <filepath>`).
|
||||
Extract from $ARGUMENTS: phase number (integer or decimal like `2.1`), flags (`--research`, `--skip-research`, `--gaps`, `--skip-verify`, `--prd <filepath>`, `--reviews`).
|
||||
|
||||
Extract `--prd <filepath>` from $ARGUMENTS. If present, set PRD_FILE to the filepath.
|
||||
|
||||
@@ -47,6 +47,24 @@ mkdir -p ".planning/phases/${padded_phase}-${phase_slug}"
|
||||
|
||||
**Existing artifacts from init:** `has_research`, `has_plans`, `plan_count`.
|
||||
|
||||
## 2.5. Validate `--reviews` Prerequisite
|
||||
|
||||
**Skip if:** No `--reviews` flag.
|
||||
|
||||
**If `--reviews` AND `--gaps`:** Error — cannot combine `--reviews` with `--gaps`. These are conflicting modes.
|
||||
|
||||
**If `--reviews` AND `has_reviews` is false (no REVIEWS.md in phase dir):**
|
||||
|
||||
Error:
|
||||
```
|
||||
No REVIEWS.md found for Phase {N}. Run reviews first:
|
||||
|
||||
/gsd:review --phase {N}
|
||||
|
||||
Then re-run /gsd:plan-phase {N} --reviews
|
||||
```
|
||||
Exit workflow.
|
||||
|
||||
## 3. Validate Phase
|
||||
|
||||
```bash
|
||||
@@ -169,11 +187,19 @@ If `context_path` is not null, display: `Using phase context from: ${context_pat
|
||||
|
||||
**If `context_path` is null (no CONTEXT.md exists):**
|
||||
|
||||
Read discuss mode for context gate label:
|
||||
```bash
|
||||
DISCUSS_MODE=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get workflow.discuss_mode 2>/dev/null || echo "discuss")
|
||||
```
|
||||
|
||||
Use AskUserQuestion:
|
||||
- header: "No context"
|
||||
- question: "No CONTEXT.md found for Phase {X}. Plans will use research and requirements only — your design preferences won't be included. Continue or capture context first?"
|
||||
- options:
|
||||
- "Continue without context" — Plan using research + requirements only
|
||||
If `DISCUSS_MODE` is `"assumptions"`:
|
||||
- "Gather context (assumptions mode)" — Analyze codebase and surface assumptions before planning
|
||||
If `DISCUSS_MODE` is `"discuss"` (or unset):
|
||||
- "Run discuss-phase first" — Capture design decisions before planning
|
||||
|
||||
If "Continue without context": Proceed to step 5.
|
||||
@@ -190,7 +216,7 @@ If "Run discuss-phase first":
|
||||
|
||||
## 5. Handle Research
|
||||
|
||||
**Skip if:** `--gaps` flag or `--skip-research` flag.
|
||||
**Skip if:** `--gaps` flag or `--skip-research` flag or `--reviews` flag.
|
||||
|
||||
**If `has_research` is true (from init) AND no `--research` flag:** Use existing, skip to step 6.
|
||||
|
||||
@@ -349,7 +375,9 @@ Use AskUserQuestion:
|
||||
ls "${PHASE_DIR}"/*-PLAN.md 2>/dev/null
|
||||
```
|
||||
|
||||
**If exists:** Offer: 1) Add more plans, 2) View existing, 3) Replan from scratch.
|
||||
**If exists AND `--reviews` flag:** Skip prompt — go straight to replanning (the purpose of `--reviews` is to replan with review feedback).
|
||||
|
||||
**If exists AND no `--reviews` flag:** Offer: 1) Add more plans, 2) View existing, 3) Replan from scratch.
|
||||
|
||||
## 7. Use Context Paths from INIT
|
||||
|
||||
@@ -363,6 +391,7 @@ RESEARCH_PATH=$(printf '%s\n' "$INIT" | jq -r '.research_path // empty')
|
||||
VERIFICATION_PATH=$(printf '%s\n' "$INIT" | jq -r '.verification_path // empty')
|
||||
UAT_PATH=$(printf '%s\n' "$INIT" | jq -r '.uat_path // empty')
|
||||
CONTEXT_PATH=$(printf '%s\n' "$INIT" | jq -r '.context_path // empty')
|
||||
REVIEWS_PATH=$(printf '%s\n' "$INIT" | jq -r '.reviews_path // empty')
|
||||
```
|
||||
|
||||
## 7.5. Verify Nyquist Artifacts
|
||||
@@ -404,7 +433,7 @@ Planner prompt:
|
||||
```markdown
|
||||
<planning_context>
|
||||
**Phase:** {phase_number}
|
||||
**Mode:** {standard | gap_closure}
|
||||
**Mode:** {standard | gap_closure | reviews}
|
||||
|
||||
<files_to_read>
|
||||
- {state_path} (Project State)
|
||||
@@ -414,6 +443,7 @@ Planner prompt:
|
||||
- {research_path} (Technical Research)
|
||||
- {verification_path} (Verification Gaps - if --gaps)
|
||||
- {uat_path} (UAT Gaps - if --gaps)
|
||||
- {reviews_path} (Cross-AI Review Feedback - if --reviews)
|
||||
- {UI_SPEC_PATH} (UI Design Contract — visual/interaction specs, if exists)
|
||||
</files_to_read>
|
||||
|
||||
@@ -733,6 +763,8 @@ Verification: {Passed | Passed with override | Skipped}
|
||||
**Also available:**
|
||||
- cat .planning/phases/{phase-dir}/*-PLAN.md — review plans
|
||||
- /gsd:plan-phase {X} --research — re-research first
|
||||
- /gsd:review --phase {X} --all — peer review plans with external AIs
|
||||
- /gsd:plan-phase {X} --reviews — replan incorporating review feedback
|
||||
|
||||
───────────────────────────────────────────────────────────────
|
||||
</offer_next>
|
||||
|
||||
@@ -18,6 +18,10 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
||||
|
||||
Extract from init JSON: `project_exists`, `roadmap_exists`, `state_exists`, `phases`, `current_phase`, `next_phase`, `milestone_version`, `completed_count`, `phase_count`, `paused_at`, `state_path`, `roadmap_path`, `project_path`, `config_path`.
|
||||
|
||||
```bash
|
||||
DISCUSS_MODE=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get workflow.discuss_mode 2>/dev/null || echo "discuss")
|
||||
```
|
||||
|
||||
If `project_exists` is false (no `.planning/` directory):
|
||||
|
||||
```
|
||||
@@ -99,6 +103,7 @@ Present:
|
||||
|
||||
**Progress:** {PROGRESS_BAR}
|
||||
**Profile:** [quality/balanced/budget/inherit]
|
||||
**Discuss mode:** {DISCUSS_MODE}
|
||||
|
||||
## Recent Work
|
||||
- [Phase X, Plan Y]: [what was accomplished - 1 line from summary-extract]
|
||||
|
||||
90
get-shit-done/workflows/remove-workspace.md
Normal file
90
get-shit-done/workflows/remove-workspace.md
Normal file
@@ -0,0 +1,90 @@
|
||||
<purpose>
|
||||
Remove a GSD workspace, cleaning up git worktrees and deleting the workspace directory.
|
||||
</purpose>
|
||||
|
||||
<required_reading>
|
||||
Read all files referenced by the invoking prompt's execution_context before starting.
|
||||
</required_reading>
|
||||
|
||||
<process>
|
||||
|
||||
## 1. Setup
|
||||
|
||||
Extract workspace name from $ARGUMENTS.
|
||||
|
||||
```bash
|
||||
INIT=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" init remove-workspace "$WORKSPACE_NAME")
|
||||
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
||||
```
|
||||
|
||||
Parse JSON for: `workspace_name`, `workspace_path`, `has_manifest`, `strategy`, `repos`, `repo_count`, `dirty_repos`, `has_dirty_repos`.
|
||||
|
||||
**If no workspace name provided:**
|
||||
|
||||
First run `/gsd:list-workspaces` to show available workspaces, then ask:
|
||||
|
||||
Use AskUserQuestion:
|
||||
- header: "Remove Workspace"
|
||||
- question: "Which workspace do you want to remove?"
|
||||
- requireAnswer: true
|
||||
|
||||
Re-run init with the provided name.
|
||||
|
||||
## 2. Safety Checks
|
||||
|
||||
**If `has_dirty_repos` is true:**
|
||||
|
||||
```
|
||||
Cannot remove workspace "$WORKSPACE_NAME" — the following repos have uncommitted changes:
|
||||
|
||||
- repo1
|
||||
- repo2
|
||||
|
||||
Commit or stash changes in these repos before removing the workspace:
|
||||
cd $WORKSPACE_PATH/repo1
|
||||
git stash # or git commit
|
||||
```
|
||||
|
||||
Exit. Do NOT proceed.
|
||||
|
||||
## 3. Confirm Removal
|
||||
|
||||
Use AskUserQuestion:
|
||||
- header: "Confirm Removal"
|
||||
- question: "Remove workspace '$WORKSPACE_NAME' at $WORKSPACE_PATH? This will delete all files in the workspace directory. Type the workspace name to confirm:"
|
||||
- requireAnswer: true
|
||||
|
||||
**If answer does not match `$WORKSPACE_NAME`:** Exit with "Removal cancelled."
|
||||
|
||||
## 4. Clean Up Worktrees
|
||||
|
||||
**If strategy is `worktree`:**
|
||||
|
||||
For each repo in the workspace:
|
||||
|
||||
```bash
|
||||
cd "$SOURCE_REPO_PATH"
|
||||
git worktree remove "$WORKSPACE_PATH/$REPO_NAME" 2>&1 || true
|
||||
```
|
||||
|
||||
If `git worktree remove` fails, warn but continue:
|
||||
```
|
||||
Warning: Could not remove worktree for $REPO_NAME — source repo may have been moved or deleted.
|
||||
```
|
||||
|
||||
## 5. Delete Workspace Directory
|
||||
|
||||
```bash
|
||||
rm -rf "$WORKSPACE_PATH"
|
||||
```
|
||||
|
||||
## 6. Report
|
||||
|
||||
```
|
||||
Workspace "$WORKSPACE_NAME" removed.
|
||||
|
||||
Path: $WORKSPACE_PATH (deleted)
|
||||
Repos: $REPO_COUNT worktrees cleaned up
|
||||
```
|
||||
|
||||
</process>
|
||||
@@ -12,7 +12,7 @@ Read all files referenced by the invoking prompt's execution_context before star
|
||||
Gather project statistics:
|
||||
|
||||
```bash
|
||||
STATS=$(node "$GSD_TOOLS" stats json)
|
||||
STATS=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" stats json)
|
||||
if [[ "$STATS" == @file:* ]]; then STATS=$(cat "${STATS#@file:}"); fi
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user