Created
January 31, 2026 15:44
-
-
Save markomitranic/f74932b7468c7726e7daf34f6d87039d to your computer and use it in GitHub Desktop.
Copies the AGENTS.md file to proprietary platforms and formats (e.g. Cursor, Claude Code, GitHub Copilot)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Copies the AGENTS.md file to proprietary platforms and formats (e.g. Cursor, Claude Code, GitHub Copilot) | |
| # | |
| # Usage: ./scripts/sync-agents-md.sh | |
| # | |
| # Pro tip: add to your `.husky/pre-push`, `.husky/post-merge`, `.husky/post-checkout` hooks. | |
| # > echo "π (operation) Sync AGENTS.md for proprietary platforms. (Cursor, Claude, GitHub Copilot...)" | |
| # > ./scripts/sync-agents-md.sh | |
| # | |
| # Pro tip 2: Make the harnesses ignore each-others files: | |
| # > echo "AGENTS.md" >> .cursorignore | |
| # > echo "CLAUDE.md" >> .cursorignore | |
| # > echo ".github/copilot-instructions.md" >> .cursorignore | |
| if [ ! -f ./AGENTS.md ]; then | |
| echo "β AGENTS.md not found" >&2 | |
| exit 1 | |
| fi | |
| # Copy into CLAUDE.md | |
| cp ./AGENTS.md ./CLAUDE.md | |
| echo "β Regenerated CLAUDE.md from AGENTS.md" | |
| # Copy into GitHub Copilot | |
| mkdir -p .github | |
| cp ./AGENTS.md .github/copilot-instructions.md | |
| echo "β Regenerated copilot-instructions.md from AGENTS.md" | |
| # Copy into Cursor | |
| mkdir -p .cursor/rules | |
| { | |
| echo "---" | |
| echo "alwaysApply: true" | |
| echo "---" | |
| echo "" | |
| cat ./AGENTS.md | |
| } > .cursor/rules/project.mdc | |
| echo "β Regenerated .cursor/rules/project.mdc from AGENTS.md" | |
| echo "[If you see a git diff at any of these files, you should commit them.]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment