diff --git a/commands/gsd/add-phase.md b/commands/gsd/add-phase.md index 4aaa71a80..b04d89885 100644 --- a/commands/gsd/add-phase.md +++ b/commands/gsd/add-phase.md @@ -11,197 +11,29 @@ allowed-tools: Add a new integer phase to the end of the current milestone in the roadmap. -This command appends sequential phases to the current milestone's phase list, automatically calculating the next phase number based on existing phases. - -Purpose: Add planned work discovered during execution that belongs at the end of current milestone. +Routes to the add-phase workflow which handles: +- Phase number calculation (next sequential integer) +- Directory creation with slug generation +- Roadmap structure updates +- STATE.md roadmap evolution tracking @.planning/ROADMAP.md @.planning/STATE.md +@~/.claude/get-shit-done/workflows/add-phase.md +**Follow the add-phase workflow** from `@~/.claude/get-shit-done/workflows/add-phase.md`. - -Parse the command arguments: -- All arguments become the phase description -- Example: `/gsd:add-phase Add authentication` → description = "Add authentication" -- Example: `/gsd:add-phase Fix critical performance issues` → description = "Fix critical performance issues" - -If no arguments provided: - -``` -ERROR: Phase description required -Usage: /gsd:add-phase -Example: /gsd:add-phase Add authentication system -``` - -Exit. - - - -Load the roadmap file: - -```bash -if [ -f .planning/ROADMAP.md ]; then - ROADMAP=".planning/ROADMAP.md" -else - echo "ERROR: No roadmap found (.planning/ROADMAP.md)" - exit 1 -fi -``` - -Read roadmap content for parsing. - - - -Parse the roadmap to find the current milestone section: - -1. Locate the "## Current Milestone:" heading -2. Extract milestone name and version -3. Identify all phases under this milestone (before next "---" separator or next milestone heading) -4. Parse existing phase numbers (including decimals if present) - -Example structure: - -``` -## Current Milestone: v1.0 Foundation - -### Phase 4: Focused Command System -### Phase 5: Path Routing & Validation -### Phase 6: Documentation & Distribution -``` - - - - -Find the highest integer phase number in the current milestone: - -1. Extract all phase numbers from phase headings (### Phase N:) -2. Filter to integer phases only (ignore decimals like 4.1, 4.2) -3. Find the maximum integer value -4. Add 1 to get the next phase number - -Example: If phases are 4, 5, 5.1, 6 → next is 7 - -Format as two-digit: `printf "%02d" $next_phase` - - - -Convert the phase description to a kebab-case slug: - -```bash -# Example transformation: -# "Add authentication" → "add-authentication" -# "Fix critical performance issues" → "fix-critical-performance-issues" - -slug=$(echo "$description" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//') -``` - -Phase directory name: `{two-digit-phase}-{slug}` -Example: `07-add-authentication` - - - -Create the phase directory structure: - -```bash -phase_dir=".planning/phases/${phase_num}-${slug}" -mkdir -p "$phase_dir" -``` - -Confirm: "Created directory: $phase_dir" - - - -Add the new phase entry to the roadmap: - -1. Find the insertion point (after last phase in current milestone, before "---" separator) -2. Insert new phase heading: - - ``` - ### Phase {N}: {Description} - - **Goal:** [To be planned] - **Depends on:** Phase {N-1} - **Plans:** 0 plans - - Plans: - - [ ] TBD (run /gsd:plan-phase {N} to break down) - - **Details:** - [To be added during planning] - ``` - -3. Write updated roadmap back to file - -Preserve all other content exactly (formatting, spacing, other phases). - - - -Update STATE.md to reflect the new phase: - -1. Read `.planning/STATE.md` -2. Under "## Current Position" → "**Next Phase:**" add reference to new phase -3. Under "## Accumulated Context" → "### Roadmap Evolution" add entry: - ``` - - Phase {N} added: {description} - ``` - -If "Roadmap Evolution" section doesn't exist, create it. - - - -Present completion summary: - -``` -Phase {N} added to current milestone: -- Description: {description} -- Directory: .planning/phases/{phase-num}-{slug}/ -- Status: Not planned yet - -Roadmap updated: {roadmap-path} -Project state updated: .planning/STATE.md - ---- - -## ▶ Next Up - -**Phase {N}: {description}** - -`/gsd:plan-phase {N}` - -`/clear` first → fresh context window - ---- - -**Also available:** -- `/gsd:add-phase ` — add another phase -- Review roadmap - ---- -``` - - +The workflow handles all logic including: +1. Argument parsing and validation +2. Roadmap existence checking +3. Current milestone identification +4. Next phase number calculation (ignoring decimals) +5. Slug generation from description +6. Phase directory creation +7. Roadmap entry insertion +8. STATE.md updates - - - -- Don't modify phases outside current milestone -- Don't renumber existing phases -- Don't use decimal numbering (that's /gsd:insert-phase) -- Don't create plans yet (that's /gsd:plan-phase) -- Don't commit changes (user decides when to commit) - - - -Phase addition is complete when: - -- [ ] Phase directory created: `.planning/phases/{NN}-{slug}/` -- [ ] Roadmap updated with new phase entry -- [ ] STATE.md updated with roadmap evolution note -- [ ] New phase appears at end of current milestone -- [ ] Next phase number calculated correctly (ignoring decimals) -- [ ] User informed of next steps - diff --git a/commands/gsd/check-todos.md b/commands/gsd/check-todos.md index ccb09f4c9..5ecc3c689 100644 --- a/commands/gsd/check-todos.md +++ b/commands/gsd/check-todos.md @@ -6,223 +6,36 @@ allowed-tools: - Read - Write - Bash - - Glob - AskUserQuestion --- List all pending todos, allow selection, load full context for the selected todo, and route to appropriate action. -Enables reviewing captured ideas and deciding what to work on next. +Routes to the check-todos workflow which handles: +- Todo counting and listing with area filtering +- Interactive selection with full context loading +- Roadmap correlation checking +- Action routing (work now, add to phase, brainstorm, create phase) +- STATE.md updates and git commits - + @.planning/STATE.md @.planning/ROADMAP.md - +@~/.claude/get-shit-done/workflows/check-todos.md + +**Follow the check-todos workflow** from `@~/.claude/get-shit-done/workflows/check-todos.md`. - -```bash -TODO_COUNT=$(ls .planning/todos/pending/*.md 2>/dev/null | wc -l | tr -d ' ') -echo "Pending todos: $TODO_COUNT" -``` - -If count is 0: -``` -No pending todos. - -Todos are captured during work sessions with /gsd:add-todo. - ---- - -Would you like to: - -1. Continue with current phase (/gsd:progress) -2. Add a todo now (/gsd:add-todo) -``` - -Exit. - - - -Check for area filter in arguments: -- `/gsd:check-todos` → show all -- `/gsd:check-todos api` → filter to area:api only - - - -```bash -for file in .planning/todos/pending/*.md; do - created=$(grep "^created:" "$file" | cut -d' ' -f2) - title=$(grep "^title:" "$file" | cut -d':' -f2- | xargs) - area=$(grep "^area:" "$file" | cut -d' ' -f2) - echo "$created|$title|$area|$file" -done | sort -``` - -Apply area filter if specified. Display as numbered list: - -``` -Pending Todos: - -1. Add auth token refresh (api, 2d ago) -2. Fix modal z-index issue (ui, 1d ago) -3. Refactor database connection pool (database, 5h ago) - ---- - -Reply with a number to view details, or: -- `/gsd:check-todos [area]` to filter by area -- `q` to exit -``` - -Format age as relative time. - - - -Wait for user to reply with a number. - -If valid: load selected todo, proceed. -If invalid: "Invalid selection. Reply with a number (1-[N]) or `q` to exit." - - - -Read the todo file completely. Display: - -``` -## [title] - -**Area:** [area] -**Created:** [date] ([relative time] ago) -**Files:** [list or "None"] - -### Problem -[problem section content] - -### Solution -[solution section content] -``` - -If `files` field has entries, read and briefly summarize each. - - - -```bash -ls .planning/ROADMAP.md 2>/dev/null && echo "Roadmap exists" -``` - -If roadmap exists: -1. Check if todo's area matches an upcoming phase -2. Check if todo's files overlap with a phase's scope -3. Note any match for action options - - - -**If todo maps to a roadmap phase:** - -Use AskUserQuestion: -- header: "Action" -- question: "This todo relates to Phase [N]: [name]. What would you like to do?" -- options: - - "Work on it now" — move to done, start working - - "Add to phase plan" — include when planning Phase [N] - - "Brainstorm approach" — think through before deciding - - "Put it back" — return to list - -**If no roadmap match:** - -Use AskUserQuestion: -- header: "Action" -- question: "What would you like to do with this todo?" -- options: - - "Work on it now" — move to done, start working - - "Create a phase" — /gsd:add-phase with this scope - - "Brainstorm approach" — think through before deciding - - "Put it back" — return to list - - - -**Work on it now:** -```bash -mv ".planning/todos/pending/[filename]" ".planning/todos/done/" -``` -Update STATE.md todo count. Present problem/solution context. Begin work or ask how to proceed. - -**Add to phase plan:** -Note todo reference in phase planning notes. Keep in pending. Return to list or exit. - -**Create a phase:** -Display: `/gsd:add-phase [description from todo]` -Keep in pending. User runs command in fresh context. - -**Brainstorm approach:** -Keep in pending. Start discussion about problem and approaches. - -**Put it back:** -Return to list_todos step. - - - -After any action that changes todo count: - -```bash -ls .planning/todos/pending/*.md 2>/dev/null | wc -l -``` - -Update STATE.md "### Pending Todos" section if exists. - - - -If todo was moved to done/, commit the change: - -**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 -``` - -**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations, log "Todo moved (not committed - commit_docs: false)" - -**If `COMMIT_PLANNING_DOCS=true` (default):** - -```bash -git add .planning/todos/done/[filename] -git rm --cached .planning/todos/pending/[filename] 2>/dev/null || true -[ -f .planning/STATE.md ] && git add .planning/STATE.md -git commit -m "$(cat <<'EOF' -docs: start work on todo - [title] - -Moved to done/, beginning implementation. -EOF -)" -``` - -Confirm: "Committed: docs: start work on todo - [title]" - - +The workflow handles all logic including: +1. Todo existence checking +2. Area filtering +3. Interactive listing and selection +4. Full context loading with file summaries +5. Roadmap correlation checking +6. Action offering and execution +7. STATE.md updates +8. Git commits - - -- Moved todo to `.planning/todos/done/` (if "Work on it now") -- Updated `.planning/STATE.md` (if todo count changed) - - - -- Don't delete todos — move to done/ when work begins -- Don't start work without moving to done/ first -- Don't create plans from this command — route to /gsd:plan-phase or /gsd:add-phase - - - -- [ ] All pending todos listed with title, area, age -- [ ] Area filter applied if specified -- [ ] Selected todo's full context loaded -- [ ] Roadmap context checked for phase match -- [ ] Appropriate actions offered -- [ ] Selected action executed -- [ ] STATE.md updated if todo count changed -- [ ] Changes committed to git (if todo moved to done/) - diff --git a/commands/gsd/update.md b/commands/gsd/update.md index 99b051e97..0c939948b 100644 --- a/commands/gsd/update.md +++ b/commands/gsd/update.md @@ -1,200 +1,37 @@ --- name: gsd:update description: Update GSD to latest version with changelog display +allowed-tools: + - Bash + - AskUserQuestion --- Check for GSD updates, install if available, and display what changed. -Provides a better update experience than raw `npx get-shit-done-cc` by showing version diff and changelog entries. +Routes to the update workflow which handles: +- Version detection (local vs global installation) +- npm version checking +- Changelog fetching and display +- User confirmation with clean install warning +- Update execution and cache clearing +- Restart reminder + +@~/.claude/get-shit-done/workflows/update.md + + +**Follow the update workflow** from `@~/.claude/get-shit-done/workflows/update.md`. - -Detect whether GSD is installed locally or globally by checking both locations: - -```bash -# Check local first (takes priority) -if [ -f "./.claude/get-shit-done/VERSION" ]; then - cat "./.claude/get-shit-done/VERSION" - echo "LOCAL" -elif [ -f ~/.claude/get-shit-done/VERSION ]; then - cat ~/.claude/get-shit-done/VERSION - echo "GLOBAL" -else - echo "UNKNOWN" -fi -``` - -Parse output: -- If last line is "LOCAL": installed version is first line, use `--local` flag for update -- If last line is "GLOBAL": installed version is first line, use `--global` flag for update -- If "UNKNOWN": proceed to install step (treat as version 0.0.0) - -**If VERSION file missing:** -``` -## GSD Update - -**Installed version:** Unknown - -Your installation doesn't include version tracking. - -Running fresh install... -``` - -Proceed to install step (treat as version 0.0.0 for comparison). - - - -Check npm for latest version: - -```bash -npm view get-shit-done-cc version 2>/dev/null -``` - -**If npm check fails:** -``` -Couldn't check for updates (offline or npm unavailable). - -To update manually: `npx get-shit-done-cc --global` -``` - -STOP here if npm unavailable. - - - -Compare installed vs latest: - -**If installed == latest:** -``` -## GSD Update - -**Installed:** X.Y.Z -**Latest:** X.Y.Z - -You're already on the latest version. -``` - -STOP here if already up to date. - -**If installed > latest:** -``` -## GSD Update - -**Installed:** X.Y.Z -**Latest:** A.B.C - -You're ahead of the latest release (development version?). -``` - -STOP here if ahead. - - - -**If update available**, fetch and show what's new BEFORE updating: - -1. Fetch changelog (same as fetch_changelog step) -2. Extract entries between installed and latest versions -3. Display preview and ask for confirmation: - -``` -## GSD Update Available - -**Installed:** 1.5.10 -**Latest:** 1.5.15 - -### What's New -──────────────────────────────────────────────────────────── - -## [1.5.15] - 2026-01-20 - -### Added -- Feature X - -## [1.5.14] - 2026-01-18 - -### Fixed -- Bug fix Y - -──────────────────────────────────────────────────────────── - -⚠️ **Note:** The installer performs a clean install of GSD folders: -- `commands/gsd/` will be wiped and replaced -- `get-shit-done/` will be wiped and replaced -- `agents/gsd-*` files will be replaced - -(Paths are relative to your install location: `~/.claude/` for global, `./.claude/` for local) - -Your custom files in other locations are preserved: -- Custom commands not in `commands/gsd/` ✓ -- Custom agents not prefixed with `gsd-` ✓ -- Custom hooks ✓ -- Your CLAUDE.md files ✓ - -If you've modified any GSD files directly, back them up first. -``` - -Use AskUserQuestion: -- Question: "Proceed with update?" -- Options: - - "Yes, update now" - - "No, cancel" - -**If user cancels:** STOP here. - - - -Run the update using the install type detected in step 1: - -**If LOCAL install:** -```bash -npx get-shit-done-cc --local -``` - -**If GLOBAL install (or unknown):** -```bash -npx get-shit-done-cc --global -``` - -Capture output. If install fails, show error and STOP. - -Clear the update cache so statusline indicator disappears: - -**If LOCAL install:** -```bash -rm -f ./.claude/cache/gsd-update-check.json -``` - -**If GLOBAL install:** -```bash -rm -f ~/.claude/cache/gsd-update-check.json -``` - - - -Format completion message (changelog was already shown in confirmation step): - -``` -╔═══════════════════════════════════════════════════════════╗ -║ GSD Updated: v1.5.10 → v1.5.15 ║ -╚═══════════════════════════════════════════════════════════╝ - -⚠️ Restart Claude Code to pick up the new commands. - -[View full changelog](https://github.com/glittercowboy/get-shit-done/blob/main/CHANGELOG.md) -``` - - +The workflow handles all logic including: +1. Installed version detection (local/global) +2. Latest version checking via npm +3. Version comparison +4. Changelog fetching and extraction +5. Clean install warning display +6. User confirmation +7. Update execution +8. Cache clearing - - -- [ ] Installed version read correctly -- [ ] Latest version checked via npm -- [ ] Update skipped if already current -- [ ] Changelog fetched and displayed BEFORE update -- [ ] Clean install warning shown -- [ ] User confirmation obtained -- [ ] Update executed successfully -- [ ] Restart reminder shown - diff --git a/get-shit-done/workflows/add-phase.md b/get-shit-done/workflows/add-phase.md new file mode 100644 index 000000000..e5f404111 --- /dev/null +++ b/get-shit-done/workflows/add-phase.md @@ -0,0 +1,178 @@ + +Add a new integer phase to the end of the current milestone in the roadmap. Automatically calculates next phase number, creates phase directory, and updates roadmap structure. + + + +Read all files referenced by the invoking prompt's execution_context before starting. + + + + + +Parse the command arguments: +- All arguments become the phase description +- Example: `/gsd:add-phase Add authentication` → description = "Add authentication" +- Example: `/gsd:add-phase Fix critical performance issues` → description = "Fix critical performance issues" + +If no arguments provided: + +``` +ERROR: Phase description required +Usage: /gsd:add-phase +Example: /gsd:add-phase Add authentication system +``` + +Exit. + + + +Load the roadmap file: + +```bash +node ~/.claude/get-shit-done/bin/gsd-tools.js verify-path-exists .planning/ROADMAP.md --raw +``` + +If false: +``` +ERROR: No roadmap found (.planning/ROADMAP.md) +Run /gsd:new-project to initialize. +``` +Exit. + +Read roadmap content for parsing. + + + +Parse the roadmap to find the current milestone section: + +1. Locate the "## Current Milestone:" heading +2. Extract milestone name and version +3. Identify all phases under this milestone (before next "---" separator or next milestone heading) +4. Parse existing phase numbers (including decimals if present) + +Example structure: + +``` +## Current Milestone: v1.0 Foundation + +### Phase 4: Focused Command System +### Phase 5: Path Routing & Validation +### Phase 6: Documentation & Distribution +``` + + + +Find the highest integer phase number in the current milestone: + +1. Extract all phase numbers from phase headings (### Phase N:) +2. Filter to integer phases only (ignore decimals like 4.1, 4.2) +3. Find the maximum integer value +4. Add 1 to get the next phase number + +Example: If phases are 4, 5, 5.1, 6 → next is 7 + +Format as two-digit: `printf "%02d" $next_phase` + + + +Convert the phase description to a kebab-case slug: + +```bash +slug=$(node ~/.claude/get-shit-done/bin/gsd-tools.js generate-slug "$description" --raw) +``` + +Phase directory name: `{two-digit-phase}-{slug}` +Example: `07-add-authentication` + + + +Create the phase directory structure: + +```bash +phase_dir=".planning/phases/${phase_num}-${slug}" +mkdir -p "$phase_dir" +``` + +Confirm: "Created directory: $phase_dir" + + + +Add the new phase entry to the roadmap: + +1. Find the insertion point (after last phase in current milestone, before "---" separator) +2. Insert new phase heading: + + ``` + ### Phase {N}: {Description} + + **Goal:** [To be planned] + **Depends on:** Phase {N-1} + **Plans:** 0 plans + + Plans: + - [ ] TBD (run /gsd:plan-phase {N} to break down) + + **Details:** + [To be added during planning] + ``` + +3. Write updated roadmap back to file + +Preserve all other content exactly (formatting, spacing, other phases). + + + +Update STATE.md to reflect the new phase: + +1. Read `.planning/STATE.md` +2. Under "## Current Position" → "**Next Phase:**" add reference to new phase +3. Under "## Accumulated Context" → "### Roadmap Evolution" add entry: + ``` + - Phase {N} added: {description} + ``` + +If "Roadmap Evolution" section doesn't exist, create it. + + + +Present completion summary: + +``` +Phase {N} added to current milestone: +- Description: {description} +- Directory: .planning/phases/{phase-num}-{slug}/ +- Status: Not planned yet + +Roadmap updated: .planning/ROADMAP.md +Project state updated: .planning/STATE.md + +--- + +## ▶ Next Up + +**Phase {N}: {description}** + +`/gsd:plan-phase {N}` + +`/clear` first → fresh context window + +--- + +**Also available:** +- `/gsd:add-phase ` — add another phase +- Review roadmap + +--- +``` + + + + + +- [ ] Phase directory created: `.planning/phases/{NN}-{slug}/` +- [ ] Roadmap updated with new phase entry +- [ ] STATE.md updated with roadmap evolution note +- [ ] New phase appears at end of current milestone +- [ ] Next phase number calculated correctly (ignoring decimals) +- [ ] User informed of next steps + diff --git a/get-shit-done/workflows/check-todos.md b/get-shit-done/workflows/check-todos.md new file mode 100644 index 000000000..13c280e78 --- /dev/null +++ b/get-shit-done/workflows/check-todos.md @@ -0,0 +1,182 @@ + +List all pending todos, allow selection, load full context for the selected todo, and route to appropriate action. + + + +Read all files referenced by the invoking prompt's execution_context before starting. + + + + + +```bash +TODO_COUNT=$(node ~/.claude/get-shit-done/bin/gsd-tools.js list-todos --raw) +echo "Pending todos: $TODO_COUNT" +``` + +If count is 0: +``` +No pending todos. + +Todos are captured during work sessions with /gsd:add-todo. + +--- + +Would you like to: + +1. Continue with current phase (/gsd:progress) +2. Add a todo now (/gsd:add-todo) +``` + +Exit. + + + +Check for area filter in arguments: +- `/gsd:check-todos` → show all +- `/gsd:check-todos api` → filter to area:api only + + + +```bash +# Get todos JSON +node ~/.claude/get-shit-done/bin/gsd-tools.js list-todos [area] +``` + +Parse JSON output and display as numbered list: + +``` +Pending Todos: + +1. Add auth token refresh (api, 2d ago) +2. Fix modal z-index issue (ui, 1d ago) +3. Refactor database connection pool (database, 5h ago) + +--- + +Reply with a number to view details, or: +- `/gsd:check-todos [area]` to filter by area +- `q` to exit +``` + +Format age as relative time from created timestamp. + + + +Wait for user to reply with a number. + +If valid: load selected todo, proceed. +If invalid: "Invalid selection. Reply with a number (1-[N]) or `q` to exit." + + + +Read the todo file completely. Display: + +``` +## [title] + +**Area:** [area] +**Created:** [date] ([relative time] ago) +**Files:** [list or "None"] + +### Problem +[problem section content] + +### Solution +[solution section content] +``` + +If `files` field has entries, read and briefly summarize each. + + + +```bash +node ~/.claude/get-shit-done/bin/gsd-tools.js verify-path-exists .planning/ROADMAP.md --raw +``` + +If roadmap exists: +1. Check if todo's area matches an upcoming phase +2. Check if todo's files overlap with a phase's scope +3. Note any match for action options + + + +**If todo maps to a roadmap phase:** + +Use AskUserQuestion: +- header: "Action" +- question: "This todo relates to Phase [N]: [name]. What would you like to do?" +- options: + - "Work on it now" — move to done, start working + - "Add to phase plan" — include when planning Phase [N] + - "Brainstorm approach" — think through before deciding + - "Put it back" — return to list + +**If no roadmap match:** + +Use AskUserQuestion: +- header: "Action" +- question: "What would you like to do with this todo?" +- options: + - "Work on it now" — move to done, start working + - "Create a phase" — /gsd:add-phase with this scope + - "Brainstorm approach" — think through before deciding + - "Put it back" — return to list + + + +**Work on it now:** +```bash +mv ".planning/todos/pending/[filename]" ".planning/todos/done/" +``` +Update STATE.md todo count. Present problem/solution context. Begin work or ask how to proceed. + +**Add to phase plan:** +Note todo reference in phase planning notes. Keep in pending. Return to list or exit. + +**Create a phase:** +Display: `/gsd:add-phase [description from todo]` +Keep in pending. User runs command in fresh context. + +**Brainstorm approach:** +Keep in pending. Start discussion about problem and approaches. + +**Put it back:** +Return to list_todos step. + + + +After any action that changes todo count: + +```bash +node ~/.claude/get-shit-done/bin/gsd-tools.js list-todos --raw +``` + +Update STATE.md "### Pending Todos" section if exists. + + + +If todo was moved to done/, commit the change: + +```bash +git rm --cached .planning/todos/pending/[filename] 2>/dev/null || true +node ~/.claude/get-shit-done/bin/gsd-tools.js commit "docs: start work on todo - [title]" --files .planning/todos/done/[filename] .planning/STATE.md +``` + +Tool respects `commit_docs` config and gitignore automatically. + +Confirm: "Committed: docs: start work on todo - [title]" + + + + + +- [ ] All pending todos listed with title, area, age +- [ ] Area filter applied if specified +- [ ] Selected todo's full context loaded +- [ ] Roadmap context checked for phase match +- [ ] Appropriate actions offered +- [ ] Selected action executed +- [ ] STATE.md updated if todo count changed +- [ ] Changes committed to git (if todo moved to done/) + diff --git a/get-shit-done/workflows/update.md b/get-shit-done/workflows/update.md new file mode 100644 index 000000000..10d4d1dfd --- /dev/null +++ b/get-shit-done/workflows/update.md @@ -0,0 +1,197 @@ + +Check for GSD updates via npm, display changelog for versions between installed and latest, obtain user confirmation, and execute clean installation with cache clearing. + + + +Read all files referenced by the invoking prompt's execution_context before starting. + + + + + +Detect whether GSD is installed locally or globally by checking both locations: + +```bash +# Check local first (takes priority) +if [ -f "./.claude/get-shit-done/VERSION" ]; then + cat "./.claude/get-shit-done/VERSION" + echo "LOCAL" +elif [ -f ~/.claude/get-shit-done/VERSION ]; then + cat ~/.claude/get-shit-done/VERSION + echo "GLOBAL" +else + echo "UNKNOWN" +fi +``` + +Parse output: +- If last line is "LOCAL": installed version is first line, use `--local` flag for update +- If last line is "GLOBAL": installed version is first line, use `--global` flag for update +- If "UNKNOWN": proceed to install step (treat as version 0.0.0) + +**If VERSION file missing:** +``` +## GSD Update + +**Installed version:** Unknown + +Your installation doesn't include version tracking. + +Running fresh install... +``` + +Proceed to install step (treat as version 0.0.0 for comparison). + + + +Check npm for latest version: + +```bash +npm view get-shit-done-cc version 2>/dev/null +``` + +**If npm check fails:** +``` +Couldn't check for updates (offline or npm unavailable). + +To update manually: `npx get-shit-done-cc --global` +``` + +Exit. + + + +Compare installed vs latest: + +**If installed == latest:** +``` +## GSD Update + +**Installed:** X.Y.Z +**Latest:** X.Y.Z + +You're already on the latest version. +``` + +Exit. + +**If installed > latest:** +``` +## GSD Update + +**Installed:** X.Y.Z +**Latest:** A.B.C + +You're ahead of the latest release (development version?). +``` + +Exit. + + + +**If update available**, fetch and show what's new BEFORE updating: + +1. Fetch changelog from GitHub raw URL +2. Extract entries between installed and latest versions +3. Display preview and ask for confirmation: + +``` +## GSD Update Available + +**Installed:** 1.5.10 +**Latest:** 1.5.15 + +### What's New +──────────────────────────────────────────────────────────── + +## [1.5.15] - 2026-01-20 + +### Added +- Feature X + +## [1.5.14] - 2026-01-18 + +### Fixed +- Bug fix Y + +──────────────────────────────────────────────────────────── + +⚠️ **Note:** The installer performs a clean install of GSD folders: +- `commands/gsd/` will be wiped and replaced +- `get-shit-done/` will be wiped and replaced +- `agents/gsd-*` files will be replaced + +(Paths are relative to your install location: `~/.claude/` for global, `./.claude/` for local) + +Your custom files in other locations are preserved: +- Custom commands not in `commands/gsd/` ✓ +- Custom agents not prefixed with `gsd-` ✓ +- Custom hooks ✓ +- Your CLAUDE.md files ✓ + +If you've modified any GSD files directly, back them up first. +``` + +Use AskUserQuestion: +- Question: "Proceed with update?" +- Options: + - "Yes, update now" + - "No, cancel" + +**If user cancels:** Exit. + + + +Run the update using the install type detected in step 1: + +**If LOCAL install:** +```bash +npx get-shit-done-cc --local +``` + +**If GLOBAL install (or unknown):** +```bash +npx get-shit-done-cc --global +``` + +Capture output. If install fails, show error and exit. + +Clear the update cache so statusline indicator disappears: + +**If LOCAL install:** +```bash +rm -f ./.claude/cache/gsd-update-check.json +``` + +**If GLOBAL install:** +```bash +rm -f ~/.claude/cache/gsd-update-check.json +``` + + + +Format completion message (changelog was already shown in confirmation step): + +``` +╔═══════════════════════════════════════════════════════════╗ +║ GSD Updated: v1.5.10 → v1.5.15 ║ +╚═══════════════════════════════════════════════════════════╝ + +⚠️ Restart Claude Code to pick up the new commands. + +[View full changelog](https://github.com/glittercowboy/get-shit-done/blob/main/CHANGELOG.md) +``` + + + + + +- [ ] Installed version read correctly +- [ ] Latest version checked via npm +- [ ] Update skipped if already current +- [ ] Changelog fetched and displayed BEFORE update +- [ ] Clean install warning shown +- [ ] User confirmation obtained +- [ ] Update executed successfully +- [ ] Restart reminder shown +