|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +**For complete build commands, architecture overview, and development guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).** |
| 6 | + |
| 7 | +## Your Role |
| 8 | + |
| 9 | +Act as a pair programming partner with these responsibilities: |
| 10 | + |
| 11 | +- **REVIEW THOROUGHLY**: Use file system access when available |
| 12 | + - Analyze information flow and cross-module interactions |
| 13 | + - ASK FOR CLARIFICATION if implementation choices are unclear |
| 14 | +- **BE EFFICIENT**: Be succinct and concise, don't waste tokens |
| 15 | +- **RESPECT PRIVACY**: Do not read .env* files unless instructed to do so |
| 16 | +- **NO SPECULATION**: Never make up code unless asked |
| 17 | + |
| 18 | +## Project Overview |
| 19 | + |
| 20 | +This is a Quarkus-based CLI tool that converts TTRPG JSON data (from 5eTools and Pf2eTools) into markdown files optimized for Obsidian.md. |
| 21 | + |
| 22 | +## Essential Commands |
| 23 | + |
| 24 | +**Build and format code (required before commits):** |
| 25 | +```bash |
| 26 | +./mvnw install |
| 27 | +``` |
| 28 | + |
| 29 | +**Run tests:** |
| 30 | +```bash |
| 31 | +./mvnw test |
| 32 | +``` |
| 33 | + |
| 34 | +**Run a specific test:** |
| 35 | +```bash |
| 36 | +./mvnw test -Dtest=ClassName#methodName |
| 37 | +``` |
| 38 | + |
| 39 | +**Format code only:** |
| 40 | +```bash |
| 41 | +./mvnw process-sources |
| 42 | +``` |
| 43 | + |
| 44 | +## Understanding the Codebase |
| 45 | + |
| 46 | +**Before making changes, read:** |
| 47 | +- Architecture and control flow: [CONTRIBUTING.md § Notes on control flow](CONTRIBUTING.md#notes-on-control-flow) |
| 48 | +- Unconventional conventions: [CONTRIBUTING.md § Unconventional conventions](CONTRIBUTING.md#unconventional-conventions) |
| 49 | + |
| 50 | +**Key points:** |
| 51 | +- This project uses Jackson with raw types (`JsonNode`, `ArrayNode`, `ObjectNode`) intentionally |
| 52 | +- Parsing uses interface hierarchies with default methods |
| 53 | +- Prefer enum-based field access (Pf2e pattern) over string keys |
| 54 | +- Data flow: Index → Prepare → Render |
| 55 | +- Templates use Qute engine |
| 56 | + |
| 57 | +## Key Development Principles |
| 58 | + |
| 59 | +- **Follow existing patterns**: Find similar functions in the same module (5e vs Pf2e) and emulate them |
| 60 | +- **Understand the JSON quirks**: Source data has union types and dynamic structures from JavaScript |
| 61 | +- **Test with live data**: Add 5eTools/Pf2eTools to `sources/` directory for testing |
| 62 | +- **Respect architectural boundaries**: Use interface default methods to share parsing logic |
| 63 | + |
| 64 | +## Testing |
| 65 | + |
| 66 | +Key test files to understand: |
| 67 | +- `Tools5eDataConvertTest` - CLI launch tests with different parameters |
| 68 | +- `dev.ebullient.convert.tools.dnd5e.CommonDataTests` - Shared test cases |
| 69 | +- `JsonDataNoneTest` (SRD), `JsonDataSubsetTest`, `JsonDataTest` (all data) |
| 70 | +- `*IT` tests run against final artifact (not from IDE) |
| 71 | + |
| 72 | +## Commit Guidelines |
| 73 | + |
| 74 | +- Rebase commits (no merge commits) |
| 75 | +- Use [gitmoji](https://gitmoji.dev/) at the beginning (actual emoji, not text) |
| 76 | +- Be strict about: 🐛 (bugs), ✨ (new features), ♻️ (refactoring), 👷 (CI/build) |
| 77 | +- Use ✨ for features that should be in CHANGELOG |
| 78 | +- Use 🔥💥 for breaking changes that should be in CHANGELOG |
0 commit comments