diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..6593765 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,5 @@ +# Agent guide + +See [CLAUDE.md](CLAUDE.md) for this repository's agent instructions. +CLAUDE.md is the source of truth; this file exists so agents that follow +the cross-tool AGENTS.md convention find the same guidance. diff --git a/CLAUDE.md b/CLAUDE.md index 578c11a..ac46546 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,8 +1,27 @@ # CLAUDE.md +See [AGENTS.md](AGENTS.md) for the companion agent guide. + + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + ## Project -Java project built with Maven 3.9.X. Run `mvn install` from the root to build. +Java project built with Maven 3.9.X: a collection of small, self-contained security-related examples (e.g. zip bomb construction). Run `mvn install` from the root to build. + +## Commands + +- Build (root): `mvn install` +- Run all tests: `mvn test` +- Run a single test class: `mvn test -pl examples -Dtest=ZipBTest` +- Run a single test method: `mvn test -pl examples -Dtest=ZipBTest#happyPath` + +## Architecture + +- Multi-module Maven reactor: the root `pom.xml` (`packaging=pom`) declares only `dependencyManagement`/`pluginManagement`; the `examples` module (artifact `security.examples`) is currently the only module and must not declare its own dependency versions or plugin versions — those come from the root only, per the Maven rule below. +- Base package for all example code: `io.github.adamw7.security`. +- Each security example is a standalone, runnable class with a `main` method (e.g. `ZipB`), paired with a unit test class of the same name + `Test` suffix in `src/test/java` under the same package. +- Logging is via Log4j2, configured in `examples/src/main/resources/log4j2.properties`. ## Java version Java 25. diff --git a/pom.xml b/pom.xml index b564e89..2594068 100644 --- a/pom.xml +++ b/pom.xml @@ -51,5 +51,36 @@ + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.6.3 + + + io.github.adamw7 + tools.claude-code-enforcer + 2.5.0 + + + + + enforce-claude-md + validate + false + + enforce + + + + + ${project.basedir}/CLAUDE.md + + + + + + +