Skip to content

Commit 307bd61

Browse files
LarsEckartJayBazuziisidore
committed
. e make Claude.md generic for all other coding agents
Co-authored-by: Jay Bazuzi <[email protected]> Co-authored-by: Llewellyn Falco <[email protected]>
1 parent 0200c06 commit 307bd61

File tree

2 files changed

+50
-51
lines changed

2 files changed

+50
-51
lines changed

AGENTS.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# ApprovalTests.Java Agent Instructions
2+
3+
## Project Overview
4+
5+
ApprovalTests.Java is a snapshot-based testing library that simplifies assertions by comparing expected output to approved files. The library supports JUnit 3/4/5 and TestNG, and works with JDK 1.8-25.
6+
7+
## Architecture
8+
9+
This is a multi-module Maven project with the following key modules:
10+
11+
- **approvaltests**: Main library containing core functionality (`Approvals.java`, writers, reporters, namers)
12+
- **approvaltests-util**: Shared utilities and helper classes (used as a dependency by approvaltests)
13+
- **approvaltests-tests**: Integration tests and examples
14+
- **approvaltests-util-tests**: Tests for utility classes
15+
- **counter_display**: Sample application
16+
- **html_locker**: Additional tooling
17+
18+
The core API is in `org.approvaltests.Approvals` class, which provides static methods like `verify()`, `verifyAll()`, `verifyAsJson()`. The library uses a pattern of Writers (generate output), Namers (determine file names), and Reporters (show differences when tests fail).
19+
20+
## Common Commands
21+
22+
### Build and Test
23+
```bash
24+
# Build and test via Mise (requires mise installed)
25+
./build_and_test
26+
```
27+
28+
**Note:** The project uses [Mise](https://mise.jdx.dev/) for task automation. The `.mise.toml` file defines tasks like `build_and_test` and `format`. Java version is specified in `.java-version` file.
29+
30+
## Key Files and Concepts
31+
32+
- **Approved files**: `*.approved.*` files must be committed to source control. These are automatically treated as binary in git via `.gitattributes` (`*.approved.* binary diff`)
33+
- **Received files**: `*.received.*` files generated during test failures, showing actual output vs approved. These should not be committed
34+
- **Reporters**: Tools that show diffs when tests fail (IntelliJ, Beyond Compare, etc.). Located in `org.approvaltests.reporters`
35+
- **Namers**: Determine approval file naming based on test method/class. Located in `org.approvaltests.namer`
36+
- **Writers**: Generate the actual content to be approved. Located in `org.approvaltests.writers`
37+
38+
## Running Single Tests
39+
40+
Individual test methods can be run using standard Maven/IDE approaches:
41+
```bash
42+
mvn test -Dtest=ClassName#methodName
43+
```
44+
45+
**Note:** Tests run with `en_US` locale by default (configured in surefire plugin) to ensure consistent output across different environments.
46+
47+
## Code Style
48+
49+
There is an automatic code formatter that is used every time you build the project.

CLAUDE.md

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1 @@
1-
# CLAUDE.md
2-
3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4-
5-
## Project Overview
6-
7-
ApprovalTests.Java is a snapshot-based testing library that simplifies assertions by comparing expected output to approved files. The library supports JUnit 3/4/5 and TestNG, and works with JDK 1.8-25.
8-
9-
## Architecture
10-
11-
This is a multi-module Maven project with the following key modules:
12-
13-
- **approvaltests**: Main library containing core functionality (`Approvals.java`, writers, reporters, namers)
14-
- **approvaltests-util**: Shared utilities and helper classes (used as a dependency by approvaltests)
15-
- **approvaltests-tests**: Integration tests and examples
16-
- **approvaltests-util-tests**: Tests for utility classes
17-
- **counter_display**: Sample application
18-
- **html_locker**: Additional tooling
19-
20-
The core API is in `org.approvaltests.Approvals` class, which provides static methods like `verify()`, `verifyAll()`, `verifyAsJson()`. The library uses a pattern of Writers (generate output), Namers (determine file names), and Reporters (show differences when tests fail).
21-
22-
## Common Commands
23-
24-
### Build and Test
25-
```bash
26-
# Build and test via Mise (requires mise installed)
27-
./build_and_test
28-
```
29-
30-
**Note:** The project uses [Mise](https://mise.jdx.dev/) for task automation. The `.mise.toml` file defines tasks like `build_and_test` and `format`. Java version is specified in `.java-version` file.
31-
32-
## Key Files and Concepts
33-
34-
- **Approved files**: `*.approved.*` files must be committed to source control. These are automatically treated as binary in git via `.gitattributes` (`*.approved.* binary diff`)
35-
- **Received files**: `*.received.*` files generated during test failures, showing actual output vs approved. These should not be committed
36-
- **Reporters**: Tools that show diffs when tests fail (IntelliJ, Beyond Compare, etc.). Located in `org.approvaltests.reporters`
37-
- **Namers**: Determine approval file naming based on test method/class. Located in `org.approvaltests.namer`
38-
- **Writers**: Generate the actual content to be approved. Located in `org.approvaltests.writers`
39-
40-
## Running Single Tests
41-
42-
Individual test methods can be run using standard Maven/IDE approaches:
43-
```bash
44-
mvn test -Dtest=ClassName#methodName
45-
```
46-
47-
**Note:** Tests run with `en_US` locale by default (configured in surefire plugin) to ensure consistent output across different environments.
48-
49-
## Code Style
50-
51-
There is an automatic code formatter that is used every time you build the project.
1+
Read @AGENTS.md

0 commit comments

Comments
 (0)