AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Process Causal Inference Dags

skill-jskherman-engg-skills-process-causal-inference-dags · by jskherman

>-

No reviews yet
0 installs
0 views
view→install

Install

$ agentstack add skill-jskherman-engg-skills-process-causal-inference-dags

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-jskherman-engg-skills-process-causal-inference-dags)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Process Causal Inference Dags? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Process Causal Inference (DAG-Based Adjustment)

Overview

For observational process data, the right adjustment set determines whether a regression coefficient is a confounded estimate, a partial mediated estimate, or the total effect. This skill provides DAG tooling:

  • Build a DAG from an edge list (YAML or CLI).
  • Test d-separation between sets given conditioning.
  • Enumerate parents of the treatment as a candidate back-door adjustment

set; verify the criterion.

  • Export DOT source for the user to render with Graphviz.

The implementation is pure-Python (no NetworkX dependency). For larger problems, swap in networkx/pgmpy.

Scope is deliberately narrow per design review:

  • It DOES NOT estimate causal effects. Pair it with engineering-statistics,

censored-regression, distributed-lag-models, or bayesian-hierarchical-process-models for that.

  • It DOES NOT do front-door or instrument-variable analysis. Extend as

needed.

Prerequisites

  1. uv available.
  2. On first use, the script writes LICENSE_NOTIFICATION.txt.

When to Use

  • Designing an observational study and you need a defensible adjustment

set.

  • Resolving confounding-vs-mediation disagreements in plant data.
  • Drawing a DAG for an internal report or for HAZOP-style review of an

empirical claim.

Don't use for

  • Estimating effect sizes (see other skills).
  • Bayesian network learning from data (use pgmpy).
  • Counterfactual analysis (no potential-outcomes implementation here).

Utility Scripts

  • uv run scripts/dag.py check --edges "A,B;A,C;B,D;C,D" --treatment B --outcome D --output /tmp/check.json
  • uv run scripts/dag.py dsep --edges "A,B;A,C;B,D;C,D" --x B --y C --z A --output /tmp/dsep.json
  • uv run scripts/dag.py dot --edges "A,B;A,C;B,D;C,D" --output /tmp/g.dot

Procedure

  1. List variables (predictors, candidate confounders, mediators, colliders,

regime indicators, lab outcomes).

  1. Classify each variable (confounder vs mediator vs collider vs regime).
  2. Draw the DAG (one edge per causal direction; no cycles).
  3. Identify the treatment and the outcome.
  4. Get the parent set of the treatment; verify it satisfies the back-door

criterion via check.

  1. Use d-separation tests for alternative paths.
  2. Export DOT and render externally for review.

Pitfalls

  • Adjusting for mediators when estimating a total effect; this introduces

bias.

  • Adjusting for colliders (variables caused by both treatment and outcome);

this opens a spurious path.

  • Drawing an unsigned graph and assuming the direction is obvious;

always be explicit.

  • Equating "correlation with the outcome" with "is a confounder"; a

mediator is correlated too but should not be adjusted for total effect.

  • Forgetting the regime / selection indicator; if operators routinely

intervene in response to the outcome, that intervention may be a collider conditional on the response.

  • Reporting "no confounding" because a regression coefficient barely moves

with adjustment. The right test is graphical, not numerical.

  • Treating descendants of the treatment as legitimate adjustment variables.

Fallback Strategies

  • If the DAG has many nodes (> ~30), switch to networkx + pgmpy for

efficient enumeration of separation sets.

Verification

  • Run the listed script with representative inputs and an --output file when a deterministic calculation is available.
  • Confirm the JSON result contains ok: true, expected units, and no unhandled warnings.
  • Check result magnitudes against the stated assumptions, references, and a hand calculation or known operating range before reporting them.

References

  • references/dag_glossary.md — confounders, mediators, colliders,

back-door criterion.

  • Pearl, Causality (2nd ed).
  • Hernán & Robins, Causal Inference: What If.

Anti-Patterns

  • Drawing a DAG only after seeing the regression results.
  • Adjusting "for everything"; that controls for mediators and colliders.
  • Claiming causal effect from a coefficient without naming the DAG used.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.