360 Secure SkillHub
360 安全技能中心

A股逻辑可视化工具

根据标题与投资逻辑链提取节点、因果边和影响极性,用提示词或提示脚本生成 mxGraph XML,校验首尾标签后经 Python 脚本渲染为内嵌图表的 HTML 文件;渲染失败时回退返回 XML,并附测试与评测用例。

zoeluli7459-dev
zoeluli7459-dev
热度 8.91
最近更新 2026-07-27 19:06:56
分类:创作依赖:代码执行 / 读写文件 / 内部调用大模型应用场景:概念解释 / 市场分析 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add alphaear-logic-visualizer
Metadata
name
alphaear-logic-visualizer
description
Use this skill to turn finance or investment logic into a visual diagram, especially transmission chains, thesis maps, causal loops, risk/benefit paths, and Draw.io-compatible mxGraph XML/HTML artifacts. Trigger when the user asks to visualize, draw, map, diagram, or explain complex finance logic visually. Do not use for raw data lookup, news search, stock screening, or signal tracking unless a diagram is the requested deliverable.

AlphaEar Logic Visualizer

Create Draw.io-compatible finance logic diagrams from structured or semi-structured investment reasoning.

Inputs

  • Required: title or topic plus the logic chain to visualize.
  • Preferred node shape: each node has name, type or impact, logic, and optional evidence.
  • Ask a follow-up if the causal direction or main deliverable is unclear.

Workflow

  1. Extract nodes, causal edges, and impact polarity from the user's thesis.
  2. Classify nodes as positive, negative, or neutral.
  3. Use references/PROMPTS.md or scripts/visualizer_prompt.py to generate plain mxGraph XML.
  4. Validate that the XML starts with <mxGraphModel> and ends with </mxGraphModel>.
  5. Render to HTML with VisualizerTools.render_drawio_to_html(xml_content, filename) from scripts/visualizer.py when the user needs a file artifact.
  6. Return the rendered HTML path and a concise explanation of the diagram structure.

Output Contract

  • Deliver Draw.io XML or an HTML file that embeds the diagram.
  • Use left-to-right layout for transmission chains and top-to-bottom layout for hierarchies.
  • Use green for positive, red for negative, and grey for neutral impacts.
  • Avoid overlapping nodes and make edge labels short.

Failure Handling

  • If the thesis lacks enough structure, first produce a node/edge outline and ask for confirmation.
  • If rendering fails, still return validated XML and explain how to open it in Draw.io.
  • Do not invent unsupported financial relationships; mark uncertain links as assumptions.

Validation

  • Run or review tests/test_visualizer.py after changing scripts.
  • Use evals/evals.json for routing and output-contract checks.