Agent skill

Capture Usage4claude Screenshots

by f-is-h in f-is-h/Usage4Claude

Produce every Usage4Claude interface image used by the READMEs and docs.

MITAuto-check passedMobile

Install Capture Usage4claude Screenshots

skills CLI
$ npx skills add f-is-h/Usage4Claude --skill capture-usage4claude-screenshots -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install f-is-h/Usage4Claude capture-usage4claude-screenshots --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/f-is-h/Usage4Claude.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/capture-usage4claude-screenshots .claude/skills/capture-usage4claude-screenshots && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
capture-usage4claude-screenshots
GitHub stars
407
Token cost
~3k tokens
SKILL.md length
1,547 words
Files
3 (incl. scripts)
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Produce every Usage4Claude interface image used by the READMEs and docs.

  • Works in 4 steps: The entry file must be named main.swift.… → Sparkle must come from the SPM artifact.… → @main is stripped from a copy of… → …
  • Asked to refresh README images
  • SKILL.md covers Output And Where It Goes, README Integration, How The Pipeline Is Wired and Adding A Scene, plus 4 more sections
  • Runs Swift scripts from its folder; calls swift and python3

What it does

Capture Usage4claude Screenshots is an agent skill from f-is-h/Usage4Claude. Produce every Usage4Claude interface image used by the READMEs and docs. Renders the real SwiftUI views offscreen with ImageRenderer — no app launch, no screen capture, no synthetic mouse events, no Accessibility permission. Use when asked to refresh README images, add a new documented scene or language, change mock data, adjust image sizing or naming, wire images into the READMEs, or debug the renderer.

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts (for example `agents/openai.yaml`).

It sits in Mobile, covering Technical documentation and iOS development. It works with SwiftUI and macOS. The repository describes itself as: Monitor all your Claude/Codex usage limits in real-time from your macOS menu bar - supports 5-hour, 7-day, extra usage, 7-day Opus and 7-day Sonnet quotas. The licence is MIT.

When your agent uses it

  • Asked to refresh README images
  • Add a new documented scene
  • Change mock data
  • Adjust image sizing

Example prompts

  • “/capture-usage4claude-screenshots”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. The entry file must be named main.swift. Swift only allows top-level code there.
  2. Sparkle must come from the SPM artifact. MenuBarManager imports it, and the copy
  3. @main is stripped from a copy of ClaudeUsageMonitorApp.swift. The original is
  4. The binary runs from inside the app bundle (Contents/MacOS/), which is what makes

What it can do on your machine

Read from SKILL.md and the folder at commit e0030f1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Swift), which the agent can run.

    Shell commands in SKILL.md call:

    • swift
    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Capture Usage4claude Screenshots loads about 3k tokens when it runs. Until then it costs about 110 tokens; SKILL.md has 1,547 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~110
When it runs · the whole SKILL.md, loaded when a task matches
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from f-is-h/Usage4Claude at commit e0030f1, republished under its MIT licence (© f-is-h). 1,547 words, ~3,000 tokens.

Download SKILL.mdSave it as .claude/skills/capture-usage4claude-screenshots/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
capture-usage4claude-screenshots
description
Produce every Usage4Claude interface image used by the READMEs and docs. Renders the real SwiftUI views offscreen with ImageRenderer — no app launch, no screen capture, no synthetic mouse events, no Accessibility permission. Use when asked to refresh README images, add a new documented scene or language, change mock data, adjust image sizing or naming, wire images into the READMEs, or debug the renderer.

Usage4Claude Documentation Images

Everything the READMEs show of the app is rendered, not captured. scripts/render_docs_images.sh compiles the whole app plus scripts/docs-images/main.swift into a command-line tool and draws the real SwiftUI views into PNGs. It is deterministic, needs no GUI, and does not disturb whoever is using the machine.

sh
./scripts/render_docs_images.sh [output-dir]      # default: docs/images

One run emits 28 files: 7 languages × 2 scenes × light/dark. Expect a couple of minutes — the tool is rebuilt from scratch every time.

Render into a scratch directory first, look at the results, and only then write to docs/images/. Never overwrite the committed images with an unreviewed batch.

Output And Where It Goes

All images live in docs/images/.

FileSizeUsed by
hero.<lang>.<variant>@2x.png950×348ptREADME first screen
settings.display.<lang>.<variant>@2x.png540×1244pt (CJK) / 540×1257pt (Latin)README interface section
  • <lang> is en, ja, zh-CN, zh-TW, ko, fr, de. These follow the existing docs/images and README.zh-CN.md spelling and deliberately differ from AppLanguage's raw values (zh-Hans, zh-Hant). The mapping lives in docsLanguageCode.
  • <variant> is light or dark.
  • @2x matches renderer.scale = 2; always display at the logical point width so the image stays crisp without being upscaled.
  • Settings heights differ by language because the descriptions wrap differently. That is expected; do not treat it as a defect.

Path references differ by README: the root README.md uses docs/images/…, while docs/README.<lang>.md uses images/….

README Integration

Pair the variants and let the browser pick:

html
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="images/hero.zh-CN.dark@2x.png">
  <img src="images/hero.zh-CN.light@2x.png" width="948" alt="Usage4Claude">
</picture>

GitHub's README content area is about 948px wide inside the 1012px container.

  • Hero: width="948", at the very top, in place of a large app icon. The icon already appears twice inside the image; repeating it above only pushes the product below the fold.
  • Settings: width="500". The page renders full height (~1250pt) rather than being clipped to the real 550pt window, so every card is visible — including ones a user would have to scroll for. Narrower than 500 makes the body text too small to read.

To preview, serve a mock README page over HTTP (python3 -m http.server) and open it in the browser pane. file:// renders as a static snapshot that page tools cannot drive. Check dark mode in that page, never from the standalone PNG.

How The Pipeline Is Wired

Four non-obvious things make it work; breaking any one yields blank or broken output.

  1. The entry file must be named main.swift. Swift only allows top-level code there.
  2. Sparkle must come from the SPM artifact. MenuBarManager imports it, and the copy embedded in Usage4Claude.app/Contents/Frameworks has its Headers/Modules stripped by Xcode. The script globs DerivedData for Sparkle.xcframework/macos-arm64_x86_64.
  3. @main is stripped from a copy of ClaudeUsageMonitorApp.swift. The original is never modified.
  4. The binary runs from inside the app bundle (Contents/MacOS/), which is what makes Bundle.main resolve to the app so Assets.xcassets and the seven .lproj folders load.

The script picks the app bundle by modification time, and rebuilds when any source is newer than the binary. Do not change this to sort by name: build/ accumulates version directories, the alphabetically last one is not necessarily the newest, and rendering against a stale bundle silently produces images with outdated strings and assets.

Adding A Scene

In scripts/docs-images/main.swift, inside the language loop:

  1. Add mock data to MockUsage if needed (see the data rules).
  2. Set UserSettings.shared to the state the scene needs.
  3. Render to a bitmap with renderImage(...) immediately, before touching settings again.
  4. Compose and write(...) with the <name>.<code>.<variant>@2x.png convention.

Reset any setting the previous scene changed. Scenes run in sequence and share one UserSettings, so a scene that forgets to reset inherits the last one's state.

Adding a language means extending docsLanguageCode and heroLabels. The hero captions live in the renderer, not in the app's Localizable.strings — that file is for strings the UI actually shows.

Pitfalls

Each of these cost real debugging time.

Views read settings lazily

SwiftUI views read UserSettings.shared when they render, not when they are constructed. Building two views under different settings and rendering them together makes both use whatever is in effect at render time — the first side-by-side hero came out with two pace graphs for this reason. Always renderImage(...) per scene, then compose bitmaps.

