Web Development(CLAUDE-MD-Web-Development)
Full-stack web applications
ReactVueAngular projectsFrontend/Backend coordinationAPI patterns
๐ CLAUDE.md Template - Web Development
๐จ CRITICAL: WEB DEVELOPMENT PARALLEL EXECUTION
MANDATORY RULE: For web development projects, ALL operations MUST be concurrent/parallel:
๐ด WEB-SPECIFIC CONCURRENT PATTERNS:
- Frontend/Backend Parallel: Always develop frontend and backend components simultaneously
- Component Development: Create multiple UI components in parallel
- API Endpoints: Build multiple API routes concurrently
- Testing Suites: Generate frontend and backend tests in parallel
- Asset Processing: Handle CSS, images, and static assets concurrently
โก WEB DEVELOPMENT GOLDEN RULE: "FULL-STACK PARALLEL EXECUTION"
โ CORRECT Web Development Pattern:
// Single Message - Full-Stack Parallel Development
[BatchTool]:
// Frontend Components (Parallel)
- Write("src/components/Header.tsx", headerContent)
- Write("src/components/Navigation.tsx", navContent)
- Write("src/components/Dashboard.tsx", dashboardContent)
- Write("src/components/UserProfile.tsx", profileContent)
// Backend API Routes (Parallel)
- Write("server/routes/auth.js", authRoutes)
- Write("server/routes/users.js", userRoutes)
- Write("server/routes/dashboard.js", dashboardRoutes)
// Database Models (Parallel)
- Write("server/models/User.js", userModel)
- Write("server/models/Session.js", sessionModel)
// Tests (Parallel)
- Write("tests/frontend/components.test.js", frontendTests)
- Write("tests/backend/api.test.js", backendTests)
// Configuration (Parallel)
- Write("package.json", packageConfig)
- Write("webpack.config.js", webpackConfig)
- Write("server.js", serverSetup)
๐ฏ WEB PROJECT CONTEXT
Project Type
- ๐ Full Stack Web Application
- Frontend: React/Vue/Angular + TypeScript
- Backend: Node.js/Express + RESTful API
- Database: PostgreSQL/MongoDB + ORM/ODM
- Styling: Tailwind CSS/Styled Components
Architecture Pattern
- Frontend: Component-based architecture with state management
- Backend: MVC pattern with middleware layers
- API: RESTful design with OpenAPI documentation
- Database: Normalized schema with migrations
๐ง WEB DEVELOPMENT PATTERNS
Frontend Development Standards
// Component Structure (Always create in parallel)
src/
โโโ components/ // UI Components (parallel creation)
โ โโโ common/ // Shared components
โ โโโ forms/ // Form components
โ โโโ layout/ // Layout components
โโโ pages/ // Page components (parallel)
โโโ hooks/ // Custom hooks (parallel)
โโโ services/ // API services (parallel)
โโโ store/ // State management
โโโ utils/ // Utility functions
โโโ styles/ // Styling files
Backend Development Standards
// Server Structure (Always create in parallel)
server/
โโโ routes/ // API routes (parallel creation)
โโโ controllers/ // Business logic (parallel)
โโโ models/ // Database models (parallel)
โโโ middleware/ // Custom middleware (parallel)
โโโ services/ // External services
โโโ utils/ // Server utilities
โโโ config/ // Configuration files
โโโ tests/ // Backend tests
Concurrent File Creation Pattern
// Always create related files in parallel
[BatchTool]:
// Create component with its test and styles
- Write("src/components/UserDashboard.tsx", componentCode)
- Write("src/components/UserDashboard.test.tsx", componentTests)
- Write("src/components/UserDashboard.module.css", componentStyles)
// Create API route with controller and tests
- Write("server/routes/dashboard.js", routeCode)
- Write("server/controllers/dashboardController.js", controllerCode)
- Write("server/tests/dashboard.test.js", apiTests)
๐ WEB DEVELOPMENT SWARM ORCHESTRATION
Specialized Agent Roles
web_architect:
role: System Designer
focus: [frontend-architecture, backend-architecture, database-design]
concurrent_tasks: [ui-mockups, api-design, database-schema]
frontend_developer:
role: UI/UX Implementation
focus: [react-components, responsive-design, user-interactions]
concurrent_tasks: [multiple-components, styling, state-management]
backend_developer:
role: API Development
focus: [rest-apis, database-queries, authentication]
concurrent_tasks: [multiple-endpoints, middleware, data-validation]
fullstack_tester:
role: Quality Assurance
focus: [unit-tests, integration-tests, e2e-tests]
concurrent_tasks: [frontend-tests, backend-tests, api-tests]
devops_specialist:
role: Deployment & CI/CD
focus: [docker-setup, ci-cd-pipelines, monitoring]
concurrent_tasks: [containerization, deployment, monitoring-setup]
Topology Recommendation
# For web development projects
claude-flow hive init --topology hierarchical --agents 6
# Agent distribution:
# - 1 Web Architect (coordinator)
# - 2 Frontend Developers (parallel component development)
# - 2 Backend Developers (parallel API development)
# - 1 Full-Stack Tester (comprehensive testing)
๐ง WEB DEVELOPMENT MEMORY MANAGEMENT
Context Storage Patterns
// Store web-specific project context
memory_patterns: {
"web/frontend/state": "Redux Toolkit with RTK Query for API calls",
"web/backend/auth": "JWT tokens with refresh token rotation",
"web/database/schema": "PostgreSQL with Prisma ORM migrations",
"web/styling/system": "Tailwind CSS with custom design tokens",
"web/testing/strategy": "Jest + RTL for frontend, Supertest for backend",
"web/deployment/strategy": "Docker containers on AWS ECS with RDS"
}
Decision Tracking
// Track important architectural decisions
web_decisions: {
"state_management": {
"decision": "Redux Toolkit",
"rationale": "Complex state with API caching needs",
"alternatives": ["Zustand", "Context API"],
"date": "2024-01-15"
},
"database_choice": {
"decision": "PostgreSQL",
"rationale": "ACID compliance and complex queries",
"alternatives": ["MongoDB", "MySQL"],
"date": "2024-01-15"
}
}
๐ WEB DEPLOYMENT & CI/CD
Build Process (Parallel Execution)
# Parallel build pipeline
build_stages:
frontend_build:
- "npm run build:frontend"
- "npm run test:frontend"
- "npm run lint:frontend"
backend_build:
- "npm run build:backend"
- "npm run test:backend"
- "npm run lint:backend"
integration:
- "npm run test:integration"
- "npm run test:e2e"
deployment:
- "docker build -t web-app ."
- "docker push registry/web-app"
Environment Configuration
# Development environment
REACT_APP_API_URL=http://localhost:3001
REACT_APP_ENVIRONMENT=development
DATABASE_URL=postgresql://localhost:5432/webapp_dev
JWT_SECRET=dev_secret_key
REDIS_URL=redis://localhost:6379
# Production environment
REACT_APP_API_URL=https://api.yourapp.com
REACT_APP_ENVIRONMENT=production
DATABASE_URL=${DATABASE_URL}
JWT_SECRET=${JWT_SECRET}
REDIS_URL=${REDIS_URL}
๐ WEB MONITORING & ANALYTICS
Frontend Monitoring
// Client-side monitoring setup
monitoring: {
performance: "Web Vitals + Lighthouse CI",
errors: "Sentry for error tracking",
analytics: "Google Analytics 4 + custom events",
user_experience: "Hotjar for user sessions"
}
Backend Monitoring
// Server-side monitoring setup
backend_monitoring: {
api_performance: "APM with response time tracking",
database: "Query performance and connection pooling",
logs: "Structured logging with ELK stack",
health_checks: "Endpoint monitoring with alerts"
}
๐ WEB SECURITY & COMPLIANCE
Security Patterns
// Web security checklist
security_measures: {
authentication: "JWT with secure httpOnly cookies",
authorization: "Role-based access control (RBAC)",
input_validation: "Joi/Yup validation on frontend and backend",
sql_injection: "Parameterized queries with ORM",
xss_protection: "Content Security Policy headers",
csrf_protection: "CSRF tokens for state-changing operations",
https_enforcement: "HTTPS redirect and HSTS headers",
rate_limiting: "API rate limiting per user/IP"
}
Compliance Requirements
// Common web compliance patterns
compliance: {
gdpr: "Cookie consent + data export/deletion APIs",
accessibility: "WCAG 2.1 AA compliance with axe testing",
performance: "Core Web Vitals optimization",
seo: "Server-side rendering + structured data"
}
๐งช WEB TESTING STRATEGY
Testing Pyramid (Parallel Execution)
// Execute all test types in parallel
[BatchTool - Testing]:
// Unit Tests (Parallel)
- Bash("npm run test:unit:frontend")
- Bash("npm run test:unit:backend")
// Integration Tests (Parallel)
- Bash("npm run test:integration:api")
- Bash("npm run test:integration:database")
// E2E Tests (Parallel where possible)
- Bash("npm run test:e2e:chrome")
- Bash("npm run test:e2e:firefox")
// Performance Tests
- Bash("npm run test:lighthouse")
- Bash("npm run test:load")
Test Organization
// Test file structure (create in parallel)
tests/
โโโ frontend/
โ โโโ components/ // Component tests (parallel)
โ โโโ hooks/ // Custom hook tests (parallel)
โ โโโ integration/ // Frontend integration tests
โโโ backend/
โ โโโ routes/ // API route tests (parallel)
โ โโโ controllers/ // Controller tests (parallel)
โ โโโ models/ // Model tests (parallel)
โโโ e2e/ // End-to-end tests
โโโ performance/ // Performance tests
๐จ WEB UI/UX PATTERNS
Component Development (Always Parallel)
// Create component ecosystem in parallel
[BatchTool - Component Creation]:
// Base component
- Write("src/components/Button/Button.tsx", buttonComponent)
- Write("src/components/Button/Button.test.tsx", buttonTests)
- Write("src/components/Button/Button.stories.tsx", buttonStories)
- Write("src/components/Button/Button.module.css", buttonStyles)
// Variant components (parallel)
- Write("src/components/Button/PrimaryButton.tsx", primaryVariant)
- Write("src/components/Button/SecondaryButton.tsx", secondaryVariant)
- Write("src/components/Button/IconButton.tsx", iconVariant)
Responsive Design Patterns
/* Mobile-first responsive approach */
.component {
/* Mobile styles (default) */
padding: 1rem;
/* Tablet styles */
@media (min-width: 768px) {
padding: 1.5rem;
}
/* Desktop styles */
@media (min-width: 1024px) {
padding: 2rem;
}
}
๐ PERFORMANCE OPTIMIZATION
Frontend Performance
// Performance optimization checklist
frontend_optimization: {
code_splitting: "React.lazy() + Suspense for route-based splitting",
bundle_optimization: "Webpack bundle analyzer + tree shaking",
image_optimization: "WebP format + responsive images",
caching: "Service worker + HTTP caching headers",
lazy_loading: "Intersection Observer for images/components"
}
Backend Performance
// Backend optimization patterns
backend_optimization: {
database: "Connection pooling + query optimization + indexing",
caching: "Redis for session storage + API response caching",
compression: "Gzip/Brotli compression for API responses",
cdn: "Static asset delivery via CDN",
monitoring: "APM tools for bottleneck identification"
}
๐ Related Web Development Resources
- React Component Patterns - React-specific development
- API Development - Backend API focus
- TypeScript Patterns - Type-safe development
- Performance Optimization - Speed optimization
๐ Web Development Success: This template ensures parallel full-stack development with modern best practices, comprehensive testing, and production-ready deployment patterns.
Explore More
Related Templates
Related Guides
ClaudeCode Best Practices & Pro Tips
Master ClaudeCode with expert tips, proven workflows, and best practices. Learn how to maximize productivity and get the most out of AI-powered development.
Claude Code Checkpoints & Rewind Feature - Undo AI Code Changes
Learn how to use Claude Code's checkpoints and rewind feature to safely undo AI-generated code changes. Use Esc+Esc or /rewind to rollback mistakes and maintain control over your codebase.