Developing and testing the suite
Runtime components live under packages/<name>/. Public documentation lives under site/. The root package exposes individual extension entry points through its pi manifest; it is not an npm workspace that installs every component or the site.
Keep components independently usable, and keep sibling integrations optional. For cross-extension changes, read activity ownership and lifecycle alongside the relevant source and tests.
Switchyard compatibility
Section titled “Switchyard compatibility”The Switchyard integration contract is structured and separate from Ovis and Collie’s screen-reading contract. Assess both where relevant: passing one does not prove the other. Adapter and remote-UI changes need a portable fallback and cross-repository compatibility checks; report any checks not run. Capable Switchyard hosts provide adapter inspection and safe reload, and its authoring tools provide portable preview; check the selected host version before relying on them.
The project installs copied, commit-pinned instances of Switchyard’s public plugin-development skill for Pi/Codex and Claude. Update its source in Switchyard, then reinstall the targeted skill from the new immutable commit with the skills CLI and --copy; commit both copies and skills-lock.json together. Do not edit the copies independently.
npm run check:changed selects the real-Pi Switchyard compatibility check for package changes and compatibility infrastructure changes. It requires an installed Pi, component dependencies and a built Switchyard checkout; missing prerequisites fail. Set SWITCHYARD_DIR to an absolute checkout path when the default sibling path is not correct, including from nested worktrees. Local dirty paired checks do not establish the pinned CI result. The release gate requires successful Checks and Switchyard push workflows on the exact source HEAD.
Live local loading
Section titled “Live local loading”The repository commits a project .pi/settings.json:
{ "packages": [ { "source": "git:github.com/justmytwospence/pi-plugins", "autoload": false, "extensions": ["!**"], "skills": ["!**"], "prompts": ["!**"], "themes": ["!**"] }, ".." ]}In a trusted project, a Pi session started at the root of the checkout or of a worktree loads the suite from that checkout. The first entry is an autoload: false delta over a personal install of the suite from Git and disables all of its resources; ".." resolves against <cwd>/.pi and loads the checkout itself. Other installed packages still load. Edit a component, then run /reload in such a session to try it; each worktree session runs its own branch. Sessions started elsewhere, including a subdirectory such as packages/<name>, keep the installed release.
The checkout needs its dependencies installed (below). A change that fails to load disables that component in the session you are using to fix it; revert or fix it and /reload, or start Pi outside the checkout. Without a personal Git entry for the suite, the delta has nothing to narrow: Pi clones the Git package into the ignored .pi/git/, with all of its resources disabled, while the checkout still loads. Remove the first entry locally if you do not install the suite from Git.
Root SDK checks
Section titled “Root SDK checks”From the repository root:
npm cinpm testThe root package scripts configure Pi 1.5.2 as the SDK test target. They run loader, shortcut, contract, question-flow and lifecycle checks, then the shared eval helpers’ unit tests. The loader test uses Pi’s actual DefaultResourceLoader with temporary, in-memory package settings rather than merely importing each factory through a stub.
The loader checks:
- The full suite loads without loader errors, in the manifest’s entry order.
- Tool, command, flag and shortcut registrations do not collide across the suite.
- Each component loads alone from its package directory and through a filtered suite selection.
- Those selections match the full suite’s registration signatures: tool, command, flag and shortcut names, plus event-handler counts.
- An explicit empty resource selection loads no extensions.
PI_TEST_SDK can supply an alternative SDK module specifier for the loader check; it is not required.
Additional checks cover actual Pi shortcut resolution (including stock Ctrl+L conflicts), synchronized contracts, questionnaire routing, local AgentSession startup/turn/session replacement and in-memory TUI input. See shortcut tests, question-flow tests and lifecycle tests. The lifecycle fixture uses a local stub provider, not a paid remote model.
Local SDK coverage is not live PTY proof. These tests do start sessions and exercise selected TUI/input/lifecycle paths. They do not verify a real terminal’s encoding, mouse reporting, rendered appearance or every extension combination. Focus, cleanup and reload still need interactive checks.
Component checks
Section titled “Component checks”Install each component’s lockfile dependencies in that component’s directory, then run its own check. For example, from the repository root:
cd packages/pi-bgnpm ci && npm run checkRepeat for each component being changed. Root npm ci is not a substitute for these component installs. Respect the configured npm release-age policy; do not bypass it to make a check pass.
The exact check is defined by each component’s package.json. For example, pi-bg runs typechecking and Vitest; pi-plan-mode also runs Biome; pi-select-nav runs TypeScript checking and Node input-routing tests. Do not assume every check has identical coverage.
Once dependencies are installed for all components, run this from the repository root for the full set:
npm run checkThat first runs the root SDK tests (and the unit tests of the shared eval helpers), then scripts/check-components.mjs. The script reads the component list from the root package.json’s pi.extensions, runs npm run check in each package in parallel (--install runs npm ci first), continues through component failures and returns a failing exit status if any component fails. It does not install dependencies or check the site.
Fast and full tiers
Section titled “Fast and full tiers”npm test and npm run check run the fast tier in parallel. npm run check:full (and CI) add the slow tier, selected with PI_TEST_FULL=1: the checkpoint PTY test, footer controls, every mode-flow combination, exhaustive render width sweeps and tests with real timers. npm run check:changed checks only the components and root suites a change touches. PI_CHECK_JOBS=1 runs everything one at a time with live output, node scripts/test-suite.mjs --list shows the root suite’s tasks and --only <names> runs some. Use Node 24 or newer (.nvmrc).
Keep paid evaluations separate
Section titled “Keep paid evaluations separate”Never run npm run eval without explicit authorization. Evaluation scripts use live paid classifier calls; they are not part of the ordinary validation workflow. Missing credentials or a possible skip is not authorization to invoke them.
Live evaluations are targets: one eval/<id>.target.ts per evaluation in a package, registered in the root evals/targets.ts and run by one runner, npm run -s eval -- <id|package|all> [--dry] [--list] [--last] [--json]. Each target says how many classifier calls it would make (--dry, no spend) and returns metrics, a report and whether it passed; the runner skips without TYPESAFE_API_KEY, adds up the spend, and appends every run to a git-ignored history that --last diffs. Targets either use hand-written cases or replay a random sample of your recent Pi sessions. Evals are manual, and only pi-cache-guard, pi-copy, pi-next-prompt, pi-sidebar, pi-subagents and pi-tool-gate have them. The runner and the common helpers (the Pi model registry, the session sampler, a concurrency pool, a table printer, spend and results) live in evals/shared, which is development-only: it is not a component, not in the pi manifest and not importable from a component’s src.
Integration changes need more than loading
Section titled “Integration changes need more than loading”For activity changes, check both independent operation and the relevant enabled combinations. Exercise source offers before and after host startup, repeated offers, return to an independent pill, external wait completion and cleanup. The activity contract has five copies: pi-bg, pi-subagents, pi-marimo, pi-plan-mode and pi-herdr. Keep them aligned rather than introducing an implicit sibling dependency. The working-message contract is copied into pi-bg, pi-subagents and pi-status-footer; test both independently and together, including overlapping waits and every release path.
Useful regression entry points include pi-bg extension tests, pi-subagents activity tests and pi-herdr collector tests. These complement, not replace, interactive TUI and lifecycle checks. Report which checks were actually run and which remain unverified.
Offline prompt-handoff PTY regression
Section titled “Offline prompt-handoff PTY regression”From the repository root:
python3 scripts/test-prompt-offer.pyThe prompt-offer regression starts a real Pi PTY in regular and fullscreen modes with an offline custom provider. It loads explicit next-prompt and pi-vim entries plus a harmless /prompt-offer-test fixture, without interactive-shell. There are no real model, classifier or marimo calls. Install Pi and Node on PATH and run npm ci in both component directories first, respecting the release-age policy. Missing prerequisites fail rather than skip; a skipped run is not feature verification.
The provider calls offer_prompt with /prompt-offer-test one two, then returns a tagless final answer. Terminal output, the saved tool receipt, a boolean-only UI probe and a temporary invocation sentinel verify: displayed acknowledgement, an empty editor with ghost text before acceptance, no execution by the tool or Tab, the exact draft after Tab, and exactly one invocation with unchanged arguments after Enter. Separate preexisting-draft cases require a blocked receipt and unchanged draft, including after Tab. The probe does not write draft/render text to its log or insert text into the editor; input is sent through the PTY. Child process groups, PTYs and temporary fixtures are cleaned up even on failure.
This tests bounded component-render acknowledgement and the exercised input path, not whether a human saw the suggestion or whether a real model always uses the tool correctly. It complements the unit and loader checks; it does not replace manual checks of other terminals or extension combinations.
Independent static site
Section titled “Independent static site”The site has its own package manifest and lockfile. Use Node.js 22.12 or newer. From the repository root:
cd sitenpm cinpm run checknpm run buildThis is a separate install, not a workspace command and not a runtime plugin requirement. The Astro configuration sets output: "static" and trailingSlash: "always". The site produces static files in site/dist/, with zero backend: no server adapter, credentials, model requests or runtime extension imports are needed to serve it.
The checks have different responsibilities:
| Command | What it checks |
|---|---|
npm run check |
Runs check-docs.mjs for manifest/catalog coverage, frontmatter, uniform quick references, README catalog, keymap action IDs/defaults, JSON examples, selected entry paths and authored local links; then runs Astro diagnostics. |
npm run build |
Builds the static site and search output, then runs check-build.mjs against rendered HTML, local links and fragments, assets, canonical URLs, metadata and required search output. |
See authored-document checks and rendered-build checks. The action/default baseline in keymap data is an audited Pi 1.5.2 snapshot, not personal configuration. The checker requires a deliberate re-audit if the root test SDK changes; it imports no runtime plugin or SDK. It checks documented defaults and IDs, not whether your terminal delivers a key.
These scripts do not fetch external links, so a passing check does not verify GitHub availability or remote content.
Authoring conventions
Section titled “Authoring conventions”- Put public pages in
site/src/content/docs/, with a frontmattertitleand a usefuldescriptionof at least 30 characters. - Use root-absolute, trailing-slash documentation links, such as development and activity architecture.
- Link claims to exact repository files, not just a repository homepage. Distinguish implemented behavior, targeted test coverage and manual verification.
- Per-plugin references use the package name as their filename and
pluginfrontmatter value. Keep selection examples exact:packages/<name>/src/index.ts, without a leading./. - Start each plugin page with the same six-field Quick reference: use case, enable, controls, settings, requirements/cost/privacy, integrations/limits. Small automatic plugins should explicitly say they have no shortcut or command.
- State requirements, costs and optional integrations explicitly. Do not infer supported external tools or lifecycle guarantees from a registration test.
- Label terminal illustrations as examples rather than real screenshots, and do not use emojis in documentation.
The site owns public reference, recipe and architecture content. Keep the root README a concise install/development entry point, and keep private maintainer workflows outside public runtime requirements. See installation and selection for user-facing configuration rather than development checks.