Agent skill

Counterfactual Reasoning

by THUYRan in THUYRan/Legal-Skills-Chinese

当需要评估'如果某一事实/行为/条件不存在或发生改变,法律结果将如何不同'时触发此技能。典型触发场景包括:因果关系认定(若无该行为,损害是否仍会发生)、过错与责任比例划分、损害赔偿范围确定、合同违约损失计算、行政行为合法性假设检验、刑事因果关系中断判断、立法影响评估等。核心方法是构建一个与现实世界仅在目标变量上不同的'反事实世界',比较两个世界的结果差异,从而得出目标变量对结果的贡献程度。

No licenceAuto-check passedLegal & Compliance

Install Counterfactual Reasoning

skills CLI
$ npx skills add THUYRan/Legal-Skills-Chinese --skill counterfactual-reasoning -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install THUYRan/Legal-Skills-Chinese counterfactual-reasoning --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/THUYRan/Legal-Skills-Chinese.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/counterfactual-reasoning .claude/skills/counterfactual-reasoning && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
counterfactual-reasoning
GitHub stars
874
Token cost
~4.8k tokens
SKILL.md length
580 words
Files
1
Skills in repo
71
Repo updated
First seen
Licence
None found

At a glance

当需要评估'如果某一事实/行为/条件不存在或发生改变,法律结果将如何不同'时触发此技能。典型触发场景包括:因果关系认定(若无该行为,损害是否仍会发生)、过错与责任比例划分、损害赔偿范围确定、合同违约损失计算、行政行为合法性假设检验、刑事因果关系中断判断、立法影响评估等。核心方法是构建一个与现实世界仅在目标变量上不同的'反事实世界',比较两个世界的结果差异,从而得出目标变量对结果的贡献程度。

  • Works in 4 steps: 可能世界语义学:我们可以有意义地讨论"如果事情不同会怎样" → 最小偏离原则:反事实世界应与现实世界尽可能相似,仅在目标变量上不同 → 因果规律的稳定性:自然规律和社会规律在反事实世界中仍然成立 → …
  • Legal & Compliance work in your project
  • SKILL.md covers 一、概述表格, 二、法律声明, 三、核心概念 and 四、完整工作流程, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Counterfactual Reasoning is an agent skill from THUYRan/Legal-Skills-Chinese. 当需要评估'如果某一事实/行为/条件不存在或发生改变,法律结果将如何不同'时触发此技能。典型触发场景包括:因果关系认定(若无该行为,损害是否仍会发生)、过错与责任比例划分、损害赔偿范围确定、合同违约损失计算、行政行为合法性假设检验、刑事因果关系中断判断、立法影响评估等。核心方法是构建一个与现实世界仅在目标变量上不同的'反事实世界',比较两个世界的结果差异,从而得出目标变量对结果的贡献程度。

Its SKILL.md is about 4.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Legal & Compliance.

When your agent uses it

  • Legal & Compliance work in your project

Example prompts

  • “如果某一事实/行为/条件不存在或发生改变,法律结果将如何不同”
  • “/counterfactual-reasoning”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. 可能世界语义学:我们可以有意义地讨论"如果事情不同会怎样"
  2. 最小偏离原则:反事实世界应与现实世界尽可能相似,仅在目标变量上不同
  3. 因果规律的稳定性:自然规律和社会规律在反事实世界中仍然成立
  4. 可判断性假设:反事实世界的结果在合理范围内是可以判断的

What it can do on your machine

Read from SKILL.md and the folder at commit c31ef1f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Counterfactual Reasoning loads about 4.8k tokens when it runs. Until then it costs about 55 tokens; SKILL.md has 580 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~55
When it runs · the whole SKILL.md, loaded when a task matches
~4.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Without a licence we can't republish the file, so here is its outline and opening line. It has 580 words (~4,756 tokens).

name
counterfactual-reasoning

Read the full SKILL.md on GitHub

Files

Just SKILL.md in skills/counterfactual-reasoning of THUYRan/Legal-Skills-Chinese.

Open the folder on GitHubat commit c31ef1f

Compare with similar skills

Counterfactual Reasoning next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Counterfactual Reasoning compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Counterfactual Reasoning this skillTHUYRan/Legal-Skills-Chinese874—~4.8kAutomated safety check: PassNone
Paper to Chinese Patent DrafterYuan1z0825/nature-skills47k1 repos~1.1kAutomated safety check: PassApache-2.0
C15tc15t/c15t1.9k1 repos~1.6kAutomated safety check: PassApache-2.0
Contract Reviewevolsb/claude-legal-skill4641 repos~3.6kAutomated safety check: PassMIT
Legal Clinic Client Intakeanthropics/claude-for-legal9.6k3 repos~3.2kAutomated safety check: PassApache-2.0
Paper To Cn Patentsnipp-zha/Paper-to-patent-Skill1071 repos~959Automated safety check: PassNone

