Token导航 LogoToken导航

Agent Skill · 研究检索

detect-diagram-crossings(检测图表交叉点)

detect-diagram-crossings 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

detect-diagram-crossings 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 59,803。

总安装 376周安装 16GitHub Stars 163下载 132核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:detect-diagram-crossings(检测图表交叉点)
来源仓库:https://github.com/oocx/tfplan2md
仓库路径:skills/detect-diagram-crossings
安装命令:
npx skills add https://github.com/oocx/tfplan2md --skill detect-diagram-crossings
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/oocx/tfplan2md --skill detect-diagram-crossings

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

detect-diagram-crossings 采用几何与视觉双重方法检测 SVG 流程图交叉。适用于工作流图、架构图的布局质量验证与调试。组合数学分析与人工检查,确保无重叠连线。需输入 SVG 文件路径,输出交叉点坐标与修正建议。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/detect-diagram-crossings

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/oocx/tfplan2md --skill detect-diagram-crossing…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

detect-diagram-crossings 怎么安装?

在终端执行 npx skills add https://github.com/oocx/tfplan2md --skill detect-diagram-crossings。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

detect-diagram-crossings 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

detect-diagram-crossings 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

detect-diagram-crossings 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

detect-diagram-crossings 用的人多吗?

公开数据是累计安装 376 次,近一周安装 16 次,下载 132 次,GitHub 163 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

detect-diagram-crossings 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
detect-diagram-crossings

检测图表交叉点 · 本页

376163只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Detect Diagram Crossings

Purpose

Provide a rigorous, multi-method approach to detecting edge crossings and overlaps in SVG flowchart diagrams. This skill combines mathematical geometric analysis with visual inspection to ensure diagrams have clean, crossing-free layouts.

When to Use

  • Validating Diagram Layouts: After creating or modifying workflow diagrams
  • Quality Assurance: Before committing diagram changes to ensure no crossings
  • Debugging Visual Issues: When users report crossing/overlap problems
  • Comparative Analysis: Testing multiple layout versions to find the best one

Detection Methods

Method 1: Parametric Line Intersection (Mathematical)

The primary detection method uses parametric line equations to mathematically determine if two line segments intersect.

Algorithm:

  1. Parse SVG paths into line segments (sequences of points connected by lines)
  2. For each pair of line segments from different paths:

- Calculate intersection using parametric equations: - Line 1: P = P1 + t(P2 - P1) - Line 2: P = P3 + u(P4 - P3) - Solve for parameters t and u - Intersection occurs if 0.01 < t < 0.99 AND 0.01 < u < 0.99

  1. Exclude endpoint connections (valid node-to-node connections)
  2. Report all internal segment intersections as crossings

Why This Works:

  • Mathematically precise: detects exact intersection points
  • Coordinate-based: doesn't rely on visual rendering
  • Tolerance-aware: excludes near-endpoint intersections (within 1% of segment length)

Limitations:

  • May not detect visual overlaps that aren't true mathematical intersections
  • Doesn't account for stroke width or arrow markers
  • Requires well-formed SVG path data

Method 2: Node-Path Proximity Analysis

Detects when paths pass through or very close to node bodies (not at connection points).

Algorithm:

  1. Extract all node bounding boxes from <rect> elements: (x, y, width, height)
  2. Parse each path's d attribute into individual line segments
  3. For EACH segment of EACH path (not just waypoints):

- Vertical segments (same x, different y): Check if x is within any node's x-range AND the y-range of the segment overlaps with the node's y-range - Horizontal segments (same y, different x): Check if y is within any node's y-range AND the x-range of the segment overlaps with the node's x-range - Diagonal segments: Check if the line passes through the node's bounding box

  1. For each detected intersection:

- Exclude segments that START or END at a node edge (valid connection points) - Report all segments that PASS THROUGH a node's interior

Critical: Segment-by-Segment Analysis A multi-segment path like M 890 1180 L 550 1180 L 550 820 L 890 820 has THREE segments:

  1. Horizontal: (890,1180) → (550,1180) at y=1180
  2. Vertical: (550,1180) → (550,820) at x=550
  3. Horizontal: (550,820) → (890,820) at y=820

Each segment must be checked independently against ALL nodes. A single path can cross MULTIPLE nodes.

Why This Works:

  • Catches paths that visually obscure nodes
  • Identifies routing issues where paths don't avoid nodes
  • Complements line intersection by checking path-node relationships
  • Detects all nodes crossed by multi-segment paths, not just the first one

