code-yeongyu/oh-my-openagent / packages/shared-skills/skills/visual-qa
visual-qa
VerifiedRuns 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.
| File | Kind | Size |
|---|---|---|
| AGENTS.md | markdown | 3.2 KB |
| SKILL.md | skill md | 45.7 KB |
| references/browser-setup.md | markdown | 5.6 KB |
| scripts/ansi.test.ts | script | 1.1 KB |
| scripts/ansi.ts | script | 496 B |
| scripts/cli.test.ts | script | 2.9 KB |
| scripts/cli.ts | script | 2.5 KB |
| scripts/east-asian-width.test.ts | script | 1.9 KB |
| scripts/east-asian-width.ts | script | 3.0 KB |
| scripts/image-diff.test.ts | script | 2.5 KB |
| scripts/image-diff.ts | script | 3.8 KB |
| scripts/png-crc.ts | script | 707 B |
| scripts/png-decode.test.ts | script | 1.5 KB |
| scripts/png-decode.ts | script | 5.5 KB |
| scripts/png-synth.ts | script | 1.7 KB |
| scripts/skill-doc-fields.test.ts | script | 1.6 KB |
| scripts/tui-grid.test.ts | script | 1.9 KB |
| scripts/tui-grid.ts | script | 2.7 KB |
| scripts/types.ts | script | 1.3 KB |
| scripts/visual-qa.mjs | script | 15.8 KB |
scripts/tui-grid.ts
View on GitHubimport { hasAnsi, stripAnsi } from "./ansi"
import { charWidth, stringWidth } from "./east-asian-width"
import type { OverflowLine, TuiCheckResult } from "./types"
const BOX_DRAWING_START = 0x2500
const BOX_DRAWING_END = 0x257f
const MAX_WIDE_COLUMNS = 64
function splitLines(text: string): string[] {
const lines = text.split(/\r?\n/)
if (lines.length > 1 && lines[lines.length - 1] === "") lines.pop()
return lines
}
function isFrameLine(plain: string): boolean {
for (const char of plain) {
const codePoint = char.codePointAt(0)
if (codePoint !== undefined && codePoint >= BOX_DRAWING_START && codePoint <= BOX_DRAWING_END) {
return true
}
}
return false
}
function wideStartColumns(plain: string): number[] {
const columns: number[] = []
let column = 0
for (const char of plain) {
const codePoint = char.codePointAt(0)
if (codePoint === undefined) continue
const width = charWidth(codePoint)
if (width === 2) columns.push(column)
column += width
}
return columns
}
function summarize(
lineCount: number,
maxWidth: number,
expectedColumns: number,
overflowCount: number,
borderMisaligned: boolean,
containsAnsi: boolean,
): string {
const parts = [`${lineCount} line(s)`, `max width ${maxWidth}/${expectedColumns}`]
if (overflowCount > 0) parts.push(`${overflowCount} overflow line(s)`)
if (borderMisaligned) parts.push("borders misaligned")
if (containsAnsi) parts.push("contains ANSI")
return `${parts.join("; ")}.`
}
export function checkTui(text: string, expectedColumns: number): TuiCheckResult {
const lines = splitLines(text)
const lineWidths: number[] = []
const overflowLines: OverflowLine[] = []
const wideColumns = new Set<number>()
const frameWidths = new Set<number>()
for (let index = 0; index < lines.length; index++) {
const plain = stripAnsi(lines[index] ?? "")
const width = stringWidth(plain)
lineWidths.push(width)
if (expectedColumns > 0 && width > expectedColumns) {
overflowLines.push({ line: index + 1, width })
}
if (isFrameLine(plain)) frameWidths.add(width)
for (const column of wideStartColumns(plain)) {
if (wideColumns.size < MAX_WIDE_COLUMNS) wideColumns.add(column)
}
}
const maxWidth = lineWidths.reduce((max, width) => (width > max ? width : max), 0)
const borderMisaligned = frameWidths.size > 1
const containsAnsi = hasAnsi(text)
return {
command: "tui-check",
expectedColumns,
lineCount: lines.length,
lineWidths,
maxWidth,
overflowLines,
borderMisaligned,
wideCharColumns: [...wideColumns].sort((a, b) => a - b),
hasAnsi: containsAnsi,
summary: summarize(lines.length, maxWidth, expectedColumns, overflowLines.length, borderMisaligned, containsAnsi),
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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: 197k | Updated | Claude CodeCodex | Verified | Install |