diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..c531325 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,13 @@ +## Agent skills + +### Issue tracker + +Issues are tracked on the self-hosted Gitea (`nessar/arena-tracker`) via the `tea` CLI. See `docs/agents/issue-tracker.md`. + +### Triage labels + +Default five-role vocabulary (`needs-triage`, `needs-info`, `ready-for-agent`, `ready-for-human`, `wontfix`). See `docs/agents/triage-labels.md`. + +### Domain docs + +Single-context: one `CONTEXT.md` + `docs/adr/` at the repo root. See `docs/agents/domain.md`. diff --git a/CONTEXT.md b/CONTEXT.md new file mode 100644 index 0000000..02edda3 --- /dev/null +++ b/CONTEXT.md @@ -0,0 +1,70 @@ +# Arena Tracker + +Personal tracking of League of Legends Arena matches, centred on progress through the Challenge: placing first with every champion. + +## Language + +**Match**: +A finished Arena game played by an Account with one champion, in one Format. +_Avoid_: Game, session + +**Format**: +A variant of Arena with its own team structure and rules, such as Arena 3x6 or Bravery Arena; it filters statistics but does not split the Challenge. +_Avoid_: Mode, type, queue + +**Placement**: +The final rank of the player's team in a Match, 1 being the best. +_Avoid_: Rank, position, standing + +**Top N**: +A Match whose Placement is N or better; a top 1 is therefore also a top 3. +_Avoid_: Podium + +**Win**: +A Match the game itself counts as won, which is a Placement in the upper half of the Format (top 3 in Arena 3x6). +_Avoid_: Victory + +**Challenge**: +The goal of getting a top 1 with every champion in the game in as few Attempts as possible, scoped to one Account and one Season across all Formats, mirroring how the game client counts it. +_Avoid_: Checklist, goal, Arena God + +**Completed**: +The state of a champion that has at least one top 1 within a given Challenge. +_Avoid_: Done, validated, won + +**Attempt**: +A Match played with a champion within a Challenge up to and including that champion's first top 1; Matches played after the champion is Completed are not Attempts. +_Avoid_: Try, game count, difficulty + +**First Try**: +A champion Completed in exactly one Attempt. +_Avoid_: One-shot, flawless + +**Season**: +A period of Arena after which Challenge progress starts again from zero. +_Avoid_: Split, run + +**Account**: +A League of Legends account; the active Account is the one signed in to the game client. +_Avoid_: Player, profile, summoner + +**Official Progress**: +The game's own per-Season count of champions it considers completed, used only to cross-check a Challenge. +_Avoid_: Riot challenge, tracker + +## Interface terms + +The interface is in French. Each glossary term has one French word in user-facing text; the _Avoid_ lists above govern English naming in code and documents, not these words. + +| Term | In the interface | +| --- | --- | +| Match | Partie | +| Challenge | Défi | +| Attempt | Tentative | +| First Try | du premier coup | +| Completed | validé | +| Win | Victoire | +| Season | Saison | +| Account | Compte | +| Official Progress | Progression officielle | +| Placement, Format, Top N | unchanged | diff --git a/docs/adr/0001-two-data-sources-client-and-riot-api.md b/docs/adr/0001-two-data-sources-client-and-riot-api.md new file mode 100644 index 0000000..1f3bf0a --- /dev/null +++ b/docs/adr/0001-two-data-sources-client-and-riot-api.md @@ -0,0 +1,17 @@ +--- +status: accepted +--- + +# Two data sources: the local game client and the Riot API + +The app reads the local League client API for the active Account and for live state (champ select, end of a Match), and the Riot web API for Match history. We accept the cost of a second integration and a personal Riot API key because the client alone cannot backfill: measured on 2026-11-15, its match history endpoint returns only the 20 most recent games across all game modes and ignores paging, while the Riot API keeps about two years. + +## Considered Options + +- **Client only**: no API key, but history limited to 20 recent games, so past Seasons and any Match played while the app was closed for long would be lost. +- **Riot API only**: full history, but no knowledge of which Account is signed in and no champ select. + +## Consequences + +- The client API is unofficial and may change between patches; the app must keep working on stored Matches when it is unavailable. +- The app only ever reads from the client. It never picks, bans or acts on the player's behalf. diff --git a/docs/adr/0002-gpui-through-gpui-kit.md b/docs/adr/0002-gpui-through-gpui-kit.md new file mode 100644 index 0000000..3fc68d4 --- /dev/null +++ b/docs/adr/0002-gpui-through-gpui-kit.md @@ -0,0 +1,18 @@ +--- +status: accepted +--- + +# GPUI through gpui-kit, pinned to an exact version + +The interface is built with GPUI, taken through `gpui-kit` 0.9.1 pinned exactly, rather than the official `gpui` crate. The official crate on crates.io has been frozen at 0.2.2 since October 2025 and ships no components, while `gpui-kit` brings a current GPUI plus the data table and charts the statistics page needs. The cost is that GPUI's own code reaches us as `gpui-pre`, a snapshot of the Zed repository republished by the `gpui-kit` maintainer (Longbridge) and not by Zed, so we trust that maintainer for the framework itself. + +## Considered Options + +- **Official `gpui` 0.2.2**: published by Zed, but a year old and the table and charts would be hand-written. +- **Git dependency on the Zed repository**: official and current, but a heavy clone with no guaranteed matching component library. +- **egui or Tauri**: faster to a result, rejected because GPUI is a deliberate preference for this project. + +## Consequences + +- `gpui-kit` releases weekly and GPUI is pre-1.0: upgrades are deliberate, one version at a time, never a loose version range. +- This line needs a Rust newer than 1.93. diff --git a/docs/adr/0003-build-with-windows-toolchain-from-wsl.md b/docs/adr/0003-build-with-windows-toolchain-from-wsl.md new file mode 100644 index 0000000..ec684fb --- /dev/null +++ b/docs/adr/0003-build-with-windows-toolchain-from-wsl.md @@ -0,0 +1,18 @@ +--- +status: accepted +--- + +# Build with the Windows Rust toolchain, driven from WSL + +The repository, shell, editor and git live in WSL, but the app is compiled by Windows' own `cargo.exe` invoked from WSL, with the build directory on `C:`. Real cross-compilation from Linux was the first choice and was abandoned after testing on 2026-11-15: with `cargo-xwin`, GPUI 0.2.2 compiles but the executable exits at launch, because GPUI loads its DirectX shaders from the build machine's source path in debug builds and only generates them in release builds when the build host is Windows. The Windows toolchain driven from WSL produced a visible, responsive window for both GPUI 0.2.2 and `gpui-kit` 0.9.1. + +## Considered Options + +- **Cross-compile from WSL with `cargo-xwin`**: fails at runtime as described; not retested on the current GPUI line. +- **Develop on Linux under WSLg, build for Windows at the end**: rejected, no Vulkan support was found in this WSL and it would test a platform that is not the target. +- **Move the repository to the Windows filesystem**: works, but gives up the WSL working environment for no gain. + +## Consequences + +- The UI-free core crate is still built and tested natively in WSL; only the GPUI app crate needs the Windows toolchain. +- Two Rust toolchains must stay recent enough: Windows' to build the app, WSL's for editor diagnostics and core tests. diff --git a/docs/agents/domain.md b/docs/agents/domain.md new file mode 100644 index 0000000..b548c53 --- /dev/null +++ b/docs/agents/domain.md @@ -0,0 +1,51 @@ +# Domain Docs + +How the engineering skills should consume this repo's domain documentation when exploring the codebase. + +## Before exploring, read these + +- **`CONTEXT.md`** at the repo root, or +- **`CONTEXT-MAP.md`** at the repo root if it exists — it points at one `CONTEXT.md` per context. Read each one relevant to the topic. +- **`docs/adr/`** — read ADRs that touch the area you're about to work in. In multi-context repos, also check `src//docs/adr/` for context-scoped decisions. + +If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) creates them lazily when terms or decisions actually get resolved. + +## File structure + +Single-context repo (most repos): + +``` +/ +├── CONTEXT.md +├── docs/adr/ +│ ├── 0001-event-sourced-orders.md +│ └── 0002-postgres-for-write-model.md +└── src/ +``` + +Multi-context repo (presence of `CONTEXT-MAP.md` at the root): + +``` +/ +├── CONTEXT-MAP.md +├── docs/adr/ ← system-wide decisions +└── src/ + ├── ordering/ + │ ├── CONTEXT.md + │ └── docs/adr/ ← context-specific decisions + └── billing/ + ├── CONTEXT.md + └── docs/adr/ +``` + +## Use the glossary's vocabulary + +When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `CONTEXT.md`. Don't drift to synonyms the glossary explicitly avoids. + +If the concept you need isn't in the glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`). + +## Flag ADR conflicts + +If your output contradicts an existing ADR, surface it explicitly rather than silently overriding: + +> _Contradicts ADR-0007 (event-sourced orders) — but worth reopening because…_ diff --git a/docs/agents/issue-tracker.md b/docs/agents/issue-tracker.md new file mode 100644 index 0000000..8d5d944 --- /dev/null +++ b/docs/agents/issue-tracker.md @@ -0,0 +1,39 @@ +# Issue tracker: Gitea + +Issues and specs for this repo live as Gitea issues on `https://gitea.nessar.fr` (repo `nessar/arena-tracker`). Use the `tea` CLI (login `srvhome`) for all operations; fall back to `tea api` for anything `tea` doesn't cover. `tea` infers the repo from `git remote -v`; otherwise pass `-r nessar/arena-tracker -l srvhome`. + +## Conventions + +- **Create an issue**: `tea issues create -t "..." -d "..." [-L "label1,label2"]`. For long bodies use `--description-file file.md` (or `-` for stdin). +- **Read an issue**: `tea issues --comments` +- **List issues**: `tea issues list --state open -o json -f index,title,body,labels,comments` with `-L