690427:0812 Update Infras #01
This commit is contained in:
@@ -2,16 +2,16 @@
|
||||
# Part of LCBP3-DMS Phase 2 improvements
|
||||
|
||||
param(
|
||||
[string]$BaseDir = (Split-Path -Parent (Split-Path -Parent $PSScriptRoot))
|
||||
[string]$BaseDir = (Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $PSScriptRoot)))
|
||||
)
|
||||
|
||||
# Colors for output
|
||||
# Map to ConsoleColor enum (Write-Host expects enum, not ANSI strings)
|
||||
$Colors = @{
|
||||
Red = "`e[0;31m"
|
||||
Green = "`e[0;32m"
|
||||
Yellow = "`e[1;33m"
|
||||
Blue = "`e[0;34m"
|
||||
NoColor = "`e[0m"
|
||||
Red = 'Red'
|
||||
Green = 'Green'
|
||||
Yellow = 'Yellow'
|
||||
Blue = 'Blue'
|
||||
NoColor = 'Gray'
|
||||
}
|
||||
|
||||
$AgentsDir = Join-Path $BaseDir ".agents"
|
||||
@@ -26,10 +26,10 @@ function Test-SkillHealth {
|
||||
param(
|
||||
[string]$SkillDir
|
||||
)
|
||||
|
||||
|
||||
$skillName = Split-Path $SkillDir -Leaf
|
||||
$issues = 0
|
||||
|
||||
|
||||
# Check for SKILL.md
|
||||
$skillFile = Join-Path $SkillDir "SKILL.md"
|
||||
if (Test-Path $skillFile) {
|
||||
@@ -38,7 +38,7 @@ function Test-SkillHealth {
|
||||
Write-Host " MISSING: $skillName/SKILL.md" -ForegroundColor $Colors.Red
|
||||
$issues++
|
||||
}
|
||||
|
||||
|
||||
# Check for templates directory (optional)
|
||||
$templatesDir = Join-Path $SkillDir "templates"
|
||||
if (Test-Path $templatesDir) {
|
||||
@@ -49,39 +49,34 @@ function Test-SkillHealth {
|
||||
Write-Host " EMPTY: $skillName/templates (no files)" -ForegroundColor $Colors.Yellow
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Check SKILL.md content if exists
|
||||
if (Test-Path $skillFile) {
|
||||
$content = Get-Content $skillFile -Raw
|
||||
|
||||
|
||||
# Check for required front matter fields
|
||||
$requiredFields = @("name", "description", "version")
|
||||
$requiredFields = @('name', 'description', 'version')
|
||||
foreach ($field in $requiredFields) {
|
||||
if ($content -match "^$field:") {
|
||||
$pattern = "(?m)^${field}:"
|
||||
if ($content -match $pattern) {
|
||||
Write-Host " FIELD: $field" -ForegroundColor $Colors.Green
|
||||
} else {
|
||||
Write-Host " MISSING FIELD: $field" -ForegroundColor $Colors.Red
|
||||
$issues++
|
||||
}
|
||||
}
|
||||
|
||||
# Check for Role section
|
||||
if ($content -match "^## Role$") {
|
||||
Write-Host " SECTION: Role" -ForegroundColor $Colors.Green
|
||||
} else {
|
||||
Write-Host " MISSING SECTION: Role" -ForegroundColor $Colors.Yellow
|
||||
$issues++
|
||||
}
|
||||
|
||||
# Check for Task section
|
||||
if ($content -match "^## Task$") {
|
||||
Write-Host " SECTION: Task" -ForegroundColor $Colors.Green
|
||||
} else {
|
||||
Write-Host " MISSING SECTION: Task" -ForegroundColor $Colors.Yellow
|
||||
$issues++
|
||||
|
||||
# Check for LCBP3 context reference (speckit-* skills)
|
||||
if ($skillName -like 'speckit-*') {
|
||||
if ($content -match '_LCBP3-CONTEXT\.md') {
|
||||
Write-Host " CONTEXT: LCBP3 appendix referenced" -ForegroundColor $Colors.Green
|
||||
} else {
|
||||
Write-Host " MISSING: LCBP3 context reference" -ForegroundColor $Colors.Yellow
|
||||
$issues++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $issues
|
||||
}
|
||||
|
||||
@@ -90,11 +85,11 @@ function Get-SkillVersion {
|
||||
param(
|
||||
[string]$SkillFile
|
||||
)
|
||||
|
||||
|
||||
if (Test-Path $SkillFile) {
|
||||
try {
|
||||
$content = Get-Content $SkillFile -Raw
|
||||
if ($content -match "^version:\s*(.+)") {
|
||||
if ($content -match "(?m)^version:\s*['""]?([0-9]+\.[0-9]+\.[0-9]+)['""]?") {
|
||||
return $matches[1].Trim()
|
||||
}
|
||||
} catch {
|
||||
@@ -127,16 +122,16 @@ foreach ($skillDir in $skillDirs) {
|
||||
$skillName = $skillDir.Name
|
||||
Write-Host "Auditing: $skillName"
|
||||
Write-Host "------------------------"
|
||||
|
||||
|
||||
$issues = Test-SkillHealth -SkillDir $skillDir.FullName
|
||||
|
||||
|
||||
$skillVersion = Get-SkillVersion -SkillFile (Join-Path $skillDir.FullName "SKILL.md")
|
||||
$skillSummary += @{
|
||||
Name = $skillName
|
||||
Issues = $issues
|
||||
Version = $skillVersion
|
||||
}
|
||||
|
||||
|
||||
$totalIssues += $issues
|
||||
Write-Host ""
|
||||
}
|
||||
@@ -165,19 +160,19 @@ if (Test-Path $skillsVersionFile) {
|
||||
$globalVersion = $matches[1].Trim()
|
||||
Write-Host "Global skills version: v$globalVersion"
|
||||
Write-Host ""
|
||||
|
||||
|
||||
# Check for version mismatches
|
||||
Write-Host "Version Consistency Check:"
|
||||
Write-Host "------------------------"
|
||||
$versionMismatches = 0
|
||||
|
||||
|
||||
foreach ($summary in $skillSummary) {
|
||||
if ($summary.Version -ne "unknown" -and $summary.Version -ne "no_file" -and $summary.Version -ne $globalVersion) {
|
||||
Write-Host " MISMATCH: $($summary.Name) is v$($summary.Version), global is v$globalVersion" -ForegroundColor $Colors.Yellow
|
||||
$versionMismatches++
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($versionMismatches -eq 0) {
|
||||
Write-Host " All skills match global version" -ForegroundColor $Colors.Green
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user