claude-symphony 0.0.1 → 0.0.3
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 +16 -12
- package/assets/claude_symphony.webp +0 -0
- package/assets/claude_symphony_ascii.txt +8 -0
- package/bin/create.js +80 -69
- package/package.json +3 -2
- package/template/.claude/commands/benchmark.md +32 -32
- package/template/.claude/commands/brainstorm.md +33 -33
- package/template/.claude/commands/checkpoint.md +42 -42
- package/template/.claude/commands/codex.md +52 -52
- package/template/.claude/commands/collaborate.md +47 -47
- package/template/.claude/commands/context.md +77 -77
- package/template/.claude/commands/deploy.md +50 -50
- package/template/.claude/commands/fork.md +46 -46
- package/template/.claude/commands/gemini.md +43 -43
- package/template/.claude/commands/handoff.md +42 -42
- package/template/.claude/commands/implement.md +42 -42
- package/template/.claude/commands/init-project.md +25 -25
- package/template/.claude/commands/next.md +67 -67
- package/template/.claude/commands/planning.md +38 -38
- package/template/.claude/commands/qa.md +47 -47
- package/template/.claude/commands/refactor.md +50 -50
- package/template/.claude/commands/research.md +31 -31
- package/template/.claude/commands/restore.md +53 -53
- package/template/.claude/commands/run-stage.md +45 -45
- package/template/.claude/commands/stages.md +49 -49
- package/template/.claude/commands/status.md +41 -41
- package/template/.claude/commands/tasks.md +33 -33
- package/template/.claude/commands/test.md +45 -45
- package/template/.claude/commands/ui-ux.md +31 -31
- package/template/.claude/commands/validate.md +81 -81
- package/template/.claude/hooks/ai-selector.sh +39 -39
- package/template/.claude/hooks/auto-checkpoint.sh +30 -30
- package/template/.claude/hooks/output-validator.sh +45 -45
- package/template/.claude/hooks/post-stage.sh +28 -28
- package/template/.claude/hooks/pre-stage.sh +47 -47
- package/template/.claude/hooks/session-start.sh +27 -27
- package/template/.claude/hooks/statusline.sh +24 -24
- package/template/.claude/hooks/stop.sh +26 -26
- package/template/.claude/settings.json +32 -32
- package/template/.claude/skills/ai-collaboration/README.md +31 -31
- package/template/.claude/skills/ai-collaboration/debate.md +66 -66
- package/template/.claude/skills/ai-collaboration/parallel.md +34 -34
- package/template/.claude/skills/ai-collaboration/prompts/CLAUDE.md +59 -63
- package/template/.claude/skills/auto-checkpoint/README.md +46 -46
- package/template/.claude/skills/auto-checkpoint/prompts/CLAUDE.md +68 -72
- package/template/.claude/skills/auto-checkpoint/rollback.md +95 -95
- package/template/.claude/skills/auto-checkpoint/trigger.md +37 -37
- package/template/.claude/skills/context-compression/README.md +69 -69
- package/template/.claude/skills/context-compression/analyze.md +74 -74
- package/template/.claude/skills/context-compression/compress.md +103 -103
- package/template/.claude/skills/context-compression/prompts/compression.md +78 -78
- package/template/.claude/skills/output-validator/README.md +33 -33
- package/template/.claude/skills/output-validator/prompts/CLAUDE.md +74 -78
- package/template/.claude/skills/output-validator/validate.md +76 -76
- package/template/.claude/skills/smart-handoff/README.md +35 -35
- package/template/.claude/skills/smart-handoff/extract.md +42 -42
- package/template/.claude/skills/smart-handoff/prompts/CLAUDE.md +52 -54
- package/template/.claude/skills/smart-handoff/summarize.md +55 -55
- package/template/.claude/skills/stage-transition/README.md +50 -50
- package/template/.claude/skills/stage-transition/handoff-gen.md +89 -89
- package/template/.claude/skills/stage-transition/prompts/transition.md +74 -74
- package/template/.claude/skills/stage-transition/validate.md +41 -41
- package/template/CLAUDE.md +334 -335
- package/template/config/ai_benchmarking.yaml +22 -22
- package/template/config/ai_collaboration.yaml +18 -18
- package/template/config/ai_logging.yaml +50 -50
- package/template/config/auto_checkpoint.yaml +32 -32
- package/template/config/context.yaml +20 -20
- package/template/config/git.yaml +51 -51
- package/template/config/handoff_intelligence.yaml +23 -23
- package/template/config/mcp_fallbacks.yaml +71 -71
- package/template/config/memory_integration.yaml +23 -23
- package/template/config/model_enforcement.yaml +53 -53
- package/template/config/models.yaml +24 -24
- package/template/config/output_validation.yaml +44 -44
- package/template/config/pipeline.yaml +25 -25
- package/template/config/pipeline_forking.yaml +40 -40
- package/template/config/qa_logging.yaml +67 -67
- package/template/config/smart_rollback.yaml +48 -48
- package/template/config/stage_personas.yaml +154 -154
- package/template/config/workflow.yaml +16 -16
- package/template/scripts/ai-benchmark.sh +41 -41
- package/template/scripts/codex-wrapper.sh +32 -32
- package/template/scripts/context-manager.sh +136 -136
- package/template/scripts/create-checkpoint.sh +34 -34
- package/template/scripts/gemini-wrapper.sh +31 -31
- package/template/scripts/init-project.sh +40 -40
- package/template/scripts/list-stages.sh +30 -30
- package/template/scripts/next-stage.sh +67 -67
- package/template/scripts/output-validate.sh +2 -2
- package/template/scripts/pipeline-fork.sh +68 -68
- package/template/scripts/pre-run-check.sh +84 -84
- package/template/scripts/restore-checkpoint.sh +50 -50
- package/template/scripts/run-stage.sh +44 -44
- package/template/scripts/show-status.sh +30 -30
- package/template/scripts/smart-handoff.sh +70 -70
- package/template/stages/01-brainstorm/CLAUDE.md +70 -74
- package/template/stages/01-brainstorm/README.md +54 -54
- package/template/stages/01-brainstorm/config.yaml +18 -18
- package/template/stages/01-brainstorm/prompts/collaboration.md +24 -24
- package/template/stages/01-brainstorm/prompts/ideation.md +41 -41
- package/template/stages/01-brainstorm/prompts/persona.md +50 -50
- package/template/stages/01-brainstorm/prompts/requirements.md +55 -55
- package/template/stages/01-brainstorm/prompts/validation.md +28 -28
- package/template/stages/01-brainstorm/templates/ideas.md +47 -47
- package/template/stages/01-brainstorm/templates/requirements_analysis.md +61 -61
- package/template/stages/02-research/CLAUDE.md +72 -76
- package/template/stages/02-research/config.yaml +12 -12
- package/template/stages/02-research/prompts/collaboration.md +29 -29
- package/template/stages/02-research/prompts/feasibility.md +38 -38
- package/template/stages/02-research/prompts/market_analysis.md +29 -29
- package/template/stages/02-research/prompts/tech_stack.md +34 -34
- package/template/stages/02-research/prompts/validation.md +29 -29
- package/template/stages/03-planning/CLAUDE.md +88 -92
- package/template/stages/03-planning/config.yaml +10 -10
- package/template/stages/03-planning/prompts/architecture.md +43 -43
- package/template/stages/03-planning/prompts/collaboration.md +34 -34
- package/template/stages/03-planning/prompts/validation.md +34 -34
- package/template/stages/04-ui-ux/CLAUDE.md +68 -72
- package/template/stages/04-ui-ux/config.yaml +5 -5
- package/template/stages/04-ui-ux/prompts/collaboration.md +35 -35
- package/template/stages/04-ui-ux/prompts/validation.md +30 -30
- package/template/stages/05-task-management/CLAUDE.md +81 -85
- package/template/stages/05-task-management/config.yaml +17 -17
- package/template/stages/05-task-management/prompts/collaboration.md +30 -30
- package/template/stages/05-task-management/prompts/validation.md +33 -33
- package/template/stages/05-task-management/templates/notion_integration.md +70 -70
- package/template/stages/05-task-management/templates/parallel_groups.yaml +64 -64
- package/template/stages/05-task-management/templates/task_schema.yaml +33 -33
- package/template/stages/06-implementation/CLAUDE.md +117 -121
- package/template/stages/06-implementation/config.yaml +10 -10
- package/template/stages/06-implementation/prompts/collaboration.md +29 -29
- package/template/stages/06-implementation/prompts/validation.md +36 -36
- package/template/stages/07-refactoring/CLAUDE.md +120 -124
- package/template/stages/07-refactoring/config.yaml +11 -11
- package/template/stages/07-refactoring/prompts/collaboration.md +36 -36
- package/template/stages/07-refactoring/prompts/validation.md +40 -40
- package/template/stages/08-qa/CLAUDE.md +80 -84
- package/template/stages/08-qa/config.yaml +7 -7
- package/template/stages/08-qa/prompts/collaboration.md +34 -34
- package/template/stages/08-qa/prompts/validation.md +41 -41
- package/template/stages/09-testing/CLAUDE.md +86 -90
- package/template/stages/09-testing/config.yaml +10 -10
- package/template/stages/09-testing/prompts/collaboration.md +38 -38
- package/template/stages/09-testing/prompts/validation.md +41 -41
- package/template/stages/10-deployment/CLAUDE.md +86 -90
- package/template/stages/10-deployment/config.yaml +11 -11
- package/template/stages/10-deployment/prompts/collaboration.md +37 -37
- package/template/stages/10-deployment/prompts/validation.md +54 -54
- package/template/stages/10-deployment/templates/github-actions-cd.yaml +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# pre-run-check.sh -
|
|
2
|
+
# pre-run-check.sh - Pre-pipeline execution check script
|
|
3
3
|
# claude-symphony workflow pipeline
|
|
4
4
|
#
|
|
5
|
-
#
|
|
5
|
+
# This script verifies all required tools and settings are correct before running the pipeline.
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# Color definitions
|
|
8
8
|
RED='\033[0;31m'
|
|
9
9
|
GREEN='\033[0;32m'
|
|
10
10
|
YELLOW='\033[1;33m'
|
|
@@ -12,15 +12,15 @@ BLUE='\033[0;34m'
|
|
|
12
12
|
CYAN='\033[0;36m'
|
|
13
13
|
NC='\033[0m' # No Color
|
|
14
14
|
|
|
15
|
-
#
|
|
15
|
+
# Counters
|
|
16
16
|
PASS_COUNT=0
|
|
17
17
|
FAIL_COUNT=0
|
|
18
18
|
WARN_COUNT=0
|
|
19
19
|
|
|
20
|
-
#
|
|
20
|
+
# Store results
|
|
21
21
|
RESULTS=()
|
|
22
22
|
|
|
23
|
-
#
|
|
23
|
+
# Print header
|
|
24
24
|
print_header() {
|
|
25
25
|
echo ""
|
|
26
26
|
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
@@ -29,14 +29,14 @@ print_header() {
|
|
|
29
29
|
echo ""
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
#
|
|
32
|
+
# Section header
|
|
33
33
|
print_section() {
|
|
34
34
|
echo ""
|
|
35
35
|
echo -e "${BLUE}▸ $1${NC}"
|
|
36
36
|
echo -e "${BLUE}──────────────────────────────────────${NC}"
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
#
|
|
39
|
+
# Result output functions
|
|
40
40
|
check_pass() {
|
|
41
41
|
echo -e " ${GREEN}✓${NC} $1"
|
|
42
42
|
PASS_COUNT=$((PASS_COUNT + 1))
|
|
@@ -56,93 +56,93 @@ check_warn() {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
# =============================================================================
|
|
59
|
-
# 1. AI CLI
|
|
59
|
+
# 1. AI CLI Installation Check
|
|
60
60
|
# =============================================================================
|
|
61
61
|
check_ai_cli() {
|
|
62
|
-
print_section "AI CLI
|
|
62
|
+
print_section "AI CLI Installation Check"
|
|
63
63
|
|
|
64
64
|
# Gemini CLI
|
|
65
65
|
if command -v gemini &> /dev/null; then
|
|
66
66
|
GEMINI_PATH=$(which gemini)
|
|
67
|
-
check_pass "Gemini CLI
|
|
67
|
+
check_pass "Gemini CLI installed: $GEMINI_PATH"
|
|
68
68
|
else
|
|
69
|
-
check_fail "Gemini CLI
|
|
69
|
+
check_fail "Gemini CLI not installed - Issues expected in stages 01, 03, 04"
|
|
70
70
|
fi
|
|
71
71
|
|
|
72
72
|
# Codex CLI
|
|
73
73
|
if command -v codex &> /dev/null; then
|
|
74
74
|
CODEX_PATH=$(which codex)
|
|
75
|
-
check_pass "Codex CLI
|
|
75
|
+
check_pass "Codex CLI installed: $CODEX_PATH"
|
|
76
76
|
else
|
|
77
|
-
check_fail "Codex CLI
|
|
77
|
+
check_fail "Codex CLI not installed - Issues expected in stages 07, 09"
|
|
78
78
|
fi
|
|
79
79
|
|
|
80
|
-
# Claude Code (
|
|
81
|
-
check_pass "Claude Code:
|
|
80
|
+
# Claude Code (current environment)
|
|
81
|
+
check_pass "Claude Code: Currently running"
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
# =============================================================================
|
|
85
|
-
# 2. tmux
|
|
85
|
+
# 2. tmux Check
|
|
86
86
|
# =============================================================================
|
|
87
87
|
check_tmux() {
|
|
88
|
-
print_section "tmux
|
|
88
|
+
print_section "tmux Environment Check"
|
|
89
89
|
|
|
90
90
|
if command -v tmux &> /dev/null; then
|
|
91
91
|
TMUX_VERSION=$(tmux -V)
|
|
92
|
-
check_pass "tmux
|
|
92
|
+
check_pass "tmux installed: $TMUX_VERSION"
|
|
93
93
|
else
|
|
94
|
-
check_fail "tmux
|
|
94
|
+
check_fail "tmux not installed - External AI calls not possible"
|
|
95
95
|
return
|
|
96
96
|
fi
|
|
97
97
|
|
|
98
|
-
#
|
|
98
|
+
# Check existing sessions
|
|
99
99
|
if tmux has-session -t ax-gemini 2>/dev/null; then
|
|
100
|
-
check_pass "tmux
|
|
100
|
+
check_pass "tmux session 'ax-gemini' active"
|
|
101
101
|
else
|
|
102
|
-
check_warn "tmux
|
|
102
|
+
check_warn "tmux session 'ax-gemini' not found - Will be auto-created when needed"
|
|
103
103
|
fi
|
|
104
104
|
|
|
105
105
|
if tmux has-session -t ax-codex 2>/dev/null; then
|
|
106
|
-
check_pass "tmux
|
|
106
|
+
check_pass "tmux session 'ax-codex' active"
|
|
107
107
|
else
|
|
108
|
-
check_warn "tmux
|
|
108
|
+
check_warn "tmux session 'ax-codex' not found - Will be auto-created when needed"
|
|
109
109
|
fi
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
# =============================================================================
|
|
113
|
-
# 3.
|
|
113
|
+
# 3. Wrapper Scripts Check
|
|
114
114
|
# =============================================================================
|
|
115
115
|
check_wrapper_scripts() {
|
|
116
|
-
print_section "
|
|
116
|
+
print_section "Wrapper Scripts Check"
|
|
117
117
|
|
|
118
118
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
119
119
|
|
|
120
120
|
# gemini-wrapper.sh
|
|
121
121
|
if [[ -x "$SCRIPT_DIR/gemini-wrapper.sh" ]]; then
|
|
122
|
-
check_pass "gemini-wrapper.sh
|
|
122
|
+
check_pass "gemini-wrapper.sh executable"
|
|
123
123
|
elif [[ -f "$SCRIPT_DIR/gemini-wrapper.sh" ]]; then
|
|
124
|
-
check_warn "gemini-wrapper.sh
|
|
125
|
-
echo -e " ${YELLOW}
|
|
124
|
+
check_warn "gemini-wrapper.sh exists but not executable"
|
|
125
|
+
echo -e " ${YELLOW}Fix: chmod +x $SCRIPT_DIR/gemini-wrapper.sh${NC}"
|
|
126
126
|
else
|
|
127
|
-
check_fail "gemini-wrapper.sh
|
|
127
|
+
check_fail "gemini-wrapper.sh not found"
|
|
128
128
|
fi
|
|
129
129
|
|
|
130
130
|
# codex-wrapper.sh
|
|
131
131
|
if [[ -x "$SCRIPT_DIR/codex-wrapper.sh" ]]; then
|
|
132
|
-
check_pass "codex-wrapper.sh
|
|
132
|
+
check_pass "codex-wrapper.sh executable"
|
|
133
133
|
elif [[ -f "$SCRIPT_DIR/codex-wrapper.sh" ]]; then
|
|
134
|
-
check_warn "codex-wrapper.sh
|
|
135
|
-
echo -e " ${YELLOW}
|
|
134
|
+
check_warn "codex-wrapper.sh exists but not executable"
|
|
135
|
+
echo -e " ${YELLOW}Fix: chmod +x $SCRIPT_DIR/codex-wrapper.sh${NC}"
|
|
136
136
|
else
|
|
137
|
-
check_fail "codex-wrapper.sh
|
|
137
|
+
check_fail "codex-wrapper.sh not found"
|
|
138
138
|
fi
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
# =============================================================================
|
|
142
|
-
# 4.
|
|
142
|
+
# 4. Configuration Files Check
|
|
143
143
|
# =============================================================================
|
|
144
144
|
check_config_files() {
|
|
145
|
-
print_section "
|
|
145
|
+
print_section "Configuration Files Check"
|
|
146
146
|
|
|
147
147
|
CONFIG_DIR="$(dirname "$(dirname "${BASH_SOURCE[0]}")")/config"
|
|
148
148
|
|
|
@@ -156,42 +156,42 @@ check_config_files() {
|
|
|
156
156
|
|
|
157
157
|
for config in "${required_configs[@]}"; do
|
|
158
158
|
if [[ -f "$CONFIG_DIR/$config" ]]; then
|
|
159
|
-
check_pass "$config
|
|
159
|
+
check_pass "$config exists"
|
|
160
160
|
else
|
|
161
|
-
check_fail "$config
|
|
161
|
+
check_fail "$config not found"
|
|
162
162
|
fi
|
|
163
163
|
done
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
# =============================================================================
|
|
167
|
-
# 5.
|
|
167
|
+
# 5. State Files Check
|
|
168
168
|
# =============================================================================
|
|
169
169
|
check_state_files() {
|
|
170
|
-
print_section "
|
|
170
|
+
print_section "State Files Check"
|
|
171
171
|
|
|
172
172
|
STATE_DIR="$(dirname "$(dirname "${BASH_SOURCE[0]}")")/state"
|
|
173
173
|
|
|
174
174
|
if [[ -f "$STATE_DIR/progress.json" ]]; then
|
|
175
175
|
CURRENT_STAGE=$(grep -o '"current_stage"[^,]*' "$STATE_DIR/progress.json" 2>/dev/null | cut -d'"' -f4)
|
|
176
|
-
check_pass "progress.json
|
|
176
|
+
check_pass "progress.json exists (current stage: ${CURRENT_STAGE:-unknown})"
|
|
177
177
|
else
|
|
178
|
-
check_warn "progress.json
|
|
178
|
+
check_warn "progress.json not found - Starting as new pipeline"
|
|
179
179
|
fi
|
|
180
180
|
|
|
181
|
-
#
|
|
181
|
+
# Checkpoints directory
|
|
182
182
|
if [[ -d "$STATE_DIR/checkpoints" ]]; then
|
|
183
183
|
CP_COUNT=$(ls -1 "$STATE_DIR/checkpoints" 2>/dev/null | wc -l | tr -d ' ')
|
|
184
|
-
check_pass "
|
|
184
|
+
check_pass "Checkpoints directory exists ($CP_COUNT checkpoints)"
|
|
185
185
|
else
|
|
186
|
-
check_warn "
|
|
186
|
+
check_warn "Checkpoints directory not found"
|
|
187
187
|
fi
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
# =============================================================================
|
|
191
|
-
# 6.
|
|
191
|
+
# 6. Stage Files Check
|
|
192
192
|
# =============================================================================
|
|
193
193
|
check_stage_files() {
|
|
194
|
-
print_section "
|
|
194
|
+
print_section "Stage Files Check"
|
|
195
195
|
|
|
196
196
|
STAGES_DIR="$(dirname "$(dirname "${BASH_SOURCE[0]}")")/stages"
|
|
197
197
|
|
|
@@ -212,75 +212,75 @@ check_stage_files() {
|
|
|
212
212
|
if [[ -f "$STAGES_DIR/$stage/CLAUDE.md" ]]; then
|
|
213
213
|
check_pass "$stage/CLAUDE.md"
|
|
214
214
|
else
|
|
215
|
-
check_fail "$stage/CLAUDE.md
|
|
215
|
+
check_fail "$stage/CLAUDE.md not found"
|
|
216
216
|
fi
|
|
217
217
|
done
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
# =============================================================================
|
|
221
|
-
# 7. AI CLI
|
|
221
|
+
# 7. AI CLI Simple Test (Optional)
|
|
222
222
|
# =============================================================================
|
|
223
223
|
test_ai_cli() {
|
|
224
|
-
print_section "AI CLI
|
|
224
|
+
print_section "AI CLI Connection Test (Optional)"
|
|
225
225
|
|
|
226
|
-
echo -e " ${YELLOW}
|
|
227
|
-
echo -e " ${YELLOW}
|
|
226
|
+
echo -e " ${YELLOW}This test will make actual API calls.${NC}"
|
|
227
|
+
echo -e " ${YELLOW}Press Enter to skip, or type 'y' to run:${NC}"
|
|
228
228
|
read -r -t 10 response
|
|
229
229
|
|
|
230
230
|
if [[ "$response" != "y" ]]; then
|
|
231
|
-
check_warn "AI
|
|
231
|
+
check_warn "AI connection test skipped"
|
|
232
232
|
return
|
|
233
233
|
fi
|
|
234
234
|
|
|
235
|
-
# Gemini
|
|
235
|
+
# Gemini test
|
|
236
236
|
if command -v gemini &> /dev/null; then
|
|
237
|
-
echo -e " ${BLUE}Gemini
|
|
237
|
+
echo -e " ${BLUE}Testing Gemini...${NC}"
|
|
238
238
|
if timeout 30 gemini "Say 'Hello'" &>/dev/null; then
|
|
239
|
-
check_pass "Gemini API
|
|
239
|
+
check_pass "Gemini API connection successful"
|
|
240
240
|
else
|
|
241
|
-
check_fail "Gemini API
|
|
241
|
+
check_fail "Gemini API connection failed"
|
|
242
242
|
fi
|
|
243
243
|
fi
|
|
244
244
|
|
|
245
|
-
# Codex
|
|
245
|
+
# Codex test
|
|
246
246
|
if command -v codex &> /dev/null; then
|
|
247
|
-
echo -e " ${BLUE}Codex
|
|
247
|
+
echo -e " ${BLUE}Testing Codex...${NC}"
|
|
248
248
|
if timeout 30 codex --help &>/dev/null; then
|
|
249
|
-
check_pass "Codex CLI
|
|
249
|
+
check_pass "Codex CLI working"
|
|
250
250
|
else
|
|
251
|
-
check_fail "Codex CLI
|
|
251
|
+
check_fail "Codex CLI error"
|
|
252
252
|
fi
|
|
253
253
|
fi
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
# =============================================================================
|
|
257
|
-
#
|
|
257
|
+
# Summary
|
|
258
258
|
# =============================================================================
|
|
259
259
|
print_summary() {
|
|
260
260
|
echo ""
|
|
261
261
|
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
262
|
-
echo -e "${CYAN} 📊
|
|
262
|
+
echo -e "${CYAN} 📊 Check Results Summary${NC}"
|
|
263
263
|
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
264
264
|
echo ""
|
|
265
|
-
echo -e " ${GREEN}
|
|
266
|
-
echo -e " ${YELLOW}
|
|
267
|
-
echo -e " ${RED}
|
|
265
|
+
echo -e " ${GREEN}Passed: $PASS_COUNT${NC}"
|
|
266
|
+
echo -e " ${YELLOW}Warnings: $WARN_COUNT${NC}"
|
|
267
|
+
echo -e " ${RED}Failed: $FAIL_COUNT${NC}"
|
|
268
268
|
echo ""
|
|
269
269
|
|
|
270
270
|
if [[ $FAIL_COUNT -eq 0 ]]; then
|
|
271
271
|
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
272
|
-
echo -e "${GREEN} ✅
|
|
272
|
+
echo -e "${GREEN} ✅ All required checks passed! Pipeline ready to run${NC}"
|
|
273
273
|
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
274
274
|
else
|
|
275
275
|
echo -e "${RED}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
276
|
-
echo -e "${RED} ❌ $FAIL_COUNT
|
|
276
|
+
echo -e "${RED} ❌ $FAIL_COUNT items failed. Please resolve the issues above.${NC}"
|
|
277
277
|
echo -e "${RED}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
278
278
|
fi
|
|
279
279
|
|
|
280
|
-
#
|
|
280
|
+
# Failed items detail
|
|
281
281
|
if [[ $FAIL_COUNT -gt 0 ]]; then
|
|
282
282
|
echo ""
|
|
283
|
-
echo -e "${RED}
|
|
283
|
+
echo -e "${RED}Failed Items Detail:${NC}"
|
|
284
284
|
for result in "${RESULTS[@]}"; do
|
|
285
285
|
if [[ $result == FAIL:* ]]; then
|
|
286
286
|
echo -e " ${RED}•${NC} ${result#FAIL: }"
|
|
@@ -292,33 +292,33 @@ print_summary() {
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
# =============================================================================
|
|
295
|
-
#
|
|
295
|
+
# Recommendations
|
|
296
296
|
# =============================================================================
|
|
297
297
|
print_recommendations() {
|
|
298
298
|
if [[ $FAIL_COUNT -gt 0 || $WARN_COUNT -gt 0 ]]; then
|
|
299
299
|
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
300
|
-
echo -e "${BLUE} 💡
|
|
300
|
+
echo -e "${BLUE} 💡 Recommended Actions${NC}"
|
|
301
301
|
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
302
302
|
echo ""
|
|
303
303
|
|
|
304
|
-
# Gemini
|
|
304
|
+
# If Gemini not installed
|
|
305
305
|
if ! command -v gemini &> /dev/null; then
|
|
306
|
-
echo -e " ${YELLOW}Gemini CLI
|
|
306
|
+
echo -e " ${YELLOW}Install Gemini CLI:${NC}"
|
|
307
307
|
echo " pip install google-generativeai"
|
|
308
|
-
echo " #
|
|
308
|
+
echo " # Or refer to official documentation"
|
|
309
309
|
echo ""
|
|
310
310
|
fi
|
|
311
311
|
|
|
312
|
-
# Codex
|
|
312
|
+
# If Codex not installed
|
|
313
313
|
if ! command -v codex &> /dev/null; then
|
|
314
|
-
echo -e " ${YELLOW}Codex CLI
|
|
314
|
+
echo -e " ${YELLOW}Install Codex CLI:${NC}"
|
|
315
315
|
echo " npm install -g @openai/codex-cli"
|
|
316
316
|
echo ""
|
|
317
317
|
fi
|
|
318
318
|
|
|
319
|
-
# tmux
|
|
319
|
+
# If tmux not installed
|
|
320
320
|
if ! command -v tmux &> /dev/null; then
|
|
321
|
-
echo -e " ${YELLOW}tmux
|
|
321
|
+
echo -e " ${YELLOW}Install tmux:${NC}"
|
|
322
322
|
echo " brew install tmux # macOS"
|
|
323
323
|
echo " apt install tmux # Ubuntu"
|
|
324
324
|
echo ""
|
|
@@ -329,7 +329,7 @@ print_recommendations() {
|
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
# =============================================================================
|
|
332
|
-
#
|
|
332
|
+
# Main execution
|
|
333
333
|
# =============================================================================
|
|
334
334
|
main() {
|
|
335
335
|
print_header
|
|
@@ -341,7 +341,7 @@ main() {
|
|
|
341
341
|
check_state_files
|
|
342
342
|
check_stage_files
|
|
343
343
|
|
|
344
|
-
#
|
|
344
|
+
# Optional test
|
|
345
345
|
if [[ "$1" == "--test" ]]; then
|
|
346
346
|
test_ai_cli
|
|
347
347
|
fi
|
|
@@ -349,7 +349,7 @@ main() {
|
|
|
349
349
|
print_summary
|
|
350
350
|
print_recommendations
|
|
351
351
|
|
|
352
|
-
#
|
|
352
|
+
# Exit code
|
|
353
353
|
if [[ $FAIL_COUNT -gt 0 ]]; then
|
|
354
354
|
exit 1
|
|
355
355
|
else
|
|
@@ -357,5 +357,5 @@ main() {
|
|
|
357
357
|
fi
|
|
358
358
|
}
|
|
359
359
|
|
|
360
|
-
#
|
|
360
|
+
# Run
|
|
361
361
|
main "$@"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# restore-checkpoint.sh -
|
|
2
|
+
# restore-checkpoint.sh - Checkpoint restoration
|
|
3
3
|
# claude-symphony workflow pipeline
|
|
4
4
|
|
|
5
5
|
set -e
|
|
@@ -8,7 +8,7 @@ PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
|
8
8
|
PROGRESS_FILE="$PROJECT_ROOT/state/progress.json"
|
|
9
9
|
CHECKPOINTS_DIR="$PROJECT_ROOT/state/checkpoints"
|
|
10
10
|
|
|
11
|
-
#
|
|
11
|
+
# Color definitions
|
|
12
12
|
RED='\033[0;31m'
|
|
13
13
|
GREEN='\033[0;32m'
|
|
14
14
|
YELLOW='\033[1;33m'
|
|
@@ -18,7 +18,7 @@ WHITE='\033[1;37m'
|
|
|
18
18
|
GRAY='\033[0;90m'
|
|
19
19
|
NC='\033[0m' # No Color
|
|
20
20
|
|
|
21
|
-
#
|
|
21
|
+
# Option handling
|
|
22
22
|
LIST_MODE=false
|
|
23
23
|
LATEST_MODE=false
|
|
24
24
|
FORCE_MODE=false
|
|
@@ -39,13 +39,13 @@ while [[ "$#" -gt 0 ]]; do
|
|
|
39
39
|
shift
|
|
40
40
|
done
|
|
41
41
|
|
|
42
|
-
# jq
|
|
42
|
+
# Check jq
|
|
43
43
|
if ! command -v jq &> /dev/null; then
|
|
44
|
-
echo -e "${RED}
|
|
44
|
+
echo -e "${RED}Error:${NC} jq is required."
|
|
45
45
|
exit 1
|
|
46
46
|
fi
|
|
47
47
|
|
|
48
|
-
#
|
|
48
|
+
# List checkpoints function
|
|
49
49
|
list_checkpoints() {
|
|
50
50
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
51
51
|
echo -e "💾 ${WHITE}Checkpoint List${NC}"
|
|
@@ -53,8 +53,8 @@ list_checkpoints() {
|
|
|
53
53
|
|
|
54
54
|
if [ ! -d "$CHECKPOINTS_DIR" ] || [ -z "$(ls -A "$CHECKPOINTS_DIR" 2>/dev/null)" ]; then
|
|
55
55
|
echo ""
|
|
56
|
-
echo -e " ${GRAY}
|
|
57
|
-
echo -e " ${GRAY}/checkpoint
|
|
56
|
+
echo -e " ${GRAY}No checkpoints available.${NC}"
|
|
57
|
+
echo -e " ${GRAY}Create one with /checkpoint command.${NC}"
|
|
58
58
|
echo ""
|
|
59
59
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
60
60
|
return 0
|
|
@@ -74,7 +74,7 @@ list_checkpoints() {
|
|
|
74
74
|
CREATED=$(jq -r '.created_at // "unknown"' "$META_FILE")
|
|
75
75
|
DESC=$(jq -r '.description // ""' "$META_FILE")
|
|
76
76
|
|
|
77
|
-
#
|
|
77
|
+
# Date formatting
|
|
78
78
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
79
79
|
CREATED_FMT=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$CREATED" "+%Y-%m-%d %H:%M" 2>/dev/null || echo "$CREATED")
|
|
80
80
|
else
|
|
@@ -91,11 +91,11 @@ list_checkpoints() {
|
|
|
91
91
|
done
|
|
92
92
|
|
|
93
93
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
94
|
-
echo -e "
|
|
94
|
+
echo -e "Total ${CYAN}${COUNT}${NC} checkpoints | Restore with ${GREEN}/restore [ID]${NC}"
|
|
95
95
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
#
|
|
98
|
+
# Find latest checkpoint
|
|
99
99
|
find_latest_checkpoint() {
|
|
100
100
|
local latest=""
|
|
101
101
|
local latest_time=0
|
|
@@ -106,7 +106,7 @@ find_latest_checkpoint() {
|
|
|
106
106
|
if [ -f "$META_FILE" ]; then
|
|
107
107
|
CREATED=$(jq -r '.created_at // ""' "$META_FILE")
|
|
108
108
|
if [ -n "$CREATED" ]; then
|
|
109
|
-
#
|
|
109
|
+
# Timestamp comparison (simple string comparison)
|
|
110
110
|
if [[ "$CREATED" > "$latest_time" ]]; then
|
|
111
111
|
latest_time="$CREATED"
|
|
112
112
|
latest=$(basename "$cp_dir")
|
|
@@ -119,14 +119,14 @@ find_latest_checkpoint() {
|
|
|
119
119
|
echo "$latest"
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
#
|
|
122
|
+
# Restore function
|
|
123
123
|
restore_checkpoint() {
|
|
124
124
|
local cp_id=$1
|
|
125
125
|
local cp_dir="$CHECKPOINTS_DIR/$cp_id"
|
|
126
126
|
|
|
127
127
|
if [ ! -d "$cp_dir" ]; then
|
|
128
|
-
echo -e "${RED}
|
|
129
|
-
echo " /restore --list
|
|
128
|
+
echo -e "${RED}Error:${NC} Checkpoint not found: $cp_id"
|
|
129
|
+
echo " Use /restore --list to see available checkpoints."
|
|
130
130
|
exit 1
|
|
131
131
|
fi
|
|
132
132
|
|
|
@@ -136,20 +136,20 @@ restore_checkpoint() {
|
|
|
136
136
|
CREATED=$(jq -r '.created_at // "unknown"' "$META_FILE")
|
|
137
137
|
|
|
138
138
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
139
|
-
echo -e "⚠️ ${WHITE}
|
|
139
|
+
echo -e "⚠️ ${WHITE}Checkpoint Restoration${NC}"
|
|
140
140
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
141
|
-
echo -e "
|
|
142
|
-
echo -e "
|
|
141
|
+
echo -e "Checkpoint: ${CYAN}$cp_id${NC}"
|
|
142
|
+
echo -e "Stage: ${CYAN}$STAGE${NC}"
|
|
143
143
|
if [ -n "$DESC" ] && [ "$DESC" != "null" ]; then
|
|
144
|
-
echo -e "
|
|
144
|
+
echo -e "Description: $DESC"
|
|
145
145
|
fi
|
|
146
|
-
echo -e "
|
|
146
|
+
echo -e "Created: $CREATED"
|
|
147
147
|
echo ""
|
|
148
148
|
|
|
149
149
|
if [ "$DRY_RUN" = true ]; then
|
|
150
|
-
echo -e "${YELLOW}[DRY-RUN]
|
|
150
|
+
echo -e "${YELLOW}[DRY-RUN] Not executing actual restoration.${NC}"
|
|
151
151
|
echo ""
|
|
152
|
-
echo "
|
|
152
|
+
echo "Files to be restored:"
|
|
153
153
|
find "$cp_dir" -type f | while read -r f; do
|
|
154
154
|
echo " - $(basename "$f")"
|
|
155
155
|
done
|
|
@@ -158,62 +158,62 @@ restore_checkpoint() {
|
|
|
158
158
|
fi
|
|
159
159
|
|
|
160
160
|
if [ "$FORCE_MODE" = false ]; then
|
|
161
|
-
echo -e "${YELLOW}⚠️
|
|
162
|
-
echo -e "
|
|
161
|
+
echo -e "${YELLOW}⚠️ Warning: Current state will be restored to that point.${NC}"
|
|
162
|
+
echo -e " Current changes may be lost."
|
|
163
163
|
echo ""
|
|
164
|
-
read -p "
|
|
164
|
+
read -p "Proceed with restoration? [y/N] " -n 1 -r
|
|
165
165
|
echo
|
|
166
166
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
167
|
-
echo -e "${YELLOW}
|
|
167
|
+
echo -e "${YELLOW}Cancelled.${NC}"
|
|
168
168
|
exit 0
|
|
169
169
|
fi
|
|
170
170
|
fi
|
|
171
171
|
|
|
172
172
|
echo ""
|
|
173
|
-
echo "
|
|
173
|
+
echo "Restoring..."
|
|
174
174
|
|
|
175
|
-
#
|
|
175
|
+
# Backup current state (optional)
|
|
176
176
|
if [ "$BACKUP_MODE" = true ]; then
|
|
177
177
|
BACKUP_ID="BACKUP-$(date +%Y%m%d-%H%M%S)"
|
|
178
178
|
BACKUP_DIR="$CHECKPOINTS_DIR/$BACKUP_ID"
|
|
179
179
|
mkdir -p "$BACKUP_DIR"
|
|
180
180
|
cp "$PROGRESS_FILE" "$BACKUP_DIR/progress.json" 2>/dev/null || true
|
|
181
|
-
echo -e "${GREEN}✓${NC}
|
|
181
|
+
echo -e "${GREEN}✓${NC} Current state backed up: $BACKUP_ID"
|
|
182
182
|
fi
|
|
183
183
|
|
|
184
|
-
# progress.json
|
|
184
|
+
# Restore progress.json
|
|
185
185
|
if [ -f "$cp_dir/progress.json" ]; then
|
|
186
186
|
cp "$cp_dir/progress.json" "$PROGRESS_FILE"
|
|
187
|
-
echo -e "${GREEN}✓${NC} progress.json
|
|
187
|
+
echo -e "${GREEN}✓${NC} progress.json restored"
|
|
188
188
|
fi
|
|
189
189
|
|
|
190
|
-
# outputs
|
|
190
|
+
# Restore outputs
|
|
191
191
|
STAGE_DIR="$PROJECT_ROOT/stages/$STAGE"
|
|
192
192
|
if [ -d "$cp_dir/outputs" ]; then
|
|
193
193
|
rm -rf "$STAGE_DIR/outputs" 2>/dev/null || true
|
|
194
194
|
cp -r "$cp_dir/outputs" "$STAGE_DIR/"
|
|
195
195
|
FILE_COUNT=$(find "$cp_dir/outputs" -type f | wc -l | tr -d ' ')
|
|
196
|
-
echo -e "${GREEN}✓${NC}
|
|
196
|
+
echo -e "${GREEN}✓${NC} Output files restored (${FILE_COUNT} files)"
|
|
197
197
|
fi
|
|
198
198
|
|
|
199
|
-
# HANDOFF.md
|
|
199
|
+
# Restore HANDOFF.md
|
|
200
200
|
if [ -f "$cp_dir/HANDOFF.md" ]; then
|
|
201
201
|
cp "$cp_dir/HANDOFF.md" "$STAGE_DIR/"
|
|
202
|
-
echo -e "${GREEN}✓${NC} HANDOFF.md
|
|
202
|
+
echo -e "${GREEN}✓${NC} HANDOFF.md restored"
|
|
203
203
|
fi
|
|
204
204
|
|
|
205
|
-
# progress.json
|
|
205
|
+
# Update current stage in progress.json
|
|
206
206
|
jq ".current_stage = \"$STAGE\" | .stages.\"$STAGE\".status = \"in_progress\"" \
|
|
207
207
|
"$PROGRESS_FILE" > "${PROGRESS_FILE}.tmp" && mv "${PROGRESS_FILE}.tmp" "$PROGRESS_FILE"
|
|
208
208
|
|
|
209
209
|
echo ""
|
|
210
210
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
211
|
-
echo -e "${GREEN}✅${NC}
|
|
212
|
-
echo -e "
|
|
211
|
+
echo -e "${GREEN}✅${NC} Checkpoint restoration complete!"
|
|
212
|
+
echo -e "Current stage: ${CYAN}$STAGE${NC}"
|
|
213
213
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
#
|
|
216
|
+
# Main logic
|
|
217
217
|
if [ "$LIST_MODE" = true ]; then
|
|
218
218
|
list_checkpoints
|
|
219
219
|
exit 0
|
|
@@ -222,10 +222,10 @@ fi
|
|
|
222
222
|
if [ "$LATEST_MODE" = true ]; then
|
|
223
223
|
CP_ID=$(find_latest_checkpoint)
|
|
224
224
|
if [ -z "$CP_ID" ]; then
|
|
225
|
-
echo -e "${RED}
|
|
225
|
+
echo -e "${RED}Error:${NC} No checkpoints available to restore."
|
|
226
226
|
exit 1
|
|
227
227
|
fi
|
|
228
|
-
echo -e "
|
|
228
|
+
echo -e "Latest checkpoint: ${CYAN}$CP_ID${NC}"
|
|
229
229
|
restore_checkpoint "$CP_ID"
|
|
230
230
|
exit 0
|
|
231
231
|
fi
|
|
@@ -235,13 +235,13 @@ if [ -n "$CP_ID" ]; then
|
|
|
235
235
|
exit 0
|
|
236
236
|
fi
|
|
237
237
|
|
|
238
|
-
#
|
|
239
|
-
echo "
|
|
240
|
-
echo " /restore --list
|
|
241
|
-
echo " /restore --latest
|
|
242
|
-
echo " /restore [CP-ID]
|
|
238
|
+
# Show help if no arguments
|
|
239
|
+
echo "Usage:"
|
|
240
|
+
echo " /restore --list View checkpoint list"
|
|
241
|
+
echo " /restore --latest Restore to latest checkpoint"
|
|
242
|
+
echo " /restore [CP-ID] Restore to specific checkpoint"
|
|
243
243
|
echo ""
|
|
244
|
-
echo "
|
|
245
|
-
echo " --force
|
|
246
|
-
echo " --backup
|
|
247
|
-
echo " --dry-run
|
|
244
|
+
echo "Options:"
|
|
245
|
+
echo " --force Restore without confirmation"
|
|
246
|
+
echo " --backup Backup current state before restoration"
|
|
247
|
+
echo " --dry-run Preview without actual restoration"
|