### Copy Example Configuration
Source: https://github.com/dwsy/agent/blob/main/pi-gateway/docs/guides/configuration.md
Use this command to copy the example configuration file to start your own.
```bash
cp pi-gateway.jsonc.example pi-gateway.jsonc
```
--------------------------------
### Example: Onboarding Knowledge Base
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/README.md
An example of creating an onboarding knowledge base for new team members. The prompt specifies requirements such as project architecture, development workflow, setup guides, and coding standards, with custom settings for iterations and completion promise.
```bash
knowledge-builder "Create an onboarding knowledge base for new team members.
Requirements:
- Explain project architecture
- Document development workflow
- Create setup guides
- Explain coding standards
- Document common tasks
- Provide troubleshooting tips
Make it comprehensive for someone completely new to the project.
Output ONBOARDING_COMPLETE" \
--tmux \
-m 75 \
-p "ONBOARDING_COMPLETE"
```
--------------------------------
### Environment Setup Commands
Source: https://github.com/dwsy/agent/blob/main/web-ui/README.md
Commands for cloning, installing, and building the project.
```bash
# 克隆仓库
git clone https://github.com/badlogic/pi-mono
cd pi-mono
# 安装依赖
bun install
# 构建现有包
bun run build
```
```bash
# 启动后端(终端 1)
bun run dev --mode web --port 3721
# 启动前端(终端 2)
cd packages/web-ui-app
bun run dev
# 访问
open http://localhost:5173
```
--------------------------------
### Start Game Commands
Source: https://github.com/dwsy/agent/blob/main/game/IMPLEMENTATION_SUMMARY.md
Examples of how to launch specific games using command-line interface.
```bash
# 贪吃蛇
/game:snake
```
```bash
# 俄罗斯方块
/game:tetris
```
--------------------------------
### Development Commands
Source: https://github.com/dwsy/agent/blob/main/landing-page/README.md
Commands for installing dependencies and starting the development server.
```bash
cd landing-page
bun install
bun run dev
```
--------------------------------
### Development Workflow Example
Source: https://github.com/dwsy/agent/blob/main/skills/tmux/README.md
Demonstrates starting multiple services and tasks for a development workflow using the tmux skill. After starting, the TUI can be used for management.
```bash
bun ~/.pi/agent/skills/tmux/lib.ts create dev-server "npm run dev" service
```
```bash
bun ~/.pi/agent/skills/tmux/lib.ts create build-watch "npm run build:watch" task
```
```bash
bun ~/.pi/agent/skills/tmux/lib.ts create test-runner "npm run test:watch" task
```
```bash
bun ~/.pi/agent/skills/tmux/tui.ts
```
--------------------------------
### Pi Agent Quick Start Commands
Source: https://github.com/dwsy/agent/blob/main/README.md
Examples of using Pi Agent's workflow commands for code reconnaissance, analysis, and design. Also includes starting the multi-channel gateway.
```bash
/scout authentication flow # Fast code reconnaissance
/analyze database schema # Deep analysis
/brainstorm caching strategy # Design exploration
```
```bash
cd ~/.pi/agent/pi-gateway && bun install && bun run start
```
--------------------------------
### Login Flow Example
Source: https://github.com/dwsy/agent/blob/main/skills/web-browser/COMPLETION_REPORT.md
Demonstrates a typical login sequence using various agent scripts. Ensure the agent is started before executing navigation and interaction commands.
```bash
node scripts/start.js
node scripts/nav.js https://example.com/login
node scripts/type.js "#username" "john@example.com"
node scripts/type.js "#password" "secret123" --clear
node scripts/click.js "#login-button"
node scripts/wait-for.js text "Welcome"
node scripts/screenshot.js
node scripts/stop.js
```
--------------------------------
### Example: Document a React Project
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/README.md
Demonstrates starting the Knowledge Builder with a detailed prompt for a React project, specifying requirements for documentation and setting custom max iterations and a completion promise.
```bash
knowledge-builder "Build a comprehensive knowledge base for my React project.
Requirements:
- Document all components
- Explain state management patterns
- Document API integrations
- Create guides for common workflows
- Record architectural decisions
Process:
1. Scan the codebase
2. Identify key concepts
3. Create concept documents
4. Write guides
5. Document decisions
6. Generate index
Output KNOWLEDGE_BASE_COMPLETE" \
--tmux \
-m 50 \
-p "KNOWLEDGE_BASE_COMPLETE"
```
--------------------------------
### Network Monitoring Example
Source: https://github.com/dwsy/agent/blob/main/skills/web-browser/README.md
Shows how to start, stop, and export network requests made by the browser.
```bash
# Start browser
node scripts/start.js
# Start network monitoring
node scripts/network.js start
# Navigate to page
node scripts/nav.js https://example.com
# Stop monitoring and view results
node scripts/network.js stop
# Export requests
node scripts/network.js export requests.json
# Stop browser
node scripts/stop.js
```
--------------------------------
### Quick Start Commands for agent-browser
Source: https://github.com/dwsy/agent/blob/main/skills/agent-browser/SKILL.md
A concise set of commands to quickly get started with common browser automation tasks like opening URLs, taking snapshots, clicking elements, filling forms, and closing the browser.
```bash
agent-browser open # Navigate to page
agent-browser snapshot -i # Get interactive elements with refs
agent-browser click @e1 # Click element by ref
agent-browser fill @e2 "text" # Fill input by ref
agent-browser close # Close browser
```
--------------------------------
### Install Dependencies
Source: https://github.com/dwsy/agent/blob/main/skills/tmux/FINAL_SUMMARY.md
Navigate to the project directory and install required dependencies using bun.
```bash
cd ~/.pi/agent/skills/tmux
bun install
```
--------------------------------
### Full Gateway Configuration Example
Source: https://github.com/dwsy/agent/blob/main/pi-gateway/docs/guides/telegram.md
A comprehensive example demonstrating multiple features including audio providers, group settings, and stream modes.
```jsonc
{
"channels": {
"telegram": {
"enabled": true,
"botToken": "${TELEGRAM_BOT_TOKEN}",
"dmPolicy": "pairing",
"allowFrom": [123456789],
"streamMode": "partial",
"replyToMode": "first",
"mediaMaxMb": 10,
"audio": {
"provider": "groq",
"apiKey": "${GROQ_API_KEY}",
"language": "en"
},
"groups": {
"-1001234567890": {
"requireMention": true,
"role": "team-helper",
"groupPolicy": "open"
}
}
}
}
}
```
--------------------------------
### Start pi-gateway
Source: https://github.com/dwsy/agent/blob/main/pi-gateway/README.md
Initialize the gateway environment and start the server on a specified port.
```bash
cd pi-gateway
bun install
bun run src/cli.ts gateway --port 18800
# Open http://localhost:18800
```
--------------------------------
### Run Demo Script
Source: https://github.com/dwsy/agent/blob/main/skills/web-browser/SKILL.md
Execute the demo script to verify the web browser skill is functioning correctly. No specific setup is required beyond having Node.js installed.
```bash
node demo.js
```
--------------------------------
### Install AST-Grep
Source: https://github.com/dwsy/agent/blob/main/skills/ast-grep/SKILL.md
Commands to install the tool on macOS or Linux and verify the installation.
```bash
# macOS
brew install ast-grep
# Linux
cargo install ast-grep
# 验证安装
ast-grep --version
```
--------------------------------
### Install @remotion/media package
Source: https://github.com/dwsy/agent/blob/main/skills/remotion-best-practices/rules/audio.md
Use the appropriate package manager command to install the required media dependency.
```bash
npx remotion add @remotion/media # If project uses npm
bunx remotion add @remotion/media # If project uses bun
yarn remotion add @remotion/media # If project uses yarn
pnpm exec remotion add @remotion/media # If project uses pnpm
```
--------------------------------
### Example AI Query for In-Progress Frontend Tasks
Source: https://github.com/dwsy/agent/blob/main/skills/workhub/UPDATE_SUMMARY.md
This example shows how to find all frontend tasks that are currently in progress.
```bash
# 查找所有进行中的前端任务
# 查询: category: "前端" AND status: "in-progress"
```
--------------------------------
### Install @remotion/transitions package
Source: https://github.com/dwsy/agent/blob/main/skills/remotion-best-practices/rules/transitions.md
Commands to install the transitions package using various package managers.
```bash
npx remotion add @remotion/transitions # If project uses npm
bunx remotion add @remotion/transitions # If project uses bun
yarn remotion add @remotion/transitions # If project uses yarn
pnpm exec remotion add @remotion/transitions # If project uses pnpm
```
--------------------------------
### CLI Quick Start for Ralph
Source: https://github.com/dwsy/agent/blob/main/extensions/ralph/README.md
Starts Ralph directly from the command line with specified prompt file, max iterations, and promise tag.
```bash
pi --ralph PROMPT.md --ralph-max 50 --ralph-promise "DONE"
```
--------------------------------
### Jina Reader Usage Examples
Source: https://github.com/dwsy/agent/blob/main/skills/jina-reader/SKILL.md
Practical examples for reading specific URLs and searching the web with custom parameters.
```bash
bun scripts/reader.ts read "https://docs.jina.ai"
bun scripts/reader.ts search "AI news" --count 5 --site arxiv.org
bun scripts/reader.ts read "https://example.com" --selector ".article" --format json
```
--------------------------------
### Start Pi with Session Fork Slim Extension
Source: https://github.com/dwsy/agent/blob/main/extensions/session-fork-slim/README.md
Load the Session Fork Slim extension when starting Pi to enable its functionality.
```bash
pi -e ~/.pi/agent/extensions/session-fork-slim
```
--------------------------------
### Quick Start Build and Run Instructions
Source: https://github.com/dwsy/agent/blob/main/test/todolist/VERIFICATION_REPORT.md
Provides step-by-step instructions to build and run the TodoList application from the command line, including navigating to the project directory and entering the password.
```bash
# Navigate to project
cd ./test/todolist
# Build
make
# Run
./todolist
# Enter password: 123456
# Start using the todo list!
```
--------------------------------
### Sample SKILL.md for a Security Review Skill
Source: https://github.com/dwsy/agent/blob/main/skills/creatorskill/SKILL.md
This is an example of a generated SKILL.md file for a skill that reviews staged git changes. It includes frontmatter, purpose, setup, workflow, and examples.
```markdown
---
name: security-review
description: Review staged git changes for security issues and suggest concise remediation steps. Use when you want an automated checklist and file-level recommendations for changed files.
---
# Security Review
## Purpose
Quickly identify security-relevant changes in staged files and provide prioritized remediation suggestions.
## Setup
No one-time setup required. (If helper scripts are included, document how to run them.)
## Workflow
1. List staged files and their diffs.
2. For each file, check for secrets, insecure patterns, and risky configuration changes.
3. Produce a short summary and per-file remediation steps.
## Examples
- ./scripts/check_secrets.sh (run locally after review)
```
--------------------------------
### Use Case: Onboarding Kit
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/SUMMARY.md
Example for creating onboarding materials, setting a high iteration count and running in tmux.
```bash
knowledge-builder "Create onboarding materials" --tmux -m 80
```
--------------------------------
### Manage Pi Gateway
Source: https://github.com/dwsy/agent/blob/main/README.md
Commands for installing, starting, and maintaining the Pi Gateway service.
```bash
cd pi-gateway
bun install
bun run start # Start gateway (default port 18800)
bun run dev # Start with hot-reload
bun run src/cli.ts doctor # Health check
bun run src/cli.ts config show # Show current config
```
--------------------------------
### Initialize Project Structure
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/TEST.md
Creates the directory hierarchy for components, services, and supporting files.
```bash
mkdir -p src/{components/{auth,products,cart,checkout},services/{auth,products,cart,payment},hooks,utils,store,types}
```
--------------------------------
### Manage Ralph Loops
Source: https://github.com/dwsy/agent/blob/main/extensions/ralph/README.md
Commands to manage the Ralph loop, including starting from a file, canceling, and getting help.
```bash
# Start from a prompt file
/ralph-loop --file PROMPT.md --max-iterations 20
```
```bash
# Cancel active loop
/cancel-ralph
```
```bash
# Get help
/ralph-help
```
--------------------------------
### Start the Browser
Source: https://github.com/dwsy/agent/blob/main/skills/web-browser/README.md
Initialize the browser instance. Use the --chrome flag to specify Google Chrome instead of the default Chromium.
```bash
cd ~/.pi/agent/skills/web-browser
# Start Chromium with persistent storage (default)
node scripts/start.js
# Use Google Chrome instead of Chromium
node scripts/start.js --chrome
```
--------------------------------
### Start Development Server
Source: https://github.com/dwsy/agent/blob/main/web-ui/TASKS.md
Launch the frontend development server for the web UI application. This command should be run from the `packages/web-ui-app` directory.
```bash
cd packages/web-ui-app
bun run dev
```
--------------------------------
### Start Knowledge Builder for React Project
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/EXAMPLES.md
Initializes the documentation process for a React e-commerce application with specific requirements and a completion promise.
```bash
cd ~/projects/my-ecommerce-app
knowledge-builder "Build a comprehensive knowledge base for my React e-commerce project.
Requirements:
- Document all React components
- Explain state management with Redux
- Document API integrations (products, cart, checkout)
- Create guides for common workflows
- Record architectural decisions
- Document authentication flow
- Explain payment integration
- Create troubleshooting guides
Process:
1. Scan the codebase
2. Identify key concepts (components, hooks, services)
3. Create concept documents for all major components
4. Write guides for common workflows (add to cart, checkout, etc.)
5. Document API endpoints and their usage
6. Record architectural decisions
7. Generate comprehensive index
Make sure the knowledge base is complete enough for a new developer to understand the entire system.
Output KNOWLEDGE_BASE_COMPLETE" \
--tmux \
--session ecommerce \
-m 100 \
-p "KNOWLEDGE_BASE_COMPLETE"
```
--------------------------------
### Usage Example: Get Audio Duration
Source: https://github.com/dwsy/agent/blob/main/skills/remotion-best-practices/rules/get-audio-duration.md
Demonstrates how to call the `getAudioDuration` function and log the result to the console. Assumes the function is defined elsewhere.
```typescript
const duration = await getAudioDuration("https://remotion.media/audio.mp3");
console.log(duration); // e.g. 180.5 (seconds)
```
--------------------------------
### Scout Output Format
Source: https://github.com/dwsy/agent/blob/main/docs/agents/QUICK-REF.md
Example of the output format for the Scout agent, including retrieved files, key code snippets, architecture explanation, and starting points.
```markdown
## Files Retrieved
1. `path/to/file.ts` (10-50行) - 描述
## Key Code
```typescript
code here
```
## Architecture
架构说明
## Where to Start
从哪里开始
```
--------------------------------
### Background Task Example
Source: https://github.com/dwsy/agent/blob/main/skills/tmux/README.md
Starts a long-running background task, such as model training, using the tmux skill. You can later list sessions or capture output to check progress.
```bash
bun ~/.pi/agent/skills/tmux/lib.ts create training "python train.py" task
```
```bash
bun ~/.pi/agent/skills/tmux/lib.ts list
```
```bash
bun ~/.pi/agent/skills/tmux/lib.ts capture pi-task-training-20250107-123456
```
--------------------------------
### Use Case: Project Documentation
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/SUMMARY.md
Example of initiating project documentation generation with specific parameters for iterations and tmux mode.
```bash
knowledge-builder "Document my React project" --tmux -m 50
```
--------------------------------
### Command Usage Hint Example
Source: https://github.com/dwsy/agent/blob/main/extensions/hash-trigger/docs/01-INTERCEPTOR.md
Shows how the system provides hints for command usage and parameters.
```text
用户输入: #file
显示提示: #file [--preview] [--edit]
```
--------------------------------
### Network Monitoring Example
Source: https://github.com/dwsy/agent/blob/main/skills/web-browser/COMPLETION_REPORT.md
Shows how to monitor network requests during a browsing session. The script starts network monitoring, navigates to a URL, stops monitoring, and then exports the captured requests to a JSON file.
```bash
node scripts/start.js
node scripts/network.js start
node scripts/nav.js https://example.com
node scripts/network.js stop
node scripts/network.js export requests.json
node scripts/stop.js
```
--------------------------------
### Create Onboarding Knowledge Base
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/EXAMPLES.md
Sets up the Knowledge Builder to generate a comprehensive onboarding guide for new team members.
```bash
cd ~/projects/my-app
knowledge-builder "Create an onboarding knowledge base for new team members.
Requirements:
- Project overview and architecture
- Technology stack and why it was chosen
- Setup instructions for local development
- Development workflow and conventions
- Git workflow and branching strategy
- Code review guidelines
- Testing practices
- Deployment process
- Common tasks and how to do them
- Troubleshooting common issues
- Team structure and contact information
- Documentation links and resources
Make it comprehensive enough that a new developer can be productive within their first week.
Output ONBOARDING_KIT_COMPLETE" \
--tmux \
--session onboarding \
-m 80 \
-p "ONBOARDING_KIT_COMPLETE"
```
--------------------------------
### Install Evolution Skill Hooks
Source: https://github.com/dwsy/agent/blob/main/skills/evolution/SKILL.md
Set up automatic triggering of the evolution skill using Pi Agent's hooks system. This example shows how to monitor tool results, session shutdowns, and context changes.
```typescript
import type { HookAPI } from "@mariozechner/pi-coding-agent/hooks";
export default function (api: HookAPI) {
// Monitor tool results for error detection
api.on("tool_result", async (event, ctx) => {
if (event.tool === "bash") {
await detectErrorPatterns(event, ctx);
}
});
// Monitor session end for learning capture
api.on("session", async (event, ctx) => {
if (event.reason === "shutdown") {
await promptLearningCapture(ctx);
}
});
// Monitor context for new patterns
api.on("context", async (event, ctx) => {
await detectNewPatterns(event, ctx);
});
}
```
--------------------------------
### Generate API Documentation
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/README.md
Creates complete API documentation including endpoints, schemas, authentication, error codes, rate limiting, examples, and integration guides. Utilizes tmux mode, sets iterations, and defines a completion marker.
```bash
knowledge-builder "Generate complete API documentation.
Include:
- All endpoints
- Request/response schemas
- Authentication methods
- Error codes
- Rate limiting
- Usage examples
- Integration guides
Make it production-ready."
--tmux \
-m 75 \
-p "API_DOCS_COMPLETE"
```
--------------------------------
### Starting a New Project with Simple Approach
Source: https://github.com/dwsy/agent/blob/main/skills/project-planner/SKILL.md
This approach is suitable for initiating projects where a high-level overview is sufficient initially. It focuses on gathering essential information to define core project documents.
```text
User: "I want to build an order flow trading automation system"
Response: "I'll help you create comprehensive planning documents for your trading system. Let me gather some key information:
1. Is this for personal use (single-user) or a multi-user platform?
2. Which markets/exchanges will it connect to?
3. What are the core trading strategies or patterns?
4. Any specific performance requirements (latency, throughput)?
Based on this, I'll generate:
- Requirements document with user stories
- System design with components and data flow
- Implementation plan with phases and tasks"
```
--------------------------------
### Create Onboarding Kit
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/README.md
Generates an onboarding knowledge base for new hires, covering project overview, architecture, setup, workflow, standards, tasks, troubleshooting, and contacts. Runs in tmux mode with specified iterations and a completion marker.
```bash
knowledge-builder "Create an onboarding knowledge base.
Include:
- Project overview
- Architecture diagrams
- Setup instructions
- Development workflow
- Coding standards
- Common tasks
- Troubleshooting guide
- Team contact information
Make it comprehensive for new hires."
--tmux \
-m 80 \
-p "ONBOARDING_KIT_COMPLETE"
```
--------------------------------
### Quick Start: Initialize and Render a Panel with a List
Source: https://github.com/dwsy/agent/blob/main/extensions/pi-tui-kit/README.md
This snippet demonstrates how to initialize a Panel with a title and borders, add a List component to it, and then render it within a custom TUI context. It shows basic setup for a TUI application using pi-tui-kit.
```typescript
import {
Panel, List, Button,
DefaultTheme, Borders
} from "pi-tui-kit";
const panel = new Panel({
title: "My App",
border: Borders.rounded,
theme: DefaultTheme
});
const list = new List({
items: [
{ id: "1", label: "Option 1" },
{ id: "2", label: "Option 2" },
],
onSelect: (item) => console.log(item.label)
});
panel.addChild(list);
await ctx.ui.custom((tui, theme, kb, done) => {
return {
render: (width) => panel.render(width),
handleInput: (data) => list.handleInput(data),
invalidate: () => panel.invalidate()
};
});
```
--------------------------------
### Quick Reference Commands
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/SUMMARY.md
Common commands for starting, monitoring, viewing, and managing documentation sessions.
```bash
knowledge-builder "" --tmux -m 50
```
```bash
knowledge-builder-manager status
```
```bash
tree docs/knowledge
```
```bash
knowledge-builder-manager kill
```
--------------------------------
### Manage Development Server with TUI
Source: https://github.com/dwsy/agent/blob/main/skills/tmux/TUI.md
Example of using the TUI to manage a development server. This involves creating a new session, specifying the command, and category. Subsequent actions include capturing output for logs, getting attach commands for interaction, and stopping the server.
```bash
# 启动 TUI/Launch TUI
bun ~/.pi/agent/skills/tmux/tui.ts
# 按 'n' 创建新会话/Press 'n' to create new session
# 名称/Name: dev-server
# 命令/Command: npm run dev
# 分类/Category: service
# 按 'c' 捕获输出查看日志/Press 'c' to capture output and view logs
# 按 'a' 获取 attach 命令进行交互式操作/Press 'a' to get attach command for interactive access
# 按 'k' 停止服务器/Press 'k' to stop server
```
--------------------------------
### Production Recommended Configuration Example
Source: https://github.com/dwsy/agent/blob/main/pi-gateway/docs/architecture/CRON-AND-CONFIG.md
A comprehensive JSON configuration example for a production environment, covering gateway, agent, heartbeat, cron jobs, and queue settings.
```jsonc
{
"gateway": { "port": 52134, "bind": "0.0.0.0" },
"agent": {
"model": "anthropic/claude-sonnet-4-20250514",
"pool": { "min": 2, "max": 4 }
},
"heartbeat": {
"enabled": true,
"every": "30m",
"activeHours": { "start": "08:00", "end": "23:00", "timezone": "Asia/Shanghai" }
},
"cron": {
"enabled": true,
"jobs": [
{
"id": "daily-report",
"schedule": { "kind": "cron", "expr": "0 9 * * *", "timezone": "Asia/Shanghai" },
"payload": { "text": "Generate daily status report." },
"delivery": "announce"
},
{
"id": "health-check",
"schedule": { "kind": "every", "expr": "1h" },
"payload": { "text": "Check system health." }
}
]
},
"queue": {
"mode": "collect",
"dedup": { "enabled": true }
}
}
```
--------------------------------
### Browser Management Examples
Source: https://github.com/dwsy/agent/blob/main/skills/web-browser/README.md
Commands for managing the browser lifecycle.
```bash
node scripts/start.js
```
```bash
node scripts/stop.js
```
```bash
node scripts/get-port.js
```
--------------------------------
### Install Bun on Windows
Source: https://github.com/dwsy/agent/blob/main/README.md
Installs Bun using a PowerShell script. Restart your terminal after installation.
```bash
powershell -c "irm bun.sh/install.ps1 | iex"
```
--------------------------------
### Format Input/Output Examples
Source: https://github.com/dwsy/agent/blob/main/skills/skill-creator/SKILL.md
Recommended pattern for demonstrating expected behavior in documentation.
```markdown
## Commit message format
**Example 1:**
Input: Added user authentication with JWT tokens
Output: feat(auth): implement JWT-based authentication
```
--------------------------------
### Install pi-rtk-optimizer via Git Repository
Source: https://github.com/dwsy/agent/blob/main/extensions/pi-rtk-optimizer/README.md
Install the extension directly from its Git repository using this command. Pi will manage the installation.
```bash
pi install git:github.com/MasuRii/pi-rtk-optimizer
```
--------------------------------
### Troubleshoot Tmux Installation
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/README.md
Verify and install tmux if it is missing from the environment.
```bash
# Check if tmux is installed
tmux -V
# Install if needed
brew install tmux # macOS
sudo apt-get install tmux # Ubuntu
```
--------------------------------
### Use Case: Microservices Documentation
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/SUMMARY.md
Example for documenting microservices, specifying a large number of iterations and using tmux for background execution.
```bash
knowledge-builder "Document microservices" --tmux -m 120
```
--------------------------------
### Custom Agent Full Configuration Example
Source: https://github.com/dwsy/agent/blob/main/docs/agents/QUICK-REF.md
Example of a complete agent configuration file, including name, description, version, tools, mode, and other metadata. System prompt content follows the frontmatter.
```markdown
---
name: custom-agent
description: Custom agent description
version: "1.0.0"
tools: read, bash, write, edit
mode: standard
category: general
requires_context: false
max_parallel: 1
model: claude-sonnet-4
provider: anthropic
showInTool: true
registerCommand: true
---
System prompt content...
```
--------------------------------
### Install @remotion/fonts
Source: https://github.com/dwsy/agent/blob/main/skills/remotion-best-practices/rules/fonts.md
Install the @remotion/fonts package using your project's package manager.
```bash
npx remotion add @remotion/fonts # If project uses npm
```
```bash
bunx remotion add @remotion/fonts # If project uses bun
```
```bash
yarn remotion add @remotion/fonts # If project uses yarn
```
```bash
pnpm exec remotion add @remotion/fonts # If project uses pnpm
```
--------------------------------
### Run Knowledge Builder (Quick Test)
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/TEST.md
Initializes the knowledge base and runs Knowledge Builder in foreground mode to generate documentation for a React e-commerce project. It specifies requirements for documentation and uses a completion promise for monitoring.
```bash
# Initialize knowledge base
bun ~/.pi/agent/skills/knowledge-base/lib.ts init
# Run Knowledge Builder (foreground mode for testing)
knowledge-builder "Build a knowledge base for this React e-commerce project.
Requirements:
- Document all components (App)
- Explain hooks (useAuth)
- Document API services
- Document utilities
- Create guides for common workflows
- Record architectural decisions
Keep it concise but comprehensive.
Output KNOWLEDGE_BASE_COMPLETE" \
-m 20 \
-p "KNOWLEDGE_BASE_COMPLETE"
```
--------------------------------
### Review and Iterate Documentation
Source: https://github.com/dwsy/agent/blob/main/extensions/knowledge-builder/SUMMARY.md
Verify generated files and re-run the builder if the documentation is incomplete.
```bash
# After completion, review
tree docs/knowledge
# If incomplete, run again
knowledge-builder "Continue building" --tmux -m 50
```
--------------------------------
### Install @remotion/google-fonts
Source: https://github.com/dwsy/agent/blob/main/skills/remotion-best-practices/rules/fonts.md
Install the @remotion/google-fonts package using your project's package manager.
```bash
npx remotion add @remotion/google-fonts # If project uses npm
```
```bash
bunx remotion add @remotion/google-fonts # If project uses bun
```
```bash
yarn remotion add @remotion/google-fonts # If project uses yarn
```
```bash
pnpm exec remotion add @remotion/google-fonts # If project uses pnpm
```
--------------------------------
### Launch Evaluation Viewer
Source: https://github.com/dwsy/agent/blob/main/skills/skill-creator/SKILL.md
Start the evaluation viewer server to review outputs and benchmark data. Use the --static flag for headless environments.
```bash
nohup python /eval-viewer/generate_review.py \
/iteration-N \
--skill-name "my-skill" \
--benchmark /iteration-N/benchmark.json \
> /dev/null 2>&1 &
VIEWER_PID=$!
```
--------------------------------
### Install @remotion/layout-utils
Source: https://github.com/dwsy/agent/blob/main/skills/remotion-best-practices/rules/measuring-text.md
Commands to install the layout utilities package using various package managers.
```bash
npx remotion add @remotion/layout-utils # If project uses npm
bunx remotion add @remotion/layout-utils # If project uses bun
yarn remotion add @remotion/layout-utils # If project uses yarn
pnpm exec remotion add @remotion/layout-utils # If project uses pnpm
```
--------------------------------
### Install React Best Practices via CLI
Source: https://github.com/dwsy/agent/blob/main/skills/react-best-practices/README.md
Use the Claude Code CLI to register the skill repository directly.
```bash
claude skills add https://github.com/michaelshimeles/react-best-practices
```
--------------------------------
### Verify Evolution Hook Installation
Source: https://github.com/dwsy/agent/blob/main/skills/evolution/README.md
Check if the evolution hook script is installed at the expected location.
```bash
ls -la ~/.pi/hooks/evolution.ts
```
--------------------------------
### Memory Quality Examples
Source: https://github.com/dwsy/agent/blob/main/extensions/role-persona/skills/memory-best-practices/SKILL.md
Examples of high-quality, actionable memories versus generic or temporary entries.
```text
✅ "MyBatis-Plus getOne needs .last('LIMIT 1') to avoid TooManyResultsException"
✅ "禁止 rm,优先 trash"
✅ "ACP: Agent 无状态,Client 持状态"
❌ "用户让我修了一个 bug" ← too generic
❌ "Error at /src/index.ts:42" ← copy-paste, no insight
❌ "服务器现在在 3000 端口" ← temporary state
```
--------------------------------
### Future Pipe Support Example
Source: https://github.com/dwsy/agent/blob/main/extensions/hash-trigger/docs/01-INTERCEPTOR.md
A conceptual example of how commands might be piped together in the future.
```text
#search auth | #file → 搜索后选择文件
```
--------------------------------
### Add Tailscale Devices (Common Scenarios - Bash)
Source: https://github.com/dwsy/agent/blob/main/skills/surge-manager/README.md
Examples demonstrating how to add Tailscale devices for direct connection using the Bash script. This includes both automatic and manual methods.
```bash
~/.pi/agent/skills/surge-manager/surge-config.sh add-tailscale
# or manually add specific device
~/.pi/agent/skills/surge-manager/surge-config.sh add-ip 100.89.35.126/32
~/.pi/agent/skills/surge-manager/surge-config.sh add-domain mbp.ts.net
```
--------------------------------
### Install Session Fork Slim Extension
Source: https://github.com/dwsy/agent/blob/main/extensions/session-fork-slim/README.md
Clone or copy the extension to your Pi extensions directory to install it.
```bash
# Clone or copy to extensions directory
git clone ~/.pi/agent/extensions/session-fork-slim
# Or manually:
cp -r session-fork-slim ~/.pi/agent/extensions/
```