# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

This is a Drupal 10 site (Advance Auto Parts / AAP) built on the Lightning distribution. The project uses DDEV for local development and is deployed on Acquia Cloud.

## Common Commands

### DDEV Commands
```bash
ddev start          # Start the local environment
ddev stop           # Stop the local environment
ddev drush [cmd]    # Run Drush commands (e.g., ddev drush cr for cache rebuild)
ddev exec [cmd]     # Execute commands in the web container
ddev mysql          # Access the database
ddev import-db [file]  # Import a database dump
ddev export-db > file.sql  # Export the database
```

### Composer
```bash
composer install     # Install dependencies
composer update      # Update dependencies
```

### Frontend (Theme)
```bash
cd web/themes/aap/scss/
npm install          # Install theme dependencies
grunt                # Run watch task for SCSS compilation
```

### Drupal
```bash
# Cache rebuild
ddev drush cr

# Run database updates
ddev drush updb

# Clear all caches
ddev drush cr all

# Export configuration
ddev drush cex

# Import configuration
ddev drush cim

# Run tests (requires proper environment setup)
ddev drush test-run [test_class]
```

## Architecture

### Directory Structure
- `web/` - Drupal docroot (web server document root)
  - `core/` - Drupal core
  - `modules/contrib/` - Contributed modules (via Composer)
  - `modules/custom/` - Custom site modules
  - `themes/aap/` - Primary custom theme
  - `themes/neato/` - Parent theme for AAP
  - `sites/default/` - Site configuration and files
- `config/default/` - Exported Drupal configuration (YAML)
- `config/config-split-development/` - Development-only config
- `config/config-split-shield/` - Shield password protection config
- `vendor/` - Composer dependencies
- `.ddev/` - DDEV configuration

### Custom Modules (web/modules/custom/)
- `aap_utilities/` - Core utilities module
- `aap_header/` - Header functionality
- `aap_workflow/` - Workflow/bulkupload integrations
- `aap_menu/` - Menu customizations
- `contently/` - Content management integrations
- `hs2_components/` - Reusable components
- `tealium/` - Tealium tag management

### Custom Theme (web/themes/aap/)
- Uses SCSS with Grunt for CSS compilation
- Parent theme: `neato`
- Key files: `aap.libraries.yml` (asset loading), `aap.theme` (theme functions)

### Configuration
Drupal configuration is managed via `config/default/` as exported YAML files. Use `ddev drush cex` to export and `ddev drush cim` to import.

### Patches
Patches are managed via `cweagans/composer-patches`. See `composer.json` `extra.patches` for applied patches.

### OpenTelemetry
The project includes `drupal/opentelemetry` and `drupal/opentelemetry_metrics` modules. Environment variable `OTEL_PHP_DISABLED_INSTRUMENTATIONS=psr3` is set in DDEV.

## Development Workflow
1. Create a feature branch from `develop`
2. Make changes in custom modules/themes
3. Export configuration changes with `ddev drush cex`
4. Commit changes following the pattern: `[TICKET-ID] Description`