Rapid Architecture & Diagram Drawing Tool
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md to install @user_04c33885/diagram-builder.
About this skill
The Specific Problem It Solves
For engineers, drawing clear and规范 architecture and flow diagrams is a necessity for technical documentation, design reviews, and solution discussions. However, manually adjusting SVG coordinates, handling arrow-text overlaps, and ensuring consistent styling across components are tedious and error-prone tasks. General-purpose drawing tools often fail to produce inline diagrams ready for technical blogs, or generate Mermaid code that doesn't meet documentation standards.
How the Skill Works
This skill offers two core diagramming pathways, underpinned by strict engineering specifications:
1. Inline Visualization (Recommended)
- Operation: Loads preset CSS variables and design modules via
read_me, then renders SVG or HTML diagrams directly in the conversation usingshow_widget. - Advantage: It provides a What-You-See-Is-What-You-Get experience. The
diagrammodule enforces uniform colors, fonts, and spacing for visual consistency. - Use Cases: System architecture diagrams, microservice topologies, business process flowcharts (swimlanes), and data flow diagrams—ideal for scenarios requiring immediate display and discussion.
2. Mermaid Code Blocks
- Operation: Outputs standard-compliant Mermaid syntax.
- Advantage: Easily embedded in Markdown documents (e.g., GitHub, Obsidian) and rendered into final documents via rendering engines.
- Use Cases: Sequence diagrams, state machine diagrams, ER diagrams, or any scenario requiring version-controlled diagram source code.
Key Design Specifications and Pitfall Avoidance
The skill is more than a simple drawing tool; it emphasizes generating standards-compliant diagrams:
* Token Efficiency: Advocates for using CSS classes and SVG <defs> for reuse instead of inline styles per element, which can significantly reduce token consumption.
* Arrow Clarity: Includes specifications for arrow marker definitions, ensuring precise alignment via refX/refY and setting markerWidth/markerHeight not smaller than the viewport to prevent clipping distortion.
* Overlap Prevention: Employs mechanisms like the "arrow tip exclusion zone" and "white background underlay" to enforce avoiding arrows covering text, ensuring label readability.
* Layered Layout: Provides specifications for layer grouping frames (dashed rectangles) and inter-layer arrow spacing for architecture diagrams, guiding a clear hierarchical layout.
Applicability and Important Notes
Before use, it's crucial to understand the capabilities:
* Supported: Vector diagrams such as architecture, flowchart, sequence, state machine, ER, and Gantt charts.
* Not Supported: Pie, bar, and line charts (use the chart module instead), mind maps, 3D graphics, maps, or direct PNG generation. For such requests, you should proactively explain and provide alternatives.
* Best Practice: When diagramming complex systems, it's advisable to break them into multiple diagrams, each focusing on a single perspective, accompanied by textual explanations. A single diagram is recommended to contain no more than 20 nodes to maintain clarity.
Use Cases
- Drawing a system architecture diagram for a new microservice project to clarify inter-service call relationships, data flows, and infrastructure dependencies, for team design review.
- Creating SVG-format business flow diagrams (e.g., user registration flow) for technical blogs or documentation that can be directly embedded in articles, ensuring visual clarity and style consistency.
- Generating a state machine diagram to describe the lifecycle state transitions of a business object (e.g., an order), requiring output as Mermaid code blocks that conform to documentation standards.
- Quickly sketching an ER diagram during the project design phase to define database table structures and entity relationships, serving as the foundation for subsequent data layer development.
Best For
- System architects or technical authors who need to visualize complex technical proposals (e.g., microservice architecture, data flows) for inclusion in design documents or technical blogs.
- Documentation engineers responsible for writing and maintaining technical documentation (e.g., online help centers, Confluence pages), needing to present business processes and system interactions via standardized diagrams.
- Product managers or backend developers who need to quickly draw ER diagrams and flowcharts in early project phases to align design thinking with the team, but lack specialized drawing tools or time.
- Technical analysts who need to create clear state or sequence diagrams to assist in analyzing complex business logic and ensure the diagrams can be version-controlled.
Related Skills
A P8-level programming expert skill that follows a six-step closed-loop workflow, covering the full development lifecycle including code generation, review, and debugging for complex software projects.
Intelligently transforms natural language requests into editable professional online diagrams, supporting various types like flowcharts, architecture diagrams, etc.
A Chinese localization plugin for GitHub Desktop that automatically detects the installation directory and performs text string replacements to localize the interface, supporting loose and asar modes with backup and rollback features.
This skill automatically generates skill packages compliant with the wx.modelContext specification from WeChat Mini Program source code, supporting source analysis, interface extraction, and code generation.