feat(03-01): brownfield integration into GSD workflows

- new-project.md detects existing code, offers /gsd:map-codebase first
- plan-phase loads relevant codebase context based on phase type
- execute-phase updates codebase map incrementally after execution

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2025-12-17 10:37:57 -06:00
parent 8a0dcd668e
commit 8d2f307451
4 changed files with 133 additions and 1 deletions

View File

@@ -1148,6 +1148,52 @@ EOF
For commit message conventions and git workflow patterns, see ~/.claude/get-shit-done/references/git-integration.md
</step>
<step name="update_codebase_map">
**If .planning/codebase/ exists AND files were modified:**
Check if execution modified significant code:
```bash
# Get list of code files modified in this plan
MODIFIED_CODE=$(git diff --name-only HEAD~1 2>/dev/null | grep -E '\.(ts|js|py|go|rs|swift|java)$' | grep -v node_modules)
```
**If significant modifications (>3 code files changed):**
Determine which codebase documents may need update based on what changed:
| Changed Files | Documents to Update |
|--------------|-------------------|
| New directories created | STRUCTURE.md |
| Package dependencies changed | STACK.md, INTEGRATIONS.md |
| New patterns introduced | ARCHITECTURE.md, CONVENTIONS.md |
| Test files added/changed | TESTING.md |
| Config files changed | STACK.md |
| External service integration | INTEGRATIONS.md |
**Update strategy (incremental, not full remap):**
For each document needing update:
1. Read current document
2. Identify what changed (new entries, removed entries, modified sections)
3. Apply minimal edits to reflect new state
4. Keep document under 100 lines (summarize if needed)
**Commit codebase updates:**
```bash
git add .planning/codebase/*.md
git commit --amend --no-edit # Include in plan commit
```
**If no significant changes:**
Skip codebase update - map is still current.
**If .planning/codebase/ doesn't exist:**
Skip this step - no codebase map to update.
**Note:** Full remap via `/gsd:map-codebase` is available if incremental updates become stale.
</step>
<step name="check_phase_issues">
**Check if issues were created during this phase:**
@@ -1330,4 +1376,5 @@ All [Y] plans finished.
- SUMMARY.md created with substantive content
- STATE.md updated (position, decisions, issues, session)
- ROADMAP.md updated
- If codebase map exists: map updated with execution changes (or skipped if no significant changes)
</success_criteria>