### Clone Visualise Skill (User-Level)
Source: https://github.com/bentossell/visualise/blob/main/README.md
Clones the Visualise agent skill repository to the user's local agents directory. This is the recommended installation method for general use.
```bash
git clone https://github.com/bentossell/visualise.git ~/.agents/skills/visualise
```
--------------------------------
### MCP Server Wrapper for Visualisation (TypeScript)
Source: https://github.com/bentossell/visualise/blob/main/references/client-implementation.md
Sets up an MCP server with tools to read markdown files based on provided modules and render visual components. It uses the '@modelcontextprotocol/sdk' and 'zod' for validation. The server listens for incoming requests after defining the 'visualizer_read_me' and 'render_visual' tools.
```typescript
import { Server } from '@modelcontextprotocol/sdk/server';
import { z } from 'zod';
import fs from 'fs';
const server = new Server({ name: 'inline-visualizer', version: '1.0.0' });
server.tool('visualizer_read_me', {
modules: z.array(z.enum(['design-system', 'diagrams', 'components', 'charts'])),
}, async ({ modules }) => {
const docs = modules.map(m =>
fs.readFileSync(`./references/${m}.md`, 'utf-8')).join('
---
');
return { content: [{ type: 'text', text: docs }] };
});
server.tool('render_visual', {
title: z.string(),
widget_code: z.string(),
}, async ({ title, widget_code }) => ({
content: [{ type: 'resource', resource: {
uri: `visual://${title}`, mimeType: 'text/html', text: widget_code
}}]
}));
server.listen();
```
--------------------------------
### Create Inline SVG Visualizations
Source: https://github.com/bentossell/visualise/blob/main/references/charts.md
Examples of lightweight, dependency-free SVG charts including a horizontal bar and a sparkline.
```svg
```
```svg
```
--------------------------------
### Streaming Support for Iframe - TypeScript
Source: https://github.com/bentossell/visualise/blob/main/references/client-implementation.md
Provides functions to manage streaming content into an iframe. `startStreaming` initializes the iframe document with CSS, `appendChunk` writes incoming data chunks, and `finishStreaming` closes the document, triggering script execution.
```typescript
function startStreaming(iframe, isDark) {
const doc = iframe.contentDocument;
doc.open();
doc.write(``);
// Leave open for appending
}
function appendChunk(iframe, chunk) {
iframe.contentDocument.write(chunk);
}
function finishStreaming(iframe) {
iframe.contentDocument.close(); // Triggers script execution
}
```
--------------------------------
### Theme CSS Generation Function (TypeScript)
Source: https://github.com/bentossell/visualise/blob/main/references/client-implementation.md
A TypeScript function that generates CSS variables for theming based on the system's dark mode preference. It defines color, font, and border-radius tokens for both dark and light themes. This function is used by the `VisualWidget` component.
```typescript
function getThemeCSS(isDark: boolean): string {
return isDark ? `
:root {
--color-text-primary: #E5E7EB;
--color-text-secondary: #9CA3AF;
--color-text-tertiary: #6B7280;
--color-text-info: #60A5FA;
--color-text-success: #34D399;
--color-text-warning: #FBBF24;
--color-text-danger: #F87171;
--color-background-primary: #1A1A1A;
--color-background-secondary: #262626;
--color-background-tertiary: #111111;
--color-border-tertiary: rgba(255,255,255,0.15);
--color-border-secondary: rgba(255,255,255,0.3);
--font-sans: system-ui, -apple-system, sans-serif;
--font-mono: 'SF Mono', Menlo, monospace;
--border-radius-md: 8px; --border-radius-lg: 12px;
}` : `
:root {
--color-text-primary: #1F2937;
--color-text-secondary: #6B7280;
--color-text-tertiary: #9CA3AF;
--color-text-info: #2563EB;
--color-text-success: #059669;
--color-text-warning: #D97706;
--color-text-danger: #DC2626;
--color-background-primary: #FFFFFF;
--color-background-secondary: #F9FAFB;
--color-background-tertiary: #F3F4F6;
--color-border-tertiary: rgba(0,0,0,0.15);
--color-border-secondary: rgba(0,0,0,0.3);
--font-sans: system-ui, -apple-system, sans-serif;
--font-mono: 'SF Mono', Menlo, monospace;
--border-radius-md: 8px; --border-radius-lg: 12px;
}`;
}
```
--------------------------------
### Detect Visualizer Output in Messages - React/JSX
Source: https://github.com/bentossell/visualise/blob/main/references/client-implementation.md
Parses chat message content to detect and separate content enclosed within '```visualizer\n...```' code fences. It splits the content and renders detected visualizer parts using a `VisualWidget` component and other content as Markdown.
```jsx
function ChatMessage({ content }) {
const parts = content.split(/```visualizer\n([\s\S]*?)```/g);
return (
{parts.map((part, i) => {
if (i % 2 === 1) {
return sendMessage(text)} />;
}
return {part};
})}
```
--------------------------------
### Build Comparison Layouts
Source: https://github.com/bentossell/visualise/blob/main/references/components.md
Creates a side-by-side card comparison view using CSS grid. Supports custom styling for recommended options via thicker borders and badges.
```html
Option A
Option B
```
--------------------------------
### Initialize D3.js Visualization
Source: https://github.com/bentossell/visualise/blob/main/references/charts.md
Boilerplate for initializing a D3.js visualization within a container element.
```html
```
--------------------------------
### Clone Visualise Skill (Project-Level)
Source: https://github.com/bentossell/visualise/blob/main/README.md
Clones the Visualise agent skill repository into the project's local agents directory. This method is suitable for project-specific integrations.
```bash
git clone https://github.com/bentossell/visualise.git .agents/skills/visualise
```
--------------------------------
### Wrap Visual Output with 'visualizer' Tag
Source: https://github.com/bentossell/visualise/blob/main/SKILL.md
Visual output should be wrapped in a code fence with the language tag `visualizer`. This allows the client to detect and route the content to the iframe renderer. The client then strips the fence and injects the content into the iframe with theme variables prepended.
```html
```visualizer
```
```
--------------------------------
### ERD Diagram Import Mermaid.js
Source: https://github.com/bentossell/visualise/blob/main/references/diagrams.md
Shows how to import the Mermaid.js library from esm.sh for generating ERD diagrams.
```javascript
import mermaid from 'esm.sh/mermaid@11';
```
--------------------------------
### Wrap Mockups in Background Surface
Source: https://github.com/bentossell/visualise/blob/main/references/components.md
Provides a container style for mobile mockups, chat threads, and modals. Uses CSS variables for background color and border radius to ensure consistent styling.
```html
```
--------------------------------
### Implement Interactive Explainer with Sliders
Source: https://github.com/bentossell/visualise/blob/main/references/components.md
Provides a control interface using range inputs to update live state displays. Uses standard HTML elements with inline styles for layout and font sizing.
```html
20
£1,000 →£3,870
```
--------------------------------
### Implement Faux Modal Viewport
Source: https://github.com/bentossell/visualise/blob/main/references/components.md
Creates a modal overlay using a faux viewport approach instead of fixed positioning. This ensures the modal is contained within its parent element while maintaining a centered layout.
```html
```
--------------------------------
### Implement Cyclic Stepper Component
Source: https://github.com/bentossell/visualise/blob/main/references/components.md
A state-driven stepper component for cyclic processes. Includes navigation buttons, a progress indicator, and JavaScript logic to cycle through content steps.
```html
```
--------------------------------
### Layout Metric Cards and Chart
Source: https://github.com/bentossell/visualise/blob/main/references/charts.md
Provides a grid layout structure for displaying metric cards above a chart container.
```html
```
--------------------------------
### Create Metric Cards for Summary Data
Source: https://github.com/bentossell/visualise/blob/main/references/components.md
Displays summary numerical data using a secondary background color without borders. Designed to be used in CSS grid layouts for clean, side-by-side metric presentation.
```html
Label
$3,870
```
--------------------------------
### SVG Container and Marker Configuration
Source: https://github.com/bentossell/visualise/blob/main/references/design-system.md
Standardized SVG structure for the Visualise project, including a responsive viewBox and a reusable arrow marker. The marker utilizes 'context-stroke' to automatically inherit the stroke color of the path it is applied to.
```svg
```
--------------------------------
### Display Data Records
Source: https://github.com/bentossell/visualise/blob/main/references/components.md
Renders a user or entity profile card with an avatar and descriptive text. Uses a raised card style with a 0.5px border and rounded corners.
```html
MR
Name
Role
```
--------------------------------
### Flowchart Two-Line Node SVG
Source: https://github.com/bentossell/visualise/blob/main/references/diagrams.md
Defines the SVG structure for a two-line node in a flowchart, accommodating a title and a subtitle within a larger rectangular shape.
```svg
TitleSubtitle
```
--------------------------------
### Prevent CSS Grid Overflow
Source: https://github.com/bentossell/visualise/blob/main/references/components.md
A CSS technique to prevent grid children from overflowing their container. By using minmax(0, 1fr) instead of 1fr, the grid tracks are allowed to shrink below their content size.
```css
.grid-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}
```
--------------------------------
### Flowchart Single-Line Node SVG
Source: https://github.com/bentossell/visualise/blob/main/references/diagrams.md
Defines the SVG structure for a single-line node in a flowchart, including its rectangular shape, text content, and an onclick event handler.
```svg
Label
```
--------------------------------
### Flowchart Arrow Path SVG
Source: https://github.com/bentossell/visualise/blob/main/references/diagrams.md
Represents an SVG path element for drawing arrows in a flowchart, utilizing a 'd' attribute for path data and a marker-end for the arrowhead.
```svg
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.