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 five public packages under packages/:
packages/astro/—@cloudflare/polystella-astro.packages/polystella/—@cloudflare/polystella, a forwarding compatibility package.packages/core/— platform-neutral translation orchestration.packages/adapters/— Markdown, MDX, JSON, YAML, and TOML adapters.packages/providers/— Workers AI and Anthropic transports.
The private root coordinates those packages, the docs/ site, and the
playgrounds/ fixtures.
The agent-facing context lives in AGENTS.md. The
post-migration package map lives in
PACKAGE_ARCHITECTURE.md, and 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 22.12+ (24 recommended).
- pnpm 9+ (the lockfile is
pnpm-lock.yaml).
| Command | Purpose |
|---|---|
pnpm test |
Run package, Astro, workerd, and boundary tests. |
pnpm typecheck |
Build and typecheck all five public packages. |
pnpm build |
Build all five public packages. |
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.base.jsonand each package's local config. - 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. Package tests live under each
packages/*/tests/directory. Astro tests underpackages/astro/tests/mirrorpackages/astro/src/and include an end-to-end smoke suite.
Before adding to the public surface:
- Is it covered by an existing export path? Check the
exportsfield in the owningpackages/*/package.json; avoid adding a namespace when an existing entry already fits. - 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-walkspackages/astro/src/config/options.tszod schema. If your change adds a new config field, regenerate the page locally withpnpm --filter polystella-docs prebuildand verify the output reads cleanly.
Portable adapters implement FileAdapter in
packages/adapters/src/adapter.ts; Astro policy wrappers implement
FileTypeAdapter in packages/astro/src/parsing/adapter.ts and register via
packages/astro/src/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
packages/core/src/translator.ts and expose transports from
packages/providers/src/. Throw PermanentProviderError on
4xx HTTP responses that retries can't fix (400/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
i18n-r2-report.jsonbuild report, 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.