personal-ai-infrastructure
💡 摘要
个人AI基础设施通过模块化技能和自动化会话管理增强Claude Code。
🎯 适合人群
🤖 AI 吐槽: “该项目涉及网络访问和文件系统修改,如果配置不当,可能会暴露敏感数据。实施严格的访问控制并验证输入以降低风险。”
该项目涉及网络访问和文件系统修改,如果配置不当,可能会暴露敏感数据。实施严格的访问控制并验证输入以降低风险。
Personal AI Infrastructure (PAI)
A skills-based context management system for Claude Code. PAI extends Claude Code with domain-specific knowledge, custom workflows, and automated session management.
What is PAI?
PAI is a personal AI infrastructure layer that sits on top of Claude Code, providing:
- Skills System - Modular context packages that load relevant knowledge on-demand
- Hook System - Event-driven automation for session lifecycle management
- Memory System - Session history, learnings, and signal capture
- Custom Commands - Slash commands for common workflows
Prerequisites
- Claude Code CLI installed and authenticated
- Bun runtime (for hooks and tools)
- macOS or Linux (Windows via WSL)
Installation
1. Clone the repository
git clone https://github.com/robdtaylor/personal-ai-infrastructure.git ~/.claude
Note: If you already have a
~/.claudedirectory, back it up first:mv ~/.claude ~/.claude-backup
2. Copy and configure settings
cd ~/.claude cp settings.json.template settings.json
Edit settings.json to customize:
- Environment variables
- Hook configurations
- Permission settings
3. Install dependencies
# Install Bun if not already installed curl -fsSL https://bun.sh/install | bash # Install hook dependencies cd ~/.claude/hooks && bun install
4. Personalize your setup
Edit the following files in skills/CORE/USER/:
| File | Purpose |
|------|---------|
| BASICINFO.md | Your contact information |
| CONTACTS.md | Directory of people you work with |
| ABOUTME.md | Personal background for AI context |
| DAIDENTITY.md | AI assistant name and personality |
| TECHSTACKPREFERENCES.md | Your preferred technologies |
5. Verify installation
claude
You should see the PAI context load at session start.
Directory Structure
~/.claude/
├── skills/ # Skill packages (context modules)
│ ├── CORE/ # Core identity and system docs
│ ├── Research/ # Multi-source research workflows
│ ├── Browser/ # Web automation
│ └── ... # Domain-specific skills
├── hooks/ # Event-driven automation
├── commands/ # Custom slash commands
├── bin/ # CLI tools and utilities
├── MEMORY/ # Session history and learnings
└── settings.json # Claude Code configuration
Skills Included
Manufacturing & Operations
- AutomotiveManufacturing - IATF 16949, work instructions, SOPs
- A3CriticalThinking - Toyota-style problem solving
- CNCSetup - Machine setup sheets
- CuttingParams - Feeds and speeds reference
- PlantCapability - Machine shop capabilities
- QuoteEstimator - Cycle time and cost estimation
- SkillsMatrix - Operator competency tracking
- ToolCrib - Tool inventory management
- TribalKnowledge - Expertise capture
- MaintenancePM - Preventive maintenance schedules
- HoshinKanri - Strategy deployment (X-Matrix, catchball)
- SapEcc - SAP transaction codes and processes
- SupplyChain - Purchasing and materials management
Business & Strategy
- BusinessStrategy - Financial analysis, valuations, business plans
- PowerPlatform - Power Automate flow generation
Infrastructure & Automation
- HomeAssistant - Smart home integration
- Infrastructure - Network services and endpoints
- MobileApp - Mobile web interface for PAI
- Proxmox - VM management
- Unifi - Network monitoring
- n8n - Workflow automation
AI & Research
- Research - Multi-source parallel research
- AgentObservability - Real-time agent monitoring dashboard
- PhotoRealisticArt - AI image generation prompting
- Art - Excalidraw-style visualizations
Core
- CORE - Identity, preferences, security protocols
- Browser - Web automation and verification
- Context - Obsidian vault integration
- CreateSkill - Skill authoring tools
- Upgrades - Track Claude Code updates
Creating Custom Skills
Skills are modular context packages. Create a new skill:
mkdir -p ~/.claude/skills/MySkill
Create SKILL.md:
--- name: MySkill description: Brief description. USE WHEN user says 'keyword1', 'keyword2'. --- # MySkill ## Overview What this skill does... ## Workflows - WorkflowName: Description ## Reference Key information the AI should know...
Regenerate the skill index:
bun run ~/.claude/tools/GenerateSkillIndex.ts
Hooks
PAI uses Claude Code's hook system for automation:
| Hook | Purpose |
|------|---------|
| SessionStart | Load core context, initialize session |
| PreToolUse | Security validation for Bash commands |
| PostToolUse | Capture signals and checkpoints |
| Stop | Capture learnings and session summary |
Configure hooks in settings.json.
Custom Commands
Slash commands are defined in ~/.claude/commands/. Example:
# /mycommand Description of what this command does. ## Instructions Steps for the AI to follow...
Configuration
Environment Variables
Set in settings.json under env:
{ "env": { "PAI_DIR": "$HOME/.claude", "TIME_ZONE": "Europe/London" } }
Security
The security-validator.ts hook blocks dangerous bash commands. Customize patterns in skills/CORE/USER/PAISECURITYSYSTEM/patterns.yaml.
Troubleshooting
Hooks not running
- Check Bun is installed:
bun --version - Verify hook paths in
settings.json - Check hook file permissions:
chmod +x ~/.claude/hooks/*.ts
Skills not loading
- Regenerate skill index:
bun run ~/.claude/tools/GenerateSkillIndex.ts - Check skill has valid YAML frontmatter in
SKILL.md
Context not appearing
- Verify
load-core-context.tshook is configured in SessionStart - Check
CORE/SKILL.mdexists and has valid content
Contributing
- Fork this repository
- Create a feature branch
- Make your changes
- Submit a pull request
License
MIT License - See LICENSE file for details.
Acknowledgments
Built for Claude Code by Anthropic.
优点
- 模块化技能提供量身定制的AI体验
- 事件驱动的自动化提高效率
- 全面的会话管理
- 支持多个领域和行业
缺点
- 需要多个依赖项
- 初学者的设置可能较复杂
- 对Windows支持有限
- 定制可能需要技术知识
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 robdtaylor.
