Logo de Counterfactual Analysis

Counterfactual Analysis

Comunidade
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.

Visão geral

Publicado porMattArtzAnthro
Repositóriogephi-ai
Nome da habilidadecounterfactual-analysis
Estrelas
26
Forks
6
Arquivos incluídos
Somente instruções
LicençaApache-2.0
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Sem arquivos extras

    Tudo de que o modelo precisa está nas instruções — sem arquivos extras para sincronizar.

  • Código aberto

    Publicada por MattArtzAnthro no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Counterfactual Analysis no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/MattArtzAnthro/gephi-ai/tree/main/plugins/gephi-network-analysis/skills/counterfactual-analysis
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

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
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Counterfactual Analysis em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Counterfactual Analysis automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Counterfactual Analysis não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

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.

Perguntas frequentes

O que a habilidade de IA Counterfactual Analysis faz?

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.

Por que usar Counterfactual Analysis no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Counterfactual Analysis é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Counterfactual Analysis no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/MattArtzAnthro/gephi-ai/tree/main/plugins/gephi-network-analysis/skills/counterfactual-analysis. O TypingMind lê o arquivo SKILL.md e instala a habilidade para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Counterfactual Analysis?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Counterfactual Analysis?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Counterfactual Analysis com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Counterfactual Analysis é gratuita?

Sim. A habilidade é publicada no GitHub por MattArtzAnthro sob a licença Apache-2.0. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