Prime Agent is a monorepo with a root build pipeline (tui → ai → agent → coding-agent), a published npm package under @earendil-works/pi-coding-agent that releases as prime-agent, and a complete CI/test harness spanning type-check, linting, sharded vitest runs, and kernel integration tests. The workspace retains legacy @earendil-works/pi-* identifiers and pi bin entry for internal compatibility; packages/coding-agent's build produces both TypeScript-compiled output and a bundled CLI, with optional clipboard access and runtime assets bundled into dist/.
The prime-agent monorepo workspace root is a private npm module-type package named prime-agent, with workspaces spanning all packages/* directories plus four specific extension example packages under packages/coding-agent/examples/extensions/.[1] Both the root and packages/coding-agent require Node.js >=22.8.0 as the minimum engine version.[1][2] packages/coding-agent is published under the npm scope @earendil-works/pi-coding-agent, retaining the legacy earendil-works scope from the upstream pi-mono fork; public releases rewrite the package and command to prime-agent.[2][3] The workspace retains legacy @earendil-works/pi-* source package identifiers, the pi package manifest key, and a pi bin entry for internal compatibility — the inherited npm package should NOT be used as the install path.[3]
The root build script compiles packages in strict dependency order: tui → ai → agent → coding-agent.[1] The dev script runs the ai, agent, coding-agent, and tui packages concurrently via concurrently, each in watch mode.[1] packages/coding-agent's build produces both a TypeScript-compiled dist/ (via tsgo) and a bundled CLI (via scripts/bundle.mjs); the build:binary variant additionally compiles a self-contained Bun binary at dist/pi.[2] The copy-assets step in packages/coding-agent bundles interactive theme JSON, PNG assets, export-HTML templates, the prime-agent-runtime directory, and the skills/ directory into dist/.[2] tsgo is a high-performance TypeScript compiler toolchain used in the Prime Agent build pipeline for both compiling source to dist/ and type-checking via --noEmit.
The root check script runs Biome linting (with --write --error-on-warnings), TypeScript type-checking via tsgo --noEmit, and two custom smoke checks (check:installer and check:browser-smoke).[1] Versioning scripts (version:patch, version:minor, version:major) bump versions across all workspaces with npm version -ws, then run scripts/sync-versions.js, and perform a full node_modules and lock-file clean reinstall.[1] Release scripts (release:patch, release:minor, release:major) delegate to scripts/release.mjs with the bump level; release:pack delegates to scripts/pack-prime-agent-release.mjs.[1] shell-quote is pinned to ^1.10.0 in the root package.json via an override, likely as a security constraint.[1] Clipboard access is declared as an optional dependency (@mariozechner/clipboard) in packages/coding-agent, so it degrades gracefully when unavailable.[2] Prime Agent uses a changelog-fragment workflow: each PR must include a Markdown file under packages/<pkg>/.changes/ (e.g., packages/coding-agent/.changes/<id>.md); at release time, scripts/release.mjs and scripts/lib/changelog-fragments.mjs assemble these fragments into the final CHANGELOG.md.
CI runs on ubuntu-latest with Node.js 22 and cancels concurrent runs for the same branch via the concurrency group ci-${{ github.ref }} with cancel-in-progress: true.[4] System dependencies installed for CI builds include libcairo2-dev, libpango1.0-dev, libjpeg-dev, libgif-dev, librsvg2-dev, fd-find, and ripgrep (with fdfind symlinked to fd).[4] The build-check CI job runs npm run build followed by npm run check (type-check and lint) with a 15-minute timeout.[4] The coding-agent test suite is split into three shards (--shard=1/3, 2/3, 3/3) plus a process smoke test and a kernel test, all requiring uv to be installed.[4] CI installs uv via python3 -m pip install --user uv and appends $HOME/.local/bin to PATH for test jobs that require it.[4] A gate job, build-check-test, always runs after build-check and test and verifies both succeeded, providing a single required-status check for branch protection.[4]
CI tests in packages/coding-agent run with vitest --run; the test:ci variant first bootstraps the kernel via tsx src/core/kernel/bootstrap-cli.ts and excludes test/daemon-supervisor-process.test.ts — see Test harness for harness internals.[2] Heavy kernel integration tests are scoped with --tagsFilter kernel-heavy and target acp-kernel-features.test.ts, acp-cold-cli.test.ts, kernel-goal-skill.test.ts, and kernel-state-roundtrip.test.ts.[2]
Sources