npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@shaurya-sethi/primus

v0.1.6

Published

CAD generation agent built on Pi and build123d

Readme

Primus

Primus is a standalone CLI for agent-driven parametric CAD generation. It wraps Pi with a managed build123d workshop so first-time setup and day-to-day CAD workflows run from one command surface.

Install

npm install -g @shaurya-sethi/primus

Prerequisites

  • Node.js 20.19.0 through 24.x
  • git on PATH
  • Python 3.11-3.14 on PATH
    • macOS/Linux launchers: python3.11-python3.14 or python
    • Windows launchers: py -3.11-py -3.14, python3.11-python3.14, or python
  • Internet access during setup (clones build123d, installs managed tools/packages)

First-Time Setup

primus setup

primus setup:

  • validates Node/Git/Python prerequisites
  • creates managed venv at ~/.primus/workspace/.venv
  • clones build123d to ~/.primus/workspace/vendor/build123d
  • installs managed Python deps (build123d, pytest, ocp-vscode)
  • installs/verifies managed uv, serena-agent, and tavily-cli
  • indexes workspace with Serena
  • writes MCP config to ~/.primus/agent/mcp.json

First run can take several minutes while Serena indexes.

LLM Providers

Primus needs an LLM to run. Use /login inside a session to authenticate with a subscription or store an API key:

  • Claude Pro/Max — Anthropic subscription
  • ChatGPT Plus/Pro — OpenAI Codex
  • GitHub Copilot — Copilot subscription

You can also configure any supported provider via environment variables (e.g. ANTHROPIC_API_KEY=sk-ant-...) before launching. For the full list of providers, API key env vars, and advanced auth options see the Pi providers docs.

Core Usage

Primus must be run from a project directory — do not run it from your home directory or any other generic location. Each directory you run Primus from becomes its own design workspace.

For the very first launch in a new project directory, run /init inside the session to scaffold the repo layout and initialise git:

mkdir my-cad-project && cd my-cad-project
primus
# then inside the session:
# /init

Subsequent launches in the same directory pick up where you left off.

Launch entrypoints:

  • primus starts Primus CAD workshop
  • primus design <description> starts goal-alignment flow via /design
  • primus modify <description> starts modify flow via /modify

If launch reports machine is not ready, run primus setup first.

Commands

  • primus setup - bootstrap or repair managed workshop
  • primus doctor - run environment/runtime diagnostics
  • primus update - update Pi, Serena, build123d, and managed workshop dependencies
  • primus preview <script> [expression] - push model preview to ocp-vscode viewer
  • primus help or primus --help - command help
  • primus --version - installed version

How It Works

Primus isn't a thin prompt wrapper. Every design session follows a deliberate four-stage workflow backed by purpose-built skills, specialist subagents, state management, and a set of tools that each cover a distinct slice of the problem.

Four-stage design workflow

Stage 1 — Goal Alignment (cad-goal-alignment skill) is where Primus pins down exactly what you want before touching any code. Rather than accepting a vague one-liner and guessing the rest, Primus runs a relentless structured interview one question at a time, with a recommended answer for each question to make tradeoffs explicit. It walks the design tree branch-by-branch, resolves dependencies between decisions, and checks repository context first when a question is discoverable from existing artifacts. Ambiguities get surfaced and resolved before plan synthesis. The stage only closes when both sides agree on an approved plan.

Stage 2 — Research (build123d-research skill) turns the approved plan into actionable implementation knowledge. Primus spawns specialist subagents to inspect the local build123d source and optionally gather domain knowledge from the web. Findings are synthesized into a structured implementation brief that covers exactly which classes and functions to use, which patterns fit the geometry, and what pitfalls to avoid — so the authoring stage starts from verified knowledge rather than guesswork.

Stage 3 — Script Authoring (cad-script-authoring skill) is where the model actually gets written. Primus — and only Primus as the orchestrator — authors the final generator script and its verification suite. Tests run before the stage closes. The orchestrator can draw on the research brief, the source research artifacts, and its own long-term memory of the session to write the script, but it doesn't have to do it all in one go: if it hits a gap in knowledge or needs to verify something during authoring, it can spin up more research subagents on the fly, without losing context or momentum.

Stage 4 — Review Loop (cad-review-loop skill) runs a dedicated cad-reviewer subagent that checks the script against the plan, verifies API usage against build123d source, and audits the test suite. The orchestrator applies fixes and can request a second pass for substantial edits. The workflow only completes after the review clears and a live ocp-vscode preview handoff succeeds.

Toolchain

Pi is the agent harness Primus runs on.

build123d is the Python CAD programming library that generates the actual 3D geometry. Primus manages a dedicated Python venv with build123d installed, writes parametric generator scripts against its API, and exports finished models as STEP or STL files.

Serena MCP gives Primus semantic code intelligence over the local build123d source tree. Instead of hallucinating API signatures.

Tavily handles domain-specific research — manufacturing tolerances, standard dimensions, material properties, and anything else that lives outside the build123d source. It's intentionally narrow in scope: Serena covers the code, Tavily covers the domain knowledge that code can't answer.

Multi-agent orchestration

Primus keeps itself as the sole writer of scripts and tests. Specialist subagents — build123d-source-scout for Serena-backed source research, domain-research-worker for Tavily-backed domain knowledge, and cad-reviewer for post-authoring critique — each run inside a tight, narrowly scoped task and write only to their designated directories. This matters for two reasons: it prevents conflicting writes to the working tree, and it preserves the orchestrator's reasoning quality across long sessions by offloading deep, narrow work to agents that start fresh, do one thing, and return a structured artifact. The orchestrator never loses its own context window to sub-problems it can safely delegate.

Version-controlled design artifacts

Every stage transition commits to git. The approved plan, research artifacts, generator scripts, tests, and review logs are all tracked — giving you a full audit trail, the ability to roll back to any point in the workflow, and clean branch isolation if you want to explore a design variant without disturbing earlier work.

Platform Notes

I've done extensive end-to-end testing on macOS and Linux — install, setup, and full design workflows all run smoothly there. Windows has seen only limited testing, so expect rough edges; if you hit something, please open an issue.

CI runs npm run typecheck, npm test, and npm pack --dry-run against ubuntu-latest, macos-latest, and windows-latest on every push, so the package itself stays installable across all three — it's the runtime workflow on Windows where gaps may still exist.

Troubleshooting

  • Primus not ready on this machine:
    • Run primus setup, then primus doctor
  • Tavily auth failure during setup/doctor:
    • Set TAVILY_API_KEY=tvly-..., or run tvly login, then rerun setup/doctor
  • Python prerequisite failure:
    • Install Python 3.11-3.14, ensure launcher is on PATH, rerun setup
  • primus update issues:
    • If vendored build123d checkout is dirty, commit/stash/discard local changes first
    • To update Primus itself, run npm install -g @shaurya-sethi/primus@latest

License

MIT. See LICENSE.