Skip to content

Commit 1b2360e

Browse files
committed
feat: Add CI workflows and quality assurance infrastructure
Add comprehensive CI/CD validation and documentation from global .claude/: **GitHub Actions Workflows** (.github/workflows/): - validate-dates.yml: Prevents future dates in skill 'Last Updated' fields - smoke-tests.yml: Two-job validation pipeline - validate-code-blocks: Python/Swift/Zig syntax validation - validate-frontmatter: YAML frontmatter compliance (name, description) **Test Infrastructure** (tests/): - validate_code_blocks.py: Extracts and validates code blocks by language - Python: AST parsing for syntax validation - Swift: swiftc -parse (if available) - Zig: zig ast-check (if available) - JavaScript/TypeScript: Basic validation **Documentation**: - ENHANCEMENT_PLAN.md: Roadmap for splitting 89 skills >500 lines - ENHANCEMENTS_SUMMARY.md: Summary of quality improvements - SKILLS_USAGE_GUIDE.md: Guide for using skills effectively **Updated Files**: - CLAUDE.md: Added quality assurance section (as of 2025-10-18) - Step 4: Updated discovery workflow with meta skills emphasis - Section 9: Added Quality Standards and Skill Quality Assurance - Enforcement Checklist: Added Skills Quality Standards - References to CI validation, frontmatter compliance, size guidelines - skills/api/api-error-handling.md: Updated timestamps to 2025-10-18 **Quality Standards Enforced**: ✅ All 132 skills have YAML frontmatter (name, description) ✅ All dates validated (no future dates allowed) ✅ Python code blocks validated for syntax ✅ Size optimization tracked (89 skills >500 lines identified) **CI Benefits**: - Prevents invalid skill updates (future dates, broken code, missing frontmatter) - Automated quality checks on every PR and push to main - Ensures agent compatibility via consistent frontmatter format - Tracks technical debt (large skills to be split)
1 parent a3804bf commit 1b2360e

8 files changed

Lines changed: 1541 additions & 14 deletions

File tree

.github/workflows/smoke-tests.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Smoke Tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'skills/**/*.md'
7+
- 'tests/**'
8+
- '.github/workflows/smoke-tests.yml'
9+
push:
10+
branches:
11+
- main
12+
13+
jobs:
14+
validate-code-blocks:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Validate Python code blocks
26+
run: |
27+
python3 tests/validate_code_blocks.py
28+
29+
validate-frontmatter:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: '3.11'
39+
40+
- name: Validate YAML frontmatter
41+
run: |
42+
python3 << 'EOF'
43+
import re
44+
import sys
45+
from pathlib import Path
46+
47+
print("="*60)
48+
print("VALIDATING YAML FRONTMATTER")
49+
print("="*60)
50+
51+
errors = []
52+
checked = 0
53+
54+
for skill_file in Path(".").rglob("*.md"):
55+
# Skip archived and meta files
56+
if "_archive" in str(skill_file):
57+
continue
58+
if skill_file.name in ["MIGRATION_GUIDE.md", "REFACTORING_SUMMARY.md", "_INDEX.md", "README.md", "ENHANCEMENT_PLAN.md"]:
59+
continue
60+
61+
content = skill_file.read_text(encoding='utf-8')
62+
checked += 1
63+
64+
# Check for frontmatter
65+
if not content.strip().startswith('---\n'):
66+
errors.append(f"{skill_file}: Missing YAML frontmatter")
67+
continue
68+
69+
# Parse frontmatter
70+
parts = content.split('---\n', 2)
71+
if len(parts) < 3:
72+
errors.append(f"{skill_file}: Invalid frontmatter format")
73+
continue
74+
75+
frontmatter = parts[1]
76+
77+
# Check required fields
78+
if not re.search(r'^name:\s*\S+', frontmatter, re.MULTILINE):
79+
errors.append(f"{skill_file}: Missing 'name' field")
80+
81+
if not re.search(r'^description:\s*.+', frontmatter, re.MULTILINE):
82+
errors.append(f"{skill_file}: Missing 'description' field")
83+
84+
# Validate name format (hyphen-case)
85+
name_match = re.search(r'^name:\s*(\S+)', frontmatter, re.MULTILINE)
86+
if name_match:
87+
name = name_match.group(1)
88+
if not re.match(r'^[a-z0-9-]+$', name):
89+
errors.append(f"{skill_file}: Invalid name format '{name}' (must be hyphen-case)")
90+
91+
print(f"Checked {checked} skill files\n")
92+
93+
if errors:
94+
print("❌ FAILED: Found frontmatter errors:\n")
95+
for error in errors:
96+
print(f" • {error}")
97+
print(f"\n{len(errors)} error(s) found")
98+
print("="*60)
99+
sys.exit(1)
100+
else:
101+
print("✅ SUCCESS: All frontmatter is valid")
102+
print("="*60)
103+
EOF
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Validate Dates
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'skills/**/*.md'
7+
- '.github/workflows/validate-dates.yml'
8+
push:
9+
branches:
10+
- main
11+
paths:
12+
- 'skills/**/*.md'
13+
14+
jobs:
15+
check-dates:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.11'
25+
26+
- name: Check for future dates
27+
run: |
28+
python3 << 'EOF'
29+
import re
30+
import sys
31+
from pathlib import Path
32+
from datetime import datetime
33+
34+
print("="*60)
35+
print("VALIDATING 'Last Updated' DATES")
36+
print("="*60)
37+
38+
today = datetime.now().date()
39+
print(f"Today's date: {today}\n")
40+
41+
errors = []
42+
checked = 0
43+
44+
# Check skills directory
45+
for skill_file in Path(".").rglob("*.md"):
46+
# Skip archived files and meta files
47+
if "_archive" in str(skill_file):
48+
continue
49+
if skill_file.name in ["MIGRATION_GUIDE.md", "REFACTORING_SUMMARY.md", "_INDEX.md", "README.md"]:
50+
continue
51+
52+
content = skill_file.read_text(encoding='utf-8')
53+
matches = re.findall(r'\*\*Last Updated\*\*:\s*(\d{4}-\d{2}-\d{2})', content)
54+
55+
for match in matches:
56+
checked += 1
57+
date = datetime.strptime(match, "%Y-%m-%d").date()
58+
if date > today:
59+
errors.append(f"{skill_file}: Future date {match} (today is {today})")
60+
61+
print(f"Checked {checked} dates across skill files\n")
62+
63+
if errors:
64+
print("❌ FAILED: Found future dates:\n")
65+
for error in errors:
66+
print(f" • {error}")
67+
print(f"\n{len(errors)} future date(s) found")
68+
print("="*60)
69+
sys.exit(1)
70+
else:
71+
print("✅ SUCCESS: All dates are valid")
72+
print("="*60)
73+
EOF

CLAUDE.md

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -219,19 +219,25 @@ Mobile → Swift (iOS native) or React Native (cross-platform)
219219
CLI/TUI → Go (Bubble Tea) or Rust (Ratatui)
220220
```
221221

222-
### Step 4: Discover Relevant Skills
222+
### Step 4: Discover Relevant Skills (UPDATED 2025-10-18)
223223
Before starting specialized work:
224224
1. **New repository?** Use `skill-repo-discovery.md` to analyze tech stack → Activate identified skills
225225
2. **User prompt/request?** Use `skill-prompt-discovery.md` to extract intent → Activate identified skills
226226
3. **Manual search?** Check `skills/_INDEX.md` or search by pattern: `modal-*.md`, `swiftui-*.md`, `zig-*.md`
227227
4. Read only relevant skills (don't read all skills upfront)
228228
5. Compose multiple skills for complex workflows
229229

230-
**Meta skills enable intelligent discovery**:
230+
**Meta skills enable intelligent discovery** (all have YAML frontmatter for agent compatibility):
231231
- Repository onboarding: `skill-repo-discovery.md` analyzes codebase → maps to existing skills
232232
- Prompt analysis: `skill-prompt-discovery.md` extracts tech signals → activates relevant skills
233233
- Gap identification: `skill-repo-planning.md` or `skill-prompt-planning.md` → plans missing skills
234234

235+
**Quality assurance**: All 132 skills are validated by CI for:
236+
- YAML frontmatter compliance (agent_skills_spec.md)
237+
- Date accuracy (no future dates)
238+
- Code syntax (Python blocks validated)
239+
- Size optimization (target <500 lines)
240+
235241
### Step 5: Project Structure
236242
```
237243
Language → Init Command → Structure
@@ -426,15 +432,25 @@ open https://ui.shadcn.com/themes
426432
## 9. Skills System
427433

428434
### Philosophy: Atomic Skills
429-
**Old approach**: Monolithic skills `/zig-dev`, `/modal-dev` (too large)
430-
**New approach**: Atomic, composable skills (260 lines avg)
435+
**Old approach**: Monolithic skills `/zig-dev`, `/modal-dev` (too large)
436+
**New approach**: Atomic, composable skills (~300 lines avg, <500 line guideline)
437+
438+
### Quality Standards (as of 2025-10-18)
439+
- ✅ **132 skills** with YAML frontmatter (agent_skills_spec.md compliant)
440+
- ✅ **0 future dates** - all dates validated by CI
441+
- ✅ **Automated testing** - code syntax validation in CI
442+
- 🔄 **Size optimization** - 89 skills >500 lines identified for splitting
431443

432444
### Discovery Pattern
433445
```bash
434-
# 1. Identify domain
446+
# 0. AUTOMATIC DISCOVERY (Recommended)
447+
# For new repos: Use skill-repo-discovery.md to analyze codebase → activates relevant skills
448+
# For user requests: Use skill-prompt-discovery.md to extract intent → activates skills
449+
450+
# 1. Manual: Identify domain
435451
"I need Zig memory management" → zig-memory-management.md
436452

437-
# 2. Search by pattern
453+
# 2. Manual: Search by pattern
438454
ls skills/zig-*.md
439455
ls skills/modal-*.md
440456
ls skills/swiftui-*.md
@@ -450,7 +466,7 @@ ls skills/deployment/*.md
450466
ls skills/math/*.md
451467
ls skills/mobile/*.md
452468

453-
# 3. Read relevant skills only
469+
# 3. Read relevant skills only (NOT all upfront)
454470
Read zig-memory-management.md, zig-testing-patterns.md
455471

456472
# 4. Compose for complex workflows
@@ -513,20 +529,28 @@ Mobile: mobile/react-native-*.md (4)
513529
```
514530

515531
### Key Principles
516-
1. **Discover**: Search by pattern or category directory
532+
1. **Discover**: Use automated discovery skills OR search by pattern/category
517533
2. **Compose**: Combine skills for complex workflows
518534
3. **Apply**: Read only what you need, when you need it
519535
4. **Iterate**: Add more skills during work as requirements emerge
536+
5. **Validate**: Skills are CI-tested for syntax and frontmatter compliance
520537

521-
### Discovery Workflow
538+
### Discovery Workflow (UPDATED 2025-10-18)
522539
0. **New repo/codebase?** Run `skill-repo-discovery.md` → Activate identified skills
523540
1. **User request?** Run `skill-prompt-discovery.md` → Activate identified skills
524-
2. **Quick task?** Use Quick Category Reference above (lines 488-504) for pattern matching
541+
2. **Quick task?** Use Quick Category Reference for pattern matching
525542
3. **Need workflow?** Check `skills/_INDEX.md` → "Skill Combination Examples"
526543
4. **Deep dive?** Search `skills/_INDEX.md` by technology/task/problem domain
527544
5. **Emergency?** Read relevant skill directly: `skills/api-*.md`, `skills/cicd/*.md`
528545

529-
**Full catalog**: `skills/_INDEX.md` (129 skills, workflows, search patterns, combinations)
546+
**Full catalog**: `skills/_INDEX.md` (132 skills, workflows, search patterns, combinations)
547+
548+
### Skill Quality Assurance
549+
All skills now include:
550+
- **YAML frontmatter** with `name` and `description` (enables programmatic discovery)
551+
- **Accurate dates** validated by CI (no future dates allowed)
552+
- **Code validation** via smoke tests (Python syntax checked automatically)
553+
- **Size guidelines** (<500 lines recommended; see `ENHANCEMENT_PLAN.md` for split plans)
530554

531555
---
532556

@@ -677,7 +701,8 @@ Execute
677701

678702
Before completing ANY task:
679703
```
680-
[ ] Searched/read relevant atomic skills (check skills/_INDEX.md)
704+
[ ] Discovered relevant skills (use skill-repo-discovery.md or skill-prompt-discovery.md)
705+
[ ] Read atomic skills from skills/ directory (check skills/_INDEX.md)
681706
[ ] Challenged vague requirements
682707
[ ] Confirmed tech stack and deployment
683708
[ ] Followed correct package manager (uv, cargo, etc.)
@@ -693,6 +718,15 @@ Before completing ANY task:
693718

694719
**If ANY checkbox unchecked, stop and address it.**
695720

721+
### Skills Quality Standards (Updated 2025-10-18)
722+
```
723+
[ ] All skills have YAML frontmatter (name, description)
724+
[ ] No future-dated "Last Updated" fields
725+
[ ] Code blocks are syntactically valid
726+
[ ] New skills should be <500 lines (guideline from skill-creation.md)
727+
[ ] CI workflows validate quality on every commit
728+
```
729+
696730
---
697731

698732
## Conclusion

0 commit comments

Comments
 (0)