/bugbook:screenshot-iterationfrom bugbook
Close the vision loop on SwiftUI work. Given a natural-language spec or reference image, this skill implements the change, builds Bugbook, drives the app to the target state, captures a real screenshot, and uses vision to compare against the spec — iterating until the UI matches. Use when the user says "make it look like this", "iterate until it matches", "screenshot this and compare", "pixel-match this design", or describes UI behavior that previously needed multiple rounds of human review to get right (expand/collapse, toggles, padding, layout). Especially useful for AppKit/SwiftUI subtleties like LazyVStack caching, NSScrollView constraints, or animation timing where Claude cannot reliably reason without visual feedback.
Ships in bugbook. 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.
Why this exists. SwiftUI and AppKit hide behavior behind invisible contracts — LazyVStack caches offscreen rows, NSScrollView has its own layout pass, animations interrupt state. Claude cannot reason about any of this without seeing the result. Past sessions burned hours on meeting-block expand/collapse because the fix got "shipped" while the visible behavior stayed wrong. This skill forces a closed loop: implement → build → observe → compare → refine. The human is out of the inner loop; they re-enter only when the spec is met or the iteration budget is exhausted.
Accept one of:
/path/to/target.pngAlso accept (optional):
collapsed, expanded, hover)If the user gave only a one-line prompt, infer states from the spec. Expand/collapse implies two states. Hover implies three. Confirm only if ambiguous.
1. Read spec + reference image (if provided)
2. Locate the SwiftUI file to edit
3. Round N:
a. Implement or refine the change
b. Build Bugbook headless
c. Launch app, drive to target state
d. Capture screenshot
e. Vision-compare screenshot vs spec/reference
f. Pass? → commit and exit. Fail? → record gaps, loop back to (a)
4. If budget exhausted → halt, report gaps, do not commit
Sequential, not parallel. Each round's screenshot becomes input for the next round's implementation.
Before editing anything, capture the current state as a screenshot. This is your "before". If the current state already matches the spec, say so and exit — no change needed. This also prevents the common failure of claiming a fix worked when the behavior was already correct.
# Build and launch current code
pkill -f "debug/Bugbook" 2>/dev/null || true
swift build 2>&1 | tail -10
.build/arm64-apple-macosx/debug/Bugbook &
sleep 3
Drive to the target state (see "Driving the App" below). Capture:
mkdir -p .screenshot-iteration/round-0
screencapture -x -R"<x,y,w,h>" .screenshot-iteration/round-0/<state>.png
# Or full window:
screencapture -x -l$(osascript -e 'tell app "Bugbook" to id of window 1') .screenshot-iteration/round-0/<state>.png
Send the baseline screenshot and the spec/reference to vision:
Read tool: .screenshot-iteration/round-0/<state>.png
Read tool: <reference image if provided>
Then ask: does the current state already match? If yes, exit clean.
Read the relevant SwiftUI file first. Match surrounding patterns — don't introduce a new style just because the task mentions a specific property. If this is round 2+, read round N-1's gap analysis and target only those gaps.
Common traps to avoid on UI work:
VStack for known-small lists, or mark the cached view with .id(...) tied to the state..frame(...) does not always propagate to the scroll view's intrinsic content size. If content clips, inspect the wrapping view hierarchy.sleep 0.5 after state transitions before screenshotting, or screenshot at both start and end.pkill -f "debug/Bugbook" 2>/dev/null || true
swift build 2>&1 | tail -20
If the build fails, fix and retry up to 3 times. After 3 build failures in one round, record it as a round failure and exit the loop with the error — don't silently move to the next round with broken code.
.build/arm64-apple-macosx/debug/Bugbook &
sleep 3
See "Driving the App" below for the state-driving playbook.
mkdir -p .screenshot-iteration/round-$N
screencapture -x -l$(osascript -e 'tell app "Bugbook" to id of window 1') .screenshot-iteration/round-$N/<state>.png
Capture all required states before comparing. If the spec has two states (collapsed, expanded), capture both in the same round.
Load the captured screenshots and the reference/spec into context:
Read: .screenshot-iteration/round-$N/collapsed.png
Read: .screenshot-iteration/round-$N/expanded.png
Read: <reference image if provided>
Then reason explicitly, not vibes. Use this template:
## Round N Comparison
Spec: <restate the spec in one sentence>
Observed:
- collapsed.png: <describe what you see>
- expanded.png: <describe what you see>
Gaps:
1. <specific gap — e.g., "transcript is visible when collapsed; spec says title only">
2. <specific gap — e.g., "expanded fade-in appears instant, not 200ms">
3. <specific gap — e.g., "title font weight is regular; spec shows semibold">
Pass: <yes / no>
If no, next-round plan: <one sentence, what to change>
This template matters because unstructured "looks close" is how rounds stack without progress.
ui: <spec in one line>. Clean up .screenshot-iteration/ or leave it for the user to inspect. Report success and exit.Getting the app to the target state is the hardest part of this skill because Bugbook has no test harness yet. Three tiers, use the simplest that works:
If the view supports a debug/preview hook that can force a state (e.g. a #if DEBUG override on the meeting block's isExpanded binding), use it. Edit the hook, build, launch, screenshot. No UI automation needed.
If no hook exists and the spec is about state-driven UI, add one as part of the implementation. A small #if DEBUG hook that reads an env var or a URL scheme is worth the rounds it saves. Mark it clearly so it doesn't ship.
osascriptUse osascript to click sidebar items, open menus, or send keystrokes. Example:
osascript -e 'tell application "Bugbook" to activate'
osascript -e 'tell application "System Events" to keystroke "k" using command down'
osascript -e 'tell application "System Events" to keystroke "meeting"'
osascript -e 'tell application "System Events" to key code 36' # return
sleep 1 # let the page open
osascript -e 'tell application "System Events" to key code 49' # space to toggle (if applicable)
sleep 0.5 # let animation settle
Assume the Command Palette (cmd+k) works for most navigation. When it doesn't, fall back to tier 3.
For anything that tier 2 can't reach (drag interactions, complex multi-click paths, hover states), request computer-use access once at skill startup and use it. Keep mouse paths short — computer-use rounds are expensive.
mcp__computer-use__request_access(
apps: ["Bugbook"],
reason: "Drive Bugbook to target UI state for visual iteration",
clipboardRead: false, clipboardWrite: false, systemKeyCombos: true
)
On pass:
.screenshot-iteration/round-0/*.png (baseline) and .screenshot-iteration/round-<N>/*.png (final)On fail (budget exhausted):
max:design-interface to pick the direction first, then come here to implement it/go.pkill -f "debug/Bugbook" before every launch so stale instances don't eat screenshots.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub max4c/bugbook --plugin bugbook10 skills in this plugin
/bbAccess your bugbook workspace — local-first notes, databases, and personal context. Use when the user wants to see their notes, tickets, databases, or personal knowledge./catchupStart-of-session orientation and review. Gets you up to speed on the project — reviews /go run results if there are any, shows what's in flight, what's blocked, and what happened since you last looked. Surfaces overnight discoveries from the knowledge loop. Writes a visual Session Brief page to Bugbook so you can review in the app. Use when the user says "catchup", "catch up", "what happened", "where are we", "what's the status", "bring me up to speed", "what did I miss", "morning review", "show me what you did", "what happened overnight", or starts a new session and wants to get oriented. Works with or without a prior /go run — it's the universal "start of session" skill./compileCompile a Bugbook workspace into an agent-navigable wiki. Reads all pages, groups them by topic, generates a root Index.md that serves as the agent's entry point, and optionally creates summary articles for each category. Reusable — run once after a bulk import, then periodically as the workspace grows. Use when the user says "compile", "build my wiki", "generate index", "organize my notes", "compile my workspace", or after running /import-obsidian./dispatchSmart parallel ticket dispatcher — analyzes file overlap across tickets, builds a dependency graph, groups tickets into conflict-free parallel lanes, and executes each lane in its own git worktree. The analysis and routing layer on top of /go. Use when the user says "dispatch tickets", "smart parallel", "parallelize these tickets", "run tickets without conflicts", "dispatch", "parallel dispatch", "multi-lane", or wants to execute multiple tickets simultaneously without merge conflicts./flowStructured agent workflow that takes a Granola transcript or written description, creates tracked projects and tickets in Bugbook, executes them sequentially with status updates, and loops on human review until clean. Use this skill whenever the user wants to start a development workflow, process a meeting transcript into tasks, break work into tickets, or says "flow", "start a flow", "process this transcript", "break this into tickets", "here's what we discussed", or pastes meeting notes. Also use when the user pastes a Granola transcript, describes a batch of work to be done, or wants to turn a planning conversation into tracked action items./goAutonomous long-running execution — works through open tickets while the user is away. Claude orchestrates, writes evals, manages queue/status, and verifies every change. Codex CLI is the default implementation worker; Claude worktree agents are the fallback for complex multi-file work. Runs sequentially by default, with safe two-ticket parallelism only when tickets touch completely different files. Use when the user says "go", "let's go", "night", "goodnight", "do everything", "work on this while I sleep", "run overnight", "keep working", "don't stop", or signals they want autonomous unattended execution.