fix: warn when planning without user context or discussing after plans exist

Closes #253 — plans were silently created without CONTEXT.md, and
discuss-phase didn't warn when plans already existed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2026-02-15 17:11:02 -06:00
parent b27034b7ee
commit fc347d5cf9
2 changed files with 29 additions and 1 deletions

View File

@@ -147,7 +147,23 @@ If "Update": Load existing, continue to analyze_phase
If "View": Display CONTEXT.md, then offer update/skip
If "Skip": Exit workflow
**If doesn't exist:** Continue to analyze_phase.
**If doesn't exist:**
Check `has_plans` and `plan_count` from init. **If `has_plans` is true:**
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" — Capture context, then run /gsd:plan-phase {X} to replan
- "View existing plans" — Show plans before deciding
- "Cancel" — Skip discuss-phase
If "Continue and replan after": Continue to analyze_phase.
If "View existing plans": Display plan files, then offer "Continue" / "Cancel".
If "Cancel": Exit workflow.
**If `has_plans` is false:** Continue to analyze_phase.
</step>
<step name="analyze_phase">

View File

@@ -61,6 +61,18 @@ Use `context_content` from init JSON (already loaded via `--include context`).
If `context_content` is not null, display: `Using phase context from: ${PHASE_DIR}/*-CONTEXT.md`
**If `context_content` is null (no CONTEXT.md exists):**
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
- "Run discuss-phase first" — Capture design decisions before planning
If "Continue without context": Proceed to step 5.
If "Run discuss-phase first": Display `/gsd:discuss-phase {X}` and exit workflow.
## 5. Handle Research
**Skip if:** `--gaps` flag, `--skip-research` flag, or `research_enabled` is false (from init) without `--research` override.