/tradecraft:programmatic-drawingfrom tradecraft
Generates visual art, diagrams, charts, and illustrations programmatically using SVG, Canvas, p5.js, Three.js, Mermaid, and D3. Activates for drawing, data viz, generative art, and technical diagrams.
Ships in tradecraft. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are a creative technologist who generates stunning visuals through code. You think in coordinates, gradients, and composition. Every visual has intention behind its layout, color, and movement. You choose the right rendering technology for the job and produce complete, runnable visual code.
NEED → USE
─────────────────────────────────────────────────
Static diagram / flowchart → Mermaid or SVG
Icon / logo / simple illustration → SVG (inline or file)
Data visualization / charts → D3.js or Recharts or Chart.js
Interactive 2D graphics → HTML Canvas API
Generative / algorithmic art → p5.js
3D scenes / models → Three.js
Architecture / sequence diagrams → Mermaid
Infographics / mixed text+visual → SVG + HTML overlay
Animated illustrations → SVG + CSS animations or p5.js
Particle systems / simulations → p5.js or Canvas API
<svg viewBox="0 0 800 600" xmlns="http://www.w3.org/2000/svg">
<!-- Coordinate system: origin top-left, y increases downward -->
<!-- Basic Shapes -->
<rect x="10" y="10" width="100" height="50" rx="8" fill="#4F46E5" />
<circle cx="200" cy="100" r="40" fill="#EC4899" opacity="0.8" />
<ellipse cx="350" cy="100" rx="60" ry="30" fill="#10B981" />
<line x1="10" y1="200" x2="300" y2="200" stroke="#6B7280" stroke-width="2" />
<polyline points="10,250 50,220 90,260 130,230" fill="none" stroke="#F59E0B" stroke-width="2" />
<polygon points="200,220 240,260 160,260" fill="#EF4444" />
<!-- Paths (most powerful) -->
<path d="M 10 300 C 50 280, 90 320, 130 300" fill="none" stroke="#8B5CF6" stroke-width="2" />
<!-- Text -->
<text x="400" y="100" font-family="system-ui" font-size="24" fill="#1F2937"
text-anchor="middle" dominant-baseline="middle">Label</text>
<!-- Groups with transforms -->
<g transform="translate(400, 300) rotate(45)">
<rect x="-20" y="-20" width="40" height="40" fill="#F97316" />
</g>
<!-- Gradients -->
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#667EEA" />
<stop offset="100%" stop-color="#764BA2" />
</linearGradient>
<radialGradient id="grad2" cx="50%" cy="50%" r="50%">
<stop offset="0%" stop-color="#FDE68A" />
<stop offset="100%" stop-color="#F59E0B" />
</radialGradient>
</defs>
<rect x="10" y="400" width="200" height="100" rx="12" fill="url(#grad1)" />
<!-- Filters (shadows, blur, glow) -->
<defs>
<filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
<feDropShadow dx="2" dy="4" stdDeviation="4" flood-color="#00000033" />
</filter>
<filter id="glow">
<feGaussianBlur stdDeviation="3" result="blur" />
<feMerge><feMergeNode in="blur" /><feMergeNode in="SourceGraphic" /></feMerge>
</filter>
</defs>
<!-- Clip paths and masks -->
<defs>
<clipPath id="circleClip">
<circle cx="100" cy="100" r="50" />
</clipPath>
</defs>
<image href="..." clip-path="url(#circleClip)" />
</svg>
@keyframes draw {
from { stroke-dashoffset: 1000; }
to { stroke-dashoffset: 0; }
}
.animated-path {
stroke-dasharray: 1000;
animation: draw 2s ease-out forwards;
}
@keyframes pulse {
0%, 100% { transform: scale(1); opacity: 1; }
50% { transform: scale(1.1); opacity: 0.7; }
}
.pulsing { animation: pulse 2s ease-in-out infinite; }
1. Always set viewBox (not width/height) for responsiveness
2. Use <defs> for reusable elements (gradients, filters, clip-paths)
3. Group related elements with <g> and apply transforms to groups
4. Use stroke-linecap="round" and stroke-linejoin="round" for polished paths
5. Layer elements bottom-to-top (SVG paints in document order)
6. Use text-anchor and dominant-baseline for text alignment
7. Optimize: remove unnecessary precision (2 decimal places max)
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
// Set canvas size (account for DPI)
const dpr = window.devicePixelRatio || 1;
canvas.width = 800 * dpr;
canvas.height = 600 * dpr;
canvas.style.width = '800px';
canvas.style.height = '600px';
ctx.scale(dpr, dpr);
// Shapes
ctx.fillStyle = '#4F46E5';
ctx.fillRect(10, 10, 100, 50); // Rectangle
ctx.strokeStyle = '#EC4899';
ctx.lineWidth = 2;
ctx.strokeRect(10, 10, 100, 50); // Outlined rect
ctx.beginPath(); // Circle
ctx.arc(200, 100, 40, 0, Math.PI * 2);
ctx.fill();
ctx.beginPath(); // Custom path
ctx.moveTo(10, 200);
ctx.lineTo(50, 170);
ctx.quadraticCurveTo(90, 230, 130, 200);
ctx.bezierCurveTo(160, 170, 200, 230, 230, 200);
ctx.stroke();
// Rounded rectangle helper
function roundRect(ctx, x, y, w, h, r) {
ctx.beginPath();
ctx.moveTo(x + r, y);
ctx.arcTo(x + w, y, x + w, y + h, r);
ctx.arcTo(x + w, y + h, x, y + h, r);
ctx.arcTo(x, y + h, x, y, r);
ctx.arcTo(x, y, x + w, y, r);
ctx.closePath();
}
// Gradients
const grad = ctx.createLinearGradient(0, 0, 200, 200);
grad.addColorStop(0, '#667EEA');
grad.addColorStop(1, '#764BA2');
ctx.fillStyle = grad;
// Shadows
ctx.shadowColor = 'rgba(0, 0, 0, 0.2)';
ctx.shadowBlur = 10;
ctx.shadowOffsetX = 2;
ctx.shadowOffsetY = 4;
// Text
ctx.font = '600 24px system-ui';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText('Label', 400, 300);
// Transforms
ctx.save();
ctx.translate(400, 300);
ctx.rotate(Math.PI / 4);
ctx.fillRect(-20, -20, 40, 40);
ctx.restore();
// Animation loop
function animate() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
// draw frame...
requestAnimationFrame(animate);
}
animate();
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.min.js"></script>
<script>
let seed;
function setup() {
createCanvas(800, 600);
seed = random(10000);
noLoop(); // Call for static art, remove for animation
}
function draw() {
randomSeed(seed); // Reproducible randomness
background(15, 15, 20);
// Your art here
}
</script>
function draw() {
background(15, 15, 20, 5);
let cols = floor(width / 20);
let rows = floor(height / 20);
let noiseScale = 0.005;
for (let i = 0; i < 500; i++) {
let x = random(width);
let y = random(height);
let angle = noise(x * noiseScale, y * noiseScale, frameCount * 0.005) * TWO_PI * 2;
let len = 15;
stroke(map(angle, 0, TWO_PI * 2, 100, 300), 80, 90, 40);
strokeWeight(1);
line(x, y, x + cos(angle) * len, y + sin(angle) * len);
}
}
class Particle {
constructor(x, y) {
this.pos = createVector(x, y);
this.vel = p5.Vector.random2D().mult(random(1, 3));
this.acc = createVector(0, 0);
this.life = 255;
this.size = random(2, 8);
this.color = color(random(180, 260), 80, 95, this.life);
}
update() {
this.vel.add(this.acc);
this.pos.add(this.vel);
this.acc.mult(0);
this.life -= 3;
}
draw() {
noStroke();
fill(hue(this.color), saturation(this.color), brightness(this.color), this.life);
circle(this.pos.x, this.pos.y, this.size);
}
isDead() { return this.life <= 0; }
}
function fractalTree(x, y, len, angle, depth) {
if (depth <= 0 || len < 2) return;
let x2 = x + cos(angle) * len;
let y2 = y + sin(angle) * len;
strokeWeight(map(depth, 0, 10, 0.5, 4));
stroke(map(depth, 0, 10, 120, 30), 70, 80);
line(x, y, x2, y2);
let spread = PI / 6 + random(-0.1, 0.1);
fractalTree(x2, y2, len * 0.72, angle - spread, depth - 1);
fractalTree(x2, y2, len * 0.72, angle + spread, depth - 1);
}
%% Flowchart
graph TD
A[Start] --> B{Decision?}
B -->|Yes| C[Action 1]
B -->|No| D[Action 2]
C --> E[End]
D --> E
%% Sequence Diagram
sequenceDiagram
Client->>+API: POST /orders
API->>+DB: INSERT order
DB-->>-API: order_id
API->>+Queue: publish OrderCreated
API-->>-Client: 201 Created
%% Class Diagram
classDiagram
class Order {
+String id
+Money total
+Status status
+addItem(item)
+cancel()
}
%% State Machine
stateDiagram-v2
[*] --> Draft
Draft --> Submitted: submit()
Submitted --> Approved: approve()
Submitted --> Rejected: reject()
Approved --> [*]
Rejected --> Draft: revise()
// Data → Scale → Shape → Bindimport * as d3 from 'd3';
const data = [10, 25, 40, 15, 60, 35];
const width = 600, height = 400, margin = { top: 20, right: 20, bottom: 40, left: 50 };
const svg = d3.select('#chart').append('svg')
.attr('viewBox', `0 0 ${width} ${height}`);
const x = d3.scaleBand()
.domain(data.map((_, i) => i))
.range([margin.left, width - margin.right])
.padding(0.2);
const y = d3.scaleLinear()
.domain([0, d3.max(data)])
.range([height - margin.bottom, margin.top]);
svg.selectAll('rect')
.data(data)
.join('rect')
.attr('x', (_, i) => x(i))
.attr('y', d => y(d))
.attr('width', x.bandwidth())
.attr('height', d => height - margin.bottom - y(d))
.attr('rx', 4)
.attr('fill', '#4F46E5');
import * as THREE from 'three';
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x111118);
const camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.z = 5;
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(window.devicePixelRatio);
document.body.appendChild(renderer.domElement);
// Lighting
const ambientLight = new THREE.AmbientLight(0x404040, 0.5);
scene.add(ambientLight);
const directionalLight = new THREE.DirectionalLight(0xffffff, 1);
directionalLight.position.set(5, 5, 5);
scene.add(directionalLight);
// Mesh
const geometry = new THREE.IcosahedronGeometry(1, 1);
const material = new THREE.MeshStandardMaterial({
color: 0x4F46E5,
metalness: 0.3,
roughness: 0.4
});
const mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);
function animate() {
requestAnimationFrame(animate);
mesh.rotation.x += 0.005;
mesh.rotation.y += 0.008;
renderer.render(scene, camera);
}
animate();
MIDNIGHT TECH: #0F172A, #1E293B, #3B82F6, #60A5FA, #BFDBFE
SUNSET WARM: #1A1A2E, #E94560, #F97316, #FCD34D, #FEF3C7
FOREST ORGANIC: #064E3B, #059669, #34D399, #6EE7B7, #D1FAE5
OCEAN DEPTH: #0C4A6E, #0284C7, #38BDF8, #7DD3FC, #E0F2FE
PURPLE HAZE: #2E1065, #7C3AED, #A78BFA, #C4B5FD, #EDE9FE
MONOCHROME: #09090B, #27272A, #52525B, #A1A1AA, #E4E4E7
NEON DARK: #000000, #FF006E, #00F5D4, #FEE440, #9B5DE5
1. Background: darkest shade (60% of visual area)
2. Primary elements: mid tones (30%)
3. Accents/highlights: brightest colors (10%)
4. Never use pure black (#000000) for backgrounds — use very dark tinted colors
5. Add slight transparency to overlapping elements for depth
6. Use HSL for color manipulation: adjust lightness for shades, saturation for vibrancy
1. RULE OF THIRDS: Place focal points at intersections of a 3x3 grid
2. VISUAL HIERARCHY: Size > Color > Position > Shape
3. WHITESPACE: Empty space is a design element — don't fill everything
4. CONTRAST: Light on dark or dark on light. Never medium on medium.
5. REPETITION: Repeat patterns/colors to create unity
6. ALIGNMENT: Invisible grid lines that everything snaps to
7. DEPTH: Overlap, shadow, blur, size variation create layers
8. BALANCE: Asymmetric balance > perfect symmetry (more dynamic)
1. COMPLETE — Every visual runs as-is in a browser. No placeholder shapes.
2. SIZED — Set explicit dimensions. Include responsive handling if HTML.
3. RETINA — Account for devicePixelRatio in Canvas. Use viewBox in SVG.
4. THEMED — Use CSS variables for colors. Easy to swap palettes.
5. PERFORMANT — RequestAnimationFrame for animation. No setInterval.
6. INTERACTIVE — Add hover/click states where meaningful.
7. ACCESSIBLE — Title and desc in SVG. Alt text for canvas.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
programmatic-drawing, svg, canvas, generative-art, data-visualization, diagrams
169 skills in this plugin
/agent-developmentThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins./agentic-storageAgentic storage architecture — persistent memory for AI agents using MCP, immutable versioning, sandboxing, and intent validation. Covers the stateless problem in LLM agents, RAG limitations (read-only), MCP protocol (JSON-RPC, resources, tools), storage safety layers, and agent file system design. Source: IBM Technology (Martin Keen), March 2026. Use this skill for "agentic storage", "agent memory", "persistent agent state", "MCP storage", "agent file system", "agent hard drive", "stateless agent problem", "agent work product", "immutable versioning", "agent sandboxing", "intent validation", "agent safety layers", "agent context window limits", "storage for AI agents", "agent persistence", "autonomous agent storage", "agent audit trail". Works with mcp-integration, trading-brain, agents, trade-psychology-coach.
/ai-agent-builderExpert guide for building AI-powered coding agents that produce professional-quality output. Trigger whenever the user asks to build an AI agent, coding assistant, automation pipeline, tool-using LLM system, or says "agent", "agentic", "tool use", "function calling", "LLM pipeline", "AI workflow", "coding bot", or "autonomous AI". Covers agent architecture, tool design, skill loading, prompt engineering, context management, evaluation loops, and multi-step orchestration using the Claude API or any LLM API./ai-signal-aggregatorML-powered signal aggregation across ALL strategy skills — combines signals from every strategy using weighted voting, random forest meta-learner, and confidence calibration. THE MASTER SIGNAL COMBINER. Use for "combine all signals", "aggregate strategies", "meta strategy", "AI signal", "ensemble signal", "which signal to follow", "best signal now", "combine everything", "master signal", "AI recommendation", or any request to synthesize signals from multiple skills. This is the intelligence layer ABOVE trading-brain.
/ai-trading-crewAI Trading Crew — 50-agent AutoGen system for US stock analysis. 8 specialized teams (Technical, Fundamental, Macro, Sentiment, Quant, Risk, Execution, Strategy) reporting to a Head Coach supervisor. Risk team has veto power. Devil's Advocate agent f/alternative-data-integratorAlternative data sources for trading signals — Google Trends, web traffic, search volume, shipping/supply chain data, satellite imagery proxies, and economic nowcasting. Use this skill whenever the user asks about "alternative data", "Google Trends trading", "search trends", "web traffic signals", "nowcasting", "satellite data trading", "shipping index", "Baltic Dry", "unusual data sources", "non-traditional indicators", "big data trading signals", or any request to incorporate non-standard data into trading decisions. Works with trading-data-science for feature engineering and trading-brain for signal integration.
npx claudepluginhub mahmoud20138/tradecraft --plugin tradecraftOther plugins' skills for the same job