Generate a Copilot-style instruction file from the project graph
Source:R/generate_instructions.R
generate_instructions.RdExtracts key information from the rrlm_graph and writes a
Markdown instruction document suitable for AI coding assistants
(e.g. .github/copilot-instructions.md). The output summarises
the project type, R version, top functions by PageRank, inferred coding
conventions, and installed package inventory.
Arguments
- graph
An
rrlm_graph/igraphobject.- output_path
Character(1) or
NULL. Destination file path. WhenNULL(default) the file is written to.github/copilot-instructions.mdinside the project root stored ingraph_attr(graph, "project_root").- max_tokens
Integer(1). Soft upper bound on output size in tokens (approximated as
nchar / 4). Content is trimmed to stay under this limit. Default2000L.
Examples
if (FALSE) { # \dontrun{
g <- build_rrlm_graph("mypkg")
generate_instructions(g)
} # }