| briefing | R Documentation |
Generate project context for AI coding agents. Generate a project briefing
Produces a concise markdown briefing combining DESCRIPTION metadata,
downstream dependents, 'Claude Code' memory (skipped when
agent = "claude" since 'Claude Code' autoloads it), and
recent git commits.
Written to the user cache directory so both the agent and user
see the same context.
briefing(project = NULL, scan_dir = path.expand("~"), agent = NULL,
memory_base = file.path(path.expand("~"), ".claude", "projects"),
briefs_dir = file.path(tools::R_user_dir("saber", "cache"), "briefs"),
max_memory_lines = 30L)
project |
Project name. If NULL, inferred from the current working directory basename. |
scan_dir |
Directory to scan for project directories. |
agent |
Which coding agent is calling: |
memory_base |
Base directory for 'Claude Code' project memory files. |
briefs_dir |
Directory to write briefing markdown files. |
max_memory_lines |
Maximum lines to include from the memory file. |
The briefing text (character string), returned invisibly. Printed
to stdout and written to briefs_dir/{project}.md.
d <- file.path(tempdir(), "briefpkg")
dir.create(file.path(d, "R"), recursive = TRUE, showWarnings = FALSE)
writeLines(c("Package: briefpkg", "Title: Demo", "Version: 0.1.0"),
file.path(d, "DESCRIPTION"))
briefing("briefpkg", scan_dir = tempdir(),
briefs_dir = file.path(tempdir(), "briefs"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.