#5: CLAUDE.md

CLAUDE.md

Path: ./CLAUDE.md

Type: AI agent instructions (Markdown)

Lines: 24

Purpose: Instructions for Claude Code — tells the AI assistant how to build, test, and write code in this repository

Source: GitHub

24 lines · 18 code · 3 comments · 3 blank

What it does

CLAUDE.md is an agent instruction file — it is automatically read by Claude Code when the AI interacts with this repository. Think of it as the onboarding document for AI agents.

Without this file, Claude would need to discover build commands, code style, and conventions by reading build.gradle.kts, buildSrc/, and existing source files. With it, the agent immediately knows:

Section-by-section

Build/Test Commands (lines 5–11)

Build all:           ./gradlew build
Build skipping tests: ./gradlew build -x test
Run application:     ./gradlew bootRun
Single test:         ./gradlew test --tests "org.projectforge.package.ClassName.methodName"
Package tests:       ./gradlew test --tests "org.projectforge.package.*"
Module tests:        ./gradlew :projectforge-business:test

Six commands covering the most common operations. The --tests filter is especially useful — it runs a single test method without executing the entire suite (which takes minutes).

Note: These work because the root build.gradle.kts applies to all subprojects via allprojects { }.

Code Style Guidelines (lines 13–24)

RuleDetailWhy
Kotlin JVM target 17Set in convention plugin line 28LTS version, Spring Boot 3.x minimum
camelCase / PascalCaseStandard Kotlin namingConsistency across all modules
License headerGPLv3 header in every new Kotlin/Java fileLegal requirement for open-source distribution
Imports: stdlib firstkotlin.* → domain/project importsReadable import blocks
Non-null by defaultUse Type? only when null is semantically validKotlin's null safety — catches bugs at compile time
JUnit 5@Test, @BeforeEach, descriptive namesConfigured in convention plugin line 38
Extension functionsPrefer fun Type.method() over Util.method(type)Idiomatic Kotlin
Spring Bean injection@Autowired or constructor injectionStandard Spring Boot pattern
Kotlin CoroutinesFor async operations (not Java threads)Lightweight concurrency
kotlin-loggingprivate val log = KotlinLogging.logger {}SLF4J wrapper applied in convention plugin line 60
4-space indentConsistent across Kotlin and JavaProject convention

How it relates to the rest of the project

This file is the translation layer between human-readable conventions and what the build system actually enforces:

CLAUDE.md saysEnforced by
"Kotlin JVM target 17"Convention plugin line 28: options.release.set(17)
"JUnit 5 for tests"Convention plugin line 38: useJUnitPlatform()
"kotlin-logging"Convention plugin line 60: api("kotlin-logging")
"Build all"Root build.gradle.kts: applies to all subprojects

CLAUDE.md tells the AI what to do; the build files enforce it.

Why it exists

This file was added specifically for Claude Code — Anthropic's AI coding assistant. It follows the CLAUDE.md convention where the agent auto-reads this file at the start of every session. It was likely added by the same developer who introduced AI-assisted development to the project.

The equivalent for GitHub Copilot would be .github/copilot-instructions.md or inline comments. For Cursor, it would be .cursor/rules.md.

Notably, the file mentions Kotlin Coroutines (line 22) — but the current codebase still uses Thread in several places (e.g. IdpLoginHandler.kt). This means CLAUDE.md describes the desired style more than the current reality.