Permanent intelligence amplification infrastructure for Unity XR/AR/VR development
A comprehensive, token-optimized knowledgebase with an AI Agent Intelligence Amplification System designed for 10x faster learning and execution in Unity XR development.
This repository contains a self-improving knowledgebase and AI agent system optimized for Unity XR (AR/VR/MR) development. It implements state-of-the-art best practices from 2026, including:
Primary use cases:
Ultra-compact directive (875 tokens) that transforms every interaction into compound learning:
Existing(0h) > Adapt(0.1x) > AI(0.3x) > Scratch(1x)LEARNING_LOG.mdPhilosophy: Based on mental models from Elon Musk (first principles), Naval Ravikant (leverage), and Jeff Bezos (long-term thinking).
Three activation phrase-based pattern libraries for domain-specific knowledge:
| Phrase | Patterns | Coverage |
|---|---|---|
| "Using Unity Intelligence patterns" | 500+ | ARFoundation, VFX Graph, DOTS, Normcore, Open Brush |
| "Using WebGL Intelligence patterns" | 200+ | WebGPU, Three.js, R3F, GLSL, WebXR |
| "Using 3DVis Intelligence patterns" | 100+ | Sorting, clustering, anomaly detection, force layouts |
Built-in tools for health checking and optimization:
ai-system-monitor.sh - Token usage, symlink verification, health dashboard (<3s)kb-security-audit.sh - Privacy scanning, permission checks, integrity validationvalidate-ai-config.sh - Configuration validation and auto-healingNew KB Management Tools:
kb-add - Easy manual/automatic KB additions (patterns, insights, auto-git extraction)kb-audit - Health check with metrics, recommendations, and security scanLoad Order:
1. GLOBAL_RULES.md (~7.6K tokens)
2. AI_AGENT_V3.md (~0.9K tokens)
3. Claude config (~0.8K tokens)
4. Project overrides (~2K tokens)
────────────────────────────────────────
Total overhead: ~9.3K tokens ✅
26% reduction from initial 12.7K tokens while maintaining full functionality.
# Clone the repository
git clone https://github.com/imclab/xrai.git
cd xrai
# Set up symlinks for AI tools (optional)
ln -sf $(pwd)/KnowledgeBase ~/.claude/knowledgebase
ln -sf $(pwd)/KnowledgeBase ~/.windsurf/knowledgebase
ln -sf $(pwd)/KnowledgeBase ~/.cursor/knowledgebase
With Claude Code:
# The knowledgebase is automatically loaded via configuration hierarchy
# See ~/.claude/CLAUDE.md for load order
Access the AI Agent directive:
cat ~/.claude/AI_AGENT_CORE_DIRECTIVE_V3.md
Browse the knowledgebase:
ls KnowledgeBase/
cat KnowledgeBase/_MASTER_KNOWLEDGEBASE_INDEX.md
1. Direct Filesystem Access
After cloning, the knowledgebase is immediately available:
# Navigate to repository
cd ~/path/to/xrai
# Read any file directly
cat KnowledgeBase/LEARNING_LOG.md
cat KnowledgeBase/_AI_AGENT_PHILOSOPHY.md
# Search across all knowledge
rg "performance optimization" KnowledgeBase/
# List all markdown files
find KnowledgeBase -name "*.md" -type f
2. Symlinked Access (Recommended for AI Tools)
Create symlinks for seamless integration with AI development tools:
# Claude Code
ln -sf ~/path/to/xrai/KnowledgeBase ~/.claude/knowledgebase
# Windsurf
ln -sf ~/path/to/xrai/KnowledgeBase ~/.windsurf/knowledgebase
# Cursor
ln -sf ~/path/to/xrai/KnowledgeBase ~/.cursor/knowledgebase
# Verify symlinks
ls -lh ~/.claude/knowledgebase
ls -lh ~/.windsurf/knowledgebase
ls -lh ~/.cursor/knowledgebase
3. IDE/Editor Integration
VS Code (with Claude Code extension):
# Open in VS Code
code ~/path/to/xrai
# The knowledgebase is automatically available via MCP
# Files appear in: ~/.claude/knowledgebase/
Command Line (with ripgrep):
# Search for Unity patterns
rg -i "AR Foundation|ARKit" ~/.claude/knowledgebase/
# Search for performance tips
rg "Quest.*90 fps|optimization" ~/.claude/knowledgebase/
# Find specific topics
rg "VFX Graph|particle system" ~/.claude/knowledgebase/
4. Monitoring Tools (if installed)
# Health check
ai-system-monitor.sh --quick
# Security audit
kb-security-audit.sh
# Token usage analysis
ai-system-monitor.sh --full | grep "token usage"
1. GitHub Web Interface
Browse directly in your browser:
2. GitHub API (RESTful Access)
Access files programmatically:
# List knowledgebase contents
curl https://api.github.com/repos/imclab/xrai/contents/KnowledgeBase
# Get specific file (base64 encoded)
curl https://api.github.com/repos/imclab/xrai/contents/KnowledgeBase/LEARNING_LOG.md
# Search within repository
curl -H "Accept: application/vnd.github.v3+json" \
https://api.github.com/search/code?q=performance+repo:imclab/xrai
3. Raw File Access (Direct Download)
Access raw markdown files:
# Direct raw file URL
curl https://raw.githubusercontent.com/imclab/xrai/main/KnowledgeBase/LEARNING_LOG.md
# Download specific file
wget https://raw.githubusercontent.com/imclab/xrai/main/KnowledgeBase/_AI_AGENT_PHILOSOPHY.md
# View in browser
open "https://raw.githubusercontent.com/imclab/xrai/main/KnowledgeBase/_MASTER_KNOWLEDGEBASE_INDEX.md"
4. Clone on Any Device
Access from any machine with git:
# Clone to new device
git clone https://github.com/imclab/xrai.git ~/xrai-remote
cd ~/xrai-remote
# Pull latest updates
git pull origin main
# Read-only access (no git needed)
curl -L https://github.com/imclab/xrai/archive/refs/heads/main.zip -o xrai.zip
unzip xrai.zip
cd xrai-main/KnowledgeBase
5. GitHub Mobile App
On iOS/Android:
imclab/xraiKnowledgeBase/ folder.md file (rendered)Scenario 1: Work from multiple machines
# Machine 1: Set up and push changes
cd ~/xrai
echo "New discovery..." >> KnowledgeBase/LEARNING_LOG.md
git add . && git commit -m "Add discovery"
git push origin main
# Machine 2: Pull changes
cd ~/xrai
git pull origin main
# Your changes are now synced
Scenario 2: Mobile-to-Desktop workflow
LEARNING_LOG.mdScenario 3: Cloud-first (no local clone)
# Edit via GitHub web interface
# 1. Navigate to file on GitHub
# 2. Click "Edit" (pencil icon)
# 3. Make changes
# 4. Commit directly to main
# Or use GitHub CLI
gh repo clone imclab/xrai
cd xrai
gh browse # Opens in browser
Claude Code (automatic):
# Configuration auto-loads KB via symlink
# Location: ~/.claude/knowledgebase/
# See: ~/.claude/CLAUDE.md for load order
# Query in Claude Code:
# "Check knowledgebase for AR Foundation patterns"
# "Search KB for Quest optimization techniques"
Windsurf:
# Set up symlink (one-time)
ln -sf ~/xrai/KnowledgeBase ~/.windsurf/knowledgebase
# Access in Windsurf:
# Files appear in sidebar under "Knowledgebase"
Cursor:
# Set up symlink (one-time)
ln -sf ~/xrai/KnowledgeBase ~/.cursor/knowledgebase
# Access in Cursor:
# Reference files via @knowledgebase/filename.md
MCP Server (if available):
# Via Model Context Protocol
# Tools have access to:
# - mcp__filesystem__read_file(path="~/.claude/knowledgebase/LEARNING_LOG.md")
# - mcp__filesystem__search_files(pattern="*.md")
# - mcp__filesystem__list_directory(path="~/.claude/knowledgebase/")
| Method | Speed | Offline | Multi-device | Versioned | AI-Ready |
|---|---|---|---|---|---|
| Local filesystem | Instant | ✅ | ❌ | ✅ (git) | ✅ |
| Symlinks | Instant | ✅ | ❌ | ✅ (git) | ✅✅ |
| GitHub web | 1-2s | ❌ | ✅ | ✅ | ❌ |
| GitHub API | 1-2s | ❌ | ✅ | ✅ | ✅ (programmatic) |
| Git clone | 5-10s | ✅ (after) | ✅ | ✅ | ✅ |
| Raw files | 1-2s | ❌ | ✅ | ❌ | ⚠️ (limited) |
Recommended:
Unity-XR-AI/
├── KnowledgeBase/ # Core knowledge repository (~75 MD files)
│ ├── .claude/ # Claude-specific documentation
│ ├── AgentSystems/ # Agent architecture patterns
│ ├── CodeSnippets/ # Reusable code snippets
│ ├── scripts/ # KB automation scripts
│ ├── _scraps/ # Archived files (aliases, dated reports)
│ ├── LEARNING_LOG.md # Continuous discovery log
│ ├── _MASTER_KNOWLEDGEBASE_INDEX.md
│ ├── _PROJECT_CONFIG_REFERENCE.md # All configs documented
│ ├── _VFX25_HOLOGRAM_PORTAL_PATTERNS.md
│ └── [70+ knowledge files]
├── Vis/ # 3D Visualization frontends
│ ├── xrai-kg/ # Modular KG library (ECharts)
│ ├── HOLOVIS/ # Three.js holographic visualizer
│ ├── cosmos-standalone-web/ # 3d-force-graph visualizer
│ ├── cosmos-needle-web/ # Needle Engine WebXR
│ ├── cosmos-visualizer/ # D3 + Three.js graphs
│ ├── WarpDashboard/ # Jobs data dashboard
│ ├── chalktalk-master/ # Ken Perlin's Chalktalk (WebGL)
│ └── *.html # Standalone dashboards
├── MetavidoVFX-main/ # Unity VFX project (AR Foundation)
│ ├── Assets/H3M/ # H3M Hologram system
│ ├── Packages/ # Unity packages
│ └── build_and_deploy.sh # iOS build scripts
├── Scripts/ # Utility scripts
│ └── scraps/ # Archived experimental scripts
├── mcp-server/ # MCP KB Server (TypeScript)
├── specs/ # Spec-Kit specifications
├── xrai-speckit/ # Specify.ai templates
├── build_ios.sh # iOS Unity build
├── deploy_ios.sh # iOS device deploy
├── install.sh # Project setup
├── CLAUDE.md # Configuration pointer
└── README.md # This file
Local Tools (via symlinks):
~/.claude/knowledgebase/ → xrai/KnowledgeBase/
~/.windsurf/knowledgebase/ → xrai/KnowledgeBase/
~/.cursor/knowledgebase/ → xrai/KnowledgeBase/
Cloud Access (via GitHub):
GitHub API: https://api.github.com/repos/imclab/xrai/contents/
Web: https://github.com/imclab/xrai
1. Leverage-First Execution
Always prefer higher leverage:
├─ 0h: Use existing solution (search KB, past projects)
├─ 0.1x: Adapt from KB (modify existing pattern)
├─ 0.3x: AI-assisted generation with review
└─ 1x: Write from scratch (avoid unless necessary)
2. Compound Learning Every task should:
LEARNING_LOG.md3. Emergency Override If stuck >5 minutes:
See KnowledgeBase/_AI_AGENT_PHILOSOPHY.md for deep-dive on:
Daily activation checklist:
Pre-Task (5 seconds):
Post-Task (10 seconds):
LEARNING_LOG.mdThe Vis/ folder contains 10 3D visualization and dashboard tools, sorted by creation date:
| Project | Created | Stack | Description |
|---|---|---|---|
| chalktalk-master | 2018 | Node.js + WebGL | Ken Perlin's sketch-to-3D visualization |
| HOLOVIS | 2025-06 | Three.js + Express | Unity codebase 3D visualizer |
| cosmos-visualizer | 2025-09 | Vite + D3 + Three.js | Force-directed graph visualization |
| cosmos-standalone-web | 2025-09 | Vite + 3d-force-graph | Standalone 3D force graphs |
| cosmos-needle-web | 2025-09 | Needle Engine + Vite | WebXR-ready visualization |
| WarpDashboard | 2025-12 | Static HTML | Jobs data dashboard |
| xrai-kg | 2026-01 | ES6 + ECharts | Modular knowledge graph library |
| dashboard.html | 2026-01 | Standalone HTML | General dashboard |
| knowledge-graph-*.html | 2026-01 | ECharts | Interactive knowledge graph dashboards |
Quick Start:
cd Vis/xrai-kg && npm install && npm run dev # ECharts KG library
cd Vis/HOLOVIS && npm install && npm run serve # Three.js visualizer
cd Vis/cosmos-standalone-web && npm run dev # 3D force graph
See Vis/README.md for complete setup documentation.
| File | Purpose | Size |
|---|---|---|
LEARNING_LOG.md | Continuous discoveries & patterns | Growing |
_AI_AGENT_PHILOSOPHY.md | Mental models & why | ~3.5K tokens |
_ARFOUNDATION_VFX_KNOWLEDGE_BASE.md | AR Foundation + VFX patterns | ~15K tokens |
_WEBGL_THREEJS_COMPREHENSIVE_GUIDE.md | WebGL/Three.js integration | ~12K tokens |
_PERFORMANCE_PATTERNS_REFERENCE.md | Unity & WebGL optimization | ~8K tokens |
_MASTER_KNOWLEDGEBASE_INDEX.md | Navigation & organization | ~2K tokens |
Unity XR:
VFX & Performance:
WebGL Integration:
GitHub Resources:
# Find performance-related content
rg -i "performance|optimization|fps" KnowledgeBase/
# Find Unity-specific patterns
rg -i "unity|arfoundation|xr" KnowledgeBase/
# Search by project
rg "Portals_6|Paint-AR" KnowledgeBase/
# View recent discoveries
tail -n 100 KnowledgeBase/LEARNING_LOG.md
Quick check (<3 seconds):
ai-system-monitor.sh --quick
Full audit (~10 seconds):
ai-system-monitor.sh --full
Auto-heal issues:
ai-system-monitor.sh --fix
kb-security-audit.sh
Checks for:
Easy manual and automatic additions to the knowledgebase with built-in auditing.
Add patterns, insights, and discoveries to your knowledgebase in seconds:
# Add patterns (reusable solutions)
kb-add --pattern "Use symlinks for cross-tool KB access"
# Add insights (mental models)
kb-add --insight "Token optimization: separate philosophy from protocols"
# Quick daily notes
kb-add --quick "Quest 2 needs 90 FPS for smooth hand tracking"
# Auto-extract from git commits
kb-add --auto-git
# Interactive mode (guided)
kb-add -i
# Create new KB file with template
kb-add --file unity-xr-tips.md -i
Quick aliases (load with source ~/.local/bin/kb-aliases.sh):
kb-p "pattern" # Add pattern
kb-i "insight" # Add insight
kb-a "antipattern" # Add anti-pattern
kb-quick "note" # Quick note
kb-auto # Auto-extract from git
Comprehensive knowledgebase audit with metrics, recommendations, and security:
# Quick audit (5 seconds)
kb-audit --quick
# Full audit with recommendations (15 seconds)
kb-audit --full
# Security scan only
kb-audit --security
# Metrics only
kb-audit --metrics
# Health score only
kb-audit --health
Example output:
━━━ KB Quick Audit ━━━
Metrics:
Files: 37 total, 37 this week
Size: 1.05MB
Learning entries: 9
Git commits: 3
Health Score: 100/100 (Excellent)
Health score ranges:
Full audit includes:
Daily pattern extraction (30 seconds):
kb-check # Quick health check
kb-auto # Extract from git
kb-i "Your insight" # Add manual insights
Weekly full audit (5 minutes):
kb-full --report ~/Desktop/kb-audit-$(date +%Y%m%d).md
# Review recommendations
kb-commit # Commit changes
Post-session reflection (2 minutes):
kb-p "Pattern discovered"
kb-i "Insight about system"
kb-check
See KB_TOOLS_REFERENCE.md for complete documentation.
# 1. Access AR Foundation knowledge
cat KnowledgeBase/_ARFOUNDATION_VFX_KNOWLEDGE_BASE.md
# 2. Check platform compatibility
rg "Quest 2|Quest 3" KnowledgeBase/_PERFORMANCE_PATTERNS_REFERENCE.md
# 3. Find example projects
cat KnowledgeBase/_MASTER_GITHUB_REPO_KNOWLEDGEBASE.md
# 1. Search for performance patterns
rg -i "gpu instancing|particle" KnowledgeBase/
# 2. Check Quest-specific optimizations
rg "Quest.*fps|90 fps" KnowledgeBase/
# 3. Log discoveries
echo "## $(date +%Y-%m-%d) - VFX Optimization Discovery
**Context**: Optimizing particles for Quest 2
**Discovery**: GPU instancing reduced draw calls by 80%
**Pattern**: Use Graphics.DrawMeshInstanced for >100 particles
**ROI**: 15ms → 3ms frame time
" >> KnowledgeBase/LEARNING_LOG.md
Activate AI Agent directive:
> "Apply AI Agent Core Directive: Check knowledgebase for AR Foundation
patterns, focus on highest-leverage approach, explain trade-offs."
When stuck:
> "Emergency override: simplest solution for hand tracking on Quest 3?
Who solved this already?"
End of session:
> "Extract 2-3 patterns for LEARNING_LOG.md. What automation
opportunities exist?"
When to add:
When NOT to add:
## YYYY-MM-DD - [Tool Name] - [Brief Title]
**Discovery**: [What was learned/discovered]
**Context**: [What prompted this, what problem was solved]
**Pattern**: [Reusable approach]
**Future Application**: [Where else can this apply?]
**ROI**: [Time saved / leverage gained]
---
MIT License - See LICENSE for details
_UNITY_PATTERNS_BY_INTEREST.md - Brushes, hand tracking, audio reactive, LiDAR (459 lines)_WEBGL_INTELLIGENCE_PATTERNS.md - WebGPU, Three.js, R3F, GLSL (548 lines)_3DVIS_INTELLIGENCE_PATTERNS.md - Sorting, clustering, anomaly detection (698 lines)~/Applications/claude_memory.json (42KB, 99+ entities)_GLOBAL_RULES_AND_MEMORY.mdVis/README.md with setup docs sorted by date_scraps/ (aliases, dated reports, old docs)_PROJECT_CONFIG_REFERENCE.md documenting all configsScripts/scraps/build_ios.sh, deploy_ios.sh, install.sh)_VFX25_HOLOGRAM_PORTAL_PATTERNS.md
AI Agent philosophy based on:
Knowledge contributions from:
Built with:
Made with ❤️ for the Unity XR community
Permanent intelligence amplification infrastructure for faster learning and execution.
C#
70.1%
JavaScript
8.8%
TypeScript
7.6%
HTML
5.3%
ShaderLab
4.6%
Permanent intelligence amplification infrastructure for Unity XR/AR/VR development
A comprehensive, token-optimized knowledgebase with an AI Agent Intelligence Amplification System designed for 10x faster learning and execution in Unity XR development.
This repository contains a self-improving knowledgebase and AI agent system optimized for Unity XR (AR/VR/MR) development. It implements state-of-the-art best practices from 2026, including:
Primary use cases:
Ultra-compact directive (875 tokens) that transforms every interaction into compound learning:
Existing(0h) > Adapt(0.1x) > AI(0.3x) > Scratch(1x)LEARNING_LOG.mdPhilosophy: Based on mental models from Elon Musk (first principles), Naval Ravikant (leverage), and Jeff Bezos (long-term thinking).
Three activation phrase-based pattern libraries for domain-specific knowledge:
| Phrase | Patterns | Coverage |
|---|---|---|
| "Using Unity Intelligence patterns" | 500+ | ARFoundation, VFX Graph, DOTS, Normcore, Open Brush |
| "Using WebGL Intelligence patterns" | 200+ | WebGPU, Three.js, R3F, GLSL, WebXR |
| "Using 3DVis Intelligence patterns" | 100+ | Sorting, clustering, anomaly detection, force layouts |
Built-in tools for health checking and optimization:
ai-system-monitor.sh - Token usage, symlink verification, health dashboard (<3s)kb-security-audit.sh - Privacy scanning, permission checks, integrity validationvalidate-ai-config.sh - Configuration validation and auto-healingNew KB Management Tools:
kb-add - Easy manual/automatic KB additions (patterns, insights, auto-git extraction)kb-audit - Health check with metrics, recommendations, and security scanLoad Order:
1. GLOBAL_RULES.md (~7.6K tokens)
2. AI_AGENT_V3.md (~0.9K tokens)
3. Claude config (~0.8K tokens)
4. Project overrides (~2K tokens)
────────────────────────────────────────
Total overhead: ~9.3K tokens ✅
26% reduction from initial 12.7K tokens while maintaining full functionality.
# Clone the repository
git clone https://github.com/imclab/xrai.git
cd xrai
# Set up symlinks for AI tools (optional)
ln -sf $(pwd)/KnowledgeBase ~/.claude/knowledgebase
ln -sf $(pwd)/KnowledgeBase ~/.windsurf/knowledgebase
ln -sf $(pwd)/KnowledgeBase ~/.cursor/knowledgebase
With Claude Code:
# The knowledgebase is automatically loaded via configuration hierarchy
# See ~/.claude/CLAUDE.md for load order
Access the AI Agent directive:
cat ~/.claude/AI_AGENT_CORE_DIRECTIVE_V3.md
Browse the knowledgebase:
ls KnowledgeBase/
cat KnowledgeBase/_MASTER_KNOWLEDGEBASE_INDEX.md
1. Direct Filesystem Access
After cloning, the knowledgebase is immediately available:
# Navigate to repository
cd ~/path/to/xrai
# Read any file directly
cat KnowledgeBase/LEARNING_LOG.md
cat KnowledgeBase/_AI_AGENT_PHILOSOPHY.md
# Search across all knowledge
rg "performance optimization" KnowledgeBase/
# List all markdown files
find KnowledgeBase -name "*.md" -type f
2. Symlinked Access (Recommended for AI Tools)
Create symlinks for seamless integration with AI development tools:
# Claude Code
ln -sf ~/path/to/xrai/KnowledgeBase ~/.claude/knowledgebase
# Windsurf
ln -sf ~/path/to/xrai/KnowledgeBase ~/.windsurf/knowledgebase
# Cursor
ln -sf ~/path/to/xrai/KnowledgeBase ~/.cursor/knowledgebase
# Verify symlinks
ls -lh ~/.claude/knowledgebase
ls -lh ~/.windsurf/knowledgebase
ls -lh ~/.cursor/knowledgebase
3. IDE/Editor Integration
VS Code (with Claude Code extension):
# Open in VS Code
code ~/path/to/xrai
# The knowledgebase is automatically available via MCP
# Files appear in: ~/.claude/knowledgebase/
Command Line (with ripgrep):
# Search for Unity patterns
rg -i "AR Foundation|ARKit" ~/.claude/knowledgebase/
# Search for performance tips
rg "Quest.*90 fps|optimization" ~/.claude/knowledgebase/
# Find specific topics
rg "VFX Graph|particle system" ~/.claude/knowledgebase/
4. Monitoring Tools (if installed)
# Health check
ai-system-monitor.sh --quick
# Security audit
kb-security-audit.sh
# Token usage analysis
ai-system-monitor.sh --full | grep "token usage"
1. GitHub Web Interface
Browse directly in your browser:
2. GitHub API (RESTful Access)
Access files programmatically:
# List knowledgebase contents
curl https://api.github.com/repos/imclab/xrai/contents/KnowledgeBase
# Get specific file (base64 encoded)
curl https://api.github.com/repos/imclab/xrai/contents/KnowledgeBase/LEARNING_LOG.md
# Search within repository
curl -H "Accept: application/vnd.github.v3+json" \
https://api.github.com/search/code?q=performance+repo:imclab/xrai
3. Raw File Access (Direct Download)
Access raw markdown files:
# Direct raw file URL
curl https://raw.githubusercontent.com/imclab/xrai/main/KnowledgeBase/LEARNING_LOG.md
# Download specific file
wget https://raw.githubusercontent.com/imclab/xrai/main/KnowledgeBase/_AI_AGENT_PHILOSOPHY.md
# View in browser
open "https://raw.githubusercontent.com/imclab/xrai/main/KnowledgeBase/_MASTER_KNOWLEDGEBASE_INDEX.md"
4. Clone on Any Device
Access from any machine with git:
# Clone to new device
git clone https://github.com/imclab/xrai.git ~/xrai-remote
cd ~/xrai-remote
# Pull latest updates
git pull origin main
# Read-only access (no git needed)
curl -L https://github.com/imclab/xrai/archive/refs/heads/main.zip -o xrai.zip
unzip xrai.zip
cd xrai-main/KnowledgeBase
5. GitHub Mobile App
On iOS/Android:
imclab/xraiKnowledgeBase/ folder.md file (rendered)Scenario 1: Work from multiple machines
# Machine 1: Set up and push changes
cd ~/xrai
echo "New discovery..." >> KnowledgeBase/LEARNING_LOG.md
git add . && git commit -m "Add discovery"
git push origin main
# Machine 2: Pull changes
cd ~/xrai
git pull origin main
# Your changes are now synced
Scenario 2: Mobile-to-Desktop workflow
LEARNING_LOG.mdScenario 3: Cloud-first (no local clone)
# Edit via GitHub web interface
# 1. Navigate to file on GitHub
# 2. Click "Edit" (pencil icon)
# 3. Make changes
# 4. Commit directly to main
# Or use GitHub CLI
gh repo clone imclab/xrai
cd xrai
gh browse # Opens in browser
Claude Code (automatic):
# Configuration auto-loads KB via symlink
# Location: ~/.claude/knowledgebase/
# See: ~/.claude/CLAUDE.md for load order
# Query in Claude Code:
# "Check knowledgebase for AR Foundation patterns"
# "Search KB for Quest optimization techniques"
Windsurf:
# Set up symlink (one-time)
ln -sf ~/xrai/KnowledgeBase ~/.windsurf/knowledgebase
# Access in Windsurf:
# Files appear in sidebar under "Knowledgebase"
Cursor:
# Set up symlink (one-time)
ln -sf ~/xrai/KnowledgeBase ~/.cursor/knowledgebase
# Access in Cursor:
# Reference files via @knowledgebase/filename.md
MCP Server (if available):
# Via Model Context Protocol
# Tools have access to:
# - mcp__filesystem__read_file(path="~/.claude/knowledgebase/LEARNING_LOG.md")
# - mcp__filesystem__search_files(pattern="*.md")
# - mcp__filesystem__list_directory(path="~/.claude/knowledgebase/")
| Method | Speed | Offline | Multi-device | Versioned | AI-Ready |
|---|---|---|---|---|---|
| Local filesystem | Instant | ✅ | ❌ | ✅ (git) | ✅ |
| Symlinks | Instant | ✅ | ❌ | ✅ (git) | ✅✅ |
| GitHub web | 1-2s | ❌ | ✅ | ✅ | ❌ |
| GitHub API | 1-2s | ❌ | ✅ | ✅ | ✅ (programmatic) |
| Git clone | 5-10s | ✅ (after) | ✅ | ✅ | ✅ |
| Raw files | 1-2s | ❌ | ✅ | ❌ | ⚠️ (limited) |
Recommended:
Unity-XR-AI/
├── KnowledgeBase/ # Core knowledge repository (~75 MD files)
│ ├── .claude/ # Claude-specific documentation
│ ├── AgentSystems/ # Agent architecture patterns
│ ├── CodeSnippets/ # Reusable code snippets
│ ├── scripts/ # KB automation scripts
│ ├── _scraps/ # Archived files (aliases, dated reports)
│ ├── LEARNING_LOG.md # Continuous discovery log
│ ├── _MASTER_KNOWLEDGEBASE_INDEX.md
│ ├── _PROJECT_CONFIG_REFERENCE.md # All configs documented
│ ├── _VFX25_HOLOGRAM_PORTAL_PATTERNS.md
│ └── [70+ knowledge files]
├── Vis/ # 3D Visualization frontends
│ ├── xrai-kg/ # Modular KG library (ECharts)
│ ├── HOLOVIS/ # Three.js holographic visualizer
│ ├── cosmos-standalone-web/ # 3d-force-graph visualizer
│ ├── cosmos-needle-web/ # Needle Engine WebXR
│ ├── cosmos-visualizer/ # D3 + Three.js graphs
│ ├── WarpDashboard/ # Jobs data dashboard
│ ├── chalktalk-master/ # Ken Perlin's Chalktalk (WebGL)
│ └── *.html # Standalone dashboards
├── MetavidoVFX-main/ # Unity VFX project (AR Foundation)
│ ├── Assets/H3M/ # H3M Hologram system
│ ├── Packages/ # Unity packages
│ └── build_and_deploy.sh # iOS build scripts
├── Scripts/ # Utility scripts
│ └── scraps/ # Archived experimental scripts
├── mcp-server/ # MCP KB Server (TypeScript)
├── specs/ # Spec-Kit specifications
├── xrai-speckit/ # Specify.ai templates
├── build_ios.sh # iOS Unity build
├── deploy_ios.sh # iOS device deploy
├── install.sh # Project setup
├── CLAUDE.md # Configuration pointer
└── README.md # This file
Local Tools (via symlinks):
~/.claude/knowledgebase/ → xrai/KnowledgeBase/
~/.windsurf/knowledgebase/ → xrai/KnowledgeBase/
~/.cursor/knowledgebase/ → xrai/KnowledgeBase/
Cloud Access (via GitHub):
GitHub API: https://api.github.com/repos/imclab/xrai/contents/
Web: https://github.com/imclab/xrai
1. Leverage-First Execution
Always prefer higher leverage:
├─ 0h: Use existing solution (search KB, past projects)
├─ 0.1x: Adapt from KB (modify existing pattern)
├─ 0.3x: AI-assisted generation with review
└─ 1x: Write from scratch (avoid unless necessary)
2. Compound Learning Every task should:
LEARNING_LOG.md3. Emergency Override If stuck >5 minutes:
See KnowledgeBase/_AI_AGENT_PHILOSOPHY.md for deep-dive on:
Daily activation checklist:
Pre-Task (5 seconds):
Post-Task (10 seconds):
LEARNING_LOG.mdThe Vis/ folder contains 10 3D visualization and dashboard tools, sorted by creation date:
| Project | Created | Stack | Description |
|---|---|---|---|
| chalktalk-master | 2018 | Node.js + WebGL | Ken Perlin's sketch-to-3D visualization |
| HOLOVIS | 2025-06 | Three.js + Express | Unity codebase 3D visualizer |
| cosmos-visualizer | 2025-09 | Vite + D3 + Three.js | Force-directed graph visualization |
| cosmos-standalone-web | 2025-09 | Vite + 3d-force-graph | Standalone 3D force graphs |
| cosmos-needle-web | 2025-09 | Needle Engine + Vite | WebXR-ready visualization |
| WarpDashboard | 2025-12 | Static HTML | Jobs data dashboard |
| xrai-kg | 2026-01 | ES6 + ECharts | Modular knowledge graph library |
| dashboard.html | 2026-01 | Standalone HTML | General dashboard |
| knowledge-graph-*.html | 2026-01 | ECharts | Interactive knowledge graph dashboards |
Quick Start:
cd Vis/xrai-kg && npm install && npm run dev # ECharts KG library
cd Vis/HOLOVIS && npm install && npm run serve # Three.js visualizer
cd Vis/cosmos-standalone-web && npm run dev # 3D force graph
See Vis/README.md for complete setup documentation.
| File | Purpose | Size |
|---|---|---|
LEARNING_LOG.md | Continuous discoveries & patterns | Growing |
_AI_AGENT_PHILOSOPHY.md | Mental models & why | ~3.5K tokens |
_ARFOUNDATION_VFX_KNOWLEDGE_BASE.md | AR Foundation + VFX patterns | ~15K tokens |
_WEBGL_THREEJS_COMPREHENSIVE_GUIDE.md | WebGL/Three.js integration | ~12K tokens |
_PERFORMANCE_PATTERNS_REFERENCE.md | Unity & WebGL optimization | ~8K tokens |
_MASTER_KNOWLEDGEBASE_INDEX.md | Navigation & organization | ~2K tokens |
Unity XR:
VFX & Performance:
WebGL Integration:
GitHub Resources:
# Find performance-related content
rg -i "performance|optimization|fps" KnowledgeBase/
# Find Unity-specific patterns
rg -i "unity|arfoundation|xr" KnowledgeBase/
# Search by project
rg "Portals_6|Paint-AR" KnowledgeBase/
# View recent discoveries
tail -n 100 KnowledgeBase/LEARNING_LOG.md
Quick check (<3 seconds):
ai-system-monitor.sh --quick
Full audit (~10 seconds):
ai-system-monitor.sh --full
Auto-heal issues:
ai-system-monitor.sh --fix
kb-security-audit.sh
Checks for:
Easy manual and automatic additions to the knowledgebase with built-in auditing.
Add patterns, insights, and discoveries to your knowledgebase in seconds:
# Add patterns (reusable solutions)
kb-add --pattern "Use symlinks for cross-tool KB access"
# Add insights (mental models)
kb-add --insight "Token optimization: separate philosophy from protocols"
# Quick daily notes
kb-add --quick "Quest 2 needs 90 FPS for smooth hand tracking"
# Auto-extract from git commits
kb-add --auto-git
# Interactive mode (guided)
kb-add -i
# Create new KB file with template
kb-add --file unity-xr-tips.md -i
Quick aliases (load with source ~/.local/bin/kb-aliases.sh):
kb-p "pattern" # Add pattern
kb-i "insight" # Add insight
kb-a "antipattern" # Add anti-pattern
kb-quick "note" # Quick note
kb-auto # Auto-extract from git
Comprehensive knowledgebase audit with metrics, recommendations, and security:
# Quick audit (5 seconds)
kb-audit --quick
# Full audit with recommendations (15 seconds)
kb-audit --full
# Security scan only
kb-audit --security
# Metrics only
kb-audit --metrics
# Health score only
kb-audit --health
Example output:
━━━ KB Quick Audit ━━━
Metrics:
Files: 37 total, 37 this week
Size: 1.05MB
Learning entries: 9
Git commits: 3
Health Score: 100/100 (Excellent)
Health score ranges:
Full audit includes:
Daily pattern extraction (30 seconds):
kb-check # Quick health check
kb-auto # Extract from git
kb-i "Your insight" # Add manual insights
Weekly full audit (5 minutes):
kb-full --report ~/Desktop/kb-audit-$(date +%Y%m%d).md
# Review recommendations
kb-commit # Commit changes
Post-session reflection (2 minutes):
kb-p "Pattern discovered"
kb-i "Insight about system"
kb-check
See KB_TOOLS_REFERENCE.md for complete documentation.
# 1. Access AR Foundation knowledge
cat KnowledgeBase/_ARFOUNDATION_VFX_KNOWLEDGE_BASE.md
# 2. Check platform compatibility
rg "Quest 2|Quest 3" KnowledgeBase/_PERFORMANCE_PATTERNS_REFERENCE.md
# 3. Find example projects
cat KnowledgeBase/_MASTER_GITHUB_REPO_KNOWLEDGEBASE.md
# 1. Search for performance patterns
rg -i "gpu instancing|particle" KnowledgeBase/
# 2. Check Quest-specific optimizations
rg "Quest.*fps|90 fps" KnowledgeBase/
# 3. Log discoveries
echo "## $(date +%Y-%m-%d) - VFX Optimization Discovery
**Context**: Optimizing particles for Quest 2
**Discovery**: GPU instancing reduced draw calls by 80%
**Pattern**: Use Graphics.DrawMeshInstanced for >100 particles
**ROI**: 15ms → 3ms frame time
" >> KnowledgeBase/LEARNING_LOG.md
Activate AI Agent directive:
> "Apply AI Agent Core Directive: Check knowledgebase for AR Foundation
patterns, focus on highest-leverage approach, explain trade-offs."
When stuck:
> "Emergency override: simplest solution for hand tracking on Quest 3?
Who solved this already?"
End of session:
> "Extract 2-3 patterns for LEARNING_LOG.md. What automation
opportunities exist?"
When to add:
When NOT to add:
## YYYY-MM-DD - [Tool Name] - [Brief Title]
**Discovery**: [What was learned/discovered]
**Context**: [What prompted this, what problem was solved]
**Pattern**: [Reusable approach]
**Future Application**: [Where else can this apply?]
**ROI**: [Time saved / leverage gained]
---
MIT License - See LICENSE for details
_UNITY_PATTERNS_BY_INTEREST.md - Brushes, hand tracking, audio reactive, LiDAR (459 lines)_WEBGL_INTELLIGENCE_PATTERNS.md - WebGPU, Three.js, R3F, GLSL (548 lines)_3DVIS_INTELLIGENCE_PATTERNS.md - Sorting, clustering, anomaly detection (698 lines)~/Applications/claude_memory.json (42KB, 99+ entities)_GLOBAL_RULES_AND_MEMORY.mdVis/README.md with setup docs sorted by date_scraps/ (aliases, dated reports, old docs)_PROJECT_CONFIG_REFERENCE.md documenting all configsScripts/scraps/build_ios.sh, deploy_ios.sh, install.sh)_VFX25_HOLOGRAM_PORTAL_PATTERNS.md
AI Agent philosophy based on:
Knowledge contributions from:
Built with:
Made with ❤️ for the Unity XR community
Permanent intelligence amplification infrastructure for faster learning and execution.
C#
70.1%
JavaScript
8.8%
TypeScript
7.6%
HTML
5.3%
ShaderLab
4.6%