Skip to content

code-yeongyu/oh-my-openagent / packages/shared-skills/skills/visual-qa

visual-qa

Verified

Runs rigorous visual QA across web, terminal, and paginated surfaces: an Apple HIG-based checklist, paired light/dark captures at phone and desktop widths, screenshot evidence, and a per-item PASS/FAIL verdict. Use for any UI build or change, or when asked whether a page, component, or TUI looks right or follows the platform's design guidelines.

scripts/png-decode.test.ts

View on GitHub
import { describe, expect, test } from "bun:test"
import { Buffer } from "node:buffer"

import { decodePng } from "./png-decode"
import { encodeRgbaPng, solidRgba } from "./png-synth"

describe("decodePng", () => {
  test("#given an encoded RGBA image #when decoded #then dimensions and first pixel round-trip", () => {
    // given
    const png = encodeRgbaPng(3, 2, solidRgba(3, 2, [10, 20, 30, 255]))
    // when
    const decoded = decodePng(png)
    // then
    expect(decoded.width).toBe(3)
    expect(decoded.height).toBe(2)
    expect(Array.from(decoded.rgba.subarray(0, 4))).toEqual([10, 20, 30, 255])
  })

  test("#given a fully opaque image #when decoded #then it has no transparent pixels", () => {
    // given
    const png = encodeRgbaPng(2, 2, solidRgba(2, 2, [0, 0, 0, 255]))
    // when
    const decoded = decodePng(png)
    // then
    expect(decoded.hasAlphaChannel).toBe(true)
    expect(decoded.hasTransparentPixels).toBe(false)
  })

  test("#given a semi-transparent image #when decoded #then it reports transparent pixels", () => {
    // given
    const png = encodeRgbaPng(2, 2, solidRgba(2, 2, [255, 255, 255, 128]))
    // when
    const decoded = decodePng(png)
    // then
    expect(decoded.hasTransparentPixels).toBe(true)
  })

  test("#given a non-PNG buffer #when decoded #then it throws", () => {
    // given
    const notPng = Buffer.from("this is not a png file")
    // when / then
    expect(() => decodePng(notPng)).toThrow("not a PNG")
  })
})
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 197kUpdated Claude CodeCodexVerifiedInstall