Build and test
Set up a checkout, run the checks, install the checkout into opencode and rebuild these pages with the documentation generator.
Set up#
You need Node.js 22 or later and pnpm 11.4.0. The repository pins the pnpm version for Corepack.
git clone https://github.com/belikh/OpenUltraCode.git
cd OpenUltraCode
corepack enable
pnpm install --frozen-lockfilepnpm install sets core.hooksPath to .githooks.
Run the checks#
pnpm run checkcheck runs five steps and stops at the first that fails:
| Step | Command | What it checks |
|---|---|---|
| Assets | pnpm run validate:assets | The skill, the commands, the agents and the workflows have the parts the plugin relies on. |
| Installers | pnpm run validate:installers | The four installers and their shared files follow the rules in scripts/validate-installers.ts. |
| Types | pnpm run build | tsc --noEmit. |
| Lint | pnpm run lint | eslint .. |
| Tests | pnpm run test | The tests in tests/ with the Node.js test runner. |
The tests install into temporary directories and never touch ~/.config/opencode. The syntax tests for dash, shellcheck and PowerShell are skipped when the tool is missing, and the output names each skipped test.
check works offline, so it does not run the documentation generator. Documentation has the command for the pages.
Git hooks#
| Hook | When | What it does |
|---|---|---|
pre-commit | every commit | Runs pnpm run check. It refuses a commit when a staged file has unstaged changes or a project file is untracked, because the checks read the working tree. |
pre-push | a push of a tag that starts with v | Runs node scripts/runtime-check.mjs --live against your installed opencode. |
Source layout#
| Path | Content |
|---|---|
src/plugin.ts | The plugin entry: reads the options and registers the hooks. |
src/hooks.ts | The hooks on prompts, model requests, permissions, tool results and compaction. |
src/tools.ts | The workflow tools and their input schemas. |
src/gate.ts | The completion gate. |
src/workflow.ts | Commands, modes and the rules for starting and continuing a workflow. |
src/sessions.ts | Finds the top-level session of a session. |
src/state.ts | Reads and writes the workflow record. |
src/fusion-*.ts, src/model-catalog.ts | Fusion model configuration and opencode's model list. |
src/opencode-v2.ts | The part of the opencode 2 plugin API that the plugin uses, as types. |
.opencode/skills, .opencode/commands, assets/agents | The skill, the commands and the agents that the installer copies. |
scripts/installer-lib.mjs | Every edit of opencode.json and of installed files. |
scripts/installer-common.sh, scripts/installer-common.ps1 | The steps the release and development installers share. |
scripts/docs.mjs | Fetches and runs the documentation generator. |
tests/plugin-contract.test.ts compiles src/opencode-v2.ts against the real @opencode/plugin types, so pnpm run check fails when the API changes.
Try a change in opencode#
./install-dev.sh --skip-checks --skip-runtime-checkThe plugin entry in opencode.json now points at the checkout. Restart opencode to load a change. Run ./install-dev.sh --remove to undo it.
Documentation#
These pages are written in docs-src/ and generated with jupiter-docs from belikh/docs. The files in docs/ are output. Change a page in docs-src/, then run:
pnpm run docs:build
pnpm run docs:check19 page(s) OK
Generated Markdown is current (19 page(s)).Commit docs-src/ and docs/ together.
The generator is not on npm, so pnpm install cannot provide it. scripts/docs.mjs clones it into .jupiter-docs/ on first use and downloads the design system release that it reads. Git ignores that directory. The first run needs git, npm and network access.
| Command | What it does |
|---|---|
pnpm run docs:check | Validates the pages and their wording, then fails when docs/ is out of date. |
pnpm run docs:build | Rewrites docs/ from docs-src/. |
node scripts/docs.mjs build --site | Builds the site into dist/site. |
node scripts/docs.mjs --update check | Fetches the newest generator and design system first, then validates the pages. |
Every other argument goes to jupiter-docs unchanged.
| Variable | Default | Meaning |
|---|---|---|
JUPITER_DOCS_DIR | .jupiter-docs in the repository | A checkout of belikh/docs to use. The script never changes a checkout that this variable names. |
JUPITER_DESIGN_DIR | vendor/design in the generator checkout | The unpacked design system release. |
A checkout that JUPITER_DOCS_DIR names must be ready to run. If it is incomplete, the script stops and names each missing part:
docs: /path/to/docs is missing the generator's dependencies (run `npm ci` in it)The Docs workflow runs the validation, the check of docs/ and the site build on every push to main and on every pull request. The release workflow runs it too, because docs/ is part of the release archive.