本文へ移動
cccskills
無料GitHub で公開

go-testing

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

インストール方法を見る

含まれるファイル(2)

  • SKILL.md2.1 KB
  • references/examples.md2.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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

TargetTest pattern
Pure function or parserTable-driven unit test.
Error behaviorExplicit success and failure cases.
File operationst.TempDir() plus focused assertions.
TUI state transitionDirect Model.Update() call with tea.Msg.
Full TUI interactionteatest.NewTestModel().
Rendered outputGolden file test.
Real external commandIntegration 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

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

branch-pr

無料

Create Gentle AI pull requests with issue-first checks. Trigger: creating, opening, or preparing PRs for review.

日本語の概要は準備中です。原文の説明を表示しています。

Gentleman-Programming/gentle-ai7,6932026年10月11日 更新

Trigger: PRs over 400 lines, stacked PRs, review slices. Split oversized changes into chained PRs that protect review focus.

日本語の概要は準備中です。原文の説明を表示しています。

Gentleman-Programming/gentle-ai7,6932026年10月11日 更新

Design docs that reduce cognitive load. Trigger: writing guides, READMEs, RFCs, onboarding, architecture, or review-facing docs.

日本語の概要は準備中です。原文の説明を表示しています。

Gentleman-Programming/gentle-ai7,6932026年10月11日 更新

Write warm, direct collaboration comments. Trigger: PR feedback, issue replies, reviews, Slack messages, or GitHub comments.

日本語の概要は準備中です。原文の説明を表示しています。

Gentleman-Programming/gentle-ai7,6932026年10月11日 更新

Trigger: bench, journey, journeys, driven mode, gentle-ai-bench, journey corpus, j-numbers, bench axis. Author and verify gentle-ai bench journeys; go test ./bench never proves driven execution.

日本語の概要は準備中です。原文の説明を表示しています。

Gentleman-Programming/gentle-ai7,6932026年10月11日 更新

Create Gentle AI pull requests with issue-first checks. Trigger: creating, opening, or preparing PRs for review.

日本語の概要は準備中です。原文の説明を表示しています。

Gentleman-Programming/gentle-ai7,6932026年10月11日 更新

Gentleman-Programming のスキルをすべて見る

このスキルの問題を報告する