chore: tidy up old files

This commit is contained in:
Lex Christopherson
2026-02-07 11:39:21 -06:00
parent a63cc2dec9
commit 56b487a5b0
13 changed files with 1329 additions and 661 deletions

View File

@@ -1,14 +0,0 @@
{
"model_profile": "balanced",
"commit_docs": true,
"search_gitignored": false,
"branching_strategy": "none",
"phase_branch_template": "gsd/phase-{phase}-{slug}",
"milestone_branch_template": "gsd/{milestone}-{slug}",
"workflow": {
"research": true,
"plan_check": true,
"verifier": true
},
"parallelization": true
}

View File

@@ -1,34 +0,0 @@
# 001: Map dependencies for @commands/gsd/new-project.md
## Objective
List **all** files that are loaded/referenced when running the command `@commands/gsd/new-project.md` in this repo. The output must be exhaustive and user-facing.
## Context
Repo: `claude-code-resources/get-shit-done`.
We need a dependency map for the `@commands/gsd/new-project.md` command. This includes any files it directly references and any files referenced transitively by workflows/templates it invokes. The final list should be presented in the SUMMARY.
Constraints:
- Do not guess. Trace actual references.
- Include paths for every file referenced/loaded.
- If a file is included conditionally, still list it and note the condition.
- If the command invokes a workflow that in turn references templates or other files, include those as well.
## Process
1. Open `commands/gsd/new-project.md` and identify explicit references (workflows, templates, other commands, include directives).
- Validation: list all direct references with file paths.
2. Follow each referenced file and enumerate any additional files it loads/references (e.g., workflows → templates → references).
- Validation: for each file, list its outbound references.
3. Produce a complete, de-duplicated list of all files involved in the execution path.
- Validation: no referenced file omitted; no paths outside repo unless explicitly referenced.
4. Write `001-SUMMARY.md` with the full list and a short explanation of how you derived it.
## Verification
- Re-open each referenced file to ensure no dependencies missed.
## Success Criteria
- [ ] SUMMARY includes a complete list of every file loaded/referenced by `@commands/gsd/new-project.md`.
- [ ] Conditional references are noted.
- [ ] No guesses; each item is traceable to a reference in files.

View File

