Text Logic Diagram logo

Text Logic Diagram

Community
SpaceZephyr
text-logic-diagram

将文本内容进行逻辑拆解,生成精准的逻辑关系 SVG 图。支持递进、流程、循环、层次、对比、矩阵六种关系类型。当用户提供文本段落、文章、论述内容并要求生成逻辑图、思维导图、关系图、流程图时触发。支持中文,一次可拆解多张图。

Overview

PublisherSpaceZephyr
Repositorycowrite
Skill nametext-logic-diagram
Stars
91
Forks
14
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by SpaceZephyr on GitHub. Read the source before you install it.

Installation

Install the Text Logic Diagram AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/SpaceZephyr/cowrite/tree/main/skills/text-logic-diagram
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/SpaceZephyr/cowrite.git /tmp/cowrite
mkdir -p .claude/skills
cp -r /tmp/cowrite/skills/text-logic-diagram .claude/skills/text-logic-diagram
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Text Logic Diagram in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Text Logic Diagram on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Text Logic Diagram is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

文本逻辑关系图

将文本转换为精准的逻辑关系 SVG 图,输出为独立 HTML 文件。

触发条件

当用户提到以下场景时,主动使用此技能:

  • "生成逻辑图" / "画逻辑关系图" / "文本转图"
  • "逻辑拆解" / "拆成图" / "可视化"
  • 用户粘贴了文章/段落/论述内容并要求分析逻辑
  • "递进图" / "流程图" / "循环图" / "层次图" / "对比图" / "矩阵图"
  • 用户要求对文本进行结构化可视化

工作流程

第一步:文本分析

  1. 通读全文,识别文本中的核心论点、关键概念和逻辑链条
  2. 段落拆解,将文本按自然段落或逻辑段落分割
  3. 判断关系类型,为每个段落选择最适合的逻辑关系:
关系类型适用场景视觉特征
递进关系概念渐进发展、层层深入阶梯式排列,箭头从左到右或从上到下
流程关系步骤顺序、阶段推进线性/蛇形排列,带编号的节点
循环关系概念循环往复、闭环反馈环形排列,首尾相连
层次结构包含、从属、分类关系树形/金字塔/嵌套结构
对比关系对照、比较、优劣分析左右/上下对称排列
矩阵关系多维度交叉、复杂关联网格/象限布局

第二步:概念抽象

  1. 提取关键词:从每个段落中提取 2-6 个核心概念
  2. 精简文字:每个概念节点文字控制在 15 字以内
  3. 标注关系:概念之间的连接线和箭头标注简要说明
  4. 分层整理:区分主要概念和次要概念

第三步:生成 SVG 图

根据分析结果,使用本技能的设计规范生成 HTML 文件。

多段拆解规则:

  • 当文本包含多个独立逻辑段落时,生成多张 SVG 图
  • 每张图使用独立的 <div class="diagram-card"> 容器
  • 每张图上方标注段落标题或逻辑类型
  • 所有图按顺序排列在同一 HTML 文件中

设计系统

主题系统

支持深色和浅色主题切换,默认深色。

深色主题(默认)
元素颜色
页面背景#0a0a0a
卡片背景#141414
节点填充主色#1a2332 → #243447
节点描边#3f72af
主文字#ffffff
副文字#8899aa
连接线#556677
箭头#8899aa
强调色#3f72af (蓝), #5dade2 (亮蓝)
浅色主题
元素颜色
页面背景#f5f7fa
卡片背景#ffffff
节点填充主色#e8edf2 → #dbe2ef
节点描边#3f72af
主文字#112d4e
副文字#4a6785
连接线#aabbcc
箭头#8899aa
强调色#3f72af (蓝), #112d4e (深蓝)

字体规范

  • 全局使用 JetBrains Mono 等宽字体
  • 节点标题:14px,font-weight 600
  • 节点子标签:11px,font-weight 400
  • 连接线标注:10px
  • 段落标题:16px,font-weight 700
  • 图例文字:10px

SVG 规范

通用规范
  • 画布尺寸:每张图 viewBox 0 0 800 500,按需调整
  • 内边距:上下左右各留 40px
  • 箭头标记:小巧箭头,线宽 1
  • 阴影效果:轻微阴影 dx=1.5, dy=1.5, stdDeviation=2
节点样式
svg
<!-- 带阴影的圆角矩形节点 -->
<rect x="X" y="Y" width="W" height="H" rx="8"
  fill="url(#nodeGrad)" stroke="#3f72af" stroke-width="1.5"
  filter="url(#shadow)"/>
<text x="CX" y="CY" class="text-primary" font-size="14" font-weight="600"
  text-anchor="middle">概念名称</text>
连接线样式
svg
<!-- 标准连接线 -->
<line x1="X1" y1="Y1" x2="X2" y2="Y2"
  stroke="#556677" stroke-width="1" marker-end="url(#arrow)"/>

<!-- 虚线连接(表示弱关系/隐含关系) -->
<line x1="X1" y1="Y1" x2="X2" y2="Y2"
  stroke="#556677" stroke-width="1" stroke-dasharray="4,3"
  marker-end="url(#arrow)"/>

<!-- 曲线连接(避开障碍物) -->
<path d="M X1 Y1 Q CX CY X2 Y2"
  stroke="#556677" stroke-width="1" fill="none"
  marker-end="url(#arrow)"/>

关系类型视觉规范

递进关系
  • 从左到右阶梯式排列
  • 节点逐渐升高或尺寸逐渐增大
  • 箭头方向统一向右
  • 可用编号标注顺序(①②③)
  • 每层之间用浅色背景区分层级
流程关系
  • 线性排列或蛇形排列(超过 4 个节点时折行)
  • 每个节点带步骤编号(圆形徽章)
  • 连接线使用实线箭头
  • 起始节点用深色强调,结束节点用特殊样式
  • 分支点使用菱形节点
循环关系
  • 环形排列,首尾相连
  • 中心可放置核心概念
  • 连接线沿环形方向
  • 使用弧线连接而非直线
  • 箭头指向下一个节点
层次结构
  • 树形结构:根节点在上,子节点在下
  • 或金字塔结构:底部宽,顶部窄
  • 同级节点水平对齐
  • 父子关系用竖线连接
  • 可用嵌套矩形表示包含关系
对比关系
  • 左右对称布局
  • 中间用竖线或 VS 分隔
  • 左侧和右侧使用不同色调(如蓝色 vs 橙色)
  • 共同点放在中间或上方
  • 差异点分列两侧
矩阵关系
  • 网格布局(2×2、3×3 等)
  • 行列表头标注维度
  • 每个单元格内放置概念
  • 象限式分区(用浅色背景区分)
  • 对角线关系用特殊颜色标注

页面布局

  1. 页眉 - 标题 + 源文本简述 + 主题切换按钮
  2. 概览卡片 - 显示检测到的关系类型和概念数量
  3. 图表区域 - 多张 SVG 图按顺序排列,每张图带标题标签
  4. 页脚 - 元数据

多图排列模板

html
<div class="diagram-card">
  <div class="diagram-label">
    <span class="label-tag">递进关系</span>
    <span class="label-title">第一段:XXX 的渐进发展</span>
  </div>
  <div class="diagram-body">
    <svg class="diagram-svg" viewBox="0 0 800 500">
      <!-- SVG 内容 -->
    </svg>
  </div>
</div>

中文适配规则

  • 节点文字使用中文,技术术语保留英文
  • 中文字符宽度约为英文 2 倍,节点宽度按 14px × 字数 × 0.7 估算
  • 概念名称控制在 2-10 个汉字
  • 连接线标注使用 4-8 个汉字

输出要求

始终生成一个独立的 .html 文件,包含:

  • 内嵌 CSS(含主题变量)
  • 多张内联 SVG(按段落拆分)
  • 少量 JavaScript 用于主题切换
  • 文件可直接在浏览器中打开

Cowrite 内嵌模式

当 Cowrite 口令要求“HTML/PPT 解释图”时,使用以下覆盖规则:

  • 只输出一张 16:9 单页逻辑图,信息密度按一页 PPT 控制
  • 使用浅色白底主题,全部 CSS 与 SVG 内联,不引用外部资源
  • 不生成页眉、主题切换、概览卡片、页脚、Logo 或水印
  • 中文文字必须清晰,优先使用系统中文字体栈
  • 产物保存为独立 .html 文件,随后交给 cowrite_upload_asset 与 cowrite_insert_after

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Text Logic Diagram AI skill do?

将文本内容进行逻辑拆解,生成精准的逻辑关系 SVG 图。支持递进、流程、循环、层次、对比、矩阵六种关系类型。当用户提供文本段落、文章、论述内容并要求生成逻辑图、思维导图、关系图、流程图时触发。支持中文,一次可拆解多张图。

Why use Text Logic Diagram on TypingMind?

Because you install it once and use it with any model. Text Logic Diagram is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Text Logic Diagram in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/SpaceZephyr/cowrite/tree/main/skills/text-logic-diagram. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Text Logic Diagram?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Text Logic Diagram?

As many as you like. As long as a model supports skills, you can use Text Logic Diagram with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Text Logic Diagram AI skill free?

Yes. It is published on GitHub by SpaceZephyr under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