pi-module
БесплатноБез исполняемых скриптовНе проверенInstall a pi (pi.dev coding agent) package/extension/skill into this nix flake declaratively, instead of running `pi install npm:...`. Use when the user gives…
от fred-drake★ 28 звёзд на GitHubОб этом скилле
Adding a pi Package/Module to Nix
Pi packages are installed declaratively here, replacing pi install. The trick:
pi install npm:X does two things — (1) drops the package under ~/.pi/agent/npm/ and
(2) appends a reference to the packages array in ~/.pi/agent/settings.json. We
reproduce both with nix: build the package into the store, then register that store
path as a local-path entry in the packages array via an activation-script merge.
Key files (all already exist — extend them):
apps/pi-<name>.nix— derivation that assembles one pi package directoryapps/fetcher/pi-<name>.nix— auto-generated pin (versions + hashes); never hand-edit except to revertapps/fetcher/pi-<name>-lock.json— generated lockfile, if GitHub source has none (see Step 2)apps/fetcher/update-pi-<name>.sh— updater that re-resolves the pinmodules/home-manager/features/pi.nix— thepiPackageslist +piManagedPackagesactivation mergejustfile—update-pi-packagestarget (andupdate-pifor the CLI), both inupdate-all
The reference implementation is @quintinshaw/pi-dynamic-workflows (apps/pi-dynamic-workflows.nix).
For the buildNpmPackage+injected-lockfile strategy, see apps/pi-web-access.nix and
apps/pi-mcp-adapter.nix.
Read the real docs first
Pi ships authoritative docs inside the built package — read these, not the website
(the website's npm view ... pi manifest can even be stale vs the published package.json):
# The docs dir is inside the built pi store path:
docs=$(find /nix/store -maxdepth 5 -type d -path '*pi-monorepo/docs' 2>/dev/null | sort | tail -1)
ls "$docs" # packages.md, settings.md, extensions.md, skills.md, ...
Critical facts (these bit me; don't relearn them)
- Local-path packages are NOT
npm install-ed by pi. Fornpm:/git:sources pi runsnpm install; for a local path it just loads the directory as-is. So the derivation must shipnode_modules/with all runtimedependenciesalready present. (Docs: packages.md "Local Paths".) - Peer deps are provided by pi core — never bundle them.
@earendil-works/pi-ai,@earendil-works/pi-agent-core,@earendil-works/pi-coding-agent,@earendil-works/pi-tui,typebox. They appear inpeerDependenciesby convention. Only realdependenciesget vendored. Exception: if a package lists them independencies(notpeerDependencies), they will be bundled — pi's separate module roots mean they coexist with pi core's own copies without conflict. - Published npm tarballs have no lockfile →
buildNpmPackagefrom the tarball fails. Two strategies depending on the dep tree (Step 2). Important: GitHub source repos also frequently have no lockfile — do not assume one exists; always check withls "$src/package-lock.json"after prefetching the source. settings.jsonis mutable and pi writes to it (lastChangelogVersionon update, plus interactive/settings,/model). Do NOT manage it with read-onlyhome.file(the claude-code style) — that breaks pi's own writes. Merge with jq in an activation script instead (already implemented; you just add to thepiPackageslist).- The whole tarball is needed, not just
dist/. Pi loads.tsextensions directly (via jiti); the package typically shipssrc/,dist/, andextensions/. Unpack all. git addall new files before evaluating. Nix flakes only see git-tracked files. Adarwin-rebuild buildwill fail with "Path '...' is not tracked by Git" until yougit add apps/pi-<name>.nix apps/fetcher/pi-<name>.nix apps/fetcher/pi-<name>-lock.json ....buildNpmPackageoutput layout for pi. The defaultinstallPhasecopies to$out/lib/node_modules/<pkgname>, but pi needs the package root at$out(so it can findindex.ts,skills/, etc. directly). Always overrideinstallPhasewithcp -r . $out/. Also overridebuildPhaseto be empty when there is no build script (pi loads TypeScript via jiti — no compile step needed).- Use
cp -r source/. dest/notcp -rT source dest. macOS BSDcpdoes not support-T. The portable form iscp -r "$src"/. "$dst"/.
Step 1 — Inspect the package
npm view <pkg> version dependencies peerDependencies devDependencies pi
# Inspect the tarball manifest:
url=$(npm view <pkg> dist.tarball); f=$(nix store prefetch-file --json "$url" | jq -r .storePath)
tar -xzf "$f" -O package/package.json | jq '{main, files, pi, dependencies, peerDependencies}'
tar -tzf "$f" | grep -E 'extensions/|src/|skills/' # what resources ship
# Check if GitHub source has a lockfile:
src=$(nix flake prefetch --json github:<owner>/<repo>/v<version> | jq -r .storePath)
ls "$src/package-lock.json" 2>/dev/null || echo "NO LOCKFILE IN GITHUB SOURCE"
For every entry in dependencies, check whether it is itself dependency-free:
npm view <dep> dependencies. That d
Установить pi-module в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл pi-module?
Install a pi (pi.dev coding agent) package/extension/skill into this nix flake declaratively, instead of running `pi install npm:...`. Use when the user gives a `pi install npm:<pkg>` / `pi install git:<repo>` command, links a https://pi.dev/packages/... page, or asks to add a pi extension/skill/theme/prompt to the nix config. Also covers bumping the pi CLI itself (pi-coding-agent). Pi calls these "packages"; the user may call them "modules".
Как установить скилл pi-module?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pi-module запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic