feat: add uncommitted planning mode (#107)

* feat: add uncommitted planning mode

Add config option to keep planning docs local-only (not committed to git).
Useful for OSS contributions, client projects, or keeping planning private.

Config options in .planning/config.json:
- planning.commit_docs: true/false (default: true)
- planning.search_gitignored: true/false (default: false)

When commit_docs=false:
- All git operations for .planning/ files are skipped
- User should add .planning/ to .gitignore
- Planning system works normally, just not tracked

Updated files:
- config.json template: added planning section
- execute-plan.md: conditional git commits
- execute-phase.md: conditional git commits
- create-roadmap.md: conditional git commits
- help.md: documented new config options
- planning-config.md: reference doc for config behavior

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: extend commit_docs check to all agents/commands/workflows

Add COMMIT_PLANNING_DOCS config check to all files that commit
.planning/ artifacts, ensuring consistent behavior when
commit_docs=false is set in config.json.

Updated:
- 5 agents (planner, executor, debugger, phase-researcher, synthesizer)
- 8 commands (add-todo, check-todos, execute-phase, new-milestone,
  pause-work, plan-milestone-gaps, remove-phase, research-project)
- 7 workflows (complete-milestone, create-milestone, define-requirements,
  diagnose-issues, discuss-phase, map-codebase, verify-work)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(progress): use Bash instead of Glob for .planning/ check

Glob respects .gitignore, so projects with gitignored .planning/
directories would fail with "No planning structure found."

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(new-milestone): integrate full research/requirements/roadmap flow

Previously routed to non-existent /gsd:research-project and
/gsd:define-requirements commands. Now handles the full flow inline
like new-project does:

- Phase 7: Research Decision (spawns 4 milestone-aware researchers)
- Phase 8: Define Requirements (scopes features, creates REQUIREMENTS.md)
- Phase 9: Create Roadmap (continues phase numbering from previous milestone)
- Phase 10: Done

Key adaptations for milestones:
- Research focuses on NEW features only
- Requirements add to existing, don't start fresh
- Phase numbering continues from previous milestone

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
dan bachelder
2026-01-19 14:49:05 -08:00
committed by GitHub
parent f8096792cc
commit 1f18ec8907
23 changed files with 608 additions and 264 deletions

View File

@@ -979,7 +979,16 @@ mkdir -p .planning/debug/resolved
mv .planning/debug/{slug}.md .planning/debug/resolved/
```
Commit:
**Check planning config:**
```bash
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
```
**Commit the fix:**
If `COMMIT_PLANNING_DOCS=true` (default):
```bash
git add -A
git commit -m "fix: {brief description}
@@ -988,6 +997,16 @@ Root cause: {root_cause}
Debug session: .planning/debug/resolved/{slug}.md"
```
If `COMMIT_PLANNING_DOCS=false`:
```bash
# Only commit code changes, exclude .planning/
git add -A
git reset .planning/
git commit -m "fix: {brief description}
Root cause: {root_cause}"
```
Report completion and offer next steps.
</step>

View File

@@ -39,6 +39,17 @@ Options:
```
**If .planning/ doesn't exist:** Error - project not initialized.
**Load planning config:**
```bash
# Check if planning docs should be committed (default: true)
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
# Auto-detect gitignored (overrides config)
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
```
Store `COMMIT_PLANNING_DOCS` for use in git operations.
</step>
<step name="load_plan">
@@ -692,6 +703,10 @@ Resume file: [path to .continue-here if exists, else "None"]
<final_commit>
After SUMMARY.md and STATE.md updates:
**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations for planning files, log "Skipping planning docs commit (commit_docs: false)"
**If `COMMIT_PLANNING_DOCS=true` (default):**
**1. Stage execution artifacts:**
```bash

View File

@@ -450,6 +450,11 @@ PHASE_DIR=$(ls -d .planning/phases/${PADDED_PHASE}-* .planning/phases/${PHASE}-*
# Read CONTEXT.md if exists (from /gsd:discuss-phase)
cat "${PHASE_DIR}"/*-CONTEXT.md 2>/dev/null
# Check if planning docs should be committed (default: true)
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
# Auto-detect gitignored (overrides config)
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
```
**If CONTEXT.md exists**, it contains user decisions that MUST constrain your research:
@@ -526,6 +531,10 @@ Where `PHASE_DIR` is the full path (e.g., `.planning/phases/01-foundation`)
## Step 6: Commit Research
**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations, log "Skipping planning docs commit (commit_docs: false)"
**If `COMMIT_PLANNING_DOCS=true` (default):**
```bash
git add "${PHASE_DIR}/${PADDED_PHASE}-RESEARCH.md"
git commit -m "docs(${PHASE}): research phase domain

View File

@@ -953,6 +953,10 @@ After making edits, self-check:
### Step 6: Commit Revised Plans
**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations, log "Skipping planning docs commit (commit_docs: false)"
**If `COMMIT_PLANNING_DOCS=true` (default):**
```bash
git add .planning/phases/${PHASE}-*/${PHASE}-*-PLAN.md
git commit -m "fix(${PHASE}): revise plans based on checker feedback"
@@ -998,6 +1002,17 @@ Read `.planning/STATE.md` and parse:
- Blockers/concerns (things this phase may address)
If STATE.md missing but .planning/ exists, offer to reconstruct or continue without.
**Load planning config:**
```bash
# Check if planning docs should be committed (default: true)
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
# Auto-detect gitignored (overrides config)
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
```
Store `COMMIT_PLANNING_DOCS` for use in git operations.
</step>
<step name="load_codebase_context">
@@ -1209,6 +1224,10 @@ Update ROADMAP.md to finalize phase placeholders created by add-phase or insert-
<step name="git_commit">
Commit phase plan(s) and updated roadmap:
**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations, log "Skipping planning docs commit (commit_docs: false)"
**If `COMMIT_PLANNING_DOCS=true` (default):**
```bash
git add .planning/phases/${PHASE}-*/${PHASE}-*-PLAN.md .planning/ROADMAP.md
git commit -m "docs(${PHASE}): create phase plan

View File

@@ -48,6 +48,11 @@ cat .planning/research/STACK.md
cat .planning/research/FEATURES.md
cat .planning/research/ARCHITECTURE.md
cat .planning/research/PITFALLS.md
# Check if planning docs should be committed (default: true)
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
# Auto-detect gitignored (overrides config)
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
```
Parse each file to extract:
@@ -125,6 +130,10 @@ Write to `.planning/research/SUMMARY.md`
The 4 parallel researcher agents write files but do NOT commit. You commit everything together.
**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations, log "Skipping planning docs commit (commit_docs: false)"
**If `COMMIT_PLANNING_DOCS=true` (default):**
```bash
git add .planning/research/
git commit -m "docs: complete project research