# How to Sync AGENTS.md Changes Across All Supported AI Agent Platforms

> Sync AGENTS.md changes across Copilot, Cursor, Claude and more. Run bash scripts/sync-agent-rules.sh and node scripts/sync-skills.mjs after edits to update all AI agents.

- Repository: [JCodesMore/ai-website-cloner-template](https://github.com/JCodesMore/ai-website-cloner-template)
- Tags: how-to-guide
- Published: 2026-07-01

---

**Run `bash scripts/sync-agent-rules.sh` followed by `node scripts/sync-skills.mjs` after editing [`AGENTS.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/AGENTS.md) to propagate identical instructions to Copilot, Cursor, Claude, and seven other AI coding agents.**

The [`AGENTS.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/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`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/sync-agent-rules.sh)

The bash script at [`scripts/sync-agent-rules.sh`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/scripts/sync-agent-rules.sh) processes [`AGENTS.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/AGENTS.md) and expands any `@…` import statements to create self-contained rule files. It targets agents that cannot read [`AGENTS.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/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:
- [`.github/copilot-instructions.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/.github/copilot-instructions.md)
- `.clinerules`
- [`.continue/rules/project.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/.continue/rules/project.md)
- [`.amazonq/rules/project.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/.amazonq/rules/project.md)

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`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/.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`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/.codex/skills/clone-website/SKILL.md), [`.cursor/commands/clone-website.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/.cursor/commands/clone-website.md), and [`.amazonq/cli-agents/clone-website.json`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/.amazonq/cli-agents/clone-website.json).

## Step-by-Step Sync Workflow

Follow this exact sequence after modifying [`AGENTS.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/AGENTS.md) or any imported documentation like [`docs/research/INSPECTION_GUIDE.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/docs/research/INSPECTION_GUIDE.md):

1. Edit the source files ([`AGENTS.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/AGENTS.md) or imports)
2. Generate global rule files for agents that require them
3. Regenerate the `clone-website` skill with platform-specific formatting
4. 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
bash scripts/sync-agent-rules.sh

```

You will see output similar to:

```text
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:

```bash
node scripts/sync-skills.mjs

```

The script logs its progress, indicating the source file and each generated target:

```text
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`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/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`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/.claude/skills/clone-website/SKILL.md).

## Summary

- **[`AGENTS.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/AGENTS.md)** is the single source of truth for AI agent instructions in the repository.
- **[`scripts/sync-agent-rules.sh`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/scripts/sync-agent-rules.sh)** generates rule files for platforms that cannot read [`AGENTS.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/AGENTS.md) directly, including [`.github/copilot-instructions.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/.github/copilot-instructions.md) and `.clinerules`.
- **`scripts/sync-skills.mjs`** converts the canonical [`.claude/skills/clone-website/SKILL.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/.claude/skills/clone-website/SKILL.md) into 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.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/AGENTS.md) modification to maintain consistency.

## Frequently Asked Questions

### What happens if I only run one synchronization script?

Running only [`sync-agent-rules.sh`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/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`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/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`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/AGENTS.md)?

You should not edit generated files directly. The scripts overwrite [`.github/copilot-instructions.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/.github/copilot-instructions.md), [`.cursor/commands/clone-website.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/.cursor/commands/clone-website.md), and other targets on each execution. Always modify [`AGENTS.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/AGENTS.md) or the source skill at [`.claude/skills/clone-website/SKILL.md`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/.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`](https://github.com/JCodesMore/ai-website-cloner-template/blob/main/sync-agent-rules.sh), this ensures comprehensive coverage across the entire supported ecosystem.