geo-entity-extraction

geo-entity-extraction is a command for coding agents from huifer/claude-code-seo. It costs 28 tokens per session (2,575 once invoked), scanned A, original, MIT.

A command that extracts important entities—such as people, organizations, places, events, and concepts—from content, then maps their relationships.

In plain words
What is it for?
Use it to build Mermaid knowledge graphs and Schema.org JSON-LD for articles, blogs, content clusters, and other written material.
Why use it?
It turns unstructured writing into a clearer map of its main subjects and creates structured data that other software can understand.

Command

Part of the claude-code-seo plugin — 7 skills, 37 commands, 2 agents shipped together

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.

agentmods
npx agentmods add commands/huifer/claude-code-seo/geo-entity-extraction
Clone the repo
git clone --depth 1 https://github.com/huifer/claude-code-seo

Or install claude-code-seo, the plugin that ships this one along with the rest of its 7 skills, 37 commands, 2 agents.

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 geo-entity-extraction

README.md
[![agentmods](https://agentmods.dev/badge/commands/huifer/claude-code-seo/geo-entity-extraction.svg)](https://agentmods.dev/commands/huifer/claude-code-seo/geo-entity-extraction)
Your own site
<a href="https://agentmods.dev/commands/huifer/claude-code-seo/geo-entity-extraction"><img src="https://agentmods.dev/badge/commands/huifer/claude-code-seo/geo-entity-extraction.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,575 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00028 $0.02575
Opus 5 $0.00014 $0.01288
Sonnet 5 $0.00006 $0.00515
Haiku 4.5 $0.00003 $0.00258

Measured 5d ago against content hash b8894fd63775, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

geo-entity-extraction 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 5d ago.

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.

commands/geo-entity-extraction.md · 360 lines

How it starts

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

功能说明

核心功能

实体提取与知识图谱构建从内容中自动识别关键实体(概念、人物、组织、地点、事件),分析实体间关系,生成 Mermaid 格式的知识图谱,并提供完整的 Schema.org JSON-LD 标记。

使用场景

  • 为博客文章生成结构化数据
  • 构建主题权威性和内容集群
  • 优化 AI 对内容的理解
  • 创建可视化的知识图谱

执行流程

步骤 1: 内容读取和预处理

  • 读取文件内容
  • 去除 HTML 标签(如果是网页)
  • 分段和分句

步骤 2: 实体识别

使用 NLP 规则识别:

# 识别专有名词(大写开头)
grep -oE '\b[A-Z][a-z]+\b' content.md

# 识别技术术语
grep -oE '\b[A-Z]{2,}\b' content.md

# 识别数字和统计数据
grep -oE '\b\d+[%]?\b' content.md

# 识别定义语句
grep -E '(是|定义为|是指|refers to|means)' content.md

步骤 3: 实体分类

  • 人物 (Person): 作者、专家、名人
  • 组织 (Organization): 公司、机构
  • 概念 (Concept): 专业术语、方法、技术
  • 地点 (Place): 城市、国家、地区
  • 事件 (Event): 会议、发布、更新

步骤 4: 关系提取

  • is-a (继承): "SEO 是一种营销策略"
  • part-of (组成): "关键词研究是 SEO 的一部分"
  • related-to (相关): "SEO 与内容营销相关"
  • impacts (影响): "技术 SEO 影响网站速度"

步骤 5: 知识图谱构建

生成 Mermaid 格式的知识图谱

步骤 6: Schema.org 生成

根据实体类型生成相应的 JSON-LD

输出示例

# 🧠 实体提取与知识图谱

## 分析内容:blog/post.md

**提取时间:** 2024-01-15
**识别实体:** 15 个
**关系类型:** 6 种

---

## 📊 核心实体识别

### 主要概念(Concept)

#### 1. SEO ⭐
- **类型:** 概念
- **定义:** 搜索引擎优化
- **出现频率:** 42 次
- **相关实体:**
  - 包含 → 技术SEO、内容SEO、外链建设
  - 相关 → 营销策略、数字营销
  - 影响 → 网站排名、有机流量

#### 2. 关键词研究
- **类型:** 概念
- **定义:** 识别和选择目标关键词的过程
- **出现频率:** 18 次
- **相关实体:**
  - 属于 → SEO
  - 使用 → 关键词工具、Google Keyword Planner
  - 目标 → 搜索意图、长尾关键词

#### 3. Backlink
- **类型:** 概念
- **同义词:** 外链、入站链接
- **出现频率:** 15 次
- **相关实体:**
  - 影响 → 域名权威度、搜索排名
  - 来源 → 客座博客、社交媒体、目录

### 组织(Organization)

#### 1. SEMrush
- **类型:** 组织/公司
- **关系:**
  - 提供 → SEO 工具
  - 相关 → Ahrefs、Moz

---

## 🔗 知识图谱

```mermaid
graph TD
    A[SEO] --> B[技术SEO]
    A --> C[内容SEO]
    A --> D[外链建设]

    B --> E[网站速度]
    B --> F[移动友好]
    B --> G[SSL证书]

    C --> H[关键词研究]
    C --> I[内容质量]
    C --> J[用户体验]

    D --> K[客座博客]
    D --> L[社交媒体]
    D --> M[数字PR]

    H --> N[Google Keyword Planner]
    H --> O[SEMrush]
    H --> P[Ahrefs]

    style A fill:#f9f,stroke:#333,stroke-width:4px
    style B fill:#bbf,stroke:#333,stroke-width:2px
    style C fill:#bbf,stroke:#333,stroke-width:2px
    style D fill:#bbf,stroke:#333,stroke-width:2px

实体关系说明

  • 粗线边框 = 核心概念
  • 细线边框 = 子概念
  • 箭头 = 关系方向

📝 Schema.org 标记生成

1. Article Schema(推荐)

{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "SEO 完全指南:从入门到精通",
  "description": "深入理解搜索引擎优化的核心概念和实践方法",
  "author": {
    "@type": "Person",
    "name": "张三",
    "jobTitle": "高级 SEO 专家",
    "credential": "Google 认证 SEO 专家"
  },
  "publisher": {
    "@type": "Organization",
    "name": "Your Company",
    "logo": {
      "@type": "ImageObject",
      "url": "https://yoursite.com/logo.png"
    }
  },
  "datePublished": "2024-01-15",
  "dateModified": "2024-01-15",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://yoursite.com/seo-guide"
  },
  "about": [
    {
      "@type": "Thing",
      "name": "SEO",
      "description": "搜索引擎优化"
    },
    {
      "@type": "Thing",
      "name": "技术SEO",
      "description": "网站技术优化"
    },
    {
      "@type": "Thing",
      "name": "内容SEO",
      "description": "内容优化策略"
    }
  ],
  "keywords": "SEO, 搜索引擎优化, 技术SEO, 内容SEO, 外链建设"
}

2. FAQPage Schema

{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "什么是 SEO?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "SEO(Search Engine Optimization)是..."
      }
    },
    {
      "@type": "Question",
      "name": "SEO 需要多长时间见效?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "通常 3-6 个月可见明显效果..."
      }
    }
  ]
}

3. BreadcrumbList Schema

{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "首页",
      "item": "https://yoursite.com"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "博客",
      "item": "https://yoursite.com/blog"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "SEO 指南",
      "item": "https://yoursite.com/seo-guide"
    }
  ]
}

💡 实体优化建议

1. 核心实体强化

问题: "SEO" 概念定义不够明确

建议:

Read the full file on GitHub · 360 lines

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. 5d ago First seen · 360 lines · 28 tokens per session scan A b8894fd63775

Subscribe to this mod's changes

geo-entity-extraction is a command published in the GitHub repository huifer/claude-code-seo (110 stars, last pushed 8mo ago), licensed MIT. It adds 28 tokens to every session and 2,575 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-08-30.