본문으로 건너뛰기
Skillpedia
테스트8.2k · #12551

go-testing

하는 일

이 스킬은 AI가 Go 언어로 테스트를 쓰거나 검토할 때 안내합니다. 집중력 있고 신뢰할 수 있는 테스트를 원하는 Go 개발자를 위한 스킬이며, 터미널 인터페이스 테스트도 포함합니다.

사용하는 경우

  • ✓입력 사례가 많은 Go 함수를 위한 테스트를 쓸 때.
  • ✓Bubbletea로 만든 터미널 사용자 인터페이스를 테스트할 때.
  • ✓골든 파일 테스트나 파일 시스템을 건드리는 테스트가 필요한 경우.

스킬 링크

https://github.com/Gentleman-Programming/gentle-ai/blob/main/internal/assets/skills/go-testing/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/Gentleman-Programming/gentle-ai/blob/main/internal/assets/skills/go-testing/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 파서를 위해 오류 사례를 포함한 표 기반 Go 테스트를 작성해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 대상에 맞는 테스트 패턴을 고릅니다. 함수에는 표 기반 테스트를, 터미널 인터페이스에는 모델을 직접 업데이트하는 방식을 씁니다. 테스트를 결정적으로 유지하고, 짧은 모드에서는 느린 외부 테스트를 건너뜁니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Activation Contract

Load this skill when writing or reviewing Go tests, adding coverage, testing Bubbletea/TUI flows, using teatest, or updating golden files.

Hard Rules

  • Prefer table-driven tests for multiple cases; use t.Run(tt.name, ...).
  • Test behavior and state transitions, not implementation trivia.
  • Use t.TempDir() for filesystem tests; never rely on a real home directory.
  • Keep integration tests skippable with testing.Short() when they run external commands or slow flows.
  • For Bubbletea, test Model.Update() directly for state changes; use teatest only for interactive flows.
  • Golden files must be deterministic; update only through the repo's -update path and rerun tests without -update.
  • Use small mocks/interfaces around system or command execution boundaries.

Decision Gates

Target Test pattern
Pure function or parser Table-driven unit test.
Error behavior Explicit success and failure cases.
File operations t.TempDir() plus focused assertions.
TUI state transition Direct Model.Update() call with tea.Msg.
Full TUI interaction teatest.NewTestModel().
Rendered output Golden file test.
Real external command Integration test; skip in -short.

Execution Steps

  1. Identify behavior under test and the smallest public boundary that proves it.
  2. Choose the test pattern from the decision gate.
  3. Name cases by scenario, not input mechanics.
  4. Assert outputs, errors, state, and side effects explicitly.
  5. Run the narrow package test first, then the relevant broader suite.
  6. For golden updates: run with -update, inspect diff, then rerun without -update.

Output Contract

Report test files changed, scenarios covered, commands executed, golden files updated, and any skipped integration scope.

References

자주 묻는 질문

골든 파일이란 무엇인가요?

테스트가 비교하는 저장된 기대 출력이며, 스킬은 이것이 항상 같은 결과를 내도록 요구합니다.

터미널 인터페이스는 어떻게 테스트하나요?

상태 변화를 직접 테스트하고, 전체 대화형 흐름에서만 teatest를 씁니다.

테스트에서 실제 홈 폴더를 쓰나요?

아닙니다. 임시 폴더를 쓰고 실제 홈 디렉터리에 의존하지 말라고 스킬이 설명합니다.

상세 정보

작성자의 원본 설명

Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.

repo: Gentleman-Programming/gentle-ai

인기도

GitHub 스타
8.2k
순위
#12551
라이선스
MIT
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