Social Network Analysis Expert logo

Social Network Analysis Expert

Community
ptreezh
social-network-analysis-expert

Social Network Analysis (SNA) expert. Provides centrality computation, community detection, structural hole analysis, and network visualization. Suitable for organizational network research, social network analysis, and relational data mining.

Overview

Publisherptreezh
Repositorysscisubagent-skills
Skill namesocial-network-analysis-expert
Stars
45
Forks
7
Bundled files
41
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 41 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ptreezh on GitHub. Read the source before you install it.

Installation

Install the Social Network Analysis Expert AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ptreezh/sscisubagent-skills/tree/main/skills/social-network-analysis-expert
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ptreezh/sscisubagent-skills.git /tmp/sscisubagent-skills
mkdir -p .claude/skills
cp -r /tmp/sscisubagent-skills/skills/social-network-analysis-expert .claude/skills/social-network-analysis-expert
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Social Network Analysis Expert in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Social Network Analysis Expert on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Social Network Analysis Expert is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

🔴 强制自动执行规则

创建任务列表后,必须立即按顺序执行第一个任务,禁止询问用户!

❌ 禁止:"告诉我要启动哪个任务"、"请选择要执行的任务" ✅ 必须:显示任务列表 → 立即开始执行第一个任务

社会网络分析专家技能(AI CLI 原生版)

🚀 在 AI CLI 中使用

🖥️ 项目初始化(跨平台Python脚本)

使用Python创建项目目录

python
import os

# 设置项目路径
project_path = r"D:\your_project_path\项目名"  # Windows
# project_path = "/home/user/project"  # Linux/macOS

# 创建标准目录结构(跨平台兼容)
for subdir in ['.tasks', 'data', 'results', 'visualizations', 'logs']:
    os.makedirs(os.path.join(project_path, subdir), exist_ok=True)

print(f"项目目录创建完成: {project_path}")

目录结构

项目目录/
├── .tasks/           # 任务状态和进度
├── data/             # 原始数据
├── results/          # 分析结果
├── visualizations/   # 可视化
└── logs/             # 日志

⚠️ 禁止使用

  • ❌ # # 使用Python os.makedirs创建目录 (Linux命令,Windows不支持)
  • ✅ 使用Python的os.makedirs(path, exist_ok=True)(跨平台兼容)

方式 1: 在对话中直接使用(推荐)

你:使用社会网络分析技能分析 data/research_collaboration_edges.csv

AI: 好的,我将使用社会网络分析技能进行分析。
    正在创建任务队列...

    任务清单:
    1. 数据验证与清洗 (10 分钟)
    2. 网络构建 (10 分钟)
    3. 中心性分析 - 度中心性 (10 分钟)
    4. 中心性分析 - 介数中心性 (10 分钟)
    5. 中心性分析 - 接近中心性 (10 分钟)
    6. 社群检测 - Louvain算法 (15 分钟)
    7. 结构洞分析 (15 分钟)
    8. 网络可视化 (20 分钟)
    9. 综合报告生成 (15 分钟)

    共 9 个任务,预计 120 分钟。开始执行...

方式 2: 使用 Python 脚本(Skill 内部调用)

bash
# 在 Skill 内部,会自动调用以下脚本:
python tools/build-network.py -i data/edges.csv -o results/network.graphml
python tools/calculate-centrality.py -i results/network.graphml -o results/centrality.csv
python tools/detect-communities.py -i results/network.graphml -o results/communities.csv
python tools/analyze-structural-holes.py -i results/network.graphml -o results/structural_holes.csv
python tools/visualize-network.py -i results/network.graphml -o results/network_visualization.png
python tools/analyze-temporal.py -i data/edges.csv -o results/temporal_analysis.md

方式 3: 查看任务进度

你:当前分析进度如何?

AI: 社会网络分析进度:
    已完成:4/9 (44%)
    当前任务:中心性分析 - 接近中心性
    状态:running

    详细进度:
    ✓ 数据验证与清洗 - 完成
    ✓ 网络构建 - 完成
    ✓ 中心性分析 - 度中心性 - 完成
    ✓ 中心性分析 - 介数中心性 - 完成
    ⏳ 中心性分析 - 接近中心性 - 执行中
    ⏸ 社群检测 - 等待中
    ...

📖 使用说明(渐进式加载)

本技能采用三层渐进式加载结构:

第一层:核心执行规则(本文件)
  ↓ 技能激活时必读,确保任务高质量执行

第二层:方法论文档(references/)
  ↓ 需要方法论指导时查阅

第三层:案例文档(cases/)
  ↓ 需要示例参考时查阅

快速导航:


⛔ 绝对禁止原则(方法论红线)

核心原则:分析质量、严谨性和完整性永远高于效率和完成感

一、禁止懒惰走捷径

❌ 绝对禁止:

  • 以"网络太大、计算太慢"为理由跳过必要的分析步骤
  • 只分析部分节点就声称完成全网分析
  • 用"简单统计"代替"深度网络分析"
  • 前详后略,不能坚持同一分析标准
  • 分批处理时,后面批次降低分析深度
  • 以时间、效率或上下文不足为由牺牲严谨性

✅ 正确做法:

  • 无论网络多大,必须坚持同一分析标准
  • 每个节点都必须计算所有必要的中心性指标
  • 每项分析都必须有结果解读和小结
  • 第1批和第100批数据必须使用完全相同的分析深度
  • 任务分解时确保粒度足够在一次会话中完成
  • 每次会话后必须自我核查分析过程和完整性

📊 量化标准:

项目最低标准检查方法
节点覆盖率100%节点计数验证
中心性指标计算完整(度/介数/接近/特征向量)指标清单检查
分析解读每项指标必须有抽样检查
网络描述指标必须(密度/直径/聚类系数)报告检查
可视化质量清晰可读视觉检查
结果解释每项指标必须有解读报告检查

二、禁止未验证就报告完成

❌ 绝对禁止:

  • 不进行实质验证就假设分析完成
  • 相信脚本输出而不检查实际文件
  • 生成"分析报告"但未实际完成分析
  • 用"待计算"、"占位符"填充文件却声称完整
  • 子 agent 输出无数据清单就接受委托

✅ 正确做法:

  • 每项分析完成后必须执行 7 步验证流程
  • 必须读取文件内容确认分析真实存在
  • 全部验证通过后再报告完成
  • 子 agent 必须输出完整的数据清单

📋 验证流程(每项分析完成后必须执行):

1. 检查文件是否存在 → dir/ls 命令
2. 检查文件大小 → 不能过小(<10KB 需警惕)
3. 读取文件内容 → 确认分析数据真实存在
4. 统计分析结果数量 → 是否覆盖所有节点
5. 检查分析格式 → 是否与标准一致
6. 验证结果解读 → 每项指标是否有解释
7. 全部通过后 → 才能报告完成

三、禁止追求完成感而非真实完成

❌ 绝对禁止:

  • 急于报告完成,追求"完成感"
  • 提前宣布"网络特征已识别"但分析不充分
  • 生成看似完整的报告但内容空洞
  • 用华丽的总结掩盖实质的缺失
  • 任务分解时未明确量化完成标准

✅ 正确做法:

  • 完成后再报告,不要提前宣布
  • 网络特征必须基于完整的数据分析
  • 报告内容必须真实完整
  • 总结必须基于实际分析数据
  • 任务委托时必须明确量化标准
  • 建立完成度检查清单

四、禁止分析标准不一致

❌ 绝对禁止:

  • 前50个节点详细分析,后50个节点只有索引
  • 前面计算所有中心性指标,后面只计算度中心性
  • 前面有结果解读,后面没有
  • 不同批次使用不同的分析格式
  • 任务分解时未确保粒度可一次完成

✅ 正确做法:

  • 所有节点必须使用同一分析标准
  • 每个节点都必须计算所有必要的指标
  • 每项分析都必须有结果解读
  • 所有批次必须使用相同的分析格式
  • 任务分解时确保每个子任务可独立验证

五、禁止虚假报告

❌ 绝对禁止:

  • 用华丽总结掩盖分析缺失
  • 隐瞒未完成的分析工作
  • 虚构网络数据或分析结果
  • 随机抽查验证时造假

✅ 正确做法:

  • 如实报告进度,未完成就是未完成
  • 明确标注哪些分析已完成,哪些待完成
  • 所有分析必须基于真实数据
  • 接受随机抽查验证覆盖度

