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,9 +1,9 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# session-start.sh -
|
|
2
|
+
# session-start.sh - Session start auto-recovery
|
|
3
3
|
# claude-symphony workflow pipeline
|
|
4
4
|
#
|
|
5
|
-
# SessionStart hook: Claude Code
|
|
6
|
-
#
|
|
5
|
+
# SessionStart hook: Runs when Claude Code session starts/resumes
|
|
6
|
+
# If snapshot exists from /compact, provides auto context recovery guidance
|
|
7
7
|
|
|
8
8
|
set -e
|
|
9
9
|
|
|
@@ -12,64 +12,64 @@ TRIGGER_FILE="$PROJECT_ROOT/state/context/auto-trigger.json"
|
|
|
12
12
|
CONTEXT_DIR="$PROJECT_ROOT/state/context"
|
|
13
13
|
PROGRESS_FILE="$PROJECT_ROOT/state/progress.json"
|
|
14
14
|
|
|
15
|
-
#
|
|
15
|
+
# Ensure context directory
|
|
16
16
|
mkdir -p "$CONTEXT_DIR"
|
|
17
17
|
|
|
18
|
-
# jq
|
|
18
|
+
# jq required
|
|
19
19
|
if ! command -v jq &> /dev/null; then
|
|
20
20
|
exit 0
|
|
21
21
|
fi
|
|
22
22
|
|
|
23
|
-
# 1.
|
|
23
|
+
# 1. Check trigger file - if compact was executed
|
|
24
24
|
if [ ! -f "$TRIGGER_FILE" ]; then
|
|
25
|
-
exit 0 #
|
|
25
|
+
exit 0 # No recovery needed
|
|
26
26
|
fi
|
|
27
27
|
|
|
28
28
|
COMPACT_SCHEDULED=$(jq -r '.compact_scheduled // false' "$TRIGGER_FILE" 2>/dev/null || echo "false")
|
|
29
29
|
if [ "$COMPACT_SCHEDULED" != "true" ]; then
|
|
30
|
-
exit 0 # compact
|
|
30
|
+
exit 0 # compact not scheduled
|
|
31
31
|
fi
|
|
32
32
|
|
|
33
|
-
# 2.
|
|
33
|
+
# 2. Find latest snapshot
|
|
34
34
|
LATEST_SNAPSHOT=$(ls -1t "$CONTEXT_DIR"/auto-snapshot-*.md 2>/dev/null | head -1)
|
|
35
35
|
if [ -z "$LATEST_SNAPSHOT" ]; then
|
|
36
|
-
#
|
|
36
|
+
# No snapshot - cleanup trigger file
|
|
37
37
|
rm -f "$TRIGGER_FILE"
|
|
38
38
|
exit 0
|
|
39
39
|
fi
|
|
40
40
|
|
|
41
|
-
# 3.
|
|
41
|
+
# 3. Get current stage info
|
|
42
42
|
CURRENT_STAGE="none"
|
|
43
43
|
if [ -f "$PROGRESS_FILE" ]; then
|
|
44
44
|
CURRENT_STAGE=$(jq -r '.current_stage // "none"' "$PROGRESS_FILE" 2>/dev/null || echo "none")
|
|
45
45
|
fi
|
|
46
46
|
|
|
47
|
-
# 4.
|
|
47
|
+
# 4. Create recovery context (passed to Claude)
|
|
48
48
|
RECOVERY_CONTEXT=$(cat << EOF
|
|
49
49
|
|
|
50
50
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
51
|
-
🔄
|
|
51
|
+
🔄 Session Recovery - Restart after auto /compact
|
|
52
52
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
53
53
|
|
|
54
|
-
##
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
54
|
+
## Recovery Information
|
|
55
|
+
- Snapshot: $(basename "$LATEST_SNAPSHOT")
|
|
56
|
+
- Stage: $CURRENT_STAGE
|
|
57
|
+
- Save time: $(jq -r '.timestamp // "unknown"' "$TRIGGER_FILE" 2>/dev/null)
|
|
58
58
|
|
|
59
|
-
##
|
|
59
|
+
## Snapshot Contents
|
|
60
60
|
$(cat "$LATEST_SNAPSHOT" 2>/dev/null | head -50)
|
|
61
61
|
|
|
62
|
-
##
|
|
63
|
-
1.
|
|
64
|
-
2. stages/$CURRENT_STAGE/CLAUDE.md
|
|
65
|
-
3.
|
|
62
|
+
## Recovery Instructions
|
|
63
|
+
1. Review snapshot contents above to understand work context
|
|
64
|
+
2. Check stages/$CURRENT_STAGE/CLAUDE.md
|
|
65
|
+
3. Resume from interrupted work
|
|
66
66
|
|
|
67
67
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
68
68
|
EOF
|
|
69
69
|
)
|
|
70
70
|
|
|
71
|
-
# 5. JSON
|
|
72
|
-
#
|
|
71
|
+
# 5. JSON output (passing context to Claude)
|
|
72
|
+
# Claude receives recovery info through additionalContext
|
|
73
73
|
cat << EOF
|
|
74
74
|
{
|
|
75
75
|
"hookSpecificOutput": {
|
|
@@ -79,12 +79,12 @@ cat << EOF
|
|
|
79
79
|
}
|
|
80
80
|
EOF
|
|
81
81
|
|
|
82
|
-
# 6.
|
|
82
|
+
# 6. Cleanup trigger file (mark recovery complete)
|
|
83
83
|
jq '. + {"recovered": true, "recovery_time": "'"$(date -Iseconds)"'"}' \
|
|
84
84
|
"$TRIGGER_FILE" > "$TRIGGER_FILE.tmp" && mv "$TRIGGER_FILE.tmp" "$TRIGGER_FILE"
|
|
85
85
|
|
|
86
|
-
#
|
|
87
|
-
#
|
|
86
|
+
# Delete trigger file after some time (prevent duplicate recovery in next session)
|
|
87
|
+
# Delete in background after 5 minutes
|
|
88
88
|
(sleep 300 && rm -f "$TRIGGER_FILE" 2>/dev/null) &
|
|
89
89
|
|
|
90
90
|
exit 0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# statusline.sh - Claude Code Statusline API
|
|
2
|
+
# statusline.sh - Real-time context monitoring via Claude Code Statusline API
|
|
3
3
|
# claude-symphony workflow pipeline
|
|
4
4
|
#
|
|
5
|
-
# Claude Code
|
|
6
|
-
#
|
|
5
|
+
# Claude Code passes JSON to stdin every ~300ms.
|
|
6
|
+
# This script analyzes remaining_percentage and performs auto actions when thresholds are reached.
|
|
7
7
|
|
|
8
8
|
set -e
|
|
9
9
|
|
|
@@ -12,69 +12,69 @@ STATE_FILE="$PROJECT_ROOT/state/context/auto-trigger.json"
|
|
|
12
12
|
PROGRESS_FILE="$PROJECT_ROOT/state/progress.json"
|
|
13
13
|
CONTEXT_DIR="$PROJECT_ROOT/state/context"
|
|
14
14
|
|
|
15
|
-
#
|
|
15
|
+
# Ensure context directory
|
|
16
16
|
mkdir -p "$CONTEXT_DIR"
|
|
17
17
|
|
|
18
|
-
#
|
|
18
|
+
# Read JSON from stdin
|
|
19
19
|
input=$(cat)
|
|
20
20
|
|
|
21
|
-
# JSON
|
|
21
|
+
# JSON parsing (jq required)
|
|
22
22
|
if ! command -v jq &> /dev/null; then
|
|
23
|
-
echo "[CTX] jq
|
|
23
|
+
echo "[CTX] jq required"
|
|
24
24
|
exit 0
|
|
25
25
|
fi
|
|
26
26
|
|
|
27
|
-
#
|
|
27
|
+
# Extract context data
|
|
28
28
|
REMAINING=$(echo "$input" | jq -r '.context_window.remaining_percentage // 100' 2>/dev/null || echo "100")
|
|
29
29
|
USED=$(echo "$input" | jq -r '.context_window.used_percentage // 0' 2>/dev/null || echo "0")
|
|
30
30
|
MODEL=$(echo "$input" | jq -r '.model.display_name // "Claude"' 2>/dev/null || echo "Claude")
|
|
31
31
|
CONTEXT_SIZE=$(echo "$input" | jq -r '.context_window.context_window_size // 200000' 2>/dev/null || echo "200000")
|
|
32
32
|
|
|
33
|
-
#
|
|
33
|
+
# Get current stage
|
|
34
34
|
if [ -f "$PROGRESS_FILE" ]; then
|
|
35
35
|
CURRENT_STAGE=$(jq -r '.current_stage // "none"' "$PROGRESS_FILE" 2>/dev/null || echo "none")
|
|
36
36
|
else
|
|
37
37
|
CURRENT_STAGE="none"
|
|
38
38
|
fi
|
|
39
39
|
|
|
40
|
-
#
|
|
40
|
+
# Convert to integer for numeric comparison
|
|
41
41
|
REMAINING_INT=$(printf "%.0f" "$REMAINING" 2>/dev/null || echo "100")
|
|
42
42
|
|
|
43
|
-
#
|
|
44
|
-
#
|
|
43
|
+
# Determine status and color
|
|
44
|
+
# Thresholds: 60% warning, 50% auto-save, 40% critical
|
|
45
45
|
if [ "$REMAINING_INT" -le 40 ]; then
|
|
46
|
-
# 40%
|
|
46
|
+
# 40% or below: Critical - recommend /clear
|
|
47
47
|
STATUS_ICON="🔴"
|
|
48
48
|
STATUS_TEXT="CTX≤40%"
|
|
49
49
|
NEEDS_ACTION="critical"
|
|
50
50
|
elif [ "$REMAINING_INT" -le 50 ]; then
|
|
51
|
-
# 50%
|
|
51
|
+
# 50% or below: Auto snapshot trigger
|
|
52
52
|
STATUS_ICON="⚠️"
|
|
53
53
|
STATUS_TEXT="CTX≤50%"
|
|
54
54
|
NEEDS_ACTION="warning"
|
|
55
55
|
elif [ "$REMAINING_INT" -le 60 ]; then
|
|
56
|
-
# 60%
|
|
56
|
+
# 60% or below: Warning display
|
|
57
57
|
STATUS_ICON="⚡"
|
|
58
58
|
STATUS_TEXT="CTX≤60%"
|
|
59
59
|
NEEDS_ACTION="notice"
|
|
60
60
|
else
|
|
61
|
-
#
|
|
61
|
+
# Normal
|
|
62
62
|
STATUS_ICON="✓"
|
|
63
63
|
STATUS_TEXT=""
|
|
64
64
|
NEEDS_ACTION="none"
|
|
65
65
|
fi
|
|
66
66
|
|
|
67
|
-
# 50%
|
|
67
|
+
# Auto action when 50% or below
|
|
68
68
|
if [ "$NEEDS_ACTION" = "warning" ] || [ "$NEEDS_ACTION" = "critical" ]; then
|
|
69
|
-
#
|
|
69
|
+
# Check if already triggered (prevent duplicates)
|
|
70
70
|
ALREADY_TRIGGERED=false
|
|
71
71
|
if [ -f "$STATE_FILE" ]; then
|
|
72
72
|
TRIGGERED=$(jq -r '.triggered // false' "$STATE_FILE" 2>/dev/null || echo "false")
|
|
73
73
|
TRIGGER_REMAINING=$(jq -r '.remaining // 100' "$STATE_FILE" 2>/dev/null || echo "100")
|
|
74
74
|
|
|
75
|
-
#
|
|
75
|
+
# Skip if already triggered at same level
|
|
76
76
|
if [ "$TRIGGERED" = "true" ]; then
|
|
77
|
-
#
|
|
77
|
+
# Re-trigger if dropped to lower level
|
|
78
78
|
if [ "$REMAINING_INT" -lt "$TRIGGER_REMAINING" ]; then
|
|
79
79
|
ALREADY_TRIGGERED=false
|
|
80
80
|
else
|
|
@@ -84,7 +84,7 @@ if [ "$NEEDS_ACTION" = "warning" ] || [ "$NEEDS_ACTION" = "critical" ]; then
|
|
|
84
84
|
fi
|
|
85
85
|
|
|
86
86
|
if [ "$ALREADY_TRIGGERED" = false ]; then
|
|
87
|
-
#
|
|
87
|
+
# Record trigger state
|
|
88
88
|
cat > "$STATE_FILE" << EOF
|
|
89
89
|
{
|
|
90
90
|
"triggered": true,
|
|
@@ -95,19 +95,19 @@ if [ "$NEEDS_ACTION" = "warning" ] || [ "$NEEDS_ACTION" = "critical" ]; then
|
|
|
95
95
|
}
|
|
96
96
|
EOF
|
|
97
97
|
|
|
98
|
-
#
|
|
98
|
+
# Create auto snapshot (background)
|
|
99
99
|
if [ -x "$PROJECT_ROOT/scripts/context-manager.sh" ]; then
|
|
100
100
|
"$PROJECT_ROOT/scripts/context-manager.sh" --auto-compact "$NEEDS_ACTION" 2>/dev/null &
|
|
101
101
|
fi
|
|
102
102
|
fi
|
|
103
103
|
fi
|
|
104
104
|
|
|
105
|
-
#
|
|
105
|
+
# Reset trigger state when context is sufficient (70% or above)
|
|
106
106
|
if [ "$REMAINING_INT" -ge 70 ] && [ -f "$STATE_FILE" ]; then
|
|
107
107
|
rm -f "$STATE_FILE"
|
|
108
108
|
fi
|
|
109
109
|
|
|
110
|
-
#
|
|
110
|
+
# Output statusline
|
|
111
111
|
if [ -n "$STATUS_TEXT" ]; then
|
|
112
112
|
echo "[$MODEL] $STATUS_ICON $STATUS_TEXT ${REMAINING_INT}% | Stage: $CURRENT_STAGE"
|
|
113
113
|
else
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# stop.sh -
|
|
2
|
+
# stop.sh - Auto context management after Claude response
|
|
3
3
|
# claude-symphony workflow pipeline
|
|
4
4
|
#
|
|
5
|
-
# Stop hook:
|
|
6
|
-
#
|
|
5
|
+
# Stop hook: Runs after Claude response completes
|
|
6
|
+
# If context is 50% or below, automatically runs /compact
|
|
7
7
|
|
|
8
8
|
set -e
|
|
9
9
|
|
|
@@ -13,23 +13,23 @@ COOLDOWN_FILE="$PROJECT_ROOT/state/context/.last-compact"
|
|
|
13
13
|
CONTEXT_DIR="$PROJECT_ROOT/state/context"
|
|
14
14
|
PROGRESS_FILE="$PROJECT_ROOT/state/progress.json"
|
|
15
15
|
|
|
16
|
-
#
|
|
16
|
+
# Cooldown time (seconds) - 5 minutes
|
|
17
17
|
COOLDOWN_SECONDS=300
|
|
18
18
|
|
|
19
|
-
#
|
|
19
|
+
# Ensure context directory
|
|
20
20
|
mkdir -p "$CONTEXT_DIR"
|
|
21
21
|
|
|
22
|
-
# jq
|
|
22
|
+
# jq required
|
|
23
23
|
if ! command -v jq &> /dev/null; then
|
|
24
24
|
exit 0
|
|
25
25
|
fi
|
|
26
26
|
|
|
27
|
-
#
|
|
27
|
+
# Read hook data from stdin
|
|
28
28
|
input=$(cat)
|
|
29
29
|
|
|
30
|
-
# 1.
|
|
30
|
+
# 1. Check trigger file (created by statusline.sh)
|
|
31
31
|
if [ ! -f "$TRIGGER_FILE" ]; then
|
|
32
|
-
exit 0 #
|
|
32
|
+
exit 0 # No trigger - normal state
|
|
33
33
|
fi
|
|
34
34
|
|
|
35
35
|
TRIGGERED=$(jq -r '.triggered // false' "$TRIGGER_FILE" 2>/dev/null || echo "false")
|
|
@@ -40,65 +40,65 @@ fi
|
|
|
40
40
|
REMAINING=$(jq -r '.remaining // 100' "$TRIGGER_FILE" 2>/dev/null || echo "100")
|
|
41
41
|
LEVEL=$(jq -r '.level // "warning"' "$TRIGGER_FILE" 2>/dev/null || echo "warning")
|
|
42
42
|
|
|
43
|
-
# 50%
|
|
43
|
+
# Skip if not 50% or below
|
|
44
44
|
if [ "$REMAINING" -gt 50 ]; then
|
|
45
45
|
exit 0
|
|
46
46
|
fi
|
|
47
47
|
|
|
48
|
-
# 2.
|
|
48
|
+
# 2. Check cooldown (prevent re-run within 5 minutes)
|
|
49
49
|
if [ -f "$COOLDOWN_FILE" ]; then
|
|
50
50
|
LAST_COMPACT=$(cat "$COOLDOWN_FILE" 2>/dev/null || echo "0")
|
|
51
51
|
NOW=$(date +%s)
|
|
52
52
|
ELAPSED=$((NOW - LAST_COMPACT))
|
|
53
53
|
|
|
54
54
|
if [ "$ELAPSED" -lt "$COOLDOWN_SECONDS" ]; then
|
|
55
|
-
#
|
|
55
|
+
# In cooldown - skip
|
|
56
56
|
REMAINING_COOLDOWN=$((COOLDOWN_SECONDS - ELAPSED))
|
|
57
57
|
exit 0
|
|
58
58
|
fi
|
|
59
59
|
fi
|
|
60
60
|
|
|
61
|
-
# 3. tmux
|
|
61
|
+
# 3. Check tmux session
|
|
62
62
|
if [ -z "$TMUX" ]; then
|
|
63
|
-
# tmux
|
|
63
|
+
# Not in tmux session - provide manual guidance only
|
|
64
64
|
echo ""
|
|
65
65
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
66
|
-
echo "⚠️
|
|
66
|
+
echo "⚠️ Context ${REMAINING}% - Running /compact is recommended"
|
|
67
67
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
68
68
|
exit 0
|
|
69
69
|
fi
|
|
70
70
|
|
|
71
|
-
# 4.
|
|
71
|
+
# 4. Verify snapshot saved (should be saved by statusline.sh already)
|
|
72
72
|
LATEST_SNAPSHOT=$(ls -1t "$CONTEXT_DIR"/auto-snapshot-*.md 2>/dev/null | head -1)
|
|
73
73
|
if [ -z "$LATEST_SNAPSHOT" ]; then
|
|
74
|
-
#
|
|
74
|
+
# No snapshot - save first
|
|
75
75
|
"$PROJECT_ROOT/scripts/context-manager.sh" --auto-compact "$LEVEL" 2>/dev/null || true
|
|
76
76
|
LATEST_SNAPSHOT=$(ls -1t "$CONTEXT_DIR"/auto-snapshot-*.md 2>/dev/null | head -1)
|
|
77
77
|
fi
|
|
78
78
|
|
|
79
|
-
#
|
|
79
|
+
# Skip for safety if snapshot still doesn't exist
|
|
80
80
|
if [ -z "$LATEST_SNAPSHOT" ]; then
|
|
81
81
|
echo ""
|
|
82
|
-
echo "⚠️
|
|
82
|
+
echo "⚠️ Snapshot save failed - Auto /compact cancelled"
|
|
83
83
|
exit 0
|
|
84
84
|
fi
|
|
85
85
|
|
|
86
|
-
# 5.
|
|
86
|
+
# 5. Pre-notification
|
|
87
87
|
echo ""
|
|
88
88
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
89
|
-
echo "🔄
|
|
90
|
-
echo "
|
|
89
|
+
echo "🔄 Context ${REMAINING}% - Running auto /compact..."
|
|
90
|
+
echo " Snapshot: $(basename "$LATEST_SNAPSHOT")"
|
|
91
91
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
92
92
|
|
|
93
|
-
# 6.
|
|
93
|
+
# 6. Record cooldown timer
|
|
94
94
|
date +%s > "$COOLDOWN_FILE"
|
|
95
95
|
|
|
96
|
-
# 7.
|
|
96
|
+
# 7. Mark compact scheduled in trigger file
|
|
97
97
|
jq '. + {"compact_scheduled": true, "compact_time": "'"$(date -Iseconds)"'"}' \
|
|
98
98
|
"$TRIGGER_FILE" > "$TRIGGER_FILE.tmp" && mv "$TRIGGER_FILE.tmp" "$TRIGGER_FILE"
|
|
99
99
|
|
|
100
|
-
# 8. tmux send-keys
|
|
101
|
-
sleep 1 #
|
|
100
|
+
# 8. Run /compact via tmux send-keys (to current pane)
|
|
101
|
+
sleep 1 # Brief wait (for output to be visible)
|
|
102
102
|
tmux send-keys "/compact" Enter
|
|
103
103
|
|
|
104
104
|
exit 0
|
|
@@ -20,129 +20,129 @@
|
|
|
20
20
|
},
|
|
21
21
|
|
|
22
22
|
"hooks_info": {
|
|
23
|
-
"note": "
|
|
24
|
-
"stop": ".claude/hooks/stop.sh -
|
|
25
|
-
"session_start": ".claude/hooks/session-start.sh -
|
|
23
|
+
"note": "Actual hooks settings are in settings.local.json",
|
|
24
|
+
"stop": ".claude/hooks/stop.sh - auto /compact",
|
|
25
|
+
"session_start": ".claude/hooks/session-start.sh - auto recovery"
|
|
26
26
|
},
|
|
27
27
|
|
|
28
28
|
"commands": {
|
|
29
29
|
"init-project": {
|
|
30
|
-
"description": "
|
|
30
|
+
"description": "Initialize new project",
|
|
31
31
|
"file": "commands/init-project.md"
|
|
32
32
|
},
|
|
33
33
|
"run-stage": {
|
|
34
|
-
"description": "
|
|
34
|
+
"description": "Run stage",
|
|
35
35
|
"file": "commands/run-stage.md"
|
|
36
36
|
},
|
|
37
37
|
"handoff": {
|
|
38
|
-
"description": "
|
|
38
|
+
"description": "Generate handoff document",
|
|
39
39
|
"file": "commands/handoff.md"
|
|
40
40
|
},
|
|
41
41
|
"checkpoint": {
|
|
42
|
-
"description": "
|
|
42
|
+
"description": "Create checkpoint",
|
|
43
43
|
"file": "commands/checkpoint.md"
|
|
44
44
|
},
|
|
45
45
|
"gemini": {
|
|
46
|
-
"description": "Gemini CLI
|
|
46
|
+
"description": "Call Gemini CLI (tmux)",
|
|
47
47
|
"file": "commands/gemini.md"
|
|
48
48
|
},
|
|
49
49
|
"codex": {
|
|
50
|
-
"description": "Codex CLI
|
|
50
|
+
"description": "Call Codex CLI (tmux)",
|
|
51
51
|
"file": "commands/codex.md"
|
|
52
52
|
},
|
|
53
53
|
"status": {
|
|
54
|
-
"description": "
|
|
54
|
+
"description": "Check pipeline status",
|
|
55
55
|
"file": "commands/status.md"
|
|
56
56
|
},
|
|
57
57
|
"stages": {
|
|
58
|
-
"description": "
|
|
58
|
+
"description": "Stage list and details",
|
|
59
59
|
"file": "commands/stages.md"
|
|
60
60
|
},
|
|
61
61
|
"restore": {
|
|
62
|
-
"description": "
|
|
62
|
+
"description": "Restore checkpoint",
|
|
63
63
|
"file": "commands/restore.md"
|
|
64
64
|
},
|
|
65
65
|
"next": {
|
|
66
|
-
"description": "
|
|
66
|
+
"description": "Transition to next stage",
|
|
67
67
|
"file": "commands/next.md"
|
|
68
68
|
},
|
|
69
69
|
"context": {
|
|
70
|
-
"description": "
|
|
70
|
+
"description": "Context state management",
|
|
71
71
|
"file": "commands/context.md"
|
|
72
72
|
},
|
|
73
73
|
"brainstorm": {
|
|
74
|
-
"description": "01-brainstorm
|
|
74
|
+
"description": "Start 01-brainstorm stage",
|
|
75
75
|
"file": "commands/brainstorm.md"
|
|
76
76
|
},
|
|
77
77
|
"research": {
|
|
78
|
-
"description": "02-research
|
|
78
|
+
"description": "Start 02-research stage",
|
|
79
79
|
"file": "commands/research.md"
|
|
80
80
|
},
|
|
81
81
|
"planning": {
|
|
82
|
-
"description": "03-planning
|
|
82
|
+
"description": "Start 03-planning stage",
|
|
83
83
|
"file": "commands/planning.md"
|
|
84
84
|
},
|
|
85
85
|
"ui-ux": {
|
|
86
|
-
"description": "04-ui-ux
|
|
86
|
+
"description": "Start 04-ui-ux stage",
|
|
87
87
|
"file": "commands/ui-ux.md"
|
|
88
88
|
},
|
|
89
89
|
"tasks": {
|
|
90
|
-
"description": "05-task-management
|
|
90
|
+
"description": "Start 05-task-management stage",
|
|
91
91
|
"file": "commands/tasks.md"
|
|
92
92
|
},
|
|
93
93
|
"implement": {
|
|
94
|
-
"description": "06-implementation
|
|
94
|
+
"description": "Start 06-implementation stage",
|
|
95
95
|
"file": "commands/implement.md"
|
|
96
96
|
},
|
|
97
97
|
"refactor": {
|
|
98
|
-
"description": "07-refactoring
|
|
98
|
+
"description": "Start 07-refactoring stage",
|
|
99
99
|
"file": "commands/refactor.md"
|
|
100
100
|
},
|
|
101
101
|
"qa": {
|
|
102
|
-
"description": "08-qa
|
|
102
|
+
"description": "Start 08-qa stage",
|
|
103
103
|
"file": "commands/qa.md"
|
|
104
104
|
},
|
|
105
105
|
"test": {
|
|
106
|
-
"description": "09-testing
|
|
106
|
+
"description": "Start 09-testing stage",
|
|
107
107
|
"file": "commands/test.md"
|
|
108
108
|
},
|
|
109
109
|
"deploy": {
|
|
110
|
-
"description": "10-deployment
|
|
110
|
+
"description": "Start 10-deployment stage",
|
|
111
111
|
"file": "commands/deploy.md"
|
|
112
112
|
},
|
|
113
113
|
"collaborate": {
|
|
114
|
-
"description": "Multi-AI
|
|
114
|
+
"description": "Run Multi-AI collaboration",
|
|
115
115
|
"file": "commands/collaborate.md"
|
|
116
116
|
},
|
|
117
117
|
"benchmark": {
|
|
118
|
-
"description": "AI
|
|
118
|
+
"description": "AI model benchmarking",
|
|
119
119
|
"file": "commands/benchmark.md"
|
|
120
120
|
},
|
|
121
121
|
"fork": {
|
|
122
|
-
"description": "
|
|
122
|
+
"description": "Pipeline branch management",
|
|
123
123
|
"file": "commands/fork.md"
|
|
124
124
|
},
|
|
125
125
|
"validate": {
|
|
126
|
-
"description": "
|
|
126
|
+
"description": "Run output validation",
|
|
127
127
|
"file": "commands/validate.md"
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
|
|
131
131
|
"skills": {
|
|
132
132
|
"smart-handoff": {
|
|
133
|
-
"description": "
|
|
133
|
+
"description": "Smart context extraction and HANDOFF generation",
|
|
134
134
|
"directory": "skills/smart-handoff"
|
|
135
135
|
},
|
|
136
136
|
"ai-collaboration": {
|
|
137
|
-
"description": "Multi-AI
|
|
137
|
+
"description": "Multi-AI collaboration orchestration",
|
|
138
138
|
"directory": "skills/ai-collaboration"
|
|
139
139
|
},
|
|
140
140
|
"auto-checkpoint": {
|
|
141
|
-
"description": "
|
|
141
|
+
"description": "Automatic checkpoint generation",
|
|
142
142
|
"directory": "skills/auto-checkpoint"
|
|
143
143
|
},
|
|
144
144
|
"output-validator": {
|
|
145
|
-
"description": "
|
|
145
|
+
"description": "Output validation and quality verification",
|
|
146
146
|
"directory": "skills/output-validator"
|
|
147
147
|
}
|
|
148
148
|
}
|
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
# AI Collaboration Skill
|
|
2
2
|
|
|
3
|
-
Multi-AI
|
|
3
|
+
Multi-AI Collaboration and Orchestration Skill
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
7
|
+
Collaborate multiple AI models (Claude, Gemini, Codex) to generate better results:
|
|
8
|
+
- Gain diverse perspectives through parallel execution
|
|
9
|
+
- Gradual improvement through sequential handoff
|
|
10
|
+
- Derive optimal conclusions through debate mode
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Trigger
|
|
13
13
|
|
|
14
|
-
- `/collaborate`
|
|
15
|
-
-
|
|
16
|
-
-
|
|
14
|
+
- `/collaborate` command
|
|
15
|
+
- Auto-suggested when complex task detected
|
|
16
|
+
- When low confidence detected
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Collaboration Modes
|
|
19
19
|
|
|
20
|
-
### 1. Parallel Execution
|
|
21
|
-
|
|
20
|
+
### 1. Parallel Execution
|
|
21
|
+
Multiple AIs perform the same task simultaneously → Select optimal result
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
/collaborate --mode parallel --task "
|
|
24
|
+
/collaborate --mode parallel --task "idea generation" --models "gemini,claude"
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
### 2. Sequential Handoff
|
|
28
|
-
AI
|
|
27
|
+
### 2. Sequential Handoff
|
|
28
|
+
AI relay to gradually improve results
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
31
|
/collaborate --mode sequential --chain "code_review"
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
### 3. Debate Mode
|
|
35
|
-
AI
|
|
34
|
+
### 3. Debate Mode
|
|
35
|
+
AI debate to derive optimal conclusions from various perspectives
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
/collaborate --mode debate --topic "
|
|
38
|
+
/collaborate --mode debate --topic "architecture selection" --rounds 3
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## File Structure
|
|
42
42
|
|
|
43
43
|
```
|
|
44
44
|
ai-collaboration/
|
|
45
|
-
├── README.md #
|
|
46
|
-
├── parallel.md #
|
|
47
|
-
├── debate.md #
|
|
45
|
+
├── README.md # This file
|
|
46
|
+
├── parallel.md # Parallel execution guide
|
|
47
|
+
├── debate.md # Debate mode guide
|
|
48
48
|
└── prompts/
|
|
49
|
-
└── CLAUDE.md # AI
|
|
49
|
+
└── CLAUDE.md # AI instructions
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
##
|
|
52
|
+
## Configuration
|
|
53
53
|
|
|
54
|
-
`config/ai_collaboration.yaml`
|
|
54
|
+
See `config/ai_collaboration.yaml`
|
|
55
55
|
|
|
56
|
-
##
|
|
56
|
+
## Output
|
|
57
57
|
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
- `state/collaborations/`
|
|
58
|
+
- Each AI's result
|
|
59
|
+
- Comparative analysis report
|
|
60
|
+
- Final selection/merge result
|
|
61
|
+
- Saved to `state/collaborations/`
|