Agent skill

Image Visual Check

by jjjkkkjjj in jjjkkkjjj/Matft

Procedure for adding tests for Matft's image processing (Matft.image., indexing or channel swapping on images, etc.), generating comparison images that put the result next to an OpenCV reference…

BSD-3-ClauseAuto-check passedDevelopment

Install Image Visual Check

skills CLI
$ npx skills add jjjkkkjjj/Matft --skill image-visual-check -a claude-code

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

GitHub CLI
$ gh skill install jjjkkkjjj/Matft image-visual-check --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/jjjkkkjjj/Matft.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/image-visual-check .claude/skills/image-visual-check && 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
image-visual-check
GitHub stars
147
Token cost
~2.3k tokens
SKILL.md length
1,018 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Procedure for adding tests for Matft's image processing (Matft.image., indexing or channel swapping on images, etc.), generating comparison images that put the result next to an OpenCV reference…

  • Works in 8 steps: Pre-checks → Write the test (Red) → Register the OpenCV version → …
  • The conversation is about adding
  • SKILL.md covers How it works, 0. Pre-checks, 1. Write the test (Red) and 2. Register the OpenCV version, plus 5 more sections
  • Calls swift, python3 and pip3

What it does

Image Visual Check is an agent skill from jjjkkkjjj/Matft. Procedure for adding tests for Matft's image processing (Matft.image., indexing or channel swapping on images, etc.), generating comparison images that put the result next to an OpenCV reference, and visually checking that the conversion is correct. Use this skill whenever the conversation is about adding, fixing, testing, or checking Matft features that handle images — e.g. "add an image processing test", "visually check resize / warpAffine / color", "see if the image is converted correctly", "compare with…

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering iOS development and Technical documentation. It works with OpenCV, NumPy and Python. The repository describes itself as: Numpy-like library in swift. (Multi-dimensional Array, ndarray, matrix and vector library). The licence is BSD-3-Clause.

When your agent uses it

  • The conversation is about adding
  • Checking Matft features that handle images — e.g

Example prompts

  • “add an image processing test”
  • “visually check resize / warpAffine / color”
  • “see if the image is converted correctly”
  • “/image-visual-check”

Requirements

  • Python 3

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Pre-checks
  2. Write the test (Red)
  3. Register the OpenCV version
  4. Implement and pass the test (Green)
  5. Generate the comparison images
  6. Visual check (Claude)
  7. Show the user and report
  8. Commit (only when the user tells you to)

What it can do on your machine

Read from SKILL.md and the folder at commit 618dcfc. 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

    Shell commands in SKILL.md call:

    • swift
    • python3
    • pip3
    • git

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

  • Network

    No URLs in SKILL.md. Its commands use pip3 and git, which can reach the network depending on how they are called.

    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

Image Visual Check loads about 2.3k tokens when it runs. Until then it costs about 191 tokens; SKILL.md has 1,018 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~191
When it runs · the whole SKILL.md, loaded when a task matches
~2.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); files beside SKILL.md are not scanned.

SKILL.md

The full file from jjjkkkjjj/Matft at commit 618dcfc, republished under its BSD-3-Clause licence (© jjjkkkjjj). 1,018 words, ~2,292 tokens.

