PAI (Personal AI Infrastructure) is a template for building your own AI-powered operating system using Claude Code.
Core Primitives:
- Skills - Self-contained AI capabilities with routing, workflows, and documentation
- Agents - Specialized AI personalities for different tasks (engineer, researcher, designer, etc.)
- Hooks - Event-driven automation that captures work, provides voice feedback, and manages state
Philosophy: Start clean, small, and simple. Build the scaffolding that makes AI reliable.
PAI (this repository) provides:
- β Skills/agents/hooks architecture
- β CORE documentation and routing
- β History system (UOCS) for automatic documentation
- β Example skills (research, fabric, etc.)
- β Voice server skeleton
- βοΈ Requires: API key configuration per skill
Kai (Daniel's private system) adds:
- π Personal data, contacts, and history
- π Additional private skills and workflows
- π Customized agent personalities and voices
- π Production integrations and automations
Think of it this way: PAI is the scaffolding. You build your own "Kai" on top of it.
After setup, PAI should:
- β Execute hooks without errors
- β Load CORE context at session start
- β Route skills correctly
- β Capture session history
- β Launch agents successfully
Not working? Run the health check:
bun ~/.claude/hooks/self-test.tsSee PAI_CONTRACT.md for complete details on what's guaranteed vs what needs configuration.
# Install Bun (PAI's package manager)
curl -fsSL https://bun.sh/install | bash
# Install Claude Code
# Follow instructions at: https://code.claude.com# Clone the repository
git clone https://github.com/danielmiessler/Personal_AI_Infrastructure.git
cd Personal_AI_Infrastructure
# Copy environment template
cp .claude/.env.example .claude/.env
# Edit .env and add your API keys
# At minimum: ANTHROPIC_API_KEY=your_key_here# Copy .claude directory to your home directory
cp -r .claude ~/.claude
# Or symlink if you prefer
ln -s $(pwd)/.claude ~/.claude# PAI loads automatically via the CORE skill
claude-codeThat's it! The CORE skill loads at session start and provides all PAI functionality.
π For detailed setup: See docs/QUICKSTART.md
All documentation lives in the CORE skill (.claude/skills/CORE/):
- CONSTITUTION.md - System philosophy, architecture, and operating principles
- SKILL.md - Main PAI skill with identity, preferences, and quick reference
- SKILL-STRUCTURE-AND-ROUTING.md - How to create your own skills
- hook-system.md - Event-driven automation
- history-system.md - Automatic work documentation
- VOICE.md β voice-server/README.md - Text-to-speech feedback
- prosody-guide.md - Voice emotion system
- prompting.md - Prompt engineering patterns
- terminal-tabs.md - Terminal management
Explore example skills in .claude/skills/:
fabric/- Integration with Fabric pattern system (242+ AI patterns)research/- Multi-source research workflowscreate-skill/- Templates for creating new skillsalex-hormozi-pitch/- Business pitch generationffuf/- Web fuzzing and security testing
Each skill demonstrates the skills-as-containers pattern with routing, workflows, and self-contained documentation.
PAI is built on three foundational principles:
Build deterministic CLI tools, then wrap them with AI orchestration. Code is cheaper, faster, and more reliable than prompts.
Package domain expertise in self-activating, self-contained modules. Natural language triggers automatic routing to the right skill.
Load context only when needed (3 tiers):
- Tier 1: System prompt (always active, 200-500 words)
- Tier 2: SKILL.md (on-demand, comprehensive reference)
- Tier 3: Reference files (just-in-time, deep dives)
Complete architecture: See .claude/skills/CORE/CONSTITUTION.md
- Runtime: Bun (NOT Node.js)
- Language: TypeScript (NOT Python - we're TypeScript zealots)
- Package Manager: Bun (NOT npm/yarn/pnpm)
- Format: Markdown (NOT HTML for basic content)
- Testing: Vitest when needed
- Voice: ElevenLabs TTS integration
IMPORTANT: This is a PUBLIC template repository with sanitized examples.
DO NOT commit:
- API keys or secrets
- Personal email addresses or contact information
- Private repository references
- Any sensitive personal data
See SECURITY.md for complete security protocols.
- GitHub Issues: Report bugs or request features
- Discussions: Ask questions and share ideas
- Video: Watch PAI Overview
MIT License - see LICENSE file for details.
Built on Claude Code by Anthropic.
Inspired by the idea that AI systems need scaffolding to be reliable. This is that scaffolding.
Start clean. Start small. Build the AI infrastructure you need.