From 7d775f7bb8a812d92efadab4fe78e677fdcca1b7 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sat, 11 Apr 2026 17:52:01 -0700 Subject: [PATCH 1/2] docs: add AGENTS.md guidance --- AGENTS.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..d4433d5 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,35 @@ +# AGENTS.md + +## Project overview + +- This repository is a small ESM Node.js package that exports a single middleware from `lib/index.js`. +- Runtime support starts at Node.js 18 (`package.json`), and CI tests the package on Node.js 18, 20, and 22. +- Linting runs with Biome, and releases are managed through `release-please`. + +## Working agreements + +- Use `npm` for dependency and script commands. +- Prefer small, focused changes. Avoid unrelated cleanup in the same PR. +- Keep the public middleware API and the README example aligned when behavior or options change. +- Do not edit `CHANGELOG.md` or `.release-please-manifest.json` manually unless the task is explicitly about the release process. + +## Commands + +- Install dependencies: `npm install` +- Run tests: `npm test` +- Run lint: `npm run lint` +- Auto-fix formatting and lint issues: `npm run fix` +- Generate coverage report: `npm run coverage` + +## Testing notes + +- `npm test` runs with `NODE_ENV=production`, which is important because the middleware bypasses redirects outside production mode. +- HTTPS behavior is covered in `test/test.js` using the certificates under `test/certs/`. +- If you change request handling or HSTS behavior, update or extend tests in `test/test.js`. + +## Files to check during changes + +- `lib/index.js`: package implementation and exported middleware. +- `test/test.js`: behavioral coverage for redirects, HSTS headers, and ignored routes. +- `README.md`: user-facing API and usage examples. +- `example/app.js`: example app for manual testing and docs alignment. From 613c102b47ce1cc5b639e658a9dc9ece0cd9e7d0 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sat, 11 Apr 2026 17:52:26 -0700 Subject: [PATCH 2/2] docs: require conventional commits in AGENTS --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index d4433d5..a5b23e0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,6 +10,7 @@ - Use `npm` for dependency and script commands. - Prefer small, focused changes. Avoid unrelated cleanup in the same PR. +- Use Conventional Commits for commit messages and PR titles (for example: `fix: ...`, `feat: ...`, `docs: ...`). This repository uses `release-please`, so incorrect commit or PR prefixes can break release automation. - Keep the public middleware API and the README example aligned when behavior or options change. - Do not edit `CHANGELOG.md` or `.release-please-manifest.json` manually unless the task is explicitly about the release process.