Download SKILL.mdSave it as .claude/skills/image-visual-check/SKILL.md (or your agent's skills folder).
name
image-visual-check
description
Procedure for adding tests for Matft's image processing (Matft.image.*, indexing or channel swapping on images, etc.), generating comparison images that put the result next to an OpenCV reference, and visually checking that the conversion is correct. Use this skill whenever the conversation is about adding, fixing, testing, or checking Matft features that handle images — e.g. "add an image processing test", "visually check resize / warpAffine / color", "see if the image is converted correctly", "compare with OpenCV", "check it like the images in the README / docs", or in Japanese「画像処理のテスト追加して」「resize / warpAffine / color を目視確認したい」「画像が正しく変換されてるか見て」「OpenCV と見比べたい」「README / ドキュメントの画像みたいに確認したい」— even if the word "skill" is never mentioned.

Adding image processing tests and checking them visually

With numeric asserts alone, image processing bugs like vertical flips, swapped RGB, or shifted interpolation are easy to miss. So pin down the spec with numeric tests, then build a comparison image that lays out input | Matft | OpenCV | diff side by side, and have both Claude and the user check it visually. The comparison images are committed to the repository so they can be reviewed in the PR.

How it works

LocationRole
Tests/MatftTests/files/images/rena.pngInput image (225x225, RGBA). Lossless PNG, because JPEG mixes in decoder differences
Tests/MatftTests/ImageSnapshot.swiftTest helper. loadFixture() loads a CGImage; check(_:as:) compares Matft's output with the committed opencv/<case>.png by tolerances[<case>] and then saves it as PNG (save(_:as:))
Tests/MatftTests/ImageTest.swiftImage processing tests (create it if missing)
scripts/image_compare.pyRuns the OpenCV version of each conversion registered in CASES and writes reference images, comparison images, and diff metrics
files/images/matft/<case>.pngMatft's output (committed)
files/images/opencv/<case>.pngOpenCV's output (committed)
files/images/compare/<case>.pngComparison image (committed). This is what you look at

ImageSnapshot.save writes files only when run with the environment variable MATFT_IMAGE_SNAPSHOT=1, so that a regular swift test does not modify files in the repository.

0. Pre-checks

sh
python3 -c "import cv2, numpy; print(cv2.__version__, numpy.__version__)"

If cv2 is missing, suggest pip3 install --user opencv-python-headless. Install only with the user's consent.

1. Write the test (Red)

Follow TDD as CLAUDE.md requires. If ImageTest.swift does not exist, create it in this form. Wrap the whole file in #if so it still builds where Accelerate/ImageIO are unavailable (WASI, Linux).

swift
#if canImport(Accelerate) && canImport(ImageIO)
import XCTest

@testable import Matft

final class ImageTest: XCTestCase {
    func test_resize() {
        let image = Matft.image.cgimage2mfarray(ImageSnapshot.loadFixture())   // Float [0, 1], RGBA, shape=(225, 225, 4)
        let ret = Matft.image.resize(image, width: 300, height: 150)

        XCTAssertEqual(ret.shape, [150, 300, 4])
        XCTAssertEqual(ret.mftype, .Float)
        // Assert whatever can be checked numerically, e.g. representative pixel values

        ImageSnapshot.check(ret, as: "resize_300x150")
    }
}
#endif

Tips for numeric asserts:

  • Get expected values by computing them from rena.png in Python (numpy / cv2). Write the Python expression in a comment so it is clear where the embedded values come from.
  • For operations involving interpolation (resize, warpAffine), vImage and OpenCV do not match pixel for pixel. So assert algorithm-independent properties: shape, dtype, value range, pixels in flat regions, border values (warpAffine's borderValue), etc.
  • For operations that are exactly defined (flip, channel swap, grayscale), compare representative pixels with the numpy / cv2 values (divide by 255 for Float; tolerance around 1e-2).
  • Give each check a case name that tells the operation and its conditions (e.g. warpAffine_rotate30_edgeExtend).
  • check fails until the case has a tolerance in ImageSnapshot.tolerances and a committed reference opencv/<case>.png (step 4). Pick .exact, .rounding(n) or .interpolation(meanAbs:minPSNR:) from the metrics of step 4, with a little margin, and write the measured values in a comment.

Confirm it fails with swift test --filter MatftTests.ImageTest.

2. Register the OpenCV version

Add the OpenCV operation to CASES in scripts/image_compare.py under the same case name.

python
"resize_300x150": Case("rena.png",
                       lambda x: cv2.resize(x, (300, 150), interpolation=cv2.INTER_LANCZOS4),
                       "Matft.image.resize(width: 300, height: 150) vs cv2.resize(LANCZOS4)"),

op receives an RGBA uint8 array. It may return either uint8 or float in [0, 1] (converted to uint8 automatically). Differences in conventions between Matft and OpenCV often make a correct result look "off". Watch for:

  • Channel order: Matft is RGBA, OpenCV is BGR(A). The script passes RGBA, so do not use BGR-based conversions (COLOR_BGR2GRAY, etc.) inside op.
  • Size arguments: cv2.resize takes (width, height); Matft's shape is (height, width, channel).
  • Value range: Matft's Float images are [0, 1]; OpenCV uses 0–255. Multiply borderValue and the like by 255.
  • Interpolation: vImage's resize uses Lanczos-style interpolation, whose edges differ from INTER_LINEAR. Pick the closest interpolation and state in the description what it was compared against.
  • Savable channel counts: mfarray2cgimage supports only 1 and 4 channels. For results with 3 channels, such as RGBA2RGB, convert back to 4 channels with Matft.image.color(ret, conversion: .RGB2RGBA) before save. Do the same on the OpenCV side.

3. Implement and pass the test (Green)

Write the minimal implementation that passes the test, and confirm all tests pass with swift test. When no change to Matft itself is needed (just adding tests and a visual check to an existing feature), this step is only a check.

Show full SKILL.md (408 more words)Show less

4. Generate the comparison images

sh
MATFT_IMAGE_SNAPSHOT=1 swift test --filter MatftTests.ImageTest
python3 scripts/image_compare.py --filter '<regex of case names>'

Check the status column of the table the script prints.

  • missing-matft: check was not called on the Swift side. Either MATFT_IMAGE_SNAPSHOT=1 was forgotten or the case names do not match.
  • missing-case: not registered in CASES.

5. Visual check (Claude)

Open compare/<case>.png with the Read tool and actually look at the image. Do not decide pass/fail from the metrics alone. A high PSNR is still wrong if the image is mirrored, and a diff can be fine if only the interpolation differs.

Look in this order:

  1. Orientation and position: do flips, rotation direction, and translation direction match the intended transform?
  2. Color: do skin and background tones look natural compared with the input? Any R/B swap (bluish skin) or alpha mishandling (blown-out whites, crushed blacks)?
  3. Shape: is the output size and aspect ratio the same as OpenCV's?
  4. Diff map: look at the shape of the diff's distribution.
    • Faintly scattered everywhere → rounding error or different interpolation. Usually acceptable.
    • Along edges → different interpolation, or a half-pixel shift.
    • A whole region or the image border is bright → likely a real bug: coordinate system, border handling, swapped channels, etc.

Rough metric guidelines (guidelines only):

Kind of operationExpected
Indexing (flip, slice, channel swap)`max
Color conversion`max
resize, warpAffineNo pixel match expected. Fine if PSNR is roughly 30 dB or higher and the diff is confined to edges

When a result falls outside the guidelines, before calling it a bug, suspect the convention differences in step 2 (a mistake on the OpenCV side), and decide which is right by comparing against the input image.

6. Show the user and report

sh
open Tests/MatftTests/files/images/compare/<case>.png   # pass several at once if there are multiple

Include in the report:

  • The tests added and what they assert
  • The table the script printed (metrics per case)
  • What you checked visually: what looked correct, where the diff appears and why you judged it acceptable (or what is wrong)

Let the user make the final call on correctness.

7. Commit (only when the user tells you to)

Commit files/images/{matft,opencv,compare}/<case>.png together with the tests. Check with git status that images of existing cases have not changed unintentionally. If they have, tell the user about that diff too.

To show a new case in the docs, add #### <function name> and ![alt](/img/compare/<case>.png) to the "Visual check against OpenCV" section of website/docs/guide/image.md. website/scripts/copy-assets.mjs copies the images into static at build time, so do not commit them a second time on the website side.

© jjjkkkjjj, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/image-visual-check of jjjkkkjjj/Matft.

Open the folder on GitHubat commit 618dcfc

Compare with similar skills

Image Visual Check 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.

Image Visual Check compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Image Visual Check this skilljjjkkkjjj/Matft147—~2.3kAutomated safety check: PassBSD-3-Clause
Revise Docstringspymc-labs/pathmc132—~2.3kAutomated safety check: PassMIT
Scientific DocumentationYikai-Liao/symusic189—~5.5kAutomated safety check: PassMIT
Torch Performance Optimizationalbumentations-team/albucore123—~895Automated safety check: PassMIT
ComfyUI Custom Node BuilderConstantineB6/comfy-pilot230—~897Automated safety check: PassMIT
Dbgtheodo-group/debug-that158—~2.5kAutomated safety check: PassMIT

Similar skills

  • Revise Docstrings

    pymc-labs/pathmc

    Review and improve Python docstrings for Great Docs API reference generation.

    132 GitHub stars~2.3k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • Scientific Documentation

    Yikai-Liao/symusic

    Set up and maintain documentation for scientific Python packages.

    189 GitHub stars~5.5k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Torch Performance Optimization

    albumentations-team/albucore

    Optimize or review eager CPU-only Albucore PyTorch runtime paths with benchmark-backed decisions.

    123 GitHub stars~895 tokensUpdated 6 days ago
    AI & LLM EngineeringAuto-check passed
  • ComfyUI Custom Node Builder

    ConstantineB6/comfy-pilot

    Helps an agent write ComfyUI custom nodes in Python, including wrapping an existing script, mapping data types and handling image batches.

    230 GitHub stars~897 tokensUpdated 7 mo ago
    AI & LLM EngineeringAuto-check passed
  • Dbg

    theodo-group/debug-that

    Debug applications using the dbg CLI debugger. An agent skill from theodo-group/debug-that.

    158 GitHub stars~2.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Env Setup

    wwwzhouhui/skills_collection

    Checking and provisioning the machine's environment for the video-agent-kit plugin — probing for ffmpeg/ffprobe that actually carry the encoders and filters we render with (libx264/aac/libmp3lame…

    283 GitHub stars~3.5k tokensUpdated 5 days ago
    Media & CreativeAuto-check: notes

More from jjjkkkjjj/Matft

  • Docs

    jjjkkkjjj/Matft

    Procedure for writing and updating Matft's documentation (the Docusaurus site in website/ and the doc comments on the public API that become the Swift-DocC API reference).

    147 GitHub stars~2.7k tokensUpdated 14 days ago
    Auto-check passed
  • Test Design

    jjjkkkjjj/Matft

    Procedure for designing and writing Matft's XCTest cases with high coverage — boundary values, dtypes, memory layouts, NaN/inf, empty arrays, broadcasting, platform differences, performance and…

    147 GitHub stars~2k tokensUpdated 14 days ago
    Auto-check passed
  • Benchmark

    jjjkkkjjj/Matft

    Procedure for benchmarking Matft's PerformanceTests against Numpy and reporting the results (and, when asked, updating the speed comparison table on the docs site, website/docs/performance.md).

    147 GitHub stars~1.7k tokensUpdated 14 days ago
    Auto-check passed
  • Release

    jjjkkkjjj/Matft

    Procedure for releasing a new version of Matft (decide the version → check tests → write release notes → create and push an annotated tag → publish a GitHub Release).

    147 GitHub stars~1.8k tokensUpdated 14 days ago
    Auto-check passed

Questions about Image Visual Check

What does Image Visual Check do?

Procedure for adding tests for Matft's image processing (Matft.image., indexing or channel swapping on images, etc.), generating comparison images that put the result next to an OpenCV reference…. Image Visual Check is an agent skill from jjjkkkjjj/Matft.), generating comparison images that put the result next to an OpenCV reference, and visually checking that the conversion is correct.

When should I use Image Visual Check?

Image Visual Check fits situations like: the conversation is about adding; checking Matft features that handle images — e.g.

How do I install Image Visual Check in Claude Code?

Run `npx skills add jjjkkkjjj/Matft --skill image-visual-check -a claude-code`. Or copy the skill folder (.claude/skills/image-visual-check in jjjkkkjjj/Matft) into .claude/skills/image-visual-check in your project. Claude Code loads it when a task matches its description.

How do I install Image Visual Check in Codex?

Run `npx skills add jjjkkkjjj/Matft --skill image-visual-check -a codex`. Or copy the skill folder (.claude/skills/image-visual-check in jjjkkkjjj/Matft) into .agents/skills/image-visual-check in your project. Codex loads it when a task matches its description.

Can I use Image Visual Check 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 jjjkkkjjj/Matft --skill image-visual-check -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/image-visual-check, .gemini/skills/image-visual-check, .github/skills/image-visual-check and .opencode/skills/image-visual-check in your project.

What does Image Visual Check need to run?

Going by SKILL.md and its folder, Image Visual Check needs the command-line tools its instructions call (swift, python3, pip3 and git). Our summary lists: Python 3.

Does Image Visual Check access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Image Visual Check 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. Review the folder before installing.

What licence does Image Visual Check use?

Image Visual Check is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Image Visual Check use?

About 2.3k tokens (SKILL.md is roughly 9.2k 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 Image Visual Check?

Skills that share tags, products or a category with Image Visual Check: Revise Docstrings (pymc-labs/pathmc, 132 stars), Scientific Documentation (Yikai-Liao/symusic, 189 stars), Torch Performance Optimization (albumentations-team/albucore, 123 stars) and ComfyUI Custom Node Builder (ConstantineB6/comfy-pilot, 230 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Image Visual Check?

jjjkkkjjj (a GitHub user) maintains it in jjjkkkjjj/Matft, which has 147 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on September 27, 2026.

Source: jjjkkkjjj/Matft on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.