Method 3: Path Overlap and Shared Point Analysis

Detects paths that share segments or start/end points, causing visual confusion.

Algorithm:

  1. Extract all path endpoints (start and end coordinates)
  2. Extract all path segments with their coordinates
  3. Check for:

- Shared endpoints: Multiple paths starting or ending at exact same point - Overlapping segments: Two paths sharing the same line segment (same x or y and overlapping range) - Convergence points: Multiple paths arriving at the same node edge within close proximity

Why This Works:

  • Identifies visual clutter where paths merge
  • Catches paths that are hard to distinguish
  • Highlights areas needing offset routing for clarity

Method 4: Routing Quality Analysis

Detects suboptimal path routing that could be improved for visual clarity.

Algorithm:

  1. Shared Start Points: Check if multiple paths originate from the exact same coordinate

- Example violation: UAT Tester → UAT PR and UAT Tester → Developer both starting at (890, 1180) - Fix: Offset one path to start from a different point on the same node edge

  1. Off-Center Connections: For nodes with only one incoming/outgoing path on an edge, verify the connection is centered

- Example violation: Path connecting to lower-left of a node instead of center-left - Fix: Adjust path endpoint to center of the edge

  1. Unnecessary Segments: Check if paths use more segments than necessary

- Example violation: 4-segment path when a 2-segment orthogonal path would work without crossings - Fix: Simplify the path to use the minimum number of segments

  1. Suboptimal Routes: Check if shorter intersection-free routes exist

- Example violation: Retro Report → Workflow Engineer going left-down-right instead of right-up-left - Fix: Reroute using the shorter valid alternative

Why This Works:

  • Ensures visual consistency and professionalism
  • Reduces clutter by minimizing unnecessary path complexity
  • Improves readability by using the most direct valid routes

Method 5: Visual Screenshot Analysis

Uses actual rendered output to catch visual issues that math might miss.

Algorithm:

  1. Capture high-resolution screenshot of rendered diagram
  2. Visually inspect for:

- Lines crossing over each other - Paths obscuring node labels - Arrow markers colliding with nodes/paths - Color overlaps making paths indistinguishable

  1. Document specific coordinates of visual crossings

Why This Works:

  • Catches rendering artifacts (antialiasing, stroke width effects)
  • Validates user-perceived quality
  • Identifies issues in arrow markers and decorations
  • Accounts for font rendering and text overlaps

Systematic Detection Checklist

When detecting issues manually (without scripts), follow this checklist:

Step 1: Build Node Inventory

Create a table of ALL nodes with their bounding boxes:

| Node Name | x-min | x-max | y-min | y-max |
|-----------|-------|-------|-------|-------|
| Developer | 780   | 1000  | 780   | 820   |
| Tech Writer | 490 | 710   | 960   | 1000  |
...

Step 2: Parse Each Path into Segments

For each path, break down the d attribute into individual segments:

Path: "M 890 1180 L 550 1180 L 550 820 L 890 820"
Segments:
  1. Horizontal at y=1180: x from 890 to 550
  2. Vertical at x=550: y from 1180 to 820
  3. Horizontal at y=820: x from 550 to 890

Step 3: Check EVERY Segment Against EVERY Node

For each segment, systematically check against all nodes:

  • Vertical segment at x=X, y from Y1 to Y2:

- Does X fall within [node.x-min, node.x-max]? - Does [Y1, Y2] overlap with [node.y-min, node.y-max]? - If BOTH yes → CROSSING DETECTED

  • Horizontal segment at y=Y, x from X1 to X2:

- Does Y fall within [node.y-min, node.y-max]? - Does [X1, X2] overlap with [node.x-min, node.x-max]? - If BOTH yes → CROSSING DETECTED

Step 4: Check Path Start/End Points

For each path, check if its start or end point is shared with other paths:

  • Same exact coordinates = SHARED ENDPOINT
  • Different paths arriving at same node edge within 5px = CONVERGENCE

Step 5: Check Path-Path Intersections

For each pair of paths, check if their segments intersect:

  • Two horizontal segments at same y with overlapping x-range = OVERLAP
  • Two vertical segments at same x with overlapping y-range = OVERLAP
  • Horizontal and vertical segments that cross = CROSSING

Hard Rules

