Agent Quickstart
Source:AGENTS.md
README.md is the human quickstart for this repository. AGENTS.md is the agent quickstart.
What rllmdoc does
rllmdoc generates spec-valid llms.txt and llms-full.txt artifacts for:
- Quarto projects (website and book subtypes)
- R package documentation sites built with pkgdown
The package uses a hybrid model:
- Quarto
llms-txt: trueand pkgdownbuild_llm_docs()are used to generate supporting markdown companions (.llms.mdand.mdfiles). - rllmdoc does not treat native
llms.txtoutput as canonical. - rllmdoc derives grouping and descriptions from existing project config, validates the final output against the spec, writes the tracked
llms.txtitself, and mirrors llms-only artifacts into_llms/.
Current Public Surface
The current exported interface is:
use_llm_docs()llms_document()build_llms_docs()as_project()check_quarto_yaml()parse_quarto_yaml()parse_quarto_body()md2qmd()
Historical note:
- Older commits and stale generated docs may reference intermediate names such as
detect_project(),use_llms_txt(),build_llms_txt(), andbuild_llms_full_txt(). - Those names are useful for archaeology, but they are not the current public API.
Read In This Order
When onboarding to the repo, read in this order:
AGENTS.mdvignettes/rllmdoc.qmdvignettes/spec-contract.qmdNEWS.md- The plan
next-phase-pipelinein the$AGENTS_HOMEplans directory DISCUSS.md- Then the relevant files in
R/andtests/testthat/
If generated docs under docs/ disagree with source files, prefer the source files and rebuild the generated artifacts.
Canonical Documentation Sources
Source-of-truth documentation lives in:
-
R/roxygen comments vignettes/README.mdAGENTS.mdNEWS.md_pkgdown.yml-
DISCUSS.mdfor research and discussion context
Generated outputs live in:
man/NAMESPACEdocs/
Documentation Build Workflow
Run from the package root in an R session:
devtools::document()
pkgdown::clean_site()
pkgdown::build_site()
devtools::load_all(quiet = TRUE)
rllmdoc::build_llms_docs(".")Why the last step matters:
-
pkgdown::build_site()generates the HTML site and the supporting.mdcompanion files. -
rllmdoc::build_llms_docs(".")then replaces pkgdown’s nativellms.txtwith the package’s curated, spec-validllms.txt, updatesllms-full.txt, and refreshes_llms/.
Use a clean site rebuild when generated docs drift, old reference pages linger, or search metadata looks stale.
Project Structure
rllmdoc is a standalone R package.
- Core implementation lives in
R/, usually one concern per file. - Tests live in
tests/testthat/; shared test helpers are intests/testthat/helper-rllmdoc.R. - Long-form package docs live in
vignettes/. - JSON schemas live in
inst/schemas/. - The published pkgdown site lives in tracked
docs/.
Coding And Testing
- Follow the repository’s existing R style: two-space indentation, small focused functions, and fail-fast
cli::cli_abort()errors. - Exported APIs use
snake_case; internal helpers use dotted private names. - Add regression tests for behavior changes in
tests/testthat/test-*.R. - Run
devtools::document()after changing roxygen comments or exported functions.
Release History And Planning
- Update
NEWS.mdwhenever behavior or API changes. - Forward-looking roadmap lives in the
$AGENTS_HOMEplans directory, not in this repo. It is not the source of truth for the current shipped interface. -
DISCUSS.mdis research and exploratory context, not authoritative runtime behavior.