Causalのロゴ

Causal

組織
ai-analyst-lab
causal

Causal inference toolkit for when experiments are not possible: estimate treatment effects from observational data with assumption checks and mandatory caveats. Invoke as /causal. Trigger on "causal", "caused", "impact of", "effect of", "attribution", "counterfactual", "difference-in-differences", "DiD", "propensity matching", "pre-post". If randomization IS possible, route to /experiment design instead.

概要

公開者ai-analyst-lab
リポジトリai-analyst-plugin
スキル名causal
スター
34
フォーク
13
同梱ファイル
8
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 8個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    ai-analyst-labがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルCausalをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/ai-analyst-lab/ai-analyst-plugin/tree/main/ai-analyst-plus/skills/causal
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ai-analyst-lab/ai-analyst-plugin.git /tmp/ai-analyst-plugin
mkdir -p .claude/skills
cp -r /tmp/ai-analyst-plugin/ai-analyst-plus/skills/causal .claude/skills/causal
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでCausalを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にCausalを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Causalは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

If the skill install path cannot be resolved (some sandboxed environments): read the script file(s) from this skill, write a copy into a scripts/ folder inside the working folder, and run from there. The scripts are self-contained.

Skill: /causal — OpenCausalInf Causal Inference Toolkit

Purpose

Multi-mode skill for causal inference when experiments aren't possible. Helps users estimate treatment effects from observational data with explicit assumption checking, sensitivity analysis, and mandatory caveats. Uses the coded estimator library bundled in this skill at scripts/causal_stats/.

Using the bundled library: add this skill's scripts/ directory to sys.path, then import, e.g.

python
import sys
sys.path.insert(0, "<path to this skill>/scripts")  # the scripts/ dir next to this SKILL.md
from causal_stats import did_basic

Requires pandas, numpy, scipy, statsmodels, and scikit-learn (for propensity matching); install the last two in the sandbox if missing.

When to Use

Invoke as /causal [mode] or trigger on causal inference intents:

  • "Did this feature actually cause the improvement?"
  • "We can't run an experiment, but..."
  • "Was this change responsible for the metric movement?"
  • "Can we measure the impact retroactively?"

Modes

/causal select

Purpose: Walk the method selection decision tree and recommend a causal method. Agent: the causal-method-selector plugin agent Flow:

  1. Ask 4-6 diagnostic questions:
    • Can you randomize? → Route to /experiment design
    • Do you have a comparison group?
    • Do you have pre-treatment data?
    • Are there observable confounders you can measure?
    • How many time periods do you have?
  2. Recommend: Pre-Post, DiD, PSM, Regression Adjustment, or "not feasible"
  3. Output: recommended method + confidence level + rationale Checkpoint: Method confirmation (Type C — user must confirm before analysis)

/causal analyze

Purpose: Run the selected causal method on data. Agent: the causal-analyzer plugin agent Flow:

  1. Read selected method from previous step or user input
  2. Dispatch to the appropriate bundled estimator:
    python
    from causal_stats import (
        pre_post_analysis, did_basic, propensity_match,
        regression_adjust,
    )
    # Method routing:
    # "pre_post" → pre_post_analysis(pre, post, covariates)
    # "did"      → did_basic(df, outcome, treat, post)
    # "psm"      → propensity_match(df, treat, covariates, outcome)
    # "regression" → regression_adjust(df, outcome, treatment, covariates)
  3. Generate charts (treatment effect, balance plots for PSM, event study for DiD)
  4. Output: working/causal_analysis_results.json

/causal check

Purpose: Run assumption checks for the selected method. Agent: the causal-assumption-checker plugin agent Flow:

  1. Identify which assumptions apply to the selected method:
    • DiD: Parallel trends, no anticipation, stable composition
    • PSM: Common support, balance (SMD < 0.1), positivity
    • Pre-Post: No concurrent events, trend stability
    • Regression: All confounders included, correct specification
  2. Run quantitative checks:
    python
    from causal_stats import (
        check_parallel_trends, check_common_support,
        balance_table,
    )
  3. Output: per-assumption PASS / WARNING / FAIL verdicts Checkpoint: Any FAIL (Type C) → present options: adjust method, add caveats, or abort