@@ -1,268 +0,0 @@
# Bug Report - Get Shit Done Codebase Review
**Date:** 2026-01-31
**Reviewer:** Claude Code Agent
**Scope:** Full codebase review for bugs, logic errors, and edge cases
---
## Critical Bugs (High Priority)
### 1. Missing error handling in statusline.js for file system operations
**File:** `hooks/gsd-statusline.js:51-54`
**Severity:** High
**Type:** Runtime error / crash
**Issue:**
The statusline reads the todos directory without error handling. If there's a permission issue or a race condition where a file gets deleted between `readdirSync` and `statSync`, the statusline will crash.
**Current code:**
```javascript
if (session && fs.existsSync(todosDir)) {
const files = fs.readdirSync(todosDir) // Can throw on permission errors
.filter(f => f.startsWith(session) && f.includes('-agent-') && f.endsWith('.json'))
.map(f => ({ name: f, mtime: fs.statSync(path.join(todosDir, f)).mtime })) // Can throw if file deleted
.sort((a, b) => b.mtime - a.mtime);
```
The try-catch at line 57 only wraps the JSON.parse, not the directory operations.
**Fix:**
Wrap the entire directory reading block in try-catch:
```javascript
if (session && fs.existsSync(todosDir)) {
try {
const files = fs.readdirSync(todosDir)
.filter(f => f.startsWith(session) && f.includes('-agent-') && f.endsWith('.json'))
.map(f => ({ name: f, mtime: fs.statSync(path.join(todosDir, f)).mtime }))
.sort((a, b) => b.mtime - a.mtime);
if (files.length > 0) {
try {
const todos = JSON.parse(fs.readFileSync(path.join(todosDir, files[0].name), 'utf8'));
const inProgress = todos.find(t => t.status === 'in_progress');
if (inProgress) task = inProgress.activeForm || '';
} catch (e) {}
}
} catch (e) {
// Silently fail - don't break statusline on file system errors
}
}
```
---
### 2. Fragile JSON parsing in bash workflows
**Files:**
- `get-shit-done/workflows/execute-phase.md:20`
- `commands/gsd/execute-phase.md:45`
- `get-shit-done/workflows/execute-phase.md:62`
- `agents/gsd-executor.md:47`
**Severity:** High
**Type:** Logic error / silent failure
**Issue:**
The workflows use fragile grep/sed patterns to extract JSON values instead of proper JSON parsing. These patterns will fail silently if JSON formatting varies.
**Examples:**
```bash
# Fragile - fails if JSON is minified or has different spacing
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
BRANCHING_STRATEGY=$(cat .planning/config.json 2>/dev/null | grep -o '"branching_strategy"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*:.*"\([^"]*\)"/\1/' || echo "none")
```
**Problems:**
- Fails if JSON is minified (no spaces)
- Fails if values aren't quoted (e.g., `true` vs `"true"`)
- Fails if there are escaped quotes in the value
- Fails if spacing is different than expected
**Fix:**
Use `jq` for robust JSON parsing:
```bash
# Robust JSON parsing
MODEL_PROFILE=$(jq -r '.model_profile // "balanced"' .planning/config.json 2>/dev/null || echo "balanced")
COMMIT_PLANNING_DOCS=$(jq -r '.commit_docs // true' .planning/config.json 2>/dev/null | grep -o 'true\|false' || echo "true")
BRANCHING_STRATEGY=$(jq -r '.branching_strategy // "none"' .planning/config.json 2>/dev/null || echo "none")
PHASE_BRANCH_TEMPLATE=$(jq -r '.phase_branch_template // "gsd/phase-{phase}-{slug}"' .planning/config.json 2>/dev/null || echo "gsd/phase-{phase}-{slug}")
```
**Impact:**
Without this fix, configuration settings may silently fall back to defaults even when explicitly configured, leading to unexpected behavior.
---
### 3. Violation of stated git commit rules
**File:** `commands/gsd/execute-phase.md:94`
**Severity:** Medium
**Type:** Inconsistency with documented rules
**Issue:**
The workflow uses `git add -u` which violates the explicitly stated rule "NEVER use git add . or git add -A or git add src/".
**Current code:**
```bash
git add -u && git commit -m "fix({phase}): orchestrator corrections"
```
**Fix:**
Either:
1. Remove this step if orchestrator corrections shouldn't happen
2. Explicitly enumerate the files to stage:
```bash
# List modified files and stage individually
git status --porcelain | grep '^ M' | cut -c4- | while read file; do
git add "$file"
done
git commit -m "fix({phase}): orchestrator corrections"
```
Or better yet, avoid making corrections at the orchestrator level.
---
## Medium Priority Issues
### 4. Missing hex color validation in install.js
**File:** `bin/install.js:437-441`
**Severity:** Medium
**Type:** Data validation
**Issue:**
The code accepts hex color values without validation:
```javascript
} else if (colorValue.startsWith('#')) {
// Already hex, keep as is
newLines.push(line);
}
```
**Fix:**
Add validation for hex color format:
```javascript
} else if (colorValue.startsWith('#')) {
// Validate hex color format (#RGB or #RRGGBB)
if (/^#[0-9A-Fa-f]{3}$|^#[0-9A-Fa-f]{6}$/.test(colorValue)) {
newLines.push(line);
}
// Skip invalid hex colors
}
```
---
### 5. Potential issue with branch variable expansion
**File:** `get-shit-done/workflows/execute-phase.md:100-103`
**Severity:** Low
**Type:** Shell safety
**Issue:**
Phase name is used in shell variable without proper quoting in some places:
```bash
PHASE_NAME=$(basename "$PHASE_DIR" | sed 's/^[0-9]*-//')
```
The variable is properly quoted, but the subsequent sed operations should also be reviewed for edge cases with special characters in phase names.
**Fix:**
Ensure all variable expansions are properly quoted, especially in sed operations.
---
### 6. Missing CONTEXT.md reference documentation
**File:** `agents/gsd-executor.md:69`
**Severity:** Low
**Type:** Documentation gap
**Issue:**
The executor mentions that plans can reference CONTEXT.md but doesn't explain how it should be passed or read.
**Current text:**
```markdown
**If plan references CONTEXT.md:** The CONTEXT.md file provides the user's vision for this phase — how they imagine it working, what's essential, and what's out of scope. Honor this context throughout execution.
```
**Fix:**
Add clarity about how CONTEXT.md is accessed:
```markdown
**If plan references CONTEXT.md:** Read .planning/phases/{phase}/CONTEXT.md for the user's vision. Honor this context throughout execution. The file provides how they imagine it working, what's essential, and what's out of scope.
```
---
## Low Priority / Code Quality Issues
### 7. Inconsistent error handling patterns
**Files:** Multiple
**Severity:** Low
**Type:** Code quality
**Issue:**
Error handling is inconsistent across different files:
- Some functions have comprehensive try-catch blocks
- Others rely on optional chaining or existence checks
- Some fail silently, others propagate errors
**Recommendation:**
Establish consistent error handling patterns across the codebase, especially for:
- File system operations
- JSON parsing
- Git operations
- External command execution
---
### 8. Hardcoded paths in multiple locations
**Files:** Multiple
**Severity:** Low
**Type:** Maintainability
**Issue:**
Paths like `~/.claude/`, `.planning/`, etc. are hardcoded in many places. Changes to directory structure would require updates in multiple files.
**Examples:**
- `hooks/gsd-statusline.js:49` - hardcoded `~/.claude/todos`
- `hooks/gsd-check-update.js:12` - hardcoded `~/.claude/`
- Multiple workflow files reference `.planning/`
**Recommendation:**
Consider centralizing path constants in a shared configuration module.
---
## Summary
**Total bugs found:** 8
**By severity:**
- Critical: 3 (statusline error handling, JSON parsing, git rules violation)
- Medium: 3 (color validation, variable expansion, documentation)
- Low: 2 (error handling patterns, hardcoded paths)
**Recommended immediate actions:**
1. Fix statusline.js error handling (prevents crashes)
2. Replace grep/sed JSON parsing with jq (prevents silent configuration failures)
3. Fix or document the git add -u usage (consistency with stated rules)
**Next steps:**
- Prioritize fixes based on user impact
- Add unit tests for critical paths (especially JSON parsing and file operations)
- Consider adding integration tests for workflow orchestration
- Establish error handling and coding standards documentation