Never judge a render from a standalone PNG thumbnail

Dark-variant PNGs are transparent and draw white content; viewers composite transparency onto white, so white text, hairlines and the monochrome icon all look missing. Small elements are just as deceptive — a 20pt icon in a 950pt canvas is easy to misread. This produced several rounds of chasing bugs that did not exist.

Use the bundled previewer before concluding anything is wrong. It needs no dependencies — this is a Swift repo, swift runs a single file directly. Do not install Pillow or ImageMagick for this.

sh
S=.agents/skills/capture-usage4claude-screenshots/scripts/preview_on_background.swift

# whole image on GitHub's dark background (use ffffff for light)
swift $S docs/images/hero.zh-CN.dark@2x.png /tmp/check.png 0d1117

# top 50pt only, enlarged 3x — for the menu bar icon and other small elements
swift $S docs/images/hero.zh-CN.dark@2x.png /tmp/check.png 0d1117 50
ImageRenderer cannot draw AppKit-backed controls

They render as a yellow "unsupported" block. Usage4Claude/Helpers/DocsRenderMode.swift holds the stand-ins, all inert in the shipping app:

  • DocsRenderMode.isActive — the flag.
  • DocsScrollView — ScrollView renders its content as blank, with no error. Out of scroll mode the content lays out fully and the enclosing frame clips it.
  • DocsSegmentedPicker — replaces .pickerStyle(.segmented). Size it to its content; NSSegmentedControl does not stretch to fill the row.
  • UsageDetailView.menuButtonLabel(rotated:) — replaces the three-dot Menu.

When writing a stand-in, copy what the control looks like on screen, not what its source says. That Menu label carries .rotationEffect(.degrees(90)) which AppKit ignores, so the replica must not rotate.

SettingsView also drops its fixed height under DocsRenderMode so the whole page renders.

Show full SKILL.md (664 more words)Show less
Monochrome menu bar icons need two fixes

The template icon is an alpha mask and the app leaves tinting to macOS. Offscreen there is no system tinting, and the mask mixes two colour sources: rings use dynamic NSColor.labelColor, digits use a hardcoded NSColor.black. Under a dark appearance the rings turn white while the digits stay black.

Both halves are required:

  • Generate with NSApp.appearance pinned to .aqua (monochromeMenuBarIcon) for a uniformly black mask.
  • Tint in SwiftUI with .renderingMode(.template) + foregroundStyle.

colorInvert() flips opaque regions too and turns the rings into solid blocks. Tinting the NSImage itself (lockFocus + sourceAtop, or rebuilding a bitmap rep) yields an image that exports to PNG correctly but renders empty through SwiftUI.

Shadows belong on an opaque background shape

Applying .shadow to content shadows every element in it. With a transparent content area each card, radio dot and checkbox casts its own shadow and the window reads as several floating pieces. WindowChrome paints an opaque window background and puts the shadow on the shape behind it; PopoverChrome draws the arrow and card as one Shape for the same reason — separate views let the shadow trace the arrow's slanted edges.

The dual-provider layout needs debug mode

isMultiProviderActive normally requires real accounts for both providers. Under DEBUG it also accepts debugModeEnabled == true plus a custom display set containing both providers' limit types. Use that instead of faking credentials.

The renderer shares the real app's UserDefaults

Bundle.main is the app bundle, so the process reads and writes the release app's preference domain. Every setting it touches is snapshotted and restored in a defer; add new settings to that tuple or the user's app is left in screenshot state.

Light/dark is pinned with -AppleInterfaceStyle Light|Dark on the command line instead of being written. NSArgumentDomain outranks everything and never touches disk, so output does not depend on the machine's current appearance.

Mock Data Rules

