Creates a markdown file with instructions for AI coding assistants (such as Claude, Codex, or Gemini) on how to create Grattan-styled charts using the grattantheme package. The guide covers chart styling conventions, colour palettes, saving functions, and common patterns.

grattan_write_ai_guide(filename = "CLAUDE.md", path = ".", overwrite = FALSE)

Arguments

filename

The name of the file to create. Defaults to "CLAUDE.md". Different AI tools look for different filenames:

CLAUDE.md

Used by Claude Code (Anthropic). Also reads AGENTS.md.

AGENTS.md

Cross-tool standard used by OpenAI Codex, Google Gemini/Jules, and many other AI coding assistants.

path

The directory in which to create the file. Defaults to the current working directory.

overwrite

Logical. If FALSE (the default), the function will not overwrite an existing file and will instead display a message.

Value

The file path of the created file (invisibly).

Examples

if (FALSE) { # \dontrun{
# Write a CLAUDE.md file (default, for Claude Code)
grattan_write_ai_guide()

# Write an AGENTS.md file (cross-tool standard for Codex, Gemini, etc.)
grattan_write_ai_guide("AGENTS.md")

# Write to a specific directory
grattan_write_ai_guide("CLAUDE.md", path = "path/to/project")

# Overwrite an existing file
grattan_write_ai_guide(overwrite = TRUE)
} # }