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:

  1. Frontend/Backend Parallel: Always develop frontend and backend components simultaneously
  2. Component Development: Create multiple UI components in parallel
  3. API Endpoints: Build multiple API routes concurrently
  4. Testing Suites: Generate frontend and backend tests in parallel
  5. 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"
}


๐ŸŒ Web Development Success: This template ensures parallel full-stack development with modern best practices, comprehensive testing, and production-ready deployment patterns.

Explore More

Related Guides

Use this template

You can use this template with ClaudeCode by running:claude-flow templates apply web-development(claude-md-web-development)