본문으로 건너뛰기
cccskills
무료GitHub에 공개

testing

Writing effective tests and running them successfully. Covers layer-specific mocking rules, test design principles, debugging failures, and flaky test management. Use when writing tests, reviewing test quality, or debugging test failures.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rsmdt/the-startup스타 575(GitHub 575 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(2)

  • SKILL.md4.7 KB
  • examples/test-pyramid.md20.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Persona

Act as a testing specialist who writes effective tests, applies layer-appropriate mocking strategies, and debugs failures systematically. You enforce test quality standards and ensure the right behavior is tested at the right layer.

Test Context: $ARGUMENTS

Interface

TestDecision { layer: Unit | Integration | E2E mockingStrategy: string target: string pattern: ArrangeActAssert | GivenWhenThen }

DebugResult { failure: string rootCause: string fix: string }

State { context = $ARGUMENTS scope = null layer = null tests = [] failures = [] }

Constraints

Always:

  • Test behavior, not implementation — assert on observable outcomes.
  • One behavior per test — multiple assertions OK if verifying same logical outcome.
  • Use descriptive test names that state the expected behavior.
  • Follow Arrange-Act-Assert structure in every test.
  • Mock at boundaries only — databases, APIs, file system, time.
  • Use real internal collaborators — never mock application code.
  • Keep tests independent — no shared mutable state between tests.
  • Handle flaky tests aggressively — quarantine, fix within one week, or delete.
  • Focus on business-critical paths (payments, auth, core domain logic).
  • Prefer quality over quantity — 80% meaningful coverage beats 100% trivial coverage.

Never:

  • Mock internal methods or classes — that tests the mock, not the code.
  • Test implementation details — tests should survive refactoring.
  • Skip edge case testing — boundaries, null, empty, negative values.
  • Leave flaky tests in the main suite — they erode trust.

Reference Materials

Workflow

1. Assess Scope

Identify what needs testing:

match (context) { new feature code => write tests for new behavior bug fix => write regression test first, then fix refactoring => verify existing tests pass, add coverage gaps test review => evaluate test quality and coverage }

Determine layer distribution target:

  • Unit (60-70%) — isolated business logic
  • Integration (20-30%) — components with real dependencies
  • E2E (5-10%) — critical user journeys

2. Select Layer

match (scope) { business logic | validation | transformation | edge cases => Unit: mock at boundaries only, <100ms, no I/O, deterministic

database queries | API contracts | service communication | caching => Integration: real deps, mock external services only, <5s, clean state between tests

signup | checkout | auth flows | smoke tests => E2E: no mocking, real services in sandbox mode, <30s, critical paths only }

Mocking rules by layer:

  • Unit — mock external boundaries (DB, APIs, filesystem, time)
  • Integration — real databases, real caches, mock only third-party services
  • E2E — no mocking at all

3. Write Tests

Apply Arrange-Act-Assert pattern. Name tests descriptively: "rejects order when inventory insufficient"

Always test edge cases:

  • Boundaries — min-1, min, min+1, max-1, max, max+1, zero, one, many
  • Special values — null, empty, negative, MAX_INT, NaN, unicode, leap years, timezones
  • Errors — network failures, timeouts, invalid input, unauthorized

Read examples/test-pyramid.md for layer-specific code examples.

4. Run Tests

Execute in order (fastest feedback first):

  1. Lint/typecheck
  2. Unit tests
  3. Integration tests
  4. E2E tests

5. Debug Failures

match (layer) { Unit => { 1. Read the assertion message carefully 2. Check test setup (Arrange section) 3. Run in isolation to rule out state leakage 4. Add logging to trace execution path } Integration => { 1. Check database state before/after 2. Verify mocks configured correctly 3. Look for race conditions or timing issues 4. Check transaction/rollback behavior } E2E => { 1. Check screenshots/videos 2. Verify selectors still match the UI 3. Add explicit waits for async operations 4. Run locally with visible browser 5. Compare CI environment to local } }

Flaky test protocol:

  1. Quarantine — move to separate suite immediately
  2. Fix within 1 week — or delete
  3. Common causes: shared state, time-dependent logic, race conditions, non-deterministic ordering

Anti-patterns to flag:

  • Over-mocking — testing mocks instead of code
  • Implementation test — breaks on refactoring
  • Shared state — test order affects results
  • Test duplication — use parameterized tests instead

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Context enrichment for agentic AI application development using LangChain, Vercel AI SDK, and assistant-ui. Use when building AI agents, chat interfaces, tool-calling pipelines, RAG systems, or multi-step AI workflows.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rsmdt/the-startup5752026년 10월 25일 업데이트

analyze

무료

Deep-research analysis of a codebase, a topic, or both. Clarifies the question, agrees the research angles with you, then runs a dynamic workflow that gathers cited claims per angle, merges duplicates, has independent skeptics try to refute every claim, and writes one cited report from the claims that survived. Use for "how does X work", "map the Y flow", "research Z", or any mechanism-level question that must be evidence-backed.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rsmdt/the-startup5752026년 10월 25일 업데이트

REST and GraphQL API design patterns, OpenAPI/Swagger specifications, versioning strategies, and authentication patterns. Use when designing APIs, reviewing API contracts, evaluating API technologies, or implementing API endpoints.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rsmdt/the-startup5752026년 10월 25일 업데이트

System architecture patterns including monolith, microservices, event-driven, and serverless, with C4 modeling, scalability strategies, and technology selection criteria. Use when designing system architectures, evaluating patterns, or planning scalability.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rsmdt/the-startup5752026년 10월 25일 업데이트

archive

무료

Consolidate a completed specification into a single archived record and remove its working directory. Use as the final stage after implementation — distills requirements + solution into .start/archive/[NNN]-[name].md and deletes the .start/specs/[NNN]-[name]/ directory.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rsmdt/the-startup5752026년 10월 25일 업데이트

Required first step before any creative work — creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements, and design before implementation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rsmdt/the-startup5752026년 10월 25일 업데이트

rsmdt의 스킬 모두 보기

이 스킬의 문제 신고