|
1 | 1 | # Code Editing Agent Java |
2 | 2 |
|
3 | 3 | ## Commands |
4 | | -- **Build**: `./gradlew build` (includes fatJar) |
5 | | -- **Test**: `./gradlew test` |
| 4 | +- **Build**: `./gradlew build` (includes fatJar creation) |
| 5 | +- **Test**: `./run_tests.sh` (runs tests with formatted output) |
6 | 6 | - **Single test**: `./gradlew test --tests "ClassName"` |
7 | | -- **Run**: `./gradlew run` |
| 7 | +- **Run CLI mode**: `./gradlew run` (default) |
| 8 | +- **Run Web mode**: `./gradlew run -Dapp.mode=web` |
8 | 9 | - **Clean**: `./gradlew clean` |
9 | 10 |
|
| 11 | +## Development Server |
| 12 | +- **Start dev server**: `./dev-server.sh start` (web mode with hot reloading) |
| 13 | +- **Stop dev server**: `./dev-server.sh stop` |
| 14 | +- **Check status**: `./dev-server.sh status` |
| 15 | +- **View logs**: `./dev-server.sh logs` |
| 16 | + |
10 | 17 | ## Code Style Guidelines |
11 | 18 | - **Package**: Use `com.larseckart` root package |
12 | 19 | - **Imports**: Group imports (standard library, third-party, then local), alphabetically within groups |
|
18 | 25 | - **Testing**: Use JUnit 5 (`@Test`, no public methods needed) |
19 | 26 | - **Dependencies**: Add to `gradle/libs.versions.toml` first, reference in build.gradle.kts |
20 | 27 | - **Main class**: `com.larseckart.App` |
21 | | -- **Java version**: 21 (configured in toolchain) |
| 28 | +- **Java version**: 24 (configured in toolchain) |
| 29 | + |
| 30 | +## Testing Conventions |
| 31 | +- **Test classes**: End with `Test` suffix (e.g., `ReadFileToolTest`) |
| 32 | +- **Display names**: Use `@DisplayNameGeneration(DisplayNameGenerator.ReplaceUnderscores.class)` |
| 33 | +- **Test methods**: Use snake_case format (e.g., `should_handle_empty_file()`) |
| 34 | +- **Error tests**: Use `should_throw_exception_for_*` pattern |
| 35 | +- **Validation tests**: Use `should_validate_required_parameters()` pattern |
| 36 | +- **Platform-specific**: Use `@DisabledOnOs(OS.WINDOWS)` instead of manual OS detection |
| 37 | + |
| 38 | +## Architecture |
| 39 | +- **Core**: Business logic in `core/` package (services, domain, ports) |
| 40 | +- **Adapters**: I/O implementations in `adapters/` (cli, web) |
| 41 | +- **Tools**: File operations in `core/tools/` (ReadFileTool, EditFileTool, ListFilesTool) |
| 42 | +- **Hexagonal Architecture**: Clear separation between business logic and I/O |
| 43 | + |
| 44 | +## Key Dependencies |
| 45 | +- **Anthropic Java SDK**: `com.anthropic:anthropic-java:2.0.0` |
| 46 | +- **Spring Boot**: `3.5.0` (for web mode) |
| 47 | +- **JUnit 5**: For testing |
| 48 | +- **Jackson**: For JSON handling |
| 49 | + |
| 50 | +## Environment Variables |
| 51 | +- **API Key**: `code_editing_agent_api_key` - Required for Claude API access |
| 52 | +- **App Mode**: `app.mode=web` - Optional, defaults to CLI mode |
| 53 | + |
| 54 | +## Git Commits |
| 55 | +- **Co-author**: Add yourself as co-author to all commits we make using: |
| 56 | + ``` |
| 57 | + Co-authored-by: Amp <amp@sourcegraph.com> |
| 58 | + ``` |
0 commit comments