Project guidance for Claude Code (CLI, IDE, and the GitHub Action). The same
conventions apply to GitHub Copilot — see
.github/copilot-instructions.md, which is
the source of truth for repository-specific style and workflow. This file
is a short orientation; defer to copilot-instructions.md for details.
This is a template repository for creating R packages following UCD-SERG
standards. When you create a package from it, replace the placeholder package
name, Title, and Description in DESCRIPTION (and the project context above)
with your actual package details.
Authoritative style guide: UCD-SERG Lab Manual (source: https://github.com/UCD-SERG/lab-manual).
R/,man/,NAMESPACE,DESCRIPTION— R package source and generated docstests/testthat/— testthat suite (use snapshot tests where helpful)vignettes/— package vignettes and.qmdarticlesaltdoc/— altdoc + Quarto documentation site config (quarto_website.yml,index.qmd, post-render scripts)data-raw/— scripts that generate package datainst/WORDLIST— accepted spell-check terms.github/workflows/— CI workflow definitions
This template documents the package with altdoc
- Quarto (not pkgdown):
altdoc::render_docs()generates man-page.qmdfiles (underaltdoc/man/) fromman/*.Rdat build time, then invokes Quarto (project rootaltdoc/,altdoc/quarto_website.yml) to render the site intodocs/. Thedocs/output is gitignored; the generated man.qmdfiles are regenerated each build — neither is committed.- For doc or vignette changes, build and preview locally before requesting
review:
altdoc::render_docs(verbose = TRUE), thenaltdoc::preview_docs(), and visually confirm the rendered site (math, code highlighting, links, nav). .github/workflows/docs.yamlbuilds and deploys the site: pushes tomaingo to/dev/, stable releases go to/latest-tag/and/<tag>/, and each PR gets a preview at/preview/pr<number>/viarossjrw/pr-preview-action. AVersionsnavbar dropdown is generated by.github/scripts/generate_version_dropdown.py.
Run the relevant checks before committing (see copilot-instructions.md for the full list). Slash commands are available for the common ones:
/document—devtools::document()after editing roxygen2 comments (keepsman/,NAMESPACE,DESCRIPTIONin sync;R-check-docs.ymlenforces this)./lint—lintr::lint_package()against.lintr.R; fix issues in changed files./spell—spelling::spell_check_package(); add genuine terms toinst/WORDLIST./test—devtools::test()for affected tests./check—devtools::check()for the full R CMD check (slow).- Add a
NEWS.mdbullet for any user-facing change (news.yamlenforces this viaUCD-SERG/changelog-check-action).
- Don't remove features as workarounds. If a link, button, or behavior is broken, fix the root cause. Only remove or disable a feature when explicitly instructed to.
- Don't edit generated files:
README.mdis built fromREADME.Rmd;man/andNAMESPACEare generated bydevtools::document(). - Style: respect
.lintr.R(snake_case, line length, etc.). Extract complex argument validation into internal helpers (e.g..validate_*()). - Tests: cover new/changed behavior with testthat; set seeds where randomness is involved so snapshots are deterministic.
- Keep PRs scoped — bug fixes shouldn't smuggle in refactors.
- Write commit messages and PR descriptions explaining the why, not the what.
- Don't bypass CI failures (spell check, lint, docs sync) — fix the underlying issue.
- Adding new package dependencies without a clear reason; declare them in
DESCRIPTION(Imports/Suggests) rather than loading ad hoc. - Reformatting unrelated files.
- Inventing URLs or citations — only use sources explicitly provided.