Skip to content

V1.0

Latest

Choose a tag to compare

@laraben laraben released this 03 Jul 09:22
· 3 commits to main since this release

🚀 Laravel Claude Code Setup Script v1.0

The Complete AI Development Environment for Laravel Projects

Transform your Laravel development workflow with AI-powered assistance through comprehensive MCP (Model Context Protocol) server integration. This script automatically configures Claude Code with a full suite of tools specifically designed for Laravel + Livewire + Filament + Alpine.js + Tailwind CSS development.

🎨 Figma Integration

  • Framelink Figma MCP Server integration with proper authentication
  • Design-to-Code workflow - Convert Figma designs directly to Laravel/Livewire components
  • Design token extraction - Automatically extract colors, typography, and spacing for Tailwind CSS
  • Component specifications - Get precise implementation details from Figma designs
  • Interactive token management - Easy setup and update of Figma API tokens

🔧 Enhanced Token Management

  • Interactive token updates - Properly prompt users for new tokens when updating
  • Better error handling - Graceful fallbacks when token input fails
  • Improved detection - Smart detection of existing tokens in environment and config files
  • Non-interactive mode support - Works seamlessly in CI/CD environments

🧠 Advanced Interactive Detection

  • Curl pipe support - Works correctly when run via curl | bash
  • Terminal detection - Proper distinction between interactive and non-interactive modes
  • Controlling terminal access - Uses /dev/tty for reliable input in piped scenarios
  • Fallback mechanisms - Handles edge cases in different shell environments

🛠️ Complete Feature Set

🌐 Global MCP Servers (Shared across all projects)

  • GitHub MCP - Full repository access and management
  • Memory MCP - Persistent knowledge base across sessions
  • Context7 MCP - Latest Laravel/framework documentation access
  • Web Fetch MCP - External API and resource integration
  • Figma MCP - Design file access and design-to-code workflows

📁 Project-Specific MCP Servers

  • Filesystem MCP - Direct file system access for current project
  • Database MCP - Direct database queries and schema analysis
  • Laravel DebugBar MCP - Debug information integration (if installed)

🏗️ Automated Setup

  • Environment detection - Automatically detects Laravel projects and configurations
  • Database configuration - Supports MySQL, PostgreSQL, and SQLite
  • Dependency management - Installs and configures all required MCP servers
  • Error recovery - Robust error handling with graceful fallbacks

📚 AI-Optimized Documentation

  • Project-specific instructions - Tailored guidance for your Laravel stack
  • Coding standards - Laravel/Livewire/Filament/Alpine/Tailwind best practices
  • Development shortcuts - Useful aliases and commands
  • Memory initialization - Pre-configured context for better AI assistance

🎯 Perfect for Laravel Developers Using

  • Laravel Framework - Full Laravel application development
  • Livewire - Dynamic components and real-time interfaces
  • Filament - Admin panels and complex forms
  • Alpine.js - Lightweight frontend interactivity
  • Tailwind CSS - Utility-first styling
  • Figma - Design system integration and design-to-code workflows

🚀 Quick Start

One-Line Installation

curl -fsSL https://raw.githubusercontent.com/laraben/laravel-claude-code-setup/main/install.sh | bash

Interactive Setup

# Download and run interactively
curl -fsSL https://raw.githubusercontent.com/laraben/laravel-claude-code-setup/main/install.sh -o setup.sh
chmod +x setup.sh
./setup.sh

