Automates the end-to-end creation, documentation, and installation of a pi extension.
Install
mkdir -p .claude/skills/zero-to-documented && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11382" && unzip -o skill.zip -d .claude/skills/zero-to-documented && rm skill.zipInstalls to .claude/skills/zero-to-documented
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Build a complete, documented pi extension from scratch (zero → plan → scaffold → implement → document → validate → install)Key capabilities
- →Plan the architecture of a pi extension based on a user's goal
- →Scaffold the file structure for a new pi extension
- →Implement the core logic of the extension in TypeScript
- →Generate complete `README.md` and optional `ARCHITECTURE.md` documentation
- →Validate the extension for correctness and adherence to standards
How it works
The skill orchestrates the creation of a pi extension through a multi-phase workflow: planning, scaffolding, implementing, documenting, validating, and reviewing, using an `extension_creator` tool.
Inputs & outputs
When to use zero-to-documented
- →Building custom tools
- →Creating command-line extensions
- →Generating extension scaffolds
About this skill
Zero to Documented Extension
You are tasked with building a complete, documented pi extension from scratch based on a user's goal. Follow this complete workflow:
Input
The user will provide a goal such as:
- "create an extension that blocks dangerous file writes"
- "make an extension that adds a custom tool for git operations"
- "build an extension that injects system prompt guidance"
Complete Workflow
Phase 1: Plan (mode: plan)
Call the extension_creator tool with:
mode: "plan"
goal: "<user's goal>"
extensionKind: "<inferred type>" (optional)
From the response, extract:
- Extension type (tool, command, prompt, provider)
- Package name (kebab-case)
- Required files structure
- Key steps and cautions
Phase 2: Scaffold (mode: scaffold)
Call the extension_creator tool with:
mode: "scaffold"
goal: "<user's goal>"
extensionKind: "<type from phase 1>"
path: "<external workspace path>"
Create the files:
- Create the external workspace directory
- Initialize
package.json(use the plan's package name) - Create
tsconfig.jsonfor TypeScript - Create the entrypoint file (named, not index.ts)
- Create prompt templates in
prompts/if needed
Phase 3: Implement
Write the actual code:
- Implement the extension logic in the entrypoint TypeScript file
- Register tools/commands as needed
- Follow the "Clean architecture by default" principles:
- One responsibility per extension
- Minimal event hooks
- Small and obvious file layout
- No unnecessary UI or hidden side effects
Validate as you code:
- Ensure TypeScript compiles:
npx tsc --noEmit - Check package.json has explicit entrypoint
- Verify named entrypoint (not index.ts)
Phase 4: Document (mode: document)
Call the extension_creator tool with:
mode: "document"
path: "<external workspace path>"
extensionKind: "<type>"
Then, using the guidance returned:
-
Read the source code at the path
-
Analyze the structure, dependencies, and purpose
-
Generate README.md:
- Use flat-square badges (TypeScript, License, Pi Extension)
- Follow the style from
prompts/documentation.md - Include: Features, Tools/Commands, Quick Start, Usage, Development
- Add emojis sparingly (🔍, 🛠️, 📦, ✨)
- Reference web-search extension style: https://github.com/Immac/pi-extension-builder
-
Generate ARCHITECTURE.md (optional):
- Only if extension has complex architecture (multiple agents, state management)
- Include: Purpose, Components, Principles, Interaction flows
-
Write the files to the extension path
Phase 5: Validate (mode: validate)
Call the extension_creator tool with:
mode: "validate"
path: "<external workspace path>"
Check the validation result:
- If
status: "fail": Fix errors and re-validate - If
status: "warn": Address warnings (optional cleanup) - If
status: "pass": Ready for install
Phase 6: Review (mode: review)
Call the extension_creator tool with:
mode: "review"
path: "<external workspace path>"
Ensure:
- No command sprawl
- Clean, minimal structure
- Easy reviewability
Phase 7: Install (mode: install) - Optional
If the user wants to install:
mode: "install"
path: "<external workspace path>"
installTarget: "global" or "local" (optional)
Output Format
At each phase, report:
## Phase X: <Phase Name>
**Tool Call:** (if applicable)
<details of tool call>
**Actions Taken:**
- <action 1>
- <action 2>
**Files Created/Modified:**
- `<path>`: <description>
**Next Step:** <what happens next>
Pi Extension Examples
Study these real extension patterns from pi-coding-agent/examples:
Simple Tool Extension (with-deps)
- Pattern: Register a single tool using
pi.registerTool() - Structure: Simple, single file, minimal
export default function (pi: ExtensionAPI) {
pi.registerTool({
name: "tool_name",
label: "Tool Label",
description: "What it does",
parameters: Type.Object({ /* ... */ }),
execute: async (_id, params) => { /* ... */ }
});
}
Complex Extension with Multiple Files (sandbox)
- Pattern: Replace built-in tool with enhanced version
- Features: Config loading, OS-level sandboxing, event handlers
- Key patterns:
pi.registerTool()with...localToolspreadpi.on("session_start", async (event, ctx) => { ... })pi.registerFlag()for extension optionspi.registerCommand()for slash commands- Load config from
~/.pi/agent/extensions/and<cwd>/.pi/
Skill Extension (dynamic-resources)
- Pattern: Markdown-based skill with frontmatter
---
name: dynamic-resources
description: Example skill...
---
Extension Entrypoint Pattern
export default function (pi: ExtensionAPI) {
// Register tools, commands, flags, event handlers
pi.registerTool({ /* ... */ });
pi.registerCommand("cmd", { /* ... */ });
pi.on("session_start", async (event, ctx) => { /* ... */ });
}
Package Structure
my-extension/
├── package.json # name: "my-extension", main: "./dist/index.js"
├── tsconfig.json
├── src/
│ └── index.ts # Entrypoint (named, not just "index" for identity)
├── prompts/ # Optional: prompt templates
│ └── extension.md
└── dist/ # Build output (gitignored)
Important Notes
- This is LLM-driven: Use your understanding to write code and documentation, don't just fill templates
- Documentation is key: The
documentmode provides guidance, but YOU write the actual README.md and ARCHITECTURE.md - External workspace: Always work in an external directory, not pi's runtime folders
- Clean first: Prioritize simplicity over features
- Badges: Use flat-square style (matching web-search extension)
- Personal project disclaimer: If generating README for this extension-creator, include the disclaimer about no maintenance guarantees
Example Flow
User: "Create an extension that searches the web"
Phase 1: Plan → tool returns "web-search" extension plan
Phase 2: Scaffold → create workspace/web-search/ with package.json, tsconfig.json, src/
Phase 3: Implement → write web-search.ts with search tool
Phase 4: Document → generate README.md (with badges, examples) and ARCHITECTURE.md
Phase 5: Validate → check TypeScript compiles, structure is clean
Phase 6: Review → ensure minimal, no extra commands
Phase 7: Install → pi install ./workspace/web-search
Reference Files
prompts/documentation.md- Detailed documentation generation guideARCHITECTURE.md- This project's architecture spec- https://github.com/Immac/pi-extension-builder - Example of documented extension
When not to use it
- →When the user's goal is not to build a pi extension
- →When documentation is not a priority
- →When working directly in pi's runtime folders
Limitations
- →Requires an `extension_creator` tool for various modes
- →Documentation is generated based on guidance, not fully automated
- →Always works in an external workspace directory
How it compares
This skill provides a structured, phase-driven approach to building pi extensions from scratch, integrating planning, code implementation, and complete documentation generation, unlike manual development.
Compared to similar skills
zero-to-documented side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| zero-to-documented (this skill) | 0 | 3mo | No flags | Advanced |
| react-component-patterns | 3 | 1mo | No flags | Intermediate |
| typescript-pro | 3 | 4mo | No flags | Advanced |
| nx-generate | 1 | 6mo | Review | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
react-component-patterns
HoangNguyen0403
Modern React component architecture and composition patterns.
typescript-pro
sickn33
Master TypeScript with advanced types, generics, and strict type safety. Handles complex type systems, decorators, and enterprise-grade patterns. Use PROACTIVELY for TypeScript architecture, type inference optimization, or advanced typing patterns.
nx-generate
nrwl
Generate code using nx generators. USE WHEN scaffolding code or transforming existing code - for example creating libraries or applications, or anything else that is boilerplate code or automates repetitive tasks. ALWAYS use this first when generating code with Nx instead of calling MCP tools or running nx generate immediately.
generate-subsystem-skills
llama-farm
Generate specialized skills for each subsystem in the monorepo. Creates shared language skills and subsystem-specific checklists for high-quality AI code generation.
ark-sdk-development
mckinsey
Regenerate and debug types across the ARK stack (SDK, API, Dashboard). Use when fixing TypeScript type errors in ark-dashboard, updating types after CRD changes, regenerating types.ts from OpenAPI spec, debugging "Property does not exist on type" schema errors, or adding custom SDK functionality via overlays. Covers the full type pipeline from Kubernetes CRDs to TypeScript.
effect-patterns-domain-modeling
PaulJPhilp
Effect-TS patterns for Domain Modeling. Use when working with domain modeling in Effect-TS applications.