Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/aretw0/agents-labnpx agentmods add skills/aretw0/agents-lab/test-pi-extensionWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/aretw0/agents-lab/test-pi-extension)<a href="https://agentmods.dev/skills/aretw0/agents-lab/test-pi-extension"><img src="https://agentmods.dev/badge/skills/aretw0/agents-lab/test-pi-extension/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/aretw0/agents-lab/test-pi-extension"><img src="https://agentmods.dev/badge/skills/aretw0/agents-lab/test-pi-extension.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00044 | $0.02104 |
| Opus 5.5 | $0.00018 | $0.00842 |
| Sonnet 5.5 | $0.00009 | $0.00421 |
| Haiku 4.5 | $0.00004 | $0.00210 |
Grade C, and why
test-pi-extension scanned grade C with 1 finding 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 1mo 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
it("bloqueia rm -rf /", async () => { How it starts
The opening of the file, as written. The whole thing — 321 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Testando Extensões Pi
O @marcfargas/pi-test-harness permite testar extensões pi com o runtime real — sem LLM. Tudo roda de verdade (loading, hooks, tools, eventos), exceto o modelo que é substituído por um playbook scriptado.
Instalação
npm install --save-dev @marcfargas/pi-test-harness vitest
Peer dependencies: @earendil-works/pi-coding-agent, @earendil-works/pi-ai, @earendil-works/pi-agent-core.
Teste Básico
import { describe, it, expect, afterEach } from "vitest";
import { createTestSession, when, calls, says, type TestSession } from "@marcfargas/pi-test-harness";
describe("minha extensão", () => {
let t: TestSession;
afterEach(() => t?.dispose());
it("registra e executa uma tool", async () => {
t = await createTestSession({
extensions: ["./src/index.ts"],
mockTools: {
bash: (params) => `$ ${params.command}\noutput`,
read: "conteúdo do arquivo",
write: "ok",
edit: "ok",
},
});
await t.run(
when("Liste os arquivos", [
calls("bash", { command: "ls" }),
says("Encontrei os arquivos."),
]),
);
expect(t.events.toolResultsFor("bash")).toHaveLength(1);
expect(t.events.toolResultsFor("bash")[0].text).toContain("output");
});
});
Arquitetura
┌───────────────────────────────────────┐
│ Ambiente pi REAL │
│ │
│ Extensions ─── carregadas de verdade │
│ Tool registry ─ hooks reais │
│ Session state ─ persistência real │
│ │
│ ┌─────────────────────────────────┐ │
│ │ streamFn ── SUBSTITUÍDO │ │ ← playbook (when/calls/says)
│ │ tool.execute ── INTERCEPTADO │ │ ← mockTools
│ │ ctx.ui.* ── INTERCEPTADO │ │ ← mockUI
│ └─────────────────────────────────┘ │
└───────────────────────────────────────┘
Só 3 pontos são substituídos — todo o resto é pi real.
Playbook DSL
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.
- 1mo ago First seen · 321 lines · 44 tokens per session scan C eb78b9373550
test-pi-extension is a skill published in the GitHub repository aretw0/agents-lab (11 stars, last pushed 4mo ago), licensed MIT. It adds 44 tokens to every session and 2,104 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
tmux-manual-qa
Run a single manual tmux-based QA scenario for the todo continuation feature against the real CLI (./pi-test.sh) in an interactive TUI. Captures scrollback, asserts deterministic pass/fail count markers, and cleans up test fixtures. Use only for the manual-qa milestone features.
pi-package-sandbox-test
Use when verifying that published Pi packages install and load for normal users, including pi.dev package compatibility checks, release validation, Daytona sandbox tests, and package installability audits.
qa
Regression test a San feature by name. Looks for a feature doc in docs/reference/ or docs/packages/2-feature/, runs automated Go tests and interactive tmux tests, then produces a pass/fail report. Use this skill when the user says "qa", "regression test", "test feature X", "verify feature", or references a feature…
pi-validation-flow
Use when validating Pi monorepo changes after editing TypeScript, Svelte, package manifests, built-in registry, tests, repo tooling, skills, or docs.
tdd
Test-driven development — write a failing test that names the behavior, watch it fail, implement the minimum to make it pass, then refactor with tests green. Works for new features, bug fixes, and behavior changes. Use when the user says "tdd", "test-first", "write tests first", or wants a change built test-first.
investigate
A structured root-cause investigation method for software bugs. It moves from history and reproduction through tested hypotheses, a focused fix, verification, and a report.