Enterprise-grade AI coding agent system with modular architecture.
Pi Agent is an autonomous AI orchestrator for software development, featuring:
- 5-Phase Workflow: Context retrieval → Analysis → Prototyping → Implementation → Audit
- Multi-Model Orchestration: Seamless integration with Claude, Gemini, and specialized tools
- Modular Architecture: 30+ skills, 10+ extensions, 15+ subagents
- Enterprise Protocols: Code sovereignty, sandbox security, SSOT documentation
# Initialize documentation structure
cd /path/to/your/project
bun ~/.pi/agent/skills/workhub/lib.ts init
# Use workflow commands
/scout authentication flow # Fast code reconnaissance
/analyze database schema # Deep analysis
/brainstorm caching strategy # Design explorationPi Agent
├── Core System
│ ├── 5-Phase Workflow (Context → Analysis → Prototype → Implement → Audit)
│ ├── Multi-Model Orchestration (Claude, Gemini, specialized tools)
│ └── Enterprise Protocols (Code sovereignty, sandbox security)
│
├── Extensions (10+) → UI/UX enhancements, custom commands
├── Skills (30+) → Reusable capabilities (search, docs, tools)
├── Agents (15+) → Specialized subagents (scout, planner, reviewer)
└── Prompts (6) → Workflow templates
UI/UX enhancements and custom commands. → Details
Core Extensions:
answer.ts- Interactive Q&A TUI (Ctrl+.)qna.ts- Editor Q&A extraction (Ctrl+,)continue.ts- Quick continue dialog (Ctrl+Option+C)handoff.ts- Context handoff to new sessionsubagent/- Delegate tasks to specialized agentsgames/- Mini-games framework (Snake, 2048, Tetris, etc.)
Tool Extensions:
git-commit.ts- Auto git commitworkflow-commands.ts- Workflow commands (/scout,/analyze, etc.)insights-*.ts- Session insights and reportssafety-gates.ts- Safety checks before destructive operations
Reusable capabilities for code search, documentation, and tools. → Details
Code Search & Analysis:
ace-tool- Semantic code searchast-grep- AST-aware code search/rewritecodemap- Code flow visualization
Documentation & Knowledge:
workhub- Documentation management (Issues/PRs)deepwiki- GitHub repository docscontext7- GitHub Issues/PRs searchknowledge-base- Knowledge management system
Web & Search:
tavily-search-free- Real-time web searchexa- High-quality web searchweb-browser- Browser automation (Chrome DevTools Protocol)
Development Tools:
tmux- Terminal session managementproject-planner- Project planning & documentationsystem-design- Architecture design (EventStorming)improve-skill- Improve/create skills from sessions
Specialized:
office-combo- Microsoft Office support (Excel, PPT, PDF, Word)har-to-vue- Convert HAR files to Vue codesvg-logo-generator- Generate SVG logosmcp-to-skill- Wrap MCP servers as skills
→ Full skill list with descriptions
Specialized subagents for different tasks. → Details
Core Agents:
scout- Fast code reconnaissance (read-only)worker- Deep analysis and implementationplanner- 5-phase task planningreviewer- Code review and quality assurancebrainstormer- Design exploration and ideationvision- Visual analysis (images, videos, OCR, UI/UX)
Specialized:
security-reviewer- Security auditsimplifier- Code simplificationsystem-design- Architecture design
Workflow templates for different scenarios. → Details
init.md- Initial session setuphandoff.md- Context handoff between sessionsscout-and-plan.md- Reconnaissance and planningimplement.md- Implementation workflowimplement-and-review.md- Implementation with reviewcheck-progress.md- Progress checking
graph LR
A[Phase 1: Context Retrieval] --> B[Phase 2: Analysis]
B --> C[Phase 3: Prototyping]
C --> D[Phase 4: Implementation]
D --> E[Phase 5: Audit]
Phase 1: Context Retrieval (Mandatory)
- Tools:
ace-tool(semantic) /ast-grep(AST) /rg(exact match) - Strategy: Natural language queries, recursive retrieval
- Output: Complete code definitions
Phase 2: Analysis & Planning (Complex tasks only)
- Model: Gemini
- Input: Raw requirements
- Output: Step-by-step plan with pseudocode
Phase 3: Prototyping (Mandatory)
- Route A (Frontend/UI): Gemini → Unified Diff
- Route B (Backend/Logic): Gemini → Unified Diff
- Constraint: NO file writes, diff only
Phase 4: Implementation (Mandatory)
- Refactor prototype to production code
- Remove redundancy, optimize efficiency
- Minimal scope, audit side effects
Phase 5: Audit & Delivery (Mandatory)
- Automated code review (Codex/Gemini)
- Delivery after audit passes
| Command | Purpose | Agent |
|---|---|---|
/scout <query> |
Fast code reconnaissance | scout |
/analyze <topic> |
Deep code analysis | worker |
/brainstorm <idea> |
Design exploration | brainstormer |
/research <topic> |
Parallel research | multi-tool |
- External AI code is reference only
- Must refactor to clean, efficient enterprise code
- All changes via Unified Diff Patch
- External models cannot write directly
- Human-in-the-loop for all modifications
- Mandatory Phase 5 audit
- One authoritative source per knowledge domain
- Reference over copy
- File system as memory
- Information-dense documentation
- Reference links instead of duplication
- Context holds paths, files hold content
# ✅ Correct
cd /path/to/your/project
bun ~/.pi/agent/skills/workhub/lib.ts create issue "Task"
# ❌ Wrong (stores docs in wrong location)
~/.pi/agent/skills/workhub/lib.ts create issue "Task"- ace-tool: Semantic search (concepts, functionality)
- ast-grep: AST-aware search (patterns, structures)
- rg (ripgrep): Exact identifier/literal matches
- fd: File/directory search (faster than
find)
- Create Issue before starting
- Update Issue status during execution
- Create PR after completion
- Link PR to Issue
- AI-generated code is reference only
- Must refactor to clean, efficient code
- Apply design patterns and best practices
- Long compilation/build tasks
- Interactive programs (Python REPL, gdb)
- Background services (dev servers, databases)
- Real-time monitoring tasks
| File | Purpose |
|---|---|
APPEND_SYSTEM.md |
System prompt (agent instructions) |
docs/system/SYSTEM.md |
Detailed protocols and workflow |
settings.json |
Agent settings |
models.json |
Model configurations |
auth.json |
Authentication credentials |
docs/
├── system/ # System protocol documents
│ ├── SYSTEM.md # Current system protocol
│ └── VERSIONS.md # Version history
├── guides/ # Usage guides
├── knowledge/ # Knowledge base
├── issues/ # Task tracking (workhub)
└── pr/ # Change logs (workhub)
/scout authentication flow
# Returns:
# - Relevant files with line ranges
# - Key functions and interfaces
# - Architecture overview/analyze database schema
# Returns:
# - Complete architecture analysis
# - Pattern identification
# - Dependency mapping
# - Improvement recommendations/brainstorm caching strategy
# Returns:
# - Multiple design approaches
# - Trade-off analysis
# - Implementation considerations- System Prompt: APPEND_SYSTEM.md - Agent instructions and protocols
- Workflow Guide: docs/system/SYSTEM.md - Detailed workflow and protocols
- Extensions Guide: extensions/README.md - Extension development
- Agent Examples: agents/README-EXAMPLES.md - Agent usage patterns
- Skills Documentation: skills/ - Individual skill docs
Enterprise-grade AI Agent system for professional software development.