| name | Governance |
| description | Organizational governance for PAI agent infrastructure โ budget controls, approval gates, goal ancestry, org chart visualization, standing orders, config portability, workspaces, and task locking. USE WHEN user mentions budget, spending, approval, governance, org chart, goals, standing orders, heartbeat, export config, import config, workspace, task lock, OR organizational management. |
Governance
Organizational intelligence for PAI, cherry-picked from Paperclip's zero-human-company model and adapted for CLI-first personal AI infrastructure.
Workflow Routing
| Action | Trigger | Tool/Config |
|---|
| Budget Review | "budget report", "agent spending", "cost tracking" | tools/BudgetReport.ts |
| Org Chart | "org chart", "show team", "agent hierarchy" | tools/OrgChart.ts |
| Goal Management | "goals", "goal context", "why are we doing this" | tools/GoalManager.ts |
| Approval Check | "approval needed", "can I deploy", "governance gate" | tools/ApprovalGate.ts |
| Standing Orders | "standing orders", "heartbeat", "scheduled agents" | tools/StandingOrders.ts |
| Config Export | "export config", "backup PAI", "portable config" | tools/ConfigExport.ts |
| Config Import | "import config", "restore PAI", "load config" | tools/ConfigImport.ts |
| Task Locking | "lock task", "task checkout", "atomic task" | tools/TaskLock.ts |
Features
1. Budget Controls
Track and limit per-agent spending with cost estimates based on model pricing.
bun tools/BudgetReport.ts
bun tools/BudgetReport.ts --budget
bun tools/BudgetReport.ts --agent hiram --period week
Config: config/budgets.yml โ per-agent monthly limits with alert thresholds.
2. Approval Gates
Human-in-the-loop governance for high-impact actions via Telegram.
bun tools/ApprovalGate.ts check deploy --agent hiram
bun tools/ApprovalGate.ts request deploy --agent hiram --action "Push to carbene.ai production"
bun tools/ApprovalGate.ts list
Config: config/approvals.yml โ gate definitions with Telegram integration.
3. Goal Ancestry
Every task traces back to a company goal. Provides "why" context for agent prompts.
bun tools/GoalManager.ts list
bun tools/GoalManager.ts trace P4
bun tools/GoalManager.ts context P1
Config: goals/goals.yml โ goal hierarchy with projects.
4. Org Chart Visualization
Auto-generated Mermaid diagram from agent configurations.
bun tools/OrgChart.ts
bun tools/OrgChart.ts --output svg --save org-chart.svg
5. Standing Orders (Heartbeat)
Recurring agent tasks executed on schedules โ the PAI version of Paperclip's heartbeat engine.
bun tools/StandingOrders.ts list
bun tools/StandingOrders.ts enable daily-security-check
bun tools/StandingOrders.ts run friday-retro
bun tools/StandingOrders.ts sync
Config: config/standing-orders.yml โ agent schedules with goal links.
6. Config Export/Import
Portable, sanitized PAI configuration bundles for backup and sharing.
bun tools/ConfigExport.ts --output ~/exports/pai-config.tar.gz
bun tools/ConfigImport.ts pai-config.tar.gz --dry-run
bun tools/ConfigImport.ts pai-config.tar.gz --merge
7. Multi-Workspace Isolation
Group agents, budgets, and goals by business domain.
Config: config/workspaces.yml โ workspace definitions mapping agents to goals with budget pools.
8. Atomic Task Checkout
File-based locking prevents two agents from claiming the same task.
bun tools/TaskLock.ts acquire TASK-001 --agent hiram
bun tools/TaskLock.ts release TASK-001 --agent hiram
bun tools/TaskLock.ts status TASK-001
bun tools/TaskLock.ts cleanup --stale 30
Architecture
Governance/
โโโ SKILL.md # This file
โโโ tools/
โ โโโ OrgChart.ts # Mermaid org chart generator
โ โโโ BudgetReport.ts # Cost tracking and budget comparison
โ โโโ GoalManager.ts # Goal hierarchy management
โ โโโ ApprovalGate.ts # Telegram-based approval gates
โ โโโ StandingOrders.ts # Heartbeat/recurring agent tasks
โ โโโ ConfigExport.ts # Portable config export
โ โโโ ConfigImport.ts # Config import with merge
โ โโโ TaskLock.ts # Atomic task checkout
โโโ config/
โ โโโ budgets.yml # Per-agent spend limits
โ โโโ approvals.yml # Approval gate definitions
โ โโโ standing-orders.yml # Recurring agent schedules
โ โโโ workspaces.yml # Workspace isolation
โโโ reference/
โโโ PaperclipInspiration.md # Design decisions and Paperclip comparison
Design Principles
- CLI-first โ Every feature is a TypeScript CLI tool (PAI Constitution Principle 8)
- File-based state โ No database required; YAML configs and file locks
- Telegram-native governance โ Approvals via existing Telegram bot infrastructure
- Goal-aware โ Every agent action can trace back to a company objective
- Sanitize by default โ Config exports strip secrets automatically
- Composable โ Each tool works independently; combine via shell pipelines
Examples
Example 1: Morning governance check
User: "How are we doing on budgets this month?"
โ Runs BudgetReport.ts --budget
โ Shows per-agent spend vs limits
โ Flags any agents approaching thresholds
Example 2: Pre-deploy approval
User: "Deploy carbene.ai changes"
โ ApprovalGate.ts check deploy --agent hiram
โ Gate triggered โ sends Telegram approval request
โ Waits for the user's "approve" reply
โ Proceeds with deployment
Example 3: Why are we doing this?
User: "What goal does the trading system serve?"
โ GoalManager.ts trace P7
โ "P7 (Joseph Trading System) โ G3 (Generate investment returns via automated trading)"
โ Provides full context for decision-making