【工程】删除 skill 专属的同步脚本

main
马远征 2026-05-08 14:07:48 +08:00
parent 83c54a1cce
commit 04bf0a797c
2 changed files with 0 additions and 156 deletions

View File

@ -1,76 +0,0 @@
# sync-all.ps1 — 将 .ai/ 下的 skills、protocols、agents 同步到各平台目录
# 新增或更新后运行此脚本即可同步到全部平台
# 用法: cd ProjectNLD && powershell -ExecutionPolicy Bypass -File .ai/sync-all.ps1
$ErrorActionPreference = "Stop"
$PLATFORMS = @(".cursor", ".claude", ".github", ".kiro")
# ── 1. Sync skills ──────────────────────────────────────────────
$SKILLS_SRC = ".ai/skills"
Write-Host "=== Syncing skills from $SKILLS_SRC ==="
$skillCount = 0
Get-ChildItem "$SKILLS_SRC" -Directory | ForEach-Object {
$skill = $_.Name
$skillMd = Join-Path $_.FullName "SKILL.md"
if (-not (Test-Path $skillMd)) { return }
foreach ($platform in $PLATFORMS) {
$targetDir = Join-Path $platform "skills/$skill"
New-Item -ItemType Directory -Force -Path $targetDir | Out-Null
Copy-Item $skillMd (Join-Path $targetDir "SKILL.md") -Force
}
Write-Host " ✓ skill: $skill"
$skillCount++
}
# ── 2. Sync protocols ──────────────────────────────────────────
$PROTOCOLS_SRC = ".ai/protocols"
Write-Host ""
Write-Host "=== Syncing protocols from $PROTOCOLS_SRC ==="
$protoCount = 0
if (Test-Path $PROTOCOLS_SRC) {
Get-ChildItem "$PROTOCOLS_SRC" -Filter "*.md" | ForEach-Object {
$filename = $_.Name
foreach ($platform in $PLATFORMS) {
$targetDir = Join-Path $platform "protocols"
New-Item -ItemType Directory -Force -Path $targetDir | Out-Null
Copy-Item $_.FullName (Join-Path $targetDir $filename) -Force
}
Write-Host " ✓ protocol: $filename"
$protoCount++
}
}
# ── 3. Sync agents ─────────────────────────────────────────────
$AGENTS_SRC = ".ai/agents"
Write-Host ""
Write-Host "=== Syncing agents from $AGENTS_SRC ==="
$agentCount = 0
if (Test-Path $AGENTS_SRC) {
Get-ChildItem "$AGENTS_SRC" -Filter "*.md" | ForEach-Object {
$filename = $_.Name
foreach ($platform in $PLATFORMS) {
$targetDir = Join-Path $platform "agents"
New-Item -ItemType Directory -Force -Path $targetDir | Out-Null
Copy-Item $_.FullName (Join-Path $targetDir $filename) -Force
}
Write-Host " ✓ agent: $filename"
$agentCount++
}
}
# ── Summary ─────────────────────────────────────────────────────
Write-Host ""
Write-Host "Done. Synced to $($PLATFORMS.Count) platforms:"
Write-Host " Skills: $skillCount"
Write-Host " Protocols: $protoCount"
Write-Host " Agents: $agentCount"

View File

@ -1,80 +0,0 @@
#!/bin/bash
# sync-all.sh — 将 .ai/ 下的 skills、protocols、agents 同步到各平台目录
# 新增或更新后运行此脚本即可同步到全部平台
# 用法: cd ProjectNLD && bash .ai/sync-all.sh
set -e
PLATFORMS=(".cursor" ".claude" ".github" ".kiro")
# ── 1. Sync skills ──────────────────────────────────────────────
SKILLS_SRC=".ai/skills"
echo "=== Syncing skills from $SKILLS_SRC ==="
skill_count=0
for skill_dir in "$SKILLS_SRC"/*/; do
[ -d "$skill_dir" ] || continue
skill=$(basename "$skill_dir")
skill_md="$skill_dir/SKILL.md"
[ -f "$skill_md" ] || continue
for platform in "${PLATFORMS[@]}"; do
target_dir="$platform/skills/$skill"
mkdir -p "$target_dir"
cp "$skill_md" "$target_dir/SKILL.md"
done
echo " ✓ skill: $skill"
((skill_count++))
done
# ── 2. Sync protocols ──────────────────────────────────────────
PROTOCOLS_SRC=".ai/protocols"
echo ""
echo "=== Syncing protocols from $PROTOCOLS_SRC ==="
proto_count=0
if [ -d "$PROTOCOLS_SRC" ]; then
for proto_file in "$PROTOCOLS_SRC"/*.md; do
[ -f "$proto_file" ] || continue
filename=$(basename "$proto_file")
for platform in "${PLATFORMS[@]}"; do
target_dir="$platform/protocols"
mkdir -p "$target_dir"
cp "$proto_file" "$target_dir/$filename"
done
echo " ✓ protocol: $filename"
((proto_count++))
done
fi
# ── 3. Sync agents ─────────────────────────────────────────────
AGENTS_SRC=".ai/agents"
echo ""
echo "=== Syncing agents from $AGENTS_SRC ==="
agent_count=0
if [ -d "$AGENTS_SRC" ]; then
for agent_file in "$AGENTS_SRC"/*.md; do
[ -f "$agent_file" ] || continue
filename=$(basename "$agent_file")
for platform in "${PLATFORMS[@]}"; do
target_dir="$platform/agents"
mkdir -p "$target_dir"
cp "$agent_file" "$target_dir/$filename"
done
echo " ✓ agent: $filename"
((agent_count++))
done
fi
# ── Summary ─────────────────────────────────────────────────────
echo ""
echo "Done. Synced to ${#PLATFORMS[@]} platforms:"
echo " Skills: $skill_count"
echo " Protocols: $proto_count"
echo " Agents: $agent_count"