Graphviz.Causal Kg Style
Generate a Graphviz DOT causal knowledge graph per causal inference conventions
от gpsaggese★ 158 звёзд на GitHub
Установить Graphviz.Causal Kg Style в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
You are an expert in causal inference and graphical models
Given a description or an image, produce a Graphviz/DOT graph that follows the rules below exactly. The graph should let a knowledgeable reader:
- Distinguish causation from correlation at a glance
- Identify exogenous vs endogenous variables
- Identify latent vs observable variables
- Recognize interventions and counterfactuals
Use color to distinguish variable types consistently
Generate the DOT File
General Graph Rules
- Use Graphviz DOT syntax
- Use a directed graph (
digraph) - Set
rankdir=LRfor left-to-right causal flow - Encode variable type with both
color(border) andfillcolor+style=filled. Do not rely on color alone; keep the shape conventions too
Node Representation Rules
Variable Type Colors (Required)
Use these colors consistently for node borders/fills:
- Exogenous variable: color=#408AB0, fillcolor=#EAF3F8
- Endogenous variable: color=#62D4A4, fillcolor=#EAF9F3
- Target variable: color=#F8D476, fillcolor=#FFF6DA
- Latent (unobservable) variable: color=#183B4A, fillcolor=#E6EEF1
- Intervened variable (do(X)): color=#DE5470, fillcolor=#FBE6EC
- Counterfactual variable: color=#183B4A, fillcolor=#E6EEF1
Exogenous vs Endogenous vs Target
- Exogenous variable (no causal parents)
shape=ellipsepenwidth=2- Must use the exogenous palette
- Endogenous variable (has at least one causal parent)
shape=box,roundedpenwidth=1(default)- Must use the endogenous palette
- Target variable (no descendants; under study)
shape=boxpenwidth=2- Must use the target palette
Observable vs Unobservable (Latent) Variables
- Observable variable
style=filled,solid- Use the palette of its type (exogenous/endogenous/target/etc.)
fontcolor=black
- Unobservable / latent variable
style="filled,dashed"- Must use the latent palette (
color=gray40,fillcolor=gray90,fontcolor=gray40) - Keep the shape rule for exogenous/endogenous/target if known; otherwise
default to
shape=ellipse
Special Node Types
- Intervened variable (
do(X))shape=doublecircle- Label must be
do(X) style=filled,solid- Must use the intervened palette
- Omit incoming causal edges to
X
- Counterfactual variable
style="filled,dotted"- Must use the counterfactual palette
- Label must include counterfactual context (e.g.,
Y | do(X=1))
Edge Representation Rules
Causation
- Direct causal effect
- Solid arrow (
->) style=soliddir=forward- Default
color=blackunless overridden by effect sign/strength
- Solid arrow (
- Uncertain or hypothesized causation
- Dotted arrow (
style=dotted) - Must include
label="?" - Use
color=gray30
- Dotted arrow (
Correlation / Association (Non-causal)
- Correlation without causal claim
- Dashed edge
- No arrowheads (
dir=none) - Use
constraint=false - Label with a statistical symbol
- Use
color=gray50
Effect Attributes (Optional)
- Positive effect
- Default arrowhead
- Label
"+","++","+++" - Use
color=darkgreen
- Negative effect
- Default arrowhead
- Label
"-","--","---" - Use
color=firebrick3
- Effect strength (by symbols in the label)
- Strong:
+++,--- - Weak:
+,-
- Strong:
Confounding and Common Causes
- Represent confounders explicitly
- Use a latent node with dashed gray styling (latent palette)
- Draw causal arrows from the confounder to each affected variable
- Do not use correlation edges to represent confounding
Layout and Structure
- Use subgraphs (clusters) when helpful
- Structural model vs observational associations
- Different time slices or mechanisms
- Ensure correlation edges do not affect node ranking (
constraint=false)
Save the File
- Save the output in a
<PREFIX>.dotfile<PREFIX>isgraphviz.causal_kg_style.<INPUT_REF>, in the current dir<INPUT_REF>comes from<IMAGE>|<DESCRIPTION>, as in.claude/skills/skill.rules.md### Name the Output File
- Say in the DOT file how it was generated, with this comment at the top:
// Generated by `.claude/skills/graphviz.causal_kg_style/SKILL.md`
Output Requirements
- Output only valid Graphviz/DOT code without triple backticks
- Do not explain the code in natural language
- Follow all visual and semantic conventions above exactly
Render the Graph
- After generating the graph description, render an image with:
> dot -Tpng <PREFIX>.dot -o <PREFIX>.png > open <PREFIX>.png
Read the PNG File
- If an image was specified, read the PNG file
- If the PNG is very different from the input image:
- Find the differences in terms of layout
- Apply changes to
<PREFIX>.dotto approximate the input image
Verification
- The output file is
graphviz.causal_kg_style.<INPUT_REF>.dotin the current dir - Confirm
<PREFIX>.dotis valid Graphviz DOT syntax - C
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Graphviz.Causal Kg Style?
Generate a Graphviz DOT causal knowledge graph per causal inference conventions
Как установить скилл Graphviz.Causal Kg Style?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Graphviz.Causal Kg Style запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…