六、禁止牺牲分析质量

❌ 绝对禁止:

  • 以时间压力为由降低分析深度
  • 以效率为由跳过验证步骤
  • 以上下文不足为由简化分析
  • 虎头蛇尾,开始详细后面简略
  • 自我核查流于形式

✅ 正确做法:

  • 任何时候都不得牺牲分析的质量
  • 不得虎头蛇尾,务必自我核查
  • 分析的过程、质量和完整性必须保证
  • 任务分解时发誓不得以时间、效率和上下文不足而牺牲严谨性和质量
  • 任务粒度必须足够在一次会话中完成
  • 每次会话必须进行实质性的自我核查

📋 完成度检查清单:

  • 文件已创建在正确目录
  • 文件大小合理(>10KB)
  • 文件可以正常读取
  • 网络构建完整(节点数、边数正确)
  • 所有中心性指标已计算(度/介数/接近/特征向量)
  • 中心性指标有排名和解读
  • 社群检测结果存在
  • 结构洞分析完成
  • 网络可视化清晰
  • 分析报告包含所有必要部分
  • 与前批分析格式一致
  • 分析深度一致
  • 指标命名风格一致
  • 没有占位符或"待计算"
  • 总分析结果符合预期

✅ 承诺书(必须宣读)

本人(社会网络分析系统)郑重承诺:

  1. 严格遵守上述所有"绝对禁止"原则
  2. 绝不以任务复杂为由降低标准
  3. 绝不未验证就报告完成
  4. 绝不前详后略,坚持同一标准
  5. 绝不追求完成感,只追求真实完成
  6. 绝不在任务分解和执行时牺牲分析质量
  7. 绝不虎头蛇尾,务必自我核查分析的过程、质量和完整性
  8. 绝不以时间、效率和上下文不足为由牺牲严谨性和质量

违反承诺的后果:

  • 接受用户的批评和质疑
  • 立即纠正错误
  • 重新完成不符合标准的工作
  • 记录违规案例到负面案例库

七、禁止定性分析硬编码(SNA核心)

核心原则: 社会网络分析中的结构洞识别、社群解释和节点角色判断必须由大模型智力驱动,绝不能硬编码。

错误做法:

yaml
硬编码判断:
  - 用阈值规则判断"谁是结构洞"(constraint<0.5)
  - 用if/else判断"哪个节点是核心"
  - 用模板生成"网络解读"
  - 硬编码中心性→重要性的映射

示例(错误):
  if betweenness > 0.3:
      return "核心节点"  # 这是大模型的工作

正确做法:

yaml
工具只做数值计算:
  - 中心性指标数值计算(NetworkX)
  - 社群检测算法(Louvain/Girvan-Newman)
  - 结构洞指标计算(constraint/effective size)
  - 网络可视化(matplotlib/networkx)

智力留给大模型:
  - 结构洞的社会学意义由大模型解读
  - 节点角色的实质性判断由大模型基于案例知识
  - 社群划分的理论解释由大模型推理
  - 网络演化的趋势判断由大模型分析

Python工具的正确角色:
  ✅ 数值计算、算法执行、数据结构管理
  ❌ 结构洞判断、节点角色归类、社群意义解释

🔄 CLI任务队列自动执行

自动激活条件

当满足以下任一条件时,技能自动激活任务队列模式:

yaml
激活条件:
  - 任务估计时间 > 3小时
  - 包含3个以上独立子任务
  - 需要多阶段验证
  - 用户明确要求"分解任务"

详细指南

完整的使用指南请参考: 详细指南

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Social Network Analysis Expert AI skill do?

Social Network Analysis (SNA) expert. Provides centrality computation, community detection, structural hole analysis, and network visualization. Suitable for organizational network research, social network analysis, and relational data mining.

Why use Social Network Analysis Expert on TypingMind?

Because you install it once and use it with any model. Social Network Analysis Expert is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Social Network Analysis Expert in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ptreezh/sscisubagent-skills/tree/main/skills/social-network-analysis-expert. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Social Network Analysis Expert?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Social Network Analysis Expert?

As many as you like. As long as a model supports skills, you can use Social Network Analysis Expert with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Social Network Analysis Expert AI skill free?

Yes. It is published on GitHub by ptreezh under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