AGENT SKILL

compare

Orchestrate a before/after screenshot (or video) comparison across two branches — typically a PR's base branch and its compare branch, each served by its own already-running dev server. Resolves the two URLs to capture (from `.claude/settings.json` config or explicit overrides), delegates the actual capture to `screen-capture:capture` once per URL, and delegates upload/PR-comment formatting to `screen-capture:attach`. ALWAYS invoke this skill first when asked to "make a before/after comparison", "compare rendered output between branches", "show reviewers my UI change" or "verify a visual change against main", even when the config looks incomplete: it knows the config keys and the `--before`/`--after` overrides, and what to do when a URL is missing.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 1
Forks
0

01 前言 Front Matter

name
compare
license
MIT
metadata
{ "version": "0.1.0" }
description
Orchestrate a before/after screenshot (or video) comparison across two branches — typically a PR's base branch and its compare branch, each served by its own already-running dev server. Resolves the two URLs to capture (from `.claude/settings.json` config or explicit overrides), delegates the actual capture to `screen-capture:capture` once per URL, and delegates upload/PR-comment formatting to `screen-capture:attach`. ALWAYS invoke this skill first when asked to "make a before/after comparison", "compare rendered output between branches", "show reviewers my UI change" or "verify a visual change against main", even when the config looks incomplete: it knows the config keys and the `--before`/`--after` overrides, and what to do when a URL is missing.

03 SKILL.md 正文

compare

Contract

  • Input: two reachable URLs, either an explicit --before/--after pair or ones resolved from .claude/settings.json, each already served by a running dev server.
  • Output: a before/after comparison posted through screen-capture:attach, built from one screen-capture:capture per URL.
  • Does not: start a dev server, drive a browser, or talk to GitHub directly.

This skill resolves which two URLs to capture and orchestrates the two downstream skills that do the actual work. It does not talk to a browser itself (that's screen-capture:capture) and does not talk to GitHub itself (that's screen-capture:attach).

Precondition: dev servers are the caller's job

This skill never starts a dev server. Both the base-branch and compare-branch URLs must already be reachable before this skill runs — if neither resolves (see below), stop and tell the caller to start the relevant server(s) rather than launching one yourself.

A typical worktree-based setup runs one dev server per checkout, each on its own port: the main checkout serves the base branch (e.g. main) and a PR worktree serves the compare branch. The dev_server_command / compare_dev_server_command config keys below exist to document, for whoever's driving this skill, which command brings up which side — this skill reads them for that documentation purpose only and never executes them.

Resolving the two URLs

Two ways to get a "before" URL and an "after" URL, in this order:

  1. Explicit override. A --before <url> / --after <url> pair passed to this skill always wins, whole pair at a time — this is also the only path when there is no .claude/settings.json, or config is ambiguous (e.g. only one of base_url / compare_base_url is set).
  2. Auto-detect from config. If both --before and --after are omitted, read screenCapture.base_url (before) and screenCapture.compare_base_url (after) from the repo's .claude/settings.json. Both must be present and non-empty to count as resolved; if only one is set, treat config as ambiguous and fall back to requiring explicit --before/--after instead of guessing the other.

If, after both steps, either URL is still unresolved: stop and ask the caller to either add the missing screenCapture key(s) to .claude/settings.json or pass --before/--after directly. Do not default to localhost with a guessed port.

Config keys (.claude/settings.json → screenCapture)

Key Read by Meaning
base_url this skill URL to capture for "before" (base branch)
compare_base_url this skill URL to capture for "after" (compare branch)
dev_server_command caller (documentation only) Command that serves the base branch at base_url
compare_dev_server_command caller (documentation only) Command that serves the compare branch at compare_base_url

Example:

{
  "screenCapture": {
    "base_url": "http://localhost:5173",
    "compare_base_url": "http://localhost:5174",
    "dev_server_command": "npm run dev",
    "compare_dev_server_command": "npm run dev -- --port 5174"
  }
}

Only base_url/compare_base_url change this skill's behavior; the two *_command keys are read solely to surface in error/status messages so a human or calling agent knows which command to run when a URL isn't up yet.

Delegation flow

Once both URLs are resolved:

  1. Call screen-capture:capture once per URL (before, then after), passing through any shared route/viewport/output-type params so both captures are directly comparable (same page, same viewport, same output type).
  2. Call screen-capture:attach with both resulting files to handle upload and before/after comment formatting — this skill does not touch GitHub or any other target directly.