Prerequisites

  • Claude Code - Download from [claude.ai/code](https://claude.ai/code)
  • Node.js & npm - For MCP server dependencies
  • Go 1.22+ - For database MCP server
  • Laravel Project - Run from your Laravel project root

📋 What Gets Installed

MCP Servers Installed

  • @modelcontextprotocol/server-github - GitHub integration
  • @modelcontextprotocol/server-memory - Persistent memory
  • @modelcontextprotocol/server-filesystem - File system access
  • figma-developer-mcp - Figma design integration
  • Context7 - Documentation access
  • Web Fetch - External API access
  • Database MCP - Direct database access
  • Laravel DebugBar MCP - Debug integration (optional)

Project Files Created

.claude/
├── instructions.md         # AI-optimized development instructions
├── project_context.md     # Project-specific context
├── coding_standards.md    # Laravel/Livewire best practices
├── memory_prompts.md      # AI memory initialization
├── shortcuts.sh           # Development aliases
├── README.md              # Setup documentation
└── memory/                # AI memory storage

🎨 Figma Integration Highlights

Design-to-Code Workflow

1. Share Figma URL with Claude
2. Claude analyzes design structure
3. Extract design tokens automatically
4. Generate Laravel/Livewire components
5. Apply Tailwind CSS styling
6. Implement Alpine.js interactions

Example Usage

# Analyze a Figma design
> Please analyze this Figma design: https://www.figma.com/design/ABC123/MyProject

# Convert to Laravel component
> Convert this Figma button to a Livewire component with Tailwind CSS

# Extract design tokens
> Extract the color palette and typography from this Figma file for Tailwind config

🔧 Technical Improvements

Enhanced Error Handling

  • Graceful fallbacks when MCP servers fail to install
  • Automatic retries with exponential backoff
  • Clear error messages with actionable solutions
  • Partial installation support - Continue even if some servers fail

Smart Configuration

  • Automatic token detection from environment variables
  • Config file integration - Seamless Claude Code configuration
  • Project-specific settings - Unique MCP server instances per project
  • Backup creation - Automatic config backups before changes

Cross-Platform Support

  • macOS optimized - Homebrew integration for dependencies
  • Linux compatible - Universal package manager support
  • Windows support - WSL and native Windows compatibility

📊 Performance & Reliability

Optimized Installation

  • Parallel installations where possible
  • Smart caching - Reuse existing installations
  • Minimal downloads - Only install what's needed
  • Fast startup - Optimized MCP server configurations

Production Ready

  • Comprehensive testing - Tested across multiple environments
  • Rollback support - Easy removal and cleanup
  • Documentation - Extensive usage guides and troubleshooting

🤝 AI Assistant Optimization

Context-Aware Development

  • Project understanding - AI knows your Laravel stack preferences
  • Best practice enforcement - Follows Laravel/Livewire conventions
  • Design system integration - Consistent component development
  • Memory persistence - Learns from your coding patterns

Intelligent Assistance

  • Code generation - Laravel-optimized components and features
  • Database queries - Direct database analysis and optimization
  • Documentation access - Latest Laravel/framework documentation
  • Design implementation - Figma-to-code conversion

📖 Documentation & Support

Getting Started

  • Setup guide - Step-by-step installation instructions
  • Configuration - Customization options and settings
  • Troubleshooting - Common issues and solutions
  • Best practices - Optimal usage patterns

Advanced Usage

  • Custom MCP servers - Adding additional integrations
  • Multiple projects - Managing multiple Laravel projects
  • Team setup - Sharing configurations across teams
  • CI/CD integration - Automated environment setup

🔗 Links & Resources

💡 Usage Tips

Development Shortcuts

# Load helpful aliases
source .claude/shortcuts.sh

# Quick commands
pa migrate              # php artisan migrate
make-livewire Button   # php artisan make:livewire Button
serve                  # php artisan serve

AI Interaction Examples

# Project analysis
> Show me the project structure and suggest improvements

# Database operations
> What tables are in my database and how are they related?

# Figma integration
> Analyze this Figma design and create the corresponding Livewire components

# Code generation
> Create a Filament resource for managing users with proper validation

🎉 Get Started Today!

Transform your Laravel development with AI-powered assistance. This script sets up everything you need for a modern, AI-enhanced development workflow.

Install now:

curl -fsSL https://raw.githubusercontent.com/laraben/laravel-claude-code-setup/main/install.sh | bash

Happy coding with AI! 🚀