Numbers are chosen, not arbitrary. They live in MockUsage.

  • The pace graph must demonstrate itself. Its x axis is elapsed window time and the diagonal is an even burn rate, so put one point clearly above the diagonal and one clearly below, separated horizontally. resetsAt drives x: elapsedRatio = 1 - remaining / window.
  • Vary the percentages. A column of identical numbers reads as unfilled placeholder data.
  • Anchor reset times to the current hour (MockUsage.anchor). Using Date() directly makes the minutes differ on every run, so every re-render produces a meaningless diff. Renders within the same hour are identical; across hours they still differ. Pinning it completely would need the views to pass an injected now down to UsagePaceGraphMath — the parameter exists, the views just do not use it.
  • Codex's 7-day reset is deliberately off the hour. That window comes from reset_after_seconds so it lands on an arbitrary minute, and the UI formats it with minute precision while Claude's hour-precision resets_at does not. A round :00 there looks like an inconsistent format.

Scene Inventory

Hero — two groups side by side in one PNG, each a menu bar icon between two hairlines with the popover hanging below. Left: Claude, ring graph, colour menu bar icon with app icon. Right: Claude + Codex, pace graph, monochrome icon, percentages only. The pair carries the caption text.

No wallpaper, no clock, no traffic lights, no fake system chrome anywhere — it ages badly and this is a product illustration, not a screen capture. The only synthetic parts are the hairlines and the popover/window chrome that AppKit would otherwise provide.

Settings — the Display tab at full height, in WindowChrome. Reset the settings to a representative default first (colour theme, icon + percentage, medium size, smart display, ring graph); otherwise the shot inherits the hero's monochrome/pace state.

Retired

scripts/ in this skill now holds only preview_on_background.swift. The CleanShot capture flow that used to live here is gone, along with capture_usage4claude_window.sh, capture_current_display_all_languages.sh, apply_scenario.sh and apply_reference_debug_values.sh. It drove the real cursor, needed Accessibility permission for the agent process, and was fragile by its own admission. If a scene is missing, extend the renderer rather than reviving it.

© f-is-h, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts) in .agents/skills/capture-usage4claude-screenshots of f-is-h/Usage4Claude.

  • SKILL.md
  • agents/openai.yaml
  • scripts/preview_on_background.swift

Open the folder on GitHubat commit e0030f1

Compare with similar skills

Capture Usage4claude Screenshots next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Capture Usage4claude Screenshots compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Capture Usage4claude Screenshots this skillf-is-h/Usage4Claude407—~3kAutomated safety check: PassMIT
macOS DevelopmentKartikLabhshetwar/better-shot2.4k2 repos~735Automated safety check: PassCustom licence
Code ReviewRobertoMachorro/Moped115—~2.1kAutomated safety check: PassGPL-3.0
Swiftui Debuggingst0012/cctop154—~2kAutomated safety check: PassMIT
Swift ExpertJeffallan/claude-skills12k—~1.5kAutomated safety check: PassMIT
macOS View Refactorrobinebers/openusage4.3k—~1.4kAutomated safety check: PassMIT

Similar skills

  • macOS Development

    KartikLabhshetwar/better-shot

    Comprehensive macOS development guidance including Swift 6+, SwiftUI, SwiftData, architecture patterns, AppKit bridging, and macOS 26 Tahoe APIs.

    2.4k GitHub starsUsed in 2 repos~735 tokens
    MobileAuto-check passed
  • Code Review

    RobertoMachorro/Moped

    Review guidance for Moped, a sandboxed macOS SwiftUI text editor with a homegrown TextKit 1 editor core in the local MopedEditor package.

    115 GitHub stars~2.1k tokensUpdated 5 days ago
    MobileAuto-check passed
  • Swiftui Debugging

    st0012/cctop

    A skill your agent uses when debugging SwiftUI issues in this macOS app — views not updating, layout problems, unnecessary re-renders, state ownership bugs, Preview crashes, or NSHostingView/NSPanel…

    154 GitHub stars~2k tokensUpdated 9 days ago
    MobileAuto-check passed
  • Swift Expert

    Jeffallan/claude-skills

    Builds Swift apps for Apple platforms with SwiftUI, protocol-oriented design, async/await, actors and Sendable checks, verified with swift build and swift test.

    12k GitHub stars~1.5k tokensUpdated 6 days ago
    MobileAuto-check passed
  • macOS View Refactor

    robinebers/openusage

    Refactor macOS SwiftUI views and scenes into stable structure.

    4.3k GitHub stars~1.4k tokensUpdated today
    MobileAuto-check passed
  • View Refactor

    robinebers/openusage

    Refactor macOS SwiftUI views and scenes with strong defaults for small dedicated subviews, stable sidebar and selection structure, explicit command and toolbar ownership, scene-aware state, and…

    4.3k GitHub stars~1.4k tokensUpdated today
    MobileAuto-check passed

More from f-is-h/Usage4Claude

  • Release

    f-is-h/Usage4Claude

    发布 Usage4Claude 新版本时使用。当用户说“发布新版本 / 发版 / 出新版 / release / 打 tag 发布 / 准备发版材料”等,用本 skill 引导完成从收集变更、编写 CHANGELOG 与 RELEASENOTES、更新版本号、编译验证,到发版 commit、CI 自动发布的完整流程。

    407 GitHub stars~1.9k tokensUpdated 11 days ago
    Auto-check passed

Works with

Questions about Capture Usage4claude Screenshots

What does Capture Usage4claude Screenshots do?

Produce every Usage4Claude interface image used by the READMEs and docs. Capture Usage4claude Screenshots is an agent skill from f-is-h/Usage4Claude. Produce every Usage4Claude interface image used by the READMEs and docs.

When should I use Capture Usage4claude Screenshots?

Capture Usage4claude Screenshots fits situations like: asked to refresh README images; add a new documented scene; change mock data; adjust image sizing.

How do I install Capture Usage4claude Screenshots in Claude Code?

Run `npx skills add f-is-h/Usage4Claude --skill capture-usage4claude-screenshots -a claude-code`. Or copy the skill folder (.agents/skills/capture-usage4claude-screenshots in f-is-h/Usage4Claude) into .claude/skills/capture-usage4claude-screenshots in your project. Claude Code loads it when a task matches its description.

How do I install Capture Usage4claude Screenshots in Codex?

Run `npx skills add f-is-h/Usage4Claude --skill capture-usage4claude-screenshots -a codex`. Or copy the skill folder (.agents/skills/capture-usage4claude-screenshots in f-is-h/Usage4Claude) into .agents/skills/capture-usage4claude-screenshots in your project. Codex loads it when a task matches its description.

Can I use Capture Usage4claude Screenshots in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add f-is-h/Usage4Claude --skill capture-usage4claude-screenshots -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/capture-usage4claude-screenshots, .gemini/skills/capture-usage4claude-screenshots, .github/skills/capture-usage4claude-screenshots and .opencode/skills/capture-usage4claude-screenshots in your project.

What does Capture Usage4claude Screenshots need to run?

Going by SKILL.md and its folder, Capture Usage4claude Screenshots needs Swift for the scripts in its folder and the command-line tools its instructions call (swift and python3). Our summary lists: Python 3.

Does Capture Usage4claude Screenshots access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Capture Usage4claude Screenshots safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Capture Usage4claude Screenshots use?

Capture Usage4claude Screenshots is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Capture Usage4claude Screenshots use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Capture Usage4claude Screenshots?

Skills that share tags, products or a category with Capture Usage4claude Screenshots: macOS Development (KartikLabhshetwar/better-shot, 2.4k stars), Code Review (RobertoMachorro/Moped, 115 stars), Swiftui Debugging (st0012/cctop, 154 stars) and Swift Expert (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Capture Usage4claude Screenshots?

f-is-h (a GitHub user) maintains it in f-is-h/Usage4Claude, which has 407 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on September 29, 2026.

Source: f-is-h/Usage4Claude on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.