Thanks for considering a contribution.
Before You Start
- Open an issue for bugs, usability problems, or larger feature ideas.
- Keep pull requests focused. Small, reviewable changes are much easier to merge.
- When behavior changes, update user-facing documentation and add or update tests in
tests/testthat/.
Development Workflow
- Install the released package from CRAN with
install.packages("llmshieldr")if you want a reference version for comparison. - Install development dependencies.
- Make the change in
R/,tests/, and the relevant documentation files. - Run package checks locally.
- Open a pull request with a short description of the problem, the approach, and any follow-up work.
Typical local commands:
install.packages(c("devtools", "roxygen2", "testthat", "pkgdown"))
devtools::document()
devtools::test()
devtools::check()Edit README.Rmd and Roxygen comments in R/. Do not hand-edit generated README.md, man/*.Rd, or NAMESPACE files. Run devtools::document() and render README.Rmd after changing their sources.
Branch and Release Policy
-
devis the integration branch for the development package. Its version must use the.9000development suffix. -
mainrepresents the latest stable release. Changes reachmainthrough a release pull request after checks pass and the version is finalized. - Pull requests build pkgdown as a downloadable preview without deploying it.
- Pushes to
devpublish development documentation under/dev/. The same deployment rebuilds the stable site frommainso GitHub Pages receives both versions as one artifact. - Publishing a stable GitHub release rebuilds the stable site from its tag and refreshes the development site from
dev. The release tag must exactly matchv<DESCRIPTION Version>. - The pkgdown Versions menu switches between the stable site at
/and the development site at/dev/. - The
github-pagesenvironment must allow deployments from thedevbranch and stable version tags matchingv*. - After a stable release, resume development on
devwith a.9000version.
Install the current development branch with:
pak::pak("ineelhere/llmshieldr@dev")Style Expectations
- Prefer clear function names and explicit validation.
- Keep exported functions documented with runnable examples whenever possible.
- Keep network requests, credentials, downloads, and optional executables out of evaluated examples and vignette builds.
- Preserve backwards compatibility unless there is a strong security or usability reason to change behavior.
- For security-related changes, include at least one regression test that captures the failure mode.
Adding Or Changing Rules
Rule changes need both detection and overblocking evidence.
- Add at least one positive test where the risky text triggers the intended rule.
- Add at least one negative test where ordinary text in the same domain is allowed.
- Use a stable rule ID with an OWASP prefix when the mapping is clear.
- Keep regex rules narrow enough to preserve useful text around the finding.
- Document any known false-positive tradeoff in the test or rule description.
