microsim-iframe-tester
Test whether MicroSim controls (buttons, sliders, dropdowns) are fully visible inside their iframe without being clipped. Uses Playwright to load each MicroSim's main.html, measure actual content height, and compare against the iframe height declared in index.md. Use this skill whenever the user mentions iframe height testing, MicroSim visibility checking, controls being cut off, iframe sizing, or wants to verify that MicroSims render correctly at their configured heights. Also trigger when the user says things like "check if my sims fit", "are the controls visible", "test iframe heights", or "fix clipped controls".
What this skill does
# MicroSim Iframe Height Tester ## Purpose MicroSims are embedded in MkDocs pages via `<iframe>` tags with fixed heights and `scrolling="no"`. If the iframe height is too short, controls at the bottom (sliders, buttons, dropdowns) get clipped and students can't interact with them. This skill automates checking that every MicroSim's controls are fully visible at the declared iframe height. ## How It Works Always use the Python script (`scripts/test-iframe-heights.py`) — it only requires `pip install playwright` and avoids any Node.js/npm dependency. A legacy Node.js version (`scripts/test-iframe-heights.js`) exists but should not be used. The script uses Playwright to: 1. Find all MicroSim directories under `docs/sims/` 2. Read each `index.md` to extract the declared iframe height 3. Load `main.html` in a browser viewport constrained to that height 4. Wait for p5.js (or other libraries) to finish rendering controls 5. Find all interactive elements (buttons, sliders, selects, inputs, checkboxes) 6. Check whether each element's bounding box fits within the iframe height 7. Measure the actual content height needed 8. Report pass/fail with recommended height for failures ## Prerequisites ```bash pip install playwright playwright install chromium ``` ## Running the Tests ```bash # Test all MicroSims python scripts/test-iframe-heights.py --sims-dir docs/sims # Test a single MicroSim python scripts/test-iframe-heights.py --sims-dir docs/sims --sim energy-pyramid # Test with a custom height override (ignores index.md heights) python scripts/test-iframe-heights.py --sims-dir docs/sims --height 530 # Generate a markdown report python scripts/test-iframe-heights.py --sims-dir docs/sims --report report.md ``` ## Reading the Output The script outputs a table like: ``` MicroSim | Iframe Height | Content Height | Status | Suggested Height ----------------------------|---------------|----------------|--------|------------------ energy-pyramid | 532 | 528 | PASS | 532 predator-prey | 697 | 720 | FAIL | 730 greenhouse-effect | 500 | 498 | PASS | 500 ``` - **PASS**: All controls fit within the iframe height (with 5px tolerance) - **FAIL**: One or more controls extend below the iframe boundary - **Suggested Height**: The actual content height rounded up to the nearest 10px, plus a 10px safety margin. If the sim's JS file contains a `// CANVAS_HEIGHT = N` comment, that declared height is used instead of the measured content height (responsive sims can measure taller at the test viewport width than they actually render in MkDocs). ## Responsive Sims and CANVAS_HEIGHT Some p5.js sims dynamically resize their canvas based on viewport width. The test viewport (700px) may not exactly match the MkDocs content column, causing measured heights to differ from the actual embedded height. When a sim declares `// CANVAS_HEIGHT = N` in its JS file, the tester trusts that value as authoritative. **Always sanity-check suggestions for responsive sims** — if the suggested height is dramatically larger than the current iframe height, the sim likely has dynamic sizing and needs a `CANVAS_HEIGHT` declaration rather than a blind height increase. ## Fixing Failures For each failing MicroSim, update the iframe height in `index.md`: ```html <!-- Before --> <iframe src="main.html" height="500" width="100%" scrolling="no"></iframe> <!-- After — use the suggested height from the report --> <iframe src="main.html" height="540" width="100%" scrolling="no"></iframe> ``` Also update the `// CANVAS_HEIGHT:` comment in the JavaScript file if present, and any chapter markdown files that embed the same sim. ## Step-by-Step for Claude When the user asks to test iframe heights: 1. Confirm the project root contains `docs/sims/` with MicroSim directories 2. Check that `scripts/test-iframe-heights.py` exists in the skill directory at `~/.claude/skills/microsim-iframe-tester/scripts/` 3. Run `playwright install chromium` if not already installed 4. Run the Python test script from the project root 5. Present the results to the user 6. For failures, offer to update the iframe heights in the affected `index.md` files 7. If chapter markdown files also embed the failing sims, update those too
Related 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.