@orchestrator-claude/cli 3.11.0 → 3.12.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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/base/CLAUDE.md.hbs +35 -332
- package/dist/templates/base/claude/hooks/dangling-workflow-guard.sh +33 -41
- package/dist/templates/base/claude/hooks/gate-guardian.sh +42 -43
- package/dist/templates/base/claude/hooks/orch-helpers.sh +25 -20
- package/dist/templates/base/claude/hooks/ping-pong-enforcer.sh +26 -40
- package/dist/templates/base/claude/hooks/prompt-orchestrator.sh +41 -0
- package/dist/templates/base/claude/hooks/session-orchestrator.sh +54 -0
- package/dist/templates/base/claude/hooks/workflow-guard.sh +53 -0
- package/dist/templates/base/claude/settings.json +37 -0
- package/dist/templates/base/claude/skills/workflow-status/SKILL.md +59 -291
- package/dist/templates/base/docker-compose.yml.hbs +2 -1
- package/package.json +1 -1
- package/templates/base/CLAUDE.md.hbs +35 -332
- package/templates/base/claude/hooks/dangling-workflow-guard.sh +33 -41
- package/templates/base/claude/hooks/gate-guardian.sh +42 -43
- package/templates/base/claude/hooks/orch-helpers.sh +25 -20
- package/templates/base/claude/hooks/ping-pong-enforcer.sh +26 -40
- package/templates/base/claude/hooks/prompt-orchestrator.sh +41 -0
- package/templates/base/claude/hooks/session-orchestrator.sh +54 -0
- package/templates/base/claude/hooks/workflow-guard.sh +53 -0
- package/templates/base/claude/settings.json +37 -0
- package/templates/base/claude/skills/workflow-status/SKILL.md +59 -291
- package/templates/base/docker-compose.yml.hbs +2 -1
- package/dist/templates/base/claude/hooks/post-artifact-generate.sh +0 -39
- package/dist/templates/base/claude/hooks/post-implement-validate.sh +0 -139
- package/dist/templates/base/claude/hooks/pre-agent-invoke.sh +0 -34
- package/dist/templates/base/claude/hooks/pre-phase-advance.sh +0 -40
- package/templates/base/claude/hooks/post-artifact-generate.sh +0 -39
- package/templates/base/claude/hooks/post-implement-validate.sh +0 -139
- package/templates/base/claude/hooks/pre-agent-invoke.sh +0 -34
- package/templates/base/claude/hooks/pre-phase-advance.sh +0 -40
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Post-Implement Validation Hook
|
|
3
|
-
# Validates orchestrator-index.json consistency after IMPLEMENT phase
|
|
4
|
-
# Detects possible delegation bypass where code was written directly
|
|
5
|
-
# instead of through the implementer subagent
|
|
6
|
-
#
|
|
7
|
-
# Exit codes:
|
|
8
|
-
# 0 = Validation passed or skipped (jq not available)
|
|
9
|
-
# 1 = Warning detected (possible delegation bypass)
|
|
10
|
-
#
|
|
11
|
-
# Author: Orchestrator System
|
|
12
|
-
# Version: 1.0.0
|
|
13
|
-
|
|
14
|
-
set -e
|
|
15
|
-
|
|
16
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
17
|
-
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
18
|
-
INDEX_FILE="$PROJECT_ROOT/.orchestrator/orchestrator-index.json"
|
|
19
|
-
|
|
20
|
-
# Colors for output
|
|
21
|
-
RED='\033[0;31m'
|
|
22
|
-
YELLOW='\033[1;33m'
|
|
23
|
-
GREEN='\033[0;32m'
|
|
24
|
-
CYAN='\033[0;36m'
|
|
25
|
-
NC='\033[0m' # No Color
|
|
26
|
-
|
|
27
|
-
log_info() {
|
|
28
|
-
echo -e "${GREEN}[post-implement-validate]${NC} $1" >&2
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
log_warn() {
|
|
32
|
-
echo -e "${YELLOW}[post-implement-validate] WARNING:${NC} $1" >&2
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
log_error() {
|
|
36
|
-
echo -e "${RED}[post-implement-validate] ERROR:${NC} $1" >&2
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
log_debug() {
|
|
40
|
-
if [ "${DEBUG:-false}" = "true" ]; then
|
|
41
|
-
echo -e "${CYAN}[post-implement-validate] DEBUG:${NC} $1" >&2
|
|
42
|
-
fi
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
# Check if jq is available
|
|
46
|
-
if ! command -v jq &> /dev/null; then
|
|
47
|
-
log_warn "jq not found, skipping validation (install jq for full validation)"
|
|
48
|
-
exit 0
|
|
49
|
-
fi
|
|
50
|
-
|
|
51
|
-
# Check if orchestrator-index.json exists
|
|
52
|
-
if [ ! -f "$INDEX_FILE" ]; then
|
|
53
|
-
log_debug "orchestrator-index.json not found at $INDEX_FILE, skipping validation"
|
|
54
|
-
exit 0
|
|
55
|
-
fi
|
|
56
|
-
|
|
57
|
-
# Read statistics from orchestrator-index.json
|
|
58
|
-
TASKS_COMPLETED=$(jq -r '.statistics.tasksCompleted // 0' "$INDEX_FILE" 2>/dev/null || echo "0")
|
|
59
|
-
TASKS_PENDING=$(jq -r '.statistics.tasksPending // 0' "$INDEX_FILE" 2>/dev/null || echo "0")
|
|
60
|
-
CURRENT_PHASE=$(jq -r '.activeWorkflow.currentPhase // "unknown"' "$INDEX_FILE" 2>/dev/null || echo "unknown")
|
|
61
|
-
STATUS=$(jq -r '.activeWorkflow.status // "unknown"' "$INDEX_FILE" 2>/dev/null || echo "unknown")
|
|
62
|
-
|
|
63
|
-
# Count TypeScript files in src/ (if directory exists)
|
|
64
|
-
TS_FILES_COUNT=0
|
|
65
|
-
if [ -d "$PROJECT_ROOT/src" ]; then
|
|
66
|
-
TS_FILES_COUNT=$(find "$PROJECT_ROOT/src" -name "*.ts" 2>/dev/null | wc -l | tr -d ' ' || echo "0")
|
|
67
|
-
fi
|
|
68
|
-
|
|
69
|
-
# Count test files
|
|
70
|
-
TEST_FILES_COUNT=0
|
|
71
|
-
if [ -d "$PROJECT_ROOT/tests" ]; then
|
|
72
|
-
TEST_FILES_COUNT=$(find "$PROJECT_ROOT/tests" -name "*.spec.ts" -o -name "*.test.ts" 2>/dev/null | wc -l | tr -d ' ' || echo "0")
|
|
73
|
-
fi
|
|
74
|
-
|
|
75
|
-
log_info "Validating IMPLEMENT phase consistency..."
|
|
76
|
-
log_info " Current Phase: $CURRENT_PHASE"
|
|
77
|
-
log_info " Status: $STATUS"
|
|
78
|
-
log_info " Tasks Completed: $TASKS_COMPLETED"
|
|
79
|
-
log_info " Tasks Pending: $TASKS_PENDING"
|
|
80
|
-
log_info " TypeScript Files: $TS_FILES_COUNT"
|
|
81
|
-
log_info " Test Files: $TEST_FILES_COUNT"
|
|
82
|
-
|
|
83
|
-
# Detection logic
|
|
84
|
-
WARNINGS=0
|
|
85
|
-
MESSAGES=()
|
|
86
|
-
|
|
87
|
-
# Check 1: Few tasks completed but many pending (primary indicator)
|
|
88
|
-
if [ "$TASKS_COMPLETED" -le 1 ] && [ "$TASKS_PENDING" -gt 5 ]; then
|
|
89
|
-
MESSAGES+=("Only $TASKS_COMPLETED task(s) completed but $TASKS_PENDING pending.")
|
|
90
|
-
MESSAGES+=("This suggests the implementer agent may not have been properly invoked.")
|
|
91
|
-
WARNINGS=$((WARNINGS + 1))
|
|
92
|
-
fi
|
|
93
|
-
|
|
94
|
-
# Check 2: Many source files but few tasks completed
|
|
95
|
-
if [ "$TS_FILES_COUNT" -gt 10 ] && [ "$TASKS_COMPLETED" -lt 5 ]; then
|
|
96
|
-
MESSAGES+=("Found $TS_FILES_COUNT TypeScript files but only $TASKS_COMPLETED tasks completed.")
|
|
97
|
-
MESSAGES+=("Code may have been generated without proper task tracking.")
|
|
98
|
-
WARNINGS=$((WARNINGS + 1))
|
|
99
|
-
fi
|
|
100
|
-
|
|
101
|
-
# Check 3: Status still "ready_for_implementation" after code exists
|
|
102
|
-
if [ "$STATUS" = "ready_for_implementation" ] && [ "$TS_FILES_COUNT" -gt 5 ]; then
|
|
103
|
-
MESSAGES+=("Status is still 'ready_for_implementation' but $TS_FILES_COUNT code files exist.")
|
|
104
|
-
MESSAGES+=("Workflow state may not have been updated correctly.")
|
|
105
|
-
WARNINGS=$((WARNINGS + 1))
|
|
106
|
-
fi
|
|
107
|
-
|
|
108
|
-
# Check 4: Source files exist but no test files (TDD violation)
|
|
109
|
-
if [ "$TS_FILES_COUNT" -gt 5 ] && [ "$TEST_FILES_COUNT" -eq 0 ]; then
|
|
110
|
-
MESSAGES+=("Found $TS_FILES_COUNT source files but no test files.")
|
|
111
|
-
MESSAGES+=("TDD methodology may not have been followed.")
|
|
112
|
-
WARNINGS=$((WARNINGS + 1))
|
|
113
|
-
fi
|
|
114
|
-
|
|
115
|
-
# Summary
|
|
116
|
-
if [ "$WARNINGS" -gt 0 ]; then
|
|
117
|
-
echo "" >&2
|
|
118
|
-
log_warn "============================================"
|
|
119
|
-
log_warn "Detected $WARNINGS potential issue(s):"
|
|
120
|
-
log_warn "============================================"
|
|
121
|
-
for msg in "${MESSAGES[@]}"; do
|
|
122
|
-
log_warn " - $msg"
|
|
123
|
-
done
|
|
124
|
-
echo "" >&2
|
|
125
|
-
log_warn "Possible causes:"
|
|
126
|
-
log_warn " 1. Implementer agent was not invoked via Task tool"
|
|
127
|
-
log_warn " 2. Code was written directly instead of through delegation"
|
|
128
|
-
log_warn " 3. orchestrator-index.json was not updated during implementation"
|
|
129
|
-
echo "" >&2
|
|
130
|
-
log_warn "Recommended actions:"
|
|
131
|
-
log_warn " 1. Review CLAUDE.md section: MANDATORY: IMPLEMENT Phase Delegation"
|
|
132
|
-
log_warn " 2. Ensure Task tool is used with subagent_type='implementer'"
|
|
133
|
-
log_warn " 3. Update orchestrator-index.json with correct task progress"
|
|
134
|
-
echo "" >&2
|
|
135
|
-
exit 1
|
|
136
|
-
else
|
|
137
|
-
log_info "Validation passed. No issues detected."
|
|
138
|
-
exit 0
|
|
139
|
-
fi
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Pre-Agent Invoke Hook
|
|
3
|
-
# Executado antes de invocar um subagent
|
|
4
|
-
# Valida contexto e injeta informacoes da KB
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
9
|
-
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
10
|
-
|
|
11
|
-
# Recebe evento via stdin ou argumento
|
|
12
|
-
if [ -n "$1" ]; then
|
|
13
|
-
EVENT="$1"
|
|
14
|
-
else
|
|
15
|
-
EVENT=$(cat)
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
# Verifica se temos o handler compilado
|
|
19
|
-
HANDLER="$PROJECT_ROOT/dist/hook.js"
|
|
20
|
-
|
|
21
|
-
if [ ! -f "$HANDLER" ]; then
|
|
22
|
-
echo '{"success": false, "error": "Hook handler not compiled. Run npm run build first."}' >&2
|
|
23
|
-
exit 1
|
|
24
|
-
fi
|
|
25
|
-
|
|
26
|
-
# Executa o handler TypeScript
|
|
27
|
-
echo "$EVENT" | node "$HANDLER" pre-agent-invoke
|
|
28
|
-
|
|
29
|
-
EXIT_CODE=$?
|
|
30
|
-
|
|
31
|
-
# Exit code determina se agente pode prosseguir
|
|
32
|
-
# 0 = permitido
|
|
33
|
-
# 1 = bloqueado
|
|
34
|
-
exit $EXIT_CODE
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Pre-Phase Advance Hook
|
|
3
|
-
# Executado antes de avancar para proxima fase
|
|
4
|
-
# Avalia gate e cria checkpoint
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
9
|
-
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
10
|
-
|
|
11
|
-
# Recebe evento via stdin ou argumento
|
|
12
|
-
if [ -n "$1" ]; then
|
|
13
|
-
EVENT="$1"
|
|
14
|
-
else
|
|
15
|
-
EVENT=$(cat)
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
# Verifica se temos o handler compilado
|
|
19
|
-
HANDLER="$PROJECT_ROOT/dist/hook.js"
|
|
20
|
-
|
|
21
|
-
if [ ! -f "$HANDLER" ]; then
|
|
22
|
-
echo '{"success": false, "error": "Hook handler not compiled. Run npm run build first."}' >&2
|
|
23
|
-
exit 1
|
|
24
|
-
fi
|
|
25
|
-
|
|
26
|
-
# Executa o handler TypeScript
|
|
27
|
-
echo "$EVENT" | node "$HANDLER" pre-phase-advance
|
|
28
|
-
|
|
29
|
-
EXIT_CODE=$?
|
|
30
|
-
|
|
31
|
-
# Exit code determina se fase pode avancar
|
|
32
|
-
# 0 = gate passou, pode avancar
|
|
33
|
-
# 1 = gate falhou, bloqueado
|
|
34
|
-
if [ $EXIT_CODE -eq 0 ]; then
|
|
35
|
-
echo "[pre-phase-advance] Gate passed, advancing phase" >&2
|
|
36
|
-
else
|
|
37
|
-
echo "[pre-phase-advance] Gate failed, phase advance blocked" >&2
|
|
38
|
-
fi
|
|
39
|
-
|
|
40
|
-
exit $EXIT_CODE
|