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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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; useteatestonly for interactive flows. - Golden files must be deterministic; update only through the repo's
-updatepath 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
- Identify behavior under test and the smallest public boundary that proves it.
- Choose the test pattern from the decision gate.
- Name cases by scenario, not input mechanics.
- Assert outputs, errors, state, and side effects explicitly.
- Run the narrow package test first, then the relevant broader suite.
- 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
- references/examples.md — compact table-driven, Bubbletea, teatest, golden, and command examples.
자주 묻는 질문
골든 파일이란 무엇인가요?
테스트가 비교하는 저장된 기대 출력이며, 스킬은 이것이 항상 같은 결과를 내도록 요구합니다.
터미널 인터페이스는 어떻게 테스트하나요?
상태 변화를 직접 테스트하고, 전체 대화형 흐름에서만 teatest를 씁니다.
테스트에서 실제 홈 폴더를 쓰나요?
아닙니다. 임시 폴더를 쓰고 실제 홈 디렉터리에 의존하지 말라고 스킬이 설명합니다.
상세 정보
작성자의 원본 설명
Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.
인기도
- GitHub 스타
- 8.2k
- 순위
- #12551
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
branch-pr
8.2k에이전트가 일반 템플릿이 아니라 대상 프로젝트 고유의 기여 규칙을 따르는 브랜치와 풀 리퀘스트를 준비하도록 돕습니다.
chained-pr
8.2k에이전트가 400줄이 넘는 큰 변경을 각각 독립적으로 검토할 수 있는 작은 풀 리퀘스트 체인으로 나누도록 돕습니다.
cognitive-doc-design
8.2k에이전트가 답을 먼저 제시하고 세부 내용을 묶어, 쉽게 훑어보고 기억할 수 있는 가이드와 README, 검토 글을 쓰도록 가르칩니다.
comment-writer
8.2k에이전트가 풀 리퀘스트, 리뷰, 이슈 답변, 팀 채팅 메시지에 쓸 짧고 따뜻하며 직접적인 댓글을 쓰도록 돕습니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.