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.svg" alt="Measured on agentmods" 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 | $0.00022 | $0.01052 |
| Sonnet 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 6d 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.
- 6d 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 2mo ago), licensed MIT. It adds 44 tokens to every session and 2,104 once invoked, about $0.0002 per session on Opus 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
taiyi-dev
A software-development stage that implements planned tasks using test-driven development, or TDD: write a failing test, make it pass, then improve the code. It checks the task plan, dependencies, file boundaries, and required completion evidence.
taiyi-test
A project workflow skill for verifying an implementation and producing a TEST.md record. TDD means writing a failing test, implementing the change, and then making the test pass; this skill checks that process and other regression cases.
codex-claude-worker
Translate natural-language user requests into bounded Claude Code worker tasks while Codex or ChatGPT remains the supervisor. Use when the user gives an ordinary prompt and wants Codex to clarify scope, choose a safe work boundary, generate a worker prompt, approve or defer worker execution, read run summaries and…
skill-test
Verifies that the skill system is working correctly.
test-browser
Run browser tests on pages affected by current PR or branch.
test-xcode
Build and test iOS apps on simulator using XcodeBuildMCP.