-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate.sh
More file actions
executable file
·124 lines (110 loc) · 3.72 KB
/
validate.sh
File metadata and controls
executable file
·124 lines (110 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
# =============================================================================
# Awesome Agentic Coding — Validate Installation
# Checks that all hooks, skills, agents, and settings are properly installed.
# =============================================================================
set -euo pipefail
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m'
PASS=0
FAIL=0
WARN=0
check() {
if [ -f "$1" ]; then
echo -e " ${GREEN}✓${NC} $2"
PASS=$((PASS + 1))
else
echo -e " ${RED}✗${NC} $2 — missing: $1"
FAIL=$((FAIL + 1))
fi
}
check_exec() {
if [ -x "$1" ]; then
echo -e " ${GREEN}✓${NC} $2 (executable)"
PASS=$((PASS + 1))
elif [ -f "$1" ]; then
echo -e " ${YELLOW}!${NC} $2 — exists but not executable"
WARN=$((WARN + 1))
else
echo -e " ${RED}✗${NC} $2 — missing: $1"
FAIL=$((FAIL + 1))
fi
}
check_json_key() {
if python3 -c "import json; d=json.load(open('$1')); assert $2" 2>/dev/null; then
echo -e " ${GREEN}✓${NC} $3"
PASS=$((PASS + 1))
else
echo -e " ${RED}✗${NC} $3"
FAIL=$((FAIL + 1))
fi
}
echo ""
echo "=== Awesome Agentic Coding — Installation Validator ==="
echo ""
# Hooks
echo "Hooks:"
check_exec "$HOME/.claude/hooks/quality-gate.sh" "quality-gate (Stop)"
check_exec "$HOME/.claude/hooks/secret-guard.sh" "secret-guard (PreToolUse)"
check_exec "$HOME/.claude/hooks/context-inject.sh" "context-inject (SessionStart)"
check_exec "$HOME/.claude/hooks/protect-prod.sh" "protect-prod (PreToolUse)"
check_exec "$HOME/.claude/hooks/syntax-check.sh" "syntax-check (PostToolUse)"
echo ""
# Skills
echo "Skills:"
check "$HOME/.claude/skills/oneshot/SKILL.md" "/oneshot"
check "$HOME/.claude/skills/review/SKILL.md" "/review"
check "$HOME/.claude/skills/debug/SKILL.md" "/debug"
check "$HOME/.claude/skills/refactor/SKILL.md" "/refactor"
check "$HOME/.claude/skills/commit/SKILL.md" "/commit"
check "$HOME/.claude/skills/test/SKILL.md" "/test"
check "$HOME/.claude/skills/plan/SKILL.md" "/plan"
echo ""
# Agents
echo "Agents:"
check "$HOME/.claude/agents/researcher/AGENT.md" "researcher (Haiku)"
check "$HOME/.claude/agents/reviewer/AGENT.md" "reviewer (Haiku)"
check "$HOME/.claude/agents/architect/AGENT.md" "architect (Sonnet)"
echo ""
# Settings
echo "Settings:"
if [ -f "$HOME/.claude/settings.json" ]; then
check_json_key "$HOME/.claude/settings.json" "'hooks' in d" "hooks section exists"
check_json_key "$HOME/.claude/settings.json" "'permissions' in d" "permissions section exists"
else
echo -e " ${RED}✗${NC} ~/.claude/settings.json not found"
FAIL=$((FAIL + 1))
fi
echo ""
# CLAUDE.md
echo "CLAUDE.md:"
if [ -f ".claude/CLAUDE.md" ] || [ -f "CLAUDE.md" ]; then
CLAUDE_MD=$([ -f ".claude/CLAUDE.md" ] && echo ".claude/CLAUDE.md" || echo "CLAUDE.md")
LINES=$(wc -l < "$CLAUDE_MD" | tr -d ' ')
if [ "$LINES" -le 200 ]; then
echo -e " ${GREEN}✓${NC} $CLAUDE_MD ($LINES lines — optimal)"
elif [ "$LINES" -le 500 ]; then
echo -e " ${YELLOW}!${NC} $CLAUDE_MD ($LINES lines — consider trimming to <200)"
WARN=$((WARN + 1))
else
echo -e " ${RED}✗${NC} $CLAUDE_MD ($LINES lines — >500 = ~40% adherence)"
FAIL=$((FAIL + 1))
fi
else
echo -e " ${YELLOW}!${NC} No CLAUDE.md found in this project"
WARN=$((WARN + 1))
fi
echo ""
# Summary
echo "=== Results ==="
echo -e " ${GREEN}Passed:${NC} $PASS"
echo -e " ${YELLOW}Warnings:${NC} $WARN"
echo -e " ${RED}Failed:${NC} $FAIL"
echo ""
if [ $FAIL -eq 0 ]; then
echo -e "${GREEN}All checks passed!${NC} Your Claude Code setup is optimal."
else
echo -e "${RED}$FAIL checks failed.${NC} Run 'bash setup.sh' to fix."
fi