Skip to content
Skills Library
Programming · Automation

publishing-pi-extensions

/publishing-pi-extensions

Use when creating a new pi extension package, or releasing a new version of one, for npm and the pi package gallery.

Licence
MIT
Last repository change
13.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when creating a new pi extension package, or releasing a new version of one, for npm and the pi package gallery.

Original author description

Use when creating a new pi extension package, or releasing a new version of one, for npm and the pi package gallery.

How it works

  1. New package
  2. New release
Original SKILL.md headings · 93 lines, 734 words
SKILL.md preview
---
name: publishing-pi-extensions
description: Use when creating a new pi extension package, or releasing a new version of one, for npm and the pi package gallery.
---

# Publishing Pi Extensions

A pi extension ships as its own public repository under `~/projects/<name>`, published to npm as `<name>`, and listed in the pi package gallery at `https://pi.dev/packages/<name>`.
`~/projects/pi-robot-hand` is the minimal template: copy its `package.json`, `tsconfig.json`, `.gitignore`, `LICENSE`, `.github/workflows/publish.yml`, and `tests/imports.test.ts`, then adapt names and descriptions.
A package that also ships a skill and compiled helper scripts, such as `pi-robot-hand`'s secret-drop skill, shows how to lay those out.

## New package

### 1. Claim the name

`npm view <name>` and `gh repo view wayne930242/<name>` both report not found.
Name choices belong to the user; offer candidates that pass this check.

**Complete when:** the user picked a name that is free on npm and GitHub.

### 2. Build

- `package.json` carries the `pi-package` keyword (this is what lists it in the gallery), `pi.extensions` pointing at `./src/index.ts`, `files` limited to what pi loads, pi packages as `peerDependencies` with `"*"`, and the same packages pinned to their latest versions in `devDependencies`.
- Relative imports inside `src/` end in `.ts`: pi reloads TypeScript on `/reload`, while Node caches `.js` modules for the life of the process.
- Tests drive the registered tool's `execute()` against a minimal `ExtensionAPI` and `ExtensionContext`, as in `pi-robot-hand/tests/tool.test.ts`.

**Complete when:** `npm run check` and `npm test` pass, and `npm pack --dry-run` lists only the intended files.

### 3. Exercise it in a real pi

Run pi in tmux with only this extension loaded, then drive it with `tmux send-keys` and read it with `tmux capture-pane -p`:

```bash
tmux new-session -d -s ext -x 160 -y 50 "pi --no-session -ne -e $HOME/projects/<name>/src/index.ts --model openai/gpt-6-luna; sleep 60"
```

`-ne` also drops the claude-bridge extension, so pick an `openai/gpt-6-*` model; the ChatGPT login serves them under the `openai` provider.
The trailing `sleep` keeps the pane open long enough to read a startup error.
Save and restore the user's clipboard (`pbpaste`/`pbcopy`) around clipboard checks.

**Complete when:** every user-visible branch of the extension ran in the TUI and its captured screen matches the contract.

### 4. Push to GitHub

Commit with Conventional Commits, staging files by name, then:

```bash
gh repo create wayne930242/<name> --public --description "<one line>" --source . --remote origin --push
```

**Complete when:** `origin/main` holds the commit.

### 5. First publish by the user

The maintainer's npm account authenticates with a security key, which needs the user's browser, so the user runs the first publish.
Hand it over with `robot_hand`:

```bash
cd ~/projects/<name> && npm publish --access public --auth-type=web
```

Run `npm whoami` first; on a 401, hand over `npm login` before the publish.

A new package's first publish goes through npm staging and leaves a public `0.0.0-stage` placeholder beside the real version, and the registry takes a few minutes to show the real one.
The placeholder is harmless; removing it with `npm unpublish <name>@0.0.0-stage --auth-type=web` within 72 hours only tidies the version list.

**Complete when:** `npm view <name> version` prints the released version.

### 6. Trusted publishing

The local npm may lack `npm trust`, so run it through the latest npm:

```bash
npx -y npm@latest trust github <name> --repo wayne930242/<name> --file publish.yml --allow-publish --allow-stage-publish --yes
```

**Complete when:** `npx -y npm@latest trust list <name>` shows the GitHub `publish.yml` entry with `publish, stage publish`.

### 7. Install

- During development, `pi install ~/projects/<name>` loads the working tree; `/reload` picks up edits.
- After release, `pi remove ~/projects/<name>` then `pi install npm:<name>@<version>`, and the user runs `/reload`.
- To install it on every machine, add the pinned spec to `PACKAGES` in `scripts/pi_root/pins.py`; this is the user's call.

**Complete when:** `~/.pi/agent/settings.json` lists `npm:<name>@<version>`.

The gallery finds packages only through npm's `keywords:pi-package` search, which pages no deeper than 5000 results while more than 10,000 packages carry the keyword, so a new package can stay unlisted for days or indefinitely ([earendil-works/pi#7885](https://github.com/earendil-works/pi/issues/7885)).
Report the gallery page's status to the user without waiting on it or polling for it; republishing does not help.

## New release

1. Bump `version` in `package.json`, commit, and push `main` with a matching tag: `git tag v<version> && git push origin main v<version>`.
2. The `Publish` workflow runs check and tests, confirms the tag matches the version, and publishes through trusted publishing.
3. Move the install to the new pin with `pi install npm:<name>@<version>`, and bump `PACKAGES` in `scripts/pi_root/pins.py` when it is listed there.

**Complete when:** `gh run list --repo wayne930242/<name> --limit 1` shows the run succeeded and `npm view <name> version` prints the new version.

Versions

The database has no other skills named publishing-pi-extensions.

Database snapshot: 13.11.2026 · package version 18634cd9fb46 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100secure-npm-package
    Use when creating or hardening an npm release with Trusted or Staged Publishing, including E404 packages sequenced after first publish. Not for remote changes or publishing.
  • 100scaffold-extension
    Create a new extension package inside an existing framework's extensions/ directory. Use when authoring an expansion (extension) for AIWG.
  • 100nuxt-modules
    Use when creating Nuxt modules: (1) Published npm modules (@nuxtjs/, nuxt-), (2) Local project modules (modules/ directory), (3) Runtime extensions (components, composables, plugins), (4) Server extensions (API routes, middleware), (5) Releasing/publishing modules to npm, (6)…
  • 90npm-publishing
    Publish an npm package that installs and imports cleanly: correct exports map, dual formats, types, and semver. Use when releasing a library to npm or fixing a package consumers cannot import.
  • 90publishing-packages
    Conventions for publishing npm packages from this repository, including when a PR needs a changeset and how to write one. Use when adding or editing a changeset, versioning or releasing a package, or deciding whether a change to a publishable library needs a changelog entry.
  • 100secure-npm-package
    Set up a secure release process for an npm package to protect it from supply chain attacks. Use for any request to create and publish a new npm package, secure npm publishing or releasing, set up npm Trusted Publishing, provenance, or Staged Publishing, harden a release workflow.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.