Records R1 to R7 from the developer and the decisions D1 to D11 that the v1 work builds on, plus the issue, branch and review workflow the agents follow. Refs #1
7.2 KiB
FinalToken
A small tray app that tracks Claude Code and Codex usage and limits on Windows 11 and CachyOS. It never signs in to a provider and never handles a token: all data comes from the installed CLIs and the files they write. A stats panel shows history, small popups warn when usage runs ahead of or behind a limit's pace, and a Stream Deck plugin puts stats on keys. Developer: schmidt.florian (Gitea user name).
Sources of truth
docs/requirements.mdholds the requirements, with stable IDs (R1).docs/decisions.mdholds the recorded decisions (D1), each with why and what it gives up. Read the ones for your area before working in it. Cite IDs in code comments, commits and PRs rather than restating the text.- Each project under
src/andtests/has a shortAGENTS.md. Read it before changing the project.
Recorded decisions are binding
Build what the decisions say. When a task conflicts with one, or one looks wrong, stop: comment on
the issue with the conflict and a proposal, add status/needs-decision, and leave the call to the
developer. A decision changes only through a PR that edits its text in docs/decisions.md, keeps
the decision, why and gives-up format, and carries the type/decision label.
Layout
| Path | What it is |
|---|---|
src/FinalToken.Core |
No UI. Domain model, pace (D7), collectors (D3, D4), history store (D5), refresh scheduler (D6), snapshot contract (D9), settings, plugin installer (D11) |
src/FinalToken.App |
Avalonia desktop app (D8): stats panel, tray, settings, popups |
src/FinalToken.Cli |
finaltoken console: runs a refresh and prints the snapshot, for scripts and checks |
src/FinalToken.StreamDeck |
Stream Deck plugin executable and its .sdPlugin assets (D10) |
tests/* |
One test project per tested project, named <Project>.Tests |
tools/ |
Repository tools, listed under Tools |
Rules for code
- Current C# 14 on .NET 10: file-scoped namespaces, primary constructors, collection expressions,
requiredandinit, pattern matching,System.Threading.Lock. Nullable reference types on. - NativeAOT-safe everywhere (D1): System.Text.Json source generation, Avalonia compiled bindings,
no reflection-driven serialization, binding or loading, no
dynamic, no runtime code generation. Trim and AOT analyzer warnings are errors; never suppress one without a one-line reason at that spot. - Never touch credentials (D2): do not open credential files, environment secrets or keychains, never log message text, and never call a provider's HTTP API.
- Child processes (
claude,codex) run without a shell, with arguments as a list, a timeout and cancellation, and are killed with their process tree when they overrun (D6). - Every file the app writes for itself is written atomically (D5).
- Paths come from
Environment.GetFolderPath,Path.Combineand the environment overrides named in D3 and D4, never from hard-coded drive letters or/home/<user>. - Parsers of CLI output and files are total: unknown or malformed input becomes a diagnostic, never an exception that stops a refresh, and never a guessed value.
- A new package needs a justification in its PR and must be NativeAOT-compatible. Package
versions live in
Directory.Packages.props. - New behaviour has tests. Parser tests use small, hand-written fixtures under the test project; never copy a real transcript or rollout into the repo.
Workflow
- Issue first. Find or create the Gitea issue at
https://git.finalfactory.de/FinalFactory/FinalTokenand assign it to schmidt.florian. Put the plan on the issue as a checklist and keep it current. Give it atype/label. Claim agent work with the active agent labels. - One branch per issue, in its own worktree: branch
<issue>-<slug>fromorigin/master, checked out at../FinalToken-wt/<issue>-<slug>. - Commit with an
area: summarysubject (docs:,tools:,core:,app:,streamdeck:,cli:), a body that says why, andRefs #N. Push after every commit. - Open a PR into
masterwith a body that follows.gitea/pull_request_template.mdand saysCloses #N. The PR title becomes the squash commit subject, so it follows the commit style. - Review. After the last push, start a fresh reviewer as described in
docs/agents/review.md. Fix blocking findings, push, and start a new review. - Merge with a squash merge once the review passes, then delete the branch and remove the worktree.
Codex workers use GPT-6.1 Sol, model ID gpt-6.1-sol. Never select GPT-6 Sol or gpt-6-sol.
Active agent labels
| Label | Meaning |
|---|---|
status/in-progress |
At least one agent works on the issue now |
agent/florian |
The active agents work for schmidt.florian |
model/<exact-model-id> |
An active agent uses this exact model ID |
- Add
status/in-progress,agent/florianand each active model's label when work starts, and post a claim comment with the models, their roles, the branch and the worktree. - The coordinating agent keeps labels and comments current; workers report to it and do not edit the issue. Remove a model label when its last agent stops, and all three kinds when none runs.
- Add and remove single labels. Never replace the issue's label list.
Workers
The coordinating agent briefs workers, answers their questions and keeps the commits, pushes,
issue comments and the PR. Workers leave their changes uncommitted, end with a summary of the
commands they ran and their results, and list open questions under QUESTIONS:. Never let two
agents edit the same files at once.
When you are stuck
- Stop when the same problem survives two attempts, or as soon as something proves
impossible. Comment on the issue with what you tried, what failed and what you need, and set
status/blockedorstatus/needs-decision. - The review loop has a limit: after a PR's second failed review, the developer decides how
it goes on (
docs/agents/review.md).
Building and testing
Run every command from the repository root.
| Command | What it does |
|---|---|
dotnet build FinalToken.slnx -c Release |
Builds everything; any warning fails |
dotnet test --solution FinalToken.slnx -c Release |
Runs every test project |
python -B tools/docs/check_docs.py |
Checks that local links and anchors resolve, that each ID is defined once and that every cited ID exists |
Every change runs the build, the affected tests and the documentation check. UI changes also need a screenshot of each changed view: compiling is not working.
Tools
tools/docs/check_docs.py: the documentation check; its tests arepython -B tools/docs/test_check_docs.py.tools/gitea.sh: calls the Gitea API with the stored git credential orGITEA_TOKEN.tools/agent-review.sh: posts an agent review and sets theagent-reviewstatus; seedocs/agents/review.md.
Writing
Docs, commit messages and PR bodies use plain, short sentences in the style of
docs/decisions.md. Link issues as
[#1](https://git.finalfactory.de/FinalFactory/FinalToken/issues/1).
Shared memory
Durable lessons (a gotcha, a convention, a command) go into this file, a project's AGENTS.md or
.agents/mind/, through a PR. Session state and handoffs go in issue comments.