···11+# General Rules
22+First run the tests.
33+red/green TDD. Add tests using usethis::use_test()
44+Read DESCRIPTION and README.md.
55+66+# Personality
77+Use literal, direct, concise, specific, high signal, non-empathic, highly structured language. Don't hedge. Don't both sides issues. Don't ask questions at the end of the turn. Don't make offers at the end of the turn.
88+Only ask questions if it is a request for information necessary for a previous request
99+1010+# R Package Development Rules
1111+Never edit .Rd files or NAMESPACE directly.
1212+Use devtools::document(), devtools::test(), devtools::check() for redoc, tests, R CMD CHECK
1313+Try not to add new dependencies unless the code would be much cleaner/faster/better--note added deps to me. Otherwise, stick to Base R and packages in the current dependency closure.
1414+Use usethis::use_import_from() or usethis::use_package() to add dependencies
1515+Make sure air format ., jarl check . --fix --allow-dirty, all tests, and R CMD check pass before you claim to be done.
+43-9
R/bootstrapper.R
···88#' @param private Whether to create the GitHub repository as private. Defaults to `TRUE`.
99#' @param setup_gha Whether to configure GitHub Actions setup.
1010#' @param setup_dependabot Whether to write a Dependabot configuration.
1111+#' @param setup_AGENTS Whether to write a default AGENTS file.
1112#' @param ... Additional arguments passed to [usethis::create_package()].
1213#'
1314#' @return Invisibly returns `NULL`.
···1819 private = TRUE,
1920 setup_gha = TRUE,
2021 setup_dependabot = TRUE,
2222+ setup_AGENTS = FALSE,
2123 ...
2224) {
2325 create_package(path, fields, private, ...)
2426 pkg_setup(
2527 setup_gha = setup_gha,
2626- setup_dependabot = setup_dependabot
2828+ setup_dependabot = setup_dependabot,
2929+ setup_AGENTS = setup_AGENTS
2730 )
2831 invisible(NULL)
2932}
···8487#'
8588#' @param setup_gha Whether to configure GitHub Actions setup.
8689#' @param setup_dependabot Whether to write a Dependabot configuration.
9090+#' @param setup_AGENTS Whether to write a default AGENTS file.
8791#'
8892#' @return Invisibly returns `NULL`.
8993#' @export
9094pkg_setup <- function(
9195 setup_gha = TRUE,
9292- setup_dependabot = TRUE
9696+ setup_dependabot = TRUE,
9797+ setup_AGENTS = FALSE
9398) {
9499 tryCatch(
95100 usethis::use_testthat(),
···109114 )
110115111116 if (setup_gha) {
112112- configure_gha()
117117+ setup_gha()
113118 }
114119 if (setup_dependabot) {
115115- configure_dependabot()
120120+ setup_dependabot()
121121+ }
122122+ if (setup_AGENTS) {
123123+ setup_AGENTS()
116124 }
117125118126 try_air_jarl_format()
···166174#' @return Invisibly returns `NULL`.
167175#' @keywords internal
168176#' @noRd
169169-configure_gha <- function() {
177177+setup_gha <- function() {
170178 usethis::use_github_action("check-standard", badge = TRUE)
171179 usethis::use_github_action("test-coverage", badge = TRUE)
172180 usethis::use_github_action(
···196204 "extend-select = [\"TESTTHAT\"]"
197205 ) |>
198206 write_to_path(fs::path("tests", "jarl.toml")) # TODO: need to make GHA jarl runs respect this
199199-200200- invisible(NULL)
201207}
202208203209#' Configure Dependabot Defaults
···207213#' @return Invisibly returns `NULL`.
208214#' @keywords internal
209215#' @noRd
210210-configure_dependabot <- function() {
216216+setup_dependabot <- function() {
211217 c(
212218 "version: 2",
213219 "updates:",
···217223 " interval: \"weekly\""
218224 ) |> # TODO: move file to inst?
219225 write_to_path(fs::path(".github", "dependabot.yml"))
220220- invisible(NULL)
226226+}
227227+228228+#' Configure AGENTS Defaults
229229+#'
230230+#' Placeholder for AGENTS file setup.
231231+#'
232232+#' @return Invisibly returns `NULL`.
233233+#' @keywords internal
234234+#' @noRd
235235+setup_agents <- function() {
236236+ # See https://simonwillison.net/guides/agentic-engineering-patterns/
237237+ c(
238238+ "# General Rules",
239239+ "First run the tests.",
240240+ "red/green TDD. Add tests using usethis::use_test()",
241241+ "Read DESCRIPTION and README.md.",
242242+ "",
243243+ "# Personality",
244244+ "Use literal, direct, concise, specific, high signal, non-empathic, highly structured language. Don't hedge. Don't both sides issues. Don't ask questions at the end of the turn. Don't make offers at the end of the turn.",
245245+ "Only ask questions if it is a request for information necessary for a previous request",
246246+ "",
247247+ "# R Package Development Rules",
248248+ "Never edit .Rd files or NAMESPACE directly.",
249249+ "Use devtools::document(), devtools::test(), devtools::check() for redoc, tests, R CMD CHECK",
250250+ "Try not to add new dependencies unless the code would be much cleaner/faster/better--note added deps to me. Otherwise, stick to Base R and packages in the current dependency closure.",
251251+ "Use usethis::use_import_from() or usethis::use_package() to add dependencies",
252252+ "Make sure air format ., jarl check . --fix --allow-dirty, all tests, and R CMD check pass before you claim to be done."
253253+ ) |>
254254+ write_to_path(fs::path("AGENTS.md"))
221255}
222256223257
+3
man/bootstrapper.Rd
···1010 private = TRUE,
1111 setup_gha = TRUE,
1212 setup_dependabot = TRUE,
1313+ setup_AGENTS = FALSE,
1314 ...
1415)
1516}
···2425\item{setup_gha}{Whether to configure GitHub Actions setup.}
25262627\item{setup_dependabot}{Whether to write a Dependabot configuration.}
2828+2929+\item{setup_AGENTS}{Whether to write a default AGENTS file.}
27302831\item{...}{Additional arguments passed to \code{\link[usethis:create_package]{usethis::create_package()}}.}
2932}
+3-1
man/pkg_setup.Rd
···44\alias{pkg_setup}
55\title{Apply Opinionated Package Setup}
66\usage{
77-pkg_setup(setup_gha = TRUE, setup_dependabot = TRUE)
77+pkg_setup(setup_gha = TRUE, setup_dependabot = TRUE, setup_AGENTS = FALSE)
88}
99\arguments{
1010\item{setup_gha}{Whether to configure GitHub Actions setup.}
11111212\item{setup_dependabot}{Whether to write a Dependabot configuration.}
1313+1414+\item{setup_AGENTS}{Whether to write a default AGENTS file.}
1315}
1416\value{
1517Invisibly returns \code{NULL}.