hale-api / scripts /validate-skills.ps1
Raunak211006's picture
Deploy HALE API v3.1
cc38116 verified
Raw
History Blame Contribute Delete
2.44 kB
# GSD Skill Validation Script
# Validates all skill directories for required structure
$ErrorCount = 0
$WarningCount = 0
$SkillsChecked = 0
Write-Host "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -ForegroundColor Cyan
Write-Host " GSD β–Ί VALIDATING SKILLS" -ForegroundColor Cyan
Write-Host "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -ForegroundColor Cyan
Write-Host ""
$skills = Get-ChildItem ".agents/skills" -Directory
foreach ($skill in $skills) {
$SkillsChecked++
$skillFile = Join-Path $skill.FullName "SKILL.md"
$hasErrors = $false
# Check SKILL.md exists
if (-not (Test-Path $skillFile)) {
Write-Host "❌ $($skill.Name): Missing SKILL.md" -ForegroundColor Red
$ErrorCount++
continue
}
$content = Get-Content $skillFile -Raw
# Check for frontmatter
if ($content -notmatch "^---") {
Write-Host "❌ $($skill.Name): Missing frontmatter" -ForegroundColor Red
$ErrorCount++
$hasErrors = $true
}
# Check for name field
if ($content -notmatch "name:") {
Write-Host "❌ $($skill.Name): Missing name in frontmatter" -ForegroundColor Red
$ErrorCount++
$hasErrors = $true
}
# Check for description field
if ($content -notmatch "description:") {
Write-Host "❌ $($skill.Name): Missing description in frontmatter" -ForegroundColor Red
$ErrorCount++
$hasErrors = $true
}
if (-not $hasErrors) {
Write-Host "βœ… $($skill.Name)" -ForegroundColor Green
}
}
Write-Host ""
Write-Host "───────────────────────────────────────────────────────" -ForegroundColor Gray
Write-Host ""
Write-Host "Skills checked: $SkillsChecked"
Write-Host "Errors: $ErrorCount" -ForegroundColor $(if ($ErrorCount -gt 0) { "Red" } else { "Green" })
Write-Host ""
if ($ErrorCount -eq 0) {
Write-Host "βœ… All skills valid!" -ForegroundColor Green
exit 0
} else {
Write-Host "❌ Validation failed" -ForegroundColor Red
exit 1
}