Network Analysis

Network Analysis is a skill for Claude Code, Codex from aj-geddes/useful-ai-prompts. It costs 23 tokens per session (2,523 once invoked), scanned A, original, MIT.

A method for studying connected entities, such as people, organisations, papers, or companies, as points linked by relationships. It finds groups, important connectors, and patterns in those connections.

In plain words
What is it for?
Use it to analyse social, organisational, citation, recommendation, supply-chain, or financial-transaction networks and visualise their relationships.
Why use it?
It turns a large set of relationships into a structure you can inspect, helping reveal influential entities, communities, bottlenecks, and possible weaknesses.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to analyse social, organisational, citation, recommendation, supply-chain, or financial-transaction networks and visualise their relationships.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aj-geddes/useful-ai-prompts/network-analysis
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add aj-geddes/useful-ai-prompts --skill network-analysis
Clone the repo
git clone --depth 1 https://github.com/aj-geddes/useful-ai-prompts

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Network Analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/aj-geddes/useful-ai-prompts/network-analysis/github.svg)](https://agentmods.dev/skills/aj-geddes/useful-ai-prompts/network-analysis)
Your own site
<a href="https://agentmods.dev/skills/aj-geddes/useful-ai-prompts/network-analysis"><img src="https://agentmods.dev/badge/skills/aj-geddes/useful-ai-prompts/network-analysis/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Network Analysis

Your own site · 80×15
<a href="https://agentmods.dev/skills/aj-geddes/useful-ai-prompts/network-analysis"><img src="https://agentmods.dev/badge/skills/aj-geddes/useful-ai-prompts/network-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,523 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 18 Mar 2026
  • Snyk pass 4 Mar 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.02523
Opus 5 $0.00012 $0.01262
Sonnet 5 $0.00005 $0.00505
Haiku 4.5 $0.00002 $0.00252

Measured 9d ago against content hash f632e1f323f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

Network Analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/scaffold-analysis.sh, templates/notebook-template.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/network-analysis/SKILL.md · 272 lines

How it starts

The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Network Analysis

Overview

This skill enables analysis of network structures to identify communities, measure centrality, detect influential nodes, and visualize complex relationships in social networks, organizational structures, and interconnected systems.

When to Use

  • Analyzing social networks to identify influential users and community structures
  • Mapping organizational hierarchies and identifying key connectors or bottlenecks
  • Studying citation networks to find impactful research papers and collaboration patterns
  • Building recommendation systems based on network relationships and similarities
  • Analyzing supply chain networks to optimize logistics and identify vulnerabilities
  • Detecting fraud patterns through network analysis of financial transactions

Network Concepts

  • Nodes: Individual entities
  • Edges: Connections/relationships
  • Degree: Number of connections
  • Centrality: Node importance measures
  • Community: Densely connected groups
  • Clustering Coefficient: Local density

Key Metrics

  • Degree Centrality: Number of connections
  • Betweenness Centrality: Control over paths
  • Closeness Centrality: Average distance to others
  • Eigenvector Centrality: Connections to important nodes
  • Modularity: Community structure strength

Implementation with Python

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
from collections import defaultdict, Counter
import seaborn as sns

# Create sample network (social network)
G = nx.Graph()

# Add nodes with attributes
nodes = [
    ('Alice', {'role': 'Manager', 'dept': 'Sales'}),
    ('Bob', {'role': 'Engineer', 'dept': 'Tech'}),
    ('Carol', {'role': 'Designer', 'dept': 'Design'}),
    ('David', {'role': 'Engineer', 'dept': 'Tech'}),
    ('Eve', {'role': 'Analyst', 'dept': 'Sales'}),
    ('Frank', {'role': 'Manager', 'dept': 'HR'}),
    ('Grace', {'role': 'Designer', 'dept': 'Design'}),
    ('Henry', {'role': 'Engineer', 'dept': 'Tech'}),
    ('Iris', {'role': 'Analyst', 'dept': 'Sales'}),
    ('Jack', {'role': 'Manager', 'dept': 'Finance'}),
]

for node, attrs in nodes:
    G.add_node(node, **attrs)

# Add edges (relationships)
edges = [
    ('Alice', 'Bob'), ('Alice', 'Carol'), ('Alice', 'Eve'),
    ('Bob', 'David'), ('Bob', 'Henry'), ('Carol', 'Grace'),
    ('David', 'Henry'), ('Eve', 'Iris'), ('Frank', 'Jack'),
    ('Grace', 'Carol'), ('Alice', 'Frank'), ('Bob', 'Carol'),
    ('Eve', 'Alice'), ('Iris', 'Eve'), ('Jack', 'Frank'),
    ('Henry', 'David'), ('Carol', 'David'),
]

G.add_edges_from(edges)

print("Network Summary:")
print(f"Nodes: {G.number_of_nodes()}")
print(f"Edges: {G.number_of_edges()}")
print(f"Density: {nx.density(G):.2%}")

# 1. Degree Centrality
degree_centrality = nx.degree_centrality(G)
print("\n1. Degree Centrality (Top 5):")
for node, score in sorted(degree_centrality.items(), key=lambda x: x[1], reverse=True)[:5]:
    print(f"  {node}: {score:.3f}")

# 2. Betweenness Centrality (control over network)
betweenness_centrality = nx.betweenness_centrality(G)
print("\n2. Betweenness Centrality (Top 5):")
for node, score in sorted(betweenness_centrality.items(), key=lambda x: x[1], reverse=True)[:5]:
    print(f"  {node}: {score:.3f}")

# 3. Closeness Centrality (average distance to others)
closeness_centrality = nx.closeness_centrality(G)
print("\n3. Closeness Centrality (Top 5):")
for node, score in sorted(closeness_centrality.items(), key=lambda x: x[1], reverse=True)[:5]:
    print(f"  {node}: {score:.3f}")

# 4. Eigenvector Centrality
try:
    eigenvector_centrality = nx.eigenvector_centrality(G, max_iter=100)
    print("\n4. Eigenvector Centrality (Top 5):")
    for node, score in sorted(eigenvector_centrality.items(), key=lambda x: x[1], reverse=True)[:5]:
        print(f"  {node}: {score:.3f}")
except:
    print("\n4. Eigenvector Centrality: Not converged")

# 5. Community Detection (using modularity)
from networkx.algorithms import community

communities = list(community.greedy_modularity_communities(G))
print(f"\n5. Community Detection:")
print(f"Number of communities: {len(communities)}")
for i, comm in enumerate(communities):
    print(f"  Community {i+1}: {list(comm)}")

# 6. Network Statistics
degrees = [G.degree(n) for n in G.nodes()]
print(f"\n6. Network Statistics:")
print(f"Average Degree: {np.mean(degrees):.2f}")
print(f"Max Degree: {max(degrees)}")
print(f"Min Degree: {min(degrees)}")
print(f"Clustering Coefficient: {nx.average_clustering(G):.3f}")
print(f"Number of Triangles: {sum(nx.triangles(G).values()) // 3}")

# Visualization
fig, axes = plt.subplots(2, 2, figsize=(15, 12))

# Network layout
pos = nx.spring_layout(G, k=0.5, iterations=50, seed=42)

# 1. Network Graph (colored by degree)
ax = axes[0, 0]
node_colors = [degree_centrality[node] for node in G.nodes()]
nx.draw_networkx_nodes(G, pos, node_color=node_colors, node_size=1000, cmap='YlOrRd', ax=ax)
nx.draw_networkx_edges(G, pos, alpha=0.5, ax=ax)
nx.draw_networkx_labels(G, pos, font_size=8, ax=ax)
ax.set_title('Network Graph (Colored by Degree Centrality)')
ax.axis('off')

# 2. Network Graph (colored by communities)
ax = axes[0, 1]
color_map = []
colors = plt.cm.Set3(np.linspace(0, 1, len(communities)))
node_to_color = {}
for i, comm in enumerate(communities):
    for node in comm:
        node_to_color[node] = colors[i]
color_map = [node_to_color[node] for node in G.nodes()]

nx.draw_networkx_nodes(G, pos, node_color=color_map, node_size=1000, ax=ax)
nx.draw_networkx_edges(G, pos, alpha=0.5, ax=ax)
nx.draw_networkx_labels(G, pos, font_size=8, ax=ax)
ax.set_title('Network Graph (Colored by Community)')
ax.axis('off')

# 3. Centrality Comparison
ax = axes[1, 0]
centrality_df = pd.DataFrame({
    'Degree': degree_centrality,
    'Betweenness': betweenness_centrality,
    'Closeness': closeness_centrality,
}).head(8)

centrality_df.plot(kind='barh', ax=ax, width=0.8)
ax.set_xlabel('Centrality Score')
ax.set_title('Top 8 Nodes - Centrality Comparison')
ax.legend(loc='lower right')
ax.grid(True, alpha=0.3, axis='x')

# 4. Degree Distribution
ax = axes[1, 1]
degree_sequence = sorted([d for n, d in G.degree()], reverse=True)
degree_count = Counter(degree_sequence)
degrees_unique = sorted(degree_count.keys())
counts = [degree_count[d] for d in degrees_unique]

ax.bar(degrees_unique, counts, color='steelblue', edgecolor='black', alpha=0.7)
ax.set_xlabel('Degree')
ax.set_ylabel('Count')
ax.set_title('Degree Distribution')
ax.grid(True, alpha=0.3, axis='y')

plt.tight_layout()
plt.show()

# 7. Path Analysis
print(f"\n7. Path Analysis:")
try:
    shortest_path = nx.shortest_path_length(G, 'Alice', 'Jack')
    print(f"Shortest path from Alice to Jack: {shortest_path}")
except nx.NetworkXNoPath:
    print("No path exists between nodes")

# 8. Connectivity Analysis
print(f"\n8. Connectivity Analysis:")
print(f"Is connected: {nx.is_connected(G)}")
num_components = nx.number_connected_components(G)
print(f"Number of connected components: {num_components}")

# 9. Similarity Measures
def jaccard_similarity(node1, node2):
    neighbors1 = set(G.neighbors(node1)) | {node1}
    neighbors2 = set(G.neighbors(node2)) | {node2}
    intersection = len(neighbors1 & neighbors2)
    union = len(neighbors1 | neighbors2)
    return intersection / union if union > 0 else 0

print(f"\n9. Node Similarity (Jaccard):")
print(f"Alice & Bob: {jaccard_similarity('Alice', 'Bob'):.3f}")
print(f"Alice & Jack: {jaccard_similarity('Alice', 'Jack'):.3f}")

# 10. Influence Score (Combination of metrics)
influence_score = {}
for node in G.nodes():
    score = (degree_centrality[node] * 0.4 +
             betweenness_centrality[node] * 0.3 +
             closeness_centrality[node] * 0.3)
    influence_score[node] = score

print(f"\n10. Influence Score (Top 5):")
for node, score in sorted(influence_score.items(), key=lambda x: x[1], reverse=True)[:5]:
    print(f"  {node}: {score:.3f}")

# Summary
print("\n" + "="*50)
print("NETWORK ANALYSIS SUMMARY")
print("="*50)
print(f"Most influential: {max(influence_score, key=influence_score.get)}")
print(f"Most connected: {max(degree_centrality, key=degree_centrality.get)}")
print(f"Network bottleneck: {max(betweenness_centrality, key=betweenness_centrality.get)}")
print(f"Closest to all: {max(closeness_centrality, key=closeness_centrality.get)}")
print("="*50)

Read the full file on GitHub · 272 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 272 lines · 23 tokens per session scan A f632e1f323f0

Subscribe to this mod's changes

Network Analysis is a skill published in the GitHub repository aj-geddes/useful-ai-prompts (338 stars, last pushed 6mo ago), licensed MIT. It adds 23 tokens to every session and 2,523 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens