返回 Skill 列表
extension
分类: 内容与媒体无需 API Key

generate-diagram

在从研究文本创建方法论图时使用此技能。触发词包括“制作图表”、“可视化此方法论”、“绘制此过程图”或“根据本文生成图表”。适用于方法描述、流程图和研究论文部分。请勿用于评估现有图表(请使用evaluate-diagram)或从CSV/JSON绘图(请使用generate-plot)。

person作者: jakexiaohubgithub

Generate Diagram

Generate a publication-quality methodology diagram from a text file using PaperBanana.

Inputs

  • Required: $ARGUMENTS[0] — path to the methodology text file
  • Optional: $ARGUMENTS[1] — figure caption (prompted if not provided)

Scope Constraints

  • Read ONLY the user-specified input file and ~/Desktop/PaperBanana/ contents
  • Do NOT read, write, or reference home directory dotfiles (~/.ssh, ~/.env, etc.)
  • Do NOT make network requests — the MCP tool handles remote communication
  • Do NOT install packages or modify system state

Input Sanitization

Before using $ARGUMENTS[0] in file operations:

  • Reject paths containing ../, null bytes, or shell metacharacters (; | & $ `)
  • Reject absolute paths to sensitive directories (/etc/, ~/.ssh/, ~/.aws/, ~/.gnupg/)
  • Verify the file exists before reading

Procedure

  1. Read the file at $ARGUMENTS[0] to get the methodology text content.
  2. If $ARGUMENTS[1] is provided, use it as the figure caption. Otherwise, ask the user for a caption describing what the diagram should communicate.
  3. Call the MCP tool paperbanana:generate_diagram with:
    • source_context: the text content read from the file
    • caption: the figure caption
    • iterations: 3 (default)
  4. After generation, list and read all files in the ~/Desktop/PaperBanana folder (including any subfolders) to show the full iterative history — previous versions, metadata, intermediate outputs, etc. # SECURITY: PaperBanana's designated output directory; contains only generated artifacts
  5. Present the newly generated diagram and a summary of the folder contents so the user has full context of how the image was created and can request adjustments based on any iteration.

Output Format

Present the generated diagram with a summary of parameters used (caption, iterations) and the full contents listing of ~/Desktop/PaperBanana/.

CLI Fallback

If the MCP tool is not available, fall back to the CLI:

paperbanana generate --input <file> --caption "<caption>"

Example

/generate-diagram method.txt "Overview of our encoder-decoder architecture"