pi-extensions

Package, update, and remove pi-coding-agent extensions as Nix derivations in a nixos flake.

Updated Jul 4, 2025
One-click install
npx skills add https://github.com/milespossing/nixdots --skill pi-extensions-milespossing
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pi-extensions
Source: https://github.com/milespossing/nixdots/tree/main/.agents/skills/pi-extensions
Command: npx skills add https://github.com/milespossing/nixdots --skill pi-extensions-milespossing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing pi-coding-agent extensions in a Nix flake requires fetching npm metadata, computing tarball hashes, handling dependencies, and wiring extensions into wrapper derivations — a repetitive, error-prone process this Skill standardizes. ## Core Features & Use Cases - Declarative extension specs: Add npm-published extensions as pure data under pi.extensions.<name> with pname, version, and SRI hash, built lazily by flake.lib.buildPiExtension. - Dependency strategies: Choose between simple tarball unpacking, vendored tarballs for packages without lockfiles, or bespoke buildNpmPackage builds with fetched package-lock.json files. - Security audit workflow: Perform a mandatory supply-chain review of the npm package source before packaging, scanning for lifecycle scripts and risky API usage. - Use Case: When asked to "add the npm package @scope/pkg as a pi extension", fetch its registry metadata, audit the source, create modules/ai/extensions/<name>.nix, activate it in the pi-desktop or pi-wsl variant lists, and verify with nix build. ## Quick Start Add the npm package @scope/pkg-name as a pi extension and enable it in the pi-wsl wrapper.

Frequently Asked Questions about pi-extensions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add an npm package as a pi-coding-agent extension in Nix?▼

Fetch the package's version and dist.integrity hash from the npm registry, then create a spec file under modules/ai/extensions/<name>.nix setting pi.extensions.<name> with pname, version, and hash. List the name in the desktopExtensions or wslExtensions sets in modules/ai/pi.nix and rebuild the wrapper.

How to package a pi extension that has npm dependencies?▼

If the package ships a package-lock.json, use a bespoke build function with buildNpmPackage, fetching the lockfile via pkgs.fetchurl and obtaining npmDepsHash from a lib.fakeHash build. For one or two deps without a lockfile, use the vendor list to drop extra tarballs into node_modules.

Can I package a local extension that is not published on npm?▼

Yes. Place sources under modules/ai/extensions/_local/<name>/ with a package.json containing a pi manifest and a default.nix that runCommands the fileset into a pi-package layout. Then add a spec whose build function callPackages that directory.

How do I verify a pi extension builds correctly in the flake?▼

Run nix build --no-link .#legacyPackages.x86_64-linux.piExtensions.<name> to build just the extension and confirm the hash and unpack step. Inspect the output's package.json with jq to confirm it carries a pi manifest, or build the full .#pi-desktop or .#pi-wsl wrapper.

When should I not use this pi extension packaging workflow?▼

Do not use it for general pi usage questions, MCP servers, or other agents such as opencode, copilot, crush, or aider. It only covers the modules/ai/extensions registry and the pi-desktop and pi-wsl wrappers in this specific nixos flake.