⛰️ LifeOS — The AI-powered Life Operating System that helps you hill climb to wherever you're going.
feat: Add wizard-style installation to kai-core-install
Daniel Miesslerfe4d2811f62f
diff --git a/Packs/kai-core-install/INSTALL.md b/Packs/kai-core-install/INSTALL.mdindex 745b1d0b..dfe8a1ec 100644--- a/Packs/kai-core-install/INSTALL.md+++ b/Packs/kai-core-install/INSTALL.md@@ -1,15 +1,311 @@# Kai Core Install - Installation Guide-## Prerequisites+**This guide is designed for AI agents installing this pack into a user's infrastructure.**-- **Bun runtime**: `curl -fsSL https://bun.sh/install | bash`-- **Claude Code** (or compatible agent system)-- **Write access** to `$PAI_DIR/` (or your PAI directory)-- **kai-hook-system Pack** installed (required for session context loading)+---++## 🎯 AI Agent Instructions++**This is a wizard-style installation.** Use Claude Code's native tools to guide the user through installation:++1. **AskUserQuestion** - For user decisions and confirmations+2. **TodoWrite** - For progress tracking+3. **Bash/Read/Write** - For actual installation+4. **VERIFY.md** - For final validation++### Welcome Message++Before starting, greet the user:+```+"I'm installing the CORE skill - the foundation of your PAI system. This provides+skill routing, response formatting, identity configuration, and the CreateSkill+meta-skill for building new capabilities.++Let me analyze your system and guide you through installation."+```----## Pre-Installation: System Analysis+## Phase 1: System Analysis++**Execute this analysis BEFORE any file operations.**++### 1.1 Run These Commands++```bash+PAI_CHECK="${PAI_DIR:-$HOME/.config/pai}"++# Check if PAI_DIR is set+echo "PAI_DIR: ${PAI_DIR:-'NOT SET - will use ~/.config/pai'}"++# Check for Bun runtime+which bun && bun --version++# Check for hook system (required dependency)+if [ -f "$PAI_CHECK/hooks/lib/observability.ts" ]; then+ echo "✓ Hook system is installed (required)"+else+ echo "❌ Hook system NOT installed - install kai-hook-system first!"+fi++# Check for existing CORE skill+if [ -d "$PAI_CHECK/skills/CORE" ]; then+ echo "⚠️ Existing CORE skill found at: $PAI_CHECK/skills/CORE"+else+ echo "✓ No existing CORE skill (clean install)"+fi+```++### 1.2 Present Findings++Tell the user what you found:+```+"Here's what I found on your system:+- PAI_DIR: [path or NOT SET]+- Bun: [installed vX.X / NOT INSTALLED]+- Hook system: [installed / NOT INSTALLED - REQUIRED]+- Existing CORE skill: [Yes at path / No]"+```++---++## Phase 2: User Questions++**Use AskUserQuestion tool at each decision point.**++### Question 1: Missing Hook System (if not installed)++**Only ask if hook system is NOT installed:**++```json+{+ "header": "Dependency",+ "question": "The hook system is required but not installed. How should I proceed?",+ "multiSelect": false,+ "options": [+ {"label": "Install kai-hook-system first (Recommended)", "description": "I'll install the hook system pack, then continue with CORE"},+ {"label": "Skip and continue anyway", "description": "CORE will install but session context loading won't work"},+ {"label": "Abort installation", "description": "Cancel - I'll install dependencies manually"}+ ]+}+```++### Question 2: Conflict Resolution (if existing CORE found)++**Only ask if existing CORE skill detected:**++```json+{+ "header": "Conflict",+ "question": "Existing CORE skill detected at $PAI_DIR/skills/CORE. How should I proceed?",+ "multiSelect": false,+ "options": [+ {"label": "Backup and Replace (Recommended)", "description": "Creates timestamped backup, then installs new version"},+ {"label": "Merge/Update", "description": "Keep existing customizations, add new files"},+ {"label": "Abort Installation", "description": "Cancel installation, keep existing CORE"}+ ]+}+```++### Question 3: AI Identity Configuration++```json+{+ "header": "Identity",+ "question": "What should I name your AI assistant?",+ "multiSelect": false,+ "options": [+ {"label": "Kai (Recommended)", "description": "The default PAI assistant name"},+ {"label": "Atlas", "description": "Alternative name"},+ {"label": "Custom name", "description": "I'll ask you for a custom name"}+ ]+}+```++### Question 4: Final Confirmation++```json+{+ "header": "Install",+ "question": "Ready to install CORE skill?",+ "multiSelect": false,+ "options": [+ {"label": "Yes, install now (Recommended)", "description": "Proceeds with installation using choices above"},+ {"label": "Show me what will change", "description": "Lists all files that will be created/modified"},+ {"label": "Cancel", "description": "Abort installation"}+ ]+}+```++---++## Phase 3: Backup (If Needed)++**Only execute if user chose "Backup and Replace" for conflicts:**++```bash+BACKUP_DIR="$HOME/.pai-backup/$(date +%Y%m%d-%H%M%S)"+PAI_CHECK="${PAI_DIR:-$HOME/.config/pai}"++if [ -d "$PAI_CHECK/skills/CORE" ]; then+ mkdir -p "$BACKUP_DIR/skills"+ cp -r "$PAI_CHECK/skills/CORE" "$BACKUP_DIR/skills/CORE"+ echo "✓ Backed up CORE skill to $BACKUP_DIR/skills/CORE"+fi+```++---++## Phase 4: Installation++**Create a TodoWrite list to track progress:**++```json+{+ "todos": [+ {"content": "Create directory structure", "status": "pending", "activeForm": "Creating directory structure"},+ {"content": "Install SkillSystem.md", "status": "pending", "activeForm": "Installing SkillSystem.md"},+ {"content": "Install tools", "status": "pending", "activeForm": "Installing tools"},+ {"content": "Install CORE skill", "status": "pending", "activeForm": "Installing CORE skill"},+ {"content": "Install CreateSkill meta-skill", "status": "pending", "activeForm": "Installing CreateSkill"},+ {"content": "Generate initial index", "status": "pending", "activeForm": "Generating skill index"},+ {"content": "Run verification", "status": "pending", "activeForm": "Running verification"}+ ]+}+```++### 4.1 Create Directory Structure++**Mark todo "Create directory structure" as in_progress.**++```bash+mkdir -p $PAI_DIR/skills/CORE/Workflows+mkdir -p $PAI_DIR/skills/CORE/tools+mkdir -p $PAI_DIR/skills/CreateSkill/Workflows+mkdir -p $PAI_DIR/skills/CreateSkill/tools+mkdir -p $PAI_DIR/tools+```++**Mark todo as completed.**++### 4.2 Install SkillSystem.md++**Mark todo "Install SkillSystem.md" as in_progress.**++Copy `src/skills/CORE/SkillSystem.md` to `$PAI_DIR/skills/CORE/SkillSystem.md`++**Mark todo as completed.**++### 4.3 Install Tools++**Mark todo "Install tools" as in_progress.**++Copy the following tools to `$PAI_DIR/tools/`:+- `src/tools/SkillSearch.ts` → `$PAI_DIR/tools/SkillSearch.ts`+- `src/tools/GenerateSkillIndex.ts` → `$PAI_DIR/tools/GenerateSkillIndex.ts`+- `src/tools/PaiArchitecture.ts` → `$PAI_DIR/tools/PaiArchitecture.ts`++**Mark todo as completed.**++### 4.4 Install CORE Skill++**Mark todo "Install CORE skill" as in_progress.**++Copy `src/skills/CORE/SKILL.md` to `$PAI_DIR/skills/CORE/SKILL.md`++**IMPORTANT:** Replace placeholders with user's choices from Question 3:+- `[YOUR_AI_NAME]` → User's chosen AI name+- `[YOUR_NAME]` → Ask user for their name+- `[YOUR_PROFESSION]` → Ask user for their profession++**Mark todo as completed.**++### 4.5 Install CreateSkill Meta-Skill++**Mark todo "Install CreateSkill meta-skill" as in_progress.**++Copy `src/skills/CreateSkill/SKILL.md` to `$PAI_DIR/skills/CreateSkill/SKILL.md`++**Mark todo as completed.**++### 4.6 Install Workflows++Copy `src/skills/CORE/Workflows/UpdateDocumentation.md` to:+`$PAI_DIR/skills/CORE/Workflows/UpdateDocumentation.md`++### 4.7 Generate Initial Index++**Mark todo "Generate initial index" as in_progress.**++```bash+bun run $PAI_DIR/tools/GenerateSkillIndex.ts+bun run $PAI_DIR/tools/PaiArchitecture.ts generate+bun run $PAI_DIR/tools/PaiArchitecture.ts log-upgrade "Initial kai-core-install installation"+```++**Mark todo as completed.**++---++## Phase 5: Verification++**Mark todo "Run verification" as in_progress.**++**Execute all checks from VERIFY.md.**++Quick verification:+```bash+# Check CORE skill exists+ls $PAI_DIR/skills/CORE/SKILL.md++# Check tools exist+ls $PAI_DIR/tools/SkillSearch.ts+ls $PAI_DIR/tools/GenerateSkillIndex.ts++# Check CreateSkill exists+ls $PAI_DIR/skills/CreateSkill/SKILL.md++# Run SkillSearch+bun run $PAI_DIR/tools/SkillSearch.ts "test"+```++**Mark todo as completed when all VERIFY.md checks pass.**++---++## Success/Failure Messages++### On Success++```+"CORE skill installed successfully!++What's available:+- Skill routing system with USE WHEN triggers+- Structured response format+- Identity configuration for [AI_NAME]+- CreateSkill meta-skill for building new capabilities+- Architecture tracking with PaiArchitecture.ts++Your AI assistant [AI_NAME] is now configured and ready."+```++### On Failure++```+"Installation encountered issues. Here's what to check:++1. Hook system installed? Run: ls $PAI_DIR/hooks/lib/observability.ts+2. Directories created? Run: ls $PAI_DIR/skills/CORE/+3. Tools copied? Run: ls $PAI_DIR/tools/+4. Check VERIFY.md for the specific failing check++Need help? See Troubleshooting section below."+```++---++## Troubleshooting### Step 0.1: Verify Environment and Dependencies