Enhance installation reliability and cross-platform support

- Fix install-bmad.sh line ending issues preventing execution on Git Bash/WSL
  - Add comprehensive error handling and Windows path normalization
  - Create install-bmad.bat for native Windows Command Prompt support
  - Update .gitignore to exclude generated .bmad/ and exam/ directories
  - Add detailed installation troubleshooting guide to README
  - Improve installation verification with better error messages and fallback options

  Resolves installation failures across different platforms and environments.

  🤖 Generated with [Claude Code](https://claude.ai/code)

  Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
AmarBunty 2025-06-10 03:41:37 +05:30
parent ad07aa34cd
commit 26127ec7ef
4 changed files with 645 additions and 231 deletions

15
.gitignore vendored
View File

@ -16,4 +16,19 @@ build/
# Environment variables
.env
# BMAD system and exam implementation
.bmad/
exam/
# IDE and temporary files
.idea/
.vscode/
*.tmp
*.temp
# OS generated files
Thumbs.db
*.swp
*.swo
CLAUDE.md

View File

@ -7,6 +7,8 @@
### Quick Start with Enhanced BMAD System (Recommended for Claude Code Users)
#### Local Installation from Downloaded Repository
**Option 1: Automatic Installation (Recommended)**
```bash
# Download or clone this repository first
git clone https://github.com/your-repo/BMAD-METHOD.git
@ -17,9 +19,32 @@ cp install-bmad.sh /path/to/your-project/
cd /path/to/your-project/
# Run the installation script
chmod +x install-bmad.sh
./install-bmad.sh
```
**Option 2: Windows Users**
```cmd
# Download or clone this repository first
git clone https://github.com/your-repo/BMAD-METHOD.git
cd BMAD-METHOD
# Copy install script to your project directory
copy install-bmad.bat C:\path\to\your-project\
cd C:\path\to\your-project\
# Run the Windows installation script
install-bmad.bat
```
**Option 3: Manual Installation (If scripts fail)**
```bash
# From the BMAD-METHOD directory
mkdir /path/to/your-project/.bmad
cp -r bmad-agent /path/to/your-project/.bmad/
cp -r bmad-system/* /path/to/your-project/.bmad/ 2>/dev/null || true
```
#### Use with Claude Code
After installation, start Claude Code in your project:
```
@ -34,6 +59,41 @@ Please read the documentation and help me build my project using BMAD intelligen
**Enhanced System Features**: 4 autonomy levels, universal LLM integration, enterprise features, self-optimization, 27 comprehensive modules.
#### Installation Troubleshooting
**Common Issues:**
1. **"bmad-agent directory not found" error:**
```bash
# Make sure you're running from BMAD-METHOD root directory
ls -la # Should show bmad-agent/ directory
```
2. **Permission denied errors:**
```bash
# Make script executable (Linux/Mac)
chmod +x install-bmad.sh
# Or use manual installation
mkdir -p .bmad
cp -r /path/to/BMAD-METHOD/bmad-agent .bmad/
```
3. **Windows line ending issues:**
```bash
# Convert line endings if needed
dos2unix install-bmad.sh
# Or use the Windows batch file instead
install-bmad.bat
```
4. **Git Bash/WSL path issues:**
```bash
# Use full paths if relative paths fail
/c/path/to/BMAD-METHOD/install-bmad.sh
```
📚 **Full Documentation**: See `/bmad-system/` directory for complete guides.
---

257
install-bmad.bat Normal file
View File

@ -0,0 +1,257 @@
@echo off
rem Enhanced BMAD System Windows Installation Script
rem Copies BMAD system and agents from local repository to your project
echo 🚀 Installing Enhanced BMAD System from local repository...
echo.
rem Get the directory where this script is located (BMAD repository root)
set "SCRIPT_DIR=%~dp0"
set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
echo 📁 BMAD repository found at: %SCRIPT_DIR%
rem Check if we're in the BMAD repository directory
if not exist "%SCRIPT_DIR%\bmad-agent" (
echo ❌ Error: bmad-agent directory not found
echo Expected location: %SCRIPT_DIR%\bmad-agent
echo.
echo 🔍 Available directories:
dir "%SCRIPT_DIR%" /B /AD 2>nul
echo.
echo 💡 Manual installation alternative:
echo mkdir .bmad
echo xcopy "%SCRIPT_DIR%\bmad-agent" .bmad\bmad-agent\ /E /I /Y
if exist "%SCRIPT_DIR%\bmad-system" (
echo xcopy "%SCRIPT_DIR%\bmad-system" .bmad\ /E /Y
)
pause
exit /b 1
)
rem Create .bmad directory in current project
echo 📁 Creating .bmad directory in your project...
mkdir .bmad 2>nul
if errorlevel 1 (
echo ❌ Error: Failed to create .bmad directory - check write permissions
pause
exit /b 1
)
rem Copy BMAD system documentation (if it exists)
if exist "%SCRIPT_DIR%\bmad-system" (
echo 📚 Copying BMAD system documentation...
xcopy "%SCRIPT_DIR%\bmad-system" .bmad\ /E /Y /Q >nul 2>&1
if errorlevel 1 (
echo ⚠️ Some BMAD system files may not have copied ^(this is okay^)
) else (
echo ✅ BMAD system documentation copied
)
) else (
echo ⚠️ bmad-system directory not found, creating minimal structure...
mkdir .bmad\bmad-system 2>nul
echo # BMAD System Documentation > .bmad\README.md
echo The Enhanced BMAD System provides enterprise-grade AI development capabilities. >> .bmad\README.md
)
rem Copy BMAD agents (essential component)
echo 🤖 Copying BMAD agents...
xcopy "%SCRIPT_DIR%\bmad-agent" .bmad\bmad-agent\ /E /I /Y /Q >nul
if errorlevel 1 (
echo ❌ Error: Failed to copy BMAD agents - this is required for functionality
pause
exit /b 1
)
rem Create CLAUDE.md file for persistent reference
echo 📝 Creating CLAUDE.md reference file...
(
echo # BMAD System Reference for Claude Code
echo.
echo ## Enhanced BMAD System Available
echo.
echo This project has the Enhanced BMAD System installed in the `.bmad/` directory.
echo.
echo ### Quick Start
echo.
echo When starting a new Claude Code session, use this prompt:
echo.
echo ```
echo I have the Enhanced BMAD System installed in my .bmad/ directory.
echo.
echo Please:
echo 1. Read .bmad/README.md to understand the BMAD system capabilities
echo 2. Read .bmad/QUICK_START_CLAUDE_CODE.md for setup guidance
echo 3. Configure BMAD for my project with these settings:
echo - Autonomy Level: Collaborative
echo - Learning: Enabled
echo - Project Type: [describe your project type]
echo - Optimization Focus: [quality/speed/cost]
echo.
echo Available BMAD agents in .bmad/bmad-agent/:
echo - Architect: System architecture and design
echo - Developer: Code implementation and optimization
echo - DevOps: Infrastructure and deployment
echo - Product Manager: Requirements and planning
echo - Analyst: Data analysis and insights
echo.
echo Start BMAD-powered development assistance for my project.
echo ```
echo.
echo ### Key Capabilities
echo.
echo - **4 Autonomy Levels**: Guided → Collaborative → Supervised → Full
echo - **Universal LLM Integration**: Claude, GPT-4, Gemini, DeepSeek, Llama
echo - **Enterprise Features**: Security, compliance, governance, cost optimization
echo - **Self-Optimization**: Continuous learning and improvement
echo - **27 Comprehensive Modules**: Complete development platform
echo - **Specialized Agents**: Expert personas for different roles
echo.
echo ---
echo.
echo *This file ensures Claude Code can always reference the BMAD system capabilities*
) > CLAUDE.md
rem Create project-specific BMAD configuration
echo ⚙️ Creating project configuration...
(
echo # Enhanced BMAD System Project Configuration
echo bmad_config:
echo version: "1.0.0"
echo installation_date: "%date% %time%"
echo project_type: "general" # Options: web_application, mobile_app, enterprise, scientific, gaming
echo autonomy_level: "collaborative" # Options: guided, collaborative, supervised, full
echo
echo optimization_focus:
echo - "quality"
echo - "maintainability"
echo - "performance"
echo
echo learning:
echo enabled: true
echo adapt_to_style: true
echo remember_preferences: true
echo
echo features:
echo code_analysis: true
echo automated_testing: true
echo performance_monitoring: false
echo security_scanning: false
echo cost_optimization: false
echo
echo constraints:
echo no_production_changes: true
echo require_review: false
echo max_autonomy: "supervised"
echo.
echo agents:
echo preferred_personas:
echo - "architect" # System design and architecture
echo - "dev.ide" # IDE-focused development
echo - "analyst" # Analysis and insights
echo
echo available_tasks:
echo - "create-architecture"
echo - "create-frontend-architecture"
echo - "review-infrastructure"
echo - "advanced-elicitation"
echo.
echo # Customize this configuration for your specific project needs
echo # See .bmad/bmad-agent/ directory for available personas and tasks
) > .bmad\project-config.yml
rem Update .gitignore to optionally exclude BMAD
if exist .gitignore (
findstr /C:".bmad/" .gitignore >nul 2>&1
if errorlevel 1 (
echo. >> .gitignore
echo # Enhanced BMAD System ^(uncomment to exclude from git^) >> .gitignore
echo #.bmad/ >> .gitignore
echo 📝 Added optional .bmad/ entry to .gitignore
)
) else (
echo # Enhanced BMAD System ^(uncomment to exclude from git^) > .gitignore
echo #.bmad/ >> .gitignore
echo 📝 Created .gitignore with optional .bmad/ entry
)
rem Verify installation
echo.
echo 🔍 Verifying installation...
set "INSTALLATION_VALID=true"
if not exist .bmad (
echo ❌ .bmad directory not created
set "INSTALLATION_VALID=false"
)
if not exist .bmad\bmad-agent (
echo ❌ BMAD agents not installed
set "INSTALLATION_VALID=false"
)
if not exist CLAUDE.md (
echo ❌ CLAUDE.md reference file not created
set "INSTALLATION_VALID=false"
)
if "%INSTALLATION_VALID%" == "true" (
echo ✅ Enhanced BMAD System installed successfully!
echo.
echo 📁 Installation summary:
echo 📚 BMAD System: .bmad/ ^(documentation and modules^)
echo 🤖 BMAD Agents: .bmad/bmad-agent/ ^(personas and tasks^)
echo 📝 Claude Reference: CLAUDE.md ^(persistent reference^)
echo ⚙️ Configuration: .bmad/project-config.yml
echo.
echo 📊 Files installed:
rem Count files
for /f %%i in ('dir .bmad\*.md /s /b 2^>nul ^| find /c /v ""') do set MD_COUNT=%%i
for /f %%i in ('dir .bmad\*.yml .bmad\*.yaml /s /b 2^>nul ^| find /c /v ""') do set YML_COUNT=%%i
echo Documentation files: %MD_COUNT%
echo Configuration files: %YML_COUNT%
echo.
echo 🎯 Next steps:
echo 1. Open Claude Code in this project directory
echo 2. Reference CLAUDE.md for the startup prompt
echo 3. Start with: 'I have Enhanced BMAD System in .bmad/ directory'
echo 4. Let Claude read the documentation and begin BMAD-powered development
echo.
echo 📚 Key files to mention to Claude:
echo - .bmad/README.md ^(system overview^)
if exist .bmad\QUICK_START_CLAUDE_CODE.md (
echo - .bmad/QUICK_START_CLAUDE_CODE.md ^(setup guide^)
)
echo - .bmad/bmad-agent/ ^(specialized agents^)
echo - CLAUDE.md ^(reference guide^)
echo.
echo 🆘 If you encounter issues:
echo - Make sure you're in your target project directory
echo - Check file permissions if copying failed
echo - Run script from the BMAD-METHOD repository root
echo - Use the manual installation commands shown above if needed
) else (
echo ❌ Installation completed with errors. Manual steps:
echo.
echo 📝 Manual installation commands:
echo mkdir .bmad
echo xcopy "%SCRIPT_DIR%\bmad-agent" .bmad\bmad-agent\ /E /I /Y
if exist "%SCRIPT_DIR%\bmad-system" (
echo xcopy "%SCRIPT_DIR%\bmad-system" .bmad\ /E /Y
)
echo.
echo 🔍 Check:
echo 1. You have write permissions in current directory
echo 2. Source files exist in BMAD repository
echo 3. No conflicts with existing .bmad directory
pause
exit /b 1
)
echo.
echo 🚀 Enhanced BMAD System ready!
echo Welcome to the future of AI-powered development! 🎉
echo.
pause

View File

@ -10,24 +10,70 @@ echo ""
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
echo "📁 BMAD repository found at: $SCRIPT_DIR"
# Check if we're in the BMAD repository directory
if [ ! -d "$SCRIPT_DIR/bmad-system" ] || [ ! -d "$SCRIPT_DIR/bmad-agent" ]; then
echo "❌ Error: This script must be run from the BMAD-METHOD repository directory"
echo " Make sure you have bmad-system/ and bmad-agent/ directories"
# Function to check if command succeeded
check_success() {
if [ $? -ne 0 ]; then
echo "❌ Error: $1"
exit 1
fi
}
# Function to convert Windows paths to Unix-style for Git Bash/WSL
normalize_path() {
local path="$1"
# Convert Windows drive letters (C:\ -> /c/)
if [[ "$path" =~ ^[A-Za-z]: ]]; then
path=$(echo "$path" | sed 's|^\([A-Za-z]\):|/\L\1|' | tr '\\' '/')
fi
echo "$path"
}
# Normalize script directory path
SCRIPT_DIR=$(normalize_path "$SCRIPT_DIR")
# Check if we're in the BMAD repository directory (flexible check)
if [ ! -d "$SCRIPT_DIR/bmad-agent" ]; then
echo "❌ Error: bmad-agent directory not found"
echo " Expected location: $SCRIPT_DIR/bmad-agent"
echo ""
echo "🔍 Available directories:"
ls -la "$SCRIPT_DIR" 2>/dev/null || echo " Cannot list directory contents"
echo ""
echo "💡 Manual installation alternative:"
echo " mkdir -p .bmad"
echo " cp -r $SCRIPT_DIR/bmad-agent .bmad/"
if [ -d "$SCRIPT_DIR/bmad-system" ]; then
echo " cp -r $SCRIPT_DIR/bmad-system/* .bmad/"
fi
exit 1
fi
# Create .bmad directory in current project
echo "📁 Creating .bmad directory in your project..."
mkdir -p .bmad
check_success "Failed to create .bmad directory - check write permissions"
# Copy BMAD system documentation
echo "📚 Copying BMAD system documentation..."
cp -r "$SCRIPT_DIR/bmad-system"/* .bmad/
# Copy BMAD system documentation (if it exists)
if [ -d "$SCRIPT_DIR/bmad-system" ]; then
echo "📚 Copying BMAD system documentation..."
cp -r "$SCRIPT_DIR/bmad-system"/* .bmad/ 2>/dev/null
if [ $? -eq 0 ]; then
echo " ✅ BMAD system documentation copied"
else
echo " ⚠️ Some BMAD system files may not have copied (this is okay)"
fi
else
echo "⚠️ bmad-system directory not found, creating minimal structure..."
# Create minimal required files
mkdir -p .bmad/bmad-system
echo "# BMAD System Documentation" > .bmad/README.md
echo "The Enhanced BMAD System provides enterprise-grade AI development capabilities." >> .bmad/README.md
fi
# Copy BMAD agents
# Copy BMAD agents (essential component)
echo "🤖 Copying BMAD agents..."
cp -r "$SCRIPT_DIR/bmad-agent" .bmad/
check_success "Failed to copy BMAD agents - this is required for functionality"
# Create CLAUDE.md file for persistent reference
echo "📝 Creating CLAUDE.md reference file..."
@ -190,8 +236,26 @@ fi
# Verify installation
echo ""
echo "🔍 Verifying installation..."
if [ -d .bmad/bmad-system ] || [ -f .bmad/README.md ]; then
if [ -d .bmad/bmad-agent ]; then
# Check critical components
INSTALLATION_VALID=true
if [ ! -d .bmad ]; then
echo "❌ .bmad directory not created"
INSTALLATION_VALID=false
fi
if [ ! -d .bmad/bmad-agent ]; then
echo "❌ BMAD agents not installed"
INSTALLATION_VALID=false
fi
if [ ! -f CLAUDE.md ]; then
echo "❌ CLAUDE.md reference file not created"
INSTALLATION_VALID=false
fi
if [ "$INSTALLATION_VALID" = true ]; then
echo "✅ Enhanced BMAD System installed successfully!"
echo ""
echo "📁 Installation summary:"
@ -201,8 +265,13 @@ if [ -d .bmad/bmad-system ] || [ -f .bmad/README.md ]; then
echo " ⚙️ Configuration: .bmad/project-config.yml"
echo ""
echo "📊 Files installed:"
find .bmad -name "*.md" | wc -l | xargs echo " Documentation files:"
find .bmad -name "*.yml" -o -name "*.yaml" | wc -l | xargs echo " Configuration files:"
# Count files more reliably
MD_COUNT=$(find .bmad -name "*.md" 2>/dev/null | wc -l)
YML_COUNT=$(find .bmad -name "*.yml" -o -name "*.yaml" 2>/dev/null | wc -l)
echo " Documentation files: $MD_COUNT"
echo " Configuration files: $YML_COUNT"
echo ""
echo "🎯 Next steps:"
echo "1. Open Claude Code in this project directory"
@ -212,18 +281,31 @@ if [ -d .bmad/bmad-system ] || [ -f .bmad/README.md ]; then
echo ""
echo "📚 Key files to mention to Claude:"
echo " - .bmad/README.md (system overview)"
if [ -f .bmad/QUICK_START_CLAUDE_CODE.md ]; then
echo " - .bmad/QUICK_START_CLAUDE_CODE.md (setup guide)"
fi
echo " - .bmad/bmad-agent/ (specialized agents)"
echo " - CLAUDE.md (reference guide)"
else
echo "⚠️ BMAD system installed but agents directory missing"
echo " Please check that bmad-agent/ directory exists in source"
fi
echo ""
echo "🆘 If you encounter issues:"
echo " - Make sure you're in your target project directory"
echo " - Check file permissions if copying failed"
echo " - Run script from the BMAD-METHOD repository root"
echo " - Use the manual installation commands shown above if needed"
else
echo "❌ Installation failed. Please check:"
echo " 1. You're running this from the BMAD-METHOD directory"
echo " 2. bmad-system/ and bmad-agent/ directories exist"
echo " 3. You have write permissions in current directory"
echo "❌ Installation completed with errors. Manual steps:"
echo ""
echo "📝 Manual installation commands:"
echo " mkdir -p .bmad"
echo " cp -r '$SCRIPT_DIR/bmad-agent' .bmad/"
if [ -d "$SCRIPT_DIR/bmad-system" ]; then
echo " cp -r '$SCRIPT_DIR/bmad-system'/* .bmad/"
fi
echo ""
echo "🔍 Check:"
echo " 1. You have write permissions in current directory"
echo " 2. Source files exist in BMAD repository"
echo " 3. No conflicts with existing .bmad directory"
exit 1
fi