File size: 2,306 Bytes
cc38116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# GSD Workflow Validation Script
# Validates all workflow files for required structure

$ErrorCount = 0
$WarningCount = 0
$WorkflowsChecked = 0

Write-Host "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -ForegroundColor Cyan
Write-Host " GSD β–Ί VALIDATING WORKFLOWS" -ForegroundColor Cyan
Write-Host "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -ForegroundColor Cyan
Write-Host ""

$workflows = Get-ChildItem ".agent/workflows/*.md"

foreach ($file in $workflows) {
    $WorkflowsChecked++
    $content = Get-Content $file.FullName -Raw
    $hasErrors = $false
    
    # Check for frontmatter
    if ($content -notmatch "^---") {
        Write-Host "❌ $($file.Name): Missing frontmatter" -ForegroundColor Red
        $ErrorCount++
        $hasErrors = $true
    }
    
    # Check for description
    if ($content -notmatch "description:") {
        Write-Host "❌ $($file.Name): Missing description in frontmatter" -ForegroundColor Red
        $ErrorCount++
        $hasErrors = $true
    }
    
    # Check for process tags (optional but recommended)
    if ($content -notmatch "<process>") {
        Write-Host "⚠️  $($file.Name): Missing <process> tag" -ForegroundColor Yellow
        $WarningCount++
    }
    
    if (-not $hasErrors) {
        Write-Host "βœ… $($file.Name)" -ForegroundColor Green
    }
}

Write-Host ""
Write-Host "───────────────────────────────────────────────────────" -ForegroundColor Gray
Write-Host ""
Write-Host "Workflows checked: $WorkflowsChecked"
Write-Host "Errors: $ErrorCount" -ForegroundColor $(if ($ErrorCount -gt 0) { "Red" } else { "Green" })
Write-Host "Warnings: $WarningCount" -ForegroundColor $(if ($WarningCount -gt 0) { "Yellow" } else { "Green" })
Write-Host ""

if ($ErrorCount -eq 0) {
    Write-Host "βœ… All workflows valid!" -ForegroundColor Green
    exit 0
} else {
    Write-Host "❌ Validation failed" -ForegroundColor Red
    exit 1
}