causal-inference

causal-inference is a skill for Codex from plurigrid/asi. It costs 36 tokens per session (1,822 once invoked), scanned A, original, MIT.

A Julia index that links formal proofs to the theorems they prove and lets you navigate in both directions. It also checks a rule that prevents immediately returning to the item you just came from, for a resource-aware proof system based on linear homotopy type theory.

In plain words
What is it for?
Use it to build a proof–theorem index, find a theorem from a proof, find proofs for a theorem, check non-backtracking constraints, and test compatibility with linear homotopy type theory.
Why use it?
It provides fast cached lookups and helps prevent invalid backtracking while navigating proof relationships. The input describes it as production ready.

Skill for Codex

Written for Codex: installed under .codex/.

Good fit Use it to build a proof–theorem index, find a theorem from a proof, find proofs for a theorem, check non-backtracking constraints, and test compatibility with linear homotopy type theory.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/plurigrid/asi/causal-inference
Install

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.

Any agent
npx skills add plurigrid/asi --skill causal-inference
Clone the repo
git clone --depth 1 https://github.com/plurigrid/asi

Made for: Codex.

Wrote 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.

agentmods badge for causal-inference

README.md
[![agentmods](https://agentmods.dev/badge/skills/plurigrid/asi/causal-inference/github.svg)](https://agentmods.dev/skills/plurigrid/asi/causal-inference)
Your own site
<a href="https://agentmods.dev/skills/plurigrid/asi/causal-inference"><img src="https://agentmods.dev/badge/skills/plurigrid/asi/causal-inference/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.

agentmods 80×15 button for causal-inference

Your own site · 80×15
<a href="https://agentmods.dev/skills/plurigrid/asi/causal-inference"><img src="https://agentmods.dev/badge/skills/plurigrid/asi/causal-inference.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,822 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.01822
Opus 5 $0.00018 $0.00911
Sonnet 5 $0.00007 $0.00364
Haiku 4.5 $0.00004 $0.00182

Measured 6d ago against content hash 2c05c357fcf3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

causal-inference 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 6d 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.

ies/music-topos/.codex/skills/causal-inference/SKILL.md · 238 lines

How it starts

The opening of the file, as written. The whole thing — 238 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Causal Inference Skill

"Current deep learning is System 1: fast, intuitive, but easily fooled. We need System 2: slow, deliberate, causal." — Yoshua Bengio

Overview

Causal inference enables:

  1. Interventional reasoning: What happens if I do X?
  2. Counterfactual reasoning: What would have happened if...?
  3. Transfer: Causal structure generalizes across domains
  4. Robustness: Causal models resist distribution shift

Pearl's Causal Hierarchy

Level 3: Counterfactual (Imagining)
  "What would have happened if I had done X?"
  P(y_x | x', y')
          ▲
Level 2: Intervention (Doing)
  "What happens if I do X?"
  P(y | do(X))
          ▲
Level 1: Association (Seeing)
  "What does X tell me about Y?"
  P(y | x)

Structural Causal Models (SCM)

class StructuralCausalModel:
    """
    SCM: Variables, causal graph, structural equations.
    """
    
    def __init__(self, variables: List[str], graph: DAG, equations: Dict):
        self.variables = variables
        self.graph = graph  # Directed Acyclic Graph
        self.equations = equations  # X_i = f_i(parents(X_i), U_i)
    
    def intervene(self, intervention: Dict[str, float]) -> "SCM":
        """
        do(X = x): Replace equation for X with constant.
        
        This breaks incoming edges to X.
        """
        new_equations = self.equations.copy()
        for var, value in intervention.items():
            new_equations[var] = lambda *_: value
        
        new_graph = self.graph.remove_edges_to(intervention.keys())
        
        return StructuralCausalModel(
            self.variables, new_graph, new_equations
        )
    
    def counterfactual(self, evidence: Dict, intervention: Dict) -> Dict:
        """
        Counterfactual: What would Y be if X had been x, given we observed evidence?
        
        Three steps:
        1. Abduction: Infer noise terms from evidence
        2. Action: Apply intervention
        3. Prediction: Compute counterfactual outcome
        """
        # Step 1: Abduction - infer noise terms U
        noise_terms = self.abduct_noise(evidence)
        
        # Step 2: Action - apply intervention
        intervened_scm = self.intervene(intervention)
        
        # Step 3: Prediction - forward propagate with inferred noise
        counterfactual_world = intervened_scm.forward(noise_terms)
        
        return counterfactual_world


class CausalDiscovery:
    """
    Learn causal structure from data.
    """
    
    def __init__(self, data: pd.DataFrame):
        self.data = data
        
    def pc_algorithm(self) -> DAG:
        """
        PC Algorithm: Constraint-based causal discovery.
        
        1. Start with complete undirected graph
        2. Remove edges based on conditional independence tests
        3. Orient edges using v-structures and rules
        """
        from causallearn.search.ConstraintBased.PC import pc
        
        result = pc(self.data.values)
        return result.G
    
    def gflownet_discovery(self) -> Distribution[DAG]:
        """
        Use GFlowNet to sample DAGs proportional to likelihood.
        
        This gives a DISTRIBUTION over causal graphs,
        properly accounting for uncertainty.
        """
        from gflownet import CausalDAGGFlowNet
        
        gfn = CausalDAGGFlowNet(n_variables=len(self.data.columns))
        gfn.train(reward=lambda g: self.bayesian_score(g))
        
        # Sample multiple DAGs
        dag_samples = [gfn.sample() for _ in range(1000)]
        return dag_samples

Read the full file on GitHub · 238 lines

Changes

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.

  1. 6d ago First seen · 238 lines · 36 tokens per session scan A 2c05c357fcf3

Subscribe to this mod's changes

causal-inference is a skill published in the GitHub repository plurigrid/asi (62 stars, last pushed 2mo ago), licensed MIT. It adds 36 tokens to every session and 1,822 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-09-03.

Related

Other skills, from other repositories

proof-orchestrator

Manage a stateful, run-directory-based proof project: continuation across runs, run-local source bookkeeping, manual GPT Pro handoff packages when a local attempt stalls, and an optional DeepSeek second opinion as additional evidence only. Use when the user asks for proof-run orchestration, a GPT Pro handoff, or…

wanshuiyin/Auto-claude-code-research-in-sleep · 93 tokens

Science

The scientific method as a universal problem-solving algorithm — goal-first, plural falsifiable hypotheses, designed experiments, and honest measurement, scaling from TDD to feature validation to MVP launch. USE WHEN think about, figure out, experiment, iterate, optimize, hypothesis, science, full cycle, quick…

danielmiessler/LifeOS · 85 tokens

template-maintenance

On-demand maintenance helpers for the template repository. Includes workspace management, project info display, working-project rendering, PDF re-rendering, executive output organization, test supplement merging, batch source improvement, pre-commit setup, and CodeGraph index helpers. None run in the default pipeline…

docxology/template · 63 tokens

meal

A meal log that records foods and estimates calories, protein, carbohydrates, and fat for each meal.

shikidmsh-rgb/mochibot · 16 tokens

fitness-pre-workout-brief

Prepare and persist TODAY'S pre-workout / training-readiness brief — the daily "should I train today?" call. It reads the board's deterministic FORM SCORE (0–100, with its hrv / sleep / resting-HR / load breakdown), folds in last night's sleep + this morning's metrics + recent training load + the athlete profile +…

philipyaz/cos · 242 tokens

garmin-pulse

Syncs daily health and fitness data from Garmin Connect into markdown files. Provides sleep, activity, heart rate, stress, body battery, HRV, SpO2, and weight data.

faberlens/hardened-skills · 43 tokens