Microsoft logo

Skill

dot-graph-intelligence

analyze graph structures programmatically

Covers Graph Analysis Code Analysis

Description

Use when you need programmatic graph structure analysis — reachability, cycles, critical paths, and diffs without spending LLM tokens on structural questions code can answer

SKILL.md

DOT Graph Intelligence

Overview

Structural questions about graphs — "is this node reachable?", "are there cycles?", "what changed?" — are code problems, not language model problems. Graph analysis tools answer these in milliseconds with zero ambiguity. Reserve LLM reasoning for interpretation, not computation.

Core principle: Code answers structural questions — that is code's judgment to make. LLMs interpret what the answers mean. Use the right tool for each layer.


When to Use

digraph when_to_use {
    label="When to Use Graph Intelligence"
    labelloc=t
    rankdir=TB
    node [shape=diamond style="rounded,filled" fillcolor="#FFF9C4" fontname="Helvetica"]
    edge [fontname="Helvetica" fontsize=10]

    Q1 [label="Is the question\nstructural?\n(reachability, cycles,\npaths, counts)"]
    Q2 [label="Does it require\nunderstanding\nmeaning or context?"]

    node [shape=box style="rounded,filled"]
    UseCode [label="Use graph analysis\noperations" fillcolor="#C8E6C9"]
    UseLLM  [label="Use LLM reasoning\nwith graph as context" fillcolor="#E8F0FE"]
    UseBoth [label="Run analysis first,\nthen interpret results\nwith LLM" fillcolor="#FFF9C4"]

    Q1 -> UseCode [label="yes — pure structure"]
    Q1 -> Q2      [label="no"]
    Q2 -> UseLLM  [label="yes — meaning only"]
    Q2 -> UseBoth [label="both structure\nand meaning"]
}

Operations Reference

OperationQuestion It AnswersInputOutput
reachabilityCan node A reach node B?source node, target nodeyes/no + path
unreachableWhich nodes are isolated or stranded?graphlist of unreachable nodes
cyclesAre there circular dependencies?graphlist of cycle node sequences
pathsWhat are all paths between two nodes?source, targetlist of paths
critical_pathWhat is the longest path (bottleneck)?graph (DAG)ordered node list + length
subgraph_extractWhat is the subgraph reachable from a node?root nodesubgraph DOT
diffWhat changed between two versions?graph A, graph Badded/removed nodes+edges
statsHow large and dense is this graph?graphnode count, edge count, density

The Analysis Loop

A 7-step process for structured graph investigation:

  1. Define the question — write it as a structural query before running any tool ("are there cycles in the dependency graph?")
  2. Select the operation — match the question to the operations table above
  3. Run the operation — use graph analysis tooling, not manual inspection
  4. Capture raw output — save the result before interpreting it
  5. Interpret with context — bring the result to LLM reasoning with the original diagram and question
  6. Update the diagram — if the analysis reveals a structural issue, fix the diagram to reflect reality
  7. Re-run to verify — confirm the fix resolves the original query

Interpretation Guide

When analysis returns results, apply these patterns:

Cycles detected:

  • In a dependency graph: circular dependency — likely a design problem
  • In a state machine: valid if expected (loop states), invalid if unexpected
  • In a data flow: data is being written back to a source it reads from — check for corruption risk

Unreachable nodes found:

  • Dead code path — the node was never connected or was disconnected during refactoring
  • Orphaned component — a service or module with no callers
  • Forgotten placeholder — an intended node that was never wired up

High density (edges >> nodes):

  • Everything-talks-to-everything pattern — high coupling, hard to isolate for testing
  • Missing abstraction layer — consider introducing a coordinator or message bus

Multiple disconnected components:

  • Expected if diagram covers independent subsystems
  • Unexpected if diagram is supposed to show a single connected system — something is missing

Code vs LLM Decision Matrix

TaskUse CodeUse LLM
Count nodes in a graph
Check if path exists between two nodes
Find all cycles
Determine longest path
List unreachable nodes
Compare two graph versions (diff)
Extract subgraph from root
Calculate graph density
Explain why a cycle is a design problem
Suggest how to break a cycle

© 2026 YourAI.tools. Every skill from an identity-verified publisher.

Independent catalog. Not affiliated with, endorsed by, or sponsored by Anthropic or any listed publisher. All trademarks belong to their respective owners.