What this skill does not do

  • Does not start, stop, or health-check dev servers.
  • Does not decide whether a visual diff is required for a given PR (that's project policy, not this skill).
  • Does not upload or post anywhere — that's entirely screen-capture:attach.

04 同仓库更多 Skills

dfadler
dfadler/agent-config

youtube-transcript

ALWAYS invoke before fetching a transcript, captions or description for a YouTube video, even when only asked how you would get them. Given a YouTube URL (youtube.com/watch, youtu.be, shorts), save the video's English auto-captions as plain text and its description to files with `yt-dlp`, and print the title, channel and duration. Use when asked to "get the transcript for this video", "grab the captions", "summarize this YouTube video", "put these videos' transcripts in an artifact", or when a YouTube link is pasted and its spoken content is needed. Do not drive the browser's transcript panel or try `youtube-transcript-api` first: both were tried and are slower or empty.

★ 1
dfadler
dfadler/agent-config

git-worktree-usage

Load this before pushing to, or opening a PR from, a branch whose earlier PR already merged (a squash merge leaves its commits off the default branch, so a new PR from it shows stale history), even when only advising: it defines the fresh-branch and cherry-pick fix. Create worktrees with the `EnterWorktree` tool, never raw `git worktree add`. Git worktree and branch mechanics for isolating non-trivial work: locking and the stale-worktree sweep, picking what to parallelize by file surface, the repo-wide `git stash` collision hazard and its `git restore` alternative, branch naming, catching a branch up to a moved `main` via merge (not rebase), CI/coverage gotchas after a merge, conflict-resolution escalation levels, and PR-splitting sequencing. Also ships two SessionStart hooks that self-heal a project's own symlinked-worktree-directory convention and auto-prune merged worktrees, and a commit-branch guard hook that asks before a git commit lands on the default or an unrelated checked-out branch. Use when creating, entering, or cleaning up a git worktree, including before starting work in an existing worktree that another session may be using; deciding how to parallelize agent sessions across a repo; hitting a `git stash` collision between sessions; resolving a merge/rebase conflict; splitting an already-written diff into multiple PRs; or a stale or wrongly-linked worktree directory needs diagnosing. Do not use for a plain `git stash` in a single clone with no other worktrees or sessions, for rewriting an unpushed branch's history, or for running commands in a worktree the user just created.

★ 1
dfadler
dfadler/agent-config

url-to-audio

ALWAYS invoke before answering any request to narrate or convert a URL or article to audio, even when only asked what you would do or which backend you would use (including when `OPENAI_API_KEY` is unset and the fallback is `say`). Turn a web article into a narrated audio file: fetch the page, extract the clean reading text, and synthesize it with macOS `say` by default (free, local, already installed, no API key) or OpenAI TTS optionally (when `OPENAI_API_KEY` is set and a `say` voice isn't good enough). Voice and speed are configurable per call, with env var defaults. Produces a `.m4a`/`.mp3` file at a predictable path and prints it. Use when asked to "read this article to me", "convert this page/URL to audio", "make an audio version of this link", or "text-to-speech this article" — including when asked only for the commands or plan, or when `OPENAI_API_KEY` is unset.

★ 1
dfadler
dfadler/agent-config

subagent-orchestration

Use FIRST, before answering or planning, whenever the user hands over a list of two or more separate tasks ("do A, B and C", numbered or in no order) that each need real exploration, even if they only ask how you would tackle them: it triages which can run as parallel sub-agents and which must stay serial. Also use when asked how to configure a sub-agent already chosen for a large search or exploration (agent type, model tier), and when about to spawn a sub-agent, fan out with the Workflow tool, or run a task that would put large tool output (more than ~50 lines, or ~3 file reads) into the main context. Routes the work to the main context, a single Agent call, or a Workflow; defines the compact handback a delegated agent should return; and picks the model tier. Use for "should I delegate this", "which agent do I use", or "keep my context small".

★ 1
dfadler
dfadler/agent-config

config

Internal primitive that reads YAML frontmatter from vault config files via mcp__obsidian__* tools, and returns it as merged key-value data. Not a user-facing slash command — this skill is never triggered by a user request directly; other agent-config skills (screen-capture, and second-brain's own capture/query skills) invoke it to load their own settings. Degrades to an empty config, never a hard failure, when the Obsidian MCP is disconnected or the config file doesn't exist. Parse `$ARGUMENTS` as `<skill-name> [project-name]`.

★ 1
dfadler
dfadler/agent-config

lighthouse

Run a Lighthouse CLI pass (mobile + desktop) against a URL and store the results in the second-brain vault under knowledge/lighthouse/<project>/. ALWAYS invoke this skill first when asked to run, repeat or script a Lighthouse pass or performance/accessibility audit against a URL, before writing any `lighthouse` command, including when the config disables it (it defines the no-op behaviour). Complements, not replaces, a manual responsive resize-and-look pass. Not for advice about fixing a Lighthouse finding. Config-driven: which form factors run, whether the skill runs at all, and where results land are all controlled by lighthouse_enabled, lighthouse_form_factors, and lighthouse_output_dir.

★ 1