counterfactual-reasoning

Analyzes legal causation by comparing actual outcomes against counterfactual scenarios.

1|Updated May 28, 2026
One-click install
npx skills add https://github.com/MaryHu-YR/Chinese-Law-Harness --skill counterfactual-reasoning-maryhu-yr
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: counterfactual-reasoning
Source: https://github.com/MaryHu-YR/Chinese-Law-Harness/tree/main/skills/counterfactual-reasoning
Command: npx skills add https://github.com/MaryHu-YR/Chinese-Law-Harness --skill counterfactual-reasoning-maryhu-yr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Legal professionals often struggle to rigorously determine whether a specific act or omission caused a legal outcome, especially in multi-cause, probabilistic, or omission-based scenarios. This Skill provides a structured methodology for counterfactual causal analysis under PRC law, turning vague 'what if' questions into traceable, confidence-rated legal conclusions. ## Core Features & Use Cases - Structured Causation Testing: Applies But-for and NESS tests with a defined workflow covering variable definition, background condition locking, counterfactual world construction, and step-by-step inference. - Domain-Specific Guidance: Maps counterfactual questions to tort, contract, criminal, and administrative law with corresponding PRC statutory sources (e.g., Civil Code Articles 1165, 584, 1218). - Confidence Annotation System: Labels every inference step and conclusion with a five-level confidence scale aligned to civil, criminal, and administrative proof standards. - Use Case: In a medical malpractice dispute, determine whether a misdiagnosis caused the patient's injury by constructing a counterfactual world where timely diagnosis occurred, quantifying the lost chance of recovery (e.g., 70%), and deriving a liability proportion. ## Quick Start Ask the AI to analyze whether the defendant's running of a red light caused the plaintiff's injuries using counterfactual reasoning, and produce a structured causation report with confidence ratings.

Frequently Asked Questions about counterfactual-reasoning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze legal causation using counterfactual reasoning?▼

Define the target variable (the act or omission) and the outcome variable, lock all background conditions, then construct a counterfactual world where only the target variable changes. Compare outcomes across both worlds to determine whether the variable caused the result, and annotate each inference step with a confidence level.

What is the difference between the But-for test and the NESS test?▼

The But-for test asks whether the outcome would have occurred without the act, and works for single-cause scenarios. The NESS test checks whether the act is a necessary element of a sufficient condition set, and is used for overdetermined multi-cause cases where But-for fails.

How does counterfactual reasoning handle medical malpractice cases?▼

It constructs a counterfactual world where proper diagnosis and treatment occurred, then uses medical evidence to estimate the probability of avoiding harm. Probabilistic results are handled through the loss-of-chance theory, translating the lost survival or recovery probability into a liability proportion.

When should counterfactual reasoning not be used in legal analysis?▼

It should not be used for pure legal interpretation questions with no factual causation component, when the target variable cannot be meaningfully altered, when no reliable causal knowledge supports the inference, or when the law prescribes an alternative causation framework.

How are confidence levels assigned to counterfactual conclusions?▼

Each inference step receives a rating from CF-HIGH to CF-LOW based on the reliability of its causal basis, and the overall conclusion takes the lowest rating in the chain. The rating is then checked against the applicable proof standard, such as high probability for civil cases or beyond reasonable doubt for criminal cases.