Claude Buddy installation and setup script
npm install claude-buddy> Automated installation and configuration tool for Claude Buddy framework
The Claude Buddy installation script provides a robust, cross-platform solution for setting up and managing the Claude Buddy AI assistant framework in your development projects. It handles fresh installations, updates, uninstallations, and gracefully degrades when optional dependencies are unavailable.
- Fresh Installation: Sets up all Claude Buddy components with zero configuration
- Smart Updates: Preserves user customizations while updating framework files
- Graceful Degradation: Continues installation when optional dependencies are missing
- Dry-Run Mode: Preview all actions before executing
- Transaction Safety: Automatic rollback on failures
- Cross-Platform: Works on macOS, Linux, and Windows
- Non-Interactive Mode: Perfect for CI/CD pipelines
``bashInstall globally
npm install -g claude-buddy
$3
`bash
Fresh installation in current directory
claude-buddy installInstall in specific directory
claude-buddy install --target /path/to/projectUpdate existing installation
claude-buddy updateDry-run mode (preview without changes)
claude-buddy install --dry-runUninstall Claude Buddy
claude-buddy uninstallVerify installation
claude-buddy verify
`Commands
$3
Performs a fresh installation or updates an existing one.
`bash
claude-buddy install [options]
`Options:
-
--target - Target installation directory (default: current directory)
- --force - Force reinstall even if already installed
- --skip-hooks - Skip hook installation
- --dry-run - Preview changes without executing
- --verbose - Enable detailed logging
- --quiet - Suppress all output except errors
- --non-interactive - Run without user prompts (for CI/CD)$3
Updates an existing installation while preserving customizations.
`bash
claude-buddy update [options]
`Options:
-
--preserve-all - Preserve all files (no updates)
- --merge-config - Merge configuration files instead of replacing$3
Removes Claude Buddy from the project.
`bash
claude-buddy uninstall [options]
`Options:
-
--preserve-customizations - Keep user-created files
- --purge - Complete removal including all customizations$3
Verifies installation integrity and shows status.
`bash
claude-buddy verify
`Installation Process
$3
`
.claude/ # Claude Code integration
├── hooks/ # Python safety hooks (requires UV + Python)
├── hooks.json # Configuration (replaces buddy-config.json)
├── commands/ # Slash commands
├── agents/ # Specialized agents
└── skills/ # Auto-activating Claude Code Skills (v2.1.0+)
├── personas/ # 12 persona skills
├── domains/ # 3 domain skills
└── generators/ # 4 generator skillsdirective/ # Project foundation
└── foundation.md # Foundation document template
specs/ # Specification storage
`$3
The
.claude-buddy/ directory has been completely removed in v3.0.0:- ❌
.claude-buddy/buddy-config.json → ✅ .claude/hooks.json (config section)
- ❌ .claude-buddy/personas/ → ✅ .claude/skills/personas/
- ❌ .claude-buddy/templates/ → ✅ .claude/skills/generators/
- ❌ .claude-buddy/context/ → ✅ .claude/skills/domains/Migration Required: If upgrading from v2.x, ensure you have:
1. Configuration in
.claude/hooks.json (v2.2.0+)
2. Skills directory at .claude/skills/ (v2.1.0+)See CHANGELOG.md for migration details.
#### Claude Code Skills
The Skills system provides auto-discovering capabilities that activate based on context:
Persona Skills (12 total):
-
scribe - Professional writer and documentation specialist
- architect - Systems design and architecture specialist
- security - Threat modeling and vulnerability analysis
- frontend - UI/UX and accessibility specialist
- backend - API and reliability engineering
- performance - Optimization and bottleneck elimination
- analyzer - Root cause analysis and investigation
- qa - Quality assurance and testing
- refactorer - Code quality and technical debt management
- devops - Infrastructure and deployment
- mentor - Knowledge transfer and education
- po - Product requirements and strategic planningDomain Skills (3 total):
-
react - React.js development patterns and best practices
- jhipster - JHipster full-stack application development
- mulesoft - MuleSoft integration, DataWeave, and Anypoint PlatformGenerator Skills (4 total):
-
spec-generator - Generate feature specifications from descriptions
- plan-generator - Create implementation plans from specifications
- tasks-generator - Generate task breakdowns from plans
- docs-generator - Create comprehensive technical documentationBenefits:
- 30-70% token savings compared to manual file loading
- Auto-discovery - skills activate based on keywords, file patterns, and context
- Progressive disclosure - supporting files load only when needed
- Skill composition - multiple skills collaborate naturally
See .claude/skills/README.md for detailed documentation.
$3
Required:
- Node.js >= 18.0.0
Optional:
- UV (Python package manager) - enables safety hooks
- Python 3.8+ - enables safety hooks
- Git - enables version control integration
Graceful Degradation:
When optional dependencies are missing, the installer:
- Skips related components with clear warnings
- Installs core functionality successfully
- Provides instructions for enabling skipped features
Configuration
$3
`bash
Installation behavior
CLAUDE_BUDDY_HOME=/path/to/install # Override installation directory
CLAUDE_BUDDY_VERBOSE=1 # Enable verbose logging
CLAUDE_BUDDY_NO_COLOR=1 # Disable color output
CLAUDE_BUDDY_CONFIG=/path/to/.clauderc # Custom config file location
`$3
Create
.claude-buddy-rc.json in your project or home directory:`json
{
"installMode": "project",
"autoUpdate": false,
"preserveCustomizations": true,
"hooks": {
"enabled": true,
"timeout": 10000
},
"logging": {
"level": "normal",
"file": ".claude-buddy/install.log"
}
}
`Exit Codes
The installation script uses standard exit codes:
-
0 - Success
- 1 - General error
- 2 - User cancellation
- 10 - Environment validation failed
- 20 - Dependency missing (required)
- 30 - Permission denied
- 40 - Installation corrupted
- 50 - Transaction failed
- 60 - Rollback requiredAdvanced Usage
$3
`yaml
GitHub Actions example
- name: Install Claude Buddy
run: |
npx claude-buddy install \
--non-interactive \
--target $GITHUB_WORKSPACE \
--skip-hooks
env:
CLAUDE_BUDDY_VERBOSE: 1
`$3
`dockerfile
FROM node:18-alpineInstall Claude Buddy
RUN npx claude-buddy install \
--non-interactive \
--target /appWORKDIR /app
`$3
`javascript
const { execSync } = require('child_process');// Run installation programmatically
execSync('npx claude-buddy install --non-interactive', {
cwd: '/path/to/project',
stdio: 'inherit'
});
`Troubleshooting
$3
Installation fails with permission errors:
`bash
Run with appropriate permissions
sudo claude-buddy installOr change directory ownership
sudo chown -R $USER:$USER /path/to/project
`Hooks not installing:
- Ensure UV is installed:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Verify Python 3.8+: python3 --version
- Retry installation: claude-buddy install --forceUpdate not preserving customizations:
- Use
--preserve-all flag: claude-buddy update --preserve-all
- Check .claude-buddy/install-metadata.json for tracked filesDry-run shows unexpected changes:
- Review current installation:
claude-buddy verify
- Check for manual modifications to framework filesFor more troubleshooting, see TROUBLESHOOTING.md
Performance
$3
- Fresh Installation: < 30 seconds
- Update Operation: < 10 seconds
- Dry-Run Analysis: < 5 seconds
$3
`bash
Faster installation (quiet mode)
claude-buddy install --quietSkip optional components for speed
claude-buddy install --skip-hooks
`Development
$3
`bash
All tests
npm testUnit tests only
npm run test:unitIntegration tests only
npm run test:integrationPerformance tests
npm run test:performance
`$3
`bash
Check for issues
npm run lintAuto-fix issues
npm run lint:fix
`Architecture
$3
-
lib/environment.js - Platform and dependency detection
- lib/manifest.js - Component definitions and validation
- lib/installer.js - Fresh installation logic
- lib/updater.js - Update and preservation logic
- lib/uninstaller.js - Removal logic
- lib/transaction.js - Atomic operations with rollback
- lib/logger.js - Logging and user feedback$3
The installer uses a checkpoint-based transaction system:
1. Pre-install snapshot - Captures current state
2. Planned actions - Defines all operations
3. Execution - Performs actions with validation
4. Checkpoint creation - Saves state at each phase
5. Automatic rollback - Reverts on any failure
Security
$3
The installer protects sensitive files:
-
.env` files are never modifiedAll operations are validated:
- Permission checks before modifications
- Manifest validation before installation
- Integrity verification after completion
See CHANGELOG.md for detailed version history.
For development guidelines and contribution instructions, see the main project CONTRIBUTING.md.
MIT License - see LICENSE for details.
- Documentation: Full Documentation
- Issues: GitHub Issues
- Discussions: GitHub Discussions
---
Built with ❤️ for the Claude Code community