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 edwardyap90/counterfactual-engineering-skill --skill counterfactual-engineeringgit clone --depth 1 https://github.com/edwardyap90/counterfactual-engineering-skillWrote 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/edwardyap90/counterfactual-engineering-skill/counterfactual-engineering)<a href="https://agentmods.dev/skills/edwardyap90/counterfactual-engineering-skill/counterfactual-engineering"><img src="https://agentmods.dev/badge/skills/edwardyap90/counterfactual-engineering-skill/counterfactual-engineering/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/edwardyap90/counterfactual-engineering-skill/counterfactual-engineering"><img src="https://agentmods.dev/badge/skills/edwardyap90/counterfactual-engineering-skill/counterfactual-engineering.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00056 | $0.01286 |
| Opus 5 | $0.00028 | $0.00643 |
| Sonnet 5 | $0.00011 | $0.00257 |
| Haiku 4.5 | $0.00006 | $0.00129 |
Grade A, and why
counterfactual-engineering 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 11d 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 — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Counterfactual Engineering
Purpose
Use this skill to turn "pick a solution and hope" into "test competing solutions and choose with evidence." It is most useful for risky bug fixes, architecture changes, migrations, performance work, auth/security changes, frontend redesigns, and any task where two or more credible approaches exist.
Do not use the full workflow for tiny deterministic edits where there is only one reasonable change. In that case, keep the normal direct implementation path.
Workflow
- Read the project first. Inspect
AGENTS.md, README, key config, test scripts, current git status, and the files that own the behavior. If the worktree has unrelated user changes, preserve them and avoid broad staging. - State the candidates before editing. Propose 2-3 candidate strategies with short labels such as
minimal-fix,root-cause-fix, andcompatibility-layer. Include the validation commands that every candidate must run. - Create isolated experiment spaces. Prefer
scripts/create_experiments.shin a clean git repository. If the repo is dirty or not a git repo, create manual copies or patches and clearly state the limitation. - Implement one strategy per candidate. Keep each candidate focused on its declared hypothesis. Do not mix fixes across candidates until comparison is complete.
- Run comparable verification. Use the same test, typecheck, lint, build, screenshot, benchmark, or domain-specific checks for every candidate. Use
scripts/run_verification.shwhen shell-command evidence is enough. - Compare with evidence. Use
scripts/compare_candidates.pyor a manual report. Treat passing correctness checks as mandatory before weighing diff size or style. - Apply only the winner. Bring the winning candidate back into the real worktree with an explicit patch, cherry-pick, or targeted manual edit. Do not silently merge experimental branches.
- Clean up or record artifacts. Remove temporary worktrees with
scripts/cleanup_experiments.shunless the user wants evidence kept. Summarize the winning rationale, rejected candidates, checks run, and remaining risk.
What ships with it
7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 11d ago First seen · 103 lines · 56 tokens per session scan A 2daf2591c70f
counterfactual-engineering is a skill published in the GitHub repository edwardyap90/counterfactual-engineering-skill (21 stars, last pushed 3mo ago), licensed MIT. It adds 56 tokens to every session and 1,286 once invoked, about $0.0003 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
prove-checks
Prove a passing check was capable of failing before recording it as evidence. Use when a test, CI job, build-and-diff, smoke test or rehearsal comes back green and that green is about to be treated as proof - especially when the check depends on a setup mutation (a sed/awk rewrite, an env var, a secret, a fixture…
evidence-first-debugging
Use when debugging a crash, lỗi, failing game, tool, build, service, script, or reproducible local code failure requires repro or reproduction, giả thuyết or ranked hypotheses, instrumentation, root-cause isolation, a minimal fix, regression proof, and a regression test.
systematic-debugging
4-phase root cause debugging: understand bugs before fixing.
langsmith-observability
LLM observability platform for tracing, evaluation, and monitoring. Use when debugging LLM applications, evaluating model outputs against datasets, monitoring production systems, or building systematic testing pipelines for AI applications.
experimental-code-coverage-local-debugger
Runs code coverage locally via Universal Test Runner (UTR) or helper scripts, mimicking LUCI trybots. Activate when CQ tryjobs fail or underreport coverage, to test local GN/recipe repairs before uploading, or to debug hermetic crashes.
adversarial-reviewer
Adversarial code review that assumes bugs exist and hunts for them. Use when asked to review code, find bugs, audit for correctness, stress-test a PR, or when someone says "tear this apart" or "what's wrong with this". Give no benefit of the doubt — every line is guilty until proven innocent.