Agent skill

Reviewing Unit Tests

by Comfy-Org in Comfy-Org/ComfyUI_frontend

A skill your agent uses when reviewing Vitest unit-test diffs in ComfyUIfrontend, especially new mocks, store tests, component tests, or bugfix regression tests.

GPL-3.0Auto-check passedTesting & QA

Install Reviewing Unit Tests

skills CLI
$ npx skills add Comfy-Org/ComfyUI_frontend --skill reviewing-unit-tests -a claude-code

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

GitHub CLI
$ gh skill install Comfy-Org/ComfyUI_frontend reviewing-unit-tests --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/Comfy-Org/ComfyUI_frontend.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/reviewing-unit-tests .claude/skills/reviewing-unit-tests && 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
reviewing-unit-tests
GitHub stars
2.1k
Token cost
~5.1k tokens
SKILL.md length
1,461 words
Files
1
Skills in repo
22
Repo updated
First seen
Licence
GPL-3.0

At a glance

A skill your agent uses when reviewing Vitest unit-test diffs in ComfyUIfrontend, especially new mocks, store tests, component tests, or bugfix regression tests.

  • Works in 6 steps: Inventory shared test utilities before… → Identify the test type: component,… → Name the behavior the test proves. If… → …
  • Reviewing Vitest unit-test diffs in ComfyUIfrontend
  • SKILL.md covers Overview, Review Workflow, Source of Truth / Precedence and 30-Second Red Flags, plus 7 more sections
  • Calls rg

What it does

Reviewing Unit Tests is an agent skill from Comfy-Org/ComfyUI_frontend. Use when reviewing Vitest unit-test diffs in ComfyUIfrontend, especially new mocks, store tests, component tests, or bugfix regression tests.

Its SKILL.md is about 5.1k 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 Testing & QA, covering Unit testing and Diffusion and image models. It works with ComfyUI and Vitest. The repository describes itself as: Official front-end implementation of ComfyUI. The licence is GPL-3.0.

When your agent uses it

  • Reviewing Vitest unit-test diffs in ComfyUIfrontend
  • Especially new mocks
  • Component tests
  • Bugfix regression tests

Example prompts

  • “/reviewing-unit-tests”

Workflow steps

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

  1. Inventory shared test utilities before reading the diff. See "Inventory Before Reading".
  2. Identify the test type: component, store, composable, util, or bugfix regression.
  3. Name the behavior the test proves. If you cannot say it in one sentence, request changes.
  4. Open the authoritative doc section before judging structure.
  5. Scan the red flags below.
  6. State the verdict first. Name the failure mode. Cite the doc or rule.

What it can do on your machine

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

    • rg

    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

Reviewing Unit Tests loads about 5.1k tokens when it runs. Until then it costs about 41 tokens; SKILL.md has 1,461 words of instructions outside code blocks.

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

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 Comfy-Org/ComfyUI_frontend at commit f9be289, republished under its GPL-3.0 licence (© Comfy-Org). 1,461 words, ~5,138 tokens.

