Visual Workflow Diagram Generator
Purpose
Transform written workflow steps into interactive, visual process flow diagrams rendered in a web browser. Generate a single, self-contained HTML file that displays a standards-compliant flowchart with clickable elements that reveal detailed information about each step.
When to Use This Skill
Invoke this skill when users provide workflow steps, business processes, or procedural descriptions that would benefit from visual representation. Common scenarios include:
- •Converting written Standard Operating Procedures (SOPs) into visual diagrams
- •Documenting business processes for training or compliance
- •Creating interactive process maps from meeting notes or requirements documents
- •Visualizing decision trees and approval workflows
- •Transforming step-by-step instructions into flowcharts
Workflow Analysis Process
Identify Workflow Elements
Parse the provided workflow steps to categorize each element into one of the following types:
Processes (Actions/Tasks)
- •Active steps that perform work or operations
- •Represent with rectangles in the diagram
- •Examples: "Review Application", "Send Email", "Update Database"
Decisions (Branching Points)
- •Points where the workflow branches based on conditions
- •Represent with diamond shapes in the diagram
- •Always have multiple outcomes (yes/no or multiple paths)
- •Examples: "Budget > $10K?", "Approved?", "Error Occurred?"
Data (Inputs/Outputs/Documents)
- •Information, documents, or data used or generated by the process
- •Represent with parallelograms in the diagram
- •Examples: "Application Form", "Report Output", "Customer Data"
Start/End Points
- •Beginning and termination points of the workflow
- •Represent with rounded rectangles or ovals
- •Label as "Start" and "End" or with specific trigger/outcome names
Connectors (Flow Direction)
- •Arrows showing the sequence and direction of flow
- •Label decision branches with conditions (e.g., "Yes", "No", "> $10K")
Extract Detailed Information
For each identified element, extract two levels of information:
- •High-level label (2-5 words) - Concise summary for the diagram box
- •Detailed steps - Full explanation, criteria, or instructions for the flyout panel
Diagram Standards
Standard Flowchart Shapes
Apply the following shape conventions consistently:
| Element Type | Shape | Visual Example |
|---|---|---|
| Process/Task | Rectangle | Simple box with straight corners |
| Decision | Diamond | 45-degree rotated square |
| Data/Input/Output | Parallelogram | Slanted rectangle |
| Start/End | Rounded Rectangle | Box with rounded corners |
| Flow Direction | Arrow | Directional connector with arrowhead |
Connector Line Standards
Ensure all connector lines and arrows are fully visible and clean:
- •Visibility: All connector lines and arrows must be completely visible
- •No Overlaps: Connector lines must not overlap with boxes or shapes
- •No Clipping: Arrows must not be cut off or hidden behind elements
- •Clean Routing: Route lines to avoid crossing text or obscuring content
- •Clear Direction: Arrowheads must be clearly visible at all times
- •Proper Spacing: Maintain adequate spacing between connectors and boxes
- •Branch Merging: When decision branches merge back to the main flow, ensure proper spacing to prevent arrows from overlapping boxes
- •Error-Free: No visual glitches, overlaps, or rendering errors on connectors
Label Guidelines
Create labels that are concise yet descriptive:
- •Length: 2-5 words ideally, maximum 8 words
- •Style: Active voice for processes (e.g., "Review Application")
- •Style: Question form for decisions (e.g., "Budget > $10K?")
- •Clarity: Summarize purpose without implementation details
- •Sizing: Ensure text never overflows box boundaries
- •Wrapping: Use text wrapping if needed, but prefer shorter labels
- •Alignment: All text must be center-aligned within its containing shape
- •Padding: Ensure equal padding around all sides of text relative to box borders
- •Text should be vertically and horizontally centered
- •Maintain consistent spacing between text and shape boundaries
- •Apply appropriate padding to prevent text from appearing cramped
Label Transformation Examples
| Detailed Step | Concise Label |
|---|---|
| "Review the submitted application form for completeness and verify all required fields are filled" | "Review Application" |
| "If the budget exceeds $10,000, route to senior manager for approval" | "Budget > $10K?" |
| "Export the final report to PDF format and save to shared drive" | "Export Report" |
| "Send automated email notification to customer with confirmation number" | "Send Confirmation Email" |
| "Check whether the user has administrative privileges in the system" | "Admin User?" |
Color and Accessibility Standards
Apply colors that maintain excellent readability:
Recommended Color Palette:
- •Processes: Light blue (#E3F2FD) with dark text (#1976D2 or #000000)
- •Decisions: Light yellow (#FFF9C4) with dark text (#F57F17 or #000000)
- •Data: Light green (#E8F5E9) with dark text (#388E3C or #000000)
- •Start/End: Light gray (#F5F5F5) with dark text (#424242 or #000000)
Accessibility Requirements:
- •Maintain WCAG AA contrast ratio (4.5:1 minimum for normal text)
- •Use dark text (#000000 or dark variants) on light fill colors
- •Use light text (#FFFFFF) only on sufficiently dark backgrounds
- •Test contrast if using custom color schemes
- •Ensure color is not the only differentiator (shape also conveys meaning)
Interactivity Requirements
Clickable Elements
Make every workflow element (box/shape) clickable and interactive:
- •Click handler: Attach event listener to each SVG/HTML element
- •Visual feedback: Add hover state (subtle border or shadow)
- •Cursor change: Use
cursor: pointeron clickable elements - •Active state: Indicate which element is currently selected (optional)
Flyout Panel Behavior
When a user clicks any workflow element, display a flyout panel with:
Content:
- •Header: High-level step name (same as box label)
- •Body: Full detailed steps, decision criteria, or instructions
- •For decisions: List all possible outcomes with their conditions
- •For processes: Include any relevant substeps or notes
- •Close button: Clear visual affordance to dismiss panel
Interaction:
- •Animation: Slide in from right side (300ms transition recommended)
- •Position: Fixed or absolute positioning overlaying the diagram
- •Backdrop: Optional semi-transparent overlay (#000000 with 20-40% opacity)
- •Dismissal methods:
- •Click close button (X icon)
- •Click backdrop outside panel
- •Press Escape key
- •Responsive: Adjust panel width on smaller screens (100% width on mobile)
Styling:
- •Sufficient padding (16-24px) for readability
- •Clear visual hierarchy (larger header, readable body text)
- •Contrasting background from main diagram (typically white or light gray)
- •Box shadow for depth and separation
Technical Implementation
Output Format
Generate a complete, self-contained HTML file with this structure:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>[Workflow Name] - Process Flow</title>
<style>
/* All CSS here - no external stylesheets */
/* Include: diagram layout, shapes, colors, flyout panel, responsive styles */
</style>
</head>
<body>
<!-- Main diagram container -->
<div id="diagram-container">
<!-- SVG or HTML-based diagram -->
</div>
<!-- Flyout panel (hidden by default) -->
<div id="flyout-panel" class="hidden">
<button id="close-panel">×</button>
<h2 id="flyout-title"></h2>
<div id="flyout-content"></div>
</div>
<!-- Optional: Semi-transparent backdrop -->
<div id="backdrop" class="hidden"></div>
<script>
/* All JavaScript here - no external scripts (except CDN if using library) */
/* Include: click handlers, panel show/hide, keyboard navigation */
</script>
</body>
</html>
Implementation Approaches
Default: HTML/CSS with Inline SVG (Recommended)
Use this hybrid approach as the default implementation unless the user explicitly requests a different format:
- •HTML - Document structure, containers, and the flyout panel
- •CSS - Styling for the page layout, colors, hover effects, and responsive design
- •SVG - The actual flowchart diagram with all shapes (rectangles, diamonds, ellipses), connector lines, arrows, and text labels embedded directly in the HTML
- •JavaScript - Interactivity for clicking elements and showing/hiding the flyout panel with detailed information
The SVG is embedded directly in the HTML file (not as an external image), which makes it:
- •Fully interactive (can attach click handlers to individual shapes)
- •Scalable without quality loss
- •Self-contained in a single file
- •Easy to style with CSS
- •Ensures consistent text alignment and padding
Alternative Formats (Upon User Request):
Mermaid.js with Custom Handlers:
- •Use Mermaid for diagram generation via CDN
- •Add custom JavaScript for click interactivity
- •Good for complex layouts that benefit from auto-layout
- •Include CDN link:
https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js
Pure HTML/CSS without SVG (For simple linear workflows):
- •Use flexbox or grid for layout
- •Styled div elements instead of SVG shapes
- •Easier for developers less familiar with SVG
Key Implementation Details
Text Alignment and Padding:
- •All text within shapes must be center-aligned both horizontally and vertically
- •Implement equal padding around all sides of text relative to box borders
- •For SVG: Use
text-anchor="middle"anddominant-baseline="middle"attributes - •For HTML/CSS: Use
text-align: centerand flexbox/grid for vertical centering - •Ensure consistent spacing prevents text from appearing cramped or off-center
Responsive Design:
- •Center diagram in viewport
- •Use
max-widthand scaling for larger diagrams - •Adjust flyout panel to full width on mobile breakpoints
- •Ensure touch-friendly click targets (minimum 44x44px)
Data Structure:
- •Store detailed content in JavaScript data structure
- •Map each visual element to its detailed information
- •Example structure:
const workflowData = {
'step-1': {
label: 'Review Application',
details: 'Full detailed steps go here...'
},
// ... more steps
};
Keyboard Accessibility:
- •Escape key dismisses flyout panel
- •Consider Tab navigation between clickable elements
- •Focus management when panel opens/closes
Implementation Process
Follow these steps to generate the workflow diagram:
Step 0: Gather User Preferences
Before generating the diagram, use the AskUserQuestion tool to ask the user for their preferences:
- •Branding: "Do you want this diagram branded? If so, provide the URL to use."
- •Orientation: "Do you want this diagram vertically or horizontally oriented?"
- •Badges: "Do you want numeric or alphanumeric badges for each step?"
- •Format Confirmation: "This diagram will be built using HTML/CSS with inline SVG. Do you want to continue or opt for a different format?"
- •Options: "Continue with HTML/CSS with inline SVG" or "Opt for a different format"
- •If the user selects "Opt for a different format", follow up with: "Which format do you prefer?"
- •Options: "Mermaid" or "Pure HTML/CSS without SVG"
These preferences will inform the visual design and layout of the final diagram.
Step 1: Parse and Categorize
Read through the provided workflow steps and create a structured representation:
- •Identify each distinct step or action
- •Categorize as process, decision, data, or start/end
- •Extract high-level label and detailed description for each
- •Note the sequence and relationships between steps
- •Identify decision branch conditions and outcomes
Step 2: Design the Layout
Plan the visual structure:
- •Determine vertical or horizontal primary flow direction
- •Plan branch positions for decisions
- •Ensure adequate spacing between elements
- •When decision branches merge back to the main flow, ensure proper spacing to prevent arrows from overlapping boxes
- •Consider the overall diagram dimensions
- •Plan for responsive scaling if needed
Step 3: Create Concise Labels
Transform detailed descriptions into diagram labels:
- •Extract the core action or decision
- •Reduce to 2-5 words
- •Ensure clarity despite brevity
- •Use question form for decisions
- •Verify no text overflow with chosen font size
Step 4: Generate the HTML Structure
Build the HTML file:
- •Create the document structure with proper HTML5 doctype
- •Add viewport meta tag for responsive behavior
- •Embed all CSS in
<style>tags - •Build the diagram using chosen approach (SVG/HTML/Mermaid)
- •Create flyout panel HTML structure
- •Embed JavaScript with data structure and event handlers
Step 5: Implement Interactivity
Add the interactive behavior:
- •Create JavaScript object with detailed content for each element
- •Attach click event listeners to all diagram elements
- •Implement flyout panel show/hide functions
- •Add keyboard handler for Escape key
- •Implement backdrop click dismissal
- •Test all interactive elements
Step 6: Test and Validate
Ensure quality before delivering:
- •Verify all elements are clickable
- •Check that detailed information displays correctly in flyout
- •Test flyout dismissal with all methods (button, backdrop, Escape)
- •Validate color contrast ratios
- •Test responsive behavior at different viewport sizes
- •Ensure no text overflow in any element
Output Delivery
After generating the HTML file:
- •Provide the complete HTML code in a code block
- •Suggest a filename based on the workflow name (e.g.,
order-fulfillment-workflow.html) - •Include opening instructions: "Save this as [filename].html and open in any web browser"
- •Note any special features implemented (e.g., "Click any box to see detailed steps")
Best Practices
Do:
- •Keep labels concise (2-5 words)
- •Maintain high color contrast for accessibility
- •Make every element clickable with clear hover states
- •Store all detailed information for the flyout panels
- •Use standard flowchart shapes and conventions
- •Test the HTML file works standalone (no external dependencies except CDN)
- •Ensure responsive design for mobile viewing
Don't:
- •Don't use vague labels like "Process 1" or "Step A"
- •Don't rely on color alone to convey meaning
- •Don't make the diagram too large (causes scrolling fatigue)
- •Don't omit detailed information from any workflow element
- •Don't use technical jargon in labels without explanation in details
- •Don't forget keyboard accessibility (Escape key dismissal)
- •Don't create external file dependencies (keep everything embedded)
Example Transformation
Input (User Provides):
1. Customer submits order through website 2. System validates payment information 3. If payment is approved, proceed to fulfillment 4. If payment is declined, send error notification 5. Warehouse picks and packs items 6. Shipping carrier delivers order 7. Customer receives order confirmation
Output Structure:
- •Start: "Customer Order"
- •Data: "Order Form"
- •Process: "Validate Payment"
- •Decision: "Payment Approved?"
- •Process (Yes branch): "Fulfill Order"
- •Process (No branch): "Send Error Notice"
- •Process: "Pack Items"
- •Process: "Ship Order"
- •End: "Order Complete"
Each element includes detailed steps in the flyout panel, such as:
- •"Validate Payment" → Detailed: "System checks credit card number, expiration, CVV, billing address match, and available credit limit. Connects to payment gateway API and receives approval or decline response."
Summary
This skill transforms written workflow steps into polished, interactive visual diagrams. Focus on clear categorization, concise labeling, accessible design, and robust interactivity. The result should be a professional, self-contained HTML file that users can immediately open and interact with in any modern web browser.