Agent Skill
2/7/2026

sync-copilot-assets

Synchronize GitHub Copilot customization assets (agents, instructions, prompts, skills) from a central repository to multiple target workspaces. Use when you need to distribute or update Copilot assets across projects. Keywords: sync, distribute, copy, propagate, assets, agents, instructions, prompts, skills, repositories.

J
jurel89
1GitHub Stars
1Views
npx skills add Jurel89/copilot-resources

SKILL.md

Namesync-copilot-assets
DescriptionSynchronize GitHub Copilot customization assets (agents, instructions, prompts, skills) from a central repository to multiple target workspaces. Use when you need to distribute or update Copilot assets across projects. Keywords: sync, distribute, copy, propagate, assets, agents, instructions, prompts, skills, repositories.

name: sync-copilot-assets description: 'Synchronize GitHub Copilot customization assets (agents, instructions, prompts, skills) from a central repository to multiple target workspaces. Use when you need to distribute or update Copilot assets across projects. Keywords: sync, distribute, copy, propagate, assets, agents, instructions, prompts, skills, repositories.' license: Complete terms in LICENSE.txt

Sync Copilot Assets

Synchronize GitHub Copilot customization assets from this repository to multiple target repositories using a cross-platform Node.js script.

When to Use This Skill

  • You want to distribute Copilot assets to multiple projects
  • You need to update existing assets across workspaces
  • You're maintaining a central repository of Copilot customizations
  • Keywords: sync, distribute, copy, propagate, assets, agents, instructions, prompts, skills

⚠️ Critical Warning

This sync performs FULL OVERWRITE synchronization. Files in target repositories that don't exist in source WILL BE DELETED. Always run dry-run first.

Prerequisites

  • Node.js 18.x or later (check with node --version)
  • No additional dependencies or npm packages needed
  • Works on Windows, macOS, and Linux

Configuration

Before syncing, configure your target repositories in sync-targets.txt at the repository root:

# One absolute path per line
/Users/username/projects/project-alpha
/Users/username/projects/project-beta

See sync-targets-example.txt for a complete example.

Step-by-Step Workflow

Step 1: Verify Configuration

Check that target repositories are configured:

cat sync-targets.txt

If empty or only comments, add target paths first.

Step 2: Preview Changes (Dry-Run)

ALWAYS run dry-run first:

node .github/skills/sync-copilot-assets/scripts/sync-copilot-assets.mjs --dry-run

Review the output to see what would be added, updated, or deleted.

Step 3: Execute Sync

After confirming the dry-run output, run the actual sync:

node .github/skills/sync-copilot-assets/scripts/sync-copilot-assets.mjs

Step 4: Commit Changes in Targets

After syncing, commit changes in each target repository:

cd /path/to/target-repo
git add .github/
git commit -m "chore: sync Copilot assets from copilot-resources"
git push

Script Options

FlagDescription
-n, --dry-runPreview changes without modifying any files
-q, --quietSuppress progress output (errors still shown)
-h, --helpDisplay detailed usage information
-v, --versionShow script version

Synced Asset Directories

DirectoryContents
.github/agents/Agent definition files (.agent.md)
.github/instructions/Instruction files (.instructions.md)
.github/prompts/Prompt files (.prompt.md)
.github/skills/Skill folders with resources

Output Indicators

SymbolMeaning
+File added (new)
File updated (overwritten)
-File deleted (removed from target)

Exit Codes

CodeMeaning
0All targets synced successfully
1Partial success (some targets failed/skipped)
2Critical failure (missing source, invalid config)

Troubleshooting

IssueCauseSolution
"Configuration file not found"sync-targets.txt missingCreate the file with target paths
"Target path does not exist"Repo not cloned or wrong pathVerify path exists; clone repo if needed
"Permission denied"No write access to targetCheck filesystem permissions
"Node.js X.x required"Node.js version too oldUpdate Node.js to 18.x or later
"Source directories not found"Running from wrong directoryRun from repository root

Recovering from Mistakes

If you accidentally synced unwanted changes:

cd /path/to/target-repo
git checkout -- .github/

Or reset to previous commit:

git reset --hard HEAD~1

Cross-Platform Notes

Works identically on Windows, macOS, and Linux.

Path formats in sync-targets.txt:

  • Windows: C:\Users\username\projects\repo or C:/Users/username/projects/repo
  • macOS: /Users/username/projects/repo
  • Linux: /home/username/projects/repo

References

Skills Info
Original Name:sync-copilot-assetsAuthor:jurel89