Deeply research a topic and automatically generate a knowledge relationship graph PDF. A one-stop tool from research to visualization.
Description
This Skill receives a research topic provided by the user, automatically conducts deep web research, information collection, knowledge organization, and structural design, and ultimately generates a professional visualized relationship graph PDF. Unlike structure-to-pdf , this Skill focuses onactive research and knowledge mining, rather than passive data conversion.
Core Features
- Automatic Research: Use WebSearch for multiple rounds of deep research
- Intelligent Organization: Automatically extract, classify, and structure information
- Professional Design: Select the best visualization solution based on the characteristics of the topic
- Multiple Outputs: Supports tools such as Graphviz, PlantUML, Mermaid, etc.
- High-quality PDF: Generates vector graphics that can be scaled infinitely
Trigger Conditions
When the user wants to:
- Research the knowledge structure of a complex topic (such as "Dream of the Red Chamber character relationships")
- Generate character relationship diagrams, concept maps, knowledge graphs
- Understand the organizational structure or technical architecture of a certain field
- Visualize complex relationship networks
- Need to research and visualize a topic from scratch
Keywords:
- "research... and make a diagram"
- "study the relationships of..."
- "deeply analyze... and visualize"
- "generate... knowledge graph"
- "draw... relationship diagram" (no existing data)
Workflow
1. Task Planning (TodoWrite)
- 深度调研主题和相关知识
- 设计图谱结构和层次
- 创建可视化图表
- 生成PDF文档
2. Deep Research Stage
- Multiple Rounds of WebSearch: Collect information from different angles
- Topic overview and background
- Core elements and people/concepts
- Relationships and connections
- Hierarchies and classifications
- Information Source Recording: Save all reference links
- Knowledge Extraction: Identify key entities and relationships
3. Structural Design Stage
Select the best structure based on the topic type:
Character Relationship Diagram:
- Family lineage: multi-level tree structure
- Social network: network relationship diagram
- Organizational structure: hierarchical layout
Concept Map:
- Knowledge classification: tree diagram or mind map
- Concept relationships: directed graph
- Flowchart: linear or branching process
Technical Architecture:
- System components: modular layout
- Dependencies: hierarchical or network diagram
- Data flow: flowchart
4. Visualization Implementation
Prefer to use Graphviz (DOT language):
digraph G {
// 全局样式
graph [rankdir=TB bgcolor="#fdfdf5" fontname="Arial Unicode MS"]
node [shape=box style="rounded,filled" fillcolor="#e8f4f8"]
edge [fontname="Arial Unicode MS"]
// 使用 subgraph cluster 分组
subgraph cluster_group1 {
label="分组名称"
node1 [label="节点1"]
node2 [label="节点2"]
}
// 定义关系
node1 -> node2 [label="关系类型" color=red]
}
Alternative Tools:
- PlantUML: UML diagrams, sequence diagrams
- Mermaid: simple flowcharts, sequence diagrams
5. PDF Generation
dot -Tpdf diagram.dot -o output.pdf
6. Document Organization
Optionally generate documentation, including:
- Research topic overview
- Graph Legend
- Sources
- Usage Instructions
Design Principles
Visual Design
- Color Coding: Use different colors to distinguish categories
- Shape Distinction: Use different shapes for different types of entities
- Clear Hierarchy: Use subgraph cluster for grouping
- Relationship Annotation: Edge colors, styles, and labels express relationship types
- Chinese Support: Use "Arial Unicode MS" or a system Chinese font
Information Hierarchy
- Title Level: Main title
- Group Level: Main categories/families
- Entity Level: Specific people/concepts
- Relationship Level: Connections and annotations
- Legend Level: Explain the meaning of symbols
Layout Strategy
- rankdir=TB: Top-down (family trees, organizational charts)
- rankdir=LR: Left-to-right (flowcharts, timelines)
- rankdir=BT: Bottom-up (dependency graphs)
- splines=ortho: Orthogonal edges (clear organizational charts)
- splines=curved: Curved edges (aesthetically pleasing relationship networks)
Output Files
Default save location:~/Downloads/ or a user-specified directory
Generated files:
<topic>_relations.dot- Graphviz source file<topic>_relations.pdf- Final PDF graph<topic>_sources.md- Reference materials (optional)
Usage Examples
Example 1: Character Relationships in a Literary Work
用户:深度调查《三国演义》里人物之间的关系,然后做个结构图 PDF
Skill Execution:
- Research the main characters, factions, and relationships in Romance of the Three Kingdoms
- Design: The three major factions of Wei, Shu, and Wu + character hierarchy + alliance/conflict relationships
- Use Graphviz to create a multi-level relationship graph
- Generate PDF
Example 2: Technical Concept Graph
用户:研究 Kubernetes 架构并生成可视化图谱
Skill Execution:
- Research K8s core components and architecture layers
- Design: Control plane/data plane/plugin ecosystem
- Generate technical architecture diagram
- Output PDF
Example 3: Historical Event Relationships
用户:分析二战主要国家和联盟关系,做成图表
Skill Execution:
- Research participating countries, factions, and key time points
- Design: Axis powers/Allied powers/neutral countries relationship network
- Generate a relationship graph with a timeline
- Output PDF
Differences from structure-to-pdf
| Feature | research-to-diagram | structure-to-pdf |
|---|---|---|
| Input | Topic/research question only | Ready-made structured data |
| Research | ✅ Automatic in-depth research | ❌ No research needed |
| Knowledge Organization | ✅ Automatic extraction and structuring | ❌ Directly use user data |
| Use Cases | Knowledge exploration, research visualization | Fast data conversion |
| Time | Longer (requires research) | Fast |
When to Use This Skill:
- ✅ There is no ready-made data and you need to research from scratch
- ✅ You want an in-depth understanding of the knowledge structure of a certain topic
- ✅ You need visualization supported by authoritative sources
When to use structure-to-pdf:
- ✅ Already have structured data
- ✅ Need quick conversion to diagrams
- ✅ Data format is simple and clear
Dependencies
Required:
- Graphviz:
brew install graphviz(macOS) - WebSearch: Built into Claude Code
Optional:
- PlantUML:
brew install plantuml - Mermaid CLI:
npm install -g @mermaid-js/mermaid-cli
Configuration Options
Users can customize via parameters:
--tool: Specify visualization tool (graphviz/plantuml/mermaid)--layout: Specify layout direction (TB/LR/BT/RL)--output: Specify output directory--depth: Research depth (quick/medium/deep)--sources: Whether to generate a reference document
Best Practices
- Define the topic scope clearly: The more specific the topic, the clearer the diagram
- Group reasonably: Use cluster to group related entities
- Control complexity: A single diagram should not exceed 50 nodes
- Refine progressively: Generate an overview diagram first, then go into details
- Consistent colors: Use the same color scheme for entities of the same type
- Cite sources: Cite references at the bottom of the PDF or in a separate document
Common Diagram Type Templates
Character Relationship Diagram Template
- 家族/组织用 cluster 分组
- 人物用 box/ellipse,重要人物用特殊形状
- 血缘关系用实线,婚姻用红色,其他用虚线
- 添加图例说明符号含义
Concept Map Template
- 顶层概念在上方
- 子概念逐层展开
- is-a 关系用实线,has-a 用虚线
- 使用颜色区分不同类别
Technical Architecture Diagram Template
- 分层架构用 rankdir=TB
- 组件用矩形,服务用圆角矩形
- 依赖关系用箭头
- 关键路径用粗线或特殊颜色
Troubleshooting
Garbled Chinese characters:
graph [fontname="Arial Unicode MS"]
node [fontname="Arial Unicode MS"]
edge [fontname="Arial Unicode MS"]
Diagram is too complex:
- Use
concentrate=trueto merge identical edges - Split into multiple subgraphs
- Use different rankdir
Layout is not ideal:
- Adjust
ranksepandnodesep - Use
rank=sameto force nodes onto the same rank - Try different
splinessettings
Version History
- v1.0 (2026-01-02): Initial version
- Based on the summary of the "Dream of the Red Chamber" character relationship diagram project
- Supports automatic generation with Graphviz
- Integrates WebSearch in-depth research
- TodoWrite task management