Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/akahkhanna/groundtruth/groundtruth-rulesgit clone --depth 1 https://github.com/akahkhanna/groundtruthWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/akahkhanna/groundtruth/groundtruth-rules)<a href="https://agentmods.dev/commands/akahkhanna/groundtruth/groundtruth-rules"><img src="https://agentmods.dev/badge/commands/akahkhanna/groundtruth/groundtruth-rules.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00019 | $0.01169 |
| Opus 5 | $0.00010 | $0.00584 |
| Sonnet 5 | $0.00004 | $0.00234 |
| Haiku 4.5 | $0.00002 | $0.00117 |
Grade A, and why
groundtruth-rules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 32 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Groundtruth's compiler reads your project's rule docs — CLAUDE.md, SCHEMA.md, **/ARCHITECTURE.md, docs/*.md, every .claude/skills/**/SKILL.md, every .claude/agents/*.md, .cursorrules/.windsurfrules — and proposes deterministic rules. Nothing is enforced until you approve it here. This command is that gate.
Argument: $ARGUMENTS — empty or list ⇒ just show the candidates; approve-all ⇒ arm every clean candidate; unarm <id …> ⇒ remove those rules from the active set (silence a rule that's firing wrongly — the verdict card prints each rule's [id] for exactly this); otherwise a space-separated list of rule ids to arm.
Do this:
-
Read
.claude/groundtruth/proposed-rules.json(the candidates) and.claude/groundtruth/compiled-rules.json(already-approved/active — may not exist yet). Ifproposed-rules.jsonis missing, the compiler hasn't run: tell the user to start a fresh session (init re-proposes) or runnode "<plugin>/hooks/compile-rules.mjs" .from the repo root, then stop. -
Present the candidates, grouped — be concise, one line each:
- Already armed (in compiled-rules.json):
id· severity · message. - Clean — safe to approve (proposed,
status: "armable", not already armed):id· message · source. These match zero existing code lines, so arming them can only fire on new code — low risk. - Needs review (
status: "review"):id· message ·hitsexisting code matches · thesampleline. Warn the user: a candidate that already matches committed code is either (a) catching a real existing problem, or (b) over-broad and will false-fire on legitimate code (e.g. a doc saysavoid `map`but.map(is everywhere). Only arm one of these if you've read the sample and confirmed it's a real rule with the right scope.
- Already armed (in compiled-rules.json):
-
Decide what to do based on the argument:
approve-all→ arm all clean candidates only. Never auto-arm a review candidate — those need a human eye.unarm <id …>→ remove exactly those ids fromcompiled-rules.json(write back the array minus them; if a named id isn't armed, say so and skip it). This is the frictionless "silence a wrong rule" path — no doc edit, no restart. Confirm which were removed and that they stop firing next turn. Then STOP (don't fall through to the arm path).- a list of ids → arm exactly those (a review candidate is allowed only when explicitly named).
- empty /
list→ show the table, write nothing, and end with a crystal-clear next action the user can copy verbatim — e.g.:To arm all N clean rules, reply with the whole line:
/groundtruth-rules approve-all— or just tell me "approve the clean rules" in plain words and I'll arm them. To pick specific ones:/groundtruth-rules <id> <id>. To skip for now: do nothing — nothing is enforced until you approve. Note for the user: a bareapprove-allor rule id typed on its own gets read as a command name and fails with "unknown command" — type it as an argument on the same line as/groundtruth-rules, or just ask in plain language (this command runs as me, so I can arm them from a natural-language request too).
-
To arm: write
.claude/groundtruth/compiled-rules.jsonas the union of (already-approved rules) + (newly approved candidates). For each rule keep only the runtime fields —id,source,kind,file_re,line_re,severity,message, andunless_reif present — and drop the proposal-only fields (status,hits,sample,positive_example,reason). Defaultseverityto"warn". Preserve the existing severity of any already-approved rule (never demote a human'sblockback towarn). Dedup byid. Write valid JSON (an array). -
Confirm: "Armed N rule(s) at warn. Active next turn — the Stop hook re-reads compiled-rules.json each run; no restart. To make one halt the turn instead of warn, set its
severityto"block"(or/groundtruth-block onfor global block mode). After editing your docs, start a new session (init re-proposes) and re-run /groundtruth-rules to approve the delta."
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 32 lines · 19 tokens per session scan A 88c33d8bb303
groundtruth-rules is a command published in the GitHub repository akahkhanna/groundtruth (6 stars, last pushed 1mo ago), licensed MIT. It adds 19 tokens to every session and 1,169 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.