How to Sync AGENTS.md Changes Across All Supported AI Agent Platforms
Run bash scripts/sync-agent-rules.sh followed by node scripts/sync-skills.mjs after editing AGENTS.md to propagate identical instructions to Copilot, Cursor, Claude, and seven other AI coding agents.
The AGENTS.md file in the JCodesMore/ai-website-cloner-template repository serves as the single source of truth for AI coding instructions. When you modify this central configuration, you must synchronize those changes across all supported AI agent platforms to ensure consistent behavior. This guide explains how to use the repository's automation scripts to sync AGENTS.md changes across all supported AI agent platforms without manual copy-pasting.
The Two-Script Synchronization Strategy
The repository provides two distinct automation tools that handle different aspects of the synchronization process. Both scripts read from central sources and generate platform-specific configuration files that agents consume.
Resolve Imports and Copy Rules with sync-agent-rules.sh
The bash script at scripts/sync-agent-rules.sh processes AGENTS.md and expands any @… import statements to create self-contained rule files. It targets agents that cannot read AGENTS.md directly, such as Copilot Chat, Cline, Continue, and Amazon Q.
When executed, the script reads the central definitions and writes resolved content to:
The script outputs a verification checkmark (✓) for each successfully generated file, confirming that global project conventions (coding style and design principles) have been synchronized.
Propagate Skills with sync-skills.mjs
The Node.js script at scripts/sync-skills.mjs parses the canonical skill definition located at .claude/skills/clone-website/SKILL.md and creates platform-specific command files. This handles the clone-website skill that each platform executes, converting syntax to match platform requirements.
This script generates files for nine distinct platforms: Codex, Copilot, Cursor, Windsurf, Gemini CLI, OpenCode, Augment, Continue, and Amazon Q. Generated outputs include paths such as .codex/skills/clone-website/SKILL.md, .cursor/commands/clone-website.md, and .amazonq/cli-agents/clone-website.json.
Step-by-Step Sync Workflow
Follow this exact sequence after modifying AGENTS.md or any imported documentation like docs/research/INSPECTION_GUIDE.md:
- Edit the source files (
AGENTS.mdor imports) - Generate global rule files for agents that require them
- Regenerate the
clone-websiteskill with platform-specific formatting - Stage and commit the generated files to version control
Executing the Rules Sync
Run the following command to expand imports and update rule files:
bash scripts/sync-agent-rules.sh
You will see output similar to:
Syncing agent rules from AGENTS.md...
✓ .github/copilot-instructions.md
✓ .clinerules
✓ .continue/rules/project.md
✓ .amazonq/rules/project.md
Executing the Skills Sync
Run the following command to propagate the clone-website skill across all nine supported platforms:
node scripts/sync-skills.mjs
The script logs its progress, indicating the source file and each generated target:
Syncing clone-website skill to all platforms...
Source: .claude/skills/clone-website/SKILL.md
✓ .codex/skills/clone-website/SKILL.md
✓ .github/skills/clone-website/SKILL.md
✓ .cursor/commands/clone-website.md
… (other platforms) …
Done! 9 platform command files generated from source skill.
Why Both Scripts Are Required
scripts/sync-agent-rules.sh manages the global rule set that establishes project-wide conventions. These rules define coding standards, architectural decisions, and design principles that every agent must follow when interacting with the codebase.
scripts/sync-skills.mjs manages command-specific execution logic. The clone-website skill requires different syntax and file structures across platforms—JSON for some, Markdown for others—so the script performs necessary format conversions while preserving the canonical logic defined in .claude/skills/clone-website/SKILL.md.
Summary
AGENTS.mdis the single source of truth for AI agent instructions in the repository.scripts/sync-agent-rules.shgenerates rule files for platforms that cannot readAGENTS.mddirectly, including.github/copilot-instructions.mdand.clinerules.scripts/sync-skills.mjsconverts the canonical.claude/skills/clone-website/SKILL.mdinto nine platform-specific command formats.- Both scripts write files under version control, which must be committed to persist changes across environments.
- Run the scripts sequentially (rules first, then skills) after every
AGENTS.mdmodification to maintain consistency.
Frequently Asked Questions
What happens if I only run one synchronization script?
Running only sync-agent-rules.sh updates global coding conventions but leaves command-specific clone-website instructions stale. Running only sync-skills.mjs updates the skill logic while potentially using outdated global rules. Both scripts must execute to achieve complete synchronization across all AI agent platforms.
Do I need to install dependencies to run these scripts?
The sync-agent-rules.sh script requires only standard bash utilities available on macOS and Linux. The sync-skills.mjs script requires Node.js to execute the .mjs file, but the repository handles generation logic internally without external npm dependencies for basic operation.
Can I modify generated files directly instead of editing AGENTS.md?
You should not edit generated files directly. The scripts overwrite .github/copilot-instructions.md, .cursor/commands/clone-website.md, and other targets on each execution. Always modify AGENTS.md or the source skill at .claude/skills/clone-website/SKILL.md, then run the sync scripts to regenerate the platform-specific files.
How many platforms receive updates when I run the full sync?
The sync-skills.mjs script generates files for nine distinct AI agent platforms: Codex, Copilot, Cursor, Windsurf, Gemini CLI, OpenCode, Augment, Continue, and Amazon Q. Combined with the rule files from sync-agent-rules.sh, this ensures comprehensive coverage across the entire supported ecosystem.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →