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 skills add Kevin-Liu-01/Agent-Machines --skill counterfactualgit clone --depth 1 https://github.com/Kevin-Liu-01/Agent-MachinesWrote 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/skills/kevin-liu-01/agent-machines/counterfactual)<a href="https://agentmods.dev/skills/kevin-liu-01/agent-machines/counterfactual"><img src="https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/counterfactual/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/kevin-liu-01/agent-machines/counterfactual"><img src="https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/counterfactual.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.1 | $0.00038 | $0.00632 |
| Opus 5 | $0.00019 | $0.00316 |
| Sonnet 5 | $0.00008 | $0.00126 |
| Haiku 4.5 | $0.00004 | $0.00063 |
Grade A, and why
counterfactual 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 12d 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 — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Counterfactual
Use this to avoid patching symptoms. The output must separate the minimal correct algorithm from the current algorithm, then name the smallest intervention that moves current toward correct.
Output shape
Use exactly these sections:
- Goal: one sentence stating the invariant we need.
- Minimal algorithm: pseudocode or numbered steps for the ideal implementation. No library constraints yet.
- Current algorithm: what the code actually does today, including ownership, blocking points, and cleanup boundaries.
- Gap: the first point where current diverges from minimal.
- Smallest fix: one intervention. Preserve working invariants.
- Falsifier: the test or measurement that proves the fix wrong.
Rules
- Do not start with a proposed patch. Start with the invariant.
- Do not compare against a strawman. Read the code and name exact functions, fields, and blocking calls.
- Preserve constraints that are already correct. If a prior commit fixed a deadlock, do not revert it to fix a leak.
- Prefer ownership/cancellation changes over retries, sleeps, or cleanup after the fact.
- A good fix reduces the gap; a great fix removes an entire class of impossible states.
Checklist
- Where is ownership supposed to live?
- What wakes every blocking syscall?
- Who joins or intentionally detaches each thread?
- Which fd owner closes each fd?
- What happens if the happy-path event never occurs?
- What is the failure mode under load?
Example
Goal: Dropping a per-machine vhost-user server must not block the registry actor and must not leak fds when no VM ever connects.
Minimal algorithm: bind listener; spawn accept loop cancellable by a shutdown token; Drop fires token, wakes listener, signals workers, joins threads with a bound, and closes all owned fds.
Current algorithm: start() moves VhostUserDaemon into an accept
thread and calls daemon.start(&mut listener). Drop removes the socket
path, then tries to take the daemon from Arc<Mutex<Option<_>>>. If the
thread is blocked in accept(), the option is None, so cleanup is
skipped.
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.
- 12d ago First seen · 71 lines · 38 tokens per session scan A 0d5ad1f2a15e
counterfactual is a skill published in the GitHub repository Kevin-Liu-01/Agent-Machines (29 stars, last pushed today), licensed MIT. It adds 38 tokens to every session and 632 once invoked, about $0.0002 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-30.
Other skills, from other repositories
opik-explain
Root-cause a specific Opik trace, or a pattern across traces, and return a grounded explanation. Uses the hosted Opik MCP when it is connected, and falls back to SDK scripting otherwise. Returns the root cause, the evidence spans as clickable Opik UI links, and one suggested next step. Use for "why did this trace…
hermes-plugin-development
Use when: creating, debugging, or integrating Hermes Agent plugins, including Python backend plugins (tools, hooks, routers, middleware) and JavaScript Hermes Desktop runtime plugins.
problem-management
Manage ServiceNow problems — create from linked incidents, proactive pattern detection, RCA with 5-Whys, knownerror workarounds (KEDB), KEDB search by CI/category/keywords, and permanent-fix linkage to changes.
incident-management
Manage ServiceNow incidents — creation with impact/urgency priority calc, auto-assignment by category, reassignment tracking, major incident declaration with bridge calls, time-based escalation, MTTR metrics.
node-inspect-debugger
Debug Node.js with node inspect, inspector attach, breakpoints, Chrome DevTools Protocol, heap snapshots, and CPU profiles.
holix-cron
Schedule recurring agent tasks via Holix built-in gateway cron (not crontab or custom scripts).