ai_sync_context: Sync AI Assistant Context Files

View source: R/ai_sync.R

ai_sync_contextR Documentation

Sync AI Assistant Context Files

Description

Copies content from the canonical AI assistant file to all other AI files, adding a warning header to non-canonical files.

Usage

ai_sync_context(config_file = NULL, force = FALSE, verbose = TRUE)

Arguments

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

Details

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

Value

Invisible list with sync results

Examples


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)
}



framework documentation built on Feb. 18, 2026, 1:07 a.m.