get-shit-done-cc 1.9.13 → 1.10.0-experimental.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/agents/design-specialist.md +222 -0
- package/agents/gsd-executor.md +37 -375
- package/agents/gsd-planner.md +15 -108
- package/bin/install.js +92 -5
- package/commands/gsd/autopilot.md +518 -0
- package/commands/gsd/checkpoints.md +229 -0
- package/commands/gsd/design-system.md +70 -0
- package/commands/gsd/discuss-design.md +77 -0
- package/commands/gsd/extend.md +80 -0
- package/commands/gsd/help.md +43 -0
- package/commands/gsd/new-project.md +94 -8
- package/commands/gsd/plan-phase.md +35 -5
- package/get-shit-done/references/ccr-integration.md +468 -0
- package/get-shit-done/references/checkpoint-execution.md +369 -0
- package/get-shit-done/references/checkpoint-types.md +728 -0
- package/get-shit-done/references/deviation-rules.md +215 -0
- package/get-shit-done/references/framework-patterns.md +543 -0
- package/get-shit-done/references/ui-principles.md +258 -0
- package/get-shit-done/references/verification-patterns.md +1 -1
- package/get-shit-done/skills/gsd-extend/SKILL.md +154 -0
- package/get-shit-done/skills/gsd-extend/references/agent-structure.md +305 -0
- package/get-shit-done/skills/gsd-extend/references/extension-anatomy.md +123 -0
- package/get-shit-done/skills/gsd-extend/references/reference-structure.md +408 -0
- package/get-shit-done/skills/gsd-extend/references/template-structure.md +370 -0
- package/get-shit-done/skills/gsd-extend/references/validation-rules.md +140 -0
- package/get-shit-done/skills/gsd-extend/references/workflow-structure.md +253 -0
- package/get-shit-done/skills/gsd-extend/templates/agent-template.md +234 -0
- package/get-shit-done/skills/gsd-extend/templates/reference-template.md +239 -0
- package/get-shit-done/skills/gsd-extend/templates/workflow-template.md +169 -0
- package/get-shit-done/skills/gsd-extend/workflows/create-approach.md +332 -0
- package/get-shit-done/skills/gsd-extend/workflows/list-extensions.md +133 -0
- package/get-shit-done/skills/gsd-extend/workflows/remove-extension.md +93 -0
- package/get-shit-done/skills/gsd-extend/workflows/validate-extension.md +184 -0
- package/get-shit-done/templates/autopilot-script-simple.sh +181 -0
- package/get-shit-done/templates/autopilot-script.sh +1142 -0
- package/get-shit-done/templates/autopilot-script.sh.backup +1142 -0
- package/get-shit-done/templates/design-system.md +238 -0
- package/get-shit-done/templates/phase-design.md +205 -0
- package/get-shit-done/templates/phase-models-template.json +71 -0
- package/get-shit-done/templates/phase-prompt.md +4 -4
- package/get-shit-done/templates/state.md +37 -0
- package/get-shit-done/tui/App.tsx +169 -0
- package/get-shit-done/tui/README.md +107 -0
- package/get-shit-done/tui/build.js +37 -0
- package/get-shit-done/tui/components/ActivityFeed.tsx +126 -0
- package/get-shit-done/tui/components/PhaseCard.tsx +86 -0
- package/get-shit-done/tui/components/StatsBar.tsx +147 -0
- package/get-shit-done/tui/dist/index.js +387 -0
- package/get-shit-done/tui/index.tsx +12 -0
- package/get-shit-done/tui/package-lock.json +1074 -0
- package/get-shit-done/tui/package.json +22 -0
- package/get-shit-done/tui/utils/pipeReader.ts +129 -0
- package/get-shit-done/workflows/design-system.md +245 -0
- package/get-shit-done/workflows/discuss-design.md +330 -0
- package/get-shit-done/workflows/execute-phase.md +44 -1
- package/get-shit-done/workflows/execute-plan-auth.md +122 -0
- package/get-shit-done/workflows/execute-plan-checkpoints.md +541 -0
- package/get-shit-done/workflows/execute-plan.md +34 -856
- package/package.json +8 -3
package/bin/install.js
CHANGED
|
@@ -616,7 +616,7 @@ function uninstall(isGlobal, runtime = 'claude') {
|
|
|
616
616
|
// 4. Remove GSD hooks
|
|
617
617
|
const hooksDir = path.join(targetDir, 'hooks');
|
|
618
618
|
if (fs.existsSync(hooksDir)) {
|
|
619
|
-
const gsdHooks = ['gsd-statusline.js', 'gsd-check-update.js', 'gsd-check-update.sh'];
|
|
619
|
+
const gsdHooks = ['gsd-statusline.js', 'gsd-check-update.js', 'gsd-check-update.sh', 'gsd-activity.sh'];
|
|
620
620
|
let hookCount = 0;
|
|
621
621
|
for (const hook of gsdHooks) {
|
|
622
622
|
const hookPath = path.join(hooksDir, hook);
|
|
@@ -660,18 +660,42 @@ function uninstall(isGlobal, runtime = 'claude') {
|
|
|
660
660
|
});
|
|
661
661
|
if (settings.hooks.SessionStart.length < before) {
|
|
662
662
|
settingsModified = true;
|
|
663
|
-
console.log(` ${green}✓${reset} Removed GSD hooks from settings`);
|
|
663
|
+
console.log(` ${green}✓${reset} Removed GSD SessionStart hooks from settings`);
|
|
664
664
|
}
|
|
665
665
|
// Clean up empty array
|
|
666
666
|
if (settings.hooks.SessionStart.length === 0) {
|
|
667
667
|
delete settings.hooks.SessionStart;
|
|
668
668
|
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
// Remove GSD activity hook from PostToolUse
|
|
672
|
+
if (settings.hooks && settings.hooks.PostToolUse) {
|
|
673
|
+
const before = settings.hooks.PostToolUse.length;
|
|
674
|
+
settings.hooks.PostToolUse = settings.hooks.PostToolUse.filter(entry => {
|
|
675
|
+
if (entry.hooks && Array.isArray(entry.hooks)) {
|
|
676
|
+
// Filter out GSD hooks
|
|
677
|
+
const hasGsdHook = entry.hooks.some(h =>
|
|
678
|
+
h.command && h.command.includes('gsd-activity')
|
|
679
|
+
);
|
|
680
|
+
return !hasGsdHook;
|
|
681
|
+
}
|
|
682
|
+
return true;
|
|
683
|
+
});
|
|
684
|
+
if (settings.hooks.PostToolUse.length < before) {
|
|
685
|
+
settingsModified = true;
|
|
686
|
+
console.log(` ${green}✓${reset} Removed GSD PostToolUse hooks from settings`);
|
|
687
|
+
}
|
|
688
|
+
// Clean up empty array
|
|
689
|
+
if (settings.hooks.PostToolUse.length === 0) {
|
|
690
|
+
delete settings.hooks.PostToolUse;
|
|
672
691
|
}
|
|
673
692
|
}
|
|
674
693
|
|
|
694
|
+
// Clean up empty hooks object
|
|
695
|
+
if (settings.hooks && Object.keys(settings.hooks).length === 0) {
|
|
696
|
+
delete settings.hooks;
|
|
697
|
+
}
|
|
698
|
+
|
|
675
699
|
if (settingsModified) {
|
|
676
700
|
writeSettings(settingsPath, settings);
|
|
677
701
|
removedCount++;
|
|
@@ -981,6 +1005,22 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
981
1005
|
}
|
|
982
1006
|
}
|
|
983
1007
|
|
|
1008
|
+
// Copy GSD activity hook for autopilot real-time display
|
|
1009
|
+
const activityHookSrc = path.join(src, 'hooks', 'gsd-activity.sh');
|
|
1010
|
+
if (fs.existsSync(activityHookSrc)) {
|
|
1011
|
+
const hooksDest = path.join(targetDir, 'hooks');
|
|
1012
|
+
fs.mkdirSync(hooksDest, { recursive: true });
|
|
1013
|
+
const activityHookDest = path.join(hooksDest, 'gsd-activity.sh');
|
|
1014
|
+
fs.copyFileSync(activityHookSrc, activityHookDest);
|
|
1015
|
+
// Make executable on Unix systems
|
|
1016
|
+
try {
|
|
1017
|
+
fs.chmodSync(activityHookDest, 0o755);
|
|
1018
|
+
} catch (e) {
|
|
1019
|
+
// Windows doesn't support chmod
|
|
1020
|
+
}
|
|
1021
|
+
console.log(` ${green}✓${reset} Installed gsd-activity.sh hook`);
|
|
1022
|
+
}
|
|
1023
|
+
|
|
984
1024
|
// If critical components failed, exit with error
|
|
985
1025
|
if (failures.length > 0) {
|
|
986
1026
|
console.error(`\n ${yellow}Installation incomplete!${reset} Failed: ${failures.join(', ')}`);
|
|
@@ -1023,6 +1063,53 @@ function install(isGlobal, runtime = 'claude') {
|
|
|
1023
1063
|
});
|
|
1024
1064
|
console.log(` ${green}✓${reset} Configured update check hook`);
|
|
1025
1065
|
}
|
|
1066
|
+
|
|
1067
|
+
// Configure PostToolUse hook for autopilot activity display
|
|
1068
|
+
if (!settings.hooks.PostToolUse) {
|
|
1069
|
+
settings.hooks.PostToolUse = [];
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
// Build activity hook command path
|
|
1073
|
+
const activityHookCommand = isGlobal
|
|
1074
|
+
? `bash "${targetDir.replace(/\\/g, '/')}/hooks/gsd-activity.sh"`
|
|
1075
|
+
: `bash ${dirName}/hooks/gsd-activity.sh`;
|
|
1076
|
+
|
|
1077
|
+
// Check if GSD activity hook already exists (handles both old and new format)
|
|
1078
|
+
let hasGsdActivityHook = false;
|
|
1079
|
+
|
|
1080
|
+
// Remove old-format GSD activity hooks if present
|
|
1081
|
+
const beforeCount = settings.hooks.PostToolUse.length;
|
|
1082
|
+
settings.hooks.PostToolUse = settings.hooks.PostToolUse.filter(entry => {
|
|
1083
|
+
// Check if this is a new-format GSD hook (with hooks array)
|
|
1084
|
+
if (entry.hooks && Array.isArray(entry.hooks)) {
|
|
1085
|
+
const isGsdHook = entry.hooks.some(h => h.command && h.command.includes('gsd-activity'));
|
|
1086
|
+
if (isGsdHook) {
|
|
1087
|
+
hasGsdActivityHook = true;
|
|
1088
|
+
return true; // Keep new-format hooks
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
// Check if this is an old-format GSD hook (with direct command field)
|
|
1092
|
+
const isOldGsdHook = entry.command && entry.command.includes('gsd-activity');
|
|
1093
|
+
if (isOldGsdHook) {
|
|
1094
|
+
return false; // Remove old-format hooks
|
|
1095
|
+
}
|
|
1096
|
+
// Keep non-GSD hooks
|
|
1097
|
+
return true;
|
|
1098
|
+
});
|
|
1099
|
+
|
|
1100
|
+
// Add new-format hook if not found
|
|
1101
|
+
if (!hasGsdActivityHook) {
|
|
1102
|
+
settings.hooks.PostToolUse.push({
|
|
1103
|
+
matcher: "Task|Write|Edit|Read|Bash|TodoWrite",
|
|
1104
|
+
hooks: [
|
|
1105
|
+
{
|
|
1106
|
+
type: "command",
|
|
1107
|
+
command: activityHookCommand
|
|
1108
|
+
}
|
|
1109
|
+
]
|
|
1110
|
+
});
|
|
1111
|
+
console.log(` ${green}✓${reset} Configured autopilot activity hook`);
|
|
1112
|
+
}
|
|
1026
1113
|
}
|
|
1027
1114
|
|
|
1028
1115
|
return { settingsPath, settings, statuslineCommand, runtime };
|
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gsd:autopilot
|
|
3
|
+
description: Fully automated milestone execution from existing roadmap
|
|
4
|
+
argument-hint: "[--from-phase N] [--dry-run] [--background] [--model file.json]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- AskUserQuestion
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<objective>
|
|
16
|
+
Generate and run a shell script that autonomously executes all remaining phases in the current milestone.
|
|
17
|
+
|
|
18
|
+
Each phase: plan → execute → verify → handle gaps → next phase.
|
|
19
|
+
|
|
20
|
+
The shell script outer loop provides infinite context (each `claude -p` gets fresh 200k). State persists in `.planning/` enabling resume after interruption.
|
|
21
|
+
|
|
22
|
+
**Requires:** `.planning/ROADMAP.md` (run `/gsd:new-project` first)
|
|
23
|
+
</objective>
|
|
24
|
+
|
|
25
|
+
<execution_context>
|
|
26
|
+
@~/.claude/get-shit-done/references/ui-brand.md
|
|
27
|
+
@~/.claude/get-shit-done/templates/autopilot-script.sh
|
|
28
|
+
</execution_context>
|
|
29
|
+
|
|
30
|
+
<context>
|
|
31
|
+
Arguments: $ARGUMENTS
|
|
32
|
+
|
|
33
|
+
**Flags:**
|
|
34
|
+
- `--from-phase N` — Start from specific phase (default: first incomplete)
|
|
35
|
+
- `--dry-run` — Generate script but don't run it
|
|
36
|
+
- `--background` — Run detached with nohup (default: attached with streaming output)
|
|
37
|
+
- `--model file.json` — Use custom phase models config (default: .planning/phase-models.json)
|
|
38
|
+
</context>
|
|
39
|
+
|
|
40
|
+
**Model Configuration:**
|
|
41
|
+
|
|
42
|
+
The autopilot supports per-phase model selection via CCR (Claude Code Router). When CCR is detected:
|
|
43
|
+
1. Creates `.planning/phase-models.json` from template (first run)
|
|
44
|
+
2. Allows custom model per phase for different task types
|
|
45
|
+
3. Falls back to native `claude` command if CCR unavailable
|
|
46
|
+
|
|
47
|
+
Example configuration structure:
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"default_model": "claude-3-5-sonnet-latest",
|
|
51
|
+
"phases": {
|
|
52
|
+
"1": { "model": "claude-3-5-sonnet-latest" },
|
|
53
|
+
"2": { "model": "claude-3-5-opus-latest" },
|
|
54
|
+
"gaps": { "model": "claude-3-5-sonnet-latest" }
|
|
55
|
+
},
|
|
56
|
+
"provider_routing": {
|
|
57
|
+
"claude-3-5-sonnet-latest": {
|
|
58
|
+
"provider": "anthropic",
|
|
59
|
+
"base_url": "https://api.anthropic.com"
|
|
60
|
+
},
|
|
61
|
+
"glm-4.7": {
|
|
62
|
+
"provider": "z-ai",
|
|
63
|
+
"base_url": "https://open.bigmodel.cn/api/paas/v4/"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Benefits:**
|
|
70
|
+
- Use expensive models (Opus) only for complex phases
|
|
71
|
+
- Use GLM-4.7 for cost-effective routine tasks
|
|
72
|
+
- Mix providers (Anthropic + OpenAI + Z-AI) for optimization
|
|
73
|
+
- Per-phase routing matches task complexity to model capability
|
|
74
|
+
|
|
75
|
+
**New: Beautiful Ink TUI**
|
|
76
|
+
|
|
77
|
+
The autopilot now includes a stunning React/Ink-based terminal UI that provides:
|
|
78
|
+
|
|
79
|
+
- **Rich visual components** with proper layouts, borders, and spacing
|
|
80
|
+
- **Real-time phase progress** with completion tracking
|
|
81
|
+
- **Live activity feed** with emoji indicators and color coding
|
|
82
|
+
- **Cost and time statistics** with visual progress bars
|
|
83
|
+
- **Smooth animations** and transitions
|
|
84
|
+
- **Professional terminal graphics** using modern Ink components
|
|
85
|
+
|
|
86
|
+
**Requirements:** Node.js 16+ for the Ink TUI. Falls back to bash TUI if unavailable.
|
|
87
|
+
|
|
88
|
+
**Auto-detection:** The autopilot automatically detects and uses the Ink TUI if:
|
|
89
|
+
1. Node.js is installed
|
|
90
|
+
2. The TUI package is available (installed with GSD)
|
|
91
|
+
|
|
92
|
+
Otherwise, it gracefully falls back to the classic bash display.
|
|
93
|
+
|
|
94
|
+
## Example TUI Layout
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
╔═══════════════════════════════════════════════════════════════╗
|
|
98
|
+
║ ██████╗ ███████╗██████╗ ║
|
|
99
|
+
║ ██╔════╝ ██╔════╝██╔══██╗ ║
|
|
100
|
+
║ ██║ ███╗███████╗██║ ██║ ║
|
|
101
|
+
║ ██║ ██║╚════██║██║ ██║ ║
|
|
102
|
+
║ ╚██████╔╝███████║██████╔╝ ║
|
|
103
|
+
║ ╚═════╝ ╚══════╝╚═════╝ ║
|
|
104
|
+
║ ║
|
|
105
|
+
║ GET SHIT DONE - AUTOPILOT ║
|
|
106
|
+
╚═══════════════════════════════════════════════════════════════╝
|
|
107
|
+
|
|
108
|
+
┌─────────────────────────────────┬─────────────────────────────────┐
|
|
109
|
+
│ ┌─────────────────────────────┐ │ ┌─────────────────────────────┐ │
|
|
110
|
+
│ │ PHASE 1: Project Setup │ │ │ Activity Feed │ │
|
|
111
|
+
│ │ │ │ │ │ │
|
|
112
|
+
│ │ Progress ████████░░░░░ 50% │ │ │ [14:32:15] 🔧 BUILDING: │ │
|
|
113
|
+
│ │ │ │ │ src/components/App.tsx │ │
|
|
114
|
+
│ │ Stages │ │ │ │ │
|
|
115
|
+
│ │ ✓ RESEARCH 2m │ │ [14:32:01] ✓ COMMIT: │ │
|
|
116
|
+
│ │ ✓ PLANNING 1m │ │ Initial commit │ │
|
|
117
|
+
│ │ ○ BUILDING active│ │ │ │
|
|
118
|
+
│ └─────────────────────────────┘ │ └─────────────────────────────┘ │
|
|
119
|
+
└─────────────────────────────────┴─────────────────────────────────┘
|
|
120
|
+
|
|
121
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
122
|
+
│ 📊 Execution Stats Elapsed: 5m 23s │
|
|
123
|
+
│ Phases ██████████████░░░░░░░░░░░░░░░░░░░ 2/5 │
|
|
124
|
+
│ Time 5m 23s (remaining: ~13m) │
|
|
125
|
+
│ Tokens: 45,230 Cost: $0.68 │
|
|
126
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
127
|
+
```
|
|
128
|
+
</context>
|
|
129
|
+
|
|
130
|
+
<process>
|
|
131
|
+
|
|
132
|
+
## 1. Validate Prerequisites
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Check roadmap exists
|
|
136
|
+
if [ ! -f .planning/ROADMAP.md ]; then
|
|
137
|
+
echo "ERROR: No roadmap found. Run /gsd:new-project first."
|
|
138
|
+
exit 1
|
|
139
|
+
fi
|
|
140
|
+
|
|
141
|
+
# Check not already running
|
|
142
|
+
if [ -f .planning/autopilot.lock ]; then
|
|
143
|
+
PID=$(cat .planning/autopilot.lock)
|
|
144
|
+
if ps -p $PID > /dev/null 2>&1; then
|
|
145
|
+
echo "ERROR: Autopilot already running (PID: $PID)"
|
|
146
|
+
echo "To force restart: rm .planning/autopilot.lock"
|
|
147
|
+
exit 1
|
|
148
|
+
fi
|
|
149
|
+
fi
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## 2. Parse Roadmap State
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# Get incomplete phases
|
|
156
|
+
INCOMPLETE=$(grep -E "^- \[ \] \*\*Phase" .planning/ROADMAP.md | sed 's/.*Phase \([0-9.]*\).*/\1/' | tr '\n' ' ')
|
|
157
|
+
|
|
158
|
+
# Get completed phases
|
|
159
|
+
COMPLETED=$(grep -E "^- \[x\] \*\*Phase" .planning/ROADMAP.md | sed 's/.*Phase \([0-9.]*\).*/\1/' | tr '\n' ' ')
|
|
160
|
+
|
|
161
|
+
# Check autopilot state for resume
|
|
162
|
+
if [ -f .planning/STATE.md ]; then
|
|
163
|
+
AUTOPILOT_STATUS=$(grep "^- \*\*Mode:\*\*" .planning/STATE.md | sed 's/.*: //')
|
|
164
|
+
LAST_PHASE=$(grep "^- \*\*Current Phase:\*\*" .planning/STATE.md | sed 's/.*: //')
|
|
165
|
+
fi
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**If no incomplete phases:** Report milestone already complete, offer `/gsd:complete-milestone`.
|
|
169
|
+
|
|
170
|
+
**If `--from-phase N` specified:** Validate phase exists, use as start point.
|
|
171
|
+
|
|
172
|
+
**If autopilot was interrupted (Mode: running):** Auto-resume from last phase.
|
|
173
|
+
|
|
174
|
+
## 3. Load Config
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Read config values
|
|
178
|
+
CHECKPOINT_MODE=$(cat .planning/config.json 2>/dev/null | grep -o '"checkpoint_mode"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "queue")
|
|
179
|
+
MAX_RETRIES=$(cat .planning/config.json 2>/dev/null | grep -o '"max_retries"[[:space:]]*:[[:space:]]*[0-9]*' | grep -o '[0-9]*$' || echo "3")
|
|
180
|
+
BUDGET_LIMIT=$(cat .planning/config.json 2>/dev/null | grep -o '"budget_limit_usd"[[:space:]]*:[[:space:]]*[0-9.]*' | grep -o '[0-9.]*$' || echo "0")
|
|
181
|
+
WEBHOOK_URL=$(cat .planning/config.json 2>/dev/null | grep -o '"notify_webhook"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "")
|
|
182
|
+
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**Check for CCR availability:**
|
|
186
|
+
```bash
|
|
187
|
+
if command -v ccr &> /dev/null; then
|
|
188
|
+
CCR_AVAILABLE=true
|
|
189
|
+
if [ ! -f .planning/phase-models.json ]; then
|
|
190
|
+
# Copy template
|
|
191
|
+
cp ~/.claude/get-shit-done/templates/phase-models-template.json .planning/phase-models.json
|
|
192
|
+
echo "Created .planning/phase-models.json from template"
|
|
193
|
+
fi
|
|
194
|
+
else
|
|
195
|
+
CCR_AVAILABLE=false
|
|
196
|
+
fi
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Load model configuration:**
|
|
200
|
+
```bash
|
|
201
|
+
if [ "$CCR_AVAILABLE" = true ] && [ -f .planning/phase-models.json ]; then
|
|
202
|
+
PHASE_MODELS_CONFIG=".planning/phase-models.json"
|
|
203
|
+
else
|
|
204
|
+
PHASE_MODELS_CONFIG=""
|
|
205
|
+
fi
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## 4. Present Execution Plan
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
212
|
+
GSD ► AUTOPILOT
|
|
213
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
214
|
+
|
|
215
|
+
**Milestone:** [from ROADMAP.md]
|
|
216
|
+
|
|
217
|
+
| Status | Phases |
|
|
218
|
+
|--------|--------|
|
|
219
|
+
| ✓ Complete | {completed_phases} |
|
|
220
|
+
| ○ Remaining | {incomplete_phases} |
|
|
221
|
+
|
|
222
|
+
**Settings:**
|
|
223
|
+
- Checkpoint mode: {queue|skip}
|
|
224
|
+
- Max retries: {N}
|
|
225
|
+
- Budget limit: ${N} (0 = unlimited)
|
|
226
|
+
- Notifications: {webhook|bell|none}
|
|
227
|
+
- Model Routing: {CCR|native claude}
|
|
228
|
+
|
|
229
|
+
───────────────────────────────────────────────────────────────
|
|
230
|
+
|
|
231
|
+
**Model Configuration:**
|
|
232
|
+
{if CCR_AVAILABLE}
|
|
233
|
+
Available models from .planning/phase-models.json:
|
|
234
|
+
- Default: {default_model}
|
|
235
|
+
- Per-phase routing: enabled
|
|
236
|
+
{/if}
|
|
237
|
+
{if !CCR_AVAILABLE}
|
|
238
|
+
Using native claude command (CCR not detected)
|
|
239
|
+
{/if}
|
|
240
|
+
|
|
241
|
+
───────────────────────────────────────────────────────────────
|
|
242
|
+
|
|
243
|
+
**Execution Plan:**
|
|
244
|
+
|
|
245
|
+
For each remaining phase:
|
|
246
|
+
1. Load model config for phase
|
|
247
|
+
2. Plan phase (if no plans exist)
|
|
248
|
+
3. Execute phase (parallel waves)
|
|
249
|
+
4. Verify phase goal
|
|
250
|
+
5. If gaps found → plan gaps → execute gaps → re-verify
|
|
251
|
+
6. Move to next phase
|
|
252
|
+
|
|
253
|
+
Checkpoints queued to: `.planning/checkpoints/pending/`
|
|
254
|
+
|
|
255
|
+
───────────────────────────────────────────────────────────────
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## 5. Generate Script
|
|
259
|
+
|
|
260
|
+
Read template from `@~/.claude/get-shit-done/templates/autopilot-script.sh` and fill:
|
|
261
|
+
- `{{project_dir}}` — Current directory (absolute path)
|
|
262
|
+
- `{{project_name}}` — From PROJECT.md
|
|
263
|
+
- `{{phases}}` — Array of incomplete phase numbers
|
|
264
|
+
- `{{checkpoint_mode}}` — queue or skip
|
|
265
|
+
- `{{max_retries}}` — From config
|
|
266
|
+
- `{{budget_limit}}` — From config (0 = unlimited)
|
|
267
|
+
- `{{webhook_url}}` — From config (empty = disabled)
|
|
268
|
+
- `{{model_profile}}` — From config
|
|
269
|
+
- `{{timestamp}}` — Current datetime
|
|
270
|
+
|
|
271
|
+
Write to `.planning/autopilot.sh`:
|
|
272
|
+
```bash
|
|
273
|
+
mkdir -p .planning/logs .planning/checkpoints/pending .planning/checkpoints/approved
|
|
274
|
+
chmod +x .planning/autopilot.sh
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**Ensure gitignore entries exist** (autopilot transient files should not be committed):
|
|
278
|
+
```bash
|
|
279
|
+
# Add to .gitignore if not already present
|
|
280
|
+
GITIGNORE_ENTRIES="
|
|
281
|
+
# GSD autopilot (transient files)
|
|
282
|
+
.planning/autopilot.sh
|
|
283
|
+
.planning/autopilot.lock
|
|
284
|
+
.planning/logs/
|
|
285
|
+
.planning/checkpoints/
|
|
286
|
+
.planning/phase-models.json
|
|
287
|
+
"
|
|
288
|
+
|
|
289
|
+
if [ -f .gitignore ]; then
|
|
290
|
+
if ! grep -q "GSD autopilot" .gitignore; then
|
|
291
|
+
echo "$GITIGNORE_ENTRIES" >> .gitignore
|
|
292
|
+
fi
|
|
293
|
+
else
|
|
294
|
+
echo "$GITIGNORE_ENTRIES" > .gitignore
|
|
295
|
+
fi
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
**Copy phase models template:**
|
|
299
|
+
```bash
|
|
300
|
+
if [ -n "$PHASE_MODELS_CONFIG" ] && [ ! -f ".planning/phase-models.json" ]; then
|
|
301
|
+
cp ~/.claude/get-shit-done/templates/phase-models-template.json \
|
|
302
|
+
.planning/phase-models.json
|
|
303
|
+
echo "Created .planning/phase-models.json from template"
|
|
304
|
+
echo "Edit this file to customize per-phase model selection"
|
|
305
|
+
fi
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**Update gitignore for phase models:**
|
|
309
|
+
```bash
|
|
310
|
+
if ! grep -q "phase-models.json" .gitignore; then
|
|
311
|
+
echo ".planning/phase-models.json" >> .gitignore
|
|
312
|
+
fi
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## 6. Present Run Instructions
|
|
316
|
+
|
|
317
|
+
**IMPORTANT:** The autopilot script must run **outside** of Claude Code in a separate terminal. Claude Code's Bash tool has a 10-minute timeout which would interrupt long-running execution.
|
|
318
|
+
|
|
319
|
+
Present the following:
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
323
|
+
GSD ► AUTOPILOT READY
|
|
324
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
325
|
+
|
|
326
|
+
Script generated: .planning/autopilot.sh
|
|
327
|
+
Model config: {if CCR_AVAILABLE}.planning/phase-models.json{else}CCR not detected - using default model{endif}
|
|
328
|
+
|
|
329
|
+
───────────────────────────────────────────────────────────────
|
|
330
|
+
|
|
331
|
+
## Run in a separate terminal
|
|
332
|
+
|
|
333
|
+
**Attached (recommended — see output live):**
|
|
334
|
+
```
|
|
335
|
+
cd {project_dir} && bash .planning/autopilot.sh
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
**Background (for overnight runs):**
|
|
339
|
+
```
|
|
340
|
+
cd {project_dir} && nohup bash .planning/autopilot.sh > .planning/logs/autopilot.log 2>&1 &
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
**With CCR model routing:**
|
|
344
|
+
```
|
|
345
|
+
cd {project_dir} && ccr code --model {default_model} -- bash .planning/autopilot.sh
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**Monitor logs:**
|
|
349
|
+
```
|
|
350
|
+
tail -f .planning/logs/autopilot.log
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
───────────────────────────────────────────────────────────────
|
|
354
|
+
|
|
355
|
+
**Model Selection:**
|
|
356
|
+
- Phase models configured in .planning/phase-models.json
|
|
357
|
+
- CCR detected: {if CCR_AVAILABLE}Yes - using per-phase routing{else}No - using native claude{endif}
|
|
358
|
+
- Edit phase-models.json to customize models per phase
|
|
359
|
+
|
|
360
|
+
**Why a separate terminal?**
|
|
361
|
+
Claude Code's Bash tool has a 10-minute timeout. Autopilot runs for
|
|
362
|
+
hours across multiple phases — it needs to run independently.
|
|
363
|
+
|
|
364
|
+
**Resume after interruption:**
|
|
365
|
+
Just run the script again. It detects completed phases and continues.
|
|
366
|
+
|
|
367
|
+
**Check on checkpoints:**
|
|
368
|
+
`/gsd:checkpoints` — review and approve any pending human input
|
|
369
|
+
|
|
370
|
+
───────────────────────────────────────────────────────────────
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
## 7. Update State
|
|
374
|
+
|
|
375
|
+
Before presenting instructions, update STATE.md to mark autopilot as ready:
|
|
376
|
+
|
|
377
|
+
```markdown
|
|
378
|
+
## Autopilot
|
|
379
|
+
|
|
380
|
+
- **Mode:** running
|
|
381
|
+
- **Started:** [timestamp]
|
|
382
|
+
- **Current Phase:** [first phase]
|
|
383
|
+
- **Phases Remaining:** [list]
|
|
384
|
+
- **Checkpoints Pending:** (none yet)
|
|
385
|
+
- **Last Error:** none
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
</process>
|
|
389
|
+
|
|
390
|
+
<checkpoint_queue>
|
|
391
|
+
Plans with `autonomous: false` pause at checkpoints.
|
|
392
|
+
|
|
393
|
+
**Queue structure:**
|
|
394
|
+
```
|
|
395
|
+
.planning/checkpoints/
|
|
396
|
+
├── pending/
|
|
397
|
+
│ └── phase-03-plan-02.json # Waiting for user
|
|
398
|
+
└── approved/
|
|
399
|
+
└── phase-03-plan-02.json # User approved, ready to continue
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
**Pending checkpoint format:**
|
|
403
|
+
```json
|
|
404
|
+
{
|
|
405
|
+
"phase": "03",
|
|
406
|
+
"plan": "02",
|
|
407
|
+
"plan_name": "OAuth Integration",
|
|
408
|
+
"checkpoint_type": "auth-gate",
|
|
409
|
+
"awaiting": "OAuth client credentials for Google",
|
|
410
|
+
"context": "Plan paused after task 2. Tasks 3-4 require OAuth setup.",
|
|
411
|
+
"created": "2026-01-26T14:30:00Z",
|
|
412
|
+
"completed_tasks": [
|
|
413
|
+
{"task": 1, "commit": "abc123", "name": "Create OAuth service skeleton"},
|
|
414
|
+
{"task": 2, "commit": "def456", "name": "Add Google OAuth config structure"}
|
|
415
|
+
]
|
|
416
|
+
}
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
**Approved checkpoint format:**
|
|
420
|
+
```json
|
|
421
|
+
{
|
|
422
|
+
"phase": "03",
|
|
423
|
+
"plan": "02",
|
|
424
|
+
"approved": true,
|
|
425
|
+
"response": "Client ID: xxx, Secret: yyy",
|
|
426
|
+
"approved_at": "2026-01-26T15:00:00Z"
|
|
427
|
+
}
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
**Workflow:**
|
|
431
|
+
1. Executor hits checkpoint → writes to `pending/`
|
|
432
|
+
2. Autopilot logs checkpoint, continues with other phases
|
|
433
|
+
3. User reviews `pending/` (manually or via `/gsd:checkpoints`)
|
|
434
|
+
4. User creates approval in `approved/`
|
|
435
|
+
5. Next autopilot run (or current if phase revisited) picks up approval
|
|
436
|
+
6. Continuation agent spawned with approval context
|
|
437
|
+
</checkpoint_queue>
|
|
438
|
+
|
|
439
|
+
<cost_tracking>
|
|
440
|
+
Track token usage for budget enforcement:
|
|
441
|
+
|
|
442
|
+
**Per-phase logging:**
|
|
443
|
+
After each `claude -p` call, parse output for token counts:
|
|
444
|
+
```bash
|
|
445
|
+
# Extract from claude -p output (format varies)
|
|
446
|
+
TOKENS=$(grep -o 'tokens: [0-9]*' "$LOG_FILE" | tail -1 | grep -o '[0-9]*')
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
**Accumulate in state:**
|
|
450
|
+
```markdown
|
|
451
|
+
## Cost Tracking
|
|
452
|
+
|
|
453
|
+
| Phase | Tokens | Est. Cost |
|
|
454
|
+
|-------|--------|-----------|
|
|
455
|
+
| 1 | 45,230 | $0.68 |
|
|
456
|
+
| 2 | 62,100 | $0.93 |
|
|
457
|
+
| Total | 107,330 | $1.61 |
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
**Budget check:**
|
|
461
|
+
```bash
|
|
462
|
+
if [ "$BUDGET_LIMIT" -gt 0 ]; then
|
|
463
|
+
TOTAL_COST=$(calculate_cost)
|
|
464
|
+
if (( $(echo "$TOTAL_COST > $BUDGET_LIMIT" | bc -l) )); then
|
|
465
|
+
notify "Budget exceeded: \$$TOTAL_COST / \$$BUDGET_LIMIT"
|
|
466
|
+
update_state "paused" "budget_exceeded"
|
|
467
|
+
exit 0
|
|
468
|
+
fi
|
|
469
|
+
fi
|
|
470
|
+
```
|
|
471
|
+
</cost_tracking>
|
|
472
|
+
|
|
473
|
+
<notifications>
|
|
474
|
+
**Terminal bell:**
|
|
475
|
+
```bash
|
|
476
|
+
echo -e "\a" # On completion or error
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
**Webhook:**
|
|
480
|
+
```bash
|
|
481
|
+
notify() {
|
|
482
|
+
local message="$1"
|
|
483
|
+
local status="${2:-info}"
|
|
484
|
+
|
|
485
|
+
if [ -n "$WEBHOOK_URL" ]; then
|
|
486
|
+
curl -s -X POST "$WEBHOOK_URL" \
|
|
487
|
+
-H "Content-Type: application/json" \
|
|
488
|
+
-d "{\"text\": \"GSD Autopilot: $message\", \"status\": \"$status\"}" \
|
|
489
|
+
> /dev/null 2>&1
|
|
490
|
+
fi
|
|
491
|
+
|
|
492
|
+
# Always terminal bell
|
|
493
|
+
echo -e "\a"
|
|
494
|
+
}
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
**Notification triggers:**
|
|
498
|
+
- Phase complete
|
|
499
|
+
- Checkpoint queued
|
|
500
|
+
- Error/retry
|
|
501
|
+
- Budget warning (80%)
|
|
502
|
+
- Budget exceeded
|
|
503
|
+
- Milestone complete
|
|
504
|
+
</notifications>
|
|
505
|
+
|
|
506
|
+
<success_criteria>
|
|
507
|
+
- [ ] Roadmap exists validation
|
|
508
|
+
- [ ] Lock file prevents concurrent runs
|
|
509
|
+
- [ ] Incomplete phases parsed from ROADMAP.md
|
|
510
|
+
- [ ] Resume detection from STATE.md
|
|
511
|
+
- [ ] Config loaded (checkpoint mode, retries, budget, webhook)
|
|
512
|
+
- [ ] Execution plan presented clearly
|
|
513
|
+
- [ ] User confirms before running
|
|
514
|
+
- [ ] Script generated with project-specific values
|
|
515
|
+
- [ ] Execution mode matches user choice
|
|
516
|
+
- [ ] STATE.md updated with autopilot section
|
|
517
|
+
- [ ] Logs written to .planning/logs/
|
|
518
|
+
</success_criteria>
|