View File

@@ -1,198 +0,0 @@
# Fixes Applied - Bug Report Follow-up
**Date:** 2026-01-31
**Related:** BUG_REPORT.md
---
## Critical Bugs Fixed
### 1. ✅ Fixed: Missing error handling in statusline.js
**File:** `hooks/gsd-statusline.js`
**Change:** Wrapped directory reading operations in try-catch block
**Before:**
```javascript
if (session && fs.existsSync(todosDir)) {
const files = fs.readdirSync(todosDir) // Could crash
.filter(...)
.map(f => ({ name: f, mtime: fs.statSync(...).mtime })) // Could crash
```
**After:**
```javascript
if (session && fs.existsSync(todosDir)) {
try {
const files = fs.readdirSync(todosDir)
.filter(...)
.map(f => ({ name: f, mtime: fs.statSync(...).mtime }))
// ... rest of logic
} catch (e) {
// Silently fail on file system errors - don't break statusline
}
}
```
**Impact:** Prevents statusline crashes from file system permission issues or race conditions.
---
### 2. ✅ Fixed: Hex color validation in install.js
**File:** `bin/install.js`
**Change:** Added validation for hex color format
**Before:**
```javascript
} else if (colorValue.startsWith('#')) {
// Already hex, keep as is
newLines.push(line);
}
```
**After:**
```javascript
} else if (colorValue.startsWith('#')) {
// Validate hex color format (#RGB or #RRGGBB)
if (/^#[0-9a-f]{3}$|^#[0-9a-f]{6}$/i.test(colorValue)) {
// Already hex and valid, keep as is
newLines.push(line);
}
// Skip invalid hex colors
}
```
**Impact:** Prevents invalid hex color values from being written to config files.
---
### 3. ✅ Fixed: Git add rules violation in execute-phase.md
**File:** `commands/gsd/execute-phase.md`
**Change:** Replaced `git add -u` with individual file staging
**Before:**
```bash
git add -u && git commit -m "fix({phase}): orchestrator corrections"
```
**After:**
```bash
# Stage each modified file individually (never use git add -u, git add ., or git add -A)
git status --porcelain | grep '^ M' | cut -c4- | while read file; do
git add "$file"
done
git commit -m "fix({phase}): orchestrator corrections"
```
**Impact:** Maintains consistency with documented git commit rules and prevents accidental staging of unwanted files.
---
## Known Issues Remaining
### Fragile JSON Parsing (High Priority - Not Fixed)
**Status:** ⚠️ Documented but not fixed
**Reason:** Requires more extensive refactoring to use `jq` or alternative JSON parser
**Location:** Multiple workflow files
**Files affected:**
- `get-shit-done/workflows/execute-phase.md:20, 62, 76-77`
- `commands/gsd/execute-phase.md:45, 100`
- `agents/gsd-executor.md:47`
**Current approach:**
```bash
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
```
**Recommended fix:**
```bash
MODEL_PROFILE=$(jq -r '.model_profile // "balanced"' .planning/config.json 2>/dev/null || echo "balanced")
```
**Workaround for users:**
- Ensure `.planning/config.json` is properly formatted with consistent spacing
- Always quote string values in JSON
- Avoid special characters in configuration values
**Next steps:**
- Evaluate if `jq` can be a required dependency
- Or create a Node.js helper script for JSON parsing that workflows can call
- Or document the JSON formatting requirements clearly for users
---
## Testing Recommendations
### 1. Statusline Error Handling
**Test case:** Delete files while statusline is reading them
```bash
# Terminal 1: Watch statusline
while true; do node hooks/gsd-statusline.js; sleep 1; done
# Terminal 2: Create and delete files rapidly
mkdir -p ~/.claude/todos
while true; do
touch ~/.claude/todos/test-file.json
sleep 0.1
rm ~/.claude/todos/test-file.json
sleep 0.1
done
```
**Expected:** Statusline continues working without crashes
### 2. Color Validation
**Test case:** Invalid hex colors in frontmatter
```markdown
---
color: #ZZZ
---
```
**Expected:** Invalid color is skipped during installation
### 3. Git Operations
**Test case:** Verify individual file staging
```bash
# Create some changes
touch file1.txt file2.txt
git add file1.txt file2.txt
git commit -m "test files"
echo "change" > file1.txt
echo "change" > file2.txt
# Run the orchestrator commit logic
# Should stage each file individually
```
**Expected:** Files are staged one at a time, not in bulk
---
## Future Improvements
1. **Centralize JSON parsing**: Create a helper utility for all JSON config reading
2. **Add unit tests**: Test critical paths like statusline, installer, config parsing
3. **Establish error handling patterns**: Document and enforce consistent error handling
4. **Path constants**: Centralize hardcoded paths in a configuration module
5. **Integration tests**: Test full workflow orchestration end-to-end
---
## Changelog Entry
```markdown
## [Unreleased]
### Fixed
- **hooks/gsd-statusline.js**: Added error handling for file system operations to prevent crashes
- **bin/install.js**: Added validation for hex color values to prevent invalid config
- **commands/gsd/execute-phase.md**: Fixed git staging to use individual files instead of git add -u
### Known Issues
- JSON config parsing uses fragile grep/sed patterns - will be addressed in future release
```