Similar skills

  • Paper to Chinese Patent Drafter

    Yuan1z0825/nature-skills

    Drafts Chinese invention patent applications and technical disclosures from research papers or inventor materials, tying each claim feature to source evidence.

    47k GitHub starsUsed in 1 repo~1.1k tokens
    Legal & ComplianceAuto-check passed
  • C15t

    c15t/c15t

    Work with c15t consent management docs, APIs, and integrations for Next.js, React, and JavaScript.

    1.9k GitHub starsUsed in 1 repo~1.6k tokens
    Legal & ComplianceAuto-check passed
  • Contract Review

    evolsb/claude-legal-skill

    Review legal contracts, NDAs, employment agreements, SaaS terms, and M&A documents.

    464 GitHub starsUsed in 1 repo~3.6k tokens
    Legal & ComplianceAuto-check passed
  • Legal Clinic Client Intake

    anthropics/claude-for-legal

    Official

    Structures a legal clinic client intake interview and produces a case summary with cross-area issue spotting, conflict flags and triage classification.

    9.6k GitHub starsUsed in 3 repos~3.2k tokens
    Legal & ComplianceAuto-check passed
  • Paper To Cn Patent

    snipp-zha/Paper-to-patent-Skill

    Convert scientific papers, theses, technical reports, source code, figures, or research manuscripts into evidence-grounded Chinese invention patent drafts.

    107 GitHub starsUsed in 1 repo~959 tokens
    Legal & ComplianceAuto-check passed
  • Employment Contract Templates

    ynulihao/AgentSkillOS

    Create employment contracts, offer letters, and HR policy documents following legal best practices.

    618 GitHub starsUsed in 12 repos~4.1k tokens
    Legal & ComplianceAuto-check passed

More from THUYRan/Legal-Skills-Chinese

All 71 skills in this repo
  • Billing And Litigation Budget

    THUYRan/Legal-Skills-Chinese

    A skill your agent uses when the user needs to track or manage attorney hours, expert fees, and investigation costs; control litigation spend; or prepare timesheets or expense statements for clients.

    874 GitHub stars~5k tokensUpdated 1 mo ago
    Auto-check passed
  • Case Lifecycle Planning

    THUYRan/Legal-Skills-Chinese

    Case full-lifecycle planning skill. An agent skill from THUYRan/Legal-Skills-Chinese.

    874 GitHub stars~1k tokensUpdated 1 mo ago
    Auto-check passed
  • Legal Abductive Reasoning

    THUYRan/Legal-Skills-Chinese

    Legal abductive reasoning skill for generating and evaluating the most reasonable explanatory hypotheses when evidence is incomplete or facts are ambiguous.

    874 GitHub stars~4k tokensUpdated 1 mo ago
    Auto-check passed
  • Teleological Interpretation

    THUYRan/Legal-Skills-Chinese

    Teleological interpretation skill (目的解释). An agent skill from THUYRan/Legal-Skills-Chinese.

    874 GitHub stars~4.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Trial Scheduling And Deadline Monitoring

    THUYRan/Legal-Skills-Chinese

    A skill your agent uses when the user needs to track or be reminded of hearing schedules, enforcement schedules, evidence-submission deadlines, appeal deadlines, service deadlines, preservation…

    874 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check passed
  • Analogical Reasoning

    THUYRan/Legal-Skills-Chinese

    Trigger this skill when the AI agent must handle any of the following situations: 1.

    874 GitHub stars~14k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Counterfactual Reasoning

What does Counterfactual Reasoning do?

当需要评估'如果某一事实/行为/条件不存在或发生改变,法律结果将如何不同'时触发此技能。典型触发场景包括:因果关系认定(若无该行为,损害是否仍会发生)、过错与责任比例划分、损害赔偿范围确定、合同违约损失计算、行政行为合法性假设检验、刑事因果关系中断判断、立法影响评估等。核心方法是构建一个与现实世界仅在目标变量上不同的'反事实世界',比较两个世界的结果差异,从而得出目标变量对结果的贡献程度。. Counterfactual Reasoning is an agent skill from THUYRan/Legal-Skills-Chinese.

When should I use Counterfactual Reasoning?

Counterfactual Reasoning fits situations like: legal & Compliance work in your project.

How do I install Counterfactual Reasoning in Claude Code?

Run `npx skills add THUYRan/Legal-Skills-Chinese --skill counterfactual-reasoning -a claude-code`. Or copy the skill folder (skills/counterfactual-reasoning in THUYRan/Legal-Skills-Chinese) into .claude/skills/counterfactual-reasoning in your project. Claude Code loads it when a task matches its description.

How do I install Counterfactual Reasoning in Codex?

Run `npx skills add THUYRan/Legal-Skills-Chinese --skill counterfactual-reasoning -a codex`. Or copy the skill folder (skills/counterfactual-reasoning in THUYRan/Legal-Skills-Chinese) into .agents/skills/counterfactual-reasoning in your project. Codex loads it when a task matches its description.

Can I use Counterfactual Reasoning in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add THUYRan/Legal-Skills-Chinese --skill counterfactual-reasoning -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/counterfactual-reasoning, .gemini/skills/counterfactual-reasoning, .github/skills/counterfactual-reasoning and .opencode/skills/counterfactual-reasoning in your project.

What does Counterfactual Reasoning need to run?

SKILL.md names no scripts, command-line tools or credentials: Counterfactual Reasoning is instructions for the agent only.

Does Counterfactual Reasoning access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Counterfactual Reasoning safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Counterfactual Reasoning use?

No licence was found for Counterfactual Reasoning or its repository. Without one, default copyright applies: ask the author before reusing or redistributing it.

How many tokens does Counterfactual Reasoning use?

About 4.8k tokens (SKILL.md is roughly 19k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Counterfactual Reasoning?

Skills that share tags, products or a category with Counterfactual Reasoning: Paper to Chinese Patent Drafter (Yuan1z0825/nature-skills, 47k stars), C15t (c15t/c15t, 1.9k stars), Contract Review (evolsb/claude-legal-skill, 464 stars) and Legal Clinic Client Intake (anthropics/claude-for-legal, 9.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Counterfactual Reasoning?

THUYRan (a GitHub user) maintains it in THUYRan/Legal-Skills-Chinese, which has 874 GitHub stars. The repository holds 71 skills in this directory. The repository was last updated on August 22, 2026.

Source: THUYRan/Legal-Skills-Chinese on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.