research-to-diagram
Original:🇨🇳 Chinese
Translated
1 scripts
Conduct in-depth research on topics and automatically generate knowledge relationship graph PDFs. After receiving a research topic, it automatically performs web research, information collection, knowledge organization, and finally generates a professional visualized relationship graph. Suitable for scenarios such as "research...and diagram", "in-depth analysis...and visualization", "generate knowledge graph", etc.
3installs
Added on
NPX Install
npx skill4agent add wshuyi/research-to-diagram research-to-diagramTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Research to Diagram
Conduct in-depth research on topics and automatically generate knowledge relationship graph PDFs. A one-stop tool from research to visualization.
Description
This Skill receives research topics provided by users, automatically performs in-depth web research, information collection, knowledge organization, structure design, and finally generates professional visualized relationship graph PDFs. Different from , this Skill focuses on active research and knowledge mining rather than passive data conversion.
structure-to-pdfCore Features
- Automated Research: Conduct multi-round in-depth research using WebSearch
- Intelligent Organization: Automatically extract, classify, and structure information
- Professional Design: Select the optimal visualization scheme based on topic characteristics
- Multiple Outputs: Support tools like Graphviz, PlantUML, Mermaid
- High-Quality PDF: Generate vector graphics that can be infinitely scaled
Trigger Conditions
When users want to:
- Research the knowledge structure of a complex topic (e.g., "A Dream of Red Mansions 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 diagram"
- "Study the relationships of..."
- "In-depth analysis...and visualization"
- "Generate...knowledge graph"
- "Draw...relationship diagram" (no existing data)
Workflow
1. Task Planning (TodoWrite)
- Conduct in-depth research on the topic and related knowledge
- Design the graph structure and hierarchy
- Create visual diagrams
- Generate PDF documents2. In-Depth Research Phase
- Multi-round WebSearch: Collect information from different perspectives
- Topic overview and background
- Core elements and characters/concepts
- Relationships and connections
- Hierarchies and classifications
- Information Source Recording: Save links to all reference materials
- Knowledge Extraction: Identify key entities and relationships
3. Structure Design Phase
Select the optimal structure based on topic type:
Character Relationship Diagrams:
- Family pedigree: Multi-level tree structure
- Social network: Network relationship diagram
- Organizational structure: Hierarchical layout
Concept Maps:
- Knowledge classification: Tree or mind map
- Concept relationships: Directed graph
- Flowchart: Linear or branching process
Technical Architecture:
- System components: Modular layout
- Dependency relationships: Hierarchical or network diagram
- Data flow: Flowchart
4. Visualization Implementation
Priority use of Graphviz (DOT language):
dot
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
bash
dot -Tpdf diagram.dot -o output.pdf6. Document Organization
Optionally generate explanatory documents including:
- Research topic overview
- Graph explanation
- Reference sources (Sources)
- Usage instructions
Design Principles
Visual Design
- Color Coding: Use different colors to distinguish categories
- Shape Differentiation: Use different shapes for different types of entities
- Clear Hierarchy: Use subgraph cluster for grouping
- Relationship Annotation: Use edge color, style, and labels to express relationship types
- Chinese Support: Use "Arial Unicode MS" or system Chinese fonts
Information Hierarchy
- Title Layer: Main title
- Grouping Layer: Main categories/families
- Entity Layer: Specific characters/concepts
- Relationship Layer: Connections and annotations
- Legend Layer: Explain symbol meanings
Layout Strategies
- rankdir=TB: Top to bottom (family trees, organizational structures)
- rankdir=LR: Left to right (flowcharts, timelines)
- rankdir=BT: Bottom to top (dependency diagrams)
- splines=ortho: Orthogonal edges (clear organizational diagrams)
- splines=curved: Curved edges (aesthetic relationship networks)
Output Files
Default save location: or user-specified directory
~/Downloads/Generated files:
- - Graphviz source file
<topic>_relations.dot - - Final PDF graph
<topic>_relations.pdf - - Reference materials (optional)
<topic>_sources.md
Usage Examples
Example 1: Literary Work Character Relationships
User: Conduct in-depth research on the relationships between characters in "Romance of the Three Kingdoms" and create a structure diagram PDFSkill Execution:
- Research main characters, camps, and relationships in the Three Kingdoms period
- Design: Three major camps (Wei, Shu, Wu) + character hierarchy + alliance/opposition relationships
- Create a multi-level relationship diagram using Graphviz
- Generate PDF
Example 2: Technical Concept Map
User: Research Kubernetes architecture and generate a visualized graphSkill Execution:
- Research K8s core components and architecture hierarchy
- Design: Control plane/data plane/plugin ecosystem
- Generate technical architecture diagram
- Output PDF
Example 3: Historical Event Relationships
User: Analyze the relationships between major countries and alliances in World War II and create a chartSkill Execution:
- Research participating countries, camps, and key time nodes
- Design: Axis powers/Allied powers/neutral countries relationship network
- Generate a relationship diagram with timeline
- Output PDF
Differences from structure-to-pdf
| Feature | research-to-diagram | structure-to-pdf |
|---|---|---|
| Input | Only topic/research question | Existing structured data |
| Research | ✅ Automated in-depth research | ❌ No research needed |
| Knowledge Organization | ✅ Automatic extraction and structuring | ❌ Directly use user data |
| Application Scenarios | Knowledge exploration, research visualization | Quick data conversion |
| Time | Longer (requires research) | Fast |
When to Use This Skill:
- ✅ No existing data, need to research from scratch
- ✅ Want to deeply understand the knowledge structure of a topic
- ✅ Need visualization supported by authoritative sources
When to Use structure-to-pdf:
- ✅ Have existing structured data
- ✅ Need quick conversion to charts
- ✅ Data format is simple and clear
Dependent Tools
Required:
- Graphviz: (macOS)
brew install graphviz - 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:
- : Specify visualization tool (graphviz/plantuml/mermaid)
--tool - : Specify layout direction (TB/LR/BT/RL)
--layout - : Specify output directory
--output - : Research depth (quick/medium/deep)
--depth - : Whether to generate reference materials document
--sources
Best Practices
- Clear Topic Scope: The more specific the topic, the clearer the graph
- Reasonable Grouping: Use clusters to group related entities
- Control Complexity: No more than 50 nodes in a single graph
- Progressive Refinement: Generate an overview first, then dive into details
- Consistent Colors: Use the same color scheme for similar entities
- Cite Sources: Label reference materials at the bottom of the PDF or in a separate document
Common Graph Type Templates
Character Relationship Diagram Template
dot
- Use cluster for family/organization grouping
- Use box/ellipse for characters, special shapes for important characters
- Use solid lines for blood relationships, red lines for marriage, dashed lines for others
- Add legends to explain symbol meaningsConcept Map Template
dot
- Top-level concepts at the top
- Sub-concepts expanded layer by layer
- Use solid lines for is-a relationships, dashed lines for has-a relationships
- Use colors to distinguish different categoriesTechnical Architecture Diagram Template
dot
- Use rankdir=TB for layered architecture
- Use rectangles for components, rounded rectangles for services
- Use arrows for dependency relationships
- Use thick lines or special colors for critical pathsTroubleshooting
Chinese Display Garbled Characters:
dot
graph [fontname="Arial Unicode MS"]
node [fontname="Arial Unicode MS"]
edge [fontname="Arial Unicode MS"]Overly Complex Graph:
- Use to merge identical edges
concentrate=true - Split into multiple subgraphs
- Use different rankdir settings
Ideal Layout Not Achieved:
- Adjust and
ranksepnodesep - Use to force nodes to be on the same layer
rank=same - Try different settings
splines
Version History
- v1.0 (2026-01-02): Initial version
- Summarized based on the "A Dream of Red Mansions" character relationship graph project
- Support automatic generation with Graphviz
- Integrated WebSearch for in-depth research
- TodoWrite for task management