TokenHound
AGENTS.md3 starsChanged 35 days agoMITView on GitHub
Write code, comments, documentation, and repository-facing text in English. The rules below apply to *.cs files.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository26 other files it gives its agents.
- ai-ready-fixSkill
- ai-ready-scoreSkill
- architectural-analysisSkill
- commitSkill
- deep-reviewSkill
- domain-modelingSkill
- dotnet-efficient-validationSkill
- herdr-orchestrationSkill
- no-workaroundsSkill
- repository-cli-efficiencySkill
- sdd-create-prdSkill
- sdd-create-techspecSkill
- sdd-execute-correctionsSkill
- sdd-execute-taskSkill
- sdd-orchestrate-flowSkill
- sdd-orchestrate-prdsSkill
- sdd-orchestrate-tasksSkill
- sdd-plan-auditSkill
- sdd-plan-correctionsSkill
- sdd-plan-refactoringSkill
- sdd-plan-tasksSkill
- sdd-review-codeSkill
- sdd-snapshotSkill
- sdd-triageSkill
- update-nuget-packagesSkill
- writing-agents-mdSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
24 rules. About 0 are common, 3 are distinctive, and 21 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
21
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 3
Write code, comments, documentation, and repository-facing text in English.
- Very specific: line 7
Keep TokenHound.Core pure: zero UI or OS dependencies.
- Very specific: line 8
Never invent limits or denominators: if an API reports only remaining count, set usedFraction to null.
- Very specific: line 9
Never write or refresh credentials owned by other tools.
- Distinctive: line 17
Keep one class per file, except nested types.
- Distinctive: line 18
Keep files and classes <= 300 lines, methods <= 30 lines, nesting <= 3 levels.
- Very specific: line 19
Document public members with XML comments.
- Very specific: line 20
Use file-scoped namespaces, with alphabetized using directives above them.
- Very specific: line 28
Prefer is null, switch expressions, and collection expressions [].
- Very specific: line 29
Use records with init and required for DTOs and immutable messages.
- Very specific: line 32
Use structured logging with typed arguments.
- Very specific: line 33
Use .ConfigureAwait(false) in Core and Infrastructure.
- Very specific: line 38
Run project-scoped tests using rtk dotnet test --project <path> --no-build --no-restore -- --minimum-expected-tests 1 or rtk dotnet run …
- Very specific: line 40
Always enforce --minimum-expected-tests 1.
- Very specific: line 43
Follow the dotnet-efficient-validation skill (references/mtp.md) for runner detection, discovery flags, and extended options.
- Very specific: line 48
Verify HUD positioning with Windows MCP Screenshot on the primary monitor (display: [2]).
- Very specific: line 62
Read ARCHITECTURE.md before changing solution structure, technologies, or dependencies.
- Very specific: line 63
Read the relevant spec in docs/specs/ before implementing or modifying provider adapters, rate limits, or credentials.
- Very specific: line 64
Read docs/design/ before implementing or styling HUD geometry, animations, or tooltips.
- Very specific: line 76
Run graft map first — a token-budgeted orientation (dir clusters, hubs, hotspots), no LLM, no key.
- Very specific: line 79
Run graft ask "<your question>" --source → ranked nodes with the relevant code spans inlined (each hit's ≤8-line crux by default.
- Very specific: line 91
Add --direction out for what it calls, or --depth N to walk transitively for the full blast radius.
- Distinctive: line 99
If a returned span is truncated ("+N more lines"), open the file at that exact range before finalizing.
- Very specific: line 104
After big code changes, refresh the graph with graft build (deterministic, no API key, $0).
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Repository Instructions
Write code, comments, documentation, and repository-facing text in English. The rules below apply to *.cs files.
Project architecture & invariants
- Keep
TokenHound.Corepure: zero UI or OS dependencies; models, contracts, and policies only. - Never invent limits or denominators: if an API reports only remaining count, set
usedFractiontonull. - Never write or refresh credentials owned by other tools; borrow read-only with
FileShare.ReadWrite | FileShare.Delete. - Open SQLite WAL databases using
Mode=ReadOnly; fall back toimmutable=1when-shmsidecar is missing. - Persist and respect 429 rate-limit deadlines before dispatching network calls; never retry immediately on
Retry-After: 0. - Hook
WM_MOUSEACTIVATEreturningMA_NOACTIVATE(3) on HUD windows to prevent stealing focus on click or drag. - In
WindowStyles.EnableNonActivating, useSWP_NOZORDER(0x0004); omitSWP_SHOWWINDOWto preserve WPF layered window composition.
C# structure & style
- Keep one class per file, except nested types. Seal classes by default.
- Keep files and classes <= 300 lines, methods <= 30 lines, nesting <= 3 levels.
- Document public members with XML comments; use
<inheritdoc />for inherited members. - Use file-scoped namespaces, with alphabetized
usingdirectives above them. - Name constants in
UPPER_CASE. Usenameofinstead of hard-coded strings. Do not use#region. - Omit braces for single-line
if/elsebodies. Put=>on the next line for expression-bodied members. - Separate members with one blank line; add one blank line immediately inside multi-line blocks and before control flow statements (
if,for,return). - Split calls with >= 4 arguments across lines: method name and opening parenthesis, one argument per line, closing parenthesis on its own line.
C# practices
- Prefer
is null, switch expressions, and collection expressions[]. - Use records with
initandrequiredfor DTOs and immutable messages. - Mark anonymous functions
staticwhen they capture no state. - Compare strings with
string.Equals(a, b, StringComparison.OrdinalIgnoreCase). - Use structured logging with typed arguments. Persist configuration as JSON with
System.Text.Json. - Use
.ConfigureAwait(false)inCoreandInfrastructure; omit in UI sync contexts. - Accept and propagate
CancellationTokenfor asynchronous operations. Return tasks directly in pass-through methods.
Running & reading MTP tests
- Run project-scoped tests using
rtk dotnet test --project <path> --no-build --no-restore -- --minimum-expected-tests 1orrtk dotnet run --project <path> --no-build --no-restore -- --minimum-expected-tests 1. - Pass MTP filter arguments after
--(--filter-class "*<Name>*",--filter-method "*<Name>*", or--list-tests); do not use VSTest--filteror--logger. - Always enforce
--minimum-expected-tests 1; never treat zero executed tests as a pass. - Inspect test failures directly from stdout; rerun with
rtk proxytargeting the failing test if token filtering hides error details or stack traces. - Preserve and verify
$LASTEXITCODEafter test commands; never suppress output withOut-Null. - Follow the
dotnet-efficient-validationskill (references/mtp.md) for runner detection, discovery flags, and extended options.
Running & validating desktop HUD
- Launch
TokenHound.Appvia Windows MCPApptool (mode="launch_executable"); shellStart-Processruns in an isolated desktop and will not render to the user screen. - Verify HUD positioning with Windows MCP
Screenshoton the primary monitor (display: [2]). - Expose every new app command in both menus: the tray menu (
TrayMenuItemKey,UI/Tray/) and the HUD context menu (NotchWindow.xaml).
Releasing
- Push a
v*tag, wait for.github/workflows/release.ymlto publish the release, then replace its auto-generated notes with English release notes and updateREADME.mdfor user-facing changes.
Skills to load first
dotnet-efficient-validationbefore any .NET build, test, publish, or run command.repository-cli-efficiencybefore repository searches, grep operations, or diff inspections.
Documentation to read on demand
- Read
ARCHITECTURE.mdbefore changing solution structure, technologies, or dependencies. - Read the relevant spec in
docs/specs/before implementing or modifying provider adapters, rate limits, or credentials. - Read
docs/design/before implementing or styling HUD geometry, animations, or tooltips.
<!-- graft:start -->Graft — repo context graph
This repo is indexed in graft/: small linked markdown nodes that explain each
system and carry exact file:line spans, kept in sync with the code through git.
For ANY task here — understanding how something works, finding where code lives,
or scoping a change — get context from the graph before grepping or opening
source files. Re-ask freely (it's cheap) and reuse literal identifiers you
already have (symbol, error string, file name) as the query. New to this repo?
Run graft map first — a token-budgeted orientation (dir clusters, hubs,
hotspots), no LLM, no key.
- Run
graft ask "<your question>" --source→ ranked nodes with the relevant code spans inlined (each hit's ≤8-line crux by default;--fullfor whole definitions when the crux isn't enough). Match the tool to the task shape: for understanding or editing, the top node IS the answer — cite itscovers:file:line spans and edit straight from--source. For exhaustive tasks ("every occurrence / every caller of this pattern"), ranked results are top-N, not complete — rungraft grep "<literal>"instead (exhaustive over indexed files, grouped by enclosing symbol), falling back to rawgrep -rnonly for unindexed files. graft skeleton <file>→ every definition's signature + span, ~10× cheaper than reading the file; use it to skim an API surface.graft callers <symbol>gives precomputed, exact edges — who calls this. Add--direction outfor what it calls, or--depth Nto walk transitively for the full blast radius. For structural questions, skip ranking and use this directly.- Or browse:
graft/INDEX.mdlists every node; follow the links. - Monorepos and folders of multiple repos rank fairly across sub-projects —
hits carry
[scope/]labels naming which one they're from. Narrow withgraft ask "<task>" --in <scope>/once you know where you're working.
If a returned span is truncated ("+N more lines"), open the file at that exact range before finalizing. Only open source files when a node genuinely lacks a needed detail, and then at the exact file:line the node points to — never re-read whole files.
After big code changes, refresh the graph with graft build (deterministic,
no API key, $0).
<!-- graft:end -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