View File

@@ -1,147 +0,0 @@
# GSD Maintainer Guide
Quick reference for release workflows and maintenance tasks.
## Release Workflow
### Standard Release
```bash
/gsd-publish-version
```
The command walks you through:
1. Check uncommitted changes
2. Generate changelog from commits
3. Review and approve changelog
4. Update CHANGELOG.md
5. Bump version (`npm version patch|minor|major`)
6. Push to GitHub with tags
GitHub Actions then:
- Creates GitHub Release from CHANGELOG.md
- Publishes to npm
### Pre-release (Experimental Features)
For risky features, ship as alpha first:
```bash
# Bump to alpha
npm version prerelease --preid=alpha
# Push
git push origin main --tags
```
Pre-release tags (`v1.10.0-alpha.0`) don't trigger npm publish or GitHub Release creation. Users opt-in explicitly.
If it works, promote to stable:
```bash
npm version minor # or patch
git push origin main --tags
```
If it fails, delete the tag and move on.
### Hotfix
Production broken? Skip changelog ceremony:
```bash
# Fix the issue
git add . && git commit -m "fix(install): handle Windows UNC paths"
# Bump and push
npm version patch
git push origin main --tags
```
## Version Cadence
| Type | When | Example |
|------|------|---------|
| MAJOR | Breaking changes | Command removed, format changed |
| MINOR | New features | New command, new capability |
| PATCH | Bug fixes | Batch weekly, or immediately if critical |
## Changelog Format
Follow [Keep a Changelog](https://keepachangelog.com/):
```markdown
## [1.10.0] - 2025-01-22
### Added
- New `/gsd:whats-new` command
### Changed
- Improved parallel execution
### Fixed
- STATE.md progress calculation
### Removed
- **BREAKING:** Deprecated ISSUES.md system
```
## Dependency Policy
Before adding dependencies:
1. Check bundle size impact
2. Evaluate if it's worth the weight
3. Consider if the functionality can be implemented without it
The codebase intelligence system was removed partly because sql.js added 21MB.
## Recovery Procedures
### Broken npm Release
Within 72 hours:
```bash
npm unpublish get-shit-done-cc@1.9.5
```
After 72 hours: Publish a fix as new patch version.
### Wrong Tag
```bash
# Delete local and remote
git tag -d v1.9.5
git push origin :refs/tags/v1.9.5
# Recreate correctly
git tag -a v1.9.5 -m "Release v1.9.5"
git push origin v1.9.5
```
### Missing Changelog Entry
Either amend the release commit or add a follow-up commit with the missing content.
## CI/CD Setup
### Required Secrets
In GitHub repo settings → Secrets → Actions:
- `NPM_TOKEN`: npm automation token with publish access
`GITHUB_TOKEN` is provided automatically.
### Branch Protection (Optional)
Settings → Branches → Add rule for `main`:
- Require status checks: `test`, `lint`
- Disable force pushes
## Reviewing Contributor PRs
Checklist:
- [ ] Follows conventional commit format
- [ ] No enterprise patterns or filler
- [ ] CHANGELOG.md updated for user-facing changes
- [ ] No unnecessary dependencies
- [ ] Tested on Windows if touching paths

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,17 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000" width="2000" height="2000">
<defs>
<style>
.logo { font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Courier New', monospace; fill: #7dcfff; }
</style>
</defs>
<!-- GSD ASCII Logo - centered -->
<g transform="translate(1000, 1000)">
<text class="logo" font-size="108" text-anchor="middle" y="-225" xml:space="preserve"> ██████╗ ███████╗██████╗ </text>
<text class="logo" font-size="108" text-anchor="middle" y="-105" xml:space="preserve"> ██╔════╝ ██╔════╝██╔══██╗</text>
<text class="logo" font-size="108" text-anchor="middle" y="15" xml:space="preserve"> ██║ ███╗███████╗██║ ██║</text>
<text class="logo" font-size="108" text-anchor="middle" y="135" xml:space="preserve"> ██║ ██║╚════██║██║ ██║</text>
<text class="logo" font-size="108" text-anchor="middle" y="255" xml:space="preserve"> ╚██████╔╝███████║██████╔╝</text>
<text class="logo" font-size="108" text-anchor="middle" y="375" xml:space="preserve"> ╚═════╝ ╚══════╝╚═════╝ </text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,59 @@
# Decimal Phase Calculation
Calculate the next decimal phase number for urgent insertions.
## Find Existing Decimals
For a given integer phase, find all existing decimal phases:
```bash
# Find decimal phases after integer phase N (e.g., 06.1, 06.2)
AFTER_PHASE=$1 # e.g., 6
# Pad to 2 digits
PADDED=$(printf "%02d" "$AFTER_PHASE")
# Find existing decimals
EXISTING=$(ls -d .planning/phases/${PADDED}.*-* 2>/dev/null | \
xargs -I{} basename {} | \
grep -oE '^[0-9]+\.[0-9]+' | \
sort -V)
```
## Calculate Next Decimal
Find the highest decimal suffix and increment:
```bash
if [ -z "$EXISTING" ]; then
# No decimals exist, start at .1
NEXT_DECIMAL="1"
else
# Get highest decimal suffix
MAX_SUFFIX=$(echo "$EXISTING" | tail -1 | grep -oE '\.[0-9]+$' | tr -d '.')
NEXT_DECIMAL=$((MAX_SUFFIX + 1))
fi
# Format: 06.1, 06.2, etc.
DECIMAL_PHASE="${PADDED}.${NEXT_DECIMAL}"
```
## Examples
| Existing Phases | Next Phase |
|-----------------|------------|
| 06 only | 06.1 |
| 06, 06.1 | 06.2 |
| 06, 06.1, 06.2 | 06.3 |
## Directory Naming
Decimal phase directories use the full decimal number:
```bash
SLUG=$(echo "$DESCRIPTION" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')
PHASE_DIR=".planning/phases/${DECIMAL_PHASE}-${SLUG}"
mkdir -p "$PHASE_DIR"
```
Example: `.planning/phases/06.1-fix-critical-auth-bug/`

View File

@@ -0,0 +1,50 @@
# Git Planning Commit
Check whether to commit planning artifacts, then commit if enabled.
## Check Configuration
```bash
# Check config.json first
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
```
Default: `true` if not set or config missing.
## Conditional Commit
Only run git operations if `COMMIT_PLANNING_DOCS=true`:
```bash
if [ "$COMMIT_PLANNING_DOCS" = "true" ]; then
git add .planning/STATE.md .planning/ROADMAP.md
git commit -m "$(cat <<'EOF'
docs({scope}): {description}
{optional body}
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
fi
```
## Commit Message Patterns
| Command | Scope | Example |
|---------|-------|---------|
| plan-phase | phase | `docs(phase-03): create authentication plans` |
| execute-phase | phase | `docs(phase-03): complete authentication phase` |
| new-milestone | milestone | `docs: start milestone v1.1` |
| remove-phase | chore | `chore: remove phase 17 (dashboard)` |
| insert-phase | phase | `docs: insert phase 16.1 (critical fix)` |
| add-phase | phase | `docs: add phase 07 (settings page)` |
## When to Skip
- `commit_docs: false` in config
- `.planning/` is gitignored
- No changes to commit (check with `git status --porcelain .planning/`)

View File

@@ -0,0 +1,32 @@
# Model Profile Resolution
Resolve model profile once at the start of orchestration, then use it for all Task spawns.
## Resolution Pattern
```bash
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
```
Default: `balanced` if not set or config missing.
## Lookup Table
@~/.claude/get-shit-done/references/model-profiles.md
Look up the agent in the table for the resolved profile. Pass the model parameter to Task calls:
```
Task(
prompt="...",
subagent_type="gsd-planner",
model="{resolved_model}" # e.g., "opus" for quality profile
)
```
## Usage
1. Resolve once at orchestration start
2. Store the profile value
3. Look up each agent's model from the table when spawning
4. Pass model parameter to each Task call

View File

@@ -0,0 +1,58 @@
# Phase Argument Parsing
Parse and normalize phase arguments for commands that operate on phases.
## Extraction
From `$ARGUMENTS`:
- Extract phase number (first numeric argument)
- Extract flags (prefixed with `--`)
- Remaining text is description (for insert/add commands)
## Normalization
Zero-pad integer phases to 2 digits. Preserve decimal suffixes.
```bash
# Normalize phase number
if [[ "$PHASE" =~ ^[0-9]+$ ]]; then
# Integer: 8 → 08
PHASE=$(printf "%02d" "$PHASE")
elif [[ "$PHASE" =~ ^([0-9]+)\.([0-9]+)$ ]]; then
# Decimal: 2.1 → 02.1
PHASE=$(printf "%02d.%s" "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}")
fi
```
## Auto-Detection
When no phase number provided, detect the next unplanned phase:
```bash
# Find phases without PLAN.md files
for dir in .planning/phases/*/; do
if ! ls "$dir"/*-PLAN.md 2>/dev/null | head -1 >/dev/null; then
PHASE=$(basename "$dir" | grep -oE '^[0-9.]+')
break
fi
done
```
## Validation
After normalization, verify phase exists in ROADMAP.md:
```bash
grep -q "### Phase ${PHASE}:" .planning/ROADMAP.md || {
echo "ERROR: Phase ${PHASE} not found in roadmap"
exit 1
}
```
## Directory Lookup
Find the phase directory using the normalized phase number:
```bash
PHASE_DIR=$(ls -d .planning/phases/${PHASE}-* 2>/dev/null | head -1)
```

View File

@@ -0,0 +1,72 @@
<purpose>
Research how to implement a phase. Spawns gsd-phase-researcher with phase context.
Standalone research command. For most workflows, use `/gsd:plan-phase` which integrates research automatically.
</purpose>
<process>
## Step 0: Resolve Model Profile
@~/.claude/get-shit-done/references/model-profile-resolution.md
Resolve model for:
- `gsd-phase-researcher`
## Step 1: Normalize and Validate Phase
@~/.claude/get-shit-done/references/phase-argument-parsing.md
```bash
grep -A5 "Phase ${PHASE}:" .planning/ROADMAP.md 2>/dev/null
```
If not found: Error and exit.
## Step 2: Check Existing Research
```bash
ls .planning/phases/${PHASE}-*/RESEARCH.md 2>/dev/null
```
If exists: Offer update/view/skip options.
## Step 3: Gather Phase Context
```bash
grep -A20 "Phase ${PHASE}:" .planning/ROADMAP.md
cat .planning/REQUIREMENTS.md 2>/dev/null
cat .planning/phases/${PHASE}-*/*-CONTEXT.md 2>/dev/null
grep -A30 "### Decisions Made" .planning/STATE.md 2>/dev/null
```
## Step 4: Spawn Researcher
```
Task(
prompt="<objective>
Research implementation approach for Phase {phase}: {name}
</objective>
<context>
Phase description: {description}
Requirements: {requirements}
Prior decisions: {decisions}
Phase context: {context_md}
</context>
<output>
Write to: .planning/phases/${PHASE}-{slug}/${PHASE}-RESEARCH.md
</output>",
subagent_type="gsd-phase-researcher",
model="{researcher_model}"
)
```
## Step 5: Handle Return
- `## RESEARCH COMPLETE` — Display summary, offer: Plan/Dig deeper/Review/Done
- `## CHECKPOINT REACHED` — Present to user, spawn continuation
- `## RESEARCH INCONCLUSIVE` — Show attempts, offer: Add context/Try different mode/Manual
</process>