Demo Setup
Documentsdemo-setupDemo Setup is an Agent Skill for documents published in the Dicklesworthstone/pi_agent_rust repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Set up demo environments for Pi extensions to record videos or screenshots for the Pi package browser. Use when preparing a demo, recording a video, or creating preview assets for an extension or theme.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/Dicklesworthstone/pi_agent_rust/blob/HEAD/tests/ext_conformance/artifacts/npm/aliou-pi-extension-dev/skills/demo-setup/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/demo-setup, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Demo Setup
Set up self-contained demo directories for Pi extensions. The demo directory contains everything needed to showcase an extension: a prompt that runs through the features, fixture files, and pi configuration.
Pi Package Browser
The Pi website has a package browser at buildwithpi.ai/packages. Packages can display preview media.
Adding Preview Media to package.json
{
"pi": {
"extensions": ["./index.ts"],
"video": "https://example.com/demo.mp4",
"image": "https://example.com/preview.png"
}
}
Both video and image are optional. Video takes precedence when present.
Video/Image Specs
- Aspect ratio: 16:9 (enforced by
aspect-ratio: 16/9CSS) - Recommended resolution: 1920x1080
- Object fit:
containon black background - Modal max width: 900px
- Format:
.mp4for video,.png/.jpg/.jpeg/.webp/.giffor image - Caching: Client-side localStorage, 15-minute TTL. New visitors or cleared cache see updates immediately.
For Themes
Themes show better as images (screenshots of dark and light variants side by side). A single 16:9 image with both variants is ideal.
Demo Directory Structure
<demo-dir>/
├── .pi/
│ ├── settings.json # Registers the extension as a local path
│ ├── prompts/
│ │ └── demo.md # The /demo prompt
│ └── extensions/
│ └── <name>.json # Extension config overrides (if needed)
├── AGENTS.md # Agent instructions (if needed)
└── <fixture files> # Supporting files the demo needs
Setup Workflow
1. Detect the Extension
Check package.json in the target directory for a pi key with extensions, themes, or skills. Read the README and source to understand what the extension provides: tools, commands, hooks, providers, themes.
2. Create Demo Directory
demo_dir=$(mktemp -d)
mkdir -p "$demo_dir/.pi/prompts"
3. Register the Extension
Create .pi/settings.json pointing to the extension's absolute path:
{
"packages": [
"/absolute/path/to/extension"
],
"defaultThinkingLevel": "off"
}
Use defaultThinkingLevel: "off" to keep responses fast and visible during demos.
4. Write the Demo Prompt
Create .pi/prompts/demo.md. Structure it as numbered steps, one feature per step. Each step should produce visible output.
---
description: Showcase the <extension-name> extension
---
Demo the <extension-name> extension. Do each step one at a time.
## 1. <Feature Name>
<What to do and what it demonstrates.>
## 2. <Next Feature>
...
5. Add Fixture Files
Create any files the demo needs to function. Examples by extension type:
Hook-based extensions (e.g., guardrails):
.envwith fake secrets (to trigger env file protection).env.example(to show allowed patterns).pi/extensions/<name>.jsonwith feature toggles enabled
Tool-based extensions (e.g., processes, linkup):
- Fake project files (package.json, scripts/) that the tools operate on
AGENTS.mdinstructing the agent to use the extension's tools
Provider extensions (e.g., synthetic):
- No fixtures needed; demo is interactive (
/model, send message,/quotas)
Theme packages:
- No fixtures needed; demo switches themes and writes a code file for syntax highlighting
6. Add AGENTS.md (if needed)
When the agent needs specific behavior during the demo (e.g., always use background processes, never run servers in foreground), add an AGENTS.md.
Demo Prompt Patterns by Extension Type
Extensions with Hooks
Trigger each hook by running commands that match hook patterns. Include both blocked and allowed cases.
Extensions with Tools
Call each tool with representative inputs. Show the tool's output rendering.
Extensions with Commands
Run each command (e.g., /extension:command) to show the interactive UI.
Extensions with Providers
- Switch to the provider:
/model <provider> - Send a test message
- Show provider-specific commands (quotas, usage, balance)
- If the provider has tools (web search), use them
- Switch back to default provider
Themes
- Switch to the theme:
/theme <name> - Write a code file to show syntax highlighting
- If there are variants (light/dark), switch between them
Output
After creating the demo directory, print the path and instructions:
Demo ready at: <path>
cd <path>
pi
Then type /demo to start.