agentleFS
oocxoocx/tfplan2md/.claude/skills/flowchart-layout-optimizer/SKILL.md

flowchart_layout_optimizer

Skill174 starsChanged 2 months agoMITView on GitHub

Calculates an optimal, hierarchical, and non-intersecting layout for a flowchart provided as an SVG file using the Sugiyama algorithm (Dagre).

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when you have an existing SVG that visually represents a flow, process, or directed graph, but the current node positions …

    line 25
  2. Very specific:

    Install Dependencies: Run npm install in the skill's directory.

    line 33
  3. Very specific:

    Execute Script: Call the run_script tool with the appropriate selectors and the required flow map (passed as a simplified JSON string).

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Flowchart Layout Optimizer

This skill uses the industry-standard Dagre library to apply the Sugiyama Layered Graph Drawing algorithm to an SVG-rendered flowchart. The goal is to produce a beautiful, easy-to-read diagram where nodes are aligned into logical layers (ranks) and edges follow clean, non-intersecting paths.

💡 When to Use

Use this skill when you have an existing SVG that visually represents a flow, process, or directed graph, but the current node positions and arrow paths are messy, overlapping, or manually placed and hard to follow.

🛠 Prerequisites

The agent must be in an environment where Node.js and the dependencies listed in package.json can be installed and executed.

📝 Instructions for the Agent

  1. Install Dependencies: Run npm install in the skill's directory.
  2. Graph Mapping (Critical Pre-step): The provided SVG uses position-based routing and lacks unique id attributes on node groups (g.node) and explicit data-source/data-target attributes on edge paths (path).
    • Agent Action: The agent MUST execute a mapping logic before calling the layout script. This is done by instructing the script to use sequential IDs and providing the connection list.
  3. Execute Script: Call the run_script tool with the appropriate selectors and the required flow map (passed as a simplified JSON string).

    Required Selectors:

    • node_selector: g.node
    • edge_selector: path[d] (Selects all paths that define edges)
> **Connection Map Generation (Example for Agent):**
> The agent will internally generate a flow map by analyzing the text content of the nodes and the flow:
> ```json
> {
>   "MAINTAINER": ["REQUIREMENTS ENG", "ISSUE ANALYST", "WORKFLOW ENG"],
>   "REQUIREMENTS ENG": ["FEATURE SPEC"],
>   "ISSUE ANALYST": ["ISSUE ANALYSIS"],
>   // ... and so on for all 14 nodes/artifacts
> }
> ```
> *Note: Since the provided SVG has nodes/edges without IDs, the `run.js` script will now handle the sequential ID assignment.*

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.