This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Build all modules:
./build_all.sh- Builds all modules individually with detailed success/failure reporting - Verify all modules:
./verify_projects.sh- Verifies Gradle configuration for all modules - Build specific module:
./gradlew :module-name:build(e.g.,./gradlew :http4k-core-hello-world:build) - Clean and build:
./gradlew :module-name:clean :module-name:build - Run tests only:
./gradlew :module-name:test - Run application:
./gradlew :module-name:run(for modules with application plugin)
Modules are auto-discovered by the build system. All directories containing build.gradle.kts files are automatically included as modules with names following the pattern :section-subsection-module-name (e.g., :http4k-core-hello-world, :http4k-connect-using-connect-api-clients).
This is a multi-module Gradle project with three main sections:
- http4k-core: Core http4k library examples demonstrating fundamental features
- http4k-connect: Examples using http4k-connect for external system integration
- http4k-pro: Commercial http4k-pro library examples (AI, MCP, hot-reload features)
- Gradle 8.13 with Kotlin DSL throughout
- Kotlin 2.1.20 and Java 21 target
- Centralized version management in
gradle.properties - Automatic module discovery via
settings.gradle.kts- scans for allbuild.gradle.ktsfiles - Common build configuration in root
build.gradle.ktsapplies to all subprojects - Individual modules define their specific plugins and dependencies
All modules use BOM (Bill of Materials) for consistent versioning:
- http4k BOM:
org.http4k:http4k-bom:${http4kVersion} - JUnit BOM:
org.junit:junit-bom:${junitVersion} - http4k-pro modules: Use
org.http4k.pro:*artifacts (e.g.,http4k-ai-mcp-sdk)
Current versions are defined in gradle.properties:
- http4kVersion=6.14.0.0
- kotlinVersion=2.1.21
- junitVersion=5.10.3
Each example module typically follows this structure:
src/main/kotlin/- Application code, often with company/example package structuresrc/test/kotlin/- Tests using JUnit 5 and http4k-testing-hamkrestbuild.gradle.kts- Module-specific dependencies and pluginsREADME.md- Module documentation with setup and usage instructions
- JUnit 5 platform used across all modules
- http4k-testing-hamkrest for HTTP testing assertions
- Tests run automatically in CI/CD pipeline for all modules
- Each module can be tested independently
GitHub Actions workflow (.github/workflows/build.yaml) automatically:
- Discovers all modules dynamically
- Builds each module in parallel matrix jobs
- Uses Java 21 and Gradle caching
- Runs on all pushes and pull requests
- Continues building other modules even if one fails
- Each major section (core, connect, pro) must maintain a README.md listing all modules
- READMEs must be updated when modules are added, removed, or renamed
- Module descriptions should be brief but descriptive of the key demonstrated feature