patent-diagram-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Patent Diagram Generator Skill

专利图表生成器Skill

Create patent-style technical diagrams including flowcharts, block diagrams, and system architectures using Graphviz.
使用Graphviz创建专利风格的技术图表,包括流程图、框图和系统架构图。

When to Use

适用场景

Invoke this skill when users ask to:
  • Create flowcharts for method claims
  • Generate block diagrams for system claims
  • Draw system architecture diagrams
  • Create technical illustrations for patents
  • Add reference numbers to diagrams
  • Generate patent figures
当用户提出以下需求时调用该Skill:
  • 创建方法权利要求的流程图
  • 生成系统权利要求的框图
  • 绘制系统架构图
  • 创建专利用技术插图
  • 为图表添加引用编号
  • 生成专利附图

What This Skill Does

该Skill的功能

  1. Flowchart Generation:
    • Method step flowcharts
    • Decision trees
    • Process flows with branches
    • Patent-style step numbering
  2. Block Diagram Creation:
    • System component diagrams
    • Hardware architecture diagrams
    • Software module diagrams
    • Component interconnections
  3. Custom Diagram Rendering:
    • Render Graphviz DOT code
    • Support multiple formats (SVG, PNG, PDF)
    • Multiple layout engines (dot, neato, fdp, circo, twopi)
  4. Patent-Style Formatting:
    • Add reference numbers (10, 20, 30, etc.)
    • Use clear labels and connections
    • Professional formatting for USPTO filing
  1. 流程图生成:
    • 方法步骤流程图
    • 决策树
    • 带分支的流程
    • 专利风格的步骤编号
  2. 框图创建:
    • 系统组件图
    • 硬件架构图
    • 软件模块图
    • 组件互连关系
  3. 自定义图表渲染:
    • 渲染Graphviz DOT代码
    • 支持多种格式(SVG、PNG、PDF)
    • 多种布局引擎(dot、neato、fdp、circo、twopi)
  4. 专利风格格式化:
    • 添加引用编号(10、20、30等)
    • 使用清晰的标签和连接
    • 符合USPTO提交要求的专业格式

Required Dependencies

依赖要求

This skill requires Graphviz to be installed:
Windows:
bash
choco install graphviz
Linux:
bash
sudo apt install graphviz
Mac:
bash
brew install graphviz
Python Package:
bash
pip install graphviz
使用该Skill需要安装Graphviz:
Windows:
bash
choco install graphviz
Linux:
bash
sudo apt install graphviz
Mac:
bash
brew install graphviz
Python包:
bash
pip install graphviz

How to Use

使用方法

When this skill is invoked:
  1. Load diagram generator:
    python
    import sys
    sys.path.insert(0, os.path.join(os.environ.get('CLAUDE_PLUGIN_ROOT', '.'), 'python'))
    from python.diagram_generator import PatentDiagramGenerator
    
    generator = PatentDiagramGenerator()
  2. Create flowchart from steps:
    python
    steps = [
        {"id": "start", "label": "Start", "shape": "ellipse", "next": ["step1"]},
        {"id": "step1", "label": "Initialize System", "shape": "box", "next": ["decision"]},
        {"id": "decision", "label": "Is Valid?", "shape": "diamond", "next": ["step2", "error"]},
        {"id": "step2", "label": "Process Data", "shape": "box", "next": ["end"]},
        {"id": "error", "label": "Handle Error", "shape": "box", "next": ["end"]},
        {"id": "end", "label": "End", "shape": "ellipse", "next": []}
    ]
    
    diagram_path = generator.create_flowchart(
        steps=steps,
        filename="method_flowchart",
        output_format="svg"
    )
  3. Create block diagram:
    python
    blocks = [
        {"id": "input", "label": "Input\\nSensor", "type": "input"},
        {"id": "cpu", "label": "Central\\nProcessor", "type": "process"},
        {"id": "memory", "label": "Memory\\nStorage", "type": "storage"},
        {"id": "output", "label": "Output\\nDisplay", "type": "output"}
    ]
    
    connections = [
        ["input", "cpu", "raw data"],
        ["cpu", "memory", "store"],
        ["memory", "cpu", "retrieve"],
        ["cpu", "output", "processed data"]
    ]
    
    diagram_path = generator.create_block_diagram(
        blocks=blocks,
        connections=connections,
        filename="system_diagram",
        output_format="svg"
    )
  4. Render custom DOT code:
    python
    dot_code = """
    digraph PatentSystem {
        rankdir=LR;
        node [shape=box, style=rounded];
    
        Input [label="User Input\\n(10)"];
        Processor [label="Processing Unit\\n(20)"];
        Output [label="Display\\n(30)"];
    
        Input -> Processor [label="data"];
        Processor -> Output [label="result"];
    }
    """
    
    diagram_path = generator.render_dot_diagram(
        dot_code=dot_code,
        filename="custom_diagram",
        output_format="svg",
        engine="dot"
    )
  5. Add reference numbers:
    python
    # After creating a diagram, add patent-style reference numbers
    reference_map = {
        "Input Sensor": 10,
        "Central Processor": 20,
        "Memory Storage": 30,
        "Output Display": 40
    }
    
    annotated_path = generator.add_reference_numbers(
        svg_path=diagram_path,
        reference_map=reference_map
    )
调用该Skill时:
  1. 加载图表生成器:
    python
    import sys
    sys.path.insert(0, os.path.join(os.environ.get('CLAUDE_PLUGIN_ROOT', '.'), 'python'))
    from python.diagram_generator import PatentDiagramGenerator
    
    generator = PatentDiagramGenerator()
  2. 通过步骤创建流程图:
    python
    steps = [
        {"id": "start", "label": "Start", "shape": "ellipse", "next": ["step1"]},
        {"id": "step1", "label": "Initialize System", "shape": "box", "next": ["decision"]},
        {"id": "decision", "label": "Is Valid?", "shape": "diamond", "next": ["step2", "error"]},
        {"id": "step2", "label": "Process Data", "shape": "box", "next": ["end"]},
        {"id": "error", "label": "Handle Error", "shape": "box", "next": ["end"]},
        {"id": "end", "label": "End", "shape": "ellipse", "next": []}
    ]
    
    diagram_path = generator.create_flowchart(
        steps=steps,
        filename="method_flowchart",
        output_format="svg"
    )
  3. 创建框图:
    python
    blocks = [
        {"id": "input", "label": "Input\\nSensor", "type": "input"},
        {"id": "cpu", "label": "Central\\nProcessor", "type": "process"},
        {"id": "memory", "label": "Memory\\nStorage", "type": "storage"},
        {"id": "output", "label": "Output\\nDisplay", "type": "output"}
    ]
    
    connections = [
        ["input", "cpu", "raw data"],
        ["cpu", "memory", "store"],
        ["memory", "cpu", "retrieve"],
        ["cpu", "output", "processed data"]
    ]
    
    diagram_path = generator.create_block_diagram(
        blocks=blocks,
        connections=connections,
        filename="system_diagram",
        output_format="svg"
    )
  4. 渲染自定义DOT代码:
    python
    dot_code = """
    digraph PatentSystem {
        rankdir=LR;
        node [shape=box, style=rounded];
    
        Input [label="User Input\\n(10)"];
        Processor [label="Processing Unit\\n(20)"];
        Output [label="Display\\n(30)"];
    
        Input -> Processor [label="data"];
        Processor -> Output [label="result"];
    }
    """
    
    diagram_path = generator.render_dot_diagram(
        dot_code=dot_code,
        filename="custom_diagram",
        output_format="svg",
        engine="dot"
    )
  5. 添加引用编号:
    python
    # 创建图表后,添加专利风格的引用编号
    reference_map = {
        "Input Sensor": 10,
        "Central Processor": 20,
        "Memory Storage": 30,
        "Output Display": 40
    }
    
    annotated_path = generator.add_reference_numbers(
        svg_path=diagram_path,
        reference_map=reference_map
    )

Diagram Templates

图表模板

Get common templates:
python
templates = generator.get_diagram_templates()
获取常用模板:
python
templates = generator.get_diagram_templates()

Available templates:

可用模板:

- simple_flowchart: Basic process flow

- simple_flowchart: 基础流程

- system_block: System architecture

- system_block: 系统架构

- method_steps: Sequential method

- method_steps: 顺序方法

- component_hierarchy: Hierarchical structure

- component_hierarchy: 层级结构

undefined
undefined

Shape Types

形状类型

Flowchart Shapes

流程图形状

  • ellipse
    : Start/End points
  • box
    : Process steps
  • diamond
    : Decision points
  • parallelogram
    : Input/Output operations
  • cylinder
    : Database/Storage
  • ellipse
    : 开始/结束点
  • box
    : 流程步骤
  • diamond
    : 决策点
  • parallelogram
    : 输入/输出操作
  • cylinder
    : 数据库/存储

Block Diagram Types

