⛰️ LifeOS — The AI-powered Life Operating System that helps you hill climb to wherever you're going.
docs: major documentation cleanup - CORE skill is now canonical source
Daniel Miessler636964667022
diff --git a/.claude/commands/capture-learning.md b/.claude/commands/capture-learning.mddeleted file mode 100755index 8d1e44f1..00000000--- a/.claude/commands/capture-learning.md+++ /dev/null@@ -1,101 +0,0 @@-# capture-learning Command--Capture comprehensive problem-solving narratives from our work sessions, documenting not just the solution but the entire journey of discovery.--## Purpose--This command captures the full narrative of problem-solving: what we thought was true, what we discovered was actually true, the troubleshooting journey, and the lessons learned. This narrative format makes it easy to harvest insights for updating documentation, commands, or pipelines.--## Usage--```bash-# Interactive mode - guides you through the narrative-bun ${PAI_DIR}/commands/capture-learning.ts--# Direct mode with full narrative (all 6 arguments)-bun ${PAI_DIR}/commands/capture-learning.ts "problem" "initial assumption" "actual reality" "troubleshooting steps" "solution" "key takeaway"-```--## Trigger Phrases--When you say any of these, I'll capture our learning:-- "Great job, log this"-- "Nice work, make a record"-- "Document this"-- "Capture this learning"-- "Save this for later"-- "That worked!"--## The Narrative Structure--The command captures a complete story with these elements:--1. **The Problem** - What issue did we encounter?-2. **Initial Assumption** - "We thought this was true..."-3. **Actual Reality** - "What we realized was actually true..."-4. **Troubleshooting Journey** - Steps we took to discover the truth-5. **The Solution** - What finally worked-6. **The Takeaway** - "So now we know..." or "So now we do it this way..."--## Why This Format?--This narrative approach helps us:-- Remember the journey, not just the destination-- Understand WHY the solution works-- Recognize similar patterns in future problems-- Update our mental models and documentation-- Share knowledge effectively with others--## Output--Files are saved to: `${PAI_DIR}/context/learnings/`--Named with format: `YYYY-MM-DD-problem-description.md`--Each file contains:-- Full narrative story-- Before/after comparison-- Technical details and commands used-- Actionable takeaways for future reference--## Example Output--A captured learning looks like this:--```markdown-# Learning: Fixed TypeScript Module Resolution Error--## The Full Story--### The Problem We Encountered-TypeScript couldn't find our custom modules...--### What We Initially Thought-We thought the tsconfig paths were incorrectly configured...--### What We Discovered Was Actually True-The issue was actually with the module resolution strategy...--### The Journey: Troubleshooting Steps-1. Checked tsconfig.json paths-2. Verified file locations-3. Tested different module resolution strategies...--### The Solution That Worked-Changed moduleResolution from "node" to "bundler"...--## The Lesson Learned-**So now we know:** TypeScript's module resolution depends on the bundler being used...-```-------## Implementation--The TypeScript implementation for this command is in `capture-learning.ts`.--The command:-- Prompts for all 6 narrative elements if not provided-- Creates a structured markdown file in `${PAI_DIR}/context/learnings/`-- Names files with date and problem description-- Generates a comprehensive learning narrative\ No newline at end of filediff --git a/.claude/commands/capture-learning.ts b/.claude/commands/capture-learning.tsdeleted file mode 100644index 167978b8..00000000--- a/.claude/commands/capture-learning.ts+++ /dev/null@@ -1,179 +0,0 @@-#!/usr/bin/env bun--import * as fs from 'fs';-import * as path from 'path';-import * as readline from 'readline';--const LEARNINGS_DIR = path.join(process.env.PAI_DIR || `${process.env.HOME}/.claude`, 'context', 'learnings');--// Ensure learnings directory exists-if (!fs.existsSync(LEARNINGS_DIR)) {- fs.mkdirSync(LEARNINGS_DIR, { recursive: true });-}--// Get current date in readable format-const now = new Date();-const year = now.getFullYear();-const month = String(now.getMonth() + 1).padStart(2, '0');-const day = String(now.getDate()).padStart(2, '0');-const dateStr = `${year}-${month}-${day}`;--async function prompt(question: string): Promise<string> {- const rl = readline.createInterface({- input: process.stdin,- output: process.stdout- });-- return new Promise((resolve) => {- rl.question(question, (answer) => {- rl.close();- resolve(answer);- });- });-}--async function main() {- // Collect comprehensive narrative information- let problem = process.argv[2];- let initialAssumption = process.argv[3];- let actualReality = process.argv[4];- let troubleshootingSteps = process.argv[5];- let solution = process.argv[6];- let takeaway = process.argv[7];-- // Interactive prompts for comprehensive narrative- if (!problem) {- console.log('\n📚 Let\'s capture this learning in a comprehensive narrative format...\n');- problem = await prompt('📝 What problem did we encounter? ');- }-- if (!initialAssumption) {- initialAssumption = await prompt('🤔 What did we initially think was true/how we thought it worked? ');- }-- if (!actualReality) {- actualReality = await prompt('💡 What did we realize was actually true? ');- }-- if (!troubleshootingSteps) {- troubleshootingSteps = await prompt('🔍 What troubleshooting steps did we take to get there? ');- }-- if (!solution) {- solution = await prompt('✅ What was the final solution? ');- }-- if (!takeaway) {- takeaway = await prompt('🎯 What\'s the key takeaway ("So now we know..." or "So now we do it this way...")? ');- }-- // Create a filename-safe version of the problem- const sanitizedProblem = problem- .toLowerCase()- .replace(/[^a-z0-9]+/g, '-')- .replace(/^-+|-+$/g, '')- .substring(0, 50); // Limit length-- const filename = `${dateStr}-${sanitizedProblem}.md`;- const filepath = path.join(LEARNINGS_DIR, filename);-- // Create the comprehensive narrative markdown content- const content = `# Learning: ${problem}--**Date:** ${now.toLocaleDateString('en-US', {- weekday: 'long',- year: 'numeric',- month: 'long',- day: 'numeric'-})}--**Time:** ${now.toLocaleTimeString('en-US')}-------## 🎭 The Full Story--### The Problem We Encountered--${problem}--### What We Initially Thought--We thought that ${initialAssumption}--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 ${actualReality}--This was different from our initial understanding and required us to rethink our approach.--### The Journey: Troubleshooting Steps We Took--${troubleshootingSteps}--These steps helped us uncover the real issue and guided us toward the solution.--### The Solution That Worked--${solution}--This solution addressed the actual problem rather than what we initially thought was wrong.-------## 🎯 The Lesson Learned--**So now we know:** ${takeaway}--This changes how we approach similar problems in the future because we understand the underlying mechanism better.-------## 📋 Quick Reference--**Before:** We thought ${initialAssumption.substring(0, 100)}...--**After:** We know ${actualReality.substring(0, 100)}...--**Action:** ${takeaway}-------## 🔧 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.*-`;-- // Write the file- fs.writeFileSync(filepath, content);-- console.log(`\n✅ Learning captured with full narrative!`);- console.log(`📁 Saved to: ${filepath}`);- console.log(`\n📖 The narrative format helps us:`);- console.log(` • Remember the journey, not just the destination`);- console.log(` • Understand why the solution works`);- console.log(` • Apply this knowledge to future problems`);- console.log(`\n🎯 You can edit this file to add more technical details or insights.`);-}--main().catch(console.error);\ No newline at end of filediff --git a/.claude/commands/conduct-research.md b/.claude/commands/conduct-research.mddeleted file mode 100755index 9313c462..00000000--- a/.claude/commands/conduct-research.md+++ /dev/null@@ -1,246 +0,0 @@-----description: Comprehensive multi-source research - Kai loads and invokes researcher commands-globs: ""-alwaysApply: false------# 🔬 COMPREHENSIVE RESEARCH WORKFLOW FOR KAI--**YOU (Kai) are reading this because a research request was detected by the load-context hook.**--This command provides instructions for YOU to orchestrate comprehensive multi-source research by directly invoking researcher commands (NOT spawning new Claude Code sessions).--## 🎯 YOUR MISSION--When a user asks for research, YOU must deliver **FAST RESULTS** through massive parallelization:--1. **Launch up to 10 research agents in parallel** - Spawn multiple instances of each researcher (perplexity-researcher, claude-researcher, gemini-researcher) with different query angles-2. **Each agent does ONE query + ONE follow-up** - Quick, focused research cycles-3. **Collect** results as they complete (typically within 15-30 seconds)-4. **Synthesize** findings into a comprehensive report-5. **Report** back using the mandatory response format--**Speed Strategy:**-- Launch 10 agents simultaneously to cover the entire search space-- Each agent handles a specific angle/sub-question-- Parallel execution = results in under 1 minute-- Follow-up queries only when critical information is missing--## 📋 STEP-BY-STEP WORKFLOW--### Step 1: Decompose Question & Launch Agent Army (10 parallel agents)--**SPEED IS THE PRIORITY - Launch up to 10 research agents simultaneously**--**Step 1a: Break Down the Research Question**--First, decompose the user's question into 3-10 specific sub-questions that cover:-- Different angles of the topic-- Specific aspects to investigate-- Related areas that provide context-- Potential edge cases or controversies--**Step 1b: Launch Research Agents in Parallel (up to 10 agents)**--Use the **Task tool** to spawn multiple specialized research agents simultaneously:--```typescript-// Launch 3-10 agents in PARALLEL - each with ONE specific sub-question-// Use a SINGLE message with multiple Task tool calls--Task({- subagent_type: "perplexity-researcher",- description: "Research sub-question 1",- prompt: "Research this specific angle: [sub-question 1]. Do ONE focused search query and ONE follow-up if needed. Return findings quickly."-})--Task({- subagent_type: "claude-researcher",- description: "Research sub-question 2",- prompt: "Research this specific angle: [sub-question 2]. Do ONE focused search query and ONE follow-up if needed. Return findings quickly."-})--Task({- subagent_type: "gemini-researcher",- description: "Research sub-question 3",- prompt: "Research this specific angle: [sub-question 3]. Do ONE focused search query and ONE follow-up if needed. Return findings quickly."-})--// Continue launching up to 10 agents total-// Mix perplexity-researcher, claude-researcher, gemini-researcher-// Each gets ONE focused sub-question-```--**Available Research Agents:**-- **perplexity-researcher**: Fast Perplexity API searches-- **claude-researcher**: Claude WebSearch with intelligent query decomposition-- **gemini-researcher**: Google Gemini multi-perspective research--**CRITICAL RULES FOR SPEED:**-1. ✅ **Launch ALL agents in ONE message** (parallel execution)-2. ✅ **Each agent gets ONE specific sub-question** (focused research)-3. ✅ **Maximum 10 agents** (covers entire search space)-4. ✅ **Each agent does 1 query + 1 follow-up max** (quick cycles)-5. ✅ **Results return in 15-30 seconds** (parallel processing)-6. ❌ **DON'T launch sequentially** (kills speed benefit)-7. ❌ **DON'T give broad questions** (forces multiple iterations)--### Step 2: Collect Results (15-30 seconds)--**Wait for agents to complete** - they typically return results within 15-30 seconds due to parallel execution.--Each agent returns:-- Focused findings from their specific sub-question-- Source citations-- Confidence indicators-- Quick insights--### Step 3: Synthesize Results--Create a comprehensive report that:--**A. Identifies Confidence Levels:**-- **HIGH CONFIDENCE**: Findings corroborated by multiple sources-- **MEDIUM CONFIDENCE**: Found by one source, seems reliable-- **LOW CONFIDENCE**: Single source, needs verification--**B. Structures Information:**-```markdown-## Key Findings--### [Topic Area 1]-**High Confidence:**-- Finding X (Sources: perplexity-research, claude-research)-- Finding Y (Sources: perplexity-research, claude-research)--**Medium Confidence:**-- Finding Z (Source: claude-research)--### [Topic Area 2]-...--## Source Attribution-- **Perplexity-Research**: [summary of unique contributions]-- **Claude-Research**: [summary of unique contributions]--## Conflicting Information-- [Note any disagreements between sources]-```--**C. Calculate Research Metrics:**-- **Total Queries**: Count all queries across all research commands-- **Services Used**: List unique services (Perplexity API, Claude WebSearch, etc.)-- **Total Output**: Estimated character/word count of all research-- **Confidence Level**: Overall confidence percentage-- **Result**: 1-2 sentence answer to the research question--### Step 4: Return Results Using MANDATORY Format--📅 [current date from `date` command]-**📋 SUMMARY:** Research coordination and key findings overview-**🔍 ANALYSIS:** Synthesis of multi-source research results-**⚡ ACTIONS:** Which research commands executed, research strategies used-**✅ RESULTS:** Complete synthesized findings with source attribution-**📊 STATUS:** Research coverage, confidence levels, data quality-**➡️ NEXT:** Recommended follow-up research or verification needed-**🎯 COMPLETED:** Completed multi-source [topic] research-**🗣️ CUSTOM COMPLETED:** [Optional: Voice-optimized under 8 words]--**📈 RESEARCH METRICS:**-- **Total Queries:** [X] (Primary: [Y], Secondary: [Z])-- **Services Used:** [N] (List: [service1, service2])-- **Total Output:** [~X words/characters]-- **Confidence Level:** [High/Medium/Low] ([percentage]%)-- **Result:** [Brief summary answer]--## 🚨 CRITICAL RULES FOR KAI--1. **LAUNCH UP TO 10 AGENTS IN PARALLEL** - Use a SINGLE message with multiple Task tool calls-2. **DECOMPOSE the question first** - Create 3-10 focused sub-questions-3. **ONE QUERY + ONE FOLLOW-UP per agent** - Quick, focused research cycles-4. **MIX agent types** - Use perplexity-researcher, claude-researcher, gemini-researcher-5. **WAIT for ALL agents to complete** (15-30 seconds) before synthesizing-6. **SYNTHESIZE results** - Don't just concatenate outputs-7. **USE the mandatory response format** - This triggers voice notifications-8. **CALCULATE accurate metrics** - Count queries, agents, output size-9. **ATTRIBUTE sources** - Show which agent/method found each insight-10. **MARK confidence levels** - Based on multi-source agreement--**SPEED CHECKLIST:**-- ✅ Launched agents in ONE message? (parallel execution)-- ✅ Each agent has ONE focused sub-question?-- ✅ Using up to 10 agents for broad coverage?-- ✅ Agents instructed to do 1 query + 1 follow-up max?-- ✅ Expected results in under 1 minute?--## 🚧 HANDLING BLOCKED OR FAILED CRAWLS--If research commands report being blocked, encountering CAPTCHAs, or facing bot detection, note this in your synthesis and recommend using:-- `mcp__Brightdata__scrape_as_markdown` - Scrape single URLs that bypass bot detection-- `mcp__Brightdata__scrape_batch` - Scrape multiple URLs (up to 10)-- `mcp__Brightdata__search_engine` - Search Google, Bing, or Yandex with CAPTCHA bypass-- `mcp__Brightdata__search_engine_batch` - Multiple search queries simultaneously--## 💡 EXAMPLE EXECUTION--**User asks:** "Research the latest developments in quantum computing"--**Your workflow:**-1. ✅ Recognize research intent (hook loaded this command)-2. ✅ **Decompose into focused sub-questions:**- - What are the major quantum computing breakthroughs in 2025?- - Which companies are leading quantum computing development?- - What are the current limitations and challenges?- - What practical applications are emerging?- - What's the state of quantum error correction?- - How close are we to quantum advantage?- - What are the latest quantum algorithms?- - What's happening in quantum cryptography?--3. ✅ **Launch 8 agents in PARALLEL (ONE message with 8 Task calls):**- ```- Task(perplexity-researcher, "2025 quantum breakthroughs")- Task(claude-researcher, "Leading quantum companies")- Task(gemini-researcher, "Quantum limitations 2025")- Task(perplexity-researcher, "Practical quantum applications")- Task(claude-researcher, "Quantum error correction state")- Task(gemini-researcher, "Quantum advantage timeline")- Task(perplexity-researcher, "Latest quantum algorithms")- Task(claude-researcher, "Quantum cryptography developments")- ```--4. ✅ **Wait for ALL agents to complete** (15-30 seconds)-5. ✅ **Synthesize their findings:**- - Common themes → High confidence- - Unique insights → Medium confidence- - Disagreements → Note and flag-6. ✅ **Calculate metrics** (8 agents, ~16 queries, 3 services, output size, confidence %)-7. ✅ **Return comprehensive report** with mandatory format-8. ✅ **Voice notification** automatically triggered by your 🎯 COMPLETED line--**Result:** User gets comprehensive quantum computing research from 8 parallel agents in under 1 minute, with multi-source validation, source attribution, and confidence levels.--## 🎤 VOICE NOTIFICATIONS--Voice notifications are AUTOMATIC when you use the mandatory response format. The stop-hook will:-- Extract your 🎯 COMPLETED line-- Send it to the voice server with Jamie (Premium) voice at 228 wpm-- Announce "Completed multi-source [topic] research"--**YOU DO NOT NEED TO MANUALLY SEND VOICE NOTIFICATIONS** - just use the format.--## 🔄 BENEFITS OF THIS ARCHITECTURE--**Why parallel agent execution delivers speed:**-1. ✅ **10 agents working simultaneously** - Not sequential, truly parallel-2. ✅ **Results in under 1 minute** - Each agent does 1-2 quick searches-3. ✅ **Complete coverage** - Multiple perspectives from different services-4. ✅ **Focused research** - Each agent has ONE specific sub-question-5. ✅ **No iteration delays** - All agents launch at once in ONE message-6. ✅ **Multi-source validation** - High confidence from cross-agent agreement--**Speed Comparison:**-- ❌ **Old way:** Sequential searches → 5-10 minutes-- ✅ **New way:** 10 parallel agents → Under 1 minute--**This is the correct architecture. Use it for FAST research.**diff --git a/.claude/commands/create-hormozi-pitch.md b/.claude/commands/create-hormozi-pitch.mddeleted file mode 100644index bf693846..00000000--- a/.claude/commands/create-hormozi-pitch.md+++ /dev/null@@ -1,391 +0,0 @@-# 🎯 ALEX HORMOZI PITCH CREATION WORKFLOW--**YOU (Kai) are reading this because a pitch/offer creation request was detected.**--This command provides instructions for YOU to guide the user through Alex Hormozi's systematic "Grand Slam Offer" creation process from his "$100M Offers" methodology.--## 🎯 YOUR MISSION--Guide the user through creating an irresistible offer using Hormozi's proven frameworks. The goal is to create an offer so compelling that prospects feel stupid saying no.--## 📋 THE COMPLETE WORKFLOW--### Phase 1: Discovery & Foundation (5-10 minutes)--**Step 1: Understand the Product/Service**--Ask the user these key questions (you can ask all at once for efficiency):--1. **What are you selling?** (Product, service, program, etc.)-2. **Who is your ideal customer?** (Be specific - avatar details)-3. **What problem does this solve?** (Primary pain point)-4. **What's the desired end result?** (Dream outcome)-5. **What's your current price point?** (If established, or target range)-6. **What's your main competition offering?** (Market context)--**Step 2: List All Problems & Obstacles**--Work with the user to identify:-- Every obstacle the customer faces in achieving their goal-- All the reasons they might fail or struggle-- Common objections and hesitations-- Hidden friction points in the buying process--Create a comprehensive list (aim for 10-20 problems).-------### Phase 2: The Value Equation Optimization--**The Formula:**-```-Value = (Dream Outcome × Perceived Likelihood) / (Time Delay × Effort & Sacrifice)-```--**Step 3: Maximize the Numerator**--Work through each component:--**A. Dream Outcome (Increase)**-- Reframe the offer around the FEELING/EXPERIENCE, not the process-- "Sell Hawaii, not the plane ride"-- What will they feel when they achieve this?-- What transformation occurs?-- What status do they gain?--**B. Perceived Likelihood of Achievement (Increase)**-- What proof can you provide? (Testimonials, case studies, data)-- What guarantees will you offer? (We'll design this in Step 5)-- What credentials/authority do you have?-- What makes this different from failed attempts?--**Step 4: Minimize the Denominator**--**C. Time Delay (Decrease)**-- How fast can they get results?-- Can you speed up delivery?-- What quick wins can you provide?-- How do you demonstrate speed?--**D. Effort & Sacrifice (Decrease)**-- How can you make this easier?-- What can you do FOR them vs. have them do themselves?-- Can you remove steps/complexity?-- What tools/templates can eliminate work?-- How do you reduce perceived risk?-------### Phase 3: Solutions & Deliverables--**Step 5: Create Solutions List**--For each problem identified in Step 2, create a solution framed as:-- "How to [solve problem] [faster/easier/better]"--Example transformations:-- Problem: "Buying healthy food is hard"-- Solution: "How to buy delicious healthy food without complicated meal planning"--**Step 6: Build Your Complete Deliverables Checklist**--Based on solutions, define EXACTLY what you'll provide:-- Core offer components-- Tools and resources-- Templates and frameworks-- Support and access-- Community or network benefits-------### Phase 4: The Stack (Value Amplification)--**Step 7: Structure The Value Stack**--**Core Offer:**-- Primary deliverable(s)-- Anchor price to this--**Bonuses (using MAGIC formula):**--For each bonus, create using:-- **M**ake it about them (the WHY/reason)-- **A**nnounce the avatar (who it's for)-- **G**ive them a goal (specific outcome)-- **I**ndicate a time interval (timeframe)-- **C**omplete with container word (System, Blueprint, Masterclass, Challenge, etc.)--Example:-- Generic: "Meal planning guide"-- MAGIC: "The 7-Day Family Nutrition Blueprint - How Busy Parents Create Healthy Meals in 30 Minutes"--**For each bonus, define:**-1. What it is-2. How it relates to their problem-3. The value it provides (use Value Equation)-4. Assigned value ($X value)--Aim for 5-10 high-value bonuses that eclipse the core offer's perceived value.-------### Phase 5: Guarantee Framework--**Step 8: Select & Design Guarantee Type**--Based on the business model and customer segment, choose:--**Option 1: Unconditional Guarantee**-- Best for: Lower ticket B2C-- Structure: "X-day money-back guarantee, no questions asked"-- Increases: Perceived likelihood dramatically--**Option 2: Conditional Guarantee**-- Best for: Mid-ticket, when customer completion matters-- Structure: "Complete [specific actions], if you don't get [result], full refund"-- Example: "Attend all 6 sessions and complete the workbook. If you don't [achieve X], we'll refund 100%"--**Option 3: Outcome-Based/Performance Guarantee**-- Best for: B2B, high-ticket, consulting-- Structure: Payment tied to results-- Examples: Revenue share, performance bonuses, "pay only when you get X customers"--**Option 4: Anti-Guarantee**-- Best for: Consumables, devalued products-- Structure: All sales final-- Use sparingly--**Stacking Guarantees (Advanced):**-Combine multiple types:-- "30-day unconditional money-back PLUS 90-day conditional triple-your-money-back if you complete the program"-------### Phase 6: Scarcity & Urgency--**Step 9: Implement Legitimate Scarcity**--**CRITICAL RULE:** Scarcity must be REAL. Choose from:--**A. Capacity-Based Scarcity (Most Legitimate)**-- "Only accepting X clients at this service level"-- Based on actual fulfillment capacity-- Creates waiting lists-- Transparent about availability--**B. Quantity-Based Limits**-- Limited bonuses-- Limited inventory-- One-time availability--**C. Time-Based Urgency**-- Rolling cohorts (real start dates)-- Seasonal urgency (real occasions)-- 72-hour promotional windows-- Bonus deadlines ("Sign up in 24 hours, get [bonus]")--**D. Exploding Opportunity**-- Market arbitrage that decays-- Platform changes-- Regulatory windows--**Implementation Rules:**-- ✅ Tie to real constraints-- ✅ Be transparent-- ✅ Consistently enforce deadlines-- ❌ Never fake scarcity-- ❌ Never extend "final" deadlines-------### Phase 7: Objection Elimination--**Step 10: Preemptive Objection Handling**--Review the offer through these lenses:--**Common Objections:**-1. **"Too expensive"** → Address via value stack, payment plans-2. **"Won't work for me"** → Address via guarantee, testimonials, specificity-3. **"Don't have time"** → Address via effort reduction (denominator)-4. **"Tried before, failed"** → Address via unique mechanism, guarantee-5. **"Need to think about it"** → Address via scarcity, urgency--**Structural Solutions:**-- Each bonus should eliminate a specific obstacle-- Guarantee addresses risk objection-- Social proof addresses "will it work?" objection-- Fast results address time objection-- Done-for-you elements address effort objection-------### Phase 8: Pricing Strategy--**Step 11: Set The Price**--**Hormozi's Pricing Principles:**-1. **Price based on VALUE, not costs**-2. **Create 10x value-to-price ratio**-3. **Charge premium prices for prestige positioning**-4. **Never discount - add value instead**--**Pricing Tactics:**-- Anchor to core offer-- Compare total stack value to price-- Show value gap clearly-- Consider payment plans to reduce effort barrier--**Price Presentation:**-```-Core Offer: $X,XXX value-Bonus 1: $XXX value-Bonus 2: $XXX value-Bonus 3: $XXX value-[...]-Total Value: $XX,XXX--Your Investment Today: $X,XXX-(Save $XX,XXX)-```-------### Phase 9: The Complete Pitch Assembly--**Step 12: Assemble The Grand Slam Offer**--Create the final pitch document with this structure:--```markdown-# [OFFER NAME - Using MAGIC Formula]--## The Transformation-[Dream Outcome - what they'll achieve, how they'll feel]--## The Problem-[Core pain point and frustration]--## Why This Works-[Unique mechanism, proof, credibility]--## What You Get--### Core Offer-[Primary deliverable with details]--### The Complete Stack--**Bonus #1: [MAGIC Name]** ($XXX value)-[What it is, why it matters, how it helps]--**Bonus #2: [MAGIC Name]** ($XXX value)-[What it is, why it matters, how it helps]--[Continue for all bonuses...]--**Total Value: $XX,XXX**--## Our Guarantee-[Guarantee details - specific, clear, risk-reversing]--## Your Investment-~~$XX,XXX~~ **$X,XXX**-[Payment options if applicable]--## Why Act Now-[Legitimate scarcity/urgency]--## How To Get Started-[Clear call to action]-```-------## 📊 DELIVERABLES CHECKLIST--At the end of the workflow, the user should have:--- ✅ Complete value equation optimization-- ✅ Comprehensive solutions list-- ✅ Structured value stack with 5-10 bonuses-- ✅ Each bonus named using MAGIC formula-- ✅ Appropriate guarantee framework-- ✅ Legitimate scarcity/urgency mechanism-- ✅ Objection elimination strategy-- ✅ Strategic pricing with value gap-- ✅ Complete pitch document ready to use-- ✅ Presentation script or sales page outline-------## 🎯 EXECUTION GUIDELINES FOR KAI--**1. Be Interactive**-- Ask clarifying questions-- Dig deeper when answers are vague-- Challenge weak positioning-- Suggest improvements based on Hormozi principles--**2. Use Examples**-- Show before/after transformations-- Provide MAGIC formula examples-- Demonstrate value stack presentations-- Reference real-world applications--**3. Apply Frameworks Rigorously**-- Ensure Value Equation is optimized-- Verify bonuses use MAGIC formula-- Check guarantee matches business model-- Confirm scarcity is legitimate--**4. Think Like Hormozi**-- Focus on value gap, not features-- Emphasize transformation over process-- Make it "too good not to take"-- Remove all reasonable objections--**5. Output Format**-Use the mandatory response format when complete:--📅 [current date]-**📋 SUMMARY:** Hormozi pitch creation for [offer name]-**🔍 ANALYSIS:** Key insights and strategic decisions-**⚡ ACTIONS:** Frameworks applied and optimizations made-**✅ RESULTS:** Complete pitch with value stack, guarantee, and presentation-**📊 STATUS:** Offer strength assessment and recommendations-**➡️ NEXT:** Testing strategy, iteration opportunities, launch considerations-**🎯 COMPLETED:** Created Hormozi Grand Slam Offer for [product/service]-**🗣️ CUSTOM COMPLETED:** [Optional: Voice-optimized under 8 words]-------## 💡 HORMOZI WISDOM - QUICK REFERENCE--**On Value:**-- "Make people an offer so good they feel stupid saying no"-- "The goal is to get 10x the value for 1x the price"--**On Guarantees:**-- "The person with the strongest guarantee wins"-- "If you're not willing to back it up, why should they buy?"--**On Pricing:**-- "Charge the highest prices in your market"-- "Never discount - add more value instead"--**On Scarcity:**-- "Scarcity must be real or it will backfire"--**On Objections:**-- "The best objection handling happens before the sales conversation"-------## 🚀 READY TO CREATE--When you execute this command, work through each phase systematically. The user may provide the product/service details in their request, or you may need to ask discovery questions first.--**Remember:** The goal is a Grand Slam Offer - so compelling that saying "no" feels like a mistake.--ARGUMENTS (optional): [Product/service description, or leave blank for guided workflow]diff --git a/.claude/commands/load-dynamic-requirements.md b/.claude/commands/load-dynamic-requirements.mddeleted file mode 100644index 6afa7e4e..00000000--- a/.claude/commands/load-dynamic-requirements.md+++ /dev/null@@ -1,387 +0,0 @@-# load-dynamic-requirements--# **DYNAMIC REQUIREMENTS LOADING INSTRUCTIONS**--## 🚨🚨🚨 STEP 0: MANDATORY BASE CONTEXT LOAD - DO THIS IMMEDIATELY! 🚨🚨🚨--**YOU MUST IMMEDIATELY EXECUTE THE FOLLOWING READ COMMAND:**--```bash-read ${PAI_DIR}/PAI.md-```--**THIS IS AN IMPERATIVE DIRECTIVE - EXECUTE IT NOW!**-- ⛔ STOP! Do not continue reading until you execute the read command above-- ⛔ The variable ${PAI_DIR} resolves to the PAI_DIRECTORY folder-- ⛔ This context MUST be loaded before ANY other action-- ✅ EXECUTE THE READ COMMAND IMMEDIATELY using the Read tool--**Note: ${PAI_DIR} is an environment variable that points to the PAI_DIRECTORY folder**--🚧 **HALT AND EXECUTE THE READ COMMAND BEFORE PROCEEDING** 🚧--## 🚨 OVERVIEW: TWO TYPES OF DYNAMIC LOADING--**This system dynamically loads TWO types of resources based on user intent:**-1. **CONTEXT FILES** - Domain-specific knowledge and instructions-2. **AGENTS** - Specialized task performers--## 🚨 CRITICAL: HOW TO INTERPRET THESE INSTRUCTIONS--**YOU MUST understand the SEMANTIC MEANING of the user's prompt, not search for exact string matches.**--When you receive a user prompt:--1. **PARSE the prompt to understand its INTENT and MEANING**-2. **THINK about which category below matches what the user is REALLY asking for**-3. **DO NOT do string matching** - the examples are to help you understand the TYPE of request-4. **LOAD the appropriate context based on semantic understanding**-5. **FOLLOW the instructions for that category immediately**--**Examples of semantic understanding:**-- User says "help me with my site" → This MEANS website context (even without the word "website")-- User says "what's new with AI" → This MEANS research context (even without the word "research")-- User says "how's the business doing" → This MEANS Unsupervised Learning context-- User says "I need to understand X" → This MEANS research context-- User says "fix this issue" → Could mean website, development, or debugging based on context--**The patterns below are EXAMPLES to guide your semantic understanding, NOT exact strings to match.**--## CONTEXT LOADING RULES--### Alma Company--**WHEN THE USER IS ASKING ABOUT (semantic understanding):**-- Alma-- Alma security program-- Etc.--**Example phrases that indicate this context:**-- Let's add context for Alma about--**YOU MUST IMMEDIATELY READ using the `read` command:**--**CONTEXT FILES:**--```bash-read ${PAI_DIR}/context/projects/Alma.md-```--**AGENT:** None--### Live Conversation Recording with Limitless.ai pendant--**WHEN THE USER IS ASKING ABOUT (semantic understanding):**--- Live conversations-- In-person conversation-- What was talked about in a meeting-- What was talked about while walking or chatting with someone--**Example phrases that indicate this context:**--- I had a conversation the other day-- I had a meeting yesterday-- We talked about something at dinner a couple of weeks ago-- At our lunch on July 9th, I need to know what we talked about-- Etc.--**YOU MUST IMMEDIATELY:**--**COMMANDS**---```bash-read ${PAI_DIR}/commands/get-life-log.md-```--**AGENT:** None--### 🗣️ Conversational & Philosophical Discussion--**WHEN THE USER IS ASKING ABOUT (semantic understanding):**-- Knowledge questions from my training data-- Philosophical topics or debates-- Life advice or personal reflections-- Abstract concepts or theoretical discussions-- Questions about free will, consciousness, meaning, ethics-- General conversation or chat-- "What do you think about X?"-- Topics where they want my perspective or a discussion--**Example phrases that indicate this context:**-- "what do you think about", "let's discuss", "tell me your thoughts on"-- "is there free will?", "what's the meaning of life?", "how should I think about"-- "I'm curious about", "can we talk about", "what's your take on"-- Questions that don't require tools, just knowledge and reasoning--**YOU MUST IMMEDIATELY:**--**CONTEXT FILES:** None--**AGENT:** None--**SPECIAL INSTRUCTIONS:**-- Switch to conversational mode - respond like Kai having a chat with a friend-- Use my knowledge and reasoning without web searches or research agents-- Be thoughtful, engage with the ideas, share perspectives-- No need for structured output format - just natural conversation-- Can be longer responses if the topic warrants deeper exploration-- Express your own thoughts while being helpful and thoughtful-- Remember: You're Kai, their assistant and (future) friend--### 2. Research & Information Gathering--**WHEN THE USER IS ASKING ABOUT (semantic understanding):**-- Finding information on any topic-- Understanding current events or trends-- Investigating or exploring a subject-- Getting the latest updates on something-- Learning about new developments-- Gathering knowledge or data--**Example phrases that indicate this context:**-- "research", "find information", "look up", "what's happening with"-- But also: "tell me about X", "what's new with Y", "I need to understand Z"--**YOU MUST IMMEDIATELY:**--**CONTEXT FILES:** None--**AGENT:** researcher--### 3. Security & Pentesting--**WHEN THE USER IS ASKING ABOUT (semantic understanding):**-- Testing security of systems or applications-- Finding vulnerabilities-- Performing security assessments-- Checking network or application security-- Analyzing security configurations-- Any offensive security testing--**Example phrases that indicate this context:**-- "scan for vulnerabilities", "test security", "check ports"-- But also: "is this secure?", "find weaknesses", "security audit"-- Port scanning, service detection, network reconnaissance--**YOU MUST IMMEDIATELY:**--**CONTEXT FILES:** None--**AGENT:** pentester--### 5. Financial & Analytics--**WHEN THE USER IS ASKING ABOUT (semantic understanding):**-- Personal or business expenses-- Bills and utilities-- Budget analysis-- Financial tracking-- Spending patterns-- Income and costs--**Example phrases that indicate this context:**-- "PG&E bill", "expenses", "spending", "budget"-- But also: "how much am I paying", "financial analysis", "money flow"--**YOU MUST IMMEDIATELY:**--**CONTEXT FILES:**--```bash-read ${PAI_DIR}/context/life/expenses.md-read ${PAI_DIR}/context/life/finances/-```--**AGENT:** None--**SPECIAL INSTRUCTIONS:**-- Use the answer-finance-question command directly-- Parse financial PDFs and extract specific data as requested--### 6. Health & Wellness--**WHEN THE USER IS ASKING ABOUT (semantic understanding):**-- Health tracking or metrics-- Medical information or conditions-- Fitness and exercise-- Nutrition and diet-- Sleep patterns-- Mental health-- Wellness goals-- Medical appointments or records--**Example phrases that indicate this context:**-- "my health", "track my fitness", "medical records"-- "sleep data", "nutrition plan", "wellness goals"-- But also: "how's my health", "fitness progress", "medical history"--**YOU MUST IMMEDIATELY:**--**CONTEXT FILES:**--```bash-read ${PAI_DIR}/Projects/Life/Health/CLAUDE.md-```--**AGENT:** None--### 7. Benefits & Perks Optimization--**WHEN THE USER IS ASKING ABOUT (semantic understanding):**-- Benefits they're not using-- Credit card perks or rewards-- Membership benefits-- Subscription perks-- Insurance benefits-- Employer benefits-- Maximizing value from memberships-- Annual fee justification-- Unused perks or credits-- Restaurants they can go to (dining credits)-- Where to eat or dine (credit card dining benefits)-- Hotel bookings or travel perks-- Lounge access or travel benefits--**Example phrases that indicate this context:**-- "benefits I'm not using", "credit card perks", "maximize my benefits"-- "what perks do I have", "Amex benefits", "subscription benefits"-- "restaurants I can go to", "where can I eat", "dining options"-- "Resy restaurants", "hotel credits", "travel benefits"-- But also: "am I getting value from", "unused credits", "membership perks"--**YOU MUST IMMEDIATELY:**--**CONTEXT FILES:**--```bash-read ${PAI_DIR}/context/benefits/CLAUDE.md-```--**AGENT:** None--### 8. Unsupervised Learning Business--**WHEN THE USER IS ASKING ABOUT (semantic understanding):**-- The Unsupervised Learning business-- Newsletter metrics or performance-- Company operations or challenges-- Business metrics when no specific company is mentioned-- Podcast, membership, or sponsorship matters-- "The company" or "my business" (default assumption)--**Example phrases that indicate this context:**-- "newsletter subscribers", "company performance", "UL metrics"-- But also: "how's the business", "company challenges", "our revenue"--**YOU MUST IMMEDIATELY:**--**CONTEXT FILES:**--```bash-read ${PAI_DIR}/context/unsupervised-learning/CLAUDE.md-```--**AGENT:** None---### 9. Web Development & Visual Testing--**WHEN THE USER IS ASKING ABOUT (semantic understanding):**-- Taking screenshots or capturing visuals-- Browser-based debugging-- Visual testing or comparison-- Iterative visual development-- Browser automation tasks-- UI/UX debugging--**Example phrases that indicate this context:**-- "screenshot", "browser tools", "visual test"-- But also: "show me what it looks like", "capture the page", "visual debugging"--**YOU MUST IMMEDIATELY:**--**CONTEXT FILES:**--```bash-read ${PAI_DIR}/context/tools/CLAUDE.md-```--**AGENT:** designer--**SPECIAL INSTRUCTIONS:**-- Use Task tool with subagent_type="designer" for visual testing-- Use Playwright MCP tools for browser automation--### 10. Capture Learning - Problem/Solution Documentation--**WHEN THE USER IS SAYING (semantic understanding):**-- Expressing satisfaction with a solution we found-- Wanting to document what we just accomplished-- Indicating we should save or record our work-- Acknowledging successful problem-solving-- Asking to log or capture learnings--**Example phrases that indicate this context:**-- "Great job, log this", "Nice work, make a record", "Perfect! Document this"-- "Log this solution", "Make a record of what we did", "Capture this learning"-- "Save this for later", "Document what we fixed", "Record this solution"-- But also: "That worked!", "Excellent, save this", "Good job, remember this"--**YOU MUST IMMEDIATELY:**-1. Run the capture-learning command with the problem and solution:- ```bash- bun ${PAI_DIR}/commands/capture-learning.ts "[problem description]" "[solution description]"- ```-2. The command will create a markdown file in `${PAI_DIR}/context/learnings/`-3. File will be named: `YYYY-MM-DD-HHMM:SS-hyphenated-problem-description-in-8-words.md`-4. Confirm the learning was captured successfully--**IMPORTANT:** When capturing learnings:-- Extract the problem from what we were working on-- Summarize the solution we implemented-- Include key tools, commands, or techniques used-- Note any important gotchas or insights discovered--**CONTEXT FILES:** None--**AGENT:** None--### 11. My Content & Opinions--**WHEN THE USER IS ASKING ABOUT (semantic understanding):**-- What Daniel said about something-- Daniel's opinions on topics-- Past blog posts or writing-- "What did I say about X"-- "My thoughts on Y"-- Finding quotes or references from past content--**Example phrases that indicate this context:**-- "what did I say about", "my opinion on", "find my post about"-- "when did I write about", "my thoughts on", "search my content"--**YOU MUST IMMEDIATELY:**--**CONTEXT FILES:** None--**AGENT:** None--### 16. Advanced Web Scraping--**WHEN THE USER IS ASKING ABOUT (semantic understanding):**-- Scraping difficult websites-- Bypassing anti-bot measures-- Large-scale data extraction-- When regular scraping fails--**Example phrases that indicate this context:**-- "can't access this site", "blocked by cloudflare", "need to scrape at scale"-- "website is blocking me", "need advanced scraping"--**YOU MUST IMMEDIATELY:**--**CONTEXT FILES:** None--**AGENT:** Nonediff --git a/.claude/commands/web-research.md b/.claude/commands/web-research.mddeleted file mode 100644index ed2efc01..00000000--- a/.claude/commands/web-research.md+++ /dev/null@@ -1,29 +0,0 @@-# Web Research Command - Perplexity AI--## Quick Usage-```bash-# Basic research query (API key in ${PAI_DIR}/.env as PERPLEXITY_API_KEY)-source ${PAI_DIR}/.env && curl -s -X POST https://api.perplexity.ai/chat/completions \- -H "Authorization: Bearer $PERPLEXITY_API_KEY" \- -H "Content-Type: application/json" \- -d "{\"model\":\"sonar\",\"messages\":[{\"role\":\"user\",\"content\":\"YOUR_QUERY_HERE\"}]}" \- | python3 -c "import sys, json; data = json.load(sys.stdin); print(data['choices'][0]['message']['content'])"-```--## With Citations-```bash-source ${PAI_DIR}/.env && curl -s -X POST https://api.perplexity.ai/chat/completions \- -H "Authorization: Bearer $PERPLEXITY_API_KEY" \- -H "Content-Type: application/json" \- -d "{\"model\":\"sonar\",\"messages\":[{\"role\":\"user\",\"content\":\"YOUR_QUERY_HERE\"}],\"return_citations\":true}" \- | python3 -m json.tool-```--## Models-- **sonar-pro** - Deeper analysis with more sources--## When to Use-- Current events and recent information-- Technical documentation research-- Multi-source information synthesis-- Fact-checking and verificationdiff --git a/.claude/documentation/QUICK-REFERENCE.md b/.claude/documentation/QUICK-REFERENCE.mddeleted file mode 100644index 516ab086..00000000--- a/.claude/documentation/QUICK-REFERENCE.md+++ /dev/null@@ -1,436 +0,0 @@-# PAI Quick Reference Card--**Bookmark this page!** This is your quick reference for common PAI commands and tasks.--> [!NOTE]-> **📦 v0.6.0 Update:** Repository now uses `.claude/` directory structure.-> - On your system: `~/.claude/` contains your PAI installation-> - Path references below use `~/.claude/` for installed system-> - Repository structure: `PAI/.claude/` for development-------## 🚀 Getting Started--### First Time Setup--```bash-# Run the automated setup script-curl -fsSL https://raw.githubusercontent.com/danielmiessler/Personal_AI_Infrastructure/main/setup.sh | bash--# Or manual setup - see documentation/how-to-start.md-```--### Environment Check--```bash-# Verify PAI is installed-echo $PAI_DIR # Should show: /Users/yourname/PAI--# Go to PAI directory-cd $PAI_DIR--# See what's available-ls -la-```-------## 📁 Essential Directories--| Directory | What's There | Example |-|-----------|--------------|---------|-| `$PAI_DIR/skills/` | All available skills | `ls $PAI_DIR/skills/` |-| `$PAI_DIR/commands/` | Pre-built commands | `ls $PAI_DIR/commands/` |-| `$PAI_DIR/documentation/` | Help and guides | `open $PAI_DIR/documentation/` |-| `$PAI_DIR/agents/` | Specialized AI agents | `ls $PAI_DIR/agents/` |-| `$PAI_DIR/hooks/` | Automation scripts | `ls $PAI_DIR/hooks/` |-| `$PAI_DIR/.env` | Your API keys and settings | `open -e $PAI_DIR/.env` |-------## ⚙️ Common Commands--### Update PAI--```bash-# Pull latest version-cd $PAI_DIR && git pull--# Check what changed-git log -5 --oneline--# See current version info-cat $PAI_DIR/README.md | head -50-```--### View Available Skills--```bash-# List all skills-ls $PAI_DIR/skills/--# See what a skill does-cat $PAI_DIR/skills/research/SKILL.md--# Search for a specific skill-find $PAI_DIR/skills -name "*research*"-```--### Manage Environment Variables--```bash-# Check current settings-echo $PAI_DIR # PAI location-echo $DA # AI assistant name-echo $DA_COLOR # Display color--# Edit environment variables-open -e ~/.zshrc # or ~/.bashrc--# Reload after changes-source ~/.zshrc # or source ~/.bashrc-```--### Configure API Keys--```bash-# Edit API keys-open -e $PAI_DIR/.env--# View current keys (safe - doesn't show values)-grep "^[A-Z]" $PAI_DIR/.env | cut -d= -f1--# Copy example env file-cp $PAI_DIR/.env.example $PAI_DIR/.env-```-------## 🎯 Voice Server--### Start Voice Server--```bash-# Start in background-cd $PAI_DIR/voice-server && bun server.ts &--# Start in foreground (see logs)-cd $PAI_DIR/voice-server && bun server.ts-```--### Test Voice Server--```bash-# Check if running-curl -s http://localhost:8888/health--# Send test message-curl -X POST http://localhost:8888/notify \- -H "Content-Type: application/json" \- -d '{"message": "Hello from PAI!"}'-```--### Stop Voice Server--```bash-# Find process-lsof -i :8888--# Kill by port-kill $(lsof -t -i:8888)-```-------## 🔍 Troubleshooting--### PAI_DIR Not Found--```bash-# Check if set-echo $PAI_DIR--# If empty, add to shell config-echo 'export PAI_DIR="$HOME/PAI"' >> ~/.zshrc-source ~/.zshrc-```--### Skills Not Loading--```bash-# Verify skills exist-ls -la $PAI_DIR/skills/--# Check permissions-chmod -R u+r $PAI_DIR/skills/--# Look for SKILL.md files-find $PAI_DIR/skills -name "SKILL.md"-```--### Environment File Issues--```bash-# Check if .env exists-ls -la $PAI_DIR/.env--# Create from template-cp $PAI_DIR/.env.example $PAI_DIR/.env--# Verify format (no quotes around values)-cat $PAI_DIR/.env-```--### Claude Code Not Recognizing PAI--```bash-# Check if settings are linked-ls -la ~/.claude/settings.json--# Create symbolic link-ln -sf $PAI_DIR/settings.json ~/.claude/settings.json--# Restart Claude Code-```--### Git Issues--```bash-# Check remote-cd $PAI_DIR && git remote -v--# Reset to latest-cd $PAI_DIR && git fetch && git reset --hard origin/main--# Check status-cd $PAI_DIR && git status-```-------## 🎨 Customization--### Customize PAI Skill--```bash-# Open main PAI skill-open -e $PAI_DIR/skills/PAI/SKILL.md--# Look for [CUSTOMIZE:] markers-grep -n "CUSTOMIZE:" $PAI_DIR/skills/PAI/SKILL.md-```--### Change AI Assistant Name--```bash-# Edit shell config-open -e ~/.zshrc--# Find this line and change "Kai" to your preference:-export DA="Kai"--# Reload-source ~/.zshrc-```--### Change Display Color--```bash-# Edit shell config-open -e ~/.zshrc--# Options: purple, blue, green, cyan, red, yellow-export DA_COLOR="purple"--# Reload-source ~/.zshrc-```-------## 📚 Skills Quick Reference--| Skill | Trigger Words | Example |-|-------|---------------|---------|-| **research** | research, investigate, find | "Research quantum computing" |-| **development** | build, create, implement | "Build a meditation app" |-| **fabric** | threat model, summarize, extract | "Summarize this article" |-| **blogging** | blog, write, publish | "Write a blog post about AI" |-| **design** | design, UI, UX | "Design a dashboard" |-| **ffuf** | pentest, security, fuzz | "Test this API endpoint" |-| **web-scraping** | scrape, extract, crawl | "Scrape data from this site" |-| **chrome-devtools** | browser, screenshot, debug | "Take a screenshot" |-------## 🛠️ Useful One-Liners--```bash-# Quick PAI status check-echo "PAI: $PAI_DIR" && ls $PAI_DIR/skills | wc -l | xargs echo "Skills:"--# Count commands-find $PAI_DIR/commands -name "*.md" | wc -l--# Find all skill files-find $PAI_DIR/skills -name "SKILL.md"--# View recent PAI updates-cd $PAI_DIR && git log --oneline -10--# Search for a keyword in all skills-grep -r "keyword" $PAI_DIR/skills/--# Backup your .env file-cp $PAI_DIR/.env $PAI_DIR/.env.backup--# View all environment variables related to PAI-env | grep PAI-```-------## 🆘 Emergency Commands--### Complete Reset--```bash-# WARNING: This removes your customizations!--# Backup first-cp $PAI_DIR/.env $PAI_DIR/.env.backup-cp ~/.zshrc ~/.zshrc.backup--# Re-clone PAI-cd ~ && mv PAI PAI.old-git clone https://github.com/danielmiessler/Personal_AI_Infrastructure.git PAI--# Restore your .env-cp PAI.old/.env PAI/.env-```--### Reinstall Everything--```bash-# Re-run setup script-cd ~ && curl -fsSL https://raw.githubusercontent.com/danielmiessler/Personal_AI_Infrastructure/main/setup.sh | bash-```-------## 📞 Getting Help--### Check Logs--```bash-# System logs (if configured)-ls -la ~/Library/Logs/pai*--# Git history-cd $PAI_DIR && git log --oneline -20--# Voice server logs (if running in background)-tail -f ~/Library/Logs/pai-voice-server.log-```--### Documentation--```bash-# View all documentation-ls $PAI_DIR/documentation/--# Getting started guide-open $PAI_DIR/documentation/how-to-start.md--# Skills system explanation-open $PAI_DIR/documentation/skills-system.md--# Architecture overview-open $PAI_DIR/documentation/architecture.md-```--### Community--- 🐛 **Report Issues:** https://github.com/danielmiessler/Personal_AI_Infrastructure/issues-- 💬 **Discussions:** https://github.com/danielmiessler/Personal_AI_Infrastructure/discussions-- ⭐ **Star the Repo:** https://github.com/danielmiessler/Personal_AI_Infrastructure-- 📝 **Blog:** https://danielmiessler.com/blog/personal-ai-infrastructure-- 🎬 **Video:** https://youtu.be/iKwRWwabkEc-------## 🔑 Environment Variables--| Variable | Purpose | Example |-|----------|---------|---------|-| `PAI_DIR` | PAI installation location | `/Users/daniel/PAI` |-| `PAI_HOME` | Your home directory | `/Users/daniel` |-| `DA` | AI assistant name | `Kai` |-| `DA_COLOR` | Display color | `purple` |-| `PORT` | Voice server port | `8888` |-| `PERPLEXITY_API_KEY` | Perplexity research | `pk-...` |-| `GOOGLE_API_KEY` | Gemini AI | `AIza...` |-| `REPLICATE_API_TOKEN` | AI generation | `r8_...` |-| `OPENAI_API_KEY` | GPT integration | `sk-...` |-------## 💡 Pro Tips--### Aliases for Speed--Add these to your `~/.zshrc`:--```bash-# Quick navigation-alias pai='cd $PAI_DIR'-alias pskills='ls $PAI_DIR/skills'-alias pcmds='ls $PAI_DIR/commands'--# Quick edits-alias pai-env='open -e $PAI_DIR/.env'-alias pai-skill='open -e $PAI_DIR/skills/PAI/SKILL.md'-alias pai-shell='open -e ~/.zshrc'--# Updates-alias pai-update='cd $PAI_DIR && git pull'-alias pai-status='cd $PAI_DIR && git status'--# Voice-alias pai-voice='cd $PAI_DIR/voice-server && bun server.ts &'-alias pai-test='curl -X POST http://localhost:8888/notify -d "{\"message\":\"Test\"}"'-```--### Keyboard Shortcuts in Terminal--- `Ctrl+R` - Search command history-- `Ctrl+A` - Jump to start of line-- `Ctrl+E` - Jump to end of line-- `Ctrl+U` - Clear line-- `Ctrl+C` - Cancel current command-- `Ctrl+D` - Exit terminal-------## 📱 Quick Access URLs--Keep these bookmarked:--- **GitHub Repo:** https://github.com/danielmiessler/Personal_AI_Infrastructure-- **Issues:** https://github.com/danielmiessler/Personal_AI_Infrastructure/issues-- **Discussions:** https://github.com/danielmiessler/Personal_AI_Infrastructure/discussions-- **Claude Code:** https://claude.ai/code-- **Perplexity API:** https://www.perplexity.ai/settings/api-- **Google AI Studio:** https://aistudio.google.com/app/apikey-- **Replicate:** https://replicate.com/account/api-tokens-------**Last Updated:** October 2025--**Questions?** File an issue or start a discussion on GitHub!-------*Keep this page bookmarked for quick reference!* 🔖diff --git a/.claude/documentation/README.md b/.claude/documentation/README.mddeleted file mode 100644index 59af19c3..00000000--- a/.claude/documentation/README.md+++ /dev/null@@ -1,208 +0,0 @@-# PAI System Documentation--> [!IMPORTANT]-> **v0.6.0 MAJOR UPDATE:** Directory structure changed to `.claude/`-> - All PAI infrastructure now in `.claude/` directory-> - Repository mirrors your actual `~/.claude/` working system-> - Copy `.claude/` from repo to `~/.claude/` for installation--Welcome to the Personal AI Infrastructure (PAI) documentation. PAI is a comprehensive system for integrating AI assistants into your personal workflow with advanced context management, automation, and extensibility.--## 📚 Documentation Index--### 🚀 New to PAI? Start Here!--> **👉 [Getting Started Guide](./how-to-start.md)** - Complete setup guide with automated option->-> **👉 [Quick Reference](./QUICK-REFERENCE.md)** - Bookmark this for daily commands--### Getting Started-- **[How to Start Guide](./how-to-start.md)** - Complete setup with step-by-step instructions-- [Quick Reference](./QUICK-REFERENCE.md) - Common commands and troubleshooting-- [Installation Guide](./installation.md) - Detailed installation instructions (optional)-- [Configuration Guide](./configuration.md) - System configuration options (optional)--### Core Concepts-- [System Architecture](./architecture.md) - Overview of PAI components-- [Skills System](./skills-system.md) - Modular capability packages with progressive disclosure-- [Hook System](./hook-system.md) - Event-driven automation-- [Agent System](./agent-system.md) - Specialized AI agents--### Components-- [Voice Server](../voice-server/README.md) - Voice notification system-- [Context Management](./context-management.md) - Dynamic context loading-- [Command System](./command-system.md) - Custom commands and scripts--### Development-- [API Reference](./api-reference.md) - HTTP APIs and interfaces-- [Security Guide](./security.md) - Security best practices-- [Contributing](./contributing.md) - How to contribute to PAI--## 🚀 What is PAI?--PAI (Personal AI Infrastructure) is a powerful framework that enhances AI assistants with:--- **Skills System**: Modular capability packages activated by intent-- **Progressive Disclosure**: Load information as needed (SKILL.md → CLAUDE.md → Resources)-- **Hook System**: Event-driven automation for tool calls-- **Voice Notifications**: macOS native voice feedback with distinct agent voices-- **Multi-Agent Architecture**: Specialized agents for different tasks-- **Security First**: Built with security best practices--## 🎯 Key Features--### 1. Skills Intelligence-- Intent-based skill activation-- Progressive information disclosure-- Modular capability packages-- Dynamic agent selection--### 2. Automation-- Pre and post-execution hooks-- Custom command integration-- Workflow automation-- Event-driven responses--### 3. Voice Integration-- macOS native Premium/Enhanced voices-- Zero API costs (100% offline)-- Distinct voices for Kai and each agent-- Real-time completion notifications--### 4. Security-- Input validation and sanitization-- Rate limiting-- CORS protection-- No hardcoded secrets--## 🏗️ System Components--```-~/.claude/ # PAI installation directory-├── skills/ # Modular capability packages-├── hooks/ # Event hooks-├── commands/ # Custom slash commands-├── agents/ # Specialized AI agents-├── voice-server/ # Voice notification server-├── documentation/ # System documentation-├── settings.json # Configuration-├── .mcp.json # MCP servers-└── .env # Environment variables (create from .env.example)-```--## 🔧 Environment Variables--PAI uses environment variables for configuration:--- `PAI_DIR`: PAI configuration directory (points to PAI_DIRECTORY)-- `PAI_HOME`: Your home directory-- `PORT`: Voice server port (default: 8888)-- `DA`: Digital Assistant name (optional)-- `DA_COLOR`: Display color (optional)--## 📖 Quick Links--- [System Requirements](#system-requirements)-- [Installation](#installation)-- [Configuration](#configuration)-- [Usage Examples](#usage-examples)-- [Troubleshooting](#troubleshooting)--## System Requirements--- macOS 11+ (primary support)-- Bun runtime-- AI assistant access (Claude, GPT, Gemini, etc.)-- Optional: ElevenLabs API key-- Optional: SwiftBar for menu indicators--## Installation--```bash-# Clone PAI repository-git clone https://github.com/danielmiessler/Personal_AI_Infrastructure.git-cd Personal_AI_Infrastructure--# Copy .claude directory to your home-cp -r .claude ~/.claude--# Configure environment-cp ~/.claude/.env.example ~/.claude/.env-# Edit ~/.claude/.env with your settings--# Set PAI_DIR (optional, for repo development)-export PAI_DIR="$HOME/PAI" # Points to repo root-export PAI_HOME="$HOME"--# Start voice server (optional)-cd ~/.claude/voice-server-bun server.ts &-```--## Configuration--PAI is configured through:-1. Environment variables in `~/.claude/.env`-2. Skills in `~/.claude/skills/`-3. Hook scripts in `~/.claude/hooks/`-4. Agent definitions in `~/.claude/agents/`-5. Slash commands in `~/.claude/commands/`-6. MCP servers in `~/.claude/.mcp.json`-7. Settings in `~/.claude/settings.json`--## Usage Examples--### Skill Activation-```bash-# Skills activate based on intent matching-"Help me with prompt engineering" → Activates prompting skill-"Create a new skill for X" → Activates create-skill-"Do research on AI trends" → Activates research skill (launches agents)-```--### Voice Notifications-```bash-# Send voice notification-curl -X POST http://localhost:8888/notify \- -d '{"message": "Task completed"}'-```--### Hook System-```yaml-# ${PAI_DIR}/hooks/user-prompt-submit.sh-# Automatically loads context before processing prompts-```--## Troubleshooting--Common issues and solutions:--| Issue | Solution |-|-------|----------|-| Skill not activating | Check skill description in `<available_skills>` |-| Voice not working | Verify voice server running: `curl http://localhost:8888/health` |-| Hooks not triggering | Ensure hook scripts are executable |-| Port conflicts | Change PORT in `${PAI_DIR}/.env` |--## Contributing--PAI is open for contributions. See [Contributing Guide](./contributing.md) for:-- Code style guidelines-- Pull request process-- Issue reporting-- Feature requests--## Support--- GitHub Issues: Report bugs and request features-- Documentation: This directory contains all documentation-- Community: Join discussions in the repository--## License--PAI is part of the Personal AI Infrastructure project.-------*Last updated: [Current Date]*-*Version: 1.0.0*\ No newline at end of filediff --git a/.claude/documentation/VOICE-SETUP-GUIDE.md b/.claude/documentation/VOICE-SETUP-GUIDE.mddeleted file mode 100644index 353bf2d1..00000000--- a/.claude/documentation/VOICE-SETUP-GUIDE.md+++ /dev/null@@ -1,463 +0,0 @@-# Complete Voice Setup Guide for PAI--## 🎯 Quick Start (5 Minutes)--This guide will walk you through setting up high-quality, natural-sounding voices for Kai and all your agents. The voices are **completely free**, work **100% offline**, and sound like real people (not robots).-------## Part 1: Downloading Premium Voices from macOS--### Step 1: Open System Settings--**On macOS 13 (Ventura) and later:**--1. Click the **Apple menu** () in the top-left corner of your screen-2. Click **System Settings** (it has a gear icon ⚙️)-3. In the sidebar on the left, scroll down until you see **Voice (Live Speech)**-4. Click **Voice (Live Speech)**--**What you'll see:**-A window with voice and speech-related settings including spoken content options.--### Step 2: Access Voice Management--1. Look for the **System voice** dropdown menu- - It should be near the top of the Voice settings panel- - Shows the currently selected system voice--2. Click on the **System voice** dropdown--**What you'll see:**-A dropdown menu showing currently installed voices.--### Step 3: Download Premium Voices--1. Find the **System voice** dropdown (it's usually near the top)-2. Click on the dropdown - you'll see a list of currently installed voices-3. Look for a button that says either:- - **"Manage Voices..."** or- - **"Customize..."**-4. Click that button--**What you'll see:**-A new panel opens showing ALL available voices organized by language. Each voice shows:-- Voice name-- Language/region (like "English (United States)")-- Gender (Male/Female)-- Quality label: **Premium**, **Enhanced**, or nothing (legacy/compact)-- Download size (in MB)-- A download button (cloud icon ↓) if not installed-- A checkmark (✓) if already installed--### Step 4: Download the Core PAI Voices--You need to download **6 specific voices**. Here they are in order:--#### Voice 1: Jamie (Premium) - For Kai-- **Full name:** Jamie-- **Language:** English (United Kingdom)-- **Label:** Premium-- **Gender:** Male-- **Size:** ~120 MB-- **Used for:** Kai (your main assistant)--**How to download:**-1. Scroll to the **English (United Kingdom)** section-2. Find **"Jamie"** with the **(Premium)** label-3. Click the download icon (cloud with ↓ arrow) next to it-4. Wait for the download to complete (progress bar appears)--#### Voice 2: Ava (Premium) - For Researcher-- **Full name:** Ava-- **Language:** English (United States)-- **Label:** Premium-- **Gender:** Female-- **Size:** ~457 MB (⭐ **This is the largest and highest quality!**)-- **Used for:** Researcher agent--**How to download:**-1. Scroll to the **English (United States)** section-2. Find **"Ava"** with the **(Premium)** label-3. Click the download icon-4. **Note:** This is a large file, so it may take 3-5 minutes depending on your internet speed-5. You can continue downloading other voices while this one downloads--#### Voice 3: Serena (Premium) - For Architect-- **Full name:** Serena-- **Language:** English (United Kingdom)-- **Label:** Premium-- **Gender:** Female-- **Size:** ~195 MB-- **Used for:** Architect agent--**How to download:**-1. In the **English (United Kingdom)** section-2. Find **"Serena"** with the **(Premium)** label-3. Click the download icon--#### Voice 4: Isha (Premium) - For Designer-- **Full name:** Isha-- **Language:** English (India)-- **Label:** Premium-- **Gender:** Female-- **Size:** ~117 MB-- **Used for:** Designer agent--**How to download:**-1. Scroll to the **English (India)** section-2. Find **"Isha"** with the **(Premium)** label-3. Click the download icon--#### Voice 5: Tom (Enhanced) - For Engineer-- **Full name:** Tom-- **Language:** English (United States)-- **Label:** Enhanced-- **Gender:** Male-- **Size:** ~392 MB-- **Used for:** Engineer agent--**How to download:**-1. In the **English (United States)** section-2. Find **"Tom"** with the **(Enhanced)** label-3. Click the download icon--#### Voice 6: Oliver (Enhanced) - For Pentester-- **Full name:** Oliver-- **Language:** English (United Kingdom)-- **Label:** Enhanced-- **Gender:** Male-- **Size:** ~127 MB-- **Used for:** Pentester agent--**How to download:**-1. In the **English (United Kingdom)** section-2. Find **"Oliver"** with the **(Enhanced)** label-3. Click the download icon--### Step 5: Wait for All Downloads to Complete--- Downloads happen in the background-- You can close the Manage Voices window and continue using your Mac-- Total download size: ~1.4 GB for all 6 voices-- Total time: 5-15 minutes depending on your internet speed--**Tip:** You can check download progress by reopening the Manage Voices window. Completed downloads show a checkmark (✓).--### Step 6: Verify Installation--Once all downloads are complete, verify they're installed:--1. Open Terminal (Applications → Utilities → Terminal)-2. Run this command:- ```bash- say -v '?' | grep "Premium\|Enhanced"- ```--**Expected output:**-```-Ava (Premium) en_US # Hello! My name is Ava.-Isha (Premium) en_IN # Hello! My name is Isha.-Jamie (Premium) en_GB # Hello! My name is Jamie.-Oliver (Enhanced) en_GB # Hello! My name is Oliver.-Serena (Premium) en_GB # Hello! My name is Serena.-Tom (Enhanced) en_US # Hello! My name is Tom.-```--You should see all 6 voices listed!-------## Part 2: Testing the Voices--Let's hear each voice to make sure they work and sound great!--### Test Each Voice--Copy and paste these commands into Terminal one at a time:--```bash-# Test Kai's voice (Jamie - UK Male)-say -v "Jamie (Premium)" "Hello, I'm Kai, your personal AI assistant"--# Test Researcher voice (Ava - US Female)-say -v "Ava (Premium)" "I'm the Researcher agent, ready to find information for you"--# Test Engineer voice (Tom - US Male)-say -v "Tom (Enhanced)" "I'm the Engineer agent, ready to build your applications"--# Test Architect voice (Serena - UK Female)-say -v "Serena (Premium)" "I'm the Architect agent, ready to design your systems"--# Test Designer voice (Isha - Indian Female)-say -v "Isha (Premium)" "I'm the Designer agent, ready to create beautiful interfaces"--# Test Pentester voice (Oliver - UK Male)-say -v "Oliver (Enhanced)" "I'm the Pentester agent, ready to test your security"-```--**What you should hear:**-- Each voice should sound natural and human-like-- Clear differences in accent (US, UK, Indian)-- Clear differences in gender and tone-- **NOT robotic** - if a voice sounds robotic, you downloaded the wrong one!-------## Part 3: Setting Up the Voice Server--### Step 1: Navigate to Voice Server Directory--```bash-cd ~/.claude/voice-server-```--If that doesn't work (directory doesn't exist), the PAI system isn't fully installed yet. Go back to the main PAI installation guide first.--### Step 2: Start the Voice Server--```bash-bun server.ts &-```--**Expected output:**-```-🚀 PAIVoice Server running on port 8888-🎙️ Using macOS native voices (default: Jamie (Premium) - Highest Quality)-📡 POST to http://localhost:8888/notify-🔒 Security: CORS restricted to localhost, rate limiting enabled-```--### Step 3: Verify Server is Running--```bash-curl http://localhost:8888/health-```--**Expected output:**-```json-{- "status": "healthy",- "port": 8888,- "voice_system": "macOS Native",- "default_voice": "Jamie (Premium)"-}-```--### Step 4: Test Voice Notification--```bash-curl -X POST http://localhost:8888/notify \- -H "Content-Type: application/json" \- -d '{"message":"Voice system is working perfectly","voice_name":"Jamie (Premium)"}'-```--**What should happen:**-- You hear Jamie's voice say "Voice system is working perfectly"-- A macOS notification appears-- Terminal shows: `{"status":"success","message":"Notification sent"}`-------## Part 4: Understanding the System--### How Voice Selection Works--When you use Kai or ask an agent to do something:--1. They complete the task-2. They respond with a `🎯 COMPLETED:` line at the end-3. The stop-hook intercepts this-4. It determines who completed the task (Kai or which agent)-5. It sends the completion message to the voice server-6. The voice server speaks it using the appropriate voice-7. You hear the completion announcement!--### Voice Personality Matching--| Entity | Voice | Why This Voice? |-|--------|-------|----------------|-| Kai | Jamie (UK Male) | Professional, conversational, trustworthy |-| Researcher | Ava (US Female) | Clear, analytical, highest quality available |-| Engineer | Tom (US Male) | Steady, professional, reliable |-| Architect | Serena (UK Female) | Sophisticated, strategic, thoughtful |-| Designer | Isha (Indian Female) | Creative, distinct, artistic |-| Pentester | Oliver (UK Male) | Technical, sharp, focused |-------## Troubleshooting--### Problem: Voice Sounds Robotic--**Cause:** You downloaded the wrong voice (Compact/Legacy instead of Premium/Enhanced)--**Solution:**-1. Go back to System Settings → Voice (Live Speech) → Manage Voices-2. Make sure you're downloading voices labeled **(Premium)** or **(Enhanced)**-3. Voices without these labels are old and robotic - don't use them!--### Problem: Voice Not Found--**Error message:** `say: unknown voice`--**Solution:**-1. Verify voice is downloaded:- ```bash- say -v '?' | grep "Jamie (Premium)"- ```-2. If it doesn't appear, download it again from System Settings-3. If it still doesn't work, try logging out and back in--### Problem: No Sound--**Check these:**-1. System volume is not muted-2. Output device is set correctly (System Settings → Sound)-3. Voice server is running (`curl http://localhost:8888/health`)-4. Test directly: `say -v "Jamie (Premium)" "test"`--### Problem: Voice Server Won't Start--**Error:** `Port 8888 already in use`--**Solution:**-```bash-# Kill any existing server on port 8888-lsof -ti:8888 | xargs kill -9--# Start the server again-cd ~/.claude/voice-server-bun server.ts &-```--### Problem: Wrong Voice Playing--**Check the configuration:**-```bash-# Check which voice is mapped to which entity-grep "const VOICES" ~/.claude/hooks/stop-hook.ts--# Check agent configuration-grep "voiceId:" ~/.claude/agents/*.md-```--The voices should match the table in Part 4 above.-------## Advanced: Customizing Voices--### Want to Use Different Voices?--You can choose any Premium or Enhanced voice! Here's how:--1. Download your preferred voice from System Settings-2. Update the voice mapping in `~/.claude/hooks/stop-hook.ts`:- ```typescript- const VOICES = {- kai: "Jamie (Premium)", // Change this to your preferred voice- researcher: "Ava (Premium)", // Or change any agent voice- // ... etc- };- ```-3. Restart the voice server-4. Test it!--### Available Premium/Enhanced Voices--**US Accents:**-- Ava (Premium, Female) - Highest quality-- Tom (Enhanced, Male)-- Allison (Enhanced, Female)-- Samantha (Enhanced, Female) - Warm and friendly-- Nathan (Enhanced, Male)-- Joelle (Enhanced, Female)-- Nicky (Enhanced, Female)-- Noelle (Enhanced, Female)--**UK Accents:**-- Jamie (Premium, Male)-- Serena (Premium, Female)-- Daniel (Enhanced, Male)-- Kate (Enhanced, Female)-- Oliver (Enhanced, Male)-- Stephanie (Enhanced, Female)--**Indian Accents:**-- Isha (Premium, Female)-- Rishi (Enhanced, Male)-- Sangeeta (Enhanced, Female)-- Veena (Enhanced, Female)--**Other English Accents:**-- Moira (Enhanced, Female) - Irish-- Tessa (Enhanced, Female) - South African-------## Frequently Asked Questions--**Q: Do these voices cost money?**-A: No! They're completely free and included with macOS.--**Q: Do I need an internet connection?**-A: Only for the initial download. After that, voices work 100% offline forever.--**Q: How much disk space do I need?**-A: About 1.4 GB for the 6 core voices, or 2-4 GB if you download all available Premium/Enhanced voices.--**Q: Can I remove voices I don't use?**-A: Yes! In Manage Voices, click the (-) button next to any voice.--**Q: Will this slow down my Mac?**-A: No. The voice server uses only 20-30 MB of RAM and voice generation is near-instant.--**Q: What if I have an older macOS?**-A: Premium and Enhanced voices require macOS 13.0 (Ventura) or later. On older systems, you're limited to legacy voices which don't sound as good.--**Q: Can I use these voices for other applications?**-A: Yes! Any Mac app that uses the system `say` command can use these voices.--**Q: How do I know if a voice is Premium vs Enhanced?**-A: In the Manage Voices window, the label appears right next to the voice name. Premium voices are the highest quality, Enhanced are also excellent, and voices with no label are legacy/compact (avoid these).-------## Quick Reference--**Essential Commands:**-```bash-# List all Premium/Enhanced voices-say -v '?' | grep "Premium\|Enhanced"--# Test a specific voice-say -v "Jamie (Premium)" "test message"--# Start voice server-cd ~/.claude/voice-server && bun server.ts &--# Check server health-curl http://localhost:8888/health--# Stop voice server-lsof -ti:8888 | xargs kill -9-```--**File Locations:**-- Voice server: `~/.claude/voice-server/server.ts`-- Stop hook: `~/.claude/hooks/stop-hook.ts`-- Agent configs: `~/.claude/agents/*.md`-- Documentation: `~/.claude/documentation/voice-system.md`-------## You're All Set! 🎉--Your PAI voice system is now configured with high-quality, natural-sounding voices. Every time Kai or an agent completes a task, you'll hear a voice announcement in their distinct voice.--Enjoy your AI assistant system with personality!-------**Need more help?** Check the full [Voice System Documentation](voice-system.md) for advanced configuration and troubleshooting.\ No newline at end of filediff --git a/.claude/documentation/agent-system.md b/.claude/documentation/agent-system.mddeleted file mode 100644index 9061a505..00000000--- a/.claude/documentation/agent-system.md+++ /dev/null@@ -1,480 +0,0 @@-# PAI Agent System--## Overview--The PAI Agent System provides specialized AI agents for different domains and tasks. Each agent has specific capabilities, tools, and expertise to handle complex, multi-step tasks autonomously.--## Available Agents--### 1. General-Purpose Agent--**Purpose**: Default agent for complex, multi-step tasks and general problem-solving.--**Capabilities**:-- Research and information gathering-- Code implementation-- Multi-step task execution-- File system operations-- Web searches--**When to use**:-- Complex tasks requiring multiple steps-- Tasks that span multiple domains-- When you need comprehensive problem-solving-- General automation tasks--**Example triggers**:-```-"Help me solve this complex problem"-"I need to complete multiple tasks"-"Can you figure out how to..."-```--### 2. Researcher Agent--**Purpose**: Specialized in web research, information gathering, and analysis.--**Capabilities**:-- Web searches and crawling-- Information synthesis-- Fact-checking and verification-- Trend analysis-- Literature reviews--**When to use**:-- Finding latest information-- Researching topics in depth-- Gathering multiple sources-- Analyzing trends and patterns--**Example triggers**:-```-"Research the latest AI developments"-"Find information about..."-"What's the current state of..."-```--### 3. Engineer Agent--**Purpose**: Professional software engineering and development tasks.--**Capabilities**:-- Code implementation-- Debugging and troubleshooting-- Performance optimization-- Testing and validation-- Architecture design-- Best practices implementation--**When to use**:-- Writing production-ready code-- Debugging complex issues-- Optimizing performance-- Implementing technical solutions-- Code reviews--**Example triggers**:-```-"Implement this feature"-"Debug this issue"-"Optimize this code"-"Write tests for..."-```--### 4. Designer Agent--**Purpose**: UI/UX design and visual development.--**Capabilities**:-- User interface design-- User experience optimization-- Design system creation-- Prototyping-- Visual testing-- Accessibility improvements-- Browser automation for testing--**When to use**:-- Creating user interfaces-- Improving user experience-- Visual testing and validation-- Design system development-- Accessibility audits--**Example triggers**:-```-"Design a dashboard"-"Improve the UX of..."-"Create a design system"-"Test the visual appearance"-```--### 5. Pentester Agent--**Purpose**: Security testing and vulnerability assessment.--**Capabilities**:-- Vulnerability scanning-- Security audits-- Penetration testing-- Code security review-- Network analysis-- Security best practices--**When to use**:-- Security assessments-- Finding vulnerabilities-- Testing security measures-- Code security reviews-- Compliance checks--**Example triggers**:-```-"Test the security of..."-"Find vulnerabilities in..."-"Perform a security audit"-"Check for security issues"-```--### 6. Architect Agent--**Purpose**: System architecture and technical specifications.--**Capabilities**:-- System design-- Technical documentation-- PRD creation-- Feature breakdown-- Implementation planning-- Architecture diagrams-- Technology selection--**When to use**:-- Planning large projects-- Creating technical specifications-- System design decisions-- Breaking down complex features-- Documentation creation--**Example triggers**:-```-"Design the architecture for..."-"Create a PRD for..."-"Plan the implementation of..."-"Break down this feature"-```--### 7. Writer Agent--**Purpose**: Content creation and documentation.--**Capabilities**:-- Technical writing-- Blog posts and articles-- Documentation-- Copy writing-- Content editing-- Style consistency--**When to use**:-- Creating content-- Writing documentation-- Blog posts-- Marketing copy-- Technical articles--**Example triggers**:-```-"Write a blog post about..."-"Create documentation for..."-"Draft an article on..."-```--## Agent Selection--### Automatic Selection--The UFC system automatically selects agents based on semantic analysis of your request:--```python-def select_agent(user_intent):- intent_keywords = analyze_intent(user_intent)-- if "research" in intent_keywords:- return "researcher"- elif "code" or "debug" in intent_keywords:- return "engineer"- elif "design" or "ui" in intent_keywords:- return "designer"- elif "security" or "vulnerability" in intent_keywords:- return "pentester"- elif "architecture" or "specification" in intent_keywords:- return "architect"- elif "write" or "content" in intent_keywords:- return "writer"- else:- return "general-purpose"-```--### Manual Selection--You can explicitly request a specific agent:--```-"Use the engineer agent to implement this feature"-"Have the researcher find information about X"-"Get the pentester to check security"-```--## Agent Configuration--### Agent Context Files--Each agent can have specific context:--```-${PAI_DIR}/context/agents/-├── researcher.md-├── engineer.md-├── designer.md-├── pentester.md-├── architect.md-└── writer.md-```--### Custom Agent Instructions--Create agent-specific instructions:--```markdown-# Engineer Agent Context--## Coding Standards-- Use TypeScript for type safety-- Follow functional programming principles-- Write comprehensive tests-- Document all functions--## Tools Priority-1. Use existing libraries-2. Follow project conventions-3. Optimize for maintainability-```--## Multi-Agent Collaboration--### Sequential Agents--Agents can work in sequence:--```-1. Architect creates specification-2. Engineer implements solution-3. Pentester validates security-4. Writer creates documentation-```--### Parallel Agents--Launch multiple agents simultaneously:--```bash-# In your request-"Run these in parallel:-- Research latest security threats-- Engineer the authentication system-- Design the user interface"-```--## Agent Tools--Each agent has access to specific tools:--### General Tools (All Agents)-- File operations (Read, Write, Edit)-- Shell commands (Bash)-- Web searches-- Pattern matching (Grep, Glob)--### Specialized Tools--**Researcher**:-- Advanced web searches-- Academic databases-- Trend analysis tools--**Engineer**:-- Code analysis-- Testing frameworks-- Debugging tools-- Performance profilers--**Designer**:-- Browser automation-- Screenshot tools-- Visual comparison-- Accessibility checkers--**Pentester**:-- Security scanners-- Network tools-- Vulnerability databases-- Exploit frameworks--## Best Practices--### 1. Agent Selection-- Let the system auto-select when unsure-- Use specific agents for specialized tasks-- Combine agents for complex projects--### 2. Task Decomposition-- Break complex tasks into agent-specific parts-- Use the architect for planning-- Assign specialized tasks to appropriate agents--### 3. Quality Assurance-- Use pentester for security validation-- Use engineer for code quality-- Use designer for UX validation--### 4. Documentation-- Always use writer for user-facing content-- Use architect for technical specifications-- Use engineer for code documentation--## Agent Performance--### Optimization Tips--1. **Clear Instructions**: Be specific about requirements-2. **Context Loading**: Provide relevant context files-3. **Tool Selection**: Let agents choose appropriate tools-4. **Parallel Execution**: Use multiple agents when possible--### Performance Metrics--| Agent | Speed | Accuracy | Complexity |-|-------|-------|----------|------------|-| General | Medium | High | High |-| Researcher | Slow | Very High | Medium |-| Engineer | Fast | High | High |-| Designer | Medium | High | Medium |-| Pentester | Slow | Very High | High |-| Architect | Medium | High | Very High |-| Writer | Fast | High | Low |--## Troubleshooting--### Agent Not Selected--```bash-# Check intent matching-grep "AGENT:" ${HOME}/Library/Logs/ufc.log--# Manually specify agent-"Please use the engineer agent to..."-```--### Agent Performance Issues--```bash-# Enable agent debugging-export AGENT_DEBUG=true--# Check agent logs-tail -f ${HOME}/Library/Logs/agent-*.log-```--### Agent Errors--Common issues and solutions:--| Issue | Solution |-|-------|----------|-| Wrong agent selected | Specify agent explicitly |-| Agent timeout | Break task into smaller parts |-| Tool access denied | Check permissions |-| Context not loaded | Verify context files exist |--## Advanced Features--### Custom Agent Creation--Create your own specialized agent:--```bash-# 1. Define agent in context-cat > ${PAI_DIR}/context/agents/custom.md << EOF-# Custom Agent-Specialized for specific domain...-EOF--# 2. Add to UFC system-# Edit user-prompt-submit-hook to include custom agent--# 3. Define agent tools-# Specify which tools the agent can access-```--### Agent Chaining--Chain agents for complex workflows:--```python-workflow = [- ("architect", "Create system design"),- ("engineer", "Implement core features"),- ("designer", "Create user interface"),- ("pentester", "Security validation"),- ("writer", "Create documentation")-]-```--### Agent Templates--Create reusable agent configurations:--```yaml-template: web_project-agents:- - architect: specification- - engineer: backend- - designer: frontend- - pentester: security- - writer: documentation-```--## Future Developments--### Planned Enhancements--1. **Agent Learning**: Agents that improve over time-2. **Agent Marketplace**: Share custom agents-3. **Visual Agent Builder**: GUI for agent creation-4. **Agent Analytics**: Performance tracking-5. **Agent Collaboration**: Better multi-agent coordination--### Experimental Features--- Self-organizing agent teams-- Agent skill trees-- Domain-specific agent training-- Agent personality customization-------*Agent System Version 1.0.0*-*Part of the PAI Infrastructure*--## Recent Changes (2025-10-19)--- ✏️ `agents/claude-researcher.md` (modified)- - +3 / -3 lines-- ✏️ `agents/gemini-researcher.md` (modified)- - +3 / -3 lines-- ✏️ `agents/perplexity-researcher.md` (modified)- - +3 / -3 lines------<!-- Last Updated: 2025-10-19 -->diff --git a/.claude/documentation/architecture.md b/.claude/documentation/architecture.mddeleted file mode 100644index 84589daf..00000000--- a/.claude/documentation/architecture.md+++ /dev/null@@ -1,283 +0,0 @@-# PAI System Architecture--> [!IMPORTANT]-> **v0.6.0 Directory Structure Update**-> As of v0.6.0, all PAI infrastructure lives in the `.claude/` directory:-> - **Repository:** `/PAI/.claude/` contains all infrastructure-> - **Your System:** `~/.claude/` is where you install PAI-> - **Migration:** Copy `.claude/` from repo to `~/.claude/` on your system->-> This structure ensures the repository properly mirrors how PAI works in production.--## Overview--PAI (Personal AI Infrastructure) is a modular, event-driven system that enhances AI assistants with dynamic context management, automation, and extensibility. The architecture follows a layered approach with clear separation of concerns.--## Architecture Diagram--```-┌─────────────────────────────────────────────────────────────┐-│ User Interface │-│ (Claude Desktop, Terminal, API) │-└────────────────┬────────────────────────────────────────────┘- │-┌────────────────▼────────────────────────────────────────────┐-│ Hook System Layer │-│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │-│ │ Pre-prompt │ │ Tool hooks │ │ Post-exec │ │-│ │ Hooks │ │ │ │ Hooks │ │-│ └──────────────┘ └──────────────┘ └──────────────┘ │-└────────────────┬────────────────────────────────────────────┘- │-┌────────────────▼────────────────────────────────────────────┐-│ Skills System │-│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │-│ │ Intent │ │ Skill │ │ Progressive │ │-│ │ Matching │ │ Activation │ │ Loading │ │-│ └──────────────┘ └──────────────┘ └──────────────┘ │-└────────────────┬────────────────────────────────────────────┘- │-┌────────────────▼────────────────────────────────────────────┐-│ Agent System │-│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │-│ │ Researcher │ │ Engineer │ │ Pentester │ │-│ │ │ │ │ │ │ │-│ └──────────────┘ └──────────────┘ └──────────────┘ │-└────────────────┬────────────────────────────────────────────┘- │-┌────────────────▼────────────────────────────────────────────┐-│ Service Layer │-│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │-│ │ Voice Server │ │ MCP Tools │ │ Commands │ │-│ │ │ │ │ │ │ │-│ └──────────────┘ └──────────────┘ └──────────────┘ │-└──────────────────────────────────────────────────────────────┘-```--## Core Components--### 1. Hook System Layer--The hook system provides event-driven automation throughout the AI interaction lifecycle.--**Key Features:**-- **Pre-prompt hooks**: Execute before user prompts are processed-- **Tool hooks**: Intercept and modify tool calls-- **Post-execution hooks**: Run after commands complete--**Location:** `~/.claude/hooks/`--### 2. Skills System--The Skills System provides modular, self-contained capability packages that extend AI functionality with specialized knowledge and workflows.--**Key Features:**-- **Intent Matching**: Activates skills based on user request understanding-- **Progressive Disclosure**: SKILL.md → CLAUDE.md → Resources-- **Modular Design**: Self-contained with templates and components-- **Global Inheritance**: All skills automatically access global context--**Location:** `~/.claude/skills/`--### 3. Agent System--Specialized AI agents for different domains and tasks.--**Available Agents:**-- **General-purpose**: Default agent for most tasks-- **Researcher**: Web research and information gathering-- **Engineer**: Software development and debugging-- **Designer**: UI/UX and visual design-- **Pentester**: Security testing and vulnerability assessment-- **Architect**: System design and technical specifications--### 4. Service Layer--Supporting services that provide additional functionality.--**Services:**-- **Voice Server**: Text-to-speech notifications-- **MCP Tools**: Model Context Protocol integrations-- **Command System**: Custom command execution--## Data Flow--### 1. User Input Flow-```-User Input → Hook System → UFC Context → Agent Selection → Processing-```--1. User submits a prompt-2. Pre-prompt hooks execute-3. UFC system analyzes intent-4. Relevant context is loaded-5. Appropriate agent is selected-6. Prompt is processed with context--### 2. Tool Execution Flow-```-Tool Request → Hook Validation → Execution → Post-hook → Response-```--1. AI requests tool execution-2. Tool hooks validate/modify request-3. Tool executes-4. Post-execution hooks run-5. Response returned to AI--### 3. Context Loading Flow-```-Intent Analysis → Pattern Matching → Context Selection → Dynamic Loading-```--1. System analyzes user intent-2. Matches against context patterns-3. Selects appropriate contexts-4. Loads context files dynamically--## Directory Structure--```-${PAI_DIR}/-├── skills/ # Modular capability packages-│ ├── prompting/ # Prompt engineering guide-│ ├── create-skill/ # Skill creation framework-│ ├── development/ # Software development-│ └── [custom]/ # Your custom skills-├── hooks/ # Event hooks-│ ├── user-prompt-submit-hook-│ ├── tool-use-hook-│ └── post-execution-hook-├── commands/ # Custom slash commands-│ └── *.md # Command definitions-├── agents/ # Specialized AI agents-│ ├── engineer.md-│ ├── researcher.md-│ └── [others].md-├── voice-server/ # Voice notification service-│ ├── server.ts # Server implementation-│ ├── voices.json # Voice configuration-│ └── menubar/ # Menu bar integration-├── documentation/ # System documentation-└── statusline-command.sh--${HOME}/-├── Documentation/ # User documentation-├── Projects/ # User projects-└── Library/ # System libraries- └── Logs/ # System logs-```--## Communication Protocols--### HTTP APIs--**Voice Server API:**-- `POST /notify` - Send voice notification-- `GET /health` - Health check-- `POST /pai` - PAI-specific notifications--**Request Format:**-```json-{- "message": "Text to speak",- "voice_id": "optional_voice_id",- "title": "Optional Title"-}-```--### Hook Protocol--Hooks communicate through:-1. **Environment Variables**: Pass configuration-2. **Standard I/O**: Input/output piping-3. **Exit Codes**: Success/failure signaling-4. **File System**: Shared context files--## Security Architecture--### Input Validation-- All user inputs sanitized-- Shell metacharacters blocked-- Length limits enforced--### Process Isolation-- Spawn with argument arrays-- No shell interpretation-- Restricted permissions--### Network Security-- CORS restricted to localhost-- Rate limiting per IP-- Authentication tokens (when configured)--### Data Protection-- No hardcoded credentials-- Environment variable configuration-- Secure file permissions--## Extensibility Points--### 1. Adding Skills-Create new skills in:-- `${PAI_DIR}/skills/[skill-name]/` - Skill directory-- `SKILL.md` - Quick reference (required)-- `CLAUDE.md` - Comprehensive guide (optional)-- Add to global context for discovery--### 2. Adding Hooks-Create executable scripts in:-- `${PAI_DIR}/hooks/` - Event hooks--### 3. Adding Agents-Define new agents in:-- `${PAI_DIR}/agents/[name].md` - Agent configuration--### 4. Adding Commands-Create slash commands in:-- `${PAI_DIR}/commands/` - Custom slash commands--## Performance Considerations--### Optimization Strategies-1. **Lazy Loading**: Context loads only when needed-2. **Caching**: Frequently used contexts cached-3. **Parallel Processing**: Independent operations run concurrently-4. **Rate Limiting**: Prevents resource exhaustion--### Resource Management-- Memory: Context files loaded on-demand-- CPU: Agent selection optimized for task-- Network: Batch operations when possible-- Disk: Log rotation and cleanup--## Error Handling--### Error Propagation-```-Service Error → Hook System → User Notification → Fallback Action-```--### Fallback Strategies-1. **Voice Server**: Falls back to macOS `say`-2. **Context Loading**: Uses default context-3. **Agent Selection**: Falls back to general-purpose-4. **Hook Execution**: Continues on non-critical failures--## Future Architecture Considerations--### Planned Enhancements-1. **Distributed Agents**: Multi-machine agent deployment-2. **Plugin System**: Third-party extensions-3. **Cloud Sync**: Context synchronization-4. **API Gateway**: Unified API interface--### Scalability Path-1. **Horizontal Scaling**: Multiple agent instances-2. **Load Balancing**: Request distribution-3. **Caching Layer**: Redis/Memcached integration-4. **Queue System**: Async task processing-------*This architecture document describes PAI version 1.0.0*\ No newline at end of filediff --git a/.claude/documentation/auto-documentation.md b/.claude/documentation/auto-documentation.mddeleted file mode 100644index 41334254..00000000--- a/.claude/documentation/auto-documentation.md+++ /dev/null@@ -1,329 +0,0 @@-# Automatic Documentation Updates--## Overview--The PAI repository includes an automatic documentation update system that runs as part of the pre-commit git hook. This system ensures that documentation stays in sync with code changes without manual intervention.--## How It Works--### Pre-Commit Hook Flow--When you commit changes, the pre-commit hook:--1. **Security Scan** (First)- - Scans for sensitive content (API keys, credentials, personal data)- - **BLOCKS commit if sensitive content detected**- - See `.git/hooks/pre-commit` for full security patterns--2. **Documentation Update** (After security passes)- - Analyzes which files changed in your commit- - Determines which documentation areas are affected- - Automatically updates relevant documentation files- - Auto-stages the updated docs to include in the commit- - **Non-blocking** - warns if update fails but allows commit--### File-to-Documentation Mapping--The system automatically maps changed files to documentation updates:--| Changed Files | Updated Documentation |-|--------------|----------------------|-| `skills/**` | `documentation/skills-system.md` |-| `commands/**` | `documentation/command-system.md` |-| `hooks/**` | `documentation/hook-system.md` |-| `agents/**` | `documentation/agent-system.md` |-| `voice-server/**` | `documentation/voice-system.md` |-| `package.json` | Dependencies section |-| `.mcp.json` | MCP servers documentation |-| Any non-doc file | `README.md` (timestamp) |--### What Gets Updated--For each affected documentation file:-- Adds/updates a `<!-- Last Updated: YYYY-MM-DD -->` timestamp-- Updates are minimal and non-destructive-- Only modifies metadata, not content--For README.md:-- Updates the "Recent Updates" section with change summary-- Reflects which areas were modified--## Installation--### Method 1: Automatic Setup--```bash-bun run setup.sh-```--This will:-- Copy the pre-commit hook template to `.git/hooks/pre-commit`-- Make it executable-- Verify bun is installed-- Test the hook--### Method 2: Manual Installation--```bash-# Copy the enhanced pre-commit hook-cp hooks/pre-commit-with-docs.template .git/hooks/pre-commit--# Make it executable-chmod +x .git/hooks/pre-commit--# Verify it works-git add <some-file>-git commit -m "test: Verify auto-documentation"-```--### Method 3: Integrate with Existing Hook--If you already have a custom pre-commit hook:--```bash-# Edit your existing .git/hooks/pre-commit and add:--# After your existing logic, before exit 0:-if [ -f "hooks/update-documentation.ts" ]; then- bun run hooks/update-documentation.ts || true-fi-```--## Testing--### Test the Documentation Updater Directly--```bash-# Stage some changes-git add skills/some-skill.md--# Run the updater manually-bun run hooks/update-documentation.ts--# Check what it would update-git status-```--### Test the Full Pre-Commit Hook--```bash-# Make a change to a skill-echo "# Test" >> skills/PAI/test.md--# Stage and commit-git add skills/PAI/test.md-git commit -m "test: Verify auto-doc updates"--# You should see:-# ✅ Security scan passed-# ✅ Documentation updated (skills-system.md, README.md)-# ✅ 3 files changed (your change + 2 auto-updated docs)-```--## Configuration--### Excluded Files--The updater automatically excludes these from triggering updates:-- `documentation/**` - Documentation files themselves-- `README.md` - The README itself-- `hooks/update-documentation.ts` - The updater script itself--This prevents circular updates and infinite loops.--### Customizing File Mappings--To add custom file-to-doc mappings, edit `hooks/update-documentation.ts`:--```typescript-// In analyzeChanges() function:-if (file.startsWith('your-directory/')) {- affectedAreas.add('your-area');- needsDocUpdate.set('documentation/your-doc.md', true);-}-```--## Bypassing the Hook--### For Documentation-Only Commits--The hook automatically detects when you're only changing documentation files and skips the update phase:--```bash-git add documentation/some-doc.md-git commit -m "docs: Update documentation"-# ✅ Skips auto-update (no code changes)-```--### For Emergency Commits (Not Recommended)--```bash-git commit --no-verify -m "emergency: Skip all hooks"-```--**⚠️ WARNING**: This bypasses BOTH security scanning AND documentation updates!--## Benefits--### ✅ Always-Current Documentation-- Documentation timestamps always reflect latest code changes-- No manual "remember to update docs" step required-- Clear audit trail of when docs were last touched--### ✅ Zero Developer Overhead-- Completely automatic - no action required-- Non-blocking - doesn't interrupt workflow-- Smart detection - only updates what's relevant--### ✅ Clean Commit History-- Documentation updates bundled with code changes-- No separate "update docs" commits cluttering history-- All related changes in one atomic commit--### ✅ Team Consistency-- Everyone gets automatic doc updates-- No reliance on developers remembering to update docs-- Enforced via git hooks (automatic after repo clone)--## Troubleshooting--### Hook Doesn't Run--```bash-# Check if hook exists and is executable-ls -la .git/hooks/pre-commit--# If missing, reinstall:-cp hooks/pre-commit-with-docs.template .git/hooks/pre-commit-chmod +x .git/hooks/pre-commit-```--### Hook Runs But Doesn't Update Docs--```bash-# Test the updater directly-bun run hooks/update-documentation.ts--# Check for errors-git add some-file.ts-bun run hooks/update-documentation.ts-```--### Documentation Not Staged--The hook should auto-stage updated docs. If not:--```bash-# Check git status after hook runs-git status--# Manually stage if needed-git add documentation/*.md README.md-```--### Bun Not Found--```bash-# Install bun-curl -fsSL https://bun.sh/install | bash--# Verify installation-which bun-bun --version-```--## Advanced Usage--### CI/CD Integration--For GitHub Actions, add to your workflow:--```yaml-- name: Check Documentation Sync- run: |- bun run hooks/update-documentation.ts- if ! git diff --quiet; then- echo "Documentation out of sync!"- git diff- exit 1- fi-```--### Post-Commit Documentation--If you prefer post-commit updates (not recommended), see research on handling the "commit after commit" problem in:-- GitHub Actions workflows (recommended)-- Post-commit with environment variable guards-- Post-commit with --amend (solo dev only)--## Architecture--### Files--- `hooks/update-documentation.ts` - Main documentation updater script-- `hooks/pre-commit-with-docs.template` - Git hook template-- `.git/hooks/pre-commit` - Active git hook (not tracked)-- `documentation/*.md` - Documentation files that get updated--### Flow Diagram--```-Developer runs: git commit- ↓- Pre-commit hook triggers- ↓- ┌──────────────────────┐- │ Security Scan │- │ (Blocks if fails) │- └──────────────────────┘- ↓ Pass- ┌──────────────────────┐- │ Analyze Changes │- │ (Which files?) │- └──────────────────────┘- ↓- ┌──────────────────────┐- │ Update Docs │- │ (Add timestamps) │- └──────────────────────┘- ↓- ┌──────────────────────┐- │ Stage Updated Docs │- │ (Auto git add) │- └──────────────────────┘- ↓- Commit proceeds- (Code + Updated Docs)-```--## Future Enhancements--### Planned Features-- [ ] AI-powered documentation content updates (not just timestamps)-- [ ] Analyze git diffs with LLM to determine what docs need rewriting-- [ ] Auto-generate changelog entries from conventional commits-- [ ] Update code examples in documentation based on actual code changes-- [ ] Detect broken links in documentation-- [ ] Validate code blocks in markdown compile correctly--### Potential AI Integration-```typescript-// Future: Use Claude API to analyze changes-const analysis = await analyzeWithClaude(gitDiff);-const docUpdates = analysis.suggestedUpdates;--for (const update of docUpdates) {- await applyDocUpdate(update.file, update.changes);-}-```--See research findings in: (research conducted 2025-10-18)-- Claude Auto-Commit (npm package)-- readme-ai (multi-LLM README generation)-- Aider (terminal-based AI pair programmer)-------**Last Updated**: 2025-10-18-**Version**: 1.0.0-**Status**: Production-ready ✅diff --git a/.claude/documentation/command-system.md b/.claude/documentation/command-system.mddeleted file mode 100644index c0480883..00000000--- a/.claude/documentation/command-system.md+++ /dev/null@@ -1,298 +0,0 @@-# PAI Command System--The PAI Command System provides a flexible framework for creating custom commands, scripts, and automation tools that integrate seamlessly with the PAI infrastructure.--## 🏗️ Architecture Overview--The command system consists of three main components:--1. **Commands** - Standalone executable scripts and tools-2. **Hook Integration** - Commands triggered by system events-3. **Dynamic Loading** - Commands loaded based on user intent--## 📁 Directory Structure--```-${PAI_DIR}/commands/-├── *.md # Command documentation-├── *.ts # TypeScript implementations-├── *.sh # Shell script implementations-└── *.js # JavaScript implementations-```--## 🔧 Command Types--### 1. Standalone Commands--Independent tools that can be executed directly:--```bash-# TypeScript commands (using Bun runtime)-bun ${PAI_DIR}/commands/command-name.ts [args]--# Shell commands-bash ${PAI_DIR}/commands/command-name.sh [args]-```--### 2. Hook-Triggered Commands--Commands automatically executed by the PAI hook system:--- **UserPromptSubmit**: Triggered when user submits a prompt-- **SessionStart**: Executed at session initialization-- **Stop**: Run when session ends-- **PreCompact**: Triggered before context compression-- **SubagentStop**: Executed when subagent tasks complete--### 3. Dynamic Commands--Commands loaded based on semantic analysis of user intent via the `load-dynamic-requirements` system.--## 📝 Command Patterns--PAI supports two primary types of commands:--### 1. Instructional Commands-These are standard Markdown (`.md`) files that contain documentation, examples, and instructions for an AI to follow. They are not executable on their own. The AI reads the file and executes the described steps using its available tools.--**Use Case**: Complex workflows that require AI reasoning, or documenting a series of shell commands.--### 2. Executable Commands (Self-Contained Scripts)-This is a powerful pattern where a single file with a `.md` extension is also a fully executable TypeScript script. This is the recommended pattern for creating automated tools.--**The structure is critical:**-1. **Shebang**: The file **must** start with `#!/usr/bin/env bun`.-2. **JSDoc Comment Block**: All documentation (Purpose, Usage, etc.) **must** be placed inside a single JSDoc-style comment block (`/** ... */`) immediately following the shebang.-3. **Pure TypeScript Code**: The rest of the file is pure TypeScript code. `Bun` will execute this code, ignoring the shebang and the JSDoc block.--**CRITICAL:** Do not include any standard Markdown syntax like `#` headings or `---` rules outside of the JSDoc block, as it will cause a syntax error.--### Example Executable Command (`your-command.md`)--```markdown-#!/usr/bin/env bun-/**- * # Your Command Title- *- * ## Purpose- * A clear description of what this command does.- *- * ## Usage- * ```bash- * # Run the command directly- * bun /path/to/commands/your-command.md- * ```- */--// TypeScript code starts here-import { $ } from 'bun';--console.log('This command is running!');--async function main() {- await $`echo Hello from Bun!`;-}--main().catch(console.error);-```--## 🚀 Creating New Executable Commands--### Step 1: Create Your File-Create a single new file: `${PAI_DIR}/commands/your-command.md`.--### Step 2: Add Content-1. Add `#!/usr/bin/env bun` to the very first line.-2. Create a `/** ... */` block and write your documentation inside it.-3. Write your pure TypeScript code directly after the comment block.--### Step 3: Make it Executable-Open a terminal and run `chmod +x` on your new file:-```bash-chmod +x ${PAI_DIR}/commands/your-command.md-```--### Step 4: Test Your Command-Execute your command directly to test it:-```bash-bun ${PAI_DIR}/commands/your-command.md-```---## 🔗 Integration Points--### Environment Variables--Commands should use these PAI environment variables:--- `PAI_DIR`: PAI configuration directory-- `ELEVENLABS_API_KEY`: Voice synthesis API key-- `PORT`: Voice server port (default: 8888)--### Standard Directories--Commands commonly interact with:--- `${PAI_DIR}/context/`: Context files and learnings-- `${PAI_DIR}/hooks/`: Hook scripts-- `${HOME}/Projects/`: Project-specific contexts-- `${HOME}/Library/Logs/`: System logs--### Hook Integration--To integrate with hooks, add command to `${PAI_DIR}/settings.json`:--```json-{- "hooks": {- "UserPromptSubmit": [- {- "hooks": [- {- "type": "command",- "command": "bun ${PAI_DIR}/commands/your-command.ts"- }- ]- }- ]- }-}-```--## 📋 Existing Commands--### Core Commands--#### capture-learning-Captures comprehensive problem-solving narratives from work sessions.--**Usage**: `bun ${PAI_DIR}/commands/capture-learning.ts`-**Output**: `${PAI_DIR}/context/learnings/YYYY-MM-DD-problem.md`--#### load-dynamic-requirements-Dynamically loads context and agents based on user intent.--**Usage**: Triggered automatically via UserPromptSubmit hook-**Function**: Semantic analysis and context loading--#### web-research-Perplexity AI integration for web research queries.--**Usage**: Via API calls with PERPLEXITY_API_KEY-**Function**: External research and information gathering----## 🎯 Best Practices--### 1. Error Handling-```typescript-try {- // Command logic-} catch (error) {- console.error(`❌ Error: ${error.message}`);- process.exit(1);-}-```--### 2. User Feedback-```typescript-console.log('✅ Command completed successfully');-console.log(`📁 Output saved to: ${outputPath}`);-```--### 3. Argument Validation-```typescript-if (process.argv.length < 3) {- console.error('Usage: bun command.ts <required-arg>');- process.exit(1);-}-```--### 4. Path Handling-```typescript-const outputDir = path.join(PAI_DIR, 'context', 'output');-if (!fs.existsSync(outputDir)) {- fs.mkdirSync(outputDir, { recursive: true });-}-```--## 🔧 Troubleshooting--### Common Issues--| Issue | Solution |-|-------|----------|-| Command not found | Check file permissions and shebang |-| PAI_DIR undefined | Set environment variable in shell |-| Import errors | Verify Bun installation and dependencies |-| Hook not triggering | Check settings.json configuration |--### Debugging Commands--```bash-# Test command directly-bun ${PAI_DIR}/commands/command-name.ts--# Check environment-echo $PAI_DIR--# Verify permissions-ls -la ${PAI_DIR}/commands/--# Check hook configuration-cat ${PAI_DIR}/settings.json | jq '.hooks'-```--## 🚀 Advanced Features--### Interactive Commands-Use readline for user input:--```typescript-import * as readline from 'readline';--async function prompt(question: string): Promise<string> {- const rl = readline.createInterface({- input: process.stdin,- output: process.stdout- });-- return new Promise((resolve) => {- rl.question(question, (answer) => {- rl.close();- resolve(answer);- });- });-}-```--### Voice Integration-Commands can trigger voice notifications:--```typescript-const notification = {- title: "Command Complete",- message: "Your command has finished successfully",- voice_enabled: true-};--// Send to voice server-fetch('http://localhost:8888/notify', {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify(notification)-});-```-------*The PAI Command System enables powerful automation and customization while maintaining simplicity and consistency across the infrastructure.*--## Recent Changes (2025-10-19)--- ✏️ `commands/load-dynamic-requirements.md` (modified)- - +1 / -1 lines------<!-- Last Updated: 2025-10-19 -->diff --git a/.claude/documentation/hook-system.md b/.claude/documentation/hook-system.mddeleted file mode 100644index ef1c35a9..00000000--- a/.claude/documentation/hook-system.md+++ /dev/null@@ -1,461 +0,0 @@-# Hook System Documentation--## Overview--The PAI Hook System provides event-driven automation and control throughout the AI interaction lifecycle. Hooks are scripts that execute at specific points, allowing you to intercept, modify, and enhance AI behavior.--## Hook Types--### 1. User Prompt Submit Hook-**File**: `user-prompt-submit-hook`-**Trigger**: Before user prompts are processed-**Purpose**: Load context, validate input, prepare environment--### 2. Tool Use Hook-**File**: `tool-use-hook`-**Trigger**: Before tool execution-**Purpose**: Validate tool calls, modify parameters, security checks--### 3. Post Execution Hook-**File**: `post-execution-hook`-**Trigger**: After commands complete-**Purpose**: Cleanup, logging, notifications--### 4. Response Hook-**File**: `response-hook`-**Trigger**: Before AI response is shown-**Purpose**: Format output, add information, filter content--## Hook Execution Flow--```-User Input- ↓-[user-prompt-submit-hook]- ↓-AI Processing- ↓-Tool Request → [tool-use-hook] → Tool Execution- ↓-[post-execution-hook]- ↓-[response-hook]- ↓-User Output-```--## Creating Hooks--### Basic Hook Structure--```bash-#!/bin/bash-# Hook Name: user-prompt-submit-hook-# Purpose: Pre-process user prompts--# Access environment variables-USER_PROMPT="$1"-CONTEXT_DIR="${PAI_DIR}/context"--# Perform actions-echo "Processing prompt: $USER_PROMPT"--# Load context based on intent-if [[ "$USER_PROMPT" =~ "website" ]]; then- cat "${CONTEXT_DIR}/projects/website/CLAUDE.md"-fi--# Return status (0 = success, non-zero = block)-exit 0-```--### Hook Configuration--Hooks must be:-1. **Executable**: `chmod +x hook-name`-2. **Located in**: `${PAI_DIR}/hooks/`-3. **Named correctly**: Exact hook name without extension-4. **Return proper exit codes**: 0 for success, non-zero to block--## Hook Examples--### Example 1: Context Loading Hook--```bash-#!/bin/bash-# user-prompt-submit-hook-# Dynamically loads context based on user intent--PROMPT="$1"-PAI_DIR="${PAI_DIR:-$HOME/PAI/PAI_DIRECTORY}"--# Load UFC context system-if [[ -f "${PAI_DIR}/hooks/load-dynamic-requirements" ]]; then- source "${PAI_DIR}/hooks/load-dynamic-requirements"-fi--# Analyze intent and load context-case "$PROMPT" in- *website*|*blog*|*site*)- echo "Loading website context..."- cat "${PAI_DIR}/context/projects/website/CLAUDE.md"- ;;- *research*|*investigate*)- echo "Launching researcher agent..."- echo "AGENT: researcher"- ;;- *security*|*vulnerability*)- echo "Launching pentester agent..."- echo "AGENT: pentester"- ;;-esac--exit 0-```--### Example 2: Security Validation Hook--```bash-#!/bin/bash-# tool-use-hook-# Validates and sanitizes tool calls--TOOL_NAME="$1"-TOOL_PARAMS="$2"--# Block dangerous commands-BLOCKED_PATTERNS=(- "rm -rf /"- "sudo"- "passwd"- "format"-)--for pattern in "${BLOCKED_PATTERNS[@]}"; do- if [[ "$TOOL_PARAMS" =~ $pattern ]]; then- echo "BLOCKED: Dangerous command pattern detected"- exit 1- fi-done--# Validate file paths-if [[ "$TOOL_NAME" == "Edit" ]] || [[ "$TOOL_NAME" == "Write" ]]; then- FILE_PATH=$(echo "$TOOL_PARAMS" | grep -o '"file_path":"[^"]*"' | cut -d'"' -f4)-- # Ensure path is within PAI_DIR- if [[ ! "$FILE_PATH" =~ ^${PAI_DIR} ]]; then- echo "WARNING: File operation outside PAI_DIR"- fi-fi--exit 0-```--### Example 3: Notification Hook--```bash-#!/bin/bash-# post-execution-hook-# Sends voice notifications after task completion--COMMAND="$1"-EXIT_CODE="$2"-OUTPUT="$3"--# Send notification based on result-if [ "$EXIT_CODE" -eq 0 ]; then- MESSAGE="Task completed successfully"-else- MESSAGE="Task failed with error"-fi--# Send to voice server-curl -X POST http://localhost:8888/notify \- -H "Content-Type: application/json" \- -d "{\"message\": \"$MESSAGE\"}" \- 2>/dev/null--exit 0-```--### Example 4: Output Formatting Hook--```bash-#!/bin/bash-# response-hook-# Formats AI responses--RESPONSE="$1"--# Add timestamp-echo "[$( date '+%Y-%m-%d %H:%M:%S' )]"-echo "$RESPONSE"--# Add context information-if [ -n "$CURRENT_PROJECT" ]; then- echo "Project: $CURRENT_PROJECT"-fi--exit 0-```--## Advanced Hook Features--### Hook Communication--Hooks can communicate through:--1. **Environment Variables**-```bash-export HOOK_DATA="value"-```--2. **Temporary Files**-```bash-echo "data" > /tmp/hook_data.txt-```--3. **Standard Output**-```bash-echo "CONTEXT: Additional context here"-```--4. **Exit Codes**-```bash-exit 0 # Success, continue-exit 1 # Failure, block operation-```--### Hook Chaining--Multiple hooks can work together:--```bash-# Hook 1: Analyze intent-echo "INTENT: research" > /tmp/intent.txt--# Hook 2: Load based on intent-INTENT=$(cat /tmp/intent.txt)-if [ "$INTENT" = "research" ]; then- load_research_context-fi-```--### Conditional Execution--Hooks can run conditionally:--```bash-# Only run for specific users-if [ "$USER" != "authorized_user" ]; then- exit 0-fi--# Only run in certain directories-if [ "$PWD" != "${HOME}/Projects" ]; then- exit 0-fi-```--## Hook Best Practices--### 1. Performance-- Keep hooks lightweight-- Avoid blocking operations-- Use background processes when possible-- Cache frequently used data--### 2. Error Handling-```bash-set -e # Exit on error-trap 'echo "Hook failed: $?"' ERR-```--### 3. Logging-```bash-LOG_FILE="${HOME}/Library/Logs/hooks.log"-echo "[$(date)] Hook executed: $0" >> "$LOG_FILE"-```--### 4. Security-- Validate all inputs-- Sanitize file paths-- Check permissions-- Avoid executing user input--## Built-in Hook Variables--Hooks have access to these environment variables:--| Variable | Description |-|----------|-------------|-| `PAI_DIR` | PAI configuration directory |-| `USER_PROMPT` | Current user prompt |-| `TOOL_NAME` | Tool being called |-| `TOOL_PARAMS` | Tool parameters |-| `CONTEXT_DIR` | Context files directory |-| `HOOKS_DIR` | Hooks directory |-| `AGENT_TYPE` | Current agent type |--## Debugging Hooks--### Enable Debug Mode--```bash-export HOOK_DEBUG=true-```--### Debug Output--```bash-#!/bin/bash-if [ "$HOOK_DEBUG" = "true" ]; then- set -x # Enable trace- exec 2>>"${HOME}/Library/Logs/hook_debug.log"-fi-```--### Testing Hooks--```bash-# Test hook directly-./user-prompt-submit-hook "test prompt"--# Check exit code-echo $?--# View output-cat /tmp/hook_output.txt-```--## Common Hook Patterns--### Pattern 1: Context Injection--```bash-# Inject context before prompt processing-cat << EOF-CONTEXT: You are working on project X-CONSTRAINTS: Follow coding style Y-GOALS: Implement feature Z-EOF-```--### Pattern 2: Tool Wrapper--```bash-# Wrap tool execution with pre/post actions-pre_action-$TOOL_COMMAND-post_action-```--### Pattern 3: Validation Gate--```bash-# Validate before allowing operation-if ! validate_request; then- echo "ERROR: Validation failed"- exit 1-fi-```--### Pattern 4: Event Notification--```bash-# Notify external systems-webhook_notify "https://api.example.com/hooks" "$EVENT_DATA"-```--## Troubleshooting--### Hook Not Executing--1. **Check permissions**: `ls -la ${PAI_DIR}/hooks/`-2. **Verify name**: Must match exactly-3. **Test directly**: `./hook-name test`-4. **Check logs**: `tail -f ${HOME}/Library/Logs/hooks.log`--### Hook Blocking Operations--- Check exit codes-- Review error output-- Verify logic conditions-- Test with `set -x` for trace--### Performance Issues--- Profile with `time ./hook-name`-- Move heavy operations to background-- Cache expensive computations-- Use timeout for external calls--## Hook Security--### Input Validation--```bash-# Sanitize user input-sanitize() {- echo "$1" | sed 's/[^a-zA-Z0-9 ._-]//g'-}--SAFE_INPUT=$(sanitize "$USER_INPUT")-```--### Path Restrictions--```bash-# Restrict file operations-if [[ ! "$FILE_PATH" =~ ^${PAI_DIR} ]]; then- echo "Access denied: Outside PAI_DIR"- exit 1-fi-```--### Command Filtering--```bash-# Block dangerous commands-DANGEROUS_CMDS=("rm -rf" "sudo" "chmod 777")-for cmd in "${DANGEROUS_CMDS[@]}"; do- if [[ "$COMMAND" =~ $cmd ]]; then- exit 1- fi-done-```--## Future Enhancements--### Planned Features--1. **Hook Marketplace**: Share and download hooks-2. **Hook Templates**: Pre-built hook patterns-3. **Visual Hook Editor**: GUI for hook creation-4. **Hook Testing Framework**: Automated testing-5. **Hook Analytics**: Usage and performance metrics--### Experimental Features--- **Async Hooks**: Non-blocking execution-- **Hook Priorities**: Execution order control-- **Hook Dependencies**: Inter-hook requirements-- **Remote Hooks**: Cloud-based hooks-------*Hook System Version 1.0.0*-*Last Updated: [Current Date]*---## Recent Changes (2025-10-19)--- ➕ `hooks/initialize-pai-session.ts` (added)- - +130 / -0 lines-- ➕ `hooks/load-core-context.ts` (added)- - +88 / -0 lines-- 🗑️ `hooks/session-start-hook.ts` (deleted)- - +0 / -86 lines------<!-- Last Updated: 2025-10-19 -->diff --git a/.claude/documentation/how-to-start.md b/.claude/documentation/how-to-start.mddeleted file mode 100644index 9b4a7c23..00000000--- a/.claude/documentation/how-to-start.md+++ /dev/null@@ -1,644 +0,0 @@-# 🚀 How to Get Started with PAI--**Welcome! Let's get your Personal AI Infrastructure up and running.**--> [!NOTE]-> **📦 v0.6.0 Repository Structure**-> As of v0.6.0, the PAI repository uses a `.claude/` directory structure to match the actual working system:-> - Repository structure: `/PAI/.claude/` contains all infrastructure-> - Your system: `~/.claude/` contains your personal PAI instance-> - Simply copy or symlink `.claude/` from the repo to `~/.claude/` on your system-------## 👋 Hey there!--First things first: **Don't worry, this is easier than it looks.**--I know that setting up developer infrastructure can feel intimidating, especially if you're not super technical. But here's the thing - PAI is designed to be accessible to everyone, and this guide is going to walk you through everything step by step.--Think of this as having a friend guide you through the setup process. We'll go slow, explain everything, and by the end of this, you'll have your own personal AI assistant that actually knows about YOUR life, YOUR projects, and YOUR goals.--**Two ways to do this:**-1. 🤖 **Automated Setup** - Run one command and let the script handle everything (recommended if you're nervous!)-2. 📖 **Manual Setup** - Follow along step-by-step (recommended if you want to understand what's happening)--Choose whichever makes you comfortable. Both get you to the same place!-------## 🤖 Option 1: Automated Setup (The Easy Button)--**Just want it to work? Run this:**--```bash-# Download and run the automated setup script-curl -fsSL https://raw.githubusercontent.com/danielmiessler/Personal_AI_Infrastructure/main/setup.sh | bash-```--That's it! The script will:-- ✅ Check what you have installed (and install what's missing)-- ✅ Clone the PAI repository-- ✅ Set up your environment variables-- ✅ Create all necessary directories-- ✅ Configure your shell-- ✅ Test everything to make sure it works--**The script will ask you questions along the way, so you're always in control.**--After it finishes, skip to the [🎉 You're Done!](#-youre-done) section.-------## 📖 Option 2: Manual Setup (Step by Step)--**Want to understand what's happening? Let's do this together.**-------### Step 1: Prerequisites (What You Need Installed)--Before we start, let's make sure you have the basics. Don't worry - we'll walk through installing each one.--#### Required:--**1. macOS** (PAI is primarily built for Mac)- - You probably already have this! If you're reading this on a Mac, you're good.- - **Version needed:** macOS 11 (Big Sur) or newer- - **How to check:** Click the Apple menu → "About This Mac"--**2. Git** (for downloading PAI)- - **What it is:** A tool for downloading and managing code- - **Check if you have it:** Open Terminal and type: `git --version`- - **Don't have it?** Install it:- ```bash- # Install Xcode Command Line Tools (includes Git)- xcode-select --install- ```- - Click "Install" when the popup appears, wait a few minutes, done!--**3. Bun** (JavaScript runtime)- - **What it is:** A fast JavaScript engine (like Node.js but better)- - **Why you need it:** Powers the voice server and various PAI features- - **Check if you have it:** `bun --version`- - **Don't have it?** Install it:- ```bash- # Install Homebrew first (if you don't have it)- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"-- # Then install Bun- brew install oven-sh/bun/bun- ```--**4. Claude Code** (or another AI assistant)- - **What it is:** The AI interface you'll use to interact with PAI- - **Get it:** Visit [https://claude.ai/code](https://claude.ai/code)- - **Alternatives:** You can also use GPT, Gemini, or other AI platforms - PAI is designed to work with any of them--#### Optional (but recommended):--**5. API Keys** (for advanced features)- - These unlock extra capabilities, but PAI works without them too- - We'll set these up later - no need to worry about them now-------### Step 2: Download PAI--Okay, you've got the prerequisites. Now let's grab PAI!--**Open your Terminal** (Applications → Utilities → Terminal) and run:--```bash-# Go to a good place to download PAI-# (You can change this to wherever you want - ~/Projects, ~/Documents, etc.)-cd ~--# Download PAI from GitHub-git clone https://github.com/danielmiessler/Personal_AI_Infrastructure.git PAI--# Go into the PAI directory-cd PAI--# Check that it worked - you should see a bunch of folders-ls -la-```--**What you should see:**-```-agents/-commands/-documentation/-hooks/-skills/-README.md-settings.json-... and more-```--**If you see that, you're doing great!** 🎉-------### Step 3: Set Up Environment Variables--**What are environment variables?**-Think of them as settings your computer remembers every time you open Terminal. We need to tell your computer where PAI lives.--**Here's what we're going to do:**--1. **Open your shell configuration file:**- ```bash- # If you use zsh (default on modern Macs)- open -e ~/.zshrc-- # If you use bash- open -e ~/.bashrc- ```--2. **Add these lines to the very bottom of the file:**- ```bash- # ========== PAI Configuration ==========- # Where PAI is installed (change this to YOUR path!)- export PAI_DIR="$HOME/PAI"-- # Your home directory (this is automatic)- export PAI_HOME="$HOME"-- # (Optional) Your AI assistant's name- export DA="Kai" # Change "Kai" to whatever you want to call your AI-- # (Optional) Display color for your AI- export DA_COLOR="purple" # Options: purple, blue, green, cyan, red, yellow- ```--3. **Save the file** (Command+S) and close it--4. **Load the new settings:**- ```bash- source ~/.zshrc # or source ~/.bashrc if you use bash- ```--5. **Test that it worked:**- ```bash- echo $PAI_DIR- ```- **You should see:** `/Users/yourname/PAI` (or wherever you put it)--**If you see that path, you're golden!** ✨-------### Step 4: Configure Your Environment File--PAI uses a `.env` file to store API keys and settings. Let's set that up.--```bash-# Go to your PAI directory-cd $PAI_DIR--# Copy the example environment file-cp .env.example .env--# Open it in a text editor-open -e .env-```--**What you'll see in the file:**--```bash-# ============ REQUIRED CONFIGURATION ============-PAI_DIR="/path/to/PAI" # Your PAI location-PAI_HOME="$HOME" # Your home directory--# ============ RESEARCH AGENTS (Optional) ============-PERPLEXITY_API_KEY="" # For web research-GOOGLE_API_KEY="" # For Gemini research-# Claude WebSearch is built-in - no key needed!--# ============ AI GENERATION (Optional) ============-REPLICATE_API_TOKEN="" # For AI images/videos-OPENAI_API_KEY="" # For GPT features--# ============ SYSTEM CONFIGURATION ============-PORT="8888" # Voice server port--# ============ YOUR AI ASSISTANT ============-DA="Assistant" # Your AI's name-DA_COLOR="purple" # Display color-```--**What to do:**--1. **Update PAI_DIR** to your actual PAI path (should already be correct if you followed Step 3)-2. **Leave the API keys blank for now** - PAI works without them!-3. **Customize DA name** if you want (I call mine "Kai")-4. **Save the file** (Command+S)--**Important:** Your `.env` file contains sensitive information! PAI automatically keeps it private (it's in `.gitignore`), so don't worry about accidentally sharing it.-------### Step 5: Optional - Voice Server Setup--**Do you want your AI to talk to you?** This is totally optional but pretty cool!--PAI can use macOS's built-in Premium voices (they're free, high-quality, and work offline).--**To set this up:**--1. **Download a Premium voice:**- - Go to: System Settings → Accessibility → Spoken Content- - Click "System Voice" → "Manage Voices..."- - Download a Premium or Enhanced voice (try "Zoe" or "Samantha" - they're great!)--2. **Start the voice server:**- ```bash- cd $PAI_DIR/voice-server- bun install # Install dependencies- bun server.ts & # Start in background- ```--3. **Test it:**- ```bash- curl -X POST http://localhost:8888/notify \- -H "Content-Type: application/json" \- -d '{"message": "Hello! Your voice server is working!"}'- ```-- **You should hear your computer speak!** 🔊--**Don't hear anything?** No worries - skip this for now. You can always set it up later. The voice server is completely optional.-------### Step 6: Configure Your AI Assistant (Claude Code)--Almost there! Now let's connect Claude Code to PAI.--1. **Open Claude Code**- - Download from [https://claude.ai/code](https://claude.ai/code) if you haven't already- - Sign in with your Anthropic account--2. **Point Claude Code to your PAI settings:**-- Claude Code looks for settings in `~/.claude/settings.json`. We need to tell it to use PAI's settings instead.-- ```bash- # Create a symbolic link from Claude's settings location to PAI's settings- ln -sf $PAI_DIR/settings.json ~/.claude/settings.json- ```--3. **Restart Claude Code** (just close and reopen it)--4. **Test PAI:**-- Open Claude Code and say something like:- ```- "Hey, what's my name?"- ```-- Claude should load PAI's context and know that it's operating as your personal AI infrastructure!-------### Step 7: Understanding Your Setup--Congratulations! PAI is installed. But let's take a moment to understand what you just set up.--**Here's what you have now:**--```-PAI/-├── agents/ # Specialized AI agents (researcher, engineer, designer, etc.)-├── commands/ # Custom commands you can run-├── documentation/ # Help files (you're reading one!)-├── hooks/ # Automation that runs when you do things-├── skills/ # Specialized capabilities (research, coding, design, etc.)-├── settings.json # Your Claude Code configuration-├── .env # Your API keys and settings-└── voice-server/ # Voice notification system-```--**How it works:**--1. **You talk to Claude Code** (or your AI of choice)-2. **PAI recognizes your intent** ("I want to research something", "Build an app", etc.)-3. **PAI loads the right context** (skills, tools, knowledge)-4. **Specialized agents help** if needed (researcher for research, engineer for coding, etc.)-5. **You get smart, personalized assistance** that knows about YOUR projects and YOUR life-------### Step 8: Customize PAI for YOU--This is where it gets fun! PAI is completely customizable. Here are some things you can do:--**Add your own projects:**-```bash-# Create a new project context-mkdir -p $PAI_DIR/skills/my-project-echo "# My Amazing Project" > $PAI_DIR/skills/my-project/SKILL.md-# Then edit that file with information about your project-```--**Customize the PAI skill** (tells PAI who you are):-```bash-# Open the main PAI skill-open -e $PAI_DIR/skills/PAI/SKILL.md--# Look for lines that say [CUSTOMIZE:] and update them with YOUR information-```--**Add API keys for advanced features:**-```bash-# Open your .env file-open -e $PAI_DIR/.env--# Add API keys for services you want to use:-# - PERPLEXITY_API_KEY for web research-# - GOOGLE_API_KEY for Gemini AI-# - REPLICATE_API_TOKEN for AI image generation-```--**Create custom commands:**-```bash-# Look at existing commands for inspiration-ls $PAI_DIR/commands/--# Create your own!-touch $PAI_DIR/commands/my-custom-command.md-```-------## 🎉 You're Done!--**Seriously! Your Personal AI Infrastructure is ready to go.**--Here's what you can do now:--### Try These to Test Your Setup:--1. **Just chat:**- ```- "Hey, tell me about yourself"- ```- PAI should introduce itself as your personal AI assistant!--2. **Do some research:**- ```- "Research the latest developments in quantum computing"- ```- PAI will launch research agents and find information for you!--3. **Start a project:**- ```- "Help me build a meditation timer app"- ```- PAI will load development skills and start helping you build!--4. **Explore skills:**- ```- "What skills do you have available?"- ```- PAI will show you all the specialized capabilities it has!-------## 🆘 Troubleshooting--**Something not working? Don't panic.** Here are the most common issues:--### "PAI_DIR not found" or "command not found: PAI_DIR"--**Fix:**-```bash-# Make sure you added the environment variables to your shell config-open -e ~/.zshrc # or ~/.bashrc--# Make sure you see these lines:-export PAI_DIR="$HOME/PAI"-export PAI_HOME="$HOME"--# Save the file, then reload:-source ~/.zshrc # or source ~/.bashrc--# Test it:-echo $PAI_DIR # Should show /Users/yourname/PAI-```--### Claude Code doesn't seem to know about PAI--**Fix:**-```bash-# Make sure the symbolic link is created:-ls -la ~/.claude/settings.json--# If it's not pointing to PAI, create it:-ln -sf $PAI_DIR/settings.json ~/.claude/settings.json--# Restart Claude Code-```--### Voice server not working--**Fix:**-```bash-# Check if Bun is installed:-bun --version--# Try starting the voice server manually:-cd $PAI_DIR/voice-server-bun server.ts--# Check for errors in the output--# Make sure you have a Premium voice installed:-# System Settings → Accessibility → Spoken Content → System Voice → Manage Voices-```--### API Keys not working--**Fix:**-```bash-# Make sure your .env file exists:-ls -la $PAI_DIR/.env--# Open it and check the keys:-open -e $PAI_DIR/.env--# API keys should NOT have quotes around them:-# ✅ CORRECT: PERPLEXITY_API_KEY=pk-abc123def456-# ❌ INCORRECT: PERPLEXITY_API_KEY="pk-abc123def456"-```--### Skills not loading--**Fix:**-```bash-# List your skills:-ls -la $PAI_DIR/skills/--# Make sure each skill has a SKILL.md file:-find $PAI_DIR/skills -name "SKILL.md"--# Check permissions:-chmod -R u+r $PAI_DIR/skills-```--**Still stuck?**-- Check the [full documentation](./README.md)-- Look at [architecture.md](./architecture.md) to understand how things work-- File an issue on [GitHub](https://github.com/danielmiessler/Personal_AI_Infrastructure/issues)-- Review the logs: `ls -la ~/Library/Logs/`-------## 🎓 What's Next?--Now that PAI is set up, here's how to get the most out of it:--### 1. **Learn about Skills** (5 minutes)-Skills are the core of PAI - they're like apps for your AI.--Read: [skills-system.md](./skills-system.md)--**Quick overview:**-- `research` - Multi-source research with parallel agents-- `development` - Full-stack app building-- `fabric` - 242+ AI patterns for everything-- `blogging` - Write and publish blog posts-- And many more!--### 2. **Explore Commands** (10 minutes)-Commands are pre-built tasks you can run.--```bash-# See what's available:-ls $PAI_DIR/commands/--# Try one:-# (Ask Claude: "Show me the available commands")-```--### 3. **Customize Your Experience** (30 minutes)-Make PAI truly yours:--**Edit the PAI skill:**-```bash-open -e $PAI_DIR/skills/PAI/SKILL.md-```--Look for `[CUSTOMIZE:]` markers and update:-- Your key contacts-- Your preferences (tech stack, coding style, etc.)-- Your security settings-- Your voice preferences--**Create your first custom skill:**-```bash-# Use the create-skill skill to guide you!-# In Claude Code, just say:-"Help me create a custom skill for [your use case]"-```--### 4. **Read the Deep Dive** (Optional, 30+ minutes)-Want to really understand how PAI works?--- [architecture.md](./architecture.md) - How PAI is structured-- [skills-system.md](./skills-system.md) - Deep dive on skills-- [hook-system.md](./hook-system.md) - Automation with hooks-- [agent-system.md](./agent-system.md) - How agents work-------## 🎯 Quick Reference--**Essential Commands:**--```bash-# Check if PAI is set up correctly-echo $PAI_DIR # Should show your PAI path--# Go to PAI directory-cd $PAI_DIR # Quick way to navigate to PAI--# Update PAI to latest version-cd $PAI_DIR && git pull # Get latest features and fixes--# Start voice server (optional)-cd $PAI_DIR/voice-server && bun server.ts &--# Reload shell configuration-source ~/.zshrc # Apply any changes you made--# View available skills-ls $PAI_DIR/skills/ # See what PAI can do--# View available commands-ls $PAI_DIR/commands/ # See pre-built tasks-```--**File Locations:**--| What | Where |-|------|-------|-| PAI main directory | `$PAI_DIR` (usually `~/PAI`) |-| Your settings | `$PAI_DIR/.env` |-| Skills | `$PAI_DIR/skills/` |-| Commands | `$PAI_DIR/commands/` |-| Documentation | `$PAI_DIR/documentation/` |-| Voice server | `$PAI_DIR/voice-server/` |-| Logs | `~/Library/Logs/` |--**Important Environment Variables:**--| Variable | What it does | Example |-|----------|--------------|---------|-| `PAI_DIR` | Where PAI is installed | `/Users/daniel/PAI` |-| `PAI_HOME` | Your home directory | `/Users/daniel` |-| `DA` | Your AI's name | `Kai` |-| `DA_COLOR` | Display color | `purple` |-------## 💬 Final Thoughts--**You did it!** You now have a personal AI infrastructure that grows with you.--This is just the beginning. PAI is designed to adapt to YOUR life, YOUR projects, and YOUR goals. As you use it, you'll discover new ways to customize it, automate your workflows, and make your AI assistant truly personal.--**Remember:**-- ✅ Start simple - you don't need to use everything at once-- ✅ Customize as you go - add things when you need them-- ✅ Don't be afraid to experiment - you can't break anything permanently-- ✅ The community is here to help - ask questions if you get stuck--**Welcome to the PAI community!** 🎉--You're now part of the journey toward Human 3.0 - humans augmented with AI to amplify their capabilities.-------## 📚 Additional Resources--- **Official PAI Blog Post:** [Read the deep-dive on danielmiessler.com](https://danielmiessler.com/blog/personal-ai-infrastructure)-- **GitHub Repository:** [Star the repo to stay updated](https://github.com/danielmiessler/Personal_AI_Infrastructure)-- **Human 3.0 Vision:** [How PAI fits into the bigger picture](https://danielmiessler.com/blog/how-my-projects-fit-together)-- **Claude Code Docs:** [Learn more about Claude Code](https://claude.ai/code)-- **Video Walkthrough:** [Watch the PAI overview video](https://youtu.be/iKwRWwabkEc)-------**Questions? Issues? Ideas?**--- 🐛 [Report bugs](https://github.com/danielmiessler/Personal_AI_Infrastructure/issues)-- 💬 [Join discussions](https://github.com/danielmiessler/Personal_AI_Infrastructure/discussions)-- ⭐ [Star the repo](https://github.com/danielmiessler/Personal_AI_Infrastructure) to support the project!-------*Built with ❤️ by [Daniel Miessler](https://danielmiessler.com) and the PAI community*--*Last updated: October 2025*diff --git a/.claude/documentation/pai-context-loading.md b/.claude/documentation/pai-context-loading.mddeleted file mode 100644index 70291f38..00000000--- a/.claude/documentation/pai-context-loading.md+++ /dev/null@@ -1,353 +0,0 @@-# PAI Context Loading System--## Overview--The PAI context loading system automatically injects your personal AI context from the `skills/PAI/SKILL.md` file into every Claude Code session at startup. This ensures your AI has immediate access to your preferences, contacts, security guidelines, and custom instructions without requiring manual skill activation.--## How It Works--PAI uses a **two-hook session initialization system**:--### 1. Context Loading (`load-core-context.ts`)-**Runs FIRST** - Loads your PAI skill context into the session--- Reads `~/.claude/skills/PAI/SKILL.md`-- Injects content as a `<system-reminder>` into Claude's context-- Makes your complete PAI configuration immediately available-- Skips execution for subagent sessions (they don't need PAI context)--### 2. Session Initialization (`initialize-pai-session.ts`)-**Runs SECOND** - Sets up your session environment--- Tests stop-hook configuration-- Sets terminal tab title (e.g., "Kai Ready")-- Sends voice notification if voice server is running-- Skips for subagent sessions--## Architecture Benefits--### Automatic Context Loading-Before this system, you had to manually activate the PAI skill in each session. Now your AI has your complete context from the first message.--### Modular Design-Separating context loading from session setup provides:-- **Easier maintenance** - Each hook has a single responsibility-- **Better debugging** - Issues with context vs session setup are isolated-- **Flexibility** - You can disable voice notifications while keeping context loading--### Subagent Awareness-Both hooks detect subagent sessions and skip unnecessary operations:-- Subagents don't need PAI context (they have their own specialized instructions)-- Subagents don't need voice notifications or tab title updates-- Reduces overhead and prevents duplicate notifications--## Configuration--### Settings.json--The hooks are configured in your `settings.json` SessionStart section:--```json-{- "hooks": {- "SessionStart": [- {- "hooks": [- {- "type": "command",- "command": "${PAI_DIR}/hooks/load-core-context.ts"- },- {- "type": "command",- "command": "${PAI_DIR}/hooks/initialize-pai-session.ts"- }- ]- }- ]- }-}-```--**Order matters!** `load-core-context.ts` must run before `initialize-pai-session.ts`.--### Environment Variables--Set these in your `settings.json` `env` section:--```json-{- "env": {- "DA": "Kai", // Your AI's name (used in tab titles and notifications)- "DA_VOICE_ID": "your-voice-id", // ElevenLabs voice ID (optional, for voice notifications)- "PAI_DIR": "$HOME/.claude" // Path to your PAI directory- }-}-```--## File Structure--```-~/.claude/-├── skills/-│ └── PAI/-│ └── SKILL.md ← Your customized PAI context-├── hooks/-│ ├── load-core-context.ts ← Context loading hook-│ └── initialize-pai-session.ts ← Session initialization hook-└── settings.json ← Hook configuration-```--## Customizing Your PAI Context--### Edit skills/PAI/SKILL.md--This file contains your complete AI context. Customize these sections:--1. **Core Identity**- - AI name and personality- - Operating environment preferences--2. **Stack Preferences**- - Preferred languages (TypeScript, Python, etc.)- - Package managers (bun, npm, uv, pip)- - Frameworks and tools--3. **Response Format**- - How you want responses structured- - Use emojis or plain text- - Verbosity level--4. **Key Contacts**- - People you reference frequently- - Email addresses for quick lookup--5. **Security Guidelines**- - Repository safety rules- - Sensitive file patterns to avoid- - Infrastructure caution--6. **Social Media Accounts**- - Your online presence- - Account handles and URLs--7. **Voice IDs** (Optional)- - ElevenLabs voice assignments for agents- - Only needed if using voice system--### Template Files--The `skills/PAI/` directory includes template files for organization:-- `contacts.md` - Contact list template-- `preferences.md` - Stack and tool preferences template-- `response-format.md` - Response formatting template-- `security-detailed.md` - Security guidelines template-- `voice-ids.md` - Voice ID assignments template--These are **templates for reference only**. The actual context loaded comes from `SKILL.md`.--## How Context Loading Works (Technical)--### 1. Hook Execution-When you start a Claude Code session, `settings.json` SessionStart hooks execute in order.--### 2. Subagent Detection-```typescript-const isSubagent = claudeProjectDir.includes('/.claude/agents/') ||- process.env.CLAUDE_AGENT_TYPE !== undefined;-```--If subagent detected, hook exits silently (subagents don't need PAI context).--### 3. File Reading-```typescript-const paiDir = process.env.PAI_DIR || join(homedir(), '.claude');-const paiSkillPath = join(paiDir, 'skills/PAI/SKILL.md');-const paiContent = readFileSync(paiSkillPath, 'utf-8');-```--### 4. Context Injection-```typescript-const message = `<system-reminder>-PAI CORE CONTEXT (Auto-loaded at Session Start)--The following context has been loaded from ${paiSkillPath}:------${paiContent}------This context is now active for this session.-</system-reminder>`;--console.log(message); // Output to stdout (captured by Claude Code)-```--Claude Code captures this output and injects it into the conversation context as a system reminder, making it immediately available to Claude.--### 5. Success Logging-```-📚 Reading PAI core context from skill file...-✅ Read 12847 characters from PAI SKILL.md-✅ PAI context injected into session-```--## Troubleshooting--### PAI Context Not Loading--**Problem**: AI doesn't seem to have your PAI context--**Check**:-1. Verify `skills/PAI/SKILL.md` exists-2. Check `settings.json` has `load-core-context.ts` in SessionStart hooks-3. Look for errors in session startup output-4. Ensure `PAI_DIR` environment variable is set correctly--### Hook Not Executing--**Problem**: No "Reading PAI core context" message at session start--**Check**:-1. Hook file is executable: `chmod +x hooks/load-core-context.ts`-2. Hook is in correct location: `${PAI_DIR}/hooks/load-core-context.ts`-3. Bun is installed and accessible-4. SessionStart hooks are properly configured in settings.json--### Wrong Context Loaded--**Problem**: AI seems to have old or incorrect context--**Check**:-1. Edit `skills/PAI/SKILL.md` and save changes-2. Restart Claude Code session-3. Verify changes are in SKILL.md (not template files)-4. Check for multiple PAI installations--## Migration from Old System--### Before (Manual Skill Activation)-```-User: /PAI-Assistant: [Loads PAI skill context]-User: [Actual task]-```--### After (Automatic Context Loading)-```-[Session starts - PAI context automatically loaded]-User: [Actual task - AI already has context]-```--### Steps to Migrate--1. **Install new hooks**:- ```bash- chmod +x hooks/load-core-context.ts- chmod +x hooks/initialize-pai-session.ts- ```--2. **Update settings.json**:- Replace:- ```json- "SessionStart": [- {- "hooks": [- {- "type": "command",- "command": "${PAI_DIR}/hooks/session-start-hook.ts"- }- ]- }- ]- ```-- With:- ```json- "SessionStart": [- {- "hooks": [- {- "type": "command",- "command": "${PAI_DIR}/hooks/load-core-context.ts"- },- {- "type": "command",- "command": "${PAI_DIR}/hooks/initialize-pai-session.ts"- }- ]- }- ]- ```--3. **Customize SKILL.md**:- Edit `skills/PAI/SKILL.md` with your personal context--4. **Test**:- Start a new Claude Code session and verify PAI context loads--5. **Remove old hook** (optional):- ```bash- rm hooks/session-start-hook.ts- ```--## Best Practices--### Keep SKILL.md Updated-Your AI is only as good as the context you provide. Regularly update:-- New contacts and their roles-- Changed stack preferences-- Security guidelines for new projects-- Updated social media accounts--### Use Environment Variables-Don't hardcode paths or API keys. Use `settings.json` env section:-```json-{- "env": {- "PAI_DIR": "$HOME/.claude",- "DA": "YourAIName",- "DA_VOICE_ID": "your-voice-id"- }-}-```--### Test After Changes-After editing SKILL.md, restart a session and verify:-1. Hook executes without errors-2. AI responds according to new preferences-3. New context is accessible--### Version Control-Keep your PAI configuration in git:-```bash-git add skills/PAI/SKILL.md-git commit -m "Update PAI context with new preferences"-```--But **NEVER commit sensitive data** like:-- Real contact email addresses-- API keys or credentials-- Personal/private information-- Company-specific data--For public repos, use generic placeholders.--## Related Documentation--- [Skills System](skills-system.md) - Overview of the PAI skills architecture-- [Hook System](hook-system.md) - Complete hook system documentation-- [Voice System](voice-system.md) - Voice notification setup-- [Quick Reference](QUICK-REFERENCE.md) - Fast reference for common tasks--## Summary--The PAI context loading system provides:--✅ **Automatic context injection** - No manual skill activation needed-✅ **Modular architecture** - Separate context loading from session setup-✅ **Subagent awareness** - Skips unnecessary operations for subagents-✅ **Easy customization** - Edit SKILL.md to update your AI's context-✅ **Voice integration** - Optional voice notifications at session start-✅ **Flexible configuration** - Environment variables for portability--Your AI now has your complete personal context from the moment each session starts.diff --git a/.claude/documentation/skills-system.md b/.claude/documentation/skills-system.mddeleted file mode 100644index d28b6ba3..00000000--- a/.claude/documentation/skills-system.md+++ /dev/null@@ -1,657 +0,0 @@-# Skills System Documentation--## Overview--The Skills System is PAI's modular capability framework that extends AI functionality through self-contained packages of specialized knowledge, workflows, and tools. Skills provide progressive disclosure of information and activate based on semantic understanding of user intent.--## Core Concepts--### What Are Skills?--Skills are contextual packages that:-1. **Extend capabilities**: Add specialized knowledge or workflows-2. **Load progressively**: Metadata → Instructions → Resources-3. **Activate intelligently**: Match user intent to skill descriptions-4. **Work independently**: Self-contained but inherit global context-5. **Follow standards**: Consistent structure across all skills--### Skills vs Traditional Context Files--**Skills System (Current):**-- Modular, self-contained packages-- Progressive disclosure (SKILL.md → CLAUDE.md → Resources)-- Intent-based activation through descriptions-- Template-driven consistency-- Clear activation triggers--**Context Files (Legacy):**-- Monolithic documentation-- Always loaded in full-- Directory-based organization-- Less structured--### Skills vs Slash Commands--**Skills:**-- Contextual knowledge and workflows-- Always available in system prompt-- Triggered by matching user intent-- Can reference slash commands--**Slash Commands:**-- Executable workflows-- Must be explicitly invoked (`/command-name`)-- Typically orchestrate multiple tools-- Live in `${PAI_DIR}/commands/`--**Relationship**: Skills often invoke slash commands (e.g., research skill calls `/conduct-research`)--## How Skills Work--### 1. Three-Layer Architecture--**Layer 1: Metadata (Always Loaded)**-```yaml-----name: skill-name-description: Clear description with activation triggers-----```-- Appears in `<available_skills>` in system prompt-- Used for intent matching-- Must be concise but complete--**Layer 2: SKILL.md Body (Loaded When Activated)**-```markdown-## When to Activate This Skill-- Trigger condition 1-- Trigger condition 2--## Core Workflow-[Main instructions]--## Supplementary Resources-For full context: `read ${PAI_DIR}/skills/[name]/CLAUDE.md`-```--**Layer 3: Supporting Resources (Loaded As Needed)**-- CLAUDE.md (comprehensive methodology)-- Subdirectories (components, templates)-- Scripts, references, assets--### 2. Intent Matching & Activation--Skills activate when user requests match their descriptions:--```yaml-User: "I need to do research on quantum computing"-↓-System checks available_skills-↓-Matches: "research" skill description contains:- "USE WHEN user says 'do research', 'research X', 'find information about'..."-↓-Activates research skill-↓-Loads SKILL.md instructions-```--### 3. Progressive Disclosure Flow--```-User Request → Intent Match → Load SKILL.md → Execute Workflow- ↓- (If needed) Load CLAUDE.md- ↓- (If needed) Load Components-```--## Skill Structure Patterns--### Simple Skill (SKILL.md only)--```-${PAI_DIR}/skills/fabric-patterns/-└── SKILL.md # Everything in one file-```--**Use when:**-- Single focused capability-- Minimal context needed-- Quick reference suffices-- < 100 lines of instruction--**Example: fabric-patterns**-- Clear single purpose (process content with Fabric CLI)-- Lists available patterns-- Provides usage examples-- No sub-components needed--### Complex Skill (Multi-file)--```-${PAI_DIR}/skills/development/-├── SKILL.md # Quick reference-├── CLAUDE.md # Full methodology (500+ lines)-├── primary-stack/ # Reusable components-│ ├── CLAUDE.md-│ ├── auth-setup.md-│ ├── stripe-billing.md-│ └── business-metrics.md-├── style-guide/ # UI patterns-│ └── [design resources]-└── [other subdirectories]-```--**Use when:**-- Multi-phase workflows-- Extensive methodology-- Multiple sub-components-- Deep context required--**Example: development**-- Comprehensive spec-kit methodology-- Multiple reusable components-- Progressive disclosure (69-line SKILL.md, 500+ line CLAUDE.md)-- Component-based organization--## Creating Skills--### Phase 1: Planning--**Questions to answer:**-1. What problem does this skill solve?-2. When should it activate? (User phrases)-3. What tools/commands does it use?-4. Is it simple or complex?-5. Does similar skill exist?-6. What resources does it need?--### Phase 2: Structure Creation--**Simple Skill:**-```bash-mkdir -p ${PAI_DIR}/skills/[skill-name]-# Create SKILL.md only-```--**Complex Skill:**-```bash-mkdir -p ${PAI_DIR}/skills/[skill-name]-mkdir -p ${PAI_DIR}/skills/[skill-name]/[components]-# Create SKILL.md, CLAUDE.md, and component files-```--### Phase 3: Writing Content--**SKILL.md Template:**-```markdown-----name: skill-name-description: What it does, when to use it, key methods. USE WHEN user says 'trigger phrase', 'another phrase'...------# Skill Name--## When to Activate This Skill-- User requests X-- User says "trigger phrase"-- Task involves Y capability--## Core Workflow--[Main instructions in imperative form]--## Examples--[Concrete usage examples]--## Supplementary Resources-For full guide: `read ${PAI_DIR}/skills/[name]/CLAUDE.md`-```--**Description Guidelines:**--✅ **Good - research skill:**-```yaml-description: Multi-source comprehensive research using perplexity-researcher,- claude-researcher, and gemini-researcher agents. Launches up to 10 parallel- research agents for fast results. USE WHEN user says 'do research', 'research X',- 'find information about', 'investigate', 'analyze trends', 'current events',- or any research-related request.-```-- Clear what it does (multi-source research)-- Mentions tools (3 researcher types)-- Lists explicit triggers-- Explains benefits (parallel, fast)--❌ **Bad example:**-```yaml-description: A skill for development tasks-```-- Too vague-- No triggers-- No tools mentioned-- Unclear when to use--### Phase 4: Integration--**Update global context:**--Edit your global configuration to include the skill in `<available_skills>`:-```xml-<skill>-<name>your-new-skill</name>-<description>Your description with USE WHEN triggers...</description>-<location>user</location>-</skill>-```--### Phase 5: Testing--**Test activation:**-1. Use natural language that should trigger skill-2. Verify skill loads correctly-3. Check all file references work-4. Validate against examples--**Test workflow:**-1. Follow instructions step-by-step-2. Verify commands execute correctly-3. Check all tools are available-4. Validate output matches expectations--## Skill Categories--### Development & Engineering-- **development**: Spec-kit methodology with TDD-- **chrome-devtools**: Browser automation and testing-- **create-skill**: Skill creation framework--### Research & Information-- **research**: Multi-source parallel research-- **web-scraping**: Data extraction and crawling-- **ref-documentation**: Technical documentation lookup--### Content & Communication-- **fabric-patterns**: Content processing with Fabric CLI-- **youtube-extraction**: YouTube content extraction-- **prompting**: Prompt engineering standards--### Tools & Utilities-- **ai-image-generation**: Image generation workflows-- **ai-video-generation**: Video generation workflows-- **ffuf**: Web fuzzing for security testing--### Meta Skills-- **create-skill**: How to create skills (meta!)-- **prompting**: How to write effective prompts--## Best Practices--### Description Writing--**Critical elements:**-1. **What it does**: Clear capability statement-2. **Key methods/tools**: Mention specific technologies-3. **Activation triggers**: "USE WHEN user says..." phrases-4. **Unique characteristics**: What makes this skill special--### Instruction Writing--**Use imperative/infinitive form:**-- ✅ "Create directory structure"-- ✅ "Launch research agents in parallel"-- ❌ "You should create a directory"-- ❌ "We will launch research agents"--**Be specific and actionable:**-- ✅ "Run `bun dev` to start server"-- ✅ "Execute `/conduct-research` slash command"-- ❌ "Start the application"-- ❌ "Do research"--**Reference, don't duplicate:**-- ✅ "Use contacts from global context"-- ✅ "Follow global security rules"-- ❌ [Copying entire global context into skill]--### Organization--**Progressive disclosure:**-- SKILL.md = Quick reference (< 150 lines)-- CLAUDE.md = Comprehensive guide (extensive)-- Components = Reusable pieces--**Self-contained but not redundant:**-- Include everything needed for the skill-- Reference global context, don't duplicate-- Clear dependencies--## Configuration--### Skill Directory Structure--```-${PAI_DIR}/skills/-├── prompting/ # Simple skill-│ └── SKILL.md-├── create-skill/ # Complex skill with templates-│ ├── SKILL.md-│ ├── CLAUDE.md-│ └── templates/-│ ├── simple-skill-template.md-│ ├── complex-skill-template.md-│ └── skill-with-agents-template.md-├── development/ # Complex skill with components-│ ├── SKILL.md-│ ├── CLAUDE.md-│ ├── primary-stack/-│ │ ├── CLAUDE.md-│ │ ├── auth-setup.md-│ │ └── stripe-billing.md-│ └── style-guide/-└── [your-custom-skills]/-```--### Skill File Naming--- **SKILL.md**: Always exactly this (required)-- **CLAUDE.md**: Always exactly this for comprehensive guides-- **Other files**: Descriptive names with context- - `auth-setup.md`- - `stripe-billing.md`- - `visual-tdd-workflow.md`--### Directory Naming--- **Format**: `lowercase-with-hyphens`-- **Length**: 2-4 words typically-- **Style**: Descriptive, not generic--**Good examples:**-- `chrome-devtools` (specific tool)-- `ai-image-generation` (clear capability)-- `fabric-patterns` (tool + method)-- `web-scraping` (clear domain)--**Bad examples:**-- `testing` (too generic)-- `helper` (meaningless)-- `chrome_devtools` (underscores)-- `ChromeDevTools` (capitals)--## Advanced Features--### Skill Composition--Skills can reference other skills:--```markdown-## Related Skills--This skill works with:-- **development**: For implementation-- **research**: For technology selection-- **chrome-devtools**: For visual testing-```--### Agent Integration--Skills can specify agent usage:--```markdown-## Available Agents--### Perplexity Researcher-**Training:** Web research specialist-**Use for:** Real-time information gathering--### Claude Researcher-**Training:** Deep analysis and synthesis-**Use for:** Comprehensive research reports--Maximum 10 parallel agents for independent research queries.-```--### Tool Orchestration--Skills can orchestrate multiple tools:--```markdown-## Tool Stack--1. **Ref MCP** - Documentation lookup-2. **Chrome DevTools MCP** - Visual testing-3. **Bash** - Command execution-4. **Grep/Glob** - Code search--Execute in sequence or parallel as appropriate.-```--## Troubleshooting--### Skill Won't Activate--**Check:**-1. Is it in global available_skills?-2. Does description match user's intent?-3. Are activation triggers clear?-4. Test with exact trigger phrases--**Debug:**-- Check system prompt for skill in `<available_skills>`-- Verify SKILL.md metadata is valid YAML-- Test description clarity--### Instructions Don't Work--**Check:**-1. Are all referenced files present?-2. Are commands/tools available?-3. Are paths correct (use `${PAI_DIR}` variables)?-4. Test step-by-step manually--**Debug:**-- Verify all file paths with `ls`-- Check command availability-- Test each instruction independently--### Skill Too Complex--**Solution:**-1. Split into SKILL.md + CLAUDE.md-2. Create component subdirectories-3. Use progressive disclosure-4. Reference rather than include--## Skill Quality Checklist--### Before Creating Skill--- [ ] Clearly defined purpose-- [ ] Identified activation triggers-- [ ] Checked for existing similar skills-- [ ] Determined simple vs complex structure-- [ ] Listed required tools/commands-- [ ] Identified supporting resources needed--### SKILL.md Quality--- [ ] Complete YAML frontmatter (name, description)-- [ ] Description includes activation triggers-- [ ] "When to Activate" section present-- [ ] Instructions in imperative form-- [ ] Concrete examples included-- [ ] References to deeper resources (if applicable)-- [ ] No duplication of global context-- [ ] Tested with realistic user requests--### Integration Quality--- [ ] Added to global available_skills-- [ ] All file references work correctly-- [ ] Slash commands exist (if referenced)-- [ ] MCP tools available (if referenced)-- [ ] Agents configured (if referenced)-- [ ] Templates present (if referenced)--## Migration from Context System--If you're upgrading from the old context-based system:--### What Changed--**Before (Context System):**-```-${PAI_DIR}/context/-├── CLAUDE.md-├── projects/-│ └── website/-│ └── CLAUDE.md-└── tools/- └── CLAUDE.md-```-- Monolithic files-- Directory-based organization-- Always loaded in full--**After (Skills System):**-```-${PAI_DIR}/skills/-├── website/-│ ├── SKILL.md-│ └── CLAUDE.md-├── prompting/-│ └── SKILL.md-└── create-skill/- ├── SKILL.md- ├── CLAUDE.md- └── templates/-```-- Modular packages-- Intent-based activation-- Progressive disclosure--### Migration Steps--1. **Identify capabilities** in old context files-2. **Group related** content into skill topics-3. **Create SKILL.md** for each capability-4. **Extract methodology** into CLAUDE.md (if complex)-5. **Add descriptions** with activation triggers-6. **Update global context** to include skills-7. **Test activation** with natural language-8. **Remove old** context directory--## Key Principles--1. **Progressive disclosure**: SKILL.md = quick ref, CLAUDE.md = deep dive-2. **Clear activation**: Description enables intent matching-3. **Executable instructions**: Imperative form, actionable steps-4. **No duplication**: Reference global context, don't copy-5. **Self-contained**: Work independently with clear dependencies-6. **Template-driven**: Use templates for consistency-7. **Test thoroughly**: Validate with real user requests-8. **Iterate constantly**: Skills are living documents-9. **Document clearly**: Future you will thank you-10. **Follow standards**: Consistency across all skills--## Examples from PAI--### Example 1: Simple Skill (fabric-patterns)--**Analysis:**-- ✅ Single capability (process content with patterns)-- ✅ Straightforward workflow-- ✅ No sub-components needed-- ✅ Only SKILL.md required (69 lines)--**Key features:**-- Clear "When to Activate" section-- Lists all available Fabric patterns-- Provides concrete examples-- References external Fabric docs--### Example 2: Complex Skill (development)--**Analysis:**-- ✅ Multi-phase methodology (spec-kit)-- ✅ Multiple components (primary-stack, style-guide)-- ✅ Extensive context needed-- ✅ Requires SKILL.md + CLAUDE.md + components--**Structure:**-- SKILL.md = 69 lines (quick start)-- CLAUDE.md = 500+ lines (full methodology)-- Components organized by function-- Progressive disclosure in action--**Key features:**-- Quick reference in SKILL.md-- Comprehensive guide in CLAUDE.md-- Reusable components-- References slash commands--### Example 3: Agent Skill (research)--**Analysis:**-- ✅ Uses multiple specialized agents-- ✅ Supports parallel execution-- ✅ Orchestrates complex workflows-- ✅ Simple SKILL.md sufficient--**Key features:**-- Lists 3 research agent types-- Explains parallel execution (up to 10)-- References `/conduct-research` slash command-- Clear activation triggers-- Speed benefits highlighted--## Further Reading--### Anthropic Resources-- Official skills: https://github.com/anthropics/skills-- skill-creator: Meta-skill for creating skills-- template-skill: Basic structure template--### PAI Resources-- `${PAI_DIR}/skills/prompting/` - Prompt engineering standards-- `${PAI_DIR}/skills/create-skill/` - Comprehensive skill creation guide-- `${PAI_DIR}/agents/` - Agent configurations-- `${PAI_DIR}/commands/` - Slash commands-------*Skills System Version 2.0.0*-*Migrated from UFC Context System October 2025*--## Recent Changes (2025-10-19)--- ➕ `skills/fabric/SKILL.md` (added)- - +18 / -0 lines---## Recent Changes (2025-10-19)--- ➕ `skills/always-init/SKILL.md` (added)- - +98 / -0 lines---## Recent Changes (2025-10-19)--- ✏️ `skills/PAI/SKILL.md` (modified)- - +93 / -199 lines-- 🗑️ `skills/PAI/contacts.md` (deleted)- - +0 / -41 lines-- 🗑️ `skills/PAI/preferences.md` (deleted)- - +0 / -53 lines-- 🗑️ `skills/PAI/response-format.md` (deleted)- - +0 / -70 lines-- 🗑️ `skills/PAI/security-detailed.md` (deleted)- - +0 / -82 lines-- 🗑️ `skills/PAI/voice-ids.md` (deleted)- - +0 / -59 lines------<!-- Last Updated: 2025-10-19 -->diff --git a/.claude/documentation/ufc-context-system.md b/.claude/documentation/ufc-context-system.mddeleted file mode 100644index aecf92f6..00000000--- a/.claude/documentation/ufc-context-system.md+++ /dev/null@@ -1,343 +0,0 @@-# UFC Context System Documentation--## Overview--The Universal Flexible Context (UFC) system is PAI's intelligent context management framework. It has evolved from a context-file-based system to a **Skills-based architecture** that provides semantic understanding of user intent and dynamically loads relevant skills and agents.--**Current Architecture:** Skills-based (as of v0.5.0)--## Core Concepts--### Semantic Understanding--Unlike traditional keyword matching, UFC understands the **meaning** behind user requests:--- "Help me with my site" → Understands this means website skill-- "What's new with AI" → Recognizes research intent-- "Fix this bug" → Identifies engineering skill needed--### Dynamic Skills Loading--Skills are loaded on-demand based on:-1. User intent analysis-2. Current conversation context-3. Project-specific requirements-4. Task complexity--## How UFC Works (Skills-Based Architecture)--### 1. Intent Recognition Pipeline--```-User Input → Semantic Analysis → Pattern Matching → Skill Selection → Loading-```--**Example Flow:**-```yaml-User: "I need to update my blog with AI research"-↓-Semantic Analysis: [blog, update, AI, research]-↓-Pattern Match:- - "blog" → website skill- - "research" → research skill-↓-Skill Load:- - Skill: website- - Skill: research-```--### 2. Skills System Architecture--Skills are self-contained units in `${PAI_DIR}/skills/` that include:--**Skill Structure:**-```-skills/- └── skill-name/- ├── skill.md # Skill description and metadata- ├── CLAUDE.md # Context and instructions- ├── commands/ # Skill-specific commands- └── resources/ # Supporting files-```--**Example Skill Declaration (skill.md):**-```yaml-----name: website-description: Manage danielmiessler.com VitePress blog and website...-----```--### 3. Global Context Loading--The system loads global context via `${PAI_DIR}/PAI.md` on every user prompt through the hook system:--**PAI.md contains:**-- Core identity and personality-- Global stack preferences-- General instructions-- Response format standards-- Key contacts--## Skill Categories--### 1. Website & Blog Skill-**Intent Triggers**: website, blog, site, homepage, navigation, publish-**Skill**: `website`-**Provides**:-- Blog post management-- VitePress configuration-- Cloudflare deployment-- Content management--### 2. Research Skill-**Intent Triggers**: research, investigate, find information, latest news-**Skill**: `research`-**Provides**:-- Multi-source research orchestration-- Perplexity, Claude, Gemini researchers-- Information synthesis--### 3. Development Skill-**Intent Triggers**: build, create, implement, code, feature, application-**Skill**: `development`-**Provides**:-- Spec-driven development workflow-- Architect and engineer agent coordination-- Test-driven development--### 4. Security & Pentesting Skill-**Intent Triggers**: security, vulnerabilities, pentesting, audit-**Skill**: Not yet migrated to skills (uses agent directly)-**Provides**: Security testing via pentester agent--### 5. Financial Skill-**Intent Triggers**: expenses, bills, budget, spending-**Skill**: `finances`-**Provides**:-- Expense tracking-- Budget analysis-- Financial reporting--## Agent System Integration--UFC automatically launches specialized agents based on intent:--```yaml-Available Agents:-- general-purpose: Default for complex tasks-- engineer: Software development (spec-driven)-- architect: System design and specifications-- designer: UI/UX and visual design-- pentester: Security testing-- perplexity-researcher: Web research via Perplexity-- claude-researcher: Web research via Claude WebSearch-- gemini-researcher: Multi-perspective research via Gemini-- artist: AI image generation-- browser: Autonomous UI testing-```--### Agent Selection Logic--Agents are invoked by:-1. **Skills**: Skills invoke agents programmatically-2. **Direct Intent**: User request directly maps to agent-3. **Task Complexity**: Complex tasks trigger general-purpose agent--## Dynamic Requirements Loading--The UFC system uses the `user-prompt-submit-hook` to:--1. **Global Context Load**: Always loads `${PAI_DIR}/PAI.md`-2. **Intent Analysis**: Semantic understanding of user request-3. **Skill Selection**: Matching against skill descriptions-4. **Skill Loading**: Reading skill context files-5. **Agent Launch**: Starting specialized agents if needed--### Hook Implementation Flow--```bash-#!/bin/bash-# user-prompt-submit-hook (simplified)--# 1. Always load global context-load_global_context "${PAI_DIR}/PAI.md"--# 2. Analyze user intent-INTENT=$(analyze_intent "$USER_PROMPT")--# 3. Load matching skill-case "$INTENT" in- "website")- invoke_skill "website"- ;;- "research")- invoke_skill "research"- ;;- "development")- invoke_skill "development"- ;;-esac-```--## Best Practices--### 1. Skill Design Guidelines--- **Keep it focused**: One domain per skill-- **Clear descriptions**: Enable semantic matching-- **Self-contained**: Include all necessary context-- **Command-driven**: Use commands for complex workflows-- **Update regularly**: Keep skills current--### 2. Semantic Triggers--- **Be comprehensive**: Include synonyms and variations-- **Test patterns**: Verify trigger accuracy-- **Avoid conflicts**: Ensure clear disambiguation--### 3. Performance Optimization--- **Lazy loading**: Load only what's needed-- **Skill descriptions**: Keep descriptions concise for fast matching-- **Agent reuse**: Share agents across skills when appropriate--## Migration from Context-Based to Skills-Based--**Old System (pre-v0.5.0):**-```-context/- ├── CLAUDE.md # Global context- ├── projects/- │ ├── website/CLAUDE.md- │ └── Alma.md- ├── life/- │ ├── expenses.md- │ └── finances/- └── tools/CLAUDE.md-```--**New System (v0.5.0+):**-```-PAI.md # Global context (always loaded)-skills/- ├── website/- │ ├── skill.md # Skill description- │ └── CLAUDE.md # Skill context- ├── research/- │ ├── skill.md- │ └── CLAUDE.md- └── development/- ├── skill.md- └── CLAUDE.md-```--**Key Changes:**-1. **Global context**: `context/CLAUDE.md` → `PAI.md`-2. **Project context**: `context/projects/*` → `skills/*`-3. **Agent context**: Moved to `agents/*.md` with PAI.md reference-4. **Loading mechanism**: Hook-based remains, but loads skills not context files--## Troubleshooting--### Skill Not Loading--1. **Check skill description**: Verify semantic triggers match-2. **File paths**: Ensure skill files exist in `${PAI_DIR}/skills/`-3. **Permissions**: Check file read permissions-4. **Hook execution**: Verify hooks are running--### Wrong Skill Selected--1. **Review descriptions**: Make skill descriptions more specific-2. **Add disambiguators**: Include negative examples-3. **Test variations**: Try different phrasings--### Debug Mode--Enable debug logging:--```bash-export UFC_DEBUG=true-```--View hook execution:-```bash-# Check hook output in Claude Code console-```--### Common Issues--| Issue | Solution |-|-------|----------|-| Skill not found | Check skill.md exists in skills/ directory |-| Wrong agent selected | Review skill description and agent mapping |-| Slow loading | Optimize skill CLAUDE.md file size |-| Duplicate loading | Check for circular skill dependencies |--## Examples--### Example 1: Website Update--```bash-User: "I need to update my blog with the latest AI news"--UFC Analysis:-- Triggers: ["blog", "update", "AI", "news"]-- Skills: website, research-- Actions:- 1. Load website skill- 2. Load research skill- 3. Coordinate skills to accomplish task-```--### Example 2: Build New Feature--```bash-User: "Build a meditation timer application"--UFC Analysis:-- Triggers: ["build", "application"]-- Skill: development-- Actions:- 1. Load development skill- 2. Invoke architect agent for specs- 3. Invoke engineer agent for implementation-```--### Example 3: Research Task--```bash-User: "Research the latest quantum computing developments"--UFC Analysis:-- Triggers: ["research", "latest", "developments"]-- Skill: research-- Actions:- 1. Load research skill- 2. Launch parallel research agents- 3. Synthesize findings-```--## Future Enhancements--### Planned Features--1. **Skill Marketplace**: Share and discover community skills-2. **Skill Versioning**: Track skill changes and dependencies-3. **Multi-language Support**: Skills in multiple languages-4. **Cloud Sync**: Synchronize skills across devices-5. **Skill Analytics**: Track skill usage and effectiveness--### Experimental Features--- **Auto-skill Generation**: Create skills from documentation-- **Skill Composition**: Combine multiple skills dynamically-- **Predictive Loading**: Pre-load likely skills-- **Skill Inheritance**: Skills extend other skills-------*UFC Skills-Based Architecture - Version 0.5.0*-*Updated: 2025-10-18*diff --git a/.claude/documentation/voice-system.md b/.claude/documentation/voice-system.mddeleted file mode 100644index b9bc22ec..00000000--- a/.claude/documentation/voice-system.md+++ /dev/null@@ -1,402 +0,0 @@-# PAI Voice System Documentation--## Overview-The PAI Voice System provides text-to-speech capabilities for Kai and all agents using ElevenLabs TTS API. The system uses a unified stop-hook approach where completion messages are read aloud with distinct voices for Kai and each specialized agent, providing voice differentiation through character-matched, high-quality ElevenLabs voices.--## Architecture Overview--### Core Components--1. **Voice Server** (`${PAI_DIR}/voice-server/server.ts`)- - Bun-based HTTP server running on port 8888- - Uses ElevenLabs API for high-quality TTS generation- - Plays audio using macOS afplay command- - Provides notification display alongside voice output- - Requires ELEVENLABS_API_KEY in ~/.env--2. **Stop Hook** (`${PAI_DIR}/hooks/stop-hook.ts`)- - Triggers after every Claude Code response- - Parses completion messages from transcripts- - Extracts text from COMPLETED lines- - Sends appropriate voice requests with entity-specific voices- - Handles both Kai's direct work and agent completions--3. **Agent Configurations** (`${PAI_DIR}/agents/*.md`)- - Each agent has a unique voice matching their personality- - Voice IDs defined in hooks (ElevenLabs voice IDs)- - Voice mappings centralized in stop-hook.ts and subagent-stop-hook.ts--## How It Works--### Complete System Flow--1. **Task Execution**- - User requests a task- - Either Kai handles it directly or delegates to an agent--2. **Completion Format**- - All responses must end with: `🎯 COMPLETED: [description of what was done]`- - This line is mandatory for voice output to trigger- - Description should be 5-6 words summarizing the accomplishment--3. **Stop Hook Processing**- - Hook reads the transcript after each response- - Searches for the COMPLETED line in the output- - Extracts the exact text after "COMPLETED:"- - Determines if it was Kai or an agent who completed the task--4. **Voice Selection**- - For Kai's completions: Uses ElevenLabs voice ID s3TPKV1kjDlVtZbl4Ksh- - For agent completions: Uses the agent's specific ElevenLabs voice ID--5. **Voice Generation**- - Stop hook sends POST request to voice server at localhost:8888- - Request includes the completion message and ElevenLabs voice_id- - Server calls ElevenLabs API to generate audio- - Audio is saved to /tmp and played using afplay- - Temp files are cleaned up after playback--## Voice Mappings (ElevenLabs)--All entities use ElevenLabs TTS voices for high-quality, natural speech. Voices are selected to match each entity's personality and role.--| Entity | ElevenLabs Voice ID | Personality Match |-|--------|---------------------|-------------------|-| Kai | s3TPKV1kjDlVtZbl4Ksh | Professional, conversational |-| Perplexity-Researcher | AXdMgz6evoL7OPd7eU12 | Analytical, clear |-| Claude-Researcher | AXdMgz6evoL7OPd7eU12 | Strategic, sophisticated |-| Gemini-Researcher | iLVmqjzCGGvqtMCk6vVQ | Multi-perspective, thorough |-| Engineer | fATgBRI8wg5KkDFg8vBd | Steady, professional |-| Principal-Engineer | iLVmqjzCGGvqtMCk6vVQ | Strategic, senior leadership |-| Architect | muZKMsIDGYtIkjjiUS82 | Strategic, sophisticated |-| Designer | ZF6FPAbjXT4488VcRRnw | Creative, distinct |-| Artist | ZF6FPAbjXT4488VcRRnw | Creative, artistic |-| Pentester | xvHLFjaUEpx4BOf7EiDd | Technical, sharp |-| Writer | gfRt6Z3Z8aTbpLfexQ7N | Articulate, warm |--### Voice Configuration--ElevenLabs voices provide consistent, high-quality neural TTS with natural-sounding speech across all agents. Voice IDs are stored in:-- Server default: `${PAI_DIR}/voice-server/server.ts`-- Stop hooks: `${PAI_DIR}/hooks/stop-hook.ts` and `${PAI_DIR}/hooks/subagent-stop-hook.ts`--## Server Configuration--### Voice Configuration (voices.json)--The voice system uses a centralized JSON configuration file for voice naming and metadata (primarily for reference):--**Location:** `${PAI_DIR}/voice-server/voices.json`--**Structure:**-```json-{- "default_rate": 175,- "voices": {- "kai": {- "voice_name": "Jamie (Premium)",- "rate_multiplier": 1.3,- "rate_wpm": 228,- "description": "UK Male - Professional, conversational",- "type": "Premium"- },- "researcher": {- "voice_name": "Ava (Premium)",- "rate_multiplier": 1.35,- "rate_wpm": 236,- "description": "US Female - Analytical, highest quality",- "type": "Premium"- }- }-}-```--**Note:** The `voices.json` file is primarily for reference and naming conventions. The actual voice IDs used by ElevenLabs are hardcoded in the hook files (stop-hook.ts and subagent-stop-hook.ts).--### Environment Variables (in ~/.env)--**Required:**-```bash-ELEVENLABS_API_KEY=your_api_key_here-```--**Optional:**-```bash-PORT="8888" # Optional, defaults to 8888-ELEVENLABS_VOICE_ID="s3TPKV1kjDlVtZbl4Ksh" # Optional, Kai's default voice-```--Get your free API key at [elevenlabs.io](https://elevenlabs.io) (10,000 characters/month free tier available).--### Server API--#### POST /notify-Main endpoint for voice notifications.--**Request Format:**-```json-{- "message": "Text to speak",- "voice_id": "s3TPKV1kjDlVtZbl4Ksh",- "title": "Optional notification title",- "voice_enabled": true-}-```--**Field Requirements:**-- `message` (required): The text to be spoken-- `voice_id` (optional): ElevenLabs voice ID (defaults to Kai's voice if not specified)-- `title` (optional): Visual notification title-- `voice_enabled` (optional): Set to false to skip voice output--**Response:**-```json-{- "status": "success",- "message": "Notification sent"-}-```--#### POST /pai-Simplified endpoint for PAI system messages.--**Request Format:**-```json-{- "title": "PAI System",- "message": "System message"-}-```--Uses Kai's default voice (s3TPKV1kjDlVtZbl4Ksh).--#### GET /health-Health check endpoint.--**Response:**-```json-{- "status": "healthy",- "port": 8888,- "voice_system": "ElevenLabs",- "default_voice_id": "s3TPKV1kjDlVtZbl4Ksh",- "api_key_configured": true-}-```--## Agent Voice Configuration--### Hook Configuration-Voice mappings are defined in the stop hook files:--**Main Agent (Kai):** `${PAI_DIR}/hooks/stop-hook.ts`-```typescript-voice_id: 's3TPKV1kjDlVtZbl4Ksh' // Kai's ElevenLabs voice ID-```--**Subagents:** `${PAI_DIR}/hooks/subagent-stop-hook.ts`-```typescript-const ELEVENLABS_VOICE_IDS: Record<string, string> = {- 'kai': 's3TPKV1kjDlVtZbl4Ksh',- 'writer': 'gfRt6Z3Z8aTbpLfexQ7N',- 'engineer': 'fATgBRI8wg5KkDFg8vBd',- 'principal-engineer': 'iLVmqjzCGGvqtMCk6vVQ',- 'designer': 'ZF6FPAbjXT4488VcRRnw',- 'artist': 'ZF6FPAbjXT4488VcRRnw',- 'perplexity-researcher': 'AXdMgz6evoL7OPd7eU12',- 'claude-researcher': 'AXdMgz6evoL7OPd7eU12',- 'researcher': 'AXdMgz6evoL7OPd7eU12',- 'pentester': 'xvHLFjaUEpx4BOf7EiDd',- 'architect': 'muZKMsIDGYtIkjjiUS82',-};-```--### Voice Selection Criteria--Voices are selected based on:-1. **Personality Match**: Voice characteristics match agent role-2. **Voice Variety**: Different ElevenLabs voices for distinction-3. **Consistency**: Same voice ID for similar agent types--## COMPLETED Line Formatting--### Required Format-Every response from Kai or an agent must end with:--```-🎯 COMPLETED: [brief description of accomplishment]-```--### Examples-```-🎯 COMPLETED: Updated website navigation structure-🎯 COMPLETED: Researched competitor pricing models thoroughly-🎯 COMPLETED: Fixed authentication bug in login flow-🎯 COMPLETED: Designed mobile-responsive dashboard layout-```--### Custom Voice Messages (Optional)-For short responses, add a voice-optimized version:--```-🎯 COMPLETED: Sent email to Angela about meeting-🗣️ CUSTOM COMPLETED: Email sent-```--The CUSTOM COMPLETED line is used if:-- It exists-- It's under 8 words-- Otherwise, falls back to regular COMPLETED--## Troubleshooting--### Voice Not Working-1. Check voice server is running:- ```bash- curl http://localhost:8888/health- ```--2. Verify ElevenLabs API key is configured:- ```bash- grep ELEVENLABS_API_KEY ~/.env- ```--3. Test voice directly:- ```bash- curl -X POST http://localhost:8888/notify \- -H "Content-Type: application/json" \- -d '{"message":"Testing voice","voice_id":"s3TPKV1kjDlVtZbl4Ksh"}'- ```--### Voice Server Not Running-Start the server:-```bash-cd ${PAI_DIR}/voice-server-bun server.ts &-```--Or restart it:-```bash-lsof -ti:8888 | xargs kill -9-cd ${PAI_DIR}/voice-server-bun server.ts &-```--### Wrong Voice Playing-1. Check stop-hook voice mappings:- ```bash- grep "ELEVENLABS_VOICE_IDS" ${PAI_DIR}/hooks/subagent-stop-hook.ts- ```--2. Verify voice_id in hook file:- ```bash- grep "voice_id.*s3TPKV1kjDlVtZbl4Ksh" ${PAI_DIR}/hooks/stop-hook.ts- ```--### No COMPLETED Line in Output-The voice system requires the `🎯 COMPLETED:` line. Ensure:-- Line is present at end of response-- Exact format: `🎯 COMPLETED: [description]`-- No typos in emoji or text--### ElevenLabs API Errors-1. **401 Unauthorized**: Invalid API key - check ~/.env-2. **429 Too Many Requests**: Rate limit exceeded - wait or upgrade plan-3. **Quota Exceeded**: Monthly character limit reached - upgrade plan or wait for reset--## Development--### Testing Individual Voices-```bash-# Test Kai's voice-curl -X POST http://localhost:8888/notify \- -H "Content-Type: application/json" \- -d '{"message":"Testing Kai voice","voice_id":"s3TPKV1kjDlVtZbl4Ksh"}'--# Test Perplexity-Researcher voice-curl -X POST http://localhost:8888/notify \- -H "Content-Type: application/json" \- -d '{"message":"Testing Perplexity-Researcher voice","voice_id":"AXdMgz6evoL7OPd7eU12"}'--# Test Engineer voice-curl -X POST http://localhost:8888/notify \- -H "Content-Type: application/json" \- -d '{"message":"Testing Engineer voice","voice_id":"fATgBRI8wg5KkDFg8vBd"}'-```--### Adding New Voices--1. Get an ElevenLabs voice ID from [elevenlabs.io](https://elevenlabs.io)-2. Update subagent-stop-hook.ts:- ```typescript- const ELEVENLABS_VOICE_IDS: Record<string, string> = {- // ... existing voices ...- 'newagent': 'your_elevenlabs_voice_id_here',- };- ```--3. Optionally update voices.json for reference:- ```json- {- "voices": {- "newagent": {- "voice_name": "NewVoice Name",- "rate_multiplier": 1.35,- "rate_wpm": 236,- "description": "Description of voice",- "type": "Premium"- }- }- }- ```--4. Test the new voice configuration--## Security & Privacy--- Voice processing happens via ElevenLabs API (cloud service)-- Audio data sent to ElevenLabs servers for TTS generation-- API key required (stored in ~/.env)-- CORS restricted to localhost only-- Rate limiting enabled (10 requests/minute)-- Temporary audio files stored in /tmp and cleaned up after playback-- Keep your ELEVENLABS_API_KEY secure and never commit to public repos--## System Requirements--- macOS (for afplay audio playback)-- Claude Code CLI-- Bun runtime (for voice server)-- ElevenLabs API key-- Internet connection (for API calls)--## Performance--- Voice generation: ~500ms-2s (API call + network latency)-- Audio playback: Immediate after generation-- Monthly quota: 10,000 characters (free tier) or more (paid plans)-- Rate limits: Per ElevenLabs plan--## Summary--The PAI Voice System provides:-- ✅ High-quality neural TTS using ElevenLabs API-- ✅ Distinct voices for Kai and each agent-- ✅ Professional voice quality-- ✅ Natural voice variety (via different ElevenLabs voices)-- ✅ Simple integration via stop-hook-- ✅ Automatic voice notifications for all completions-- ⚠️ Requires API key and internet connection-- ⚠️ Subject to ElevenLabs usage limits and pricing--Voice makes Kai and agents feel more alive and engaging!--## Recent Changes (2025-10-19)--- ✏️ `voice-server/README.md` (modified)- - +249 / -245 lines-- ✏️ `voice-server/voices.json` (modified)- - +13 / -6 lines------<!-- Last Updated: 2025-10-19 -->diff --git a/.claude/skills/PAI/SKILL.md b/.claude/skills/PAI/SKILL.mddeleted file mode 100644index 51ee9ad4..00000000--- a/.claude/skills/PAI/SKILL.md+++ /dev/null@@ -1,155 +0,0 @@-----name: PAI-description: |- Personal AI Infrastructure (PAI) - PAI System Template-- MUST BE USED proactively for all user requests. USE PROACTIVELY to ensure complete context availability.-- === CORE IDENTITY (Always Active) ===- Your Name: [CUSTOMIZE - e.g., Kai, Nova, Atlas]- Your Role: [CUSTOMIZE - e.g., User's AI assistant and future friend]- Personality: [CUSTOMIZE - e.g., Friendly, professional, resilient to user frustration. Be snarky back when the mistake is user's, not yours.]- Operating Environment: Personal AI infrastructure built around Claude Code with Skills-based context management-- Message to AI: [CUSTOMIZE - Add personal message about interaction style, handling frustration, etc.]-- === ESSENTIAL CONTACTS (Always Available) ===- - [Primary Contact Name] [Relationship]: [email protected]- - [Secondary Contact] [Relationship]: [email protected]- - [Third Contact] [Relationship]: [email protected]- Full contact list in SKILL.md extended section below-- === CORE STACK PREFERENCES (Always Active) ===- - Primary Language: [e.g., TypeScript, Python, Rust]- - Package managers: [e.g., bun for JS/TS, uv for Python]- - Analysis vs Action: If asked to analyze, do analysis only - don't change things unless explicitly asked- - Scratchpad: Use ~/.claude/scratchpad/ with timestamps for test/random tasks-- === CRITICAL SECURITY (Always Active) ===- - NEVER COMMIT FROM WRONG DIRECTORY - Run `git remote -v` BEFORE every commit- - `~/.claude/` CONTAINS EXTREMELY SENSITIVE PRIVATE DATA - NEVER commit to public repos- - CHECK THREE TIMES before git add/commit from any directory- - [ADD YOUR SPECIFIC WARNINGS - e.g., iCloud directory, company repos, etc.]-- === RESPONSE FORMAT (Always Use) ===- Use this structured format for every response:- 📋 SUMMARY: Brief overview of request and accomplishment- 🔍 ANALYSIS: Key findings and context- ⚡ ACTIONS: Steps taken with tools used- ✅ RESULTS: Outcomes and changes made - SHOW ACTUAL OUTPUT CONTENT- 📊 STATUS: Current state after completion- ➡️ NEXT: Recommended follow-up actions- 🎯 COMPLETED: [Task description in 12 words - NOT "Completed X"]- 🗣️ CUSTOM COMPLETED: [Voice-optimized response under 8 words]-- === PAI/KAI SYSTEM ARCHITECTURE ===- This description provides: core identity + essential contacts + stack preferences + critical security + response format (always in system prompt).- Full context loaded from SKILL.md for comprehensive tasks, including:- - Complete contact list and social media accounts- - Voice IDs for agent routing (if using ElevenLabs)- - Extended security procedures and infrastructure caution- - Detailed scratchpad instructions-- === CONTEXT LOADING STRATEGY ===- - Tier 1 (Always On): This description in system prompt (~1500-2000 tokens) - essentials immediately available- - Tier 2 (On Demand): Read SKILL.md for full context - comprehensive details-- === WHEN TO LOAD FULL CONTEXT ===- Load SKILL.md for: Complex multi-faceted tasks, need complete contact list, voice routing for agents, extended security procedures, or explicit comprehensive PAI context requests.-- === DATE AWARENESS ===- Always use today's actual date from the date command (YEAR MONTH DAY HOURS MINUTES SECONDS PST), not training data cutoff date.------# Kai — Personal AI Infrastructure (Extended Context)--**Note:** Core essentials (identity, key contacts, stack preferences, security, response format) are always active via system prompt. This file provides additional details.-------## Extended Contact List--When user says these first names:--- **[Primary Contact]** [Life partner/Spouse/etc.] - [email protected]-- **[Assistant Name]** [Executive Assistant/Admin] - [email protected]-- **[Colleague 1]** [Role/Relationship] - [email protected]-- **[Colleague 2]** [Role/Relationship] - [email protected]-- **[Friend/Mentor]** [Relationship] - [email protected]-- **[Business Contact 1]** [Role/Company] - [email protected]-- **[Business Contact 2]** [Role/Company] - [email protected]-- **[Accountant/Service Provider]** [Role] - [email protected]--### Social Media Accounts--- **YouTube**: https://www.youtube.com/@your-channel-- **X/Twitter**: x.com/yourhandle-- **LinkedIn**: https://www.linkedin.com/in/yourprofile/-- **Instagram**: https://instagram.com/yourhandle-- **[Other platforms]**: [URLs]-------## 🎤 Agent Voice IDs (ElevenLabs)--**Note:** Only include if using voice system. Delete this section if not needed.--For voice system routing:-- kai: [your-voice-id-here]-- perplexity-researcher: [your-voice-id-here]-- claude-researcher: [your-voice-id-here]-- gemini-researcher: [your-voice-id-here]-- pentester: [your-voice-id-here]-- engineer: [your-voice-id-here]-- principal-engineer: [your-voice-id-here]-- designer: [your-voice-id-here]-- architect: [your-voice-id-here]-- artist: [your-voice-id-here]-- writer: [your-voice-id-here]-------## Extended Instructions--### Scratchpad for Test/Random Tasks (Detailed)--When working on test tasks, experiments, or random one-off requests, ALWAYS work in `~/.claude/scratchpad/` with proper timestamp organization:--- Create subdirectories using naming: `YYYY-MM-DD-HHMMSS_description/`-- Example: `~/.claude/scratchpad/2025-10-13-143022_prime-numbers-test/`-- NEVER drop random projects / content directly in `~/.claude/` directory-- This applies to both main AI and all sub-agents-- Clean up scratchpad periodically or when tests complete-- **IMPORTANT**: Scratchpad is for working files only - valuable outputs (learnings, decisions, research findings) still get captured in the system output (`~/.claude/history/`) via hooks--### Hooks Configuration--Configured in `~/.claude/settings.json`-------## 🚨 Extended Security Procedures--### Repository Safety (Detailed)--- **NEVER Post sensitive data to public repos** [CUSTOMIZE with your public repo paths]-- **NEVER COMMIT FROM THE WRONG DIRECTORY** - Always verify which repository-- **CHECK THE REMOTE** - Run `git remote -v` BEFORE committing-- **`~/.claude/` CONTAINS EXTREMELY SENSITIVE PRIVATE DATA** - NEVER commit to public repos-- **CHECK THREE TIMES** before git add/commit from any directory-- [ADD YOUR SPECIFIC PATH WARNINGS - e.g., "If in ~/Documents/iCloud - THIS IS MY PUBLIC DOTFILES REPO"]-- **ALWAYS COMMIT PROJECT FILES FROM THEIR OWN DIRECTORIES**-- Before public repo commits, ensure NO sensitive content (relationships, journals, keys, passwords)-- If worried about sensitive content, prompt user explicitly for approval--### Infrastructure Caution--Be **EXTREMELY CAUTIOUS** when working with:-- AWS-- Cloudflare-- [ADD YOUR SPECIFIC INFRASTRUCTURE - GCP, Azure, DigitalOcean, etc.]-- Any core production-supporting services--Always prompt user before significantly modifying or deleting infrastructure. For GitHub, ensure save/restore points exist.--**[CUSTOMIZE THIS WARNING - e.g., "YOU ALMOST LEAKED SENSITIVE DATA TO PUBLIC REPO - THIS MUST BE AVOIDED"]**diff --git a/README.md b/README.mdindex f2b7ce91..ec423a5d 100644--- a/README.md+++ b/README.md@@ -18,1067 +18,186 @@[](https://claude.ai/code)[](https://youtu.be/iKwRWwabkEc)--**[Features](#-key-features)** • **[Quick Start](#-quick-start)** • **[Documentation](#-documentation)** • **[Examples](#-examples)** • **[Community](#-community)**+**[Quick Start](#-quick-start)** • **[Documentation](#-documentation)** • **[Examples](#-examples)** • **[Community](#-community)**</div>----## 🚀 **Recent Updates**--> [!IMPORTANT]-> **🔥 v0.6.0 MAJOR UPGRADE:** Repository completely restructured with `.claude/` directory!->-> **BREAKING CHANGE - Repository Structure Changed:**-> - All PAI infrastructure now lives in `.claude/` directory-> - Repository now properly mirrors your actual `~/.claude/` working system-> - Fixes major compatibility issues reported by users-> - Makes repo a true reference implementation-> - **Action Required:** New installations should copy `.claude/` to `~/.claude/`->-> [See full migration guide below →](#-recent-updates)--> [!TIP]-> **✨ October 19** Now using the session-start hook to load our PAI skill on system load! Great bootloader for the overall Skills system! This is a better version of what we were doing before with UFC but now utilizing the skills system.--> **✨ October 18** Overall just massive updates to the PAI repo. Fixed tons of missing files, hooks, settings, etc. Thank you all for submitting issues and PRs!--> **✨ v0.5.0:** Skills-based PAI architecture with 92.5% token reduction! Core identity now in skill description, zero hook overhead.---<details>-<summary><strong>📅 2025-10-20 - Automated Documentation Update</strong></summary>--- **Settings:** 1 updated--*Updated by pre-commit hook: 1 modified*--</details>---<details>-<summary><strong>📅 2025-10-19 - Automated Documentation Update</strong></summary>--- **Voice:** 2 updated--*Updated by pre-commit hook: 3 modified*--</details>---<details>-<summary><strong>📅 2025-10-19 - Automated Documentation Update</strong></summary>--- **Skills:** 1 updated, 5 removed--*Updated by pre-commit hook: 1 modified, 5 deleted*--</details>---<details>-<summary><strong>📅 2025-10-19 - Automated Documentation Update</strong></summary>--- **Settings:** 1 updated--*Updated by pre-commit hook: 1 modified*--</details>---<details>-<summary><strong>📅 2025-10-19 - Automated Documentation Update</strong></summary>--- **Settings:** 1 updated--*Updated by pre-commit hook: 1 modified*--</details>---<details>-<summary><strong>📅 2025-10-19 - Automated Documentation Update</strong></summary>--- **Settings:** 1 removed--*Updated by pre-commit hook: 1 deleted*--</details>---<details>-<summary><strong>📅 2025-10-19 - Automated Documentation Update</strong></summary>--- **Hooks:** 2 new, 1 removed-- **Settings:** 1 updated--*Updated by pre-commit hook: 3 added, 1 modified, 1 deleted*--</details>---<details>-<summary><strong>📅 2025-10-19 - Automated Documentation Update</strong></summary>--- **Skills:** 1 new--*Updated by pre-commit hook: 1 added*--</details>---<details>-<summary><strong>📅 2025-10-19 - Automated Documentation Update</strong></summary>--- **Skills:** 1 new--*Updated by pre-commit hook: 1 added*--</details>---<details>-<summary><strong>📅 2025-10-19 - Automated Documentation Update</strong></summary>--- **Agents:** 3 updated-- **Commands:** 1 updated--*Updated by pre-commit hook: 5 modified*--</details>--<details>-<summary><strong>Click to see all updates</strong></summary>--<details>-<summary><strong>📅 v0.6.0 - Repository Restructure with .claude/ Directory 🔥 MAJOR UPDATE</strong></summary>--**The Problem:**-Users reported issues with PAI not working correctly because the repository structure didn't match the actual working system. The real PAI system expects all infrastructure to live in `~/.claude/`, but the repo had everything at root level. This caused confusion and compatibility problems.--**The Solution:**-Complete repository restructure to mirror the actual working system:-- Created `.claude/` directory at repository root-- Moved ALL PAI infrastructure into `.claude/` (agents, commands, documentation, hooks, skills, voice-server, etc.)-- Kept GitHub infrastructure at root (README, LICENSE, .gitignore, .github, etc.)-- Repository now serves as a true reference implementation--**What Changed:**-```-Before (v0.5.0):-/PAI/-├── agents/-├── commands/-├── documentation/-├── hooks/-├── skills/-├── voice-server/-├── settings.json-├── .mcp.json-├── setup.sh-└── README.md--After (v0.6.0):-/PAI/-├── .claude/ # ← NEW: All PAI infrastructure here-│ ├── agents/-│ ├── commands/-│ ├── documentation/-│ ├── hooks/-│ ├── skills/-│ ├── voice-server/-│ ├── settings.json-│ ├── .mcp.json-│ └── setup.sh-├── README.md # GitHub infrastructure stays at root-├── LICENSE-└── .gitignore-```--**Why This Matters:**-1. **Proper Emulation:** Repository now accurately represents how PAI works in production-2. **Easier Setup:** Users can see exactly how their `~/.claude/` directory should be structured-3. **Less Confusion:** Clear separation between GitHub files and PAI infrastructure-4. **Better Documentation:** Structure itself serves as documentation-5. **Reference Implementation:** Can be copied/referenced directly for setup--**Migration:**-- No action required for existing installations-- New users get the correct structure from the start-- All documentation updated to reflect new paths--**Rationale:**-The PAI system is designed to live in `~/.claude/` on your system. By organizing the repository to mirror this structure, we make it immediately clear how PAI should be set up. This is especially important for new users who are trying to understand the system architecture and for contributors who need to know where files belong.--</details>--<details>-<summary><strong>📅 v0.5.0 - Skills-Based PAI Architecture (92.5% Token Reduction)</strong></summary>--**Major Architectural Improvement:**-- **Zero hook overhead** - Eliminated all context loading from UserPromptSubmit hook-- **92.5% token reduction** - From 4000 tokens/interaction to 300 tokens-- **Pure skills architecture** - Core identity in skill description (always in system prompt)-- **On-demand context** - Full context loaded only when explicitly needed--**What Changed:**-- Added YAML frontmatter to `skills/PAI/SKILL.md` with comprehensive system description-- Core identity + critical security now in skill description (always present)-- Removed `MINIMAL.md` entirely (no longer needed)-- Hook renamed to `update-tab-titles.ts` (only handles tab titles, zero context)-- Flat file structure in `skills/PAI/` (no `/contexts` subdirectory)--**Architecture:**-- **Tier 1 (Always On):** Skill description in system prompt (~300 tokens) - identity, critical security, architecture explanation-- **Tier 2 (On Demand):** `SKILL.md` body loaded when PAI skill invoked (~4000 tokens) - contacts, preferences, voice IDs, detailed security-- **Hook:** Only updates tab titles (0 tokens context overhead)--**Benefits:**-- Cleanest possible architecture - fully embraces Claude Code skills system-- Context always relevant - skill description always present, full context on-demand-- Easy to customize - clear YAML frontmatter with `[CUSTOMIZE:]` markers-- Scales efficiently - adding content doesn't multiply token costs--**Files:**-- `skills/PAI/SKILL.md` - Full context with YAML frontmatter-- `skills/PAI/contacts.md` - Contact templates-- `skills/PAI/preferences.md` - Stack preferences templates-- `skills/PAI/response-format.md` - Response format templates-- `skills/PAI/security-detailed.md` - Security procedures-- `skills/PAI/voice-ids.md` - Voice system configuration (optional)-- `hooks/update-tab-titles.ts` - Tab title updates only--</details>--<details>-<summary><strong>📅 v0.4.0 - Repository Restructure 🔥 BREAKING CHANGE</strong></summary>--**⚠️ Breaking Changes:**-- PAI_DIR environment variable: Change from `/path/to/PAI/PAI_DIRECTORY` to `/path/to/PAI`-- Repository renamed: `PAI` → `Personal_AI_Infrastructure`--**What Changed:**-- Moved all `PAI_DIRECTORY/` contents to repository root (agents/, skills/, commands/, etc.)-- Repository renamed for clarity and better SEO-- All functional directories now immediately visible on GitHub-- GitHub automatically redirects old URLs to new--**Migration:**-1. Update PAI_DIR: `export PAI_DIR="/path/to/PAI"` (remove `/PAI_DIRECTORY`)-2. Reload shell: `source ~/.zshrc`-3. Pull latest: `git pull`-4. Update remote: `git remote set-url origin [email protected]:danielmiessler/Personal_AI_Infrastructure.git`--</details>--<details>-<summary><strong>📅 v0.3.2 - Fabric Skill with Intelligent Pattern Selection</strong></summary>--Fabric skill now intelligently selects the right pattern from 242+ options based on user intent. Complete Fabric repository bundled locally. Categories: Security (15), Summarization (20), Extraction (30+), Analysis (35+), Creation (50+), Improvement (10), Rating (8).--</details>--<details>-<summary><strong>📅 v0.3.1 - Research Skills & API Key Infrastructure</strong></summary>--Multi-source research with parallel agent execution. New skills: `alex-hormozi-pitch`, `research`. New agents: `perplexity-researcher`, `claude-researcher`, `gemini-researcher`. Added `.env.example` with API key documentation.--</details>--<details>-<summary><strong>📅 v0.3.0 - Skills System Migration</strong></summary>--Migrated to [Anthropic's Skills architecture](https://www.anthropic.com/news/skills). Modular skill packages with progressive disclosure. Context system → Skills system. See [documentation](./documentation/skills-system.md) for details.--</details>--<details>-<summary><strong>📅 v0.2.4 - README Cleanup</strong></summary>--Collapsed updates section, reduced visual clutter, optimized space.--</details>--<details>-<summary><strong>📅 v0.2.3 - Visibility & Portability</strong></summary>--`.claude` → `PAI_DIRECTORY`, vendor agnostic, dynamic paths with `${PAI_DIR}`, full portability.--</details>--<details>-<summary><strong>📅 v0.2.2 - Voice System</strong></summary>--Migrated to macOS native Premium voices (zero cost, offline, private).--</details>--<details>-<summary><strong>📅 v0.2.0 - v0.1.0 - Initial Releases</strong></summary>--Public release with voice server, PAI_HOME support, comprehensive documentation, MCP detection, hooks system.--</details>--<details>-<summary><strong>📅 Previous Updates</strong></summary>--**September 20, 2025**-- 🗣️ Added `/voice-server` with ElevenLabs integration-- 🔧 Fixed hardcoded path issues-- 🪝 Working on missing hooks--**September 12, 2025**-- 🧠 Dynamic resource loading system-- ⚡ Submit-user-hook for context loading-- 🗺️ Dynamic routing via load-dynamic-requirements--</details>--</details>------## 🎯 **What is PAI?**-> **Core Mission:** Augment humans with AI capabilities so they can survive and thrive in a world full of AI.--## 🌍 **The Problem**--<div align="center">--> ### It doesn't matter how powerful AI becomes if it's not accessible to everyone--</div>--Right now, AI is trapped behind corporate APIs, expensive subscriptions, and complex interfaces that only developers can use. Meanwhile, billions of people who could benefit from AI augmentation—artists, teachers, small business owners, researchers, parents—are left behind.--PAI exists to solve this. This project's goal is to give the most powerful AI capabilities, in the form of a complete platform, to everyone on Earth. Not just the tech elite. Not just the wealthy. Everyone.--<div align="center">--```mermaid-graph TB- You[👤 You] --> PAI[🧠 PAI/Kai]-- PAI --> Work[💼 Work]- PAI --> Life[🏠 Life]-- Work --> Blog[📝 write-blog]- Work --> News[📊 get-newsletter-stats]- Work --> Site[🌐 get-site-analytics]- Work --> Consult[💼 create-consulting-document]-- Life --> Finance[💰 answer-finance-question]- Life --> Memory[🔍 get-life-log]- Life --> Alert[🔔 send-text-alert]- Life --> Health[🏥 track-health-metrics]-- Blog --> Output[✨ Augmented Output]- News --> Output- Site --> Output- Consult --> Output- Finance --> Output- Memory --> Output- Alert --> Output- Health --> Output-- style You fill:#24283b,stroke:#7aa2f7,stroke-width:2px,color:#c0caf5- style PAI fill:#1a1b26,stroke:#bb9af7,stroke-width:3px,color:#c0caf5- style Work fill:#24283b,stroke:#9ece6a,stroke-width:2px,color:#c0caf5- style Life fill:#24283b,stroke:#ff9e64,stroke-width:2px,color:#c0caf5- style Output fill:#1a1b26,stroke:#f7768e,stroke-width:3px,color:#c0caf5-```--</div>--**PAI is an open-source, full personal AI platform that's completely agnostic to who you are and what you're trying to accomplish.**--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 to amplify their capabilities.--📖 **[Learn how PAI fits into the Human 3.0 vision](https://danielmiessler.com/blog/how-my-projects-fit-together)**--<table>-<tr>-<td width="33%" valign="top">--### 🧠 **Life Management**--**Finance Intelligence**-- `answer-finance-question` - Analyze bank statements-- `get-finances-state` - Track spending patterns-- Parse PDFs for utility bills and expenses--**Memory & Conversations**-- `get-life-log` - Search recorded meetings-- Query Limitless.ai pendant recordings-- Find what was discussed at any event--**Health Tracking**-- Monitor wellness metrics-- Track medical records-- Analyze sleep and fitness data--</td>-<td width="33%" valign="top">--### 💼 **Professional**--**Content Creation**-- `write-blog` - Generate posts in your style-- `publish-blog` - Deploy to production-- `enhance-content` - Improve existing work--**Business Analytics**-- `get-newsletter-stats` - Beehiiv metrics-- `get-site-analytics` - Website performance-- `create-consulting-document` - Client deliverables--**Development**-- `design-review` - Code analysis-- `browser-tools-setup` - Automation-- `update-daemon` - API management--</td>-<td width="33%" valign="top">--### 🎯 **Personal Growth**--**Knowledge Capture**-- `extract-knowledge` - Learn from content-- `capture-learning` - Document insights-- `web-research` - Deep investigations+PAI (Personal AI Infrastructure) is a template for building your own AI-powered operating system using Claude Code.-**Communication**-- `send-email` - Automated outreach-- `send-text-alert` - SMS notifications-- `send-discord-alert` - Team updates+**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-**Productivity**-- `add-linear-ticket` - Task management-- `create-mermaid-visualization` - Idea mapping-- `query-context` - Access any stored knowledge--</td>-</tr>-</table>--### 🌟 **Why This System is Different**--> *This system is designed from the very beginning to be available to anybody and to grow and scale with you throughout your life.*--- **🔓 Open Framework**: No vendor lock-in, complete transparency, you own everything-- **🌍 Universal**: Works for anyone, anywhere, in any profession or life situation-- **🤖 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-- **🔌 Extensible**: Add your own commands, agents, and integrations--📖 **[Read the full technical deep-dive on PAI](https://danielmiessler.com/blog/personal-ai-infrastructure)**-------## ⚡ **Architecture**--### 🏗️ **The PAI System Architecture**--```mermaid-graph TD- You[👤 You] --> PAI[🧠 PAI]-- PAI --> Skills[📚 Skills]-- Skills --> Research[🔍 Research]- Skills --> Development[💻 Development]- Skills --> Content[📝 Content]- Skills --> Life[🏠 Life Management]- Skills --> Custom[🎯 Your Custom Skills]-- Research --> Agents1[Perplexity/Claude/Gemini Researchers]- Development --> Agents2[Engineer/Architect/Designer]- Content --> Agents3[Writer/Artist]- Life --> Tools[Finance/Health/Memory Tools]-- Agents1 --> MCPs[🔌 MCP Servers]- Agents2 --> MCPs- Agents3 --> MCPs- Tools --> MCPs-- MCPs --> Output[✨ Augmented Output]-- style You fill:#1f2937,stroke:#10b981,stroke-width:2px,color:#e5e7eb- style Skills fill:#111827,stroke:#8b5cf6,stroke-width:3px,color:#e5e7eb- style Output fill:#111827,stroke:#ef4444,stroke-width:2px,color:#e5e7eb-```--**Skills are the core organizational unit.** Everything in PAI is built around modular skills that activate based on your intent.--### 📚 **Skills System**--<table>-<tr>-<td width="50%">--```-~/.claude/skills/-├── prompting/ # Prompt engineering standards-├── create-skill/ # Skill creation framework-├── ffuf/ # Web fuzzing for pentesting (by @rez0)-├── alex-hormozi-pitch/ # $100M Offers pitch framework-├── research/ # Multi-source research (requires API keys)-├── fabric/ # Intelligent Fabric pattern selection (242+ patterns)-├── web-scraping/ # Web data extraction-├── chrome-devtools/ # Browser automation-├── youtube-extraction/ # YouTube transcript extraction-├── ref-documentation/ # Technical docs search-├── webapp-testing/ # Playwright testing patterns-└── [your-custom-skills]/-```--</td>-<td width="50%">--**Features:**-- ✅ Modular capability packages-- 📄 Progressive disclosure (SKILL.md → CLAUDE.md)-- ⚡ Intent-based activation-- 📂 Self-contained with templates-- 🔌 Inherits global context--</td>-</tr>-</table>--### 🎯 **How Skills Work**--**Skills activate automatically based on your intent:**--- **Say:** "Research the latest AI developments"- **→** `research` skill loads → Launches parallel Perplexity/Claude/Gemini researchers--- **Say:** "Build a task tracker app"- **→** `development` skill loads → Invokes architect and engineer agents--- **Say:** "Create a threat model"- **→** `fabric` skill loads → Selects `create_threat_model` pattern from 242+ options--**Each skill contains:**-- 📄 Intent triggers ("USE WHEN...")-- 🤖 Specialized agents (if needed)-- 🔌 MCP integrations (if needed)-- ⚡ Commands and tools (if needed)-- 📖 Documentation and examples--> [!TIP]-> **You don't manage agents or commands directly.** Just tell PAI what you want to do, and the right skill activates with all necessary resources.--### 💡 **Example Skills (Included)**--| Skill | What It Does | Example Usage |-|:------|:-------------|:--------------|-| **🔍 research** | Multi-source research with parallel agents | "Research quantum computing trends" |-| **🧵 fabric** | 242+ AI patterns (threat modeling, summarization, extraction) | "Create a threat model for our API" |-| **💻 development** | Full-stack development with architect and engineer agents | "Build a meditation timer app" |-| **🎨 design** | UX/UI design with shadcn/ui and Figma integration | "Design a dashboard for analytics" |-| **🔒 ffuf** | Web fuzzing for penetration testing | "Test this API for vulnerabilities" |-| **📊 alex-hormozi-pitch** | Create irresistible offers using $100M Offers framework | "Create a pitch for my SaaS product" |-| **🌐 web-scraping** | Extract data from websites (BrightData + Apify) | "Scrape product listings from this site" |-| **📖 ref-documentation** | Search technical docs (React, Next.js, 100+ frameworks) | "How do I use React hooks?" |-| **▶️ youtube-extraction** | Extract transcripts and content from YouTube videos | "Summarize this YouTube video" |-| **🎭 webapp-testing** | Browser automation and visual testing | "Test the login flow" |--**Skills use MCP servers for integrations:**-Chrome DevTools • Apify • BrightData • Stripe • Anthropic Content • Daemon (your data) • And more...+**Philosophy:** Start clean, small, and simple. Build the scaffolding that makes AI reliable.---## 🚀 **Quick Start**-**Automated Setup:**-```bash-./.claude/setup.sh # Interactive setup script (recommended)-```--**Or read:** [Getting Started Guide](./.claude/documentation/how-to-start.md) | [Quick Reference](./.claude/documentation/QUICK-REFERENCE.md)--> [!NOTE]-> PAI was originally built 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.--### **Manual Installation**--#### **Step 1: Install Prerequisites**+### 1. Install Prerequisites```bash-# Install Bun (JavaScript runtime)-brew install oven-sh/bun/bun+# Install Bun (PAI's package manager)+curl -fsSL https://bun.sh/install | bash-# Get Claude Code (AI interface)-# Visit: https://claude.ai/code+# Install Claude Code+# Follow instructions at: https://code.claude.com```-#### **Step 2: Clone PAI Repository**+### 2. Clone and Configure```bash-# Clone the PAI repository+# Clone the repositorygit clone https://github.com/danielmiessler/Personal_AI_Infrastructure.gitcd Personal_AI_Infrastructure-# All PAI infrastructure is now in .claude/ directory-ls -la .claude/ # See agents/, skills/, commands/, etc.-```--#### **Step 3: Copy .claude/ to Your Home Directory**--```bash-# Copy the .claude directory to your home directory-cp -r .claude ~/.claude--# OR create a symbolic link if you want to keep it in the repo-# ln -s ${PAI_DIR}/.claude ~/.claude-```--#### **Step 4: Configure PAI Directory Variable** ⚠️ **IMPORTANT**--> [!IMPORTANT]-> **You MUST configure the PAI_DIR variable to point to your PAI installation directory.**-> This makes the PAI system completely agnostic to your installation location.+# Copy environment template+cp .claude/.env.example .claude/.env-```bash-# Add to your shell config (~/.zshrc or ~/.bashrc)-# Replace /path/to/PAI with YOUR actual PAI installation path-export PAI_DIR="/path/to/PAI" # Point to the PAI repository root-export PAI_HOME="$HOME" # Your home directory--# Example (adjust to YOUR installation path):-# export PAI_DIR="$HOME/Projects/PAI"-# export PAI_DIR="$HOME/Documents/PAI"-# export PAI_DIR="/Users/yourname/PAI"--# Reload your shell configuration-source ~/.zshrc # or source ~/.bashrc+# Edit .env and add your API keys+# At minimum: ANTHROPIC_API_KEY=your_key_here```-#### **Step 5: Configure Environment & API Keys**+### 3. Copy to Your System```bash-# Copy environment template-cp ~/.claude/.env.example ~/.claude/.env+# Copy .claude directory to your home directory+cp -r .claude ~/.claude-# Configure your API keys-vim ~/.claude/.env+# Or symlink if you prefer+ln -s $(pwd)/.claude ~/.claude```-> [!IMPORTANT]-> **Some skills and agents require API keys to function:**->-> **Required for Research Agents:**-> - `PERPLEXITY_API_KEY` - For perplexity-researcher agent ([Get key](https://www.perplexity.ai/settings/api))-> - `GOOGLE_API_KEY` - For gemini-researcher agent ([Get key](https://aistudio.google.com/app/apikey))-> - Claude WebSearch is built-in (no key needed for claude-researcher)->-> **Optional for AI Generation:**-> - `REPLICATE_API_TOKEN` - For AI image/video generation ([Get key](https://replicate.com/account/api-tokens))-> - `OPENAI_API_KEY` - For GPT integration and Sora billing ([Get key](https://platform.openai.com/api-keys))->-> See `.env.example` for complete list and setup instructions.-> **NEVER commit your `.env` file to version control!**--#### **Step 6: Launch PAI**+### 4. Start Claude Code```bash-# Optional: Set up voice notifications (macOS only)-# Download Premium/Enhanced voices from System Settings → Voice (Live Speech)-# Then start the voice server:-cd ~/.claude/voice-server && bun server.ts &-# See ~/.claude/documentation/VOICE-SETUP-GUIDE.md for detailed setup instructions--# Open Claude Code and start using PAI!-# Your personal AI infrastructure is ready 🚀+# PAI loads automatically via the CORE skill+claude-code```-### **⚙️ Environment Variables**--```bash-# ============ REQUIRED CONFIGURATION ============-PAI_DIR="/path/to/PAI" # PAI repository root (system agnostic)-PAI_HOME="$HOME" # Your home directory--# ============ RESEARCH AGENTS (Skills-Specific) ============-PERPLEXITY_API_KEY="your_key" # For perplexity-researcher agent-GOOGLE_API_KEY="your_key" # For gemini-researcher agent-# Claude WebSearch built-in - no key needed for claude-researcher+**That's it!** The CORE skill loads at session start and provides all PAI functionality.-# ============ AI GENERATION (Optional) ============-REPLICATE_API_TOKEN="your_token" # For Flux, Sora, etc.-OPENAI_API_KEY="your_key" # For GPT integration, Sora billing--# ============ SYSTEM CONFIGURATION ============-PORT="8888" # Voice server port (default: 8888)--# ============ DIGITAL ASSISTANT CUSTOMIZATION ============-DA="YourAssistantName" # Your AI assistant's name (default: "Assistant")-DA_COLOR="purple" # Display color (purple, blue, green, cyan, etc.)-```--> [!TIP]-> **Why PAI_DIR is Important:** The PAI_DIR variable makes the entire PAI system portable and installation-agnostic. All commands, skills, and hooks reference `${PAI_DIR}` instead of hardcoded paths. This means you can install PAI anywhere on your system, and as long as PAI_DIR points to your PAI repository root, everything will work seamlessly.+📚 **For detailed setup:** See `docs/QUICKSTART.md`---## 📚 **Documentation**-<div align="center">--| 📖 Guide | 🎯 Purpose | ⏱️ Time |-|----------|------------|---------|-| [Quick Start](#-quick-start) | Get up and running | 5 min |-| [Architecture](#-architecture) | Understand the system | 10 min |-| [SECURITY.md](./SECURITY.md) | Security guidelines | 5 min |-| [Voice Server](./.claude/voice-server/README.md) | Enable voice interaction | 10 min |-| [Commands Directory](./.claude/commands/) | Browse all commands | 15 min |--</div>-------## 🎬 **Real-World Examples**--<div align="center">--> [!IMPORTANT]-> **These are examples from my personal PAI setup. Your system will have completely different commands based on YOUR unique needs, workflows, and goals. The beauty of PAI is that it becomes whatever YOU need it to be.**--</div>--<table>-<tr>-<td width="33%" valign="top">--### 💼 **Professional**--#### 📈 **Business & Analytics**--<details>-<summary><strong>📊 Newsletter Performance</strong></summary>--```bash-# Track newsletter metrics in real-time-get-newsletter-stats-# Returns subscriber growth, open rates, top content-```--</details>--<details>-<summary><strong>🚀 Startup Dashboard</strong></summary>--```bash-# Monitor all key metrics-get-site-analytics # Traffic and conversions-get-finances-state # Revenue tracking-add-linear-ticket # Development velocity-```--</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>--#### ✍️ **Content Creation**--<details>-<summary><strong>📝 Blog Pipeline</strong></summary>--```bash-# End-to-end content creation-web-research "emerging AI trends"-extract-knowledge --key-points-write-blog --style personal --length 1500-enhance-content --seo --readability-publish-blog --schedule tomorrow-```--</details>--<details>-<summary><strong>🎨 Visual Content</strong></summary>--```bash-# Create stunning visualizations-create-d3-visualization --data metrics.json-create-custom-image "futuristic AI assistant"-create-mermaid-visualization --type flowchart-```--</details>--</td>-<td width="33%" valign="top">--### 🏠 **Personal**--#### 💰 **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>--```bash-# Never forget a conversation-get-life-log "investor meeting last week"-get-life-log "product roadmap decisions"-query-context "action items from standup"-```--</details>--<details>-<summary><strong>📚 Knowledge Building</strong></summary>--```bash-# Build your second brain-capture-learning --source conference-extract-knowledge --summarize-learn-from-iterations --improve-query-context "machine learning notes"-```--</details>--#### 🎯 **Personal Productivity**--<details>-<summary><strong>툿 Morning Automation</strong></summary>--```bash-# Start your day right-get-life-log "yesterday's highlights"-query-context "today's priorities"-send-text-alert "heading to office"-reset-visitor-peak # Reset daily counters-```--</details>--<details>-<summary><strong>📧 Smart Communication</strong></summary>--```bash-# Intelligent outreach-send-email --template followup-send-discord-alert --channel team-add-links --resource documentation-update-public-content-```+**All documentation lives in the CORE skill** (`.claude/skills/CORE/`):-</details>+### **Essential Reading**-</td>-<td width="33%" valign="top">+- **[CONSTITUTION.md](/.claude/skills/CORE/CONSTITUTION.md)** - System philosophy, architecture, and operating principles+- **[SKILL.md](/.claude/skills/CORE/SKILL.md)** - Main PAI skill with identity, preferences, and quick reference+- **[SKILL-STRUCTURE-AND-ROUTING.md](/.claude/skills/CORE/SKILL-STRUCTURE-AND-ROUTING.md)** - How to create your own skills-### 🎨 **Creative & Other Fields**+### **System Guides**-#### 🎭 **Artist Workflow**+- **[hook-system.md](/.claude/skills/CORE/hook-system.md)** - Event-driven automation+- **[agent-personalities.md](/.claude/skills/CORE/agent-personalities.md)** - Specialized AI agents (12+ personalities)+- **[history-system.md](/.claude/skills/CORE/history-system.md)** - Automatic work documentation+- **[VOICE.md](/.claude/skills/CORE/VOICE.md)** → **[voice-server/USAGE.md](/.claude/voice-server/USAGE.md)** - Text-to-speech feedback-<details>-<summary><strong>🎨 Creative Portfolio</strong></summary>+### **Reference**-```bash-# Manage artistic work-track-project-progress "oil painting series"-generate-artist-statement --style contemporary-update-portfolio-website --new-pieces-schedule-gallery-submission --deadline friday-```+- **[prosody-guide.md](/.claude/skills/CORE/prosody-guide.md)** - Voice emotion system+- **[prompting.md](/.claude/skills/CORE/prompting.md)** - Prompt engineering patterns+- **[terminal-tabs.md](/.claude/skills/CORE/terminal-tabs.md)** - Terminal management-</details>+----<details>-<summary><strong>📷 Photography Business</strong></summary>+## 🎨 **Examples**-```bash-# End-to-end photography workflow-process-shoot-metadata --wedding-2024-09-generate-client-gallery --password-protected-send-invoice --client johnson-wedding-backup-raw-files --cloud-storage-```+Explore example skills in `.claude/skills/`:-</details>+- **`fabric/`** - Integration with Fabric pattern system (242+ AI patterns)+- **`research/`** - Multi-source research workflows+- **`create-skill/`** - Templates for creating new skills+- **`alex-hormozi-pitch/`** - Business pitch generation+- **`ffuf/`** - Web fuzzing and security testing-#### 🎵 **Musician Setup**+Each skill demonstrates the skills-as-containers pattern with routing, workflows, and self-contained documentation.-<details>-<summary><strong>🎤 Music Production</strong></summary>+----```bash-# Creative music workflow-track-song-ideas --voice-memo-to-text-generate-chord-progressions --key-of-c-schedule-studio-time --next-available-export-stems --for-mixing-```+## 🏗️ **Architecture**-</details>+PAI is built on three foundational principles:-#### 🌿 **Health & Wellness Coach**+### **1. Command Line First**+Build deterministic CLI tools, then wrap them with AI orchestration. Code is cheaper, faster, and more reliable than prompts.-<details>-<summary><strong>🏋️ Client Management</strong></summary>+### **2. Skills as Containers**+Package domain expertise in self-activating, self-contained modules. Natural language triggers automatic routing to the right skill.-```bash-# Wellness practice automation-track-client-progress --weekly-checkin-generate-meal-plans --dietary-restrictions-send-motivation-message --personalized-schedule-follow-up --in-two-weeks-```+### **3. Progressive Disclosure**+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)-</details>+**Complete architecture:** See `.claude/skills/CORE/CONSTITUTION.md`-#### 📚 **Academic Researcher**+----<details>-<summary><strong>🔬 Research Pipeline</strong></summary>+## 🛠️ **Technology Stack**-```bash-# Academic workflow-search-literature --keywords "machine learning ethics"-organize-citations --zotero-import-generate-literature-review --outline-track-experiment-results --statistical-analysis-```+- **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-</details>+Stack preferences: `.claude/skills/CORE/stack-preferences.md`-#### 🏠 **Real Estate Agent**+----<details>-<summary><strong>🏡 Property Management</strong></summary>+## 🔐 **Security**-```bash-# Real estate automation-analyze-market-trends --neighborhood-data-generate-property-reports --comparative-analysis-schedule-showings --calendar-optimization-send-client-updates --weekly-digest-```+**IMPORTANT:** This is a PUBLIC template repository with sanitized examples.-</details>+**DO NOT commit:**+- API keys or secrets+- Personal email addresses or contact information+- Private repository references+- Any sensitive personal data-</td>-</tr>-</table>+See `SECURITY.md` for complete security protocols.----## 🤝 **Community**--<div align="center">--### **Help Us Give AI to the World**+## 💬 **Community**-<a href="https://github.com/danielmiessler/Personal_AI_Infrastructure/issues">- <img src="https://img.shields.io/badge/Report%20Issues-red?style=for-the-badge&logo=github&logoColor=white" alt="Issues">-</a>-<a href="https://github.com/danielmiessler/Personal_AI_Infrastructure/discussions">- <img src="https://img.shields.io/badge/Discussions-blue?style=for-the-badge&logo=github&logoColor=white" alt="Discussions">-</a>-<a href="https://github.com/danielmiessler/Personal_AI_Infrastructure/pulls">- <img src="https://img.shields.io/badge/Pull%20Requests-green?style=for-the-badge&logo=github&logoColor=white" alt="PRs">-</a>+- **GitHub Issues:** [Report bugs or request features](https://github.com/danielmiessler/Personal_AI_Infrastructure/issues)+- **Discussions:** [Ask questions and share ideas](https://github.com/danielmiessler/Personal_AI_Infrastructure/discussions)+- **Video:** [Watch PAI Overview](https://youtu.be/iKwRWwabkEc)-<br/>-<br/>+----**⭐ Star this repo** to stay updated with the latest features!+## 📜 **License**-</div>+MIT License - see `LICENSE` file for details.---## 🙏 **Acknowledgments**-Special thanks to contributors who have enhanced PAI with their expertise:+Built on [Claude Code](https://code.claude.com) by Anthropic.-- **[Joseph Thacker (@rez0)](https://twitter.com/rez0__)** - FFUF skill with comprehensive web fuzzing guidance and penetration testing expertise--## 📄 **License**--PAI is MIT licensed. See [LICENSE](./LICENSE) for details.+Inspired by the idea that AI systems need scaffolding to be reliable. This is that scaffolding.---<div align="center">-### **The Path to Human 3.0**--> *"Humans are what matter. AI is only as useful as it is to people. A system like this is need to level the field with AI and help us get to [Human 3.0](https://danielmiessler.com/blog/how-my-projects-fit-together)."*--<br/>--**Created by [Daniel Miessler](https://danielmiessler.com)**--📧 **[Newsletter](https://newsletter.danielmiessler.com)** • 📝 **[Blog](https://danielmiessler.com/blog)** • 💼 **[LinkedIn](https://linkedin.com/in/danielmiessler)** • 🎬 **[YouTube](https://www.youtube.com/@unsupervised-learning)**--<br/>+**Start clean. Start small. Build the AI infrastructure you need.**-<a href="#">- <img src="https://img.shields.io/badge/Back%20to%20Top-8B5CF6?style=for-the-badge&logo=arrow-up&logoColor=white" alt="Back to Top">-</a>+[⬆ Back to Top](#personal-ai-infrastructure-pai)</div>diff --git a/docs/QUICKSTART.md b/docs/QUICKSTART.mdnew file mode 100644index 00000000..26e57e75--- /dev/null+++ b/docs/QUICKSTART.md@@ -0,0 +1,254 @@+# PAI Quick Start Guide++**Get PAI running in 5 minutes**++---++## Prerequisites (1 minute)++### Install Bun++```bash+# Install Bun (PAI's package manager)+curl -fsSL https://bun.sh/install | bash++# Restart your terminal or source your profile+source ~/.bashrc # or ~/.zshrc+```++### Install Claude Code++Follow the installation instructions at [code.claude.com](https://code.claude.com)++---++## Installation (2 minutes)++### 1. Clone PAI++```bash+git clone https://github.com/danielmiessler/Personal_AI_Infrastructure.git+cd Personal_AI_Infrastructure+```++### 2. Configure Environment++```bash+# Copy environment template+cp .claude/.env.example .claude/.env++# Edit with your API keys+nano .claude/.env # or use your preferred editor++# Required: ANTHROPIC_API_KEY+# Optional: Add other API keys for specific skills+```++### 3. Install to Your System++**Option A: Copy (recommended for beginners)**+```bash+# Copy .claude directory to home+cp -r .claude ~/.claude+```++**Option B: Symlink (for development)**+```bash+# Symlink for live updates+ln -s $(pwd)/.claude ~/.claude+```++---++## First Run (1 minute)++### Start Claude Code++```bash+# PAI loads automatically+claude-code+```++The CORE skill loads at session start via the `SessionStart` hook.++### Try These Commands++```+"What skills are available?"+"Show me my stack preferences"+"What agents do I have access to?"+"Read the CONSTITUTION"+```++---++## Understanding PAI (1 minute)++### The Three Primitives++**1. Skills** (`.claude/skills/`)+- Self-contained AI capabilities+- Auto-activate based on your request+- Package routing, workflows, and documentation++**2. Agents** (`.claude/agents/`)+- Specialized AI personalities+- Engineer, researcher, designer, pentester, etc.+- Each has unique voice and capabilities++**3. Hooks** (`.claude/hooks/`)+- Event-driven automation+- Capture work, provide voice feedback, manage state+- Run automatically on session start/stop, tool use, etc.++### Where Everything Lives++```+~/.claude/+├── skills/+│ └── CORE/ # Main PAI documentation+│ ├── CONSTITUTION.md # System philosophy & architecture+│ ├── SKILL.md # Main skill file (loaded at startup)+│ └── *.md # Reference documentation+├── agents/ # Agent configurations+├── hooks/ # Event automation scripts+├── voice-server/ # Text-to-speech system+└── .env # Your API keys (never commit!)+```++---++## Next Steps++### Learn the System++1. **Read CONSTITUTION.md** - Understand PAI philosophy+ ```+ read ~/.claude/skills/CORE/CONSTITUTION.md+ ```++2. **Explore Skills** - See what's available+ ```+ ls ~/.claude/skills/+ ```++3. **Try Voice Feedback** - Start the voice server (optional)+ ```+ ~/.claude/voice-server/start.sh+ ```++### Create Your First Skill++```bash+# Use the create-skill skill+cd ~/.claude/skills/+mkdir my-first-skill+# See create-skill/ for templates+```++Follow the guide in `.claude/skills/CORE/SKILL-STRUCTURE-AND-ROUTING.md`++### Customize Your Setup++**Stack Preferences** - Edit what you prefer:+- `.claude/skills/CORE/stack-preferences.md` - TypeScript vs Python, etc.++**Agent Personalities** - Customize agent voices:+- `.claude/skills/CORE/agent-personalities.md`++**Hooks** - Add custom automation:+- `.claude/hooks/` - Event-driven scripts++---++## Troubleshooting++### PAI Not Loading++**Check hook configuration:**+```bash+# Verify SessionStart hook exists+cat ~/.claude/settings.json | grep SessionStart+```++**Manually load CORE skill:**+```+read ~/.claude/skills/CORE/SKILL.md+```++### Voice Server Not Working++```bash+# Check voice server status+~/.claude/voice-server/status.sh++# Restart if needed+~/.claude/voice-server/restart.sh++# Check logs+tail ~/.claude/voice-server/logs/voice-server.log+```++### API Keys Not Working++```bash+# Verify .env file exists+ls -la ~/.claude/.env++# Check format (no spaces around =)+# Correct: ANTHROPIC_API_KEY=sk-ant-...+# Wrong: ANTHROPIC_API_KEY = sk-ant-...+```++---++## Common Tasks++### Update PAI++```bash+cd ~/Personal_AI_Infrastructure # or wherever you cloned+git pull origin main++# Copy updates to your system+cp -r .claude/* ~/.claude/+```++### Add New Skills++```bash+# Clone or create in skills directory+cd ~/.claude/skills/+# Add your skill folder+```++Skills auto-activate based on their description triggers.++### Customize Agent Voices++Edit `.claude/skills/CORE/agent-personalities.md` with your preferred ElevenLabs voice IDs.++---++## Resources++- **Full Documentation:** `.claude/skills/CORE/`+- **Video Overview:** [PAI Video](https://youtu.be/iKwRWwabkEc)+- **GitHub Issues:** [Report Problems](https://github.com/danielmiessler/Personal_AI_Infrastructure/issues)+- **Discussions:** [Ask Questions](https://github.com/danielmiessler/Personal_AI_Infrastructure/discussions)++---++## Philosophy++PAI follows three principles:++1. **Command Line First** - Build CLI tools, wrap with AI+2. **Deterministic Code First** - Same input → Same output+3. **Prompts Wrap Code** - AI orchestrates, doesn't replace++**Start clean. Start small. Build out from there.**++---++**You're ready! Start exploring and building your personal AI infrastructure.**