Agent skill · research science · sundial-org

causal-inference

Add causal reasoning to agent actions. Trigger on ANY high-level action with observable outcomes - emails, messages, calendar changes, file operations, API calls, notifications, reminders, purchases, deployments. Use for planning interventions, debugging failures, predicting outcomes, backfilling historical data for analysis, or answering "what happens if I do X?" Also trigger when reviewing past actions to understand what worked/failed and why.

Why this skill is useful

Adds executable scripts for backfilling historical data and causal modeling that enhance predictive capabilities beyond standard AI knowledge.

What it needs

Requires gog, python3 installed locally. About 4k tokens when loaded. Last updated 2026-03-07. 639 stars on the source repository.

What this skill does

Causal Inference A lightweight causal layer for predicting action outcomes, not by pattern-matching correlations, but by modeling interventions and counterfactuals. Core Invariant Every action must be representable as an explicit intervention on a causal model, with predicted effects + uncertainty + a falsifiable audit trail. Plans must be causally valid, not just plausible. When to Trigger Trigger this skill on ANY high-level action, including but not limited to: Domain Actions to Log -------- --------------- Communication Send email, send message, reply, follow-up, notification, mention Calendar Create/move/cancel meeting, set reminder, RSVP Tasks Create/complete/defer task, set priority, assign Files Create/edit/share document, commit code, deploy Social Post, react, comment, share, DM Purchases Order, subscribe, cancel, refund System Config change, permission grant, integration setup Also trigger when: Reviewing outcomes — "Did that email get a reply?" → log outcome, update estimates Debugging failures — "Why didn't this work?" → trace causal graph Backfilling history — "Analyze my past emails/calendar" → parse logs, reconstruct actions Planning — "Should I send now or later?" → query causal model Backfill: Bootstrap from Historical Data Don't start from zero. Parse existing logs to reconstruct past actions + outcomes. Email Backfill Calendar Backfill Message Backfill (WhatsApp/Discord/Slack) Generic Backfill Pattern Architecture A. Action Log (required) Every executed action emits a structured event: Store in memory/causal/actionlog.jsonl. B. Causal Graphs (per domain) Start with 10-30 observable variables per domain. Email domain: Calendar domain: Messaging domain: Task domain: Store graph definitions in memory/causal/graphs/. C. Estimation For each "knob" (intervention variable), estimate treatment effects: Use simple regression or propensity matching first. Graduate to do-calculus when graphs are explicit and identification is needed. D. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills sundial-org/causal-inference

View the source on GitHub

Browse the @skills marketplace