Skip to content

Commit 4cd2803

Browse files
committed
wip
1 parent 60db903 commit 4cd2803

File tree

2 files changed

+119
-160
lines changed

2 files changed

+119
-160
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -416,19 +416,21 @@ npx playwright install
416416
# Solution: This is expected - the official server is deprecated but still functional
417417
```
418418

419-
**Claude Code Can't Access Context Files**
419+
**Claude Code Can't Find Project Standards**
420420
```bash
421-
# Issue: Claude Code can't find .claude/context files when asked about coding standards
422-
# Cause: Missing .claude_config file or .claude directory not in ALLOWED_DIRECTORIES
421+
# Issue: Claude Code can't find coding standards when asked
422+
# Cause: Context files not in discoverable locations
423423

424-
# Solution 1: Ensure .claude_config exists in project root
425-
ls -la .claude_config
424+
# Solution 1: Check if top-level files exist
425+
ls -la CODING-STANDARDS.md PROJECT-OVERVIEW.md
426426

427427
# Solution 2: If missing, re-run setup script
428428
./setup.sh
429429

430-
# Solution 3: Restart Claude Code to reload configuration
431-
# Close and reopen Claude Code after creating .claude_config
430+
# Solution 3: Ask specific questions
431+
# "Read the CODING-STANDARDS.md file"
432+
# "What's in the .claude/context/ directory?"
433+
# "Show me the project overview from PROJECT-OVERVIEW.md"
432434
```
433435

434436
**Understanding Database MCP Server Installation**

setup.sh

Lines changed: 110 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,98 +1260,82 @@ EOF
12601260
# Install NetSuite context (optional)
12611261
copy_or_download_context_file "netsuite_context.md" "NetSuite context" || print_status "NetSuite context skipped (project-specific)"
12621262

1263-
# Create project-specific .claude_config file
1264-
print_status "Creating project-specific Claude configuration..."
1265-
cat > ".claude_config" << 'EOF'
1266-
{
1267-
"mcpServers": {
1268-
"filesystem": {
1269-
"command": "npx",
1270-
"args": ["-y", "@modelcontextprotocol/server-filesystem"],
1271-
"env": {
1272-
"ALLOWED_DIRECTORIES": [
1273-
".",
1274-
"./.claude",
1275-
"./app",
1276-
"./resources",
1277-
"./database",
1278-
"./config",
1279-
"./routes",
1280-
"./tests",
1281-
"./storage",
1282-
"./public",
1283-
"./vendor"
1284-
]
1285-
}
1286-
},
1287-
"git": {
1288-
"command": "npx",
1289-
"args": ["-y", "@modelcontextprotocol/server-git"]
1290-
}
1291-
},
1292-
"rules": [
1293-
{
1294-
"pattern": "**/config/*.php",
1295-
"instructions": "Use kebab-case for config file names, snake_case for config keys. Avoid env() helper outside config files. Use Laravel 12 configuration patterns and new config features."
1296-
},
1297-
{
1298-
"pattern": "**/*.php",
1299-
"instructions": "Follow Laravel 12 conventions strictly. Use PSR-12 standards, constructor property promotion, typed properties, and the new Attribute class for accessors/mutators. Use FluxUI components for UI elements. Follow modern Laravel patterns including new validation syntax and enhanced model features."
1300-
},
1301-
{
1302-
"pattern": "**/app/Models/*.php",
1303-
"instructions": "Use Laravel 12 model features: Attribute class for accessors/mutators, #[Scope] attribute for query scopes, proper casting with enum support, new validation methods, and enhanced relationship definitions. Always use typed properties and constructor promotion where applicable."
1304-
},
1305-
{
1306-
"pattern": "**/routes/*.php",
1307-
"instructions": "Use kebab-case URLs, camelCase route names and parameters. Use route tuple notation [Controller::class, 'method']. Put HTTP verbs first when defining routes. Use Laravel 12 route model binding enhancements."
1308-
},
1309-
{
1310-
"pattern": "**/app/Http/Controllers/*.php",
1311-
"instructions": "Use plural resource names for controllers. Stick to CRUD keywords (index, create, store, show, edit, update, destroy). Extract new controllers for non-CRUD actions. Use Laravel 12 request validation and response patterns."
1312-
},
1313-
{
1314-
"pattern": "**/resources/views/**/*.blade.php",
1315-
"instructions": "Use camelCase for view files. Prefer FluxUI components over custom HTML/CSS. Use Flux components for forms, buttons, modals, etc. Indent with 4 spaces. Use {{ __() }} for translations."
1316-
},
1317-
{
1318-
"pattern": "**/app/Livewire/*.php",
1319-
"instructions": "Follow Livewire 3.x best practices with Laravel 12. Use Livewire Volt for class-based components - prefer functional components over traditional class components. Use FluxUI components in Livewire views. Use public properties for data binding. Implement proper validation with Laravel 12 validation features. Use wire:model for form inputs."
1320-
},
1321-
{
1322-
"pattern": "**/resources/views/livewire/**/*.blade.php",
1323-
"instructions": "Create Livewire Volt functional components using <?php use() ?> syntax at the top of blade files. Prefer Volt functional components over traditional class-based components. Use FluxUI components exclusively. Follow Volt patterns for state management and actions."
1324-
},
1325-
{
1326-
"pattern": "**/resources/js/**/*.js",
1327-
"instructions": "Use Alpine.js patterns that complement FluxUI components. Keep JavaScript minimal and declarative. Use x-data, x-show, x-if appropriately. Follow Alpine.js conventions and work seamlessly with FluxUI."
1328-
},
1329-
{
1330-
"pattern": "**/resources/css/**/*.css",
1331-
"instructions": "Use Tailwind CSS utility classes. FluxUI provides most styling - only add custom CSS when FluxUI components don't cover the use case. Follow FluxUI design system principles."
1332-
},
1333-
{
1334-
"pattern": "**/database/migrations/*.php",
1335-
"instructions": "Use Laravel 12 migration features including new column types, enhanced indexing, and improved foreign key constraints. Use descriptive migration names following Laravel conventions."
1336-
},
1337-
{
1338-
"pattern": "**/tests/**/*.php",
1339-
"instructions": "Follow Laravel 12 testing conventions with Pest PHP preferred. Use Feature tests for HTTP requests, Unit tests for models and services. Use Laravel 12 testing helpers and assertions."
1340-
},
1341-
{
1342-
"pattern": "**/bootstrap/app.php",
1343-
"instructions": "Use Laravel 12 Application class patterns for configuring middleware, events, and exceptions. Register middleware through withMiddleware(), events through withEvents(), and exception handling through withExceptions(). Follow the streamlined bootstrap configuration approach."
1344-
},
1345-
{
1346-
"pattern": "**/.claude/**/*.md",
1347-
"instructions": "These are project context files containing coding standards, development guidelines, and project-specific documentation. Reference these files when asked about project conventions, standards, tech stack, or development patterns. These files contain the definitive coding standards and development guidelines for this Laravel 12 project."
1348-
}
1349-
],
1350-
"customInstructions": "You are an expert Laravel 12 developer using FluxUI for component-based development and Livewire Volt for functional components. You build production-quality applications using Laravel 12, Livewire 3.x with Volt, Alpine.js, FluxUI, and Tailwind CSS. Always prefer Livewire Volt functional components over traditional class-based components. Use Laravel 12 features like the new Attribute class for accessors/mutators, enhanced validation, improved model features, and modern syntax. Use FluxUI components for all UI elements instead of building custom components. Follow PSR-12 standards, use typed properties, constructor property promotion, and maintain clean, readable code with proper separation of concerns.\n\nIMPORTANT: When asked about coding standards, project conventions, tech stack, or development patterns, always check the .claude/context/ directory first. This directory contains comprehensive project documentation including coding-standards.md, project-context.md, and various development guidelines that define the specific standards for this project."
1351-
}
1263+
# Create highly discoverable coding standards files that Claude will find
1264+
print_status "Creating discoverable project documentation..."
1265+
1266+
# Create a top-level CODING-STANDARDS.md file
1267+
cat > "CODING-STANDARDS.md" << EOF
1268+
# Coding Standards for this Laravel 12 Project
1269+
1270+
## 🎯 Project Tech Stack
1271+
- **Laravel 12** with modern PHP 8.3+ features
1272+
- **FluxUI** for pre-built components
1273+
- **Livewire 3.x + Volt** for reactive server-side components
1274+
- **Alpine.js** for minimal client-side JavaScript
1275+
- **Tailwind CSS** for utility-first styling
1276+
- **Pest PHP** for modern testing
1277+
1278+
## 🔧 Key Development Rules
1279+
1280+
### Laravel 12 Features (REQUIRED)
1281+
- **Use Attribute class** for accessors/mutators (NOT old \`getNameAttribute\` style)
1282+
- **Use #[Scope] attribute** for query scopes
1283+
- **Constructor property promotion** and **typed properties**
1284+
- **Modern Application class** in bootstrap/app.php
1285+
1286+
### Component Strategy (CRITICAL)
1287+
- **ALWAYS use FluxUI components** instead of custom HTML/CSS
1288+
- **PREFER Livewire Volt functional components** over traditional class components
1289+
- **Use Alpine.js minimally** - only to complement FluxUI
1290+
1291+
### Code Quality
1292+
- **PSR-12 standards** with Laravel Pint formatting
1293+
- **Pest PHP** for all tests (Feature and Unit)
1294+
- **Typed properties and return types**
1295+
- **Meaningful variable names**
1296+
1297+
## 📁 Complete Documentation
1298+
1299+
For comprehensive guidelines, see the \`.claude/context/\` directory:
1300+
1301+
- \`coding-standards.md\` - Detailed project standards
1302+
- \`project-context.md\` - Full project overview
1303+
- \`laravel12_guidelines.md\` - Laravel 12 specific patterns
1304+
- \`fluxui_guidelines.md\` - FluxUI component usage
1305+
- \`livewire_volt_guidelines.md\` - Volt patterns and examples
1306+
1307+
Generated: $(date)
1308+
EOF
1309+
1310+
# Create PROJECT-OVERVIEW.md for high-level context
1311+
cat > "PROJECT-OVERVIEW.md" << EOF
1312+
# Project Overview
1313+
1314+
## Technology Stack
1315+
This is a **Laravel 12** project using:
1316+
- **FluxUI** for UI components
1317+
- **Livewire Volt** for functional components
1318+
- **Alpine.js** + **Tailwind CSS** for frontend
1319+
- **Pest PHP** for testing
1320+
1321+
## Development Approach
1322+
- Component-first development with FluxUI
1323+
- Server-side rendering with Livewire
1324+
- Modern Laravel 12 patterns and features
1325+
- Comprehensive testing with Pest
1326+
1327+
## Documentation Location
1328+
Complete development guidelines are in \`.claude/context/\`:
1329+
- Coding standards
1330+
- Component patterns
1331+
- Laravel 12 features
1332+
- Testing approaches
1333+
- Project structure
1334+
1335+
**When asking about coding standards or development patterns, always reference the files in \`.claude/context/\` for complete information.**
1336+
1337+
Generated: $(date)
13521338
EOF
1353-
print_success "Claude configuration created (.claude_config)"
1354-
print_status "This file enables Claude Code to access your .claude/context/ files"
13551339

13561340
# Create FluxUI quick reference
13571341
print_status "Creating FluxUI quick reference..."
@@ -1433,59 +1417,6 @@ EOF
14331417
</flux:table>
14341418
\`\`\`
14351419
1436-
### Modal Form
1437-
\`\`\`blade
1438-
<flux:modal wire:model="showModal" name="user-modal">
1439-
<flux:modal.header>
1440-
<flux:heading>{{ \$editing ? 'Edit' : 'Create' }} User</flux:heading>
1441-
</flux:modal.header>
1442-
1443-
<flux:modal.body>
1444-
<div class="space-y-4">
1445-
<flux:field>
1446-
<flux:label>Name</flux:label>
1447-
<flux:input wire:model="form.name" />
1448-
<flux:error name="form.name" />
1449-
</flux:field>
1450-
1451-
<flux:field>
1452-
<flux:label>Email</flux:label>
1453-
<flux:input wire:model="form.email" type="email" />
1454-
<flux:error name="form.email" />
1455-
</flux:field>
1456-
</div>
1457-
</flux:modal.body>
1458-
1459-
<flux:modal.footer>
1460-
<flux:button variant="primary" wire:click="save">
1461-
{{ \$editing ? 'Update' : 'Create' }}
1462-
</flux:button>
1463-
<flux:button variant="outline" wire:click="\$set('showModal', false)">
1464-
Cancel
1465-
</flux:button>
1466-
</flux:modal.footer>
1467-
</flux:modal>
1468-
\`\`\`
1469-
1470-
## Styling Guidelines
1471-
1472-
### Component Variants
1473-
- **primary**: Main actions (save, submit, confirm)
1474-
- **outline**: Secondary actions (cancel, back)
1475-
- **danger**: Destructive actions (delete, remove)
1476-
1477-
### Colors
1478-
- **blue**: Primary/info states
1479-
- **green**: Success states
1480-
- **red**: Error/danger states
1481-
- **yellow**: Warning states
1482-
- **gray**: Neutral states
1483-
1484-
### Sizes
1485-
- **sm**: Small components for compact layouts
1486-
- **md**: Default size for most use cases
1487-
- **lg**: Large components for emphasis
1488-
14891420
Generated: $(date)
14901421
EOF
14911422

@@ -1548,6 +1479,34 @@ EOF
15481479

15491480
chmod +x ".claude/shortcuts.sh"
15501481

1482+
# Update main project README if it exists
1483+
if [ -f "README.md" ]; then
1484+
print_status "Adding coding standards section to existing README.md..."
1485+
# Check if our section already exists
1486+
if ! grep -q "## 🎯 Coding Standards" README.md; then
1487+
cat >> "README.md" << EOF
1488+
1489+
## 🎯 Coding Standards
1490+
1491+
This Laravel 12 project follows specific coding standards documented in:
1492+
1493+
- **Complete Standards**: \`.claude/context/coding-standards.md\`
1494+
- **Project Context**: \`.claude/context/project-context.md\`
1495+
- **Laravel 12 Guidelines**: \`.claude/context/laravel12_guidelines.md\`
1496+
- **FluxUI Patterns**: \`.claude/context/fluxui_guidelines.md\`
1497+
- **Livewire Volt**: \`.claude/context/livewire_volt_guidelines.md\`
1498+
1499+
### Key Points
1500+
- Use **Laravel 12 Attribute class** for accessors/mutators
1501+
- Prefer **Livewire Volt functional components**
1502+
- Always use **FluxUI components** instead of custom HTML
1503+
- Follow **PSR-12** with **Laravel Pint** formatting
1504+
- Use **Pest PHP** for testing
1505+
1506+
EOF
1507+
fi
1508+
fi
1509+
15511510
# Create README
15521511
print_status "Creating project README..."
15531512
cat > ".claude/README.md" << EOF
@@ -1592,7 +1551,7 @@ This Laravel 12 project has been configured with Claude Code and optimized MCP s
15921551
3. Start development:
15931552
\`\`\`bash
15941553
npm run dev # Start Vite dev server
1595-
pas # Start Laravel development server
1554+
herd open # Open project in browser
15961555
\`\`\`
15971556
15981557
## Key Features
@@ -1629,7 +1588,7 @@ This Laravel 12 project has been configured with Claude Code and optimized MCP s
16291588
- Coding standards: \`.claude/context/coding-standards.md\`
16301589
- FluxUI reference: \`.claude/context/fluxui-reference.md\`
16311590
1632-
Generated: $(date)
1591+
Generated: $(date)
16331592
Happy coding with Laravel 12 + FluxUI + Claude Code! 🚀
16341593
EOF
16351594

@@ -1652,7 +1611,8 @@ EOF
16521611
)
16531612

16541613
local project_files=(
1655-
".claude_config"
1614+
"CODING-STANDARDS.md"
1615+
"PROJECT-OVERVIEW.md"
16561616
)
16571617

16581618
local optional_files=(
@@ -1918,16 +1878,13 @@ main() {
19181878
echo " npm run dev # Vite development server"
19191879
echo " herd open # Open project in browser (Herd automatically serves Laravel)"
19201880
echo ""
1921-
echo "3. Restart Claude Code to load configuration:"
1922-
echo " - Close and reopen Claude Code to load .claude_config"
1923-
echo " - This enables access to project context files"
1924-
echo ""
1925-
echo "4. Test Claude Code integration:"
1881+
echo "3. Test Claude Code integration:"
19261882
echo " - Ask Claude: 'What are the coding standards for this project?'"
19271883
echo " - Try: 'Show me the project structure'"
19281884
echo " - Test: 'What's in my database?' (if database is configured)"
1885+
echo " - Note: Context files are now in discoverable locations (CODING-STANDARDS.md, PROJECT-OVERVIEW.md)"
19291886
echo ""
1930-
echo "5. Start building with FluxUI:"
1887+
echo "4. Start building with FluxUI:"
19311888
echo " - Use FluxUI components instead of custom HTML"
19321889
echo " - Follow Laravel 12 patterns (new Attribute class)"
19331890
echo " - Write tests with Pest PHP"

0 commit comments

Comments
 (0)