框图类型

  • input
    : Input devices/sensors
  • output
    : Output devices/displays
  • process
    : Processing units
  • storage
    : Memory/storage
  • decision
    : Control logic
  • default
    : General components
  • input
    : 输入设备/传感器
  • output
    : 输出设备/显示器
  • process
    : 处理单元
  • storage
    : 内存/存储
  • decision
    : 控制逻辑
  • default
    : 通用组件

Layout Engines

布局引擎

  • dot
    : Hierarchical (top-down/left-right)
  • neato
    : Spring model layout
  • fdp
    : Force-directed layout
  • circo
    : Circular layout
  • twopi
    : Radial layout
  • dot
    : 层级布局(自上而下/自左至右)
  • neato
    : 弹簧模型布局
  • fdp
    : 力导向布局
  • circo
    : 环形布局
  • twopi
    : 放射状布局

Output Formats

输出格式

  • svg
    : Scalable Vector Graphics (best for editing)
  • png
    : Raster image (good for viewing)
  • pdf
    : Portable Document Format (USPTO compatible)
  • svg
    : 可缩放矢量图形(最适合编辑)
  • png
    : 光栅图像(适合查看)
  • pdf
    : 便携文档格式(符合USPTO要求)

Patent-Style Reference Numbers

专利风格引用编号

Convention:
  • Main components: 10, 20, 30, 40, ...
  • Sub-components: 12, 14, 16 (under 10)
  • Elements: 22, 24, 26 (under 20)
Example labeling:
"Input Sensor (10)"
"  - Detector Element (12)"
"  - Signal Processor (14)"
"Central Unit (20)"
"  - CPU Core (22)"
"  - Cache (24)"
惯例:
  • 主要组件:10、20、30、40...
  • 子组件:12、14、16(属于10)
  • 元素:22、24、26(属于20)
示例标注:
"Input Sensor (10)"
"  - Detector Element (12)"
"  - Signal Processor (14)"
"Central Unit (20)"
"  - CPU Core (22)"
"  - Cache (24)"

Presentation Format

展示格式

When creating diagrams:
  1. Describe what will be generated: "Creating a flowchart for the authentication method with 5 steps..."
  2. Generate the diagram: Run Python code to create SVG/PNG/PDF
  3. Show file location: "Diagram created: ${CLAUDE_PLUGIN_ROOT}/python\diagrams\method_flowchart.svg"
  4. List reference numbers (if added):
    Reference Numbers:
    - Input Module (10)
    - Processing Unit (20)
    - Output Interface (30)
创建图表时:
  1. 描述将要生成的内容: "正在为认证方法创建包含5个步骤的流程图..."
  2. 生成图表: 运行Python代码创建SVG/PNG/PDF格式的图表
  3. 显示文件位置: "图表已创建:${CLAUDE_PLUGIN_ROOT}/python\diagrams\method_flowchart.svg"
  4. 列出引用编号(如果已添加):
    引用编号:
    - 输入模块 (10)
    - 处理单元 (20)
    - 输出接口 (30)

Common Use Cases

常见用例

  1. Method Claims → Flowcharts
    • Show sequential steps
    • Include decision branches
    • Number steps (S1, S2, S3...)
  2. System Claims → Block Diagrams
    • Show components and connections
    • Use reference numbers
    • Indicate data flow directions
  3. Architecture Diagrams → Custom DOT
    • Complex system layouts
    • Multiple interconnections
    • Hierarchical structures
  1. 方法权利要求 → 流程图
    • 展示顺序步骤
    • 包含决策分支
    • 为步骤编号(S1、S2、S3...)
  2. 系统权利要求 → 框图
    • 展示组件和连接关系
    • 使用引用编号
    • 指示数据流方向
  3. 架构图 → 自定义DOT代码
    • 复杂系统布局
    • 多重互连关系
    • 层级结构

Error Handling

错误处理

If Graphviz is not installed:
  1. Check installation:
    dot -V
  2. Install for your OS (see above)
  3. Verify Python package:
    pip show graphviz
  4. Test generation:
    python scripts/test_diagrams.py
如果未安装Graphviz:
  1. 检查安装情况:
    dot -V
  2. 为你的操作系统安装Graphviz(见上文)
  3. 验证Python包:
    pip show graphviz
  4. 测试生成功能:
    python scripts/test_diagrams.py

Tools Available

可用工具

  • Bash: To run Python diagram generation
  • Write: To save DOT code or diagrams
  • Read: To load existing diagrams or templates
  • Bash: 运行Python图表生成代码
  • Write: 保存DOT代码或图表
  • Read: 加载现有图表或模板