Contributing
Thanks for helping make the web readable by agents.
git clone https://github.com/webmaxru/agentprose && cd agentprosenpm installnpm run typecheck && npm testnpm run build # prints gzipped sizes; fails over the size budgetCHROME=/path/to/chrome npm run test:e2enpm run demo && npx serve demo/site # or any static serverRules of the road
Section titled “Rules of the road”- Size budget. The script-tag core must stay under 10 KB gzipped, and core + lazy engine under 17,408 B (CI enforces both). New site-wide logic belongs in
src/core/site-tools.tsorsrc/core/source.ts, which load lazily. - Read-only by default. New tools that change state must be opt-in, must not set
readOnlyHint, and should setconsequentialHintif appropriate. - No runtime dependencies in the browser bundle.
- Errors are results. Return
{ error, message }instead of throwing from tools. - Tests. Every feature needs a unit test. Anything that touches registration, discovery or the DOM also needs an e2e test.
- Docs. Update
docs/and, when tool definitions change, runnode scripts/docs-tools.mjs.
Documentation site
Section titled “Documentation site”The site at salnikov.no/agentprose lives in website/ (Astro + Starlight). Most of its reference pages are pulled from docs/*.md, CHANGELOG.md, CONTRIBUTING.md, RELEASING.md and the WordPress plugin’s readme.txt at build time, and the API reference is generated from src/ by TypeDoc, so edit those sources rather than the generated files. Hand-written pages are in website/src/content/docs/.
cd websitenpm installnpm run dev # http://localhost:4321/agentprose/npm run build # dist/, with the agentprose index for this sitenpm run check:links # every internal link and #anchor in dist/, under the base pathSITE_URL=http://localhost:4329/agentprose/ npm run build && npm run serve & # then:SITE_URL=http://localhost:4329/agentprose/ CHROME=/path/to/chrome npm run check:browserThe site URL (origin and base path) is one value, SITE_URL; the Pages workflow sets it from the repository’s Pages settings.
Adapters
Section titled “Adapters”New CMS adapters live in src/adapters/<name>.ts. They export a factory and fromAttributes(dataset), use only browser-safe credentials (or proxy mode), call guardToken() on any token, and come with a mocked-fetch test in test/unit/adapters.test.ts. Cite the vendor’s API docs in docs/adapters.md.
Commits and releases
Section titled “Commits and releases”Use conventional commit messages (feat:, fix:, docs:). Releases follow semver and the changelog; the full flow (prep PR, publish, jsDelivr purge, Cloud follow-up) is in Releasing agentprose.