Download SKILL.mdSave it as .claude/skills/reviewing-unit-tests/SKILL.md (or your agent's skills folder).
name
reviewing-unit-tests
description
Use when reviewing Vitest unit-test diffs in ComfyUI_frontend, especially new mocks, store tests, component tests, or bugfix regression tests.

Reviewing Unit Tests for ComfyUI_frontend

Overview

Review for behavior and current repo rules, not motion. Compare to authoritative rules, not prior diffs or legacy snippets.

Review Workflow

  1. Inventory shared test utilities before reading the diff. See "Inventory Before Reading".
  2. Identify the test type: component, store, composable, util, or bugfix regression.
  3. Name the behavior the test proves. If you cannot say it in one sentence, request changes.
  4. Open the authoritative doc section before judging structure.
  5. Scan the red flags below.
  6. State the verdict first. Name the failure mode. Cite the doc or rule.
Inventory Before Reading

List the shared factories, shared automocks, global stubs, and reuse rules before judging any setup in the diff:

bash
rg --files src | rg -i 'testutils\.ts$'
rg --files src __mocks__ | rg '__mocks__/'
rg -n -i '\breuse|instead of hand-rolling' docs/testing/*.md

Also read vitest.setup.ts for global stubs and polyfills.

A stub for a missing global (Path2D, ResizeObserver, canvas getContext) repeated in two or more test files is a finding. It belongs in the shared setup or a shared util, not per file.

Source of Truth / Precedence

When docs and examples conflict, use this order:

  1. Explicit repo rules, lint rules, and note blocks.
  2. docs/guidance/testing-principles.md for design rules that apply at every test level.
  3. docs/testing/vitest-patterns.md
  4. Rule sections in docs/testing/unit-testing.md, docs/testing/store-testing.md, and docs/testing/component-testing.md
  5. Example snippets
  6. Prior diffs

Apply these repo-specific clarifications:

  • docs/testing/component-testing.md starts with the authoritative rule: new component tests use @testing-library/vue with @testing-library/user-event. The @vue/test-utils snippets below it are legacy examples.
  • docs/testing/store-testing.md still contains as any examples. Treat them as legacy snippets, not approval for new or edited test code.
  • If docs conflict, prefer the stricter newer rule and call out the doc ambiguity. Do not approve through it.
  • Motion != fix.

30-Second Red Flags

If you see...Failure modeDefault action
New @vue/test-utils import in a new component testlegacy test APIRequest changes
vi.mock('vue-i18n', ...)mocked i18nRequest changes
as any, @ts-expect-error, as Mock, as ReturnType<typeof vi.fn>, as unknown as Xunnecessary cast or type escapeRequest changes unless the author proves no safer type exists
getXMock(), renamed wrapper, or helper that only returns a mocked valuealias-by-renamingRequest changes
beforeEach recreates the return object for a module-mocked composable or serviceshared mock setup driftRequest changes
Assertions only check defaults, mock plumbing, or CSS hooksnon-behavioral testRequest changes
Bugfix test has no proof it fails on pre-fix codeunproven regressionRequest changes
Hand-rolled canvas/graph/node/subgraph/workflow fixture or mock when litegraphTestUtils.ts or another shared *testUtils.ts already provides itduplicated fixtureRequest changes, point at the shared factory
More than three mocks in one file (vi.mock, vi.fn, vi.spyOn, hand-built fakes), excluding shared automockspossible over-mockingAsk what owned behavior still runs. Request changes only if none does or a double replaces owned code
Test rebuilds production logic (scheduler loop, rAF queue, state machine) or computes the expected value with the logic under testreplicated logicRequest changes, exercise the real code
Hand-rolled runner primitive: Object.defineProperty write counters, global save/restore in try/finally, if (arg === ...) mock ladders that only return fixed valueshand-rolled runner primitiveRequest changes: vi.spyOn(obj, 'prop', 'set'), vi.stubGlobal, vi.when. Keep mockImplementation for calculations and side effects

Rationalization Table

ExcuseReality
"I restructured the mocks"If the indirection stayed, nothing improved. Flag alias-by-renaming.
"The docs do it"Rule, note, and lint beat legacy snippet. Compare to the current rule, not the nearest example.
"TypeScript required the cast"vi.mocked() usually narrows mock methods. Assertion-only references need no cast.
"Putting it in beforeEach is DRY"Recreating module mock state in hooks hides singleton behavior and drifts from the documented pattern.
"The real collaborator is hard to set up"Use the real collaborator or a shared factory. A local double is fine at an awkward boundary (network, clock, dialogs). Flag a missing factory only when the same setup repeats.
"Mocks keep the test isolated"Desiderata isolation means tests do not affect each other. Faking owned code gives up predictive and structure-insensitive for nothing.
"It is only a nit"Explicit repo-rule violations are never nits.
"No behavior changed, just cleanup"Motion != fix. Ask what behavior got stronger.
"Mental revert is enough"For bugfix tests, establish red on pre-fix code or ask the author to show it.

Mocking Rules

  • Fail helpers that do not remove repeated setup, encode domain meaning, or simplify assertions. Barely earning the abstraction is not enough.
  • For composables with reactive or singleton state, define stable mock state inside the vi.mock() factory. Access it per test via the composable itself. See docs/testing/unit-testing.md "Mocking Composables with Reactive State".
  • This does not ban local test data builders or per-test vi.spyOn(...).
  • Mock seams, not the project-owned module you are trying to exercise. Default to real collaborators and shared factories per docs/guidance/testing-principles.md "Doubles: real collaborators first". For store tests, use real stores on the testing Pinia that vitest.setup.ts activates before each test. Flag any test that creates its own Pinia or mocks pinia. Audited concurrent store tests use the per-test pinia fixture. See docs/testing/store-testing.md and docs/testing/vitest-patterns.md.
Show full SKILL.md (650 more words)Show less
Over-Mocking and Replicated Logic
  • Count vi.mock, vi.fn, vi.spyOn, and hand-built fakes per file. Above three, ask what the test still proves about owned code. The count is a signal, not a verdict. Boundary doubles around exercised owned code are fine. Request changes when no owned behavior runs or a double replaces owned code.
  • Do not count shared automocks: a factory-less vi.mock(import('…')) that activates a __mocks__/ file, plus vi.mocked(...) configuration of it, per docs/guidance/vitest.md "Shared manual mocks". The exemption covers the count only. Automocking the module under test is still a finding.
  • A hand-written vi.mock factory for a module that already has a __mocks__/ file is a duplicated fixture.
  • Deletion test: imagine deleting the production wiring. If every test still passes, nothing covers it.
  • A test that re-implements the code it covers passes on bugs that both copies share. Request the real module plus a double at its true boundary (network, clock, reportError).
  • Name the Desiderata property the test gives up, usually predictive, behavioral, or structure-insensitive. See docs/guidance/testing-principles.md "Judge every test by Beck's Test Desiderata".
Alias-by-Renaming
ts
// Before
const mockAdd = vi.hoisted(() => vi.fn())

// After: same indirection, new name
function getToastAddMock() {
  return useToast().add
}

If the wrapper only renames or relays a mocked value, fail it. Inline the lookup at the call site or fetch the singleton mock via the documented pattern.

vi.mocked() Scope
Use casevi.mocked() required?
.mockReturnValue, .mockResolvedValue, .mockImplementationYes
.mock.calls, .mock.resultsYes
expect(fn).toHaveBeenCalled()No
expect(fn).toHaveBeenCalledWith(...)No
  • Flag casts whenever vi.mocked() would narrow correctly.
  • Do not add vi.mocked() around assertion-only references just for style.
Reset Hygiene
  • vite.config.mts sets mockReset, restoreMocks, unstubEnvs, and unstubGlobals. Flag manual resets, restores, and global save/restore that duplicate them.
  • Flag per-mock mockClear() or mockReset() when vi.clearAllMocks() or vi.resetAllMocks() already runs in the relevant hook chain.
  • Review for redundancy or broken state management. Do not bikeshed clearAllMocks vs resetAllMocks unless behavior depends on it.
Third-Party Seams
  • Distinguish trivial hooks from behavior-rich APIs.
  • Mocking single-method third-party hooks like @vueuse/core's useClipboard is usually acceptable.
  • That exception does not justify mocking behavior-rich third-party modules.
vue-i18n

Test-Body Rules

SmellReview bar
Change-detector testReject. Default values alone prove nothing.
Mock-only assertionAccept collaborator-call assertions only when the call is the meaningful external effect and the test also exercises the triggering behavior.
Non-behavioral assertionReject tests that only check classes, utility hooks, or styling internals.
New component test using @vue/test-utilsRequest changes. Use @testing-library/vue plus @testing-library/user-event.
any, as any, or @ts-expect-error in new or edited test codeRequest changes unless the author proves no safer type exists. Legacy doc snippets do not authorize it.

Bugfix Regression Proof

For fix: PRs or bugfix diffs:

  1. Identify the production change that fixes the bug.
  2. Verify the new test fails on pre-fix code, or ask the author to show it.
  3. If the test passes on broken code, request changes.

A regression test that never proves red does not pin the bug.

Review Output Rules

  • State verdict before procedural questions.
  • Do not lead with approval language like LGTM, just one nit or approve and move on?.
  • Name the failure mode directly: alias-by-renaming, unnecessary cast, mocked i18n, mock-only assertion, unproven regression, duplicated fixture, over-mocking, replicated logic, hand-rolled runner primitive.
  • Link the authoritative doc section in the review comment.
  • If an explicit repo rule, lint rule, or authoritative doc note is violated, do not downgrade it to "minor deviation" or "nit".

Quick Reference

When you see...Read this
New vi.mock(...) for a composabledocs/testing/unit-testing.md -> "Mocking Composables with Reactive State"
New store test or store mockdocs/testing/vitest-patterns.md setup + docs/testing/store-testing.md
New component testTop note in docs/testing/component-testing.md
vue-i18n in a component testdocs/testing/vitest-patterns.md + src/components/searchbox/v2/__test__/testUtils.ts
New LiteGraph node/canvas/graph test setupdocs/testing/litegraph-testing.md -> "Shared Factories" + src/utils/__tests__/litegraphTestUtils.ts
Cast around a mockdocs/guidance/typescript.md -> "Type Assertion Hierarchy"

Key Files to Read

PurposePath
Composable mocking patternsdocs/testing/unit-testing.md
Store testing patternsdocs/testing/store-testing.md
Repo-wide Vitest setup defaultsdocs/testing/vitest-patterns.md
Component testing rule for new testsdocs/testing/component-testing.md
LiteGraph test patternsdocs/testing/litegraph-testing.md
Shared LiteGraph factoriessrc/utils/__tests__/litegraphTestUtils.ts
Real i18n setupsrc/components/searchbox/v2/__test__/testUtils.ts

© Comfy-Org, GPL-3.0. 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/reviewing-unit-tests of Comfy-Org/ComfyUI_frontend.

Open the folder on GitHubat commit f9be289

Compare with similar skills

Reviewing Unit Tests 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.

Reviewing Unit Tests compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Reviewing Unit Tests this skillComfy-Org/ComfyUI_frontend2.1k—~5.1kAutomated safety check: PassGPL-3.0
Test Writing WorkflowiOfficeAI/AionUi33k1 repos~1.2kAutomated safety check: PassApache-2.0
Vitestsupabase/supabase111k12 repos~1.1kAutomated safety check: PassApache-2.0
Test GuardamElnagdy/guard-skills1.3k2 repos~2.1kAutomated safety check: PassMIT
Adding LLM MCP ToolsTriliumNext/Trilium38k—~2.5kAutomated safety check: PassAGPL-3.0
Concept Page Test Writerleonardomso/33-js-concepts67k—~5.5kAutomated safety check: PassMIT

Similar skills

  • Test Writing Workflow

    iOfficeAI/AionUi

    Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.

    33k GitHub starsUsed in 1 repo~1.2k tokens
    Testing & QAAuto-check passed
  • Vitest

    supabase/supabase

    Official

    Vitest API and config reference (Jest-compatible) — mocking with vi., spies, fake timers, coverage configuration, fixtures, snapshots, and test filtering.

    111k GitHub starsUsed in 12 repos~1.1k tokens
    Testing & QAAuto-check passed
  • Test Guard

    amElnagdy/guard-skills

    Reviews newly written or edited tests against nine rules that cut test bloat, such as mock-heavy checks and near-duplicate cases, before they are committed.

    1.3k GitHub starsUsed in 2 repos~2.1k tokens
    Testing & QAAuto-check passed
  • Adding LLM MCP Tools

    TriliumNext/Trilium

    A skill your agent uses when adding, changing, or reviewing an LLM/MCP tool in Trilium (the defineTools definitions under packages/trilium-core/src/services/llm/tools/ —…

    38k GitHub stars~2.5k tokensUpdated today
    Testing & QAAuto-check passed
  • Concept Page Test Writer

    leonardomso/33-js-concepts

    Generates Vitest tests for every runnable code example on a JavaScript concept documentation page, following a four-phase extraction and conversion process.

    67k GitHub stars~5.5k tokensUpdated 29 days ago
    Testing & QAAuto-check passed
  • Archestra Dev Testing

    archestra-ai/archestra

    A skill your agent uses for test selection and quality across backend, frontend, and e2e; load its backend reference for Vitest projects, mocking, DB fixtures, and performance.

    4.4k GitHub stars~3.2k tokensUpdated today
    Testing & QAAuto-check passed

More from Comfy-Org/ComfyUI_frontend

All 22 skills in this repo
  • Adding Deprecation Warnings

    Comfy-Org/ComfyUI_frontend

    Adds deprecation warnings for renamed or removed properties/APIs.

    2.1k GitHub stars~775 tokensUpdated today
    Auto-check passed
  • Agent Integration Replay

    Comfy-Org/ComfyUI_frontend

    Replay recorded agent conversations as Playwright tests against the real chat panel and canvas.

    2.1k GitHub stars~805 tokensUpdated today
    Auto-check: notes
  • Codegen Transform

    Comfy-Org/ComfyUI_frontend

    Transforms raw Playwright codegen output into ComfyUI convention-compliant tests.

    2.1k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Comment Sicko

    Comfy-Org/ComfyUI_frontend

    Dispatches the comment-sicko subagent to hunt gratuitous comments in a PR/diff, triages its raw findings, and posts a polite, professional writeup.

    2.1k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Hardening Flaky E2E Tests

    Comfy-Org/ComfyUI_frontend

    Diagnoses and fixes flaky Playwright e2e tests by replacing race-prone patterns with retry-safe alternatives.

    2.1k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Perf Fix With Proof

    Comfy-Org/ComfyUI_frontend

    Ships performance fixes with CI-proven improvement using stacked PRs.

    2.1k GitHub stars~1.6k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Reviewing Unit Tests

What does Reviewing Unit Tests do?

A skill your agent uses when reviewing Vitest unit-test diffs in ComfyUIfrontend, especially new mocks, store tests, component tests, or bugfix regression tests. Reviewing Unit Tests is an agent skill from Comfy-Org/ComfyUI_frontend. Use when reviewing Vitest unit-test diffs in ComfyUIfrontend, especially new mocks, store tests, component tests, or bugfix regression tests.

When should I use Reviewing Unit Tests?

Reviewing Unit Tests fits situations like: reviewing Vitest unit-test diffs in ComfyUIfrontend; especially new mocks; component tests; bugfix regression tests.

How do I install Reviewing Unit Tests in Claude Code?

Run `npx skills add Comfy-Org/ComfyUI_frontend --skill reviewing-unit-tests -a claude-code`. Or copy the skill folder (.claude/skills/reviewing-unit-tests in Comfy-Org/ComfyUI_frontend) into .claude/skills/reviewing-unit-tests in your project. Claude Code loads it when a task matches its description.

How do I install Reviewing Unit Tests in Codex?

Run `npx skills add Comfy-Org/ComfyUI_frontend --skill reviewing-unit-tests -a codex`. Or copy the skill folder (.claude/skills/reviewing-unit-tests in Comfy-Org/ComfyUI_frontend) into .agents/skills/reviewing-unit-tests in your project. Codex loads it when a task matches its description.

Can I use Reviewing Unit Tests 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 Comfy-Org/ComfyUI_frontend --skill reviewing-unit-tests -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/reviewing-unit-tests, .gemini/skills/reviewing-unit-tests, .github/skills/reviewing-unit-tests and .opencode/skills/reviewing-unit-tests in your project.

What does Reviewing Unit Tests need to run?

Going by SKILL.md and its folder, Reviewing Unit Tests needs the command-line tools its instructions call (rg).

Does Reviewing Unit Tests 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 Reviewing Unit Tests 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 Reviewing Unit Tests use?

Reviewing Unit Tests is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Reviewing Unit Tests use?

About 5.1k tokens (SKILL.md is roughly 21k 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 Reviewing Unit Tests?

Skills that share tags, products or a category with Reviewing Unit Tests: Test Writing Workflow (iOfficeAI/AionUi, 33k stars), Vitest (supabase/supabase, 111k stars), Test Guard (amElnagdy/guard-skills, 1.3k stars) and Adding LLM MCP Tools (TriliumNext/Trilium, 38k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Reviewing Unit Tests?

Comfy-Org (a GitHub organization) maintains it in Comfy-Org/ComfyUI_frontend, which has 2,056 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on October 9, 2026.

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