⛰️ LifeOS — The AI-powered Life Operating System that helps you hill climb to wherever you're going.
Release v0.1: Complete architecture documentation and README overhaul
Daniel Miessler4bf3bab19494
diff --git a/.claude/learnings/2025-09-09-commands-in-claude-commands-needed-proper-markdown.md b/.claude/learnings/2025-09-09-commands-in-claude-commands-needed-proper-markdown.mddeleted file mode 100644index a2d660be..00000000--- a/.claude/learnings/2025-09-09-commands-in-claude-commands-needed-proper-markdown.md+++ /dev/null@@ -1,79 +0,0 @@-# Learning: Commands in ${PAI_HOME}/.claude/commands/ needed proper markdown-first structure--**Date:** Tuesday, September 9, 2025--**Time:** 1:34:47 PM-------## 🎭 The Full Story--### The Problem We Encountered--Commands in ${PAI_HOME}/.claude/commands/ needed proper markdown-first structure--### What We Initially Thought--We thought that we could have a single .md file with a shebang and embedded TypeScript that bun could execute directly--This led us to believe the system worked in a certain way, and we approached the problem with these assumptions.--### What We Discovered Was Actually True--What we realized was that markdown command files need separate .md documentation and .ts implementation files - bun can't execute markdown with embedded script tags--This was different from our initial understanding and required us to rethink our approach.--### The Journey: Troubleshooting Steps We Took--1. Created initial file with shebang and embedded code in script tags. 2. Tried to run it with bun and got syntax errors. 3. Realized bun expects pure TypeScript/JavaScript files. 4. Understood we need separate files for documentation and implementation--These steps helped us uncover the real issue and guided us toward the solution.--### The Solution That Worked--Created two files: capture-learning.md for documentation/narrative and capture-learning.ts for the executable TypeScript implementation--This solution addressed the actual problem rather than what we initially thought was wrong.-------## 🎯 The Lesson Learned--**So now we know:** Markdown command files in ${PAI_HOME}/.claude/commands/ should have a .md file for documentation and a separate .ts file for implementation - this provides clear narrative-first documentation while maintaining executable functionality--This changes how we approach similar problems in the future because we understand the underlying mechanism better.-------## 📋 Quick Reference--**Before:** We thought we could have a single .md file with a shebang and embedded TypeScript that bun could execute direct...--**After:** We know markdown command files need separate .md documentation and .ts implementation files - bun can't exec...--**Action:** Markdown command files in ${PAI_HOME}/.claude/commands/ should have a .md file for documentation and a separate .ts file for implementation - this provides clear narrative-first documentation while maintaining executable functionality-------## 🔧 Technical Details--### Commands/Tools That Helped-- Document specific commands that were useful-- Note any MCP servers or tools that aided in debugging-- Include any error messages that were key indicators--### Related Files/Configurations-- List any files that were modified-- Note configuration changes made-- Document any dependencies involved--### Future Applications-This learning applies to:-- Similar error patterns involving these components-- Related debugging scenarios in this area-- Comparable system behaviors we might encounter-------*This narrative learning was captured to help us remember not just the solution, but the entire problem-solving journey and the thinking that led us to the answer.*diff --git a/README.md b/README.mdindex 53a4adbc..37614767 100644--- a/README.md+++ b/README.md@@ -48,16 +48,17 @@## 🚀 **Recent Updates**> [!TIP]-> **Check back often as I'm constantly adding features**+> **[🎉 v0.1 Released!](https://github.com/danielmiessler/PAI/releases/tag/v0.1)** - First official release with full architecture documentation<details open>-<summary><strong>📅 September 21, 2025</strong></summary>+<summary><strong>📅 September 21, 2025 - v0.1 Release</strong></summary>-- ✨ **Security**: Cleaned up voice server for secure command execution+- 🎉 **Release**: Published v0.1 - Initial public release+- 🔒 **Voice**: Hardened the voice server- 🏠 **Portability**: PAI_HOME support eliminates hardcoded paths- 📚 **Docs**: Comprehensive documentation under `~/.claude/documentation/`-- 🔌 **Dynamic**: MCP detection via `claude mcp list` (PR #12)-- 🎙️ **Voice**: Enhanced server with validation and rate limiting+- 🔌 **Dynamic**: MCP detection via `settings.json`+- 🏗️ **Architecture**: Complete system documentation with examples</details>@@ -129,7 +130,7 @@ graph TB**PAI is an open-source, full personal AI platform that's completely agnostic to who you are and what you're trying to accomplish.**-This isn't just another AI tool—it's a complete infrastructure for anyone on Earth to harness AI for both business and life. Whether you're an artist transitioning to independence, a founder building a company, or someone managing complex health needs, PAI adapts to YOUR unique situation.+Think of PAI as your personal AI that actually knows you—all your projects, your style, your data—and can handle anything you throw at it. Whether you're an artist transitioning to independence, a founder building a company, or someone managing complex health needs, PAI becomes whatever you need it to be.PAI is part of the journey toward Human 3.0—where humans are augmented by AI rather than replaced by it.@@ -204,6 +205,7 @@ PAI is part of the journey toward Human 3.0—where humans are augmented by AI r- **🌍 Universal**: Works for anyone, anywhere, in any profession or life situation- **🔓 Open Source**: No vendor lock-in, complete transparency, you own everything+- **🤖 Platform Independent**: Core structure works with Claude, GPT, Gemini, or any AI platform- **🧠 Persistent Memory**: Your AI remembers every context, project, and conversation- **🎯 Task Agnostic**: From writing a blog to tracking medical data to running a business- **📁 Plain Text**: All configuration in human-readable files you can edit and understand@@ -277,7 +279,8 @@ PAI is part of the journey toward Human 3.0—where humans are augmented by AI r## 🚀 **Quick Start**> [!NOTE]-> PAI requires [Claude Code](https://claude.ai/code) and [Bun](https://bun.sh) runtime.+> PAI works with [Claude Code](https://claude.ai/code), but the architecture supports any AI platform (GPT, Gemini, etc.)+> Requires [Bun](https://bun.sh) JavaScript runtime for the current implementation.### **Installation**@@ -369,7 +372,15 @@ PORT="8888" # Voice server port## 🎬 **Real-World Examples**-### 📈 **Business & Analytics**+> **Note:** These are examples from my personal PAI setup. Your system will have completely different commands based on your unique needs, workflows, and goals.++<table>+<tr>+<td width="50%" valign="top">++### 💼 **Professional Examples**++#### 📈 **Business & Analytics**<details><summary><strong>📊 Newsletter Performance</strong></summary>@@ -394,33 +405,34 @@ add-linear-ticket # Development velocity</details>-### 💰 **Financial Intelligence**+#### 🔒 **Development & Security**<details>-<summary><strong>📉 Expense Analysis</strong></summary>+<summary><strong>🔍 Code Security</strong></summary>```bash-# Instant financial insights-answer-finance-question "monthly utilities average?"-answer-finance-question "subscription spending?"-process-finances-data --categorize --visualize+# Security automation+check-for-sensitive --scan all+design-review --security-focus+browser-tools-setup --headers```</details><details>-<summary><strong>📈 Financial Planning</strong></summary>+<summary><strong>🔌 API Infrastructure</strong></summary>```bash-# Comprehensive financial overview-get-finances-state-prepare-finances-dashboard-push-finances-state --notify+# Personal API management+update-daemon --endpoints+create-cloudflare-mcp-server+update-tools-context --integrations+startup-context-load```</details>-### ✍️ **Content Creation**+#### ✍️ **Content Creation**<details><summary><strong>📝 Blog Pipeline</strong></summary>@@ -448,7 +460,38 @@ create-mermaid-visualization --type flowchart</details>-### 🧪 **Memory & Research**+</td>+<td width="50%" valign="top">++### 🏠 **Personal Examples**++#### 💰 **Financial Intelligence**++<details>+<summary><strong>📉 Expense Analysis</strong></summary>++```bash+# Instant financial insights+answer-finance-question "monthly utilities average?"+answer-finance-question "subscription spending?"+process-finances-data --categorize --visualize+```++</details>++<details>+<summary><strong>📈 Financial Planning</strong></summary>++```bash+# Comprehensive financial overview+get-finances-state+prepare-finances-dashboard+push-finances-state --notify+```++</details>++#### 🧪 **Memory & Research**<details><summary><strong>🔍 Meeting Recall</strong></summary>@@ -475,7 +518,7 @@ query-context "machine learning notes"</details>-### 🎯 **Personal Productivity**+#### 🎯 **Personal Productivity**<details><summary><strong>툿 Morning Automation</strong></summary>@@ -503,32 +546,9 @@ update-public-content</details>-### 🔒 **Development & Security**--<details>-<summary><strong>🔍 Code Security</strong></summary>--```bash-# Security automation-check-for-sensitive --scan all-design-review --security-focus-browser-tools-setup --headers-```--</details>--<details>-<summary><strong>🔌 API Infrastructure</strong></summary>--```bash-# Personal API management-update-daemon --endpoints-create-cloudflare-mcp-server-update-tools-context --integrations-startup-context-load-```--</details>+</td>+</tr>+</table>---diff --git a/README_OLD.md b/README_OLD.mddeleted file mode 100644index 571ea567..00000000--- a/README_OLD.md+++ /dev/null@@ -1,237 +0,0 @@-<div align="center">----# `PAI` - Personal AI Infrastructure--### <code>PAI</code> is an open-source personal AI infrastructure for orchestrating your life and work--<br />----[](https://opensource.org/licenses/MIT)-[](https://claude.ai/code)-[](https://youtu.be/iKwRWwabkEc)--<p align="center">- <a href="#-features">Features</a> •- <a href="#-getting-started">Getting Started</a> •- <a href="#-philosophy">Philosophy</a> •- <a href="#-examples">Examples</a> •- <a href="#-contribute">Contribute</a>-</p>-------</div>--## 🚀 Recent Updates--### 📅 **September 21, 2025**-- ✨ Cleaned up voice server code for secure command execution-- 🏠 Added PAI_HOME support to eliminate all hardcoded paths-- 📚 Created comprehensive documentation under `~/.claude/documentation/`-- 🔌 Dynamic MCP detection using `claude mcp list` (PR #12)-- 🎙️ Voice server improvements with input validation and rate limiting-------### 📅 **September 20, 2025**-- 🗣️ Added `/voice-server` directory with ElevenLabs integration-- 🔧 Closed PRs fixing hardcoded path issues-- 🪝 Working on missing hooks from Issues-------### 📅 **September 12, 2025**-- 🧠 Uploaded dynamic resource loading system to `/hooks` and `/commands`-- ⚡ Submit-user-hook dynamically loads context and agents-- 🗺️ Dynamic routing via `/commands/load-dynamic-requirements.md`--## 🎯 **What is PAI?**--PAI is a project designed to give anyone in the world a personal AI infrastructure for orchestrating their personal and professional lives.--Based off my own personal Digital Assistant, **Kai**, it combines a scaffolding framework with a growing set of real-world examples.--<table>-<tr>-<td width="33%" align="center"><b>🧠 Life Management</b><br/>Research • Writing • Health • Finances</td>-<td width="33%" align="center"><b>💼 Professional</b><br/>Code • Content • Analytics • Automation<br/>Department Management • Program Management • Startups</td>-<td width="33%" align="center"><b>🎯 Personal</b><br/>Learning • Family • Goals • Habits</td>-</tr>-</table>--> **💡 Core Mission:** Augment humans with AI capabilities so they can survive and thrive in a world full of AI.--<br/>--## ✨ **Features**--<details open>-<summary><b>🏗️ UFC Context Architecture - Your Persistent AI Brain</b></summary>--```-~/.claude/context/-├── 🧠 projects/ # Active work and initiatives-├── 🛠️ tools/ # AI agents and capabilities-├── 💰 finances/ # Financial tracking and analysis-├── 🏥 health/ # Wellness and medical data-└── 🎯 telos/ # Objectives and progress tracking-```--- **Persistent Memory**: Never lose context between sessions-- **Hierarchical Organization**: Intuitive file-based structure-- **Complete Portability**: Your entire AI brain in plain text-- **Dynamic Loading**: Context loads based on current task--</details>--<details>-<summary><b>🤖 Specialized Digital Assistants</b></summary>--| Assistant | Purpose | Voice ID | Specialization |-|-----------|---------|----------|----------------|-| **Researcher** | Deep information synthesis | `AXdMgz6...` | Web research, analysis |-| **Engineer** | Production code development | `kmSVBPu7...` | Full-stack, testing |-| **Designer** | UX/UI and visual design | `ZF6FPAb...` | Interfaces, experiences |-| **Pentester** | Security assessment | `hmMWXCj9...` | Vulnerability testing |-| **Architect** | System design | `muZKMsID...` | Technical specifications |--</details>--<details>-<summary><b>🔧 Integrated Tool Ecosystem</b></summary>--- **MCP Servers**: Playwright, Stripe, Apify, and more-- **Voice System**: Natural conversation with TTS/STT-- **Browser Automation**: Visual testing and web interaction-- **API Integrations**: Connect any service to your PAI--</details>--<br/>--## 🚀 **Getting Started**--> **📢 Note:** Lots more examples and templates coming soon, including the full voice implementation. This repo will be continuously updated with real-world implementations from my [YouTube channel](https://www.youtube.com/@unsupervised-learning).--### **Quick Start**--I use *Typescript* as my main language (instead of Python), and I use `bun` as my main Javascript/Typescript system. Think: runtime, package management, etc. So if you want to use this system as-is, make sure you have `bun` installed before getting started.--`brew install bun`--One thing to note is that when you download the project, the `.claude` directory is hidden by default because it's a dot directory. So cd into `.claude` when you're done with the instructions. (Or cd into `claude_directory` which is just a symlink to it)--`cd .claude`--```bash-# 1. Clone the repository-git clone https://github.com/danielmiessler/PAI.git--# 2. Check out the files (the folder is hidden with default `ls`)--ls -lah-cd ~/.claude/-ls -lah--# 3. Put your keys into your own .env file, which is not in the repo itself. Use the example as a template if needed--nvim .env--# 4. Export your own PAI_HOME in your shell config. Change for your desired home--PAI_HOME="/Users/daniel/"--### **Testing PAI in Custom Locations**--PAI uses the `PAI_HOME` environment variable to determine its installation path. By default, it uses `~/.claude/`, but you can test PAI in any directory:--# Test PAI in a custom directory-export PAI_HOME="/path/to/directory"--# The system will look for context files at ${PAI_HOME}/.claude/context/-```--**Important Notes:**-- Set `PAI_HOME` before starting Claude Code for the environment variable to take effect-- The `.claude` directory structure should exist at your custom `PAI_HOME` location-- This is particularly useful for developers testing multiple PAI configurations--### **Prerequisites**--- [Claude Code](https://claude.ai/code) - The primary AI interface, which can ultimately be any similar system, e.g., Gemini, Codex, etc.-- [Bun](https://bun.com/) - The node.js system we're using-- Text editor (Neovim recommended, but any will work—it's all Markdown/Text!)-- Ideal: Decent Command Line Interface skills--<br/>--## 💡 **Philosophy**--<div align="center">--### **Human 3.0: Augmentation, Not Replacement**--</div>--The PAI system embodies a fundamental belief: **AI should amplify human capability, not replace it.**--| Traditional AI | PAI Approach |-|----------------|--------------|-| Black box decisions | Transparent, file-based logic |-| Vendor lock-in | Completely portable |-| Forgets everything | Persistent memory |-| Generic responses | Personalized to you |-| Replaces thinking | Augments capability |--<br/>--## 📚 **Examples**--Coming soon! Each example will include:-- Complete file structure-- Configuration templates-- Step-by-step setup-- Video walkthrough--### **Planned Examples**-- 📰 Daily Intelligence Briefing-- 💰 Expense Tracking & Analysis-- 📝 Content Creation Pipeline-- 🔬 Research Assistant-- 🏥 Health Monitoring-- 📚 Learning System--<br/>--## 🤝 **Contribute**--PAI is open source and welcomes contributions!--- 🐛 [Report Issues](https://github.com/danielmiessler/PAI/issues)-- 💡 [Suggest Features](https://github.com/danielmiessler/PAI/discussions)-- 🔧 [Submit PRs](https://github.com/danielmiessler/PAI/pulls)-- ⭐ Star the repo to show support!--<br/>--## 📄 **License**--PAI is MIT licensed. See [LICENSE](./LICENSE) for details.--<br/>-------<div align="center">--### 🎓 **Remember**--> *"This is YOUR infrastructure. Every configuration, every tool, every workflow should serve your unique life and goals. You're not using AI—you're augmenting yourself with it."*--**by [Daniel Miessler](https://danielmiessler.com) • Follow along on [YouTube](https://www.youtube.com/@unsupervised-learning)**--</div>