/causal sensitivity

Purpose: Test how robust the estimate is to unmeasured confounding. Agent: the causal-sensitivity plugin agent Flow:

  1. Run sensitivity analysis based on method:
    python
    from causal_stats import rosenbaum_bounds, e_value
    # PSM: rosenbaum_bounds(treated_outcomes, control_outcomes)
    # All: e_value(risk_ratio, ci_lower)
  2. Translate to plain language: "An unmeasured confounder would need to be X times stronger than anything we measured to explain away this result."
  3. Output: sensitivity report

/causal report

Purpose: Generate a report with mandatory caveats. Agent: the causal-report-generator plugin agent Flow:

  1. Compile: estimate + CI + assumption verdicts + sensitivity results
  2. Place on confidence ladder (RCT > DiD+reg > PSM > DiD > regression > pre-post)
  3. Include mandatory caveat block (method-specific, non-negotiable)
  4. Output: reports/causal_report_{{DATE}}.md

/causal full

Purpose: End-to-end: select → analyze → check → sensitivity → report. Flow: Runs all modes in sequence. All Type C checkpoints fire.

Confidence Ladder

Methods ranked by causal credibility (highest to lowest):

LevelMethodConfidence
1RCT (Randomized Experiment)HIGH
2DiD + Regression AdjustmentMODERATE-HIGH
3PSM (Good Overlap + Balance)MODERATE
4DiD (Parallel Trends OK)MODERATE
5Regression AdjustmentLOW-MODERATE
6Pre-Post (With Trend)LOW
7Pre-Post (Simple)VERY LOW

Mandatory Caveats (Non-Negotiable)

Every causal report MUST include the method-specific caveat. These are architecturally required — the agent cannot produce a report without them.

MethodMandatory Caveat
Pre-Post"Assumes nothing else changed during this period. Any concurrent event could explain this result."
DiD"Assumes the control group would have followed the same trend. Plausible but unprovable."
PSM"Controls for observed confounders only. Unmeasured factors could bias this estimate."
Regression"Assumes all relevant confounders are included and the model is correctly specified."

Helper Function Reference

FunctionModuleUse For
pre_post_analysis()causal_stats.pre_postPre-post comparison
did_basic()causal_stats.did2x2 DiD estimator
parallel_trends_test()causal_stats.didTest parallel trends assumption
event_study()causal_stats.didPeriod-by-period effects
propensity_match()causal_stats.matchingPSM pipeline
balance_table()causal_stats.balanceSMD balance diagnostics
love_plot()causal_stats.balanceBefore/after balance visual
regression_adjust()causal_stats.regressionOLS with covariates
rosenbaum_bounds()causal_stats.sensitivityPSM sensitivity
e_value()causal_stats.sensitivityUniversal sensitivity measure
check_parallel_trends()causal_stats.assumptionsDiD assumption
check_common_support()causal_stats.assumptionsPSM assumption

Cross-Product Handoffs

  • /causal select → "Can you randomize? YES" → suggest /experiment design
  • /experiment power → NOT_VIABLE → suggest /causal select
  • /causal check → All assumptions FAIL → suggest redesign or descriptive-only analysis

State Management

analyses/{slug}/
├── causal_config.yaml       # Method selection + parameters (tracked)
├── working/                  # Intermediates (gitignored)
│   ├── causal_analysis_results.json
│   ├── assumption_report.md
│   └── sensitivity_report.md
└── reports/                  # Final reports (tracked)
    └── causal_report_{{DATE}}.md

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Causal」では何ができますか?

Causal inference toolkit for when experiments are not possible: estimate treatment effects from observational data with assumption checks and mandatory caveats. Invoke as /causal. Trigger on "causal", "caused", "impact of", "effect of", "attribution", "counterfactual", "difference-in-differences", "DiD", "propensity matching", "pre-post". If randomization IS possible, route to /experiment design instead.

TypingMindでCausalを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Causalはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにCausalをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/ai-analyst-lab/ai-analyst-plugin/tree/main/ai-analyst-plus/skills/causalを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Causalを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Causalは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもCausalを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Causal」は無料ですか?

はい。ai-analyst-labがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