-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (147 loc) · 5.65 KB
/
Copy pathalignment-check.yml
File metadata and controls
175 lines (147 loc) · 5.65 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Agent Alignment Check
on:
pull_request:
paths:
- '.claude/agents/**'
- '.claude/skills/**'
- '.claude/commands/**'
jobs:
alignment-check:
name: Validate Agent Alignment
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
.claude/agents/**/*.md
.claude/skills/**/*.md
.claude/commands/**/*.md
- name: Validate YAML frontmatter
if: steps.changed-files.outputs.any_changed == 'true'
run: |
echo "🔍 Validating YAML frontmatter in changed files..."
has_errors=false
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "Checking: $file"
# Skip README and CLAUDE.md files
if [[ "$file" == *"README.md" ]] || [[ "$file" == *"CLAUDE.md" ]]; then
echo " ⏭️ Skipping (not an agent/skill definition)"
continue
fi
# Check if file has YAML frontmatter
if ! head -1 "$file" | grep -q "^---$"; then
echo " ❌ Missing YAML frontmatter"
has_errors=true
continue
fi
# Extract frontmatter
frontmatter=$(sed -n '/^---$/,/^---$/p' "$file" | sed '1d;$d')
# Check for required fields in agents
if [[ "$file" == *"/agents/"* ]]; then
if ! echo "$frontmatter" | grep -q "^name:"; then
echo " ❌ Missing 'name' field"
has_errors=true
fi
if ! echo "$frontmatter" | grep -q "^description:"; then
echo " ❌ Missing 'description' field"
has_errors=true
fi
if ! echo "$frontmatter" | grep -q "^capabilities:"; then
echo " ❌ Missing 'capabilities' field"
has_errors=true
fi
if ! echo "$frontmatter" | grep -q "^priority:"; then
echo " ❌ Missing 'priority' field"
has_errors=true
fi
fi
if [ "$has_errors" = false ]; then
echo " ✅ Valid"
fi
done
if [ "$has_errors" = true ]; then
echo ""
echo "❌ Some files have invalid frontmatter. See above for details."
echo "📚 Reference: docs/AGENT_CONTRIBUTION_GUIDE.md"
exit 1
fi
echo ""
echo "✅ All changed files have valid frontmatter"
- name: Check for banned language patterns
if: steps.changed-files.outputs.any_changed == 'true'
run: |
echo "🔍 Checking for Frank DNA violations..."
# Patterns that suggest AI slop or misalignment
banned_patterns=(
"soul-aligned"
"consciousness evolution"
"overwhelmed to empowered"
"humble excellence"
"hustle harder"
"transformative journey"
"spiritual awakening"
"unlock your potential"
"game-changing"
"paradigm shift"
)
has_violations=false
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
for pattern in "${banned_patterns[@]}"; do
if grep -qi "$pattern" "$file" 2>/dev/null; then
echo "⚠️ Found '$pattern' in $file"
has_violations=true
fi
done
done
if [ "$has_violations" = true ]; then
echo ""
echo "⚠️ Found potentially misaligned language."
echo "📚 Review the Frank DNA: .claude/FRANK_DNA.md"
echo "💡 Use direct, technical, practical language instead."
# Warning only, not blocking
else
echo "✅ No banned language patterns found"
fi
- name: Validate skill-rules.json references
run: |
echo "🔍 Validating skill-rules.json references..."
if [ -f ".claude/skill-rules.json" ]; then
# Extract skill names from rules
skills=$(jq -r '.activation_rules[].skill' .claude/skill-rules.json 2>/dev/null || echo "")
missing_skills=""
for skill in $skills; do
if [ ! -d ".claude/skills/$skill" ]; then
missing_skills="$missing_skills $skill"
fi
done
if [ -n "$missing_skills" ]; then
echo "⚠️ skill-rules.json references missing skills:$missing_skills"
else
echo "✅ All skill references are valid"
fi
else
echo "⏭️ No skill-rules.json found"
fi
- name: Summary
run: |
echo ""
echo "📋 Alignment Check Complete"
echo "─────────────────────────────"
echo "All agents must align with the Frank DNA:"
echo " • Direct, technical, warm, playful voice"
echo " • Helps people build their own systems"
echo " • Practical value over philosophy"
echo " • Shows don't tells"
echo ""
echo "📚 Resources:"
echo " • Frank DNA: .claude/FRANK_DNA.md"
echo " • Decision Framework: .claude/DECISION_FRAMEWORK.md"
echo " • Agent Guide: docs/AGENT_CONTRIBUTION_GUIDE.md"