Thanks for the interest. PolyStella is pre-1.0 and changes land quickly. Contributions, issues, and proposals are welcome.
PolyStella is maintained by a small team. We cannot guarantee that issues, discussions, or pull requests will be reviewed promptly, or reviewed at all. The guidance below is meant to make contributions easier to evaluate when maintainer time is available.
PolyStella is a pnpm workspace with two members:
- The package itself at the repo root (
package.json→@cloudflare/polystella). - The docs site under
docs/(docs/package.json→polystella-docs).
The agent-facing context lives in AGENTS.md. The
system-level design rationale lives in
ARCHITECTURE.md. Read those before working
on anything non-trivial; they save a lot of back-and-forth.
git clone https://github.com/cloudflare/polystella
cd polystella
pnpm installRequired:
- Node 20+ (24 LTS recommended).
- pnpm 9+ (the lockfile is
pnpm-lock.yaml).
| Command | Purpose |
|---|---|
pnpm test |
Run the package's unit + smoke tests (vitest). |
pnpm exec tsc --noEmit |
Typecheck the package. |
pnpm build |
Compile src/ → dist/ (library + CLI, JS + .d.ts). |
pnpm build:llms |
Regenerate llms-full.txt from canonical agent docs. |
pnpm --filter polystella-docs dev |
Run the Nimbus docs site locally. |
pnpm --filter polystella-docs build |
Build the docs site (includes auto-generated config reference). |
pnpm --filter polystella-docs check |
Astro check over docs content. |
- Open a Discussion first for features, refactors, and performance work. PolyStella has tight coupling between adapters / providers / the cache layer; a 5-minute up-front discussion saves a rebase later. Bug fixes and docs-only changes can go straight to a PR if the scope is clear.
- Branch from
main. Branch names like<type>/<short-slug>are nice but not enforced. - Add a changeset for any user-visible change. Run
pnpm changesetfrom the repo root and follow the prompts. The Changesets bot will pick this up at release time. - Run the test suite + typecheck + docs build locally before pushing. CI does the same but local-first saves round-trips.
- Reference the issue or Discussion in the PR description if you opened one.
- TypeScript strict mode, including
noUncheckedIndexedAccess,exactOptionalPropertyTypes,noImplicitReturns,noFallthroughCasesInSwitch. Tooling configured intsconfig.json. - No
any, no!. Useunknown+ type guards; use destructure-and-check instead of non-null assertions. SeeAGENTS.mdfor the rationale. .describe()every public schema field. The docs site auto-generates the configuration reference; missing.describe()calls produce empty cells in the table.- Comments document the "why", not the "what". Long-form
rationale belongs in
ARCHITECTURE.md. Inline comments are for non-obvious decisions and known footguns. - Tests are integration-heavy. We use vitest with
singleThread: true(faster than multi-worker at our scale). Tests live undertests/<src-dir>/<basename>.test.tsmirroring the source structure. A 9-test smoke suite undertests/smoke.test.tsexercises the integration end-to-end against a temp project.
Before adding to the public surface:
- Is it covered by an existing export path? Check the
exportsfield inpackage.json. Eight subpaths are exposed; unless your addition needs its own namespace, it should fit in one of them. - Does it have a documentation page?
pnpm --filter polystella-docs check-exportsasserts everyexportspath is mentioned ondocs/src/content/docs/reference/exports.md. CI fails if not. - Does the schema reference need updating? The
docs/scripts/generate-config-ref.tsscript auto-walkssrc/config/options.ts's zod schema. If your change adds a new config field, regenerate the page locally withpnpm --filter polystella-docs prebuildand verify the output reads cleanly.
Adapters implement the FileTypeAdapter interface in
src/parsing/adapter.ts and register via parsing/registry.ts.
See ARCHITECTURE.md #adapter-contract for
the full contract. The Markdown adapter is the reference
implementation.
Providers implement the Translator interface in
src/translation/provider.ts. Throw PermanentProviderError on
4xx HTTP responses that retries can't fix (401/403/404/422); throw
plain Error on anything retriable. See ARCHITECTURE.md
#translator-contract for the detail.
Bug reports against PolyStella are most useful when they include:
- Minimum reproducible config (the
polystella.config.mjsslice that exhibits the issue). - Source file(s) that trigger the issue (or a synthetic example with the same shape).
- The build report from
dist/i18n-r2-report.json, if relevant. - The PolyStella version (visible in the report; or
polystella --version).
By contributing, you agree that your contributions are licensed under the MIT License — same as the project.