Skip to content

Testing and checks

CI calls the organisation's reusable plugin workflow on the boxd-public runner. Its check job runs the plugin's checks, docs builds this site with mkdocs build --strict, actionlint lints every workflow and install installs the pushed commit in OpenCode. A pack job runs npm run test:pack, and the required status check, ci, needs them all.

Locally

npm ci --ignore-scripts
npm run check
python3 -m venv .venv
.venv/bin/pip install -r docs/requirements.txt
.venv/bin/mkdocs build --strict

npm run check runs, in order:

  1. biome check . for lint;
  2. tsc -p tsconfig.json for the type check;
  3. npm run bundle, which rebuilds the committed dist/index.js;
  4. npm test, the unit, host and fixture tests;
  5. npm run test:pack, which installs the packed tarball and starts OpenCode 2.4.1 with it;
  6. plugin-kit check, the T0, T1 and forbidden-pattern gate;
  7. plugin-kit docs --check, which fails when a generated section drifts from the manifest.

CI also runs npm run bundle && git diff --exit-code dist/ and fails when the committed bundle is stale.

The manifest first

Change capabilities in package.json before the code: a method, source or action, with its class, operations, accounts and cost. Then the handler in src/handlers/, the provider call in src/provider/, and the tests. The register refuses a handler the manifest does not declare, and a declared method without one.

Generated docs

Generated sections sit between <!-- generated:<section> --> and <!-- /generated:<section> -->. Edit the manifest, then run:

npx plugin-kit docs

npm run check fails when a section drifts. The five files that carry generated sections are README.md, docs/capabilities.md, docs/configuration.md, docs/accounts.md and docs/automations.md.

Fixtures

fixtures/conformance.json is the plugin's evidence to the conformance kit. This repository's provider is synthetic, so npm run fixtures rebuilds the recording from invented people, meetings and sign-ins, and test/fixture.test.ts replays every recorded answer through the handlers so the fixture cannot drift. With real accounts, record instead:

npx plugin-kit record --account work
npx plugin-kit record --account personal

npx plugin-kit record redacts credentials, emails, phone numbers and home directories before it writes.

More

CONTRIBUTING.md has the commit and pull request conventions.