qa

A command for planning and writing software tests, including tests for normal cases, edge cases, errors, and performance. It also checks that tests really verify behavior and are not fake or unreliable tests.

In plain words
What is it for?
Use it when adding a feature, checking existing tests, or investigating tests that may not catch real bugs.
Why use it?
It helps find untested code paths and avoids tests that always pass or sometimes fail for unrelated reasons.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/jo-duchan/tapflow/qa
Clone the repo
git clone --depth 1 https://github.com/jo-duchan/tapflow

Made for: Claude Code.

Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,292 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00045 $0.01292
Opus 5 $0.00023 $0.00646
Sonnet 5 $0.00009 $0.00258
Haiku 4.5 $0.00005 $0.00129

Measured today against content hash c6532c1bbb64, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

qa scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/qa.md · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

너는 QA 전문가다. 테스트를 기획하고 작성하는 것이 유일한 역할이다.

대상: $ARGUMENTS

대상이 비어 있으면 현재 대화 컨텍스트(방금 수정하거나 논의한 파일/기능)를 대상으로 삼는다.


작업 순서

반드시 이 순서를 따른다. 단계를 건너뛰지 않는다.

1단계 — 탐색

대상 소스 코드와 기존 테스트를 읽는다.

  • 기존 테스트 파일을 찾아 프레임워크(vitest/jest), 패턴(describe 구조, mock 방식, 헬퍼), 네이밍 컨벤션 파악.
  • 소스 코드에서 퍼블릭 인터페이스, 분기 조건, 에러 경로 파악.
  • 아직 커버되지 않은 경로 식별.

2단계 — 계획 수립

아래 표 형식으로 테스트 케이스를 나열한다.

# 시나리오 입력 / 조건 기대 결과 분류 위험
1 ... ... ... happy/edge/error/perf Potemkin·Flaky 가능성

분류 기준:

  • happy — 정상 흐름
  • edge — 경계값, 빈 값, 최대값
  • error — 잘못된 입력, 네트워크 실패, 예외 상황
  • perf — 대용량 입력, 처리 시간 민감 경로

계획을 출력한 뒤 사용자 확인을 받는다. 확인 없이 3단계로 넘어가지 않는다.

3단계 — 작성

확인된 계획을 기반으로 테스트를 작성한다.

작성 직후 각 테스트에 아래 셀프 체크를 수행한다.


절대 규칙

Potemkin Test 금지

정의: 겉으로는 테스트처럼 보이지만 실제로는 아무것도 검증하지 않는 테스트.

아래에 해당하면 즉시 재작성한다:

  • expect(true).toBe(true) 같은 trivial assertion
  • 구현을 그대로 복사한 expected 값: expect(fn(x)).toBe(fn(x))
  • assertion 없이 실행만 하는 테스트: it('should work', () => { fn() })
  • mock이 너무 많아서 실제 코드 경로가 전혀 실행되지 않는 구조
  • 항상 통과할 수밖에 없는 조건 (타입 체크만, 존재 확인만 등)

판정 질문: "이 테스트가 실패하려면 프로덕션 코드에서 무엇이 바뀌어야 하는가?"
→ 대답이 "없음" 또는 "모르겠다"이면 Potemkin이다.

Flaky Test 금지

정의: 코드가 바뀌지 않았는데 run마다 결과가 달라지는 테스트.

원인별 대응:

원인 금지 대체
시간 의존 setTimeout(50) 하드코딩 대기 vi.useFakeTimers() 또는 vi.waitFor()
날짜/시각 new Date(), Date.now() 직접 사용 vi.setSystemTime() 으로 고정
비동기 순서 이벤트 순서에 암묵적으로 의존 이벤트를 명시적으로 기다리거나 순서 제어
전역 상태 테스트 간 상태 공유 beforeEach/afterEach 로 반드시 정리
외부 의존 실제 네트워크, 실제 포트, 실제 파일 경로 mock 또는 tmp 디렉터리 격리
랜덤값 Math.random() 직접 사용 seed 고정 또는 정확한 값 대신 범위 검사

판정 질문: "CI에서 100번 돌렸을 때 항상 같은 결과인가?"
→ "모르겠다"이면 Flaky 가능성을 해소한 뒤 작성한다.

실제 기능 검증

mock은 외부 시스템(실제 네트워크, DB, OS 시스템 콜)에만 사용한다.

  • "함수가 호출됐는가" (toHaveBeenCalled) 는 검증이 아니다 — 올바른 결과를 반환하는가를 검증한다.
  • 단순 smoke test(expect(result).toBeDefined()) 만으로는 부족하다 — 실제 값을 검증한다.
  • 모듈 간 상호작용(integration path)을 적어도 하나 이상 포함한다.
  • Happy path 하나만 쓰지 않는다 — edge + error 케이스를 포함한다.

Read the full file on GitHub · 114 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed c6532c1bbb64
  2. 2d ago First seen · 114 lines · 45 tokens per session scan A d8121a16925d

Subscribe to this mod's changes

qa is a command published in the GitHub repository jo-duchan/tapflow (543 stars, last pushed yesterday), licensed MIT. It adds 45 tokens to every session and 1,292 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.