aspect-ratio-grid
Display the same image across multiple social platform aspect ratios with per-platform download and crop-vs-outpaint comparison. Use this skill when the user says "show platform formats", "aspect ratio grid", "multi-format preview", "reformat results", or "platform image grid".
What this skill does
# Aspect Ratio Grid Skill
Responsive grid that renders the same image in every social platform format. Each card shows the platform label, pixel dimensions, live status (pending / generating / done / error), a draggable before/after comparison slider, safe zone overlay, and per-platform download + regenerate actions.
## Prerequisites
- Next.js App Router (no `src/` directory)
- `@/lib/platform-specs` — exports `getPlatform(id)` and `PlatformId` (from the `platform-specs` skill)
- shadcn/ui with Switch and Button components
- `@phosphor-icons/react`
## Installation
No new packages required. Install shadcn components if not already present:
```bash
bunx shadcn@latest add switch button
bun add @phosphor-icons/react
```
## What Gets Created
```
components/aspect-ratio-grid/aspect-ratio-grid.tsx
components/aspect-ratio-grid/aspect-ratio-card.tsx
```
## Setup Steps
### Step 1: Create `components/aspect-ratio-grid/aspect-ratio-card.tsx`
```typescript
"use client";
import { useId, useRef, useState } from "react";
import { DownloadSimple, ArrowsClockwise } from "@phosphor-icons/react";
import type { PlatformId } from "@/lib/platform-specs";
import { getPlatform } from "@/lib/platform-specs";
export type ImageVariant = {
platformId: PlatformId;
url: string;
originalUrl?: string;
status: "pending" | "generating" | "done" | "error";
error?: string;
};
type AspectRatioCardProps = {
variant: ImageVariant;
showComparison: boolean;
onDownload?: (variant: ImageVariant) => void;
onRegenerate?: (platformId: PlatformId) => void;
};
export function AspectRatioCard({
variant,
showComparison,
onDownload,
onRegenerate,
}: AspectRatioCardProps) {
const spec = getPlatform(variant.platformId);
const sliderContainerId = useId();
const containerRef = useRef<HTMLDivElement>(null);
const [sliderX, setSliderX] = useState(50); // percentage
const canCompare =
showComparison &&
variant.status === "done" &&
Boolean(variant.originalUrl);
function updateSlider(clientX: number) {
if (!containerRef.current) return;
const rect = containerRef.current.getBoundingClientRect();
const pct = Math.min(
100,
Math.max(0, ((clientX - rect.left) / rect.width) * 100)
);
setSliderX(pct);
}
function handleMouseMove(e: React.MouseEvent<HTMLDivElement>) {
if (!canCompare) return;
updateSlider(e.clientX);
}
function handleTouchMove(e: React.TouchEvent<HTMLDivElement>) {
if (!canCompare) return;
const touch = e.touches[0];
if (touch) updateSlider(touch.clientX);
}
const safeZoneStyle: React.CSSProperties | undefined =
spec.safeZone && variant.status === "done"
? {
position: "absolute",
insetTop: `${(spec.safeZone.top / spec.height) * 100}%`,
insetBottom: `${(spec.safeZone.bottom / spec.height) * 100}%`,
insetLeft: `${(spec.safeZone.left / spec.width) * 100}%`,
insetRight: `${(spec.safeZone.right / spec.width) * 100}%`,
border: "1.5px dashed rgba(255,255,255,0.6)",
borderRadius: 2,
pointerEvents: "none",
}
: undefined;
return (
<div className="flex flex-col gap-2 rounded-lg border border-border bg-card p-3">
{/* Header */}
<div className="flex items-center justify-between gap-2">
<span className="text-xs font-semibold text-foreground">
{spec.label}
</span>
<span className="rounded-full bg-muted px-2 py-0.5 text-[10px] text-muted-foreground">
{spec.width}×{spec.height}
</span>
</div>
{/* Image container */}
<div
id={sliderContainerId}
ref={containerRef}
className="relative overflow-hidden rounded"
style={{ aspectRatio: `${spec.width}/${spec.height}` }}
onMouseMove={handleMouseMove}
onTouchMove={handleTouchMove}
>
{variant.status === "pending" && (
<div className="flex h-full w-full items-center justify-center bg-muted">
<span className="text-xs text-muted-foreground">{spec.label}</span>
</div>
)}
{variant.status === "generating" && (
<div className="h-full w-full animate-pulse bg-muted" />
)}
{variant.status === "done" && (
<>
{canCompare && variant.originalUrl ? (
<>
{/* Original image clipped to left side */}
<img
src={variant.originalUrl}
alt={`${spec.label} original`}
className="absolute inset-0 h-full w-full object-cover"
style={{
clipPath: `polygon(0 0, ${sliderX}% 0, ${sliderX}% 100%, 0 100%)`,
}}
/>
{/* Generated image clipped to right side */}
<img
src={variant.url}
alt={spec.label}
className="absolute inset-0 h-full w-full object-cover"
style={{
clipPath: `polygon(${sliderX}% 0, 100% 0, 100% 100%, ${sliderX}% 100%)`,
}}
/>
{/* Divider line */}
<div
className="absolute inset-y-0 w-px bg-white shadow-md"
style={{ left: `${sliderX}%`, transform: "translateX(-50%)" }}
/>
</>
) : (
<img
src={variant.url}
alt={spec.label}
className="h-full w-full object-cover"
/>
)}
{/* Safe zone overlay */}
{safeZoneStyle && <div style={safeZoneStyle} />}
</>
)}
{variant.status === "error" && (
<div className="flex h-full w-full flex-col items-center justify-center gap-2 rounded border border-destructive/40 bg-destructive/10 p-2">
<span className="text-center text-[10px] text-destructive">
{variant.error ?? "Generation failed"}
</span>
{onRegenerate && (
<button
type="button"
onClick={() => onRegenerate(variant.platformId)}
className="rounded bg-destructive px-2 py-1 text-[10px] font-medium text-destructive-foreground hover:bg-destructive/90"
>
Retry
</button>
)}
</div>
)}
</div>
{/* Footer actions */}
<div className="flex items-center justify-end gap-1">
{variant.status === "done" && (
<a
href={variant.url}
download
onClick={() => onDownload?.(variant)}
className="inline-flex h-7 w-7 items-center justify-center rounded hover:bg-muted"
aria-label={`Download ${spec.label}`}
>
<DownloadSimple size={15} className="text-muted-foreground" />
</a>
)}
{onRegenerate && variant.status !== "generating" && (
<button
type="button"
onClick={() => onRegenerate(variant.platformId)}
className="inline-flex h-7 w-7 items-center justify-center rounded hover:bg-muted"
aria-label={`Regenerate ${spec.label}`}
>
<ArrowsClockwise size={15} className="text-muted-foreground" />
</button>
)}
</div>
</div>
);
}
```
### Step 2: Create `components/aspect-ratio-grid/aspect-ratio-grid.tsx`
```typescript
"use client";
import { useId, useState } from "react";
import { Button } from "@/components/ui/button";
import { Switch } from "@/components/ui/switch";
import { Label } from "@/components/ui/label";
import { cn } from "@/lib/utils";
import {
AspectRatioCard,
type ImageVariant,
} from "./aspect-ratio-card";
import type { PlatformId } from "@/lib/platform-specs";
type AspectRatioGridProps = {
variants: ImageVariant[];
onDownload?: (variant: ImaRelated in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.