# Novel Knowledge

> 实体搜索、关系查询、标签查询、索引重建。其他 skill 的数据访问层。

- **Type:** Skill
- **Install:** `agentstack add skill-tulancn-vibe-noveling-novel-knowledge`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [TulanCN](https://agentstack.voostack.com/s/tulancn)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [TulanCN](https://github.com/TulanCN)
- **Source:** https://github.com/TulanCN/vibe-noveling/tree/main/plugins/vibe-noveling/skills/novel-knowledge

## Install

```sh
agentstack add skill-tulancn-vibe-noveling-novel-knowledge
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 知识图谱工具

供其他 skill 调用，负责数据访问，不包含高层语义判断。

## 命令

```bash
python {SKILL_DIR}/scripts/knowledge_graph.py  [args]
```

### search — 搜索设定

```bash
python {SKILL_DIR}/scripts/knowledge_graph.py search  [-t type] [-l limit] [-j]
```

### update — 创建实体文件

```bash
python {SKILL_DIR}/scripts/knowledge_graph.py update   [-j]
```

创建空模板文件，不覆盖已有文件。编辑完成后需运行 `rebuild`。

### relations — 查询实体关系

```bash
python {SKILL_DIR}/scripts/knowledge_graph.py relations 
```

返回出向和入向关系。

### tags — 按标签查询

```bash
python {SKILL_DIR}/scripts/knowledge_graph.py tags 
```

### rebuild — 重建知识图谱（核心命令）

```bash
python {SKILL_DIR}/scripts/knowledge_graph.py rebuild
```

扫描 `memory/entities/` 下所有 md 文件的 YAML frontmatter，重新生成 `_graph.json` 和 `_index.json`。

运行时机：创建新实体文件后、编辑实体 frontmatter 后、批量修改后、novel-sync 完成后。

## 实体文件格式

每个实体文件的 YAML frontmatter：

```yaml
---
id: 
name: 
type: 
tags: [标签1, 标签2]
relations:
  - target: 
    relation: 
    description: 
---
```

关系是双向的：A → B 的关系会自动生成 B → A 的入向关系。

## 推荐工作流

1. 直接编辑 `memory/entities//.md`
2. 运行 `rebuild` 同步知识图谱

不要手动编辑 `_graph.json` 或 `_index.json`。

## 依赖

PyYAML（解析嵌套 YAML frontmatter）：`uv pip install pyyaml`

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [TulanCN](https://github.com/TulanCN)
- **Source:** [TulanCN/vibe-noveling](https://github.com/TulanCN/vibe-noveling)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-tulancn-vibe-noveling-novel-knowledge
- Seller: https://agentstack.voostack.com/s/tulancn
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
