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.
npx agentmods add skills/aretw0/agents-lab/create-pi-extensionnpx skills add aretw0/agents-lab --skill create-pi-extensiongit clone --depth 1 https://github.com/aretw0/agents-labWrote 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/create-pi-extension)<a href="https://agentmods.dev/skills/aretw0/agents-lab/create-pi-extension"><img src="https://agentmods.dev/badge/skills/aretw0/agents-lab/create-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.00037 | $0.01110 |
| Opus 5 | $0.00018 | $0.00555 |
| Sonnet 5 | $0.00007 | $0.00222 |
| Haiku 4.5 | $0.00004 | $0.00111 |
Grade A, and why
create-pi-extension 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 159 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Criando uma Extensão Pi
Extensões são módulos TypeScript que se registram no ciclo de vida do pi. Use quando skills não são suficientes.
Estrutura Mínima
extensions/minha-extension.ts
Ou como pacote:
packages/minha-extension/
├── package.json
├── index.ts
└── README.md
Template Base
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
export default function (pi: ExtensionAPI) {
// Registrar tools, commands, eventos, etc.
}
Registrando uma Tool
import { Type } from "@sinclair/typebox";
pi.registerTool({
name: "minha_tool",
label: "Minha Tool",
description: "O que esta tool faz (visível ao LLM)",
parameters: Type.Object({
input: Type.String(),
}),
async execute(toolCallId, params, signal, onUpdate, ctx) {
return {
content: [{ type: "text", text: `Resultado: ${params.input}` }],
details: {},
};
},
});
Registrando um Comando
pi.registerCommand("meu-comando", {
description: "O que o /meu-comando faz",
handler: async (args, ctx) => {
ctx.ui.notify("Executado!", "info");
},
});
Eventos Comuns
// Quando a sessão inicia ou recarrega
pi.on("session_start", async (event, ctx) => {
// Reconstruir estado, configurar UI
});
// Antes de cada chamada ao LLM
pi.on("before_agent_start", async (event, ctx) => {
// Modificar system prompt, injetar contexto
});
// A cada tool call
pi.on("tool_call", async (event, ctx) => {
// Gate: retornar { cancelled: true, reason: "..." } para bloquear
});
// Quando a sessão encerra
pi.on("session_shutdown", async (event, ctx) => {
// Cleanup, salvar estado
});
Empacotando como npm
{
"name": "@aretw0/minha-extension",
"keywords": ["pi-package"],
"type": "module",
"pi": {
"extensions": ["./index.ts"]
},
"peerDependencies": {
"@earendil-works/pi-coding-agent": "*",
"@earendil-works/pi-ai": "*",
"@earendil-works/pi-tui": "*",
"@sinclair/typebox": "*"
}
}
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.
- 5d ago First seen · 159 lines · 37 tokens per session scan A 85046fd43d95
create-pi-extension is a skill published in the GitHub repository aretw0/agents-lab (11 stars, last pushed 2mo ago), licensed MIT. It adds 37 tokens to every session and 1,110 once invoked, about $0.0002 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.
Other skills, from other repositories
pi
Use when needing a minimal, extensible terminal AI coding agent harness in TypeScript with plugin architecture. Pi: minimalist terminal AI coding agent emphasizing simplicity and composability.
autovault-skill
Understand AutoVault-managed skills and how to install or update them. Use when a skill is visible via symlink, when authoring or editing SKILL.md, or before touching /.autovault/skills. Vault writes must go through autovault add-local or MCP proposeskill/updateskill so AutoVault re-signs; never hand-edit vaulted…
nestjs-patterns
NestJS architecture patterns for modules, controllers, providers, DTO validation, guards, interceptors, config, and production-grade TypeScript backends.
bun-runtime
Bun as runtime, package manager, bundler, and test runner. When to choose Bun vs Node, migration notes, and Vercel support.
typescript
TypeScript coding conventions, best practices, and patterns for writing clean, maintainable code.
deuz-sdk
Use when building or changing any AI or LLM feature in TypeScript — chatbot, streaming chat UI, agent, tool calling, structured output, embeddings, RAG, agent memory, MCP client, guardrails, image/speech/video generation — or when about to reach for LangChain, LangGraph, LlamaIndex, the Vercel AI SDK (ai, streamText…