|
| 1 | +# aNCA — Copilot Instructions |
| 2 | + |
| 3 | +This is an R package for automated Non-Compartmental Analysis (NCA) with a Shiny app interface. |
| 4 | + |
| 5 | +## Repository Structure |
| 6 | + |
| 7 | +- `R/` — Package R functions (exported) |
| 8 | +- `inst/shiny/` — Shiny application code |
| 9 | +- `tests/testthat/` — Unit tests |
| 10 | +- `man/` — Documentation (auto-generated, do not edit) |
| 11 | +- `data/` — Package data |
| 12 | + |
| 13 | +## Key Constraints |
| 14 | + |
| 15 | +- No `library()` or `require()` in package code under `R/` |
| 16 | +- Use `pkg::function()` syntax for all external function calls |
| 17 | +- All exported functions must have roxygen2 docs (`@param`, `@returns`, `@export`) |
| 18 | +- Run `devtools::document()` after modifying roxygen comments |
| 19 | +- Run `devtools::test()` before committing |
| 20 | + |
| 21 | +## Dependencies |
| 22 | + |
| 23 | +- Check `DESCRIPTION` Imports before using any package |
| 24 | +- For new dependencies: `usethis::use_package("pkg")` |
| 25 | +- Use explicit namespaces: `dplyr::filter(x > 0)` not `filter(x > 0)` |
| 26 | + |
| 27 | +## Testing |
| 28 | + |
| 29 | +- Test file names match source: `R/foo.R` → `tests/testthat/test-foo.R` |
| 30 | +- Use `describe` and `it` functions |
| 31 | +- Include value-level assertions, not just structure checks |
| 32 | +- Use test data from `tests/testthat/setup.R` where appropriate |
| 33 | + |
| 34 | +## Anti-patterns |
| 35 | + |
| 36 | +- Do not edit `man/` or `NAMESPACE` files manually |
| 37 | +- Do not add unused `globalVariables` to `R/zzz.R` |
| 38 | +- Do not push without running `devtools::document()` first |
| 39 | +- Do not skip tests or lintr checks |
| 40 | + |
| 41 | +## PR Workflow |
| 42 | + |
| 43 | +- Branch name: `<issue-number>-<type>/<short-description>` |
| 44 | +- Before submitting: bump version, update NEWS.md |
| 45 | +- Link issue with `Closes #<number>` in PR description |
| 46 | +- Add at least 2 core team reviewers (from DESCRIPTION) |
| 47 | + |
| 48 | +## CI Checks |
| 49 | + |
| 50 | +All PRs must pass: lintr, unit tests, test coverage, man page generation, and spell check. |
| 51 | + |
| 52 | +## Additional Context |
| 53 | + |
| 54 | +See `AGENTS.md` for full development guidelines. |
| 55 | +See `.github/instructions/` for path-specific coding conventions. |
| 56 | +See `.github/skills/` for reusable agent workflows. |
0 commit comments