Logo van Counterfactual Analysis

Counterfactual Analysis

Community
MattArtzAnthro
counterfactual-analysis

Test a hypothetical edit against the loaded Gephi graph without changing the real workspace. Use for what-if questions such as removing hubs, adding ties, deleting ties, or comparing structural resilience.

Overzicht

UitgeverMattArtzAnthro
Repositorygephi-ai
Skillnaamcounterfactual-analysis
Sterren
26
Forks
6
Meegeleverde bestanden
Alleen instructies
LicentieApache-2.0
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door MattArtzAnthro op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Counterfactual Analysis in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/MattArtzAnthro/gephi-ai/tree/main/plugins/gephi-network-analysis/skills/counterfactual-analysis
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/MattArtzAnthro/gephi-ai.git /tmp/gephi-ai
mkdir -p .claude/skills
cp -r /tmp/gephi-ai/plugins/gephi-network-analysis/skills/counterfactual-analysis .claude/skills/counterfactual-analysis
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Counterfactual Analysis in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Counterfactual Analysis automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Counterfactual Analysis niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Counterfactual test

Answer the user's what-if question by running it as a real measurement against the graph currently loaded in Gephi, using gephi_whatif. It duplicates the current workspace, applies the edit to the copy, compares the structural profile before and after, then deletes the copy. The real graph is never touched, so this is safe to run repeatedly.

Follow the gephi skill's rules throughout; this workflow repeats only the ones it is most likely to break. Read ../gephi/references/claim-verification.md for removal tests and their comparison node.

Rules this workflow must keep

  • Asking. When a step says to ask, ask once. If the person cannot answer, is away, or asked for a finished product, use the default named in that step and remove or overwrite nothing. At the end, give one short line for each choice that changed the result, under "Choices I made"; leave the section out when every step used its obvious default. If there is no input to work on, stop and say what is needed.
  • Session start. Start with gephi_health_check. Then check which workspace is open (gephi_list_workspaces) and whether a filter is active (filter_active in replies): a filter from an earlier conversation stays on, and exports and checks then see only what it shows.
  • Ranking. To rank nodes on a metric, call gephi_query_nodes with sort_by set to the metric, columns set to the few columns you need, and limit about 10: nodes are ordered before paging, so the first page is the top of the whole graph. Without columns, every attribute of every node comes back and a long listing can overflow.

Steps

  1. Session start: gephi_health_check. If it fails, tell the user to start Gephi and stop. Call gephi_list_workspaces; if filter_active is true, say the test runs on the visible nodes only.

  2. Get the question. If the request does not specify an edit, ask what edit they want to test (one sentence is enough: "what if we removed the top hub?", "what if these two accounts stopped talking?"). Default: remove the single highest-degree node.

  3. Resolve the edit. Turn the plain-language question into gephi_whatif's edit list ({"op": "remove_node", "id": ...}, remove_nodes, add_edge, remove_edge). If the person names nodes by label rather than id ("the top hub", "Alice"), resolve the id first: gephi_query_nodes with column and value or contains for a name, or with the ranking rule for "top hub" (gephi_compute_degree first if the degree column is missing). If the name matches more than one node, ask which one. Default: the match with the highest degree, named in the report.

  4. Run gephi_whatif with the resolved edits. Only pass include_slow: true (which also compares average path length and diameter) if the graph is roughly under 3,000 nodes, the same cost gate as gephi_profile_graph.

  5. Report the difference, not a verdict. gephi_whatif returns measurements, and the framing matters:

    • Lead with the numbers that changed and by how much (components, giant-component share, density, modularity, isolates, path length if computed).
    • This is a hypothesis test, not a conclusion. Say what the change does and does not support, and note the caution that applies to any single sample: a counterfactual on a small or skewed graph, or a single removed node standing in for a whole category, can mislead.
    • Offer a rival reading where one exists (for example, "components jumped because this specific hub is also a cut vertex, not because hubs in general hold the network together. Should I test a second one to check?").
    • Add "Choices I made" only for choices that changed the result.
  6. Remind them nothing changed. The scratch copy is already deleted and they are back on their real graph. If they want to make the edit for real, point them at the direct tool (gephi_remove_node, gephi_add_edge, and so on), which gephi_snapshot and gephi_undo protect.

Veelgestelde vragen

Wat doet de AI-skill Counterfactual Analysis?

Test a hypothetical edit against the loaded Gephi graph without changing the real workspace. Use for what-if questions such as removing hubs, adding ties, deleting ties, or comparing structural resilience.

Waarom Counterfactual Analysis gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Counterfactual Analysis bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Counterfactual Analysis in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/MattArtzAnthro/gephi-ai/tree/main/plugins/gephi-network-analysis/skills/counterfactual-analysis. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Counterfactual Analysis gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Counterfactual Analysis gebruiken?

Zoveel als je wilt. Je kunt Counterfactual Analysis gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Counterfactual Analysis gratis?

Ja. Deze skill is door MattArtzAnthro op GitHub gepubliceerd onder de licentie Apache-2.0. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