Initial commit: Claude Code Customization Suite - 40+ agents, MCP tools, and automation scripts
This commit is contained in:
398
CLAUDE-CUSTOMIZATIONS-README.md
Normal file
398
CLAUDE-CUSTOMIZATIONS-README.md
Normal file
@@ -0,0 +1,398 @@
|
||||
# Claude Code Customizations - Complete Setup Guide
|
||||
|
||||
This repository contains automated scripts to replicate a fully customized Claude Code environment with custom agents, MCP tools, and plugins.
|
||||
|
||||
## Overview of Customizations
|
||||
|
||||
### 🤖 Custom Agents (40+ specialized agents)
|
||||
|
||||
#### Engineering Agents
|
||||
- **ai-engineer** - AI/ML feature implementation, LLM integration
|
||||
- **backend-architect** - API design, database architecture, server-side logic
|
||||
- **devops-automator** - CI/CD pipelines, infrastructure, monitoring
|
||||
- **frontend-developer** - React/Vue/Angular UI development
|
||||
- **mobile-app-builder** - iOS/Android React Native development
|
||||
- **rapid-prototyper** - Quick MVP/prototype building (6-day cycle focused)
|
||||
- **test-writer-fixer** - Automatic test writing and fixing
|
||||
|
||||
#### Marketing Agents
|
||||
- **tiktok-strategist** - TikTok marketing and viral content strategies
|
||||
- **growth-hacker** - Growth strategies and viral mechanics
|
||||
- **content-creator** - Content creation for various platforms
|
||||
- **instagram-curator** - Instagram content strategy
|
||||
- **reddit-community-builder** - Reddit community engagement
|
||||
- **twitter-engager** - Twitter engagement strategies
|
||||
- **app-store-optimizer** - ASO and app store optimization
|
||||
|
||||
#### Product Agents
|
||||
- **sprint-prioritizer** - 6-day sprint planning and feature prioritization
|
||||
- **feedback-synthesizer** - User feedback analysis and insights
|
||||
- **trend-researcher** - Market trend identification (TikTok/App Store focus)
|
||||
|
||||
#### Studio Operations Agents
|
||||
- **studio-producer** - Cross-team coordination and resource allocation
|
||||
- **project-shipper** - Launch coordination and go-to-market activities
|
||||
- **studio-coach** - Elite performance coach for other agents
|
||||
- **analytics-reporter** - Analytics and reporting
|
||||
- **finance-tracker** - Financial tracking and management
|
||||
- **infrastructure-maintainer** - Infrastructure maintenance
|
||||
- **legal-compliance-checker** - Legal and compliance checks
|
||||
- **support-responder** - Customer support responses
|
||||
|
||||
#### Project Management Agents
|
||||
- **experiment-tracker** - A/B test and experiment tracking
|
||||
- **project-shipper** - Project shipping coordination
|
||||
- **studio-producer** - Studio production management
|
||||
|
||||
#### Testing Agents
|
||||
- **test-writer-fixer** - Test writing and fixing (code change triggered)
|
||||
- **api-tester** - API testing
|
||||
- **performance-benchmarker** - Performance benchmarking
|
||||
- **test-results-analyzer** - Test results analysis
|
||||
- **tool-evaluator** - Tool evaluation
|
||||
- **workflow-optimizer** - Workflow optimization
|
||||
|
||||
#### Design Agents
|
||||
- **ui-designer** - UI design
|
||||
- **ux-researcher** - UX research
|
||||
- **brand-guardian** - Brand consistency
|
||||
- **visual-storyteller** - Visual storytelling
|
||||
- **whimsy-injector** - Add delightful/playful UI elements (auto-triggered after UI changes)
|
||||
|
||||
#### Bonus Agents
|
||||
- **joker** - Humor and entertainment
|
||||
- **studio-coach** - Performance coaching
|
||||
|
||||
### 🔧 MCP (Model Context Protocol) Tools
|
||||
|
||||
#### Vision Analysis Tools (`mcp__zai-mcp-server__`)
|
||||
- **analyze_image** - General-purpose image analysis
|
||||
- **analyze_video** - Video content analysis (MP4, MOV, M4V up to 8MB)
|
||||
- **ui_to_artifact** - Convert UI screenshots to:
|
||||
- `code` - Generate frontend code
|
||||
- `prompt` - Generate AI prompt for recreation
|
||||
- `spec` - Extract design specifications
|
||||
- `description` - Natural language description
|
||||
- **extract_text_from_screenshot** - OCR text extraction from screenshots
|
||||
- **diagnose_error_screenshot** - Error message and stack trace diagnosis
|
||||
- **ui_diff_check** - Compare two UI screenshots for differences
|
||||
- **analyze_data_visualization** - Extract insights from charts/graphs/dashboards
|
||||
- **understand_technical_diagram** - Analyze architecture/flowchart/UML/ER diagrams
|
||||
|
||||
#### Web & Research Tools
|
||||
- **mcp__web-search-prime__webSearchPrime** - Enhanced web search with:
|
||||
- Domain filtering (whitelist/blacklist)
|
||||
- Time-based filtering (day/week/month/year)
|
||||
- Location-based results (CN/US)
|
||||
- Content size control (medium/high)
|
||||
|
||||
- **mcp__web-reader__webReader** - Web scraper and converter:
|
||||
- Fetch any URL
|
||||
- Convert to markdown or text
|
||||
- Image handling
|
||||
- Link and image summaries
|
||||
|
||||
#### GitHub Tools (`mcp__zread__`)
|
||||
- **get_repo_structure** - Get GitHub repo directory structure
|
||||
- **read_file** - Read files from GitHub repos
|
||||
- **search_doc** - Search GitHub repo docs, issues, commits
|
||||
|
||||
#### Additional Tools
|
||||
- **mcp__4_5v_mcp__analyze_image** - Image analysis with URL support
|
||||
- **mcp__glm_camp_server__claim_glm_camp_coupon** - Claim GLM promotional rewards
|
||||
|
||||
### 🎯 Custom Skills
|
||||
|
||||
- **glm-plan-bug:case-feedback** - Submit bug/issue feedback for GLM Coding Plan
|
||||
- **glm-plan-usage:usage-query** - Query GLM Coding Plan usage statistics
|
||||
|
||||
### 📁 Directory Structure
|
||||
|
||||
```
|
||||
~/.claude/
|
||||
├── agents/
|
||||
│ ├── engineering/ # 7 engineering agents
|
||||
│ ├── marketing/ # 7 marketing agents
|
||||
│ ├── product/ # 3 product agents
|
||||
│ ├── studio-operations/ # 8 studio operations agents
|
||||
│ ├── project-management/ # 3 project management agents
|
||||
│ ├── testing/ # 5 testing agents
|
||||
│ ├── design/ # 5 design agents
|
||||
│ └── bonus/ # 2 bonus agents
|
||||
├── plugins/
|
||||
│ ├── cache/ # Downloaded plugins
|
||||
│ ├── marketplaces/ # Plugin marketplaces
|
||||
│ ├── installed_plugins.json
|
||||
│ └── known_marketplaces.json
|
||||
├── hooks/ # Custom hooks
|
||||
├── settings.json # Main settings
|
||||
└── settings.local.json # Local permissions
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
### Option 1: Export from Existing Machine
|
||||
|
||||
If you have an existing machine with these customizations:
|
||||
|
||||
```bash
|
||||
# 1. Export customizations
|
||||
./export-claude-customizations.sh
|
||||
|
||||
# 2. Transfer the archive to new machine
|
||||
scp claude-customizations-*.tar.gz user@new-machine:~/
|
||||
|
||||
# 3. On new machine, extract and install
|
||||
tar -xzf claude-customizations-*.tar.gz
|
||||
cd claude-customizations-export
|
||||
./install-claude-customizations.sh
|
||||
```
|
||||
|
||||
### Option 2: Fresh Installation
|
||||
|
||||
For a fresh installation on a new machine:
|
||||
|
||||
```bash
|
||||
# 1. Download or clone the setup scripts
|
||||
# 2. Run the installer
|
||||
./install-claude-customizations.sh
|
||||
|
||||
# 3. Copy agent definitions from source (if available)
|
||||
scp -r user@source:~/.claude/agents/* ~/.claude/agents/
|
||||
|
||||
# 4. Restart Claude Code
|
||||
```
|
||||
|
||||
### Option 3: Manual Installation
|
||||
|
||||
```bash
|
||||
# 1. Create directory structure
|
||||
mkdir -p ~/.claude/agents/{engineering,marketing,product,studio-operations,project-management,testing,design,bonus}
|
||||
mkdir -p ~/.claude/plugins/{cache,marketplaces}
|
||||
|
||||
# 2. Install MCP tools
|
||||
npm install -g @z_ai/mcp-server @z_ai/coding-helper
|
||||
|
||||
# 3. Create settings.json
|
||||
cat > ~/.claude/settings.json << 'EOF'
|
||||
{
|
||||
"env": {
|
||||
"ANTHROPIC_AUTH_TOKEN": "YOUR_TOKEN_HERE",
|
||||
"ANTHROPIC_BASE_URL": "https://api.anthropic.com",
|
||||
"API_TIMEOUT_MS": "3000000",
|
||||
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
|
||||
},
|
||||
"enabledPlugins": {
|
||||
"glm-plan-bug@zai-coding-plugins": true,
|
||||
"glm-plan-usage@zai-coding-plugins": true
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# 4. Copy agent files (from source or repository)
|
||||
# 5. Copy plugin configurations
|
||||
# 6. Restart Claude Code
|
||||
```
|
||||
|
||||
## Verification
|
||||
|
||||
After installation, verify everything is working:
|
||||
|
||||
1. **Check agents are loaded:**
|
||||
```bash
|
||||
ls -la ~/.claude/agents/*/
|
||||
```
|
||||
|
||||
2. **Check MCP tools:**
|
||||
- Start a Claude Code session
|
||||
- The tools should be available automatically
|
||||
- Check for `mcp__zai-mcp-server__*` tools
|
||||
- Check for `mcp__web-search-prime__webSearchPrime`
|
||||
- Check for `mcp__web-reader__webReader`
|
||||
- Check for `mcp__zread__*` tools
|
||||
|
||||
3. **Check plugins:**
|
||||
```bash
|
||||
cat ~/.claude/plugins/installed_plugins.json
|
||||
```
|
||||
|
||||
4. **Test a custom agent:**
|
||||
```
|
||||
Use the Task tool with subagent_type="tiktok-strategist"
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### API Credentials
|
||||
|
||||
Edit `~/.claude/settings.json` and add your credentials:
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
"ANTHROPIC_AUTH_TOKEN": "your-api-token-here",
|
||||
"ANTHROPIC_BASE_URL": "https://api.anthropic.com"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Permissions
|
||||
|
||||
Edit `~/.claude/settings.local.json` to customize allowed commands.
|
||||
|
||||
### Agent Customization
|
||||
|
||||
Each agent is defined in a `.md` file in `~/.claude/agents/<category>/`. Edit these files to customize agent behavior.
|
||||
|
||||
### MCP Server Configuration
|
||||
|
||||
MCP servers are configured through the `@z_ai/coding-helper` package. The preset MCP services include:
|
||||
|
||||
1. **zai-mcp-server** - Vision analysis (installed via npm/npx)
|
||||
2. **web-search-prime** - Web search (HTTP endpoint)
|
||||
3. **web-reader** - Web scraping (HTTP endpoint)
|
||||
4. **zread** - GitHub reader (HTTP endpoint)
|
||||
|
||||
## Key Features
|
||||
|
||||
### 6-Day Development Cycle Focus
|
||||
|
||||
Many agents are optimized for rapid 6-day development sprints:
|
||||
- **sprint-prioritizer** - Plan sprints
|
||||
- **rapid-prototyper** - Quick MVPs
|
||||
- **project-shipper** - Launch coordination
|
||||
- **studio-producer** - Resource management
|
||||
|
||||
### Automatic Quality Assurance
|
||||
|
||||
Certain agents trigger automatically:
|
||||
- **test-writer-fixer** - Auto-runs after code changes
|
||||
- **whimsy-injector** - Auto-triggers after UI changes
|
||||
|
||||
### Viral Marketing Focus
|
||||
|
||||
Multiple agents for app growth:
|
||||
- **tiktok-strategist** - TikTok-specific strategies
|
||||
- **trend-researcher** - Identifies viral trends
|
||||
- **growth-hacker** - Growth strategies
|
||||
|
||||
### Studio Production Workflow
|
||||
|
||||
Agents for team coordination:
|
||||
- **studio-producer** - Cross-team coordination
|
||||
- **studio-coach** - Performance coaching
|
||||
- **project-shipper** - Launch management
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### MCP Tools Not Working
|
||||
|
||||
1. Check npm packages are installed:
|
||||
```bash
|
||||
npm list -g @z_ai/mcp-server @z_ai/coding-helper
|
||||
```
|
||||
|
||||
2. Verify settings.json has correct configuration
|
||||
|
||||
3. Check Claude Code is using the latest version
|
||||
|
||||
### Agents Not Showing
|
||||
|
||||
1. Verify agent files exist in `~/.claude/agents/`
|
||||
2. Check file permissions
|
||||
3. Restart Claude Code completely
|
||||
|
||||
### Plugin Issues
|
||||
|
||||
1. Check `~/.claude/plugins/installed_plugins.json`
|
||||
2. Verify plugin cache exists
|
||||
3. Re-run installation script
|
||||
|
||||
## Architecture
|
||||
|
||||
### How Custom Agents Work
|
||||
|
||||
Each agent is a markdown file with:
|
||||
- Name and description
|
||||
- System prompt/instructions
|
||||
- Tool access permissions
|
||||
- Trigger conditions
|
||||
|
||||
Agents are invoked via the Task tool:
|
||||
```
|
||||
Task(subagent_type="tiktok-strategist", prompt="...")
|
||||
```
|
||||
|
||||
### How MCP Tools Work
|
||||
|
||||
MCP tools are registered via Model Context Protocol servers:
|
||||
1. Server is defined in `@z_ai/coding-helper`
|
||||
2. Server starts (stdio or HTTP)
|
||||
3. Claude Code discovers available tools
|
||||
4. Tools are invoked with parameters
|
||||
5. Results return to Claude
|
||||
|
||||
### How Plugins Work
|
||||
|
||||
Plugins are npm packages with:
|
||||
- `plugin.json` - Metadata
|
||||
- `skills/` - Skill definitions
|
||||
- `hooks/` - Event hooks
|
||||
- `.mcp.json` - MCP server config (optional)
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
### Creating Custom Agents
|
||||
|
||||
1. Create a new `.md` file in appropriate category
|
||||
2. Follow existing agent structure
|
||||
3. Restart Claude Code
|
||||
4. Use via Task tool
|
||||
|
||||
### Adding New MCP Tools
|
||||
|
||||
1. Install MCP server: `npm install -g <mcp-package>`
|
||||
2. Configure in settings or via `@z_ai/coding-helper`
|
||||
3. Restart Claude Code
|
||||
4. Tools become available automatically
|
||||
|
||||
### Creating Custom Skills
|
||||
|
||||
1. Create plugin structure
|
||||
2. Add skill definitions
|
||||
3. Register in `installed_plugins.json`
|
||||
4. Invoke via Skill tool
|
||||
|
||||
## Version Information
|
||||
|
||||
- **Package Version:** 1.0.0
|
||||
- **Claude Code Compatible:** Latest (2025+)
|
||||
- **Node.js Required:** 14+
|
||||
- **Platform:** Linux, macOS, WSL2
|
||||
|
||||
## Support and Contributions
|
||||
|
||||
For issues, questions, or contributions:
|
||||
1. Check existing documentation
|
||||
2. Review agent definitions for examples
|
||||
3. Test with simple tasks first
|
||||
4. Enable debug mode if needed
|
||||
|
||||
## License
|
||||
|
||||
These customizations are provided as-is for use with Claude Code.
|
||||
|
||||
## Changelog
|
||||
|
||||
### Version 1.0.0 (2025-01-15)
|
||||
- Initial release
|
||||
- 40+ custom agents across 8 categories
|
||||
- 4 MCP tool integrations
|
||||
- 2 custom skills
|
||||
- Automated installation scripts
|
||||
- Complete documentation
|
||||
|
||||
---
|
||||
|
||||
**Generated by Claude Code Customizations Package**
|
||||
**Last Updated:** 2025-01-15
|
||||
95
DNS_FIX_GUIDE.md
Normal file
95
DNS_FIX_GUIDE.md
Normal file
@@ -0,0 +1,95 @@
|
||||
# How to Fix DNS for vibecodeshow.com
|
||||
|
||||
## The Problem
|
||||
Your browser shows **ERR_NAME_NOT_RESOLVED** because DNS records are NOT configured at your domain registrar.
|
||||
|
||||
## What This Means
|
||||
- ✅ Server is ready and working
|
||||
- ✅ SSL certificate is installed
|
||||
- ✅ Site works: **https://95.216.124.237**
|
||||
- ❌ Domain DNS is NOT set up
|
||||
|
||||
## What You Need To Do
|
||||
|
||||
### Step 1: Go to Your Domain Registrar
|
||||
Visit the website where you bought **vibecodeshow.com**:
|
||||
- Namecheap → https://ap.www.namecheap.com/
|
||||
- GoDaddy → https://dcc.godaddy.com/manage/dns
|
||||
- Cloudflare → https://dash.cloudflare.com/
|
||||
- Google Domains → https://domains.google.com/
|
||||
- Or your registrar
|
||||
|
||||
### Step 2: Find DNS Settings
|
||||
Look for:
|
||||
- "DNS Management"
|
||||
- "DNS Settings"
|
||||
- "Advanced DNS"
|
||||
- "Manage DNS"
|
||||
|
||||
### Step 3: Add DNS Records
|
||||
|
||||
Click "Add Record" or "Add New Record":
|
||||
|
||||
| Type | Name/Host | Value/Points |
|
||||
|------|-----------|-------------|
|
||||
| A | vibecodeshow.com | 95.216.124.237 |
|
||||
| A | www | 95.216.124.237 |
|
||||
|
||||
**Important:**
|
||||
- **Type:** Select "A" record
|
||||
- **Name/Host:** Enter "vibecodeshow.com" (or "@" on some registrars)
|
||||
- **Value/Points:** Enter the IP address: `95.216.124.237`
|
||||
|
||||
### Step 4: Save
|
||||
Click "Save", "Apply", or "Save Changes"
|
||||
|
||||
### Step 5: Wait
|
||||
DNS takes 1-48 hours to propagate (usually 1-4 hours)
|
||||
|
||||
### Step 6: Test
|
||||
1. Go to: https://www.whatsmydns.net/
|
||||
2. Enter: vibecodeshow.com
|
||||
3. Should show: **95.216.124.237** (green)
|
||||
|
||||
### Step 7: Visit Your Site
|
||||
Open: https://vibecodeshow.com
|
||||
|
||||
## Common Mistakes
|
||||
|
||||
❌ **Don't** use CNAME records (use A records)
|
||||
❌ **Don't** forget the www subdomain
|
||||
❌ **Don't** add anything after the IP address
|
||||
❌ **Don't** use other DNS providers if you bought from Namecheap/GoDaddy
|
||||
|
||||
## Verify It Works
|
||||
|
||||
Test your site:
|
||||
```
|
||||
https://vibecodeshow.com
|
||||
https://www.vibecodeshow.com
|
||||
```
|
||||
|
||||
Both should show your site with green lock!
|
||||
|
||||
## Test Your Site Right Now
|
||||
Your site is already working via IP:
|
||||
```
|
||||
https://95.216.124.237
|
||||
```
|
||||
|
||||
Open this URL to see your "Vibe Code Show" site!
|
||||
|
||||
## If You Need Help
|
||||
|
||||
1. Tell me your domain registrar (where you bought the domain)
|
||||
2. I can give you specific instructions for that registrar
|
||||
|
||||
## Summary
|
||||
|
||||
1. Go to your domain registrar
|
||||
2. Find DNS settings
|
||||
3. Add A records pointing to 95.216.124.237
|
||||
4. Wait 1-48 hours
|
||||
5. Visit: https://vibecodeshow.com
|
||||
|
||||
That's it! 🎉
|
||||
353
FINAL-SETUP-GUIDE.md
Normal file
353
FINAL-SETUP-GUIDE.md
Normal file
@@ -0,0 +1,353 @@
|
||||
# Claude Code Customizations - Complete Setup Guide
|
||||
|
||||
## 📦 All Scripts Created
|
||||
|
||||
| Script | Size | Description |
|
||||
|--------|------|-------------|
|
||||
| **interactive-install-claude.sh** | 28KB | ⭐ **NEW** - Interactive step-by-step installer |
|
||||
| claude-setup-manager.sh | 11KB | Interactive menu manager |
|
||||
| create-complete-package.sh | 16KB | Create full distributable package |
|
||||
| install-claude-customizations.sh | 13KB | Automated installer (original) |
|
||||
| export-claude-customizations.sh | 6.5KB | Export/backup customizations |
|
||||
| verify-claude-setup.sh | 9.2KB | Verify installation |
|
||||
|
||||
## 🚀 Quick Start - Choose Your Method
|
||||
|
||||
### Method 1: Interactive Installer (Recommended) ⭐
|
||||
|
||||
The easiest way to install - guides you through each step:
|
||||
|
||||
```bash
|
||||
./interactive-install-claude.sh
|
||||
```
|
||||
|
||||
**Features:**
|
||||
- ✅ Choose model provider (Anthropic or Z.AI)
|
||||
- ✅ Select which agent categories to install
|
||||
- ✅ Choose which MCP tools to install
|
||||
- ✅ Select plugins and hooks
|
||||
- ✅ **Installs Claude Code if not present**
|
||||
- ✅ Launches Claude Code when done
|
||||
|
||||
### Method 2: Menu Manager
|
||||
|
||||
```bash
|
||||
./claude-setup-manager.sh
|
||||
```
|
||||
|
||||
Provides an interactive menu for all operations.
|
||||
|
||||
### Method 3: Package Distribution
|
||||
|
||||
For distributing to other machines:
|
||||
|
||||
```bash
|
||||
# On source machine - create package
|
||||
./create-complete-package.sh
|
||||
|
||||
# On target machine - extract and run
|
||||
tar -xzf claude-customizations-complete-*.tar.gz
|
||||
cd claude-complete-package
|
||||
./install.sh
|
||||
./verify.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📋 What Gets Installed
|
||||
|
||||
### Step-by-Step Selection
|
||||
|
||||
The interactive installer guides you through:
|
||||
|
||||
#### **Step 1: Model Provider**
|
||||
- Anthropic Claude (official) - Get API key from https://console.anthropic.com/
|
||||
- Z.AI / GLM Coding Plan - Get API key from https://open.bigmodel.cn/usercenter/apikeys
|
||||
|
||||
The script will prompt for your API key with helpful information about where to get it based on your choice.
|
||||
|
||||
#### **Step 2: Agent Categories** (40+ agents)
|
||||
- Engineering (7): AI engineer, frontend/backend dev, DevOps, mobile, rapid prototyper, test writer
|
||||
- Marketing (7): TikTok strategist, growth hacker, content creator, Instagram/Reddit/Twitter
|
||||
- Product (3): Sprint prioritizer, feedback synthesizer, trend researcher
|
||||
- Studio Operations (8): Studio producer, project shipper, analytics, finance, legal, support, coach
|
||||
- Project Management (3): Experiment tracker, studio producer, project shipper
|
||||
- Testing (5): Test writer/fixer, API tester, performance benchmarker, workflow optimizer
|
||||
- Design (5): UI/UX designer, brand guardian, visual storyteller, whimsy injector
|
||||
- Bonus (2): Joker, studio coach
|
||||
|
||||
#### **Step 3: MCP Tools**
|
||||
- Vision Analysis (8 tools): images, videos, UI screenshots, errors, data viz, diagrams
|
||||
- Web Search: enhanced search with filtering
|
||||
- Web Reader: fetch URLs, convert to markdown
|
||||
- GitHub Reader: read repos, search docs
|
||||
|
||||
#### **Step 4: Plugins**
|
||||
- glm-plan-bug: Submit bug feedback
|
||||
- glm-plan-usage: Query usage stats
|
||||
|
||||
#### **Step 5: Hooks**
|
||||
- Custom automation hooks
|
||||
|
||||
#### **Step 6: Prerequisites Check**
|
||||
- Node.js, npm, python3, npx
|
||||
|
||||
#### **Step 7: Claude Code Installation** ⭐ NEW
|
||||
- Install via npm (recommended)
|
||||
- Install via curl (standalone binary)
|
||||
- Manual installation link
|
||||
- Skip if already installed
|
||||
|
||||
#### **Step 8: Backup**
|
||||
- Backs up existing configuration
|
||||
|
||||
#### **Step 9: Installation**
|
||||
- Creates directory structure
|
||||
- Installs selected agents
|
||||
- Configures settings
|
||||
- Installs MCP tools
|
||||
- Configures plugins
|
||||
|
||||
#### **Step 10: Summary & Launch**
|
||||
- Shows what was installed
|
||||
- Offers to launch Claude Code
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Installation Examples
|
||||
|
||||
### Example 1: Fresh Machine (No Claude Code)
|
||||
|
||||
```bash
|
||||
./interactive-install-claude.sh
|
||||
```
|
||||
|
||||
The script will:
|
||||
1. Detect Claude Code is not installed
|
||||
2. Offer to install it (npm, curl, or manual)
|
||||
3. Guide you through selecting components
|
||||
4. Install everything
|
||||
5. Launch Claude Code
|
||||
|
||||
### Example 2: Existing Claude Code
|
||||
|
||||
```bash
|
||||
./interactive-install-claude.sh
|
||||
```
|
||||
|
||||
The script will:
|
||||
1. Detect existing installation
|
||||
2. Offer to back up current config
|
||||
3. Guide you through selecting components
|
||||
4. Merge with existing setup
|
||||
5. Restart Claude Code
|
||||
|
||||
### Example 3: Minimal Installation
|
||||
|
||||
```bash
|
||||
./interactive-install-claude.sh
|
||||
```
|
||||
|
||||
Select:
|
||||
- Model: Anthropic
|
||||
- Agents: Engineering only
|
||||
- MCP Tools: Vision only
|
||||
- Plugins: No
|
||||
- Hooks: No
|
||||
|
||||
→ Gets you started with just the essentials
|
||||
|
||||
### Example 4: Full Installation
|
||||
|
||||
```bash
|
||||
./interactive-install-claude.sh
|
||||
```
|
||||
|
||||
Select:
|
||||
- Model: Z.AI
|
||||
- Agents: All categories
|
||||
- MCP Tools: All tools
|
||||
- Plugins: Yes
|
||||
- Hooks: Yes
|
||||
|
||||
→ Complete setup with all features
|
||||
|
||||
---
|
||||
|
||||
## 📁 File Locations
|
||||
|
||||
All scripts are in: `/home/uroma/`
|
||||
|
||||
```
|
||||
/home/uroma/
|
||||
├── interactive-install-claude.sh ⭐ NEW - Main installer
|
||||
├── claude-setup-manager.sh - Menu manager
|
||||
├── create-complete-package.sh - Package creator
|
||||
├── install-claude-customizations.sh - Original installer
|
||||
├── export-claude-customizations.sh - Export tool
|
||||
├── verify-claude-setup.sh - Verification
|
||||
├── CLAUDE-CUSTOMIZATIONS-README.md - Feature docs
|
||||
├── SCRIPTS-GUIDE.md - Script usage
|
||||
└── FINAL-SETUP-GUIDE.md - This file
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Advanced Usage
|
||||
|
||||
### Create Custom Package
|
||||
|
||||
```bash
|
||||
# 1. Create package with your selections
|
||||
./interactive-install-claude.sh
|
||||
|
||||
# 2. Package up for distribution
|
||||
./create-complete-package.sh
|
||||
```
|
||||
|
||||
### Transfer Between Machines
|
||||
|
||||
```bash
|
||||
# On source machine
|
||||
./create-complete-package.sh
|
||||
scp claude-customizations-complete-*.tar.gz target:~/
|
||||
|
||||
# On target machine
|
||||
./interactive-install-claude.sh # Will install Claude Code if needed
|
||||
```
|
||||
|
||||
### Verify Installation
|
||||
|
||||
```bash
|
||||
./verify-claude-setup.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Troubleshooting
|
||||
|
||||
### Claude Code not found?
|
||||
→ Run `./interactive-install-claude.sh` - it will offer to install Claude Code
|
||||
|
||||
### Agents not showing?
|
||||
→ Run `./verify-claude-setup.sh` to check installation
|
||||
|
||||
### MCP tools not working?
|
||||
→ Make sure `@z_ai/mcp-server` is installed:
|
||||
```bash
|
||||
npm list -g @z_ai/mcp-server
|
||||
npm install -g @z_ai/mcp-server
|
||||
```
|
||||
|
||||
### Permission errors?
|
||||
→ Check `~/.claude/settings.local.json` for allowed commands
|
||||
|
||||
### Need to start over?
|
||||
```bash
|
||||
# Backup is saved at ~/.claude-backup-YYYYMMDD_HHMMSS
|
||||
rm -rf ~/.claude
|
||||
./interactive-install-claude.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📊 What Each Script Does
|
||||
|
||||
### interactive-install-claude.sh ⭐
|
||||
**NEW - Main Recommended Script**
|
||||
|
||||
- Step-by-step interactive installation
|
||||
- Choose model provider (Anthropic/Z.AI)
|
||||
- Select which components to install
|
||||
- Installs Claude Code if missing
|
||||
- Launches Claude Code when done
|
||||
|
||||
**Best for:** New installations, first-time setup
|
||||
|
||||
### claude-setup-manager.sh
|
||||
Interactive menu for:
|
||||
- Creating packages
|
||||
- Installing customizations
|
||||
- Exporting backups
|
||||
- Verifying setup
|
||||
- Viewing documentation
|
||||
- Cleaning backups
|
||||
|
||||
**Best for:** Ongoing management
|
||||
|
||||
### create-complete-package.sh
|
||||
Creates a complete package with:
|
||||
- All agent .md files
|
||||
- Plugin configurations
|
||||
- Settings templates
|
||||
- Self-contained install.sh
|
||||
- Verification script
|
||||
|
||||
**Best for:** Distributing to other machines
|
||||
|
||||
### install-claude-customizations.sh
|
||||
Original automated installer:
|
||||
- Creates directory structure
|
||||
- Installs agents
|
||||
- Configures settings
|
||||
- Installs MCP tools
|
||||
- Sets up plugins
|
||||
|
||||
**Best for:** Automated setups, scripting
|
||||
|
||||
### export-claude-customizations.sh
|
||||
Exports existing customizations:
|
||||
- Copies agent definitions
|
||||
- Exports plugin configs
|
||||
- Creates settings template
|
||||
- Packages into .tar.gz
|
||||
|
||||
**Best for:** Backups, transfers
|
||||
|
||||
### verify-claude-setup.sh
|
||||
Verifies installation:
|
||||
- Checks directories
|
||||
- Counts agents
|
||||
- Validates settings
|
||||
- Tests MCP tools
|
||||
- Checks plugins
|
||||
|
||||
**Best for:** Troubleshooting
|
||||
|
||||
---
|
||||
|
||||
## 🎓 Quick Reference
|
||||
|
||||
### To install everything:
|
||||
```bash
|
||||
./interactive-install-claude.sh
|
||||
```
|
||||
|
||||
### To create distribution package:
|
||||
```bash
|
||||
./create-complete-package.sh
|
||||
```
|
||||
|
||||
### To verify installation:
|
||||
```bash
|
||||
./verify-claude-setup.sh
|
||||
```
|
||||
|
||||
### To manage existing setup:
|
||||
```bash
|
||||
./claude-setup-manager.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📞 Support
|
||||
|
||||
For detailed documentation:
|
||||
- `CLAUDE-CUSTOMIZATIONS-README.md` - Complete feature docs
|
||||
- `SCRIPTS-GUIDE.md` - Script usage guide
|
||||
|
||||
---
|
||||
|
||||
**Version:** 2.0.0
|
||||
**Last Updated:** 2025-01-15
|
||||
**What's New:** Interactive installer with Claude Code installation support
|
||||
38
README.md
Normal file
38
README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# Claude Code Customization Suite
|
||||
|
||||
40+ specialized AI agents, MCP tools, and enterprise-grade automation scripts for Claude Code.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
# Download and run the interactive installer
|
||||
curl -JO https://github.rommark.dev/rommark/claude-code-customization-suite/raw/main/interactive-install-claude.sh
|
||||
chmod +x interactive-install-claude.sh
|
||||
./interactive-install-claude.sh
|
||||
```
|
||||
|
||||
## What's Included
|
||||
|
||||
- **40+ Custom Agents** across 8 categories
|
||||
- **15+ MCP Tools** for vision, search, and GitHub integration
|
||||
- **Auto-Triggering** test writer and UI enhancement agents
|
||||
- **Interactive Installation** with model selection (Anthropic/Z.AI)
|
||||
- **One-Click Setup** with comprehensive verification
|
||||
|
||||
## Installation Scripts
|
||||
|
||||
- `interactive-install-claude.sh` - Full interactive installer (recommended)
|
||||
- `claude-setup-manager.sh` - Menu-driven setup manager
|
||||
- `create-complete-package.sh` - Create distributable packages
|
||||
- `verify-claude-setup.sh` - Verify your installation
|
||||
- `export-claude-customizations.sh` - Export existing customizations
|
||||
|
||||
## Documentation
|
||||
|
||||
- `CLAUDE-CUSTOMIZATIONS-README.md` - Complete feature documentation
|
||||
- `FINAL-SETUP-GUIDE.md` - Detailed setup instructions
|
||||
- `SCRIPTS-GUIDE.md` - Script usage guide
|
||||
|
||||
## License
|
||||
|
||||
MIT License - Feel free to use and modify for your needs.
|
||||
295
SCRIPTS-GUIDE.md
Normal file
295
SCRIPTS-GUIDE.md
Normal file
@@ -0,0 +1,295 @@
|
||||
# Claude Code Customizations - Scripts Guide
|
||||
|
||||
This guide explains all the automated scripts created for managing Claude Code customizations.
|
||||
|
||||
## Available Scripts
|
||||
|
||||
### 1. `install-claude-customizations.sh` 📥
|
||||
|
||||
**Purpose**: Automated installer for setting up Claude Code customizations on a new machine.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
./install-claude-customizations.sh
|
||||
```
|
||||
|
||||
**What it does**:
|
||||
- Checks prerequisites (Node.js, npm, python3, curl)
|
||||
- Creates directory structure (~/.claude/agents/, plugins/, etc.)
|
||||
- Configures settings.json and settings.local.json
|
||||
- Installs MCP tools (@z_ai/mcp-server, @z_ai/coding-helper)
|
||||
- Sets up plugin configurations
|
||||
- Creates agent directory structure (you must copy agent files separately)
|
||||
|
||||
**Options**:
|
||||
- `--skip-agents` - Skip agent file copying (if already present)
|
||||
- `--help` - Show help message
|
||||
|
||||
**Best for**: Fresh installation on a new machine when you have access to agent files from another source.
|
||||
|
||||
---
|
||||
|
||||
### 2. `export-claude-customizations.sh` 📦
|
||||
|
||||
**Purpose**: Export/pack existing customizations for transfer to another machine.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
./export-claude-customizations.sh
|
||||
```
|
||||
|
||||
**What it does**:
|
||||
- Copies all agent definitions from ~/.claude/agents/
|
||||
- Exports plugin configurations
|
||||
- Creates settings template (without sensitive API tokens)
|
||||
- Exports hooks if present
|
||||
- Creates README and MANIFEST
|
||||
- Packages everything into a .tar.gz archive
|
||||
|
||||
**Output**:
|
||||
- `claude-customizations-YYYYMMDD_HHMMSS.tar.gz` - Compressed archive
|
||||
- `claude-customizations-export/` - Unpacked directory (optional cleanup)
|
||||
|
||||
**Best for**: Backing up your customizations or transferring to another machine.
|
||||
|
||||
---
|
||||
|
||||
### 3. `create-complete-package.sh` 🎁
|
||||
|
||||
**Purpose**: Creates a complete, distributable package with ALL agent files included.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
./create-complete-package.sh
|
||||
```
|
||||
|
||||
**What it does**:
|
||||
- Copies ALL agent files from current machine
|
||||
- Copies plugin configurations
|
||||
- Creates settings templates
|
||||
- Copies hooks
|
||||
- Generates install.sh script (self-contained installer)
|
||||
- Generates verify.sh script
|
||||
- Creates comprehensive README
|
||||
- Packages everything into .tar.gz archive
|
||||
|
||||
**Output**:
|
||||
- `claude-customizations-complete-YYYYMMDD_HHMMSS.tar.gz` - Complete package
|
||||
- `claude-complete-package/` - Unpacked directory with:
|
||||
- `agents/` - All agent .md files
|
||||
- `plugins/` - Plugin configurations
|
||||
- `config/` - Settings templates
|
||||
- `install.sh` - Automated installer
|
||||
- `verify.sh` - Verification script
|
||||
- `README.md` - Package documentation
|
||||
- `MANIFEST.json` - Package metadata
|
||||
|
||||
**Best for**: Creating a complete, ready-to-distribute package that includes everything.
|
||||
|
||||
---
|
||||
|
||||
### 4. `verify-claude-setup.sh` ✅
|
||||
|
||||
**Purpose**: Verify that customizations are properly installed.
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
./verify-claude-setup.sh
|
||||
```
|
||||
|
||||
**What it checks**:
|
||||
- Directory structure (Claude, agents, plugins)
|
||||
- Agent categories (8 categories)
|
||||
- Configuration files (settings.json, etc.)
|
||||
- MCP tools availability (npx, @z_ai packages)
|
||||
- Plugin registrations (glm-plan-bug, glm-plan-usage)
|
||||
- Critical agent files exist and have content
|
||||
- Settings file validity (JSON format, API token configured)
|
||||
|
||||
**Output**:
|
||||
- Pass/Fail status for each check
|
||||
- Summary with totals
|
||||
- Exit code 0 if all pass, 1 if any fail
|
||||
|
||||
**Best for**: Troubleshooting installation issues or confirming setup is complete.
|
||||
|
||||
---
|
||||
|
||||
## Workflow Examples
|
||||
|
||||
### Scenario 1: Transfer to New Machine
|
||||
|
||||
**On source machine**:
|
||||
```bash
|
||||
# Create complete package
|
||||
./create-complete-package.sh
|
||||
|
||||
# Transfer archive
|
||||
scp claude-customizations-complete-*.tar.gz user@new-machine:~/
|
||||
```
|
||||
|
||||
**On new machine**:
|
||||
```bash
|
||||
# Extract
|
||||
tar -xzf claude-customifications-complete-*.tar.gz
|
||||
cd claude-complete-package
|
||||
|
||||
# Install
|
||||
./install.sh
|
||||
|
||||
# Verify
|
||||
./verify.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Scenario 2: Fresh Install Without Agent Files
|
||||
|
||||
```bash
|
||||
# Run installer (creates directory structure)
|
||||
./install-claude-customizations.sh
|
||||
|
||||
# Manually copy agent files
|
||||
scp -r user@source:~/.claude/agents/* ~/.claude/agents/
|
||||
|
||||
# Verify
|
||||
./verify-claude-setup.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Scenario 3: Backup Customizations
|
||||
|
||||
```bash
|
||||
# Export current setup
|
||||
./export-claude-customizations.sh
|
||||
|
||||
# Store archive safely
|
||||
mv claude-customizations-*.tar.gz ~/backups/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Scenario 4: Create Distribution Package
|
||||
|
||||
```bash
|
||||
# Create complete package for distribution
|
||||
./create-complete-package.sh
|
||||
|
||||
# Upload to share location
|
||||
# (GitHub Releases, Google Drive, etc.)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Script Comparison
|
||||
|
||||
| Script | Creates Package | Installs | Verifies | Includes Agents |
|
||||
|--------|----------------|----------|----------|-----------------|
|
||||
| install-claude-customizations.sh | ❌ | ✅ | ❌ | ❌ (copies structure only) |
|
||||
| export-claude-customizations.sh | ✅ | ❌ | ❌ | ✅ |
|
||||
| create-complete-package.sh | ✅ | ✅ (via install.sh) | ✅ (via verify.sh) | ✅ |
|
||||
| verify-claude-setup.sh | ❌ | ❌ | ✅ | N/A |
|
||||
|
||||
---
|
||||
|
||||
## Quick Reference
|
||||
|
||||
### To Install Everything:
|
||||
```bash
|
||||
./create-complete-package.sh # On machine with customizations
|
||||
# Transfer to new machine, then:
|
||||
./install.sh # Included in package
|
||||
./verify.sh # Included in package
|
||||
```
|
||||
|
||||
### To Just Backup:
|
||||
```bash
|
||||
./export-claude-customizations.sh
|
||||
```
|
||||
|
||||
### To Just Verify:
|
||||
```bash
|
||||
./verify-claude-setup.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## File Locations
|
||||
|
||||
All scripts are located in: `/home/uroma/`
|
||||
|
||||
- `install-claude-customizations.sh`
|
||||
- `export-claude-customizations.sh`
|
||||
- `create-complete-package.sh`
|
||||
- `verify-claude-setup.sh`
|
||||
|
||||
Documentation:
|
||||
- `CLAUDE-CUSTOMIZATIONS-README.md` - Complete feature documentation
|
||||
- `SCRIPTS-GUIDE.md` - This file
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Script not executable?
|
||||
```bash
|
||||
chmod +x /path/to/script.sh
|
||||
```
|
||||
|
||||
### Permission denied?
|
||||
```bash
|
||||
bash /path/to/script.sh
|
||||
```
|
||||
|
||||
### npx not found?
|
||||
```bash
|
||||
# Install Node.js from https://nodejs.org/
|
||||
# Or use nvm: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
|
||||
```
|
||||
|
||||
### Agent files not copying?
|
||||
- Check source directory exists: `ls ~/.claude/agents/`
|
||||
- Check permissions: `ls -la ~/.claude/agents/`
|
||||
- Verify script has read permissions
|
||||
|
||||
---
|
||||
|
||||
## Customization
|
||||
|
||||
### Modify Agent Categories
|
||||
|
||||
Edit the `CATEGORIES` array in scripts:
|
||||
```bash
|
||||
CATEGORIES=("engineering" "marketing" "product" "studio-operations" "project-management" "testing" "design" "bonus")
|
||||
```
|
||||
|
||||
### Add Custom MCP Tools
|
||||
|
||||
Edit the MCP installation section in install scripts:
|
||||
```bash
|
||||
npm install -g your-custom-mcp-server
|
||||
```
|
||||
|
||||
### Change Package Format
|
||||
|
||||
Edit the tar command in export scripts:
|
||||
```bash
|
||||
# For zip instead:
|
||||
zip -r package.zip claude-complete-package/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Support
|
||||
|
||||
For issues with:
|
||||
- **Scripts**: Check script permissions and dependencies
|
||||
- **Installation**: Run verify script to identify issues
|
||||
- **Agent behavior**: Check agent .md files in ~/.claude/agents/
|
||||
- **MCP tools**: Verify npm packages installed with `npm list -g`
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: 2025-01-15
|
||||
**Version**: 1.0.0
|
||||
329
claude-setup-manager.sh
Executable file
329
claude-setup-manager.sh
Executable file
@@ -0,0 +1,329 @@
|
||||
#!/usr/bin/env bash
|
||||
################################################################################
|
||||
# Claude Code Customizations - Master Control Script
|
||||
# Provides an interactive menu for all setup operations
|
||||
################################################################################
|
||||
|
||||
# Colors
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
CYAN='\033[0;36m'
|
||||
BOLD='\033[1m'
|
||||
NC='\033[0m'
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# Script paths
|
||||
INSTALL_SCRIPT="$SCRIPT_DIR/install-claude-customizations.sh"
|
||||
EXPORT_SCRIPT="$SCRIPT_DIR/export-claude-customizations.sh"
|
||||
PACKAGE_SCRIPT="$SCRIPT_DIR/create-complete-package.sh"
|
||||
VERIFY_SCRIPT="$SCRIPT_DIR/verify-claude-setup.sh"
|
||||
|
||||
# Helper functions
|
||||
print_header() {
|
||||
clear
|
||||
echo -e "${CYAN}╔══════════════════════════════════════════════════════════════════╗${NC}"
|
||||
echo -e "${CYAN}║${NC} ${BOLD}Claude Code Customizations - Setup Manager${NC} ${CYAN}║${NC}"
|
||||
echo -e "${CYAN}╚══════════════════════════════════════════════════════════════════╝${NC}"
|
||||
echo ""
|
||||
}
|
||||
|
||||
print_menu() {
|
||||
print_header
|
||||
echo -e "${BOLD}Main Menu:${NC}"
|
||||
echo ""
|
||||
echo -e " ${GREEN}1${NC}) 📦 Create Complete Package (recommended for distribution)"
|
||||
echo -e " ${GREEN}2${NC}) 📥 Install Customizations (on new machine)"
|
||||
echo -e " ${GREEN}3${NC}) 📤 Export Customizations (backup/transfer)"
|
||||
echo -e " ${GREEN}4${NC}) ✅ Verify Installation"
|
||||
echo -e " ${GREEN}5${NC}) 📋 Show Package Contents"
|
||||
echo -e " ${GREEN}6${NC}) 📖 View Documentation"
|
||||
echo -e " ${GREEN}7${NC}) 🧹 Clean Backup Files"
|
||||
echo ""
|
||||
echo -e " ${YELLOW}0${NC}) 🚪 Exit"
|
||||
echo ""
|
||||
echo -ne "${CYAN}Select an option: ${NC}"
|
||||
}
|
||||
|
||||
check_script() {
|
||||
local script="$1"
|
||||
local name="$2"
|
||||
|
||||
if [ ! -f "$script" ]; then
|
||||
echo -e "${RED}✗ Error: $name not found at $script${NC}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -x "$script" ]; then
|
||||
echo -e "${YELLOW}⚠ Making $name executable...${NC}"
|
||||
chmod +x "$script"
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
create_package() {
|
||||
print_header
|
||||
echo -e "${BOLD}Create Complete Package${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
echo "This will create a complete package with all agents, plugins,"
|
||||
echo "and configurations ready for distribution."
|
||||
echo ""
|
||||
read -p "Continue? (y/N): " confirm
|
||||
|
||||
if [[ ! "$confirm" =~ ^[Yy]$ ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if check_script "$PACKAGE_SCRIPT" "Package Script"; then
|
||||
echo ""
|
||||
bash "$PACKAGE_SCRIPT"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
read -p "Press Enter to continue..."
|
||||
}
|
||||
|
||||
install_customizations() {
|
||||
print_header
|
||||
echo -e "${BOLD}Install Customizations${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
echo "This will install Claude Code customizations on this machine."
|
||||
echo ""
|
||||
echo "Note: If you're creating a complete package, use option 1 instead."
|
||||
echo ""
|
||||
|
||||
if check_script "$INSTALL_SCRIPT" "Install Script"; then
|
||||
echo ""
|
||||
bash "$INSTALL_SCRIPT"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
read -p "Press Enter to continue..."
|
||||
}
|
||||
|
||||
export_customizations() {
|
||||
print_header
|
||||
echo -e "${BOLD}Export Customizations${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
echo "This will export your current customizations to a package"
|
||||
echo "for backup or transfer to another machine."
|
||||
echo ""
|
||||
read -p "Continue? (y/N): " confirm
|
||||
|
||||
if [[ ! "$confirm" =~ ^[Yy]$ ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if check_script "$EXPORT_SCRIPT" "Export Script"; then
|
||||
echo ""
|
||||
bash "$EXPORT_SCRIPT"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
read -p "Press Enter to continue..."
|
||||
}
|
||||
|
||||
verify_installation() {
|
||||
print_header
|
||||
|
||||
if check_script "$VERIFY_SCRIPT" "Verify Script"; then
|
||||
bash "$VERIFY_SCRIPT"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
read -p "Press Enter to continue..."
|
||||
}
|
||||
|
||||
show_contents() {
|
||||
print_header
|
||||
echo -e "${BOLD}Package Contents${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
|
||||
CLAUDE_DIR="$HOME/.claude"
|
||||
|
||||
if [ ! -d "$CLAUDE_DIR" ]; then
|
||||
echo -e "${RED}No Claude Code directory found at $CLAUDE_DIR${NC}"
|
||||
echo ""
|
||||
read -p "Press Enter to continue..."
|
||||
return
|
||||
fi
|
||||
|
||||
echo -e "${CYAN}Agent Categories:${NC}"
|
||||
for category in engineering marketing product studio-operations project-management testing design bonus; do
|
||||
if [ -d "$CLAUDE_DIR/agents/$category" ]; then
|
||||
count=$(ls -1 "$CLAUDE_DIR/agents/$category"/*.md 2>/dev/null | wc -l)
|
||||
if [ $count -gt 0 ]; then
|
||||
printf " %-25s %2d agents\n" "$category" "$count"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo -e "${CYAN}Configuration Files:${NC}"
|
||||
echo " settings.json"
|
||||
echo " settings.local.json"
|
||||
echo " plugins/installed_plugins.json"
|
||||
|
||||
echo ""
|
||||
echo -e "${CYAN}MCP Tools:${NC}"
|
||||
echo " • zai-mcp-server (vision analysis)"
|
||||
echo " • web-search-prime"
|
||||
echo " • web-reader"
|
||||
echo " • zread (GitHub)"
|
||||
|
||||
echo ""
|
||||
echo -e "${CYAN}Skills:${NC}"
|
||||
echo " • glm-plan-bug:case-feedback"
|
||||
echo " • glm-plan-usage:usage-query"
|
||||
|
||||
echo ""
|
||||
read -p "Press Enter to continue..."
|
||||
}
|
||||
|
||||
view_documentation() {
|
||||
print_header
|
||||
echo -e "${BOLD}Documentation${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
|
||||
DOCS=(
|
||||
"SCRIPTS-GUIDE.md:Script usage guide"
|
||||
"CLAUDE-CUSTOMIZATIONS-README.md:Complete feature documentation"
|
||||
)
|
||||
|
||||
echo "Available documentation:"
|
||||
echo ""
|
||||
|
||||
for doc in "${DOCS[@]}"; do
|
||||
file="${doc%%:*}"
|
||||
desc="${doc##*:}"
|
||||
if [ -f "$SCRIPT_DIR/$file" ]; then
|
||||
echo -e " ${GREEN}✓${NC} $file"
|
||||
echo " $desc"
|
||||
else
|
||||
echo -e " ${RED}✗${NC} $file (not found)"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Would you like to view a document?"
|
||||
echo " 1) SCRIPTS-GUIDE.md"
|
||||
echo " 2) CLAUDE-CUSTOMIZATIONS-README.md"
|
||||
echo " 0) Back"
|
||||
echo ""
|
||||
read -p "Select: " doc_choice
|
||||
|
||||
case $doc_choice in
|
||||
1)
|
||||
if [ -f "$SCRIPT_DIR/SCRIPTS-GUIDE.md" ]; then
|
||||
less "$SCRIPT_DIR/SCRIPTS-GUIDE.md"
|
||||
fi
|
||||
;;
|
||||
2)
|
||||
if [ -f "$SCRIPT_DIR/CLAUDE-CUSTOMIZATIONS-README.md" ]; then
|
||||
less "$SCRIPT_DIR/CLAUDE-CUSTOMIZATIONS-README.md"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
clean_backups() {
|
||||
print_header
|
||||
echo -e "${BOLD}Clean Backup Files${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
|
||||
# Find backup directories
|
||||
BACKUPS=$(find "$HOME" -maxdepth 1 -name ".claude-backup-*" -type d 2>/dev/null)
|
||||
PACKAGES=$(find "$HOME" -maxdepth 1 -name "claude-customizations-*.tar.gz" -type f 2>/dev/null)
|
||||
EXPORT_DIRS=$(find "$HOME" -maxdepth 1 -name "claude-*-export" -type d 2>/dev/null)
|
||||
|
||||
BACKUP_COUNT=$(echo "$BACKUPS" | grep -c "^" || echo 0)
|
||||
PACKAGE_COUNT=$(echo "$PACKAGES" | grep -c "^" || echo 0)
|
||||
EXPORT_COUNT=$(echo "$EXPORT_DIRS" | grep -c "^" || echo 0)
|
||||
|
||||
echo "Found:"
|
||||
echo " • $BACKUP_COUNT backup directories"
|
||||
echo " • $PACKAGE_COUNT package archives"
|
||||
echo " • $EXPORT_COUNT export directories"
|
||||
echo ""
|
||||
|
||||
if [ $((BACKUP_COUNT + PACKAGE_COUNT + EXPORT_COUNT)) -eq 0 ]; then
|
||||
echo -e "${GREEN}No backup files to clean${NC}"
|
||||
echo ""
|
||||
read -p "Press Enter to continue..."
|
||||
return
|
||||
fi
|
||||
|
||||
read -p "Clean all backup files? (y/N): " confirm
|
||||
|
||||
if [[ ! "$confirm" =~ ^[Yy]$ ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Cleaning..."
|
||||
|
||||
if [ -n "$BACKUPS" ]; then
|
||||
echo "$BACKUPS" | while read -r backup; do
|
||||
echo " Removing: $backup"
|
||||
rm -rf "$backup"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "$PACKAGES" ]; then
|
||||
echo "$PACKAGES" | while read -r package; do
|
||||
echo " Removing: $package"
|
||||
rm -f "$package"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "$EXPORT_DIRS" ]; then
|
||||
echo "$EXPORT_DIRS" | while read -r export_dir; do
|
||||
echo " Removing: $export_dir"
|
||||
rm -rf "$export_dir"
|
||||
done
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo -e "${GREEN}✓ Cleanup complete${NC}"
|
||||
echo ""
|
||||
read -p "Press Enter to continue..."
|
||||
}
|
||||
|
||||
# Main loop
|
||||
main() {
|
||||
while true; do
|
||||
print_menu
|
||||
read -r choice
|
||||
echo ""
|
||||
|
||||
case $choice in
|
||||
1) create_package ;;
|
||||
2) install_customizations ;;
|
||||
3) export_customizations ;;
|
||||
4) verify_installation ;;
|
||||
5) show_contents ;;
|
||||
6) view_documentation ;;
|
||||
7) clean_backups ;;
|
||||
0)
|
||||
echo "Goodbye!"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo -e "${RED}Invalid option. Please try again.${NC}"
|
||||
sleep 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Run main function
|
||||
main
|
||||
212
export-claude-customizations.sh
Executable file
212
export-claude-customizations.sh
Executable file
@@ -0,0 +1,212 @@
|
||||
#!/usr/bin/env bash
|
||||
################################################################################
|
||||
# Claude Code Customizations Exporter
|
||||
# This script packages all customizations for transfer to another machine
|
||||
################################################################################
|
||||
|
||||
set -e
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
# Configuration
|
||||
CLAUDE_DIR="$HOME/.claude"
|
||||
EXPORT_DIR="$HOME/claude-customizations-export"
|
||||
EXPORT_FILE="$HOME/claude-customizations-$(date +%Y%m%d_%H%M%S).tar.gz"
|
||||
|
||||
log_info() {
|
||||
echo -e "${BLUE}[INFO]${NC} $1"
|
||||
}
|
||||
|
||||
log_success() {
|
||||
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
||||
}
|
||||
|
||||
log_warning() {
|
||||
echo -e "${YELLOW}[WARNING]${NC} $1"
|
||||
}
|
||||
|
||||
# Create export directory
|
||||
log_info "Creating export directory..."
|
||||
rm -rf "$EXPORT_DIR"
|
||||
mkdir -p "$EXPORT_DIR"
|
||||
|
||||
# Export agents
|
||||
log_info "Exporting custom agents..."
|
||||
mkdir -p "$EXPORT_DIR/agents"
|
||||
cp -r "$CLAUDE_DIR/agents/"* "$EXPORT_DIR/agents/" 2>/dev/null || true
|
||||
|
||||
# Export plugins configuration
|
||||
log_info "Exporting plugins configuration..."
|
||||
mkdir -p "$EXPORT_DIR/plugins"
|
||||
cp -r "$CLAUDE_DIR/plugins/cache/"* "$EXPORT_DIR/plugins/" 2>/dev/null || true
|
||||
cp "$CLAUDE_DIR/plugins/installed_plugins.json" "$EXPORT_DIR/plugins/" 2>/dev/null || true
|
||||
cp "$CLAUDE_DIR/plugins/known_marketplaces.json" "$EXPORT_DIR/plugins/" 2>/dev/null || true
|
||||
|
||||
# Export settings (without sensitive data)
|
||||
log_info "Exporting settings..."
|
||||
mkdir -p "$EXPORT_DIR/config"
|
||||
|
||||
# Export settings.local.json (permissions)
|
||||
cp "$CLAUDE_DIR/settings.local.json" "$EXPORT_DIR/config/" 2>/dev/null || true
|
||||
|
||||
# Create settings template (without actual API token)
|
||||
cat > "$EXPORT_DIR/config/settings-template.json" << EOF
|
||||
{
|
||||
"env": {
|
||||
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_TOKEN_HERE",
|
||||
"ANTHROPIC_BASE_URL": "https://api.anthropic.com",
|
||||
"API_TIMEOUT_MS": "3000000",
|
||||
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
|
||||
},
|
||||
"enabledPlugins": {
|
||||
"glm-plan-bug@zai-coding-plugins": true,
|
||||
"glm-plan-usage@zai-coding-plugins": true
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# Export hooks if present
|
||||
log_info "Exporting hooks..."
|
||||
if [ -d "$CLAUDE_DIR/hooks" ] && [ "$(ls -A $CLAUDE_DIR/hooks)" ]; then
|
||||
mkdir -p "$EXPORT_DIR/hooks"
|
||||
cp -r "$CLAUDE_DIR/hooks/"* "$EXPORT_DIR/hooks/"
|
||||
fi
|
||||
|
||||
# Create README
|
||||
log_info "Creating documentation..."
|
||||
cat > "$EXPORT_DIR/README.md" << 'EOF'
|
||||
# Claude Code Customizations Package
|
||||
|
||||
This package contains all customizations for Claude Code including custom agents, MCP tools configuration, and plugins.
|
||||
|
||||
## Contents
|
||||
|
||||
- `agents/` - Custom agent definitions organized by category
|
||||
- `plugins/` - Plugin configurations
|
||||
- `config/` - Settings files
|
||||
- `hooks/` - Custom hooks (if any)
|
||||
|
||||
## Installation
|
||||
|
||||
### Quick Install
|
||||
|
||||
Run the automated installer:
|
||||
|
||||
```bash
|
||||
bash install-claude-customizations.sh
|
||||
```
|
||||
|
||||
### Manual Install
|
||||
|
||||
1. **Copy agents:**
|
||||
```bash
|
||||
cp -r agents/* ~/.claude/agents/
|
||||
```
|
||||
|
||||
2. **Copy plugins:**
|
||||
```bash
|
||||
cp -r plugins/* ~/.claude/plugins/
|
||||
```
|
||||
|
||||
3. **Configure settings:**
|
||||
```bash
|
||||
cp config/settings.local.json ~/.claude/
|
||||
# Edit ~/.claude/settings.json and add your API token
|
||||
```
|
||||
|
||||
4. **Install MCP tools:**
|
||||
```bash
|
||||
npm install -g @z_ai/mcp-server @z_ai/coding-helper
|
||||
```
|
||||
|
||||
5. **Restart Claude Code**
|
||||
|
||||
## Agent Categories
|
||||
|
||||
- **Engineering** - AI engineer, backend architect, frontend developer, DevOps, mobile app builder
|
||||
- **Marketing** - TikTok strategist, growth hacker, content creator
|
||||
- **Product** - Sprint prioritizer, feedback synthesizer, trend researcher
|
||||
- **Studio Operations** - Studio producer, project shipper, analytics, finance
|
||||
- **Project Management** - Experiment tracker, studio coach
|
||||
- **Testing** - Test writer/fixer, API tester, performance benchmarker
|
||||
- **Design** - UI designer, UX researcher, brand guardian, whimsy injector
|
||||
- **Bonus** - Joker, studio coach
|
||||
|
||||
## MCP Tools Included
|
||||
|
||||
- **zai-mcp-server** - Vision analysis (images, videos, UI screenshots, error diagnosis)
|
||||
- **web-search-prime** - Enhanced web search with domain filtering
|
||||
- **web-reader** - Fetch URLs and convert to markdown
|
||||
- **zread** - GitHub repository reader
|
||||
|
||||
## Skills
|
||||
|
||||
- `glm-plan-bug:case-feedback` - Submit bug/issue feedback
|
||||
- `glm-plan-usage:usage-query` - Query account usage statistics
|
||||
|
||||
## Customization
|
||||
|
||||
Edit agent `.md` files in `~/.claude/agents/` to customize agent behavior.
|
||||
|
||||
## Support
|
||||
|
||||
For issues or questions, refer to the original source machine or Claude Code documentation.
|
||||
EOF
|
||||
|
||||
# Create manifest
|
||||
log_info "Creating package manifest..."
|
||||
cat > "$EXPORT_DIR/MANIFEST.json" << EOF
|
||||
{
|
||||
"package": "claude-code-customizations",
|
||||
"version": "1.0.0",
|
||||
"exported_at": "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)",
|
||||
"contents": {
|
||||
"agents": "$(ls -1 "$EXPORT_DIR/agents" | wc -l) categories",
|
||||
"plugins": "$(ls -1 "$EXPORT_DIR/plugins" 2>/dev/null | wc -l) items",
|
||||
"config_files": "$(ls -1 "$EXPORT_DIR/config" | wc -l) files"
|
||||
},
|
||||
"mcp_tools": [
|
||||
"zai-mcp-server (vision)",
|
||||
"web-search-prime",
|
||||
"web-reader",
|
||||
"zread"
|
||||
],
|
||||
"skills": [
|
||||
"glm-plan-bug:case-feedback",
|
||||
"glm-plan-usage:usage-query"
|
||||
]
|
||||
}
|
||||
EOF
|
||||
|
||||
# Create tarball
|
||||
log_info "Creating compressed archive..."
|
||||
tar -czf "$EXPORT_FILE" -C "$HOME" "$(basename "$EXPORT_DIR")"
|
||||
|
||||
# Get file size
|
||||
FILE_SIZE=$(du -h "$EXPORT_FILE" | cut -f1)
|
||||
|
||||
log_success "═══════════════════════════════════════════════════════════"
|
||||
log_success "Export completed successfully!"
|
||||
log_success "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
log_info "Export location: $EXPORT_FILE"
|
||||
log_info "Package size: $FILE_SIZE"
|
||||
log_info "Unpacked directory: $EXPORT_DIR"
|
||||
echo ""
|
||||
log_info "To transfer to another machine:"
|
||||
echo " 1. Copy the archive: scp $EXPORT_FILE user@target:~/"
|
||||
echo " 2. Extract: tar -xzf $(basename "$EXPORT_FILE")"
|
||||
echo " 3. Run: cd $(basename "$EXPORT_DIR") && bash install-claude-customizations.sh"
|
||||
echo ""
|
||||
|
||||
# Ask if user wants to keep unpacked directory
|
||||
read -p "Keep unpacked export directory? (y/N): " keep_unpacked
|
||||
if [[ ! "$keep_unpacked" =~ ^[Yy]$ ]]; then
|
||||
rm -rf "$EXPORT_DIR"
|
||||
log_info "Unpacked directory removed"
|
||||
fi
|
||||
396
install-claude-customizations.sh
Executable file
396
install-claude-customizations.sh
Executable file
@@ -0,0 +1,396 @@
|
||||
#!/usr/bin/env bash
|
||||
################################################################################
|
||||
# Claude Code Customizations Installer
|
||||
# This script automates the setup of custom agents, MCP tools, and plugins
|
||||
# for Claude Code on a new machine.
|
||||
################################################################################
|
||||
|
||||
set -e # Exit on error
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Configuration
|
||||
CLAUDE_DIR="$HOME/.claude"
|
||||
AGENTS_DIR="$CLAUDE_DIR/agents"
|
||||
PLUGINS_DIR="$CLAUDE_DIR/plugins"
|
||||
BACKUP_DIR="$HOME/.claude-backup-$(date +%Y%m%d_%H%M%S)"
|
||||
|
||||
################################################################################
|
||||
# Helper Functions
|
||||
################################################################################
|
||||
|
||||
log_info() {
|
||||
echo -e "${BLUE}[INFO]${NC} $1"
|
||||
}
|
||||
|
||||
log_success() {
|
||||
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
||||
}
|
||||
|
||||
log_warning() {
|
||||
echo -e "${YELLOW}[WARNING]${NC} $1"
|
||||
}
|
||||
|
||||
log_error() {
|
||||
echo -e "${RED}[ERROR]${NC} $1"
|
||||
}
|
||||
|
||||
check_command() {
|
||||
if ! command -v $1 &> /dev/null; then
|
||||
log_error "$1 is not installed. Please install it first."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
backup_file() {
|
||||
local file="$1"
|
||||
if [ -f "$file" ]; then
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
cp "$file" "$BACKUP_DIR/"
|
||||
log_info "Backed up $file to $BACKUP_DIR"
|
||||
fi
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Prerequisites Check
|
||||
################################################################################
|
||||
|
||||
check_prerequisites() {
|
||||
log_info "Checking prerequisites..."
|
||||
|
||||
check_command "node"
|
||||
check_command "npm"
|
||||
check_command "python3"
|
||||
check_command "curl"
|
||||
|
||||
# Check Node.js version (need 14+)
|
||||
NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
|
||||
if [ "$NODE_VERSION" -lt 14 ]; then
|
||||
log_error "Node.js version 14 or higher required. Current: $(node -v)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log_success "Prerequisites check passed"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Directory Structure Setup
|
||||
################################################################################
|
||||
|
||||
setup_directories() {
|
||||
log_info "Setting up directory structure..."
|
||||
|
||||
mkdir -p "$AGENTS_DIR"/{engineering,marketing,product,studio-operations,project-management,testing,design,bonus}
|
||||
|
||||
mkdir -p "$PLUGINS_DIR"/{cache,marketplaces}
|
||||
mkdir -p "$CLAUDE_DIR"/{hooks,debug,file-history,paste-cache,projects,session-env,shell-snapshots,todos}
|
||||
|
||||
log_success "Directory structure created"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Settings Configuration
|
||||
################################################################################
|
||||
|
||||
setup_settings() {
|
||||
log_info "Configuring Claude Code settings..."
|
||||
|
||||
local settings_file="$CLAUDE_DIR/settings.json"
|
||||
|
||||
backup_file "$settings_file"
|
||||
|
||||
# Prompt for API credentials
|
||||
read -p "Enter your ANTHROPIC_AUTH_TOKEN (or press Enter to skip): " API_TOKEN
|
||||
read -p "Enter your ANTHROPIC_BASE_URL (default: https://api.anthropic.com): " API_BASE
|
||||
API_BASE=${API_BASE:-https://api.anthropic.com}
|
||||
|
||||
# Create settings.json
|
||||
cat > "$settings_file" << EOF
|
||||
{
|
||||
"env": {
|
||||
"ANTHROPIC_AUTH_TOKEN": "${API_TOKEN}",
|
||||
"ANTHROPIC_BASE_URL": "${API_BASE}",
|
||||
"API_TIMEOUT_MS": "3000000",
|
||||
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
|
||||
},
|
||||
"enabledPlugins": {
|
||||
"glm-plan-bug@zai-coding-plugins": true,
|
||||
"glm-plan-usage@zai-coding-plugins": true
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# Create local settings for permissions
|
||||
local local_settings="$CLAUDE_DIR/settings.local.json"
|
||||
backup_file "$local_settings"
|
||||
|
||||
cat > "$local_settings" << EOF
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(npm install:*)",
|
||||
"Bash(npm run content:*)",
|
||||
"Bash(npm run build:*)",
|
||||
"Bash(grep:*)",
|
||||
"Bash(find:*)",
|
||||
"Bash(for:*)",
|
||||
"Bash(do sed:*)",
|
||||
"Bash(done)",
|
||||
"Bash(python3:*)",
|
||||
"Bash(while read f)",
|
||||
"Bash(do echo \\"\\$f%-* \\$f\\")",
|
||||
"Bash(ls:*)",
|
||||
"Bash(node:*)",
|
||||
"Bash(pm2 delete:*)",
|
||||
"Bash(pm2 start npm:*)",
|
||||
"Bash(pm2 save:*)"
|
||||
]
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
log_success "Settings configured"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MCP Services Installation
|
||||
################################################################################
|
||||
|
||||
install_mcp_services() {
|
||||
log_info "Installing MCP services..."
|
||||
|
||||
# Install @z_ai/mcp-server globally for vision tools
|
||||
log_info "Installing @z_ai/mcp-server (vision analysis tools)..."
|
||||
npm install -g @z_ai/mcp-server 2>/dev/null || {
|
||||
log_warning "Global install failed, trying with npx..."
|
||||
# It's okay if this fails, the tools will use npx
|
||||
}
|
||||
|
||||
# Install @z_ai/coding-helper for MCP management
|
||||
log_info "Installing @z_ai/coding-helper..."
|
||||
npm install -g @z_ai/coding-helper 2>/dev/null || {
|
||||
log_warning "Global install failed, will use npx"
|
||||
}
|
||||
|
||||
log_success "MCP services installation completed"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Agent Definitions
|
||||
################################################################################
|
||||
|
||||
install_agents() {
|
||||
log_info "Installing custom agents..."
|
||||
|
||||
# Note: In a production setup, these would be downloaded from a repository
|
||||
# For now, we'll create placeholder agent definitions
|
||||
# The actual agent content should be copied from the source machine
|
||||
|
||||
log_info "Agent directory structure created at $AGENTS_DIR"
|
||||
log_warning "NOTE: You need to copy the actual agent .md files from the source machine"
|
||||
log_info "Run: scp -r user@source:~/.claude/agents/* $AGENTS_DIR/"
|
||||
|
||||
log_success "Agent structure ready"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Plugins Installation
|
||||
################################################################################
|
||||
|
||||
install_plugins() {
|
||||
log_info "Installing Claude Code plugins..."
|
||||
|
||||
# Initialize plugin registry
|
||||
local installed_plugins="$PLUGINS_DIR/installed_plugins.json"
|
||||
local known_marketplaces="$PLUGINS_DIR/known_marketplaces.json"
|
||||
|
||||
backup_file "$installed_plugins"
|
||||
backup_file "$known_marketplaces"
|
||||
|
||||
cat > "$known_marketplaces" << EOF
|
||||
{
|
||||
"marketplaces": {
|
||||
"https://github.com/anthropics/claude-plugins": {
|
||||
"displayName": "Official Claude Plugins",
|
||||
"contact": "support@anthropic.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# Install GLM plugins via npx
|
||||
log_info "Installing GLM Coding Plan plugins..."
|
||||
|
||||
# Create plugin cache structure
|
||||
mkdir -p "$PLUGINS_DIR/cache/zai-coding-plugins"/{glm-plan-bug,glm-plan-usage}
|
||||
|
||||
# Note: Actual plugin installation happens via the @z_ai/coding-helper
|
||||
# which should already be installed
|
||||
|
||||
cat > "$installed_plugins" << EOF
|
||||
{
|
||||
"version": 2,
|
||||
"plugins": {
|
||||
"glm-plan-bug@zai-coding-plugins": [
|
||||
{
|
||||
"scope": "user",
|
||||
"installPath": "$PLUGINS_DIR/cache/zai-coding-plugins/glm-plan-bug/0.0.1",
|
||||
"version": "0.0.1",
|
||||
"installedAt": "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)",
|
||||
"lastUpdated": "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)"
|
||||
}
|
||||
],
|
||||
"glm-plan-usage@zai-coding-plugins": [
|
||||
{
|
||||
"scope": "user",
|
||||
"installPath": "$PLUGINS_DIR/cache/zai-coding-plugins/glm-plan-usage/0.0.1",
|
||||
"version": "0.0.1",
|
||||
"installedAt": "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)",
|
||||
"lastUpdated": "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
log_success "Plugins configured"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Download Agents from Repository
|
||||
################################################################################
|
||||
|
||||
download_agent_definitions() {
|
||||
log_info "Preparing to download agent definitions..."
|
||||
|
||||
# Create a temporary script to download agents
|
||||
# In production, this would download from a git repository or CDN
|
||||
|
||||
cat > /tmp/download_agents.sh << 'DOWNLOAD_SCRIPT'
|
||||
#!/bin/bash
|
||||
# This script would download agent definitions from a central repository
|
||||
# For now, it creates a template structure
|
||||
|
||||
AGENT_CATEGORIES=("engineering" "marketing" "product" "studio-operations" "project-management" "testing" "design" "bonus")
|
||||
|
||||
for category in "${AGENT_CATEGORIES[@]}"; do
|
||||
echo "Category: $category"
|
||||
# Agents would be downloaded here
|
||||
done
|
||||
DOWNLOAD_SCRIPT
|
||||
|
||||
chmod +x /tmp/download_agents.sh
|
||||
|
||||
log_info "Agent download script created at /tmp/download_agents.sh"
|
||||
log_warning "You need to provide the actual agent definitions"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Verification
|
||||
################################################################################
|
||||
|
||||
verify_installation() {
|
||||
log_info "Verifying installation..."
|
||||
|
||||
local errors=0
|
||||
|
||||
# Check directories
|
||||
[ -d "$CLAUDE_DIR" ] || { log_error "Claude directory missing"; errors=$((errors+1)); }
|
||||
[ -d "$AGENTS_DIR" ] || { log_error "Agents directory missing"; errors=$((errors+1)); }
|
||||
[ -d "$PLUGINS_DIR" ] || { log_error "Plugins directory missing"; errors=$((errors+1)); }
|
||||
|
||||
# Check files
|
||||
[ -f "$CLAUDE_DIR/settings.json" ] || { log_error "settings.json missing"; errors=$((errors+1)); }
|
||||
[ -f "$CLAUDE_DIR/settings.local.json" ] || { log_error "settings.local.json missing"; errors=$((errors+1)); }
|
||||
[ -f "$PLUGINS_DIR/installed_plugins.json" ] || { log_error "installed_plugins.json missing"; errors=$((errors+1)); }
|
||||
|
||||
# Check MCP availability
|
||||
if command -v npx &> /dev/null; then
|
||||
log_success "npx available for MCP tools"
|
||||
else
|
||||
log_error "npx not available"
|
||||
errors=$((errors+1))
|
||||
fi
|
||||
|
||||
if [ $errors -eq 0 ]; then
|
||||
log_success "Installation verification passed"
|
||||
return 0
|
||||
else
|
||||
log_error "Installation verification failed with $errors errors"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Main Installation Flow
|
||||
################################################################################
|
||||
|
||||
main() {
|
||||
echo -e "${BLUE}╔════════════════════════════════════════════════════════════╗${NC}"
|
||||
echo -e "${BLUE}║ Claude Code Customizations - Automated Installer ║${NC}"
|
||||
echo -e "${BLUE}╚════════════════════════════════════════════════════════════╝${NC}"
|
||||
echo ""
|
||||
|
||||
# Parse command line arguments
|
||||
SKIP_AGENTS_COPY=false
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--skip-agents)
|
||||
SKIP_AGENTS_COPY=true
|
||||
shift
|
||||
;;
|
||||
--help)
|
||||
echo "Usage: $0 [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --skip-agents Skip copying agent files (if already present)"
|
||||
echo " --help Show this help message"
|
||||
echo ""
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
log_error "Unknown option: $1"
|
||||
echo "Use --help for usage information"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Run installation steps
|
||||
check_prerequisites
|
||||
setup_directories
|
||||
setup_settings
|
||||
install_mcp_services
|
||||
install_agents
|
||||
install_plugins
|
||||
|
||||
# Verify installation
|
||||
if verify_installation; then
|
||||
echo ""
|
||||
log_success "═══════════════════════════════════════════════════════════"
|
||||
log_success "Installation completed successfully!"
|
||||
log_success "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
log_info "Next steps:"
|
||||
echo " 1. Copy agent definitions from source machine:"
|
||||
echo " scp -r user@source:~/.claude/agents/* $AGENTS_DIR/"
|
||||
echo ""
|
||||
echo " 2. Restart Claude Code to load all customizations"
|
||||
echo ""
|
||||
echo " 3. Verify MCP tools are working by starting a new session"
|
||||
echo ""
|
||||
echo "Backup location: $BACKUP_DIR"
|
||||
echo ""
|
||||
else
|
||||
log_error "Installation failed. Please check the errors above."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Run main function
|
||||
main "$@"
|
||||
963
interactive-install-claude.sh
Executable file
963
interactive-install-claude.sh
Executable file
@@ -0,0 +1,963 @@
|
||||
#!/usr/bin/env bash
|
||||
################################################################################
|
||||
# Claude Code Customizations - Interactive Installer
|
||||
# Step-by-step installation with user choices for each component
|
||||
################################################################################
|
||||
|
||||
set -e
|
||||
|
||||
# Colors
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
CYAN='\033[0;36m'
|
||||
BOLD='\033[1m'
|
||||
NC='\033[0m'
|
||||
|
||||
# Configuration
|
||||
CLAUDE_DIR="$HOME/.claude"
|
||||
BACKUP_DIR="$HOME/.claude-backup-$(date +%Y%m%d_%H%M%S)"
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# User choices
|
||||
USE_ZAI_MODELS=false
|
||||
INSTALL_AGENTS=true
|
||||
INSTALL_ENGINEERING=true
|
||||
INSTALL_MARKETING=true
|
||||
INSTALL_PRODUCT=true
|
||||
INSTALL_STUDIO_OPS=true
|
||||
INSTALL_PROJECT_MGMT=true
|
||||
INSTALL_TESTING=true
|
||||
INSTALL_DESIGN=true
|
||||
INSTALL_BONUS=true
|
||||
INSTALL_MCP_TOOLS=true
|
||||
INSTALL_VISION_TOOLS=true
|
||||
INSTALL_WEB_TOOLS=true
|
||||
INSTALL_GITHUB_TOOLS=true
|
||||
INSTALL_PLUGINS=true
|
||||
INSTALL_HOOKS=true
|
||||
LAUNCH_CLAUDE=false
|
||||
|
||||
# Counters
|
||||
SELECTED_AGENTS=0
|
||||
SELECTED_MCP_TOOLS=0
|
||||
|
||||
################################################################################
|
||||
# Helper Functions
|
||||
################################################################################
|
||||
|
||||
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
||||
log_success() { echo -e "${GREEN}[✓]${NC} $1"; }
|
||||
log_warning() { echo -e "${YELLOW}[!]${NC} $1"; }
|
||||
log_error() { echo -e "${RED}[✗]${NC} $1"; }
|
||||
|
||||
print_header() {
|
||||
clear
|
||||
echo -e "${CYAN}╔══════════════════════════════════════════════════════════════════╗${NC}"
|
||||
echo -e "${CYAN}║${NC} ${BOLD}Claude Code Customizations - Interactive Installer${NC} ${CYAN}║${NC}"
|
||||
echo -e "${CYAN}╚══════════════════════════════════════════════════════════════════╝${NC}"
|
||||
echo ""
|
||||
}
|
||||
|
||||
confirm() {
|
||||
local prompt="$1"
|
||||
local default="$2"
|
||||
|
||||
if [ "$default" = "Y" ]; then
|
||||
prompt="$prompt [Y/n]: "
|
||||
else
|
||||
prompt="$prompt [y/N]: "
|
||||
fi
|
||||
|
||||
read -p "$prompt" response
|
||||
|
||||
if [ -z "$response" ]; then
|
||||
if [ "$default" = "Y" ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ "$response" =~ ^[Yy]$ ]]
|
||||
}
|
||||
|
||||
select_multiple() {
|
||||
local title="$1"
|
||||
shift
|
||||
local options=("$@")
|
||||
|
||||
echo ""
|
||||
echo -e "${BOLD}$title${NC}"
|
||||
echo "─────────────────────────────────────────────────────────────"
|
||||
echo ""
|
||||
|
||||
local i=1
|
||||
for opt in "${options[@]}"; do
|
||||
echo " $i) $opt"
|
||||
i=$((i+1))
|
||||
done
|
||||
echo " a) All"
|
||||
echo " n) None"
|
||||
echo ""
|
||||
|
||||
while true; do
|
||||
read -p "Select options (comma-separated, a=n): " selection
|
||||
|
||||
if [[ "$selection" =~ ^[Aa]$ ]]; then
|
||||
return 0 # All
|
||||
elif [[ "$selection" =~ ^[Nn]$ ]]; then
|
||||
return 1 # None
|
||||
else
|
||||
return 0 # Has selections
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Welcome Screen
|
||||
################################################################################
|
||||
|
||||
show_welcome() {
|
||||
print_header
|
||||
echo -e "${BOLD}Welcome to Claude Code Customizations Installer!${NC}"
|
||||
echo ""
|
||||
echo "This installer will guide you through setting up a customized"
|
||||
echo "Claude Code environment with:"
|
||||
echo ""
|
||||
echo " • 40+ specialized agents for development, marketing, and operations"
|
||||
echo " • MCP tools for vision analysis, web search, and GitHub integration"
|
||||
echo " • Custom skills and plugins"
|
||||
echo " • Optimized workflows for rapid 6-day development cycles"
|
||||
echo ""
|
||||
echo -e "${YELLOW}Note:${NC} You can choose what to install at each step."
|
||||
echo ""
|
||||
|
||||
if ! confirm "Continue with installation?" "Y"; then
|
||||
echo "Installation cancelled."
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Model Selection
|
||||
################################################################################
|
||||
|
||||
select_model() {
|
||||
print_header
|
||||
echo -e "${BOLD}Step 1: Model Selection${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
echo "Choose which API models to use with Claude Code:"
|
||||
echo ""
|
||||
echo -e " ${GREEN}1${NC}) ${BOLD}Anthropic Claude Models${NC} (official)"
|
||||
echo " • claude-sonnet-4.5, claude-opus-4.5, etc."
|
||||
echo " • Direct Anthropic API"
|
||||
echo " • Base URL: https://api.anthropic.com"
|
||||
echo ""
|
||||
echo -e " ${CYAN}2${NC}) ${BOLD}Z.AI / GLM Coding Plan Models${NC}"
|
||||
echo " • Same Claude models via Z.AI platform"
|
||||
echo " • Additional features: usage tracking, feedback, promotions"
|
||||
echo " • Base URL: https://api.z.ai/api/anthropic"
|
||||
echo " • Includes: 旺仔牛奶 rewards program"
|
||||
echo ""
|
||||
read -p "Select model provider [1/2]: " model_choice
|
||||
|
||||
case $model_choice in
|
||||
2)
|
||||
USE_ZAI_MODELS=true
|
||||
log_success "Selected: Z.AI / GLM Coding Plan Models"
|
||||
;;
|
||||
*)
|
||||
USE_ZAI_MODELS=false
|
||||
log_success "Selected: Anthropic Claude Models (official)"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo ""
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Agent Selection
|
||||
################################################################################
|
||||
|
||||
select_agents() {
|
||||
print_header
|
||||
echo -e "${BOLD}Step 2: Agent Categories${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
echo "Custom agents provide specialized assistance for different tasks."
|
||||
echo "Select which categories to install:"
|
||||
echo ""
|
||||
|
||||
if confirm "Install Engineering agents? (AI engineer, frontend/backend dev, DevOps, mobile, rapid prototyper, test writer)" "Y"; then
|
||||
INSTALL_ENGINEERING=true
|
||||
SELECTED_AGENTS=$((SELECTED_AGENTS + 7))
|
||||
else
|
||||
INSTALL_ENGINEERING=false
|
||||
fi
|
||||
|
||||
if confirm "Install Marketing agents? (TikTok strategist, growth hacker, content creator, Instagram/Reddit/Twitter)" "Y"; then
|
||||
INSTALL_MARKETING=true
|
||||
SELECTED_AGENTS=$((SELECTED_AGENTS + 7))
|
||||
else
|
||||
INSTALL_MARKETING=false
|
||||
fi
|
||||
|
||||
if confirm "Install Product agents? (Sprint prioritizer, feedback synthesizer, trend researcher)" "Y"; then
|
||||
INSTALL_PRODUCT=true
|
||||
SELECTED_AGENTS=$((SELECTED_AGENTS + 3))
|
||||
else
|
||||
INSTALL_PRODUCT=false
|
||||
fi
|
||||
|
||||
if confirm "Install Studio Operations agents? (Studio producer, project shipper, analytics, finance, legal, support, coach)" "Y"; then
|
||||
INSTALL_STUDIO_OPS=true
|
||||
SELECTED_AGENTS=$((SELECTED_AGENTS + 8))
|
||||
else
|
||||
INSTALL_STUDIO_OPS=false
|
||||
fi
|
||||
|
||||
if confirm "Install Project Management agents? (Experiment tracker, studio producer, project shipper)" "Y"; then
|
||||
INSTALL_PROJECT_MGMT=true
|
||||
SELECTED_AGENTS=$((SELECTED_AGENTS + 3))
|
||||
else
|
||||
INSTALL_PROJECT_MGMT=false
|
||||
fi
|
||||
|
||||
if confirm "Install Testing agents? (Test writer/fixer, API tester, performance benchmarker, workflow optimizer)" "Y"; then
|
||||
INSTALL_TESTING=true
|
||||
SELECTED_AGENTS=$((SELECTED_AGENTS + 5))
|
||||
else
|
||||
INSTALL_TESTING=false
|
||||
fi
|
||||
|
||||
if confirm "Install Design agents? (UI/UX designer, brand guardian, visual storyteller, whimsy injector)" "Y"; then
|
||||
INSTALL_DESIGN=true
|
||||
SELECTED_AGENTS=$((SELECTED_AGENTS + 5))
|
||||
else
|
||||
INSTALL_DESIGN=false
|
||||
fi
|
||||
|
||||
if confirm "Install Bonus agents? (Joker, studio coach)" "Y"; then
|
||||
INSTALL_BONUS=true
|
||||
SELECTED_AGENTS=$((SELECTED_AGENTS + 2))
|
||||
else
|
||||
INSTALL_BONUS=false
|
||||
fi
|
||||
|
||||
if [ $SELECTED_AGENTS -eq 0 ]; then
|
||||
log_warning "No agents selected - you can add them later manually"
|
||||
else
|
||||
log_success "Selected $SELECTED_AGENTS agents across multiple categories"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MCP Tools Selection
|
||||
################################################################################
|
||||
|
||||
select_mcp_tools() {
|
||||
print_header
|
||||
echo -e "${BOLD}Step 3: MCP Tools${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
echo "MCP (Model Context Protocol) tools provide advanced capabilities."
|
||||
echo "Select which tools to install:"
|
||||
echo ""
|
||||
|
||||
if confirm "Install Vision Analysis tools? (images, videos, UI screenshots, error diagnosis, data visualization, diagrams)" "Y"; then
|
||||
INSTALL_VISION_TOOLS=true
|
||||
SELECTED_MCP_TOOLS=$((SELECTED_MCP_TOOLS + 8))
|
||||
else
|
||||
INSTALL_VISION_TOOLS=false
|
||||
fi
|
||||
|
||||
if confirm "Install Web Search tool? (enhanced search with domain filtering, time-based results)" "Y"; then
|
||||
INSTALL_WEB_TOOLS=true
|
||||
SELECTED_MCP_TOOLS=$((SELECTED_MCP_TOOLS + 1))
|
||||
else
|
||||
INSTALL_WEB_TOOLS=false
|
||||
fi
|
||||
|
||||
if confirm "Install Web Reader tool? (fetch URLs, convert to markdown)" "Y"; then
|
||||
INSTALL_WEB_TOOLS=true
|
||||
SELECTED_MCP_TOOLS=$((SELECTED_MCP_TOOLS + 1))
|
||||
fi
|
||||
|
||||
if confirm "Install GitHub Reader tool? (read repos, search docs/issues/commits)" "Y"; then
|
||||
INSTALL_GITHUB_TOOLS=true
|
||||
SELECTED_MCP_TOOLS=$((SELECTED_MCP_TOOLS + 3))
|
||||
else
|
||||
INSTALL_GITHUB_TOOLS=false
|
||||
fi
|
||||
|
||||
if [ $SELECTED_MCP_TOOLS -eq 0 ]; then
|
||||
log_warning "No MCP tools selected"
|
||||
else
|
||||
log_success "Selected $SELECTED_MCP_TOOLS MCP tools"
|
||||
fi
|
||||
|
||||
INSTALL_MCP_TOOLS=true
|
||||
echo ""
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Plugins Selection
|
||||
################################################################################
|
||||
|
||||
select_plugins() {
|
||||
print_header
|
||||
echo -e "${BOLD}Step 4: Plugins & Skills${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
echo "Plugins extend Claude Code with additional features:"
|
||||
echo ""
|
||||
echo " • glm-plan-bug: Submit bug/issue feedback to Z.AI"
|
||||
echo " • glm-plan-usage: Query your GLM Coding Plan usage statistics"
|
||||
echo ""
|
||||
|
||||
if confirm "Install Z.AI plugins?" "Y"; then
|
||||
INSTALL_PLUGINS=true
|
||||
log_success "Plugins selected"
|
||||
else
|
||||
INSTALL_PLUGINS=false
|
||||
log_warning "Plugins skipped"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Hooks Selection
|
||||
################################################################################
|
||||
|
||||
select_hooks() {
|
||||
print_header
|
||||
echo -e "${BOLD}Step 5: Hooks${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
echo "Hooks are scripts that run automatically on specific events."
|
||||
echo "Do you want to copy existing hooks from the package?"
|
||||
echo ""
|
||||
|
||||
if confirm "Install hooks?" "N"; then
|
||||
INSTALL_HOOKS=true
|
||||
log_success "Hooks selected"
|
||||
else
|
||||
INSTALL_HOOKS=false
|
||||
log_warning "Hooks skipped"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Prerequisites Check
|
||||
################################################################################
|
||||
|
||||
check_prerequisites() {
|
||||
print_header
|
||||
echo -e "${BOLD}Step 6: Prerequisites Check${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
|
||||
local errors=0
|
||||
|
||||
# Check Node.js
|
||||
if command -v node &> /dev/null; then
|
||||
NODE_VERSION=$(node -v)
|
||||
log_success "Node.js installed: $NODE_VERSION"
|
||||
else
|
||||
log_error "Node.js not found"
|
||||
errors=$((errors+1))
|
||||
fi
|
||||
|
||||
# Check npm
|
||||
if command -v npm &> /dev/null; then
|
||||
NPM_VERSION=$(npm -v)
|
||||
log_success "npm installed: $NPM_VERSION"
|
||||
else
|
||||
log_error "npm not found"
|
||||
errors=$((errors+1))
|
||||
fi
|
||||
|
||||
# Check python3
|
||||
if command -v python3 &> /dev/null; then
|
||||
PYTHON_VERSION=$(python3 --version)
|
||||
log_success "Python installed: $PYTHON_VERSION"
|
||||
else
|
||||
log_warning "Python3 not found (optional)"
|
||||
fi
|
||||
|
||||
# Check npx
|
||||
if command -v npx &> /dev/null; then
|
||||
log_success "npx available"
|
||||
else
|
||||
log_warning "npx not found (will be installed with npm)"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
if [ $errors -gt 0 ]; then
|
||||
log_error "Some prerequisites are missing. Please install them and try again."
|
||||
echo ""
|
||||
echo "Install Node.js: https://nodejs.org/"
|
||||
echo "Or use nvm: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log_success "Prerequisites check passed"
|
||||
echo ""
|
||||
sleep 1
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Claude Code Installation
|
||||
################################################################################
|
||||
|
||||
install_claude_code() {
|
||||
print_header
|
||||
echo -e "${BOLD}Step 7: Claude Code Installation${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
|
||||
# Check if Claude Code is installed
|
||||
if command -v claude-code &> /dev/null; then
|
||||
log_success "Claude Code is already installed"
|
||||
claude-code --version 2>/dev/null || log_info "Version: unknown"
|
||||
echo ""
|
||||
return
|
||||
fi
|
||||
|
||||
echo -e "${YELLOW}Claude Code is not installed on this system.${NC}"
|
||||
echo ""
|
||||
echo "Claude Code is Anthropic's official CLI for Claude."
|
||||
echo "You need it to use these customizations."
|
||||
echo ""
|
||||
echo "Installation options:"
|
||||
echo ""
|
||||
echo -e " ${GREEN}1${NC}) ${BOLD}Install via npm (recommended)${NC}"
|
||||
echo " • Requires Node.js 14+"
|
||||
echo " • Command: npm install -g @anthropic-ai/claude-code"
|
||||
echo " • Fastest method"
|
||||
echo ""
|
||||
echo -e " ${GREEN}2${NC}) ${BOLD}Install via curl (alternative)${NC}"
|
||||
echo " • Downloads standalone binary"
|
||||
echo " • No Node.js required"
|
||||
echo ""
|
||||
echo -e " ${GREEN}3${NC}) ${BOLD}Manual installation${NC}"
|
||||
echo " • Visit: https://claude.ai/download"
|
||||
echo " • Choose your platform"
|
||||
echo ""
|
||||
echo -e " ${YELLOW}0${NC}) Skip installation"
|
||||
echo ""
|
||||
read -p "Select installation method [1/2/3/0]: " install_choice
|
||||
|
||||
case $install_choice in
|
||||
1)
|
||||
echo ""
|
||||
log_info "Installing Claude Code via npm..."
|
||||
echo ""
|
||||
|
||||
if command -v npm &> /dev/null; then
|
||||
npm install -g @anthropic-ai/claude-code
|
||||
|
||||
if command -v claude-code &> /dev/null; then
|
||||
log_success "Claude Code installed successfully!"
|
||||
echo ""
|
||||
claude-code --version 2>/dev/null || true
|
||||
else
|
||||
log_error "Installation failed. Please try manual installation."
|
||||
fi
|
||||
else
|
||||
log_error "npm not found. Please install Node.js first."
|
||||
echo "Visit: https://nodejs.org/"
|
||||
fi
|
||||
;;
|
||||
2)
|
||||
echo ""
|
||||
log_info "Installing Claude Code via curl..."
|
||||
echo ""
|
||||
|
||||
if command -v curl &> /dev/null; then
|
||||
# Detect OS and architecture
|
||||
OS="$(uname -s)"
|
||||
ARCH="$(uname -m)"
|
||||
|
||||
case "$OS" in
|
||||
Linux)
|
||||
if [ "$ARCH" = "x86_64" ]; then
|
||||
curl -L https://claude.ai/download/claude-code-linux -o /tmp/claude-code
|
||||
sudo mv /tmp/claude-code /usr/local/bin/claude-code
|
||||
sudo chmod +x /usr/local/bin/claude-code
|
||||
log_success "Claude Code installed!"
|
||||
else
|
||||
log_error "Unsupported architecture: $ARCH"
|
||||
fi
|
||||
;;
|
||||
Darwin)
|
||||
if [ "$ARCH" = "arm64" ]; then
|
||||
curl -L https://claude.ai/download/claude-code-mac-arm -o /tmp/claude-code
|
||||
else
|
||||
curl -L https://claude.ai/download/claude-code-mac -o /tmp/claude-code
|
||||
fi
|
||||
sudo mv /tmp/claude-code /usr/local/bin/claude-code
|
||||
sudo chmod +x /usr/local/bin/claude-code
|
||||
log_success "Claude Code installed!"
|
||||
;;
|
||||
*)
|
||||
log_error "Unsupported OS: $OS"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
log_error "curl not found. Please install curl or use npm method."
|
||||
fi
|
||||
;;
|
||||
3)
|
||||
echo ""
|
||||
log_info "Please visit https://claude.ai/download to install Claude Code manually"
|
||||
echo ""
|
||||
echo "After installation, run this script again."
|
||||
echo ""
|
||||
exit 0
|
||||
;;
|
||||
0)
|
||||
log_warning "Skipping Claude Code installation"
|
||||
log_warning "You will need to install it manually to use these customizations"
|
||||
;;
|
||||
*)
|
||||
log_error "Invalid choice"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo ""
|
||||
sleep 2
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Backup Existing Configuration
|
||||
################################################################################
|
||||
|
||||
backup_config() {
|
||||
if [ -d "$CLAUDE_DIR" ]; then
|
||||
print_header
|
||||
echo -e "${BOLD}Step 8: Backup${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
log_info "Existing Claude Code configuration found"
|
||||
log_info "Creating backup at: $BACKUP_DIR"
|
||||
echo ""
|
||||
|
||||
cp -r "$CLAUDE_DIR" "$BACKUP_DIR"
|
||||
log_success "Backup created successfully"
|
||||
echo ""
|
||||
sleep 1
|
||||
fi
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Installation
|
||||
################################################################################
|
||||
|
||||
create_directories() {
|
||||
log_info "Creating directory structure..."
|
||||
|
||||
mkdir -p "$CLAUDE_DIR"/{agents,plugins/cache,plugins/marketplaces,hooks,debug,file-history,paste-cache,projects,session-env,shell-snapshots,todos}
|
||||
|
||||
if [ "$INSTALL_ENGINEERING" = true ]; then mkdir -p "$CLAUDE_DIR/agents/engineering"; fi
|
||||
if [ "$INSTALL_MARKETING" = true ]; then mkdir -p "$CLAUDE_DIR/agents/marketing"; fi
|
||||
if [ "$INSTALL_PRODUCT" = true ]; then mkdir -p "$CLAUDE_DIR/agents/product"; fi
|
||||
if [ "$INSTALL_STUDIO_OPS" = true ]; then mkdir -p "$CLAUDE_DIR/agents/studio-operations"; fi
|
||||
if [ "$INSTALL_PROJECT_MGMT" = true ]; then mkdir -p "$CLAUDE_DIR/agents/project-management"; fi
|
||||
if [ "$INSTALL_TESTING" = true ]; then mkdir -p "$CLAUDE_DIR/agents/testing"; fi
|
||||
if [ "$INSTALL_DESIGN" = true ]; then mkdir -p "$CLAUDE_DIR/agents/design"; fi
|
||||
if [ "$INSTALL_BONUS" = true ]; then mkdir -p "$CLAUDE_DIR/agents/bonus"; fi
|
||||
|
||||
log_success "Directories created"
|
||||
}
|
||||
|
||||
install_agents() {
|
||||
if [ $SELECTED_AGENTS -eq 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
log_info "Installing agents..."
|
||||
|
||||
local source_agents="$SCRIPT_DIR/claude-complete-package/agents"
|
||||
|
||||
if [ ! -d "$source_agents" ]; then
|
||||
log_warning "Agent source directory not found at $source_agents"
|
||||
log_warning "Please ensure you're running this from the correct location"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_ENGINEERING" = true ]; then
|
||||
cp -r "$source_agents/engineering/"*.md "$CLAUDE_DIR/agents/engineering/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_MARKETING" = true ]; then
|
||||
cp -r "$source_agents/marketing/"*.md "$CLAUDE_DIR/agents/marketing/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_PRODUCT" = true ]; then
|
||||
cp -r "$source_agents/product/"*.md "$CLAUDE_DIR/agents/product/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_STUDIO_OPS" = true ]; then
|
||||
cp -r "$source_agents/studio-operations/"*.md "$CLAUDE_DIR/agents/studio-operations/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_PROJECT_MGMT" = true ]; then
|
||||
cp -r "$source_agents/project-management/"*.md "$CLAUDE_DIR/agents/project-management/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_TESTING" = true ]; then
|
||||
cp -r "$source_agents/testing/"*.md "$CLAUDE_DIR/agents/testing/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_DESIGN" = true ]; then
|
||||
cp -r "$source_agents/design/"*.md "$CLAUDE_DIR/agents/design/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_BONUS" = true ]; then
|
||||
cp -r "$source_agents/bonus/"*.md "$CLAUDE_DIR/agents/bonus/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
log_success "Agents installed: $SELECTED_AGENTS"
|
||||
}
|
||||
|
||||
install_settings() {
|
||||
log_info "Configuring settings..."
|
||||
|
||||
local settings_file="$CLAUDE_DIR/settings.json"
|
||||
|
||||
# Determine API base URL and help text
|
||||
if [ "$USE_ZAI_MODELS" = true ]; then
|
||||
API_BASE="https://api.z.ai/api/anthropic"
|
||||
API_NAME="Z.AI / GLM Coding Plan"
|
||||
API_HELP="Get your API key from: https://open.bigmodel.cn/usercenter/apikeys"
|
||||
API_TOKEN_NAME="Z.AI API Key"
|
||||
else
|
||||
API_BASE="https://api.anthropic.com"
|
||||
API_NAME="Anthropic Claude"
|
||||
API_HELP="Get your API key from: https://console.anthropic.com/"
|
||||
API_TOKEN_NAME="Anthropic API Key"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo -e "${CYAN}API Configuration${NC}"
|
||||
echo "─────────────────────────────────────────────────────────────"
|
||||
echo " Provider: $API_NAME"
|
||||
echo " Base URL: $API_BASE"
|
||||
echo ""
|
||||
echo -e "${YELLOW}$API_HELP${NC}"
|
||||
echo ""
|
||||
|
||||
# Check if settings.json exists
|
||||
if [ -f "$settings_file" ]; then
|
||||
log_warning "settings.json already exists"
|
||||
if confirm "Keep existing API token?" "Y"; then
|
||||
log_info "Preserving existing configuration"
|
||||
else
|
||||
echo ""
|
||||
read -p "Enter your $API_TOKEN_NAME: " API_TOKEN
|
||||
while [ -z "$API_TOKEN" ]; do
|
||||
echo -e "${RED}API token cannot be empty${NC}"
|
||||
read -p "Enter your $API_TOKEN_NAME: " API_TOKEN
|
||||
done
|
||||
|
||||
# Update existing file
|
||||
cat > "$settings_file" << EOF
|
||||
{
|
||||
"env": {
|
||||
"ANTHROPIC_AUTH_TOKEN": "$API_TOKEN",
|
||||
"ANTHROPIC_BASE_URL": "$API_BASE",
|
||||
"API_TIMEOUT_MS": "3000000",
|
||||
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
|
||||
},
|
||||
"enabledPlugins": {}
|
||||
}
|
||||
EOF
|
||||
log_success "API token updated"
|
||||
fi
|
||||
else
|
||||
read -p "Enter your $API_TOKEN_NAME: " API_TOKEN
|
||||
while [ -z "$API_TOKEN" ]; do
|
||||
echo -e "${RED}API token cannot be empty${NC}"
|
||||
read -p "Enter your $API_TOKEN_NAME: " API_TOKEN
|
||||
done
|
||||
|
||||
cat > "$settings_file" << EOF
|
||||
{
|
||||
"env": {
|
||||
"ANTHROPIC_AUTH_TOKEN": "$API_TOKEN",
|
||||
"ANTHROPIC_BASE_URL": "$API_BASE",
|
||||
"API_TIMEOUT_MS": "3000000",
|
||||
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
|
||||
},
|
||||
"enabledPlugins": {}
|
||||
}
|
||||
EOF
|
||||
log_success "API token configured"
|
||||
fi
|
||||
|
||||
# Add plugins to enabledPlugins if selected
|
||||
if [ "$INSTALL_PLUGINS" = true ]; then
|
||||
if [ "$USE_ZAI_MODELS" = true ]; then
|
||||
# Add Z.AI plugins
|
||||
if command -v jq &> /dev/null; then
|
||||
temp=$(mktemp)
|
||||
jq '.enabledPlugins += {"glm-plan-bug@zai-coding-plugins": true, "glm-plan-usage@zai-coding-plugins": true}' "$settings_file" > "$temp"
|
||||
mv "$temp" "$settings_file"
|
||||
log_success "Z.AI plugins enabled"
|
||||
else
|
||||
log_warning "jq not found, plugins not added to settings"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
log_success "Settings configured for $API_NAME"
|
||||
}
|
||||
|
||||
install_local_settings() {
|
||||
log_info "Configuring permissions..."
|
||||
|
||||
local local_settings="$CLAUDE_DIR/settings.local.json"
|
||||
|
||||
cat > "$local_settings" << 'EOF'
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(npm install:*)",
|
||||
"Bash(npm run content:*)",
|
||||
"Bash(npm run build:*)",
|
||||
"Bash(grep:*)",
|
||||
"Bash(find:*)",
|
||||
"Bash(for:*)",
|
||||
"Bash(do sed:*)",
|
||||
"Bash(done)",
|
||||
"Bash(python3:*)",
|
||||
"Bash(while read f)",
|
||||
"Bash(do echo \"$f%-* $f\")",
|
||||
"Bash(ls:*)",
|
||||
"Bash(node:*)",
|
||||
"Bash(pm2 delete:*)",
|
||||
"Bash(pm2 start npm:*)",
|
||||
"Bash(pm2 save:*)"
|
||||
]
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
log_success "Permissions configured"
|
||||
}
|
||||
|
||||
install_mcp_tools() {
|
||||
if [ "$INSTALL_MCP_TOOLS" = false ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
log_info "Installing MCP tools..."
|
||||
|
||||
# Install @z_ai/mcp-server if vision tools selected
|
||||
if [ "$INSTALL_VISION_TOOLS" = true ]; then
|
||||
if command -v npm &> /dev/null; then
|
||||
npm install -g @z_ai/mcp-server 2>/dev/null || {
|
||||
log_warning "Global install failed, will use npx"
|
||||
}
|
||||
log_success "Vision MCP tools installed"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install @z_ai/coding-helper for web/GitHub tools
|
||||
if [ "$INSTALL_WEB_TOOLS" = true ] || [ "$INSTALL_GITHUB_TOOLS" = true ]; then
|
||||
npm install -g @z_ai/coding-helper 2>/dev/null || {
|
||||
log_warning "Global install failed, will use npx"
|
||||
}
|
||||
log_success "Web/GitHub MCP tools installed"
|
||||
fi
|
||||
|
||||
log_success "MCP tools configured: $SELECTED_MCP_TOOLS"
|
||||
}
|
||||
|
||||
install_plugins() {
|
||||
if [ "$INSTALL_PLUGINS" = false ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
log_info "Installing plugins..."
|
||||
|
||||
# Create plugin registry
|
||||
mkdir -p "$CLAUDE_DIR/plugins/cache/zai-coding-plugins"/{glm-plan-bug,glm-plan-usage}
|
||||
|
||||
local installed_plugins="$CLAUDE_DIR/plugins/installed_plugins.json"
|
||||
|
||||
if [ "$USE_ZAI_MODELS" = true ]; then
|
||||
cat > "$installed_plugins" << EOF
|
||||
{
|
||||
"version": 2,
|
||||
"plugins": {
|
||||
"glm-plan-bug@zai-coding-plugins": [
|
||||
{
|
||||
"scope": "user",
|
||||
"installPath": "$CLAUDE_DIR/plugins/cache/zai-coding-plugins/glm-plan-bug/0.0.1",
|
||||
"version": "0.0.1",
|
||||
"installedAt": "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)",
|
||||
"lastUpdated": "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)"
|
||||
}
|
||||
],
|
||||
"glm-plan-usage@zai-coding-plugins": [
|
||||
{
|
||||
"scope": "user",
|
||||
"installPath": "$CLAUDE_DIR/plugins/cache/zai-coding-plugins/glm-plan-usage/0.0.1",
|
||||
"version": "0.0.1",
|
||||
"installedAt": "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)",
|
||||
"lastUpdated": "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
||||
log_success "Plugins installed"
|
||||
}
|
||||
|
||||
install_hooks() {
|
||||
if [ "$INSTALL_HOOKS" = false ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local source_hooks="$SCRIPT_DIR/claude-complete-package/hooks"
|
||||
|
||||
if [ -d "$source_hooks" ] && [ "$(ls -A $source_hooks 2>/dev/null)" ]; then
|
||||
log_info "Installing hooks..."
|
||||
cp -r "$source_hooks/"* "$CLAUDE_DIR/hooks/" 2>/dev/null || true
|
||||
log_success "Hooks installed"
|
||||
fi
|
||||
}
|
||||
|
||||
perform_installation() {
|
||||
print_header
|
||||
echo -e "${BOLD}Step 9: Installation${NC}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo ""
|
||||
|
||||
create_directories
|
||||
install_agents
|
||||
install_settings
|
||||
install_local_settings
|
||||
install_mcp_tools
|
||||
install_plugins
|
||||
install_hooks
|
||||
|
||||
echo ""
|
||||
log_success "Installation completed!"
|
||||
echo ""
|
||||
sleep 1
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Summary & Launch
|
||||
################################################################################
|
||||
|
||||
show_summary() {
|
||||
print_header
|
||||
echo -e "${BOLD}Installation Summary${NC}"
|
||||
echo "╔══════════════════════════════════════════════════════════════════╗${NC}"
|
||||
echo "║ ║"
|
||||
echo "║ Configuration: ║"
|
||||
|
||||
if [ "$USE_ZAI_MODELS" = true ]; then
|
||||
echo "║ • Model Provider: ${CYAN}Z.AI / GLM Coding Plan${NC} ║"
|
||||
else
|
||||
echo "║ • Model Provider: ${GREEN}Anthropic Claude (Official)${NC} ║"
|
||||
fi
|
||||
|
||||
echo "║ ║"
|
||||
echo "║ Installed Components: ║"
|
||||
|
||||
if [ $SELECTED_AGENTS -gt 0 ]; then
|
||||
echo "║ • Agents: ${GREEN}$SELECTED_AGENTS custom agents${NC} ║"
|
||||
fi
|
||||
|
||||
if [ $SELECTED_MCP_TOOLS -gt 0 ]; then
|
||||
echo "║ • MCP Tools: ${CYAN}$SELECTED_MCP_TOOLS tools${NC} ║"
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_PLUGINS" = true ]; then
|
||||
echo "║ • Plugins: ${GREEN}Z.AI plugins enabled${NC} ║"
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_HOOKS" = true ]; then
|
||||
echo "║ • Hooks: ${GREEN}Installed${NC} ║"
|
||||
fi
|
||||
|
||||
echo "║ ║"
|
||||
echo "╚══════════════════════════════════════════════════════════════════╝"
|
||||
echo ""
|
||||
}
|
||||
|
||||
launch_claude_code() {
|
||||
echo ""
|
||||
echo -e "${BOLD}Launch Claude Code?${NC}"
|
||||
echo ""
|
||||
echo "You can launch Claude Code now to start using your customizations."
|
||||
echo ""
|
||||
|
||||
if confirm "Launch Claude Code now?" "N"; then
|
||||
echo ""
|
||||
log_info "Launching Claude Code..."
|
||||
echo ""
|
||||
|
||||
# Try to launch claude-code
|
||||
if command -v claude-code &> /dev/null; then
|
||||
exec claude-code
|
||||
elif command -v code &> /dev/null; then
|
||||
log_info "Trying VS Code command..."
|
||||
code
|
||||
else
|
||||
log_warning "Claude Code command not found"
|
||||
echo ""
|
||||
echo "Please launch Claude Code manually:"
|
||||
echo " • From applications menu"
|
||||
echo " • Or run: claude-code"
|
||||
echo " • Or run: code"
|
||||
fi
|
||||
else
|
||||
echo ""
|
||||
log_info "You can launch Claude Code later with: claude-code"
|
||||
fi
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Main Installation Flow
|
||||
################################################################################
|
||||
|
||||
main() {
|
||||
show_welcome
|
||||
select_model
|
||||
select_agents
|
||||
select_mcp_tools
|
||||
select_plugins
|
||||
select_hooks
|
||||
check_prerequisites
|
||||
install_claude_code
|
||||
backup_config
|
||||
perform_installation
|
||||
show_summary
|
||||
|
||||
if [ -n "$BACKUP_DIR" ] && [ -d "$BACKUP_DIR" ]; then
|
||||
log_info "Backup saved to: $BACKUP_DIR"
|
||||
fi
|
||||
|
||||
launch_claude_code
|
||||
}
|
||||
|
||||
# Run main
|
||||
main "$@"
|
||||
217
verify-claude-setup.sh
Executable file
217
verify-claude-setup.sh
Executable file
@@ -0,0 +1,217 @@
|
||||
#!/usr/bin/env bash
|
||||
################################################################################
|
||||
# Claude Code Setup Verification Script
|
||||
# Checks if all customizations are properly installed
|
||||
################################################################################
|
||||
|
||||
set -e
|
||||
|
||||
# Colors
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
CLAUDE_DIR="$HOME/.claude"
|
||||
AGENTS_DIR="$CLAUDE_DIR/agents"
|
||||
PLUGINS_DIR="$CLAUDE_DIR/plugins"
|
||||
|
||||
PASSED=0
|
||||
FAILED=0
|
||||
WARNINGS=0
|
||||
|
||||
check_pass() {
|
||||
echo -e "${GREEN}✓${NC} $1"
|
||||
PASSED=$((PASSED+1))
|
||||
}
|
||||
|
||||
check_fail() {
|
||||
echo -e "${RED}✗${NC} $1"
|
||||
FAILED=$((FAILED+1))
|
||||
}
|
||||
|
||||
check_warn() {
|
||||
echo -e "${YELLOW}⚠${NC} $1"
|
||||
WARNINGS=$((WARNINGS+1))
|
||||
}
|
||||
|
||||
check_info() {
|
||||
echo -e "${BLUE}ℹ${NC} $1"
|
||||
}
|
||||
|
||||
echo -e "${BLUE}╔════════════════════════════════════════════════════════════╗${NC}"
|
||||
echo -e "${BLUE}║ Claude Code Customizations - Verification ║${NC}"
|
||||
echo -e "${BLUE}╚════════════════════════════════════════════════════════════╝${NC}"
|
||||
echo ""
|
||||
|
||||
# 1. Check directory structure
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo "Directory Structure"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
|
||||
[ -d "$CLAUDE_DIR" ] && check_pass "Claude directory exists" || check_fail "Claude directory missing"
|
||||
[ -d "$AGENTS_DIR" ] && check_pass "Agents directory exists" || check_fail "Agents directory missing"
|
||||
[ -d "$PLUGINS_DIR" ] && check_pass "Plugins directory exists" || check_fail "Plugins directory missing"
|
||||
|
||||
echo ""
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo "Agent Categories"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
|
||||
CATEGORIES=("engineering" "marketing" "product" "studio-operations" "project-management" "testing" "design" "bonus")
|
||||
AGENT_COUNT=0
|
||||
|
||||
for category in "${CATEGORIES[@]}"; do
|
||||
if [ -d "$AGENTS_DIR/$category" ]; then
|
||||
count=$(ls -1 "$AGENTS_DIR/$category"/*.md 2>/dev/null | wc -l)
|
||||
if [ $count -gt 0 ]; then
|
||||
echo -e "${GREEN}✓${NC} $category: $count agents"
|
||||
AGENT_COUNT=$((AGENT_COUNT + count))
|
||||
else
|
||||
check_warn "$category: directory exists but no agents"
|
||||
fi
|
||||
else
|
||||
check_fail "$category: directory missing"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
check_info "Total agents: $AGENT_COUNT"
|
||||
|
||||
# 2. Check configuration files
|
||||
echo ""
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo "Configuration Files"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
|
||||
[ -f "$CLAUDE_DIR/settings.json" ] && check_pass "settings.json exists" || check_fail "settings.json missing"
|
||||
[ -f "$CLAUDE_DIR/settings.local.json" ] && check_pass "settings.local.json exists" || check_fail "settings.local.json missing"
|
||||
[ -f "$PLUGINS_DIR/installed_plugins.json" ] && check_pass "installed_plugins.json exists" || check_fail "installed_plugins.json missing"
|
||||
[ -f "$PLUGINS_DIR/known_marketplaces.json" ] && check_pass "known_marketplaces.json exists" || check_fail "known_marketplaces.json missing"
|
||||
|
||||
# 3. Check MCP tools
|
||||
echo ""
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo "MCP Tools"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
|
||||
if command -v npx &> /dev/null; then
|
||||
check_pass "npx available"
|
||||
|
||||
# Check if @z_ai/mcp-server can be accessed
|
||||
if npx -y @z_ai/mcp-server --help &> /dev/null; then
|
||||
check_pass "@z_ai/mcp-server accessible"
|
||||
else
|
||||
check_warn "@z_ai/mcp-server not directly accessible (may download on first use)"
|
||||
fi
|
||||
|
||||
# Check if @z_ai/coding-helper can be accessed
|
||||
if npx -y @z_ai/coding-helper --help &> /dev/null; then
|
||||
check_pass "@z_ai/coding-helper accessible"
|
||||
else
|
||||
check_warn "@z_ai/coding-helper not directly accessible (may download on first use)"
|
||||
fi
|
||||
else
|
||||
check_fail "npx not available - MCP tools may not work"
|
||||
fi
|
||||
|
||||
# 4. Check plugins
|
||||
echo ""
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo "Plugins"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
|
||||
if [ -f "$PLUGINS_DIR/installed_plugins.json" ]; then
|
||||
# Check if GLM plugins are registered
|
||||
if grep -q "glm-plan-bug" "$PLUGINS_DIR/installed_plugins.json" 2>/dev/null; then
|
||||
check_pass "glm-plan-bug plugin registered"
|
||||
else
|
||||
check_warn "glm-plan-bug plugin not registered"
|
||||
fi
|
||||
|
||||
if grep -q "glm-plan-usage" "$PLUGINS_DIR/installed_plugins.json" 2>/dev/null; then
|
||||
check_pass "glm-plan-usage plugin registered"
|
||||
else
|
||||
check_warn "glm-plan-usage plugin not registered"
|
||||
fi
|
||||
fi
|
||||
|
||||
# 5. Sample agent check
|
||||
echo ""
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo "Agent Content Verification"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
|
||||
CRITICAL_AGENTS=(
|
||||
"engineering/test-writer-fixer.md"
|
||||
"engineering/frontend-developer.md"
|
||||
"marketing/tiktok-strategist.md"
|
||||
"product/sprint-prioritizer.md"
|
||||
"studio-operations/studio-producer.md"
|
||||
"project-management/project-shipper.md"
|
||||
"design/whimsy-injector.md"
|
||||
)
|
||||
|
||||
for agent in "${CRITICAL_AGENTS[@]}"; do
|
||||
if [ -f "$AGENTS_DIR/$agent" ]; then
|
||||
# Check file has content
|
||||
if [ -s "$AGENTS_DIR/$agent" ]; then
|
||||
check_pass "$agent exists and has content"
|
||||
else
|
||||
check_warn "$agent exists but is empty"
|
||||
fi
|
||||
else
|
||||
check_warn "$agent missing"
|
||||
fi
|
||||
done
|
||||
|
||||
# 6. Settings validation
|
||||
echo ""
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo "Settings Validation"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
|
||||
if [ -f "$CLAUDE_DIR/settings.json" ]; then
|
||||
# Check if JSON is valid
|
||||
if python3 -m json.tool "$CLAUDE_DIR/settings.json" &> /dev/null; then
|
||||
check_pass "settings.json is valid JSON"
|
||||
|
||||
# Check for API token placeholder
|
||||
if grep -q "YOUR_API_TOKEN_HERE\|YOUR_TOKEN_HERE" "$CLAUDE_DIR/settings.json" 2>/dev/null; then
|
||||
check_warn "API token not configured (still placeholder)"
|
||||
else
|
||||
if grep -q "ANTHROPIC_AUTH_TOKEN" "$CLAUDE_DIR/settings.json" 2>/dev/null; then
|
||||
check_pass "ANTHROPIC_AUTH_TOKEN is set"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
check_fail "settings.json is not valid JSON"
|
||||
fi
|
||||
fi
|
||||
|
||||
# 7. Summary
|
||||
echo ""
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo "Summary"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
|
||||
if [ $FAILED -eq 0 ]; then
|
||||
echo -e "${GREEN}✓ All critical checks passed!${NC}"
|
||||
echo ""
|
||||
echo "Passed: $PASSED"
|
||||
echo "Warnings: $WARNINGS"
|
||||
echo "Failed: $FAILED"
|
||||
echo ""
|
||||
echo -e "${GREEN}Your Claude Code setup is ready to use!${NC}"
|
||||
exit 0
|
||||
else
|
||||
echo -e "${RED}✗ Some checks failed${NC}"
|
||||
echo ""
|
||||
echo "Passed: $PASSED"
|
||||
echo "Warnings: $WARNINGS"
|
||||
echo "Failed: $FAILED"
|
||||
echo ""
|
||||
echo "Please fix the failed checks above."
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user