pi-dev-workflow

A development guide for pi extensions and packages in a monorepo, a repository containing multiple related packages.

In plain words
What is it for?
Use it when switching between local and npm versions, reloading extensions, or testing packages in an isolated setup.
Why use it?
It prevents pi from loading the published package instead of the local code and addresses dependency hoisting and packaging problems.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/aretw0/agents-lab/pi-dev-workflow
Any agent
npx skills add aretw0/agents-lab --skill pi-dev-workflow
Clone the repo
git clone --depth 1 https://github.com/aretw0/agents-lab

Made for: Claude Code, Codex.

Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,934 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00055 $0.01934
Opus 5 $0.00028 $0.00967
Sonnet 5 $0.00011 $0.00387
Haiku 4.5 $0.00006 $0.00193

Measured 2d ago against content hash ad1c633ad6a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pi-dev-workflow scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/pi-skills/skills/pi-dev-workflow/SKILL.md · 194 lines

How it starts

The opening of the file, as written. The whole thing — 194 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Workflow de Desenvolvimento Pi

Desenvolver extensões, skills ou temas para o pi exige alternar entre código local (para iterar rápido) e pacotes publicados (para validar a experiência do usuário final). Esta skill documenta os padrões que funcionam.

Paridade guide-skill

Guide canônico: docs/guides/testing-isolation.md Guide complementar: docs/guides/control-plane-operating-doctrine.md Paridade mínima: PI_CODING_AGENT_DIR isolado; settings canônico vs derivado; paths portáveis; reload obrigatório; não mutar pacote upstream do pi Última revisão de paridade: 2026-04-30

O Problema

Quando você desenvolve um pacote pi dentro de um monorepo, surgem 3 conflitos comuns:

  1. O pi carrega a versão publicada em vez do código local que você está editando
  2. npm workspaces faz hoisting — deps vão para root/node_modules/ e paths relativos quebram
  3. bundledDependencies não funciona com workspaces — o tarball sai vazio

Solução: Source Switching

O padrão adotado pelo oh-pi e pelo agents-lab:

  1. Cada pacote é independente — publicado no npm com seu próprio package.json
  2. Um script alterna entre paths locais e npm:@scope/name no settings.json do pi
  3. Sem bundledDependencies — meta-pacotes são installers que rodam pi install para cada dependência

Configuração Mínima (pacote único)

Para um pacote simples, basta usar pi install com path local:

# Desenvolvimento — carrega do disco
pi install /caminho/absoluto/para/meu-pacote

# Produção — volta para npm
pi remove /caminho/absoluto/para/meu-pacote
pi install npm:@meu-scope/meu-pacote

Configuração Monorepo (múltiplos pacotes)

Crie um script que reescreve o settings.json do pi:

#!/usr/bin/env node
// scripts/pi-source-switch.mjs
import { existsSync, readFileSync, readdirSync, writeFileSync, mkdirSync } from "node:fs";
import { homedir } from "node:os";
import path from "node:path";
import { fileURLToPath } from "node:url";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const REPO_ROOT = path.resolve(__dirname, "..");

// Descobrir pacotes pi no workspace
const PACKAGES = new Map();
for (const entry of readdirSync(path.join(REPO_ROOT, "packages"), { withFileTypes: true })) {
  if (!entry.isDirectory()) continue;
  const pkgPath = path.join(REPO_ROOT, "packages", entry.name, "package.json");
  if (!existsSync(pkgPath)) continue;
  const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
  if (pkg.keywords?.includes("pi-package")) {
    PACKAGES.set(pkg.name, path.join(REPO_ROOT, "packages", entry.name));
  }
}

const mode = process.argv[2]; // "local" ou "published"
const settingsPath = path.join(homedir(), ".pi", "agent", "settings.json");
const settings = existsSync(settingsPath)
  ? JSON.parse(readFileSync(settingsPath, "utf8")) : {};

const newPackages = [];
for (const [name, dir] of PACKAGES) {
  newPackages.push(mode === "local" ? path.resolve(dir) : `npm:${name}`);
}
settings.packages = newPackages;

mkdirSync(path.dirname(settingsPath), { recursive: true });
writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
console.log(`✅ Switched to ${mode} mode. Restart pi to reload.`);

Read the full file on GitHub · 194 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 194 lines · 55 tokens per session scan A ad1c633ad6a3

Subscribe to this mod's changes

pi-dev-workflow is a skill published in the GitHub repository aretw0/agents-lab (11 stars, last pushed 2mo ago), licensed MIT. It adds 55 tokens to every session and 1,934 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.