| ai_sync_context | R Documentation |
Copies content from the canonical AI assistant file to all other AI files, adding a warning header to non-canonical files.
ai_sync_context(config_file = NULL, force = FALSE, verbose = TRUE)
config_file |
Path to configuration file (default: auto-detect settings.yml/settings.yml) |
force |
Logical; if TRUE, overwrite even if target is newer (default: FALSE) |
verbose |
Logical; if TRUE (default), show sync messages |
This function reads the ai.canonical_file setting from settings.yml and
copies its content to all other AI assistant instruction files that exist
in the project.
The canonical file is copied as-is. Non-canonical files receive a warning header indicating they are auto-synced and should not be edited directly.
Supported files:
AGENTS.md - Cross-platform AI assistants
CLAUDE.md - Claude Code
.github/copilot-instructions.md - GitHub Copilot
Invisible list with sync results
if (FALSE) {
# Sync AI context files
ai_sync_context()
# Force sync even if targets are newer
ai_sync_context(force = TRUE)
# Silent sync (for git hooks)
ai_sync_context(verbose = FALSE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.