Skip to content

Commit 6239661

Browse files
committed
ci: Update validation workflows to skip supporting documentation files
Improved YAML frontmatter and date validation to properly exclude files that don't need validation: 1. **Depth-based exclusion**: Skip files at depth 3+ in skills/ directory - skills/skill/references/*.md (reference files) - skills/skill/foundation/*.md (foundation guides) - skills/skill/interactive/*.md (interactive guides) - skills/skill/implementation/*.md (implementation guides) 2. **Name-based exclusion**: Skip specific documentation files - README.md, SUMMARY.txt (across all directories) - CLAUDE_MD_UPDATES.md (supporting documentation) - Existing meta files (_INDEX.md, MIGRATION_GUIDE.md, etc.) 3. **Improved output**: Show both checked and skipped file counts This aligns with the skill structure where only SKILL.md files (main entry points) require YAML frontmatter and date validation, while supporting documentation files in subdirectories are optional. Results: - Frontmatter validation: 135 skill files checked, 32 skipped - Date validation: 163 dates checked across skill files, 32 skipped
1 parent 042483f commit 6239661

2 files changed

Lines changed: 61 additions & 7 deletions

File tree

.github/workflows/smoke-tests.yml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,42 @@ jobs:
5050
5151
errors = []
5252
checked = 0
53+
skipped = 0
54+
55+
# Meta files that don't need frontmatter (by name)
56+
SKIP_FILES = {
57+
"MIGRATION_GUIDE.md", "REFACTORING_SUMMARY.md", "_INDEX.md",
58+
"README.md", "ENHANCEMENT_PLAN.md", "ENHANCEMENTS_SUMMARY.md",
59+
"SKILLS_USAGE_GUIDE.md", "CLAUDE.md", "SUMMARY.txt",
60+
"CLAUDE_MD_UPDATES.md" # Supporting documentation
61+
}
5362
5463
for skill_file in Path(".").rglob("*.md"):
55-
# Skip archived and meta files
64+
# Skip archived files
5665
if "_archive" in str(skill_file):
66+
skipped += 1
5767
continue
58-
if skill_file.name in ["MIGRATION_GUIDE.md", "REFACTORING_SUMMARY.md", "_INDEX.md", "README.md", "ENHANCEMENT_PLAN.md", "ENHANCEMENTS_SUMMARY.md", "SKILLS_USAGE_GUIDE.md", "CLAUDE.md"]:
68+
69+
# Skip meta files by name
70+
if skill_file.name in SKIP_FILES:
71+
skipped += 1
5972
continue
6073
74+
# Calculate depth (number of slashes after skills/)
75+
# skills/file.md = depth 1 ✓
76+
# skills/category/file.md = depth 2 ✓
77+
# skills/skill/SKILL.md = depth 2 ✓
78+
# skills/skill/references/file.md = depth 3 ✗ (supporting files)
79+
parts = skill_file.parts
80+
if "skills" in parts:
81+
skills_idx = parts.index("skills")
82+
depth = len(parts) - skills_idx - 1
83+
84+
# Skip files at depth 3+ (these are reference/foundation/implementation files)
85+
if depth >= 3:
86+
skipped += 1
87+
continue
88+
6189
content = skill_file.read_text(encoding='utf-8')
6290
checked += 1
6391
@@ -88,7 +116,8 @@ jobs:
88116
if not re.match(r'^[a-z0-9-]+$', name):
89117
errors.append(f"{skill_file}: Invalid name format '{name}' (must be hyphen-case)")
90118
91-
print(f"Checked {checked} skill files\n")
119+
print(f"Checked: {checked} skill files")
120+
print(f"Skipped: {skipped} supporting/meta files\n")
92121
93122
if errors:
94123
print("❌ FAILED: Found frontmatter errors:\n")
@@ -98,6 +127,6 @@ jobs:
98127
print("="*60)
99128
sys.exit(1)
100129
else:
101-
print("✅ SUCCESS: All frontmatter is valid")
130+
print("✅ SUCCESS: All skill files have valid frontmatter")
102131
print("="*60)
103132
EOF

.github/workflows/validate-dates.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,39 @@ jobs:
4040
4141
errors = []
4242
checked = 0
43+
skipped = 0
44+
45+
# Meta files that don't need date validation (by name)
46+
SKIP_FILES = {
47+
"MIGRATION_GUIDE.md", "REFACTORING_SUMMARY.md", "_INDEX.md",
48+
"README.md", "ENHANCEMENT_PLAN.md", "ENHANCEMENTS_SUMMARY.md",
49+
"SKILLS_USAGE_GUIDE.md", "CLAUDE.md", "SUMMARY.txt",
50+
"CLAUDE_MD_UPDATES.md" # Supporting documentation
51+
}
4352
4453
# Check skills directory
4554
for skill_file in Path(".").rglob("*.md"):
46-
# Skip archived files and meta files
55+
# Skip archived files
4756
if "_archive" in str(skill_file):
57+
skipped += 1
4858
continue
49-
if skill_file.name in ["MIGRATION_GUIDE.md", "REFACTORING_SUMMARY.md", "_INDEX.md", "README.md", "ENHANCEMENT_PLAN.md", "ENHANCEMENTS_SUMMARY.md", "SKILLS_USAGE_GUIDE.md", "CLAUDE.md"]:
59+
60+
# Skip meta files by name
61+
if skill_file.name in SKIP_FILES:
62+
skipped += 1
5063
continue
5164
65+
# Calculate depth (number of slashes after skills/)
66+
# Skip files at depth 3+ (these are reference/foundation/implementation files)
67+
parts = skill_file.parts
68+
if "skills" in parts:
69+
skills_idx = parts.index("skills")
70+
depth = len(parts) - skills_idx - 1
71+
72+
if depth >= 3:
73+
skipped += 1
74+
continue
75+
5276
content = skill_file.read_text(encoding='utf-8')
5377
matches = re.findall(r'\*\*Last Updated\*\*:\s*(\d{4}-\d{2}-\d{2})', content)
5478
@@ -58,7 +82,8 @@ jobs:
5882
if date > today:
5983
errors.append(f"{skill_file}: Future date {match} (today is {today})")
6084
61-
print(f"Checked {checked} dates across skill files\n")
85+
print(f"Checked: {checked} dates")
86+
print(f"Skipped: {skipped} supporting/meta files\n")
6287
6388
if errors:
6489
print("❌ FAILED: Found future dates:\n")

0 commit comments

Comments
 (0)