Must

  • Build a complete node inventory FIRST before analyzing any paths
  • Parse each path into individual line segments - never analyze paths as single entities
  • Check EVERY segment against EVERY node - a single path can cross multiple nodes
  • Run all detection methods for thorough validation
  • Report exact coordinates of intersection points
  • Identify which paths AND which specific segments are involved in each crossing
  • Calculate parametric intersection parameters (t, u values) for path-path crossings
  • Test with actual SVG data from the diagram file
  • Create visual annotations showing crossing locations
  • Report shared endpoints and overlapping path segments as separate issues

Must Not

  • Rely on only one detection method
  • Report endpoint connections as crossings
  • Skip proximity analysis
  • Ignore visual rendering validation
  • Treat a multi-segment path as a single line - always decompose into segments
  • Stop after finding one crossing on a path - continue checking remaining segments
  • Assume segment routing based on comments - verify actual coordinates

Testing Approach

Test 1: Node Inventory Verification

Build the complete node inventory table and verify all nodes are captured.

Test 2: Path Segment Decomposition

Decompose ALL paths into segments and verify segment count matches expected.

Test 3: Systematic Segment-Node Checking

For each segment, check against ALL nodes (not just visually nearby ones).

Test 4: Mathematical Verification

Run parametric line intersection detection on all path-path segment pairs.

Test 5: Shared Point Detection

Check for paths sharing start/end points or overlapping segments.

Test 6: Visual Inspection

Analyze rendered screenshot for visual crossing artifacts.

Actions

1. Run Full Detection Suite

Execute the comprehensive Python detection script:

python3 .github/skills/detect-diagram-crossings/detect_crossings.py website/ai-workflow.html

This will:

  • Parse SVG and extract all paths and nodes
  • Decompose paths into individual line segments
  • Run segment-by-segment node crossing detection
  • Check path-path intersections
  • Detect shared endpoints and overlapping segments
  • Generate a detailed report with node inventory, path inventory, and issues

2. Run Extended Validation (Recommended)

Execute the JavaScript detection script for additional quality checks:

node .github/skills/detect-diagram-crossings/detect_all.js website/ai-workflow.html

This performs additional validation including:

  • Shared start points: Multiple paths must not start at the same point of a node
  • Off-center connections: If a path is the only connection to a node edge, it must connect at the center
  • Unnecessary segments: Flags paths with more than 2 segments when a simpler 2-segment orthogonal path would work
  • Suboptimal routes: Identifies paths that take longer routes when a shorter intersection-free alternative exists

Note: The JavaScript script requires Node.js and jsdom. Install dependencies with:

cd .github/skills/detect-diagram-crossings && npm install jsdom

3. Validate Fix

After modifying the diagram, re-run both detection scripts to confirm improvements:

python3 .github/skills/detect-diagram-crossings/detect_crossings.py website/ai-workflow.html
node .github/skills/detect-diagram-crossings/detect_all.js website/ai-workflow.html

Both scripts exit with:

  • Exit code 0: No errors (warnings are OK for Python script)
  • Exit code 1: Errors detected

Detection Metrics

Success Criteria

  • ✅ Zero mathematical crossings: All parametric tests pass
  • ✅ Zero proximity issues: No path segments through node bodies
  • ✅ Zero shared start points: Each path starts from a unique point on a node
  • ✅ Zero segment overlaps: No path segments overlap with other path segments
  • ✅ Centered single connections: Paths connecting to nodes with no other connections use center of edge
  • ✅ Minimal segment paths: No paths use more segments than necessary
  • ✅ Optimal routes: No significantly shorter intersection-free alternatives exist
  • ✅ Clean visual rendering: Screenshot confirms no visual crossings
  • ✅ All paths routed: Every connection has a clear, non-crossing path

Quality Thresholds

  • Excellent: 0 crossings by all methods
  • Good: 0 mathematical crossings, minor visual artifacts only
  • Fair: 1-2 mathematical crossings in complex areas
  • Poor: 3+ crossings or major visual overlaps
  • Unacceptable: Multiple obvious crossings visible in screenshot

Common Mistakes to Avoid

Mistake 1: Incomplete Path Decomposition

Wrong: Checking only path endpoints or waypoints Right: Parse d attribute into ALL individual line segments

Mistake 2: Stopping Early

Wrong: Finding one crossing on a path and moving to next path Right: Check ALL segments of the path against ALL nodes

Mistake 3: Visual Proximity Assumption

Wrong: Assuming a path doesn't cross a node because they look far apart Right: Mathematically verify segment coordinates against node bounds

Mistake 4: Ignoring Multi-Node Crossings

Wrong: Reporting "path crosses Tech Writer" and stopping Right: Continue checking - same path might also cross Documentation, UAT Tester, etc.

Mistake 5: Missing Shared Points

Wrong: Only checking for geometric crossings Right: Also check for paths sharing exact start/end coordinates

Common Issues and Solutions

Issue: False Positives at Endpoints

Symptom: Detections at valid node-to-node connections Fix: Increase endpoint tolerance from 0.01 to 0.05

Issue: Missed Visual Crossings

Symptom: Math says no crossings but visually there are Fix: Check stroke width, arrow markers, and rendering artifacts

Issue: Paths Too Close to Nodes

Symptom: Proximity warnings but no crossings Fix: Add routing margins, use wider node spacing

Best Practices

  1. Test Early and Often: Run detection after every layout change
  2. Use All Three Methods: Don't rely on just mathematical analysis
  3. Document Findings: Save screenshots and coordinate data
  4. Iterative Refinement: Fix one crossing at a time, re-test after each fix
  5. Validate Visually: Always check rendered output, not just data

Example Output

CROSSING DETECTION REPORT
=========================

Method 1: Parametric Line Intersection
- Paths analyzed: 30
- Crossings detected: 0
- Status: ✅ PASS

Method 2: Node-Path Proximity
- Nodes analyzed: 25
- Proximity issues: 0
- Status: ✅ PASS

Method 3: Shared Points Analysis
- Shared endpoints: 0
- Overlapping segments: 0
- Status: ✅ PASS

Method 4: Visual Screenshot Analysis
- Resolution: 1920x2000px
- Visual crossings: 0
- Status: ✅ PASS

OVERALL: ✅ NO CROSSINGS DETECTED
Diagram has a clean, crossing-free layout.

Worked Example: UAT Rework Path Analysis

This example demonstrates the complete detection process for a problematic path.

Input Path

<!-- UAT rework path -->
<path d="M 890 1180 L 550 1180 L 550 820 L 890 820" stroke="#ff6b6b" .../>

Step 1: Decompose into Segments

SegmentTypeFixed CoordRange
1Horizontaly=1180x: 550-890
2Verticalx=550y: 820-1180
3Horizontaly=820x: 550-890

Step 2: Relevant Node Bounds

Nodex-minx-maxy-miny-max
UAT Tester780100011401180
Tech Writer4907109601000
Documentation49071010501085
Developer7801000780820

Step 3: Check Each Segment Against Each Node

Segment 1 (Horizontal y=1180, x: 550-890):

  • UAT Tester: y=1180 within [1140,1180]? YES (touches edge). x:[550,890] overlaps [780,1000]? YES → CROSSING (edge)
  • Tech Writer: y=1180 within [960,1000]? NO → OK
  • Documentation: y=1180 within [1050,1085]? NO → OK
  • Developer: y=1180 within [780,820]? NO → OK

Segment 2 (Vertical x=550, y: 820-1180):

  • UAT Tester: x=550 within [780,1000]? NO → OK
  • Tech Writer: x=550 within [490,710]? YES. y:[820,1180] overlaps [960,1000]? YES → CROSSING
  • Documentation: x=550 within [490,710]? YES. y:[820,1180] overlaps [1050,1085]? YES → CROSSING
  • Developer: x=550 within [780,1000]? NO → OK

Segment 3 (Horizontal y=820, x: 550-890):

  • UAT Tester: y=820 within [1140,1180]? NO → OK
  • Tech Writer: y=820 within [960,1000]? NO → OK
  • Documentation: y=820 within [1050,1085]? NO → OK
  • Developer: y=820 within [780,820]? YES (touches edge). x:[550,890] overlaps [780,1000]? YES → ENDPOINT (valid)

Step 4: Final Report for This Path

UAT Rework Path Crossings:
- Segment 1 (y=1180): Touches UAT Tester bottom edge at x=780-890 (start point)
- Segment 2 (x=550): CROSSES Tech Writer (y=960-1000)
- Segment 2 (x=550): CROSSES Documentation (y=1050-1085)
- Segment 3 (y=820): Ends at Developer node (valid endpoint)

ISSUES FOUND: 2 node crossings (Tech Writer, Documentation)

平台分布

Codex

36.61%
按下载量换算48

Claude

29.17%
按下载量换算39

Cursor

21.43%
按下载量换算28

Gemini CLI

10.39%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills