690513:0920 Refactor Workflow module: Lint error #01
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# File: scripts/sync-agent-configs.ps1
|
||||
# Change Log:
|
||||
# - 2026-05-13: Initial script to sync .agents to .windsurf
|
||||
|
||||
$rootDir = Get-Location
|
||||
$agentsDir = Join-Path $rootDir ".agents"
|
||||
$windsurfDir = Join-Path $rootDir ".windsurf"
|
||||
|
||||
Write-Host "🚀 Syncing .agents to .windsurf (v1.9.0)..." -ForegroundColor Cyan
|
||||
|
||||
# 1. Sync Rules (with YAML header)
|
||||
Write-Host "📂 Syncing Rules..." -ForegroundColor Yellow
|
||||
$rulesSrc = Join-Path $agentsDir "rules"
|
||||
$rulesDest = Join-Path $windsurfDir "rules"
|
||||
|
||||
if (!(Test-Path $rulesDest)) { New-Item -ItemType Directory -Path $rulesDest }
|
||||
|
||||
Get-ChildItem -Path $rulesSrc -Filter *.md | ForEach-Object {
|
||||
$content = Get-Content $_.FullName
|
||||
$targetFile = Join-Path $rulesDest $_.Name
|
||||
|
||||
# Check if YAML header already exists
|
||||
if ($content[0] -ne "---") {
|
||||
$newContent = @("---", "trigger: always_on", "---", "") + $content
|
||||
$newContent | Set-Content $targetFile
|
||||
} else {
|
||||
$content | Set-Content $targetFile
|
||||
}
|
||||
}
|
||||
|
||||
# 2. Sync Workflows (Mirror/Copy)
|
||||
Write-Host "📂 Syncing Workflows..." -ForegroundColor Yellow
|
||||
$workflowsSrc = Join-Path $agentsDir "workflows"
|
||||
$workflowsDest = Join-Path $windsurfDir "workflows"
|
||||
|
||||
if (!(Test-Path $workflowsDest)) { New-Item -ItemType Directory -Path $workflowsDest }
|
||||
Copy-Item -Path "$workflowsSrc\*" -Destination $workflowsDest -Force -Recurse
|
||||
|
||||
# 3. Sync Skills (Mirror/Copy)
|
||||
Write-Host "📂 Syncing Skills..." -ForegroundColor Yellow
|
||||
$skillsSrc = Join-Path $agentsDir "skills"
|
||||
$skillsDest = Join-Path $windsurfDir "skills"
|
||||
|
||||
if (!(Test-Path $skillsDest)) { New-Item -ItemType Directory -Path $skillsDest }
|
||||
Copy-Item -Path "$skillsSrc\*" -Destination $skillsDest -Force -Recurse
|
||||
|
||||
Write-Host "✅ Sync Complete!" -ForegroundColor Green
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
# File: scripts/sync-agent-configs.sh
|
||||
# Change Log:
|
||||
# - 2026-05-13: Initial script to sync .agents to .windsurf
|
||||
|
||||
echo "🚀 Syncing .agents to .windsurf (v1.9.0)..."
|
||||
|
||||
AGENTS_DIR="./.agents"
|
||||
WINDSURF_DIR="./.windsurf"
|
||||
|
||||
# 1. Sync Rules (with YAML header)
|
||||
echo "📂 Syncing Rules..."
|
||||
mkdir -p "$WINDSURF_DIR/rules"
|
||||
|
||||
for file in "$AGENTS_DIR/rules/"*.md; do
|
||||
filename=$(basename "$file")
|
||||
dest_file="$WINDSURF_DIR/rules/$filename"
|
||||
|
||||
# Read first line
|
||||
first_line=$(head -n 1 "$file")
|
||||
|
||||
if [ "$first_line" != "---" ]; then
|
||||
echo -e "---\ntrigger: always_on\n---\n" > "$dest_file"
|
||||
cat "$file" >> "$dest_file"
|
||||
else
|
||||
cat "$file" > "$dest_file"
|
||||
fi
|
||||
done
|
||||
|
||||
# 2. Sync Workflows
|
||||
echo "📂 Syncing Workflows..."
|
||||
mkdir -p "$WINDSURF_DIR/workflows"
|
||||
cp -r "$AGENTS_DIR/workflows/"* "$WINDSURF_DIR/workflows/"
|
||||
|
||||
# 3. Sync Skills
|
||||
echo "📂 Syncing Skills..."
|
||||
mkdir -p "$WINDSURF_DIR/skills"
|
||||
cp -r "$AGENTS_DIR/skills/"* "$WINDSURF_DIR/skills/"
|
||||
|
||||
echo "✅ Sync Complete!"
|
||||
Reference in New Issue
Block a user