Go Testingのロゴ

Go Testing

組織人気
GetStream
go-testing

How Go tests are written in acceleration/ and sdks/go. Read before adding a test or a test suite.

概要

公開者GetStream
リポジトリAgents
スキル名go-testing
スター
8.2K
フォーク
709
同梱ファイル
3
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 3個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    GetStreamがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Go Testing」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/GetStream/Agents/tree/main/.claude/skills/go-testing
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/GetStream/Agents.git /tmp/Agents
mkdir -p .claude/skills
cp -r /tmp/Agents/.claude/skills/go-testing .claude/skills/go-testing
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでGo Testingを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にGo Testingを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Go Testingは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Go testing

Rules

  • Group tests in a testify suite (suite.Suite). Shared setup lives in the suite, in one place.
  • Never mock. A provider is a stub registered in its router's registry, or the real one behind an integration build tag; everything else is real.
  • Test behaviour through the outside. Assert on outputs and state, never on which method was called.
  • Name a test as the sentence it proves: TestAnIdAnotherSessionHasIsRefused.
  • Avoid table tests, common as they are in Go. Write one test per behaviour, each named for what it proves, and put what they share in the suite or a helper.
  • Anything that needs Postgres, Redis or a provider's API starts with //go:build integration and skips, rather than fails, when what it needs is not configured.
  • Outside a suite, check with require, never testify/assert: a failed check stops the test there.
  • A unit test that waits on a real timer runs in a testing/synctest bubble, where the timer fires at once (AgentSuite.onFakeClock in internal/agent). Make the goroutines and channels the test waits on inside the bubble: a goroutine that waits on something from outside stops the fake clock. A test that waits on network I/O stays on the real clock, with or without a build tag (an integration test, or a unit test on a local socket): a wait on network I/O stops the fake clock. A test that needs real time between two events also stays on the real clock: on the fake clock, work that does not wait takes no time.
  • Every skip says what keeps the test from running: the env var or tool that is missing, or what the provider cannot do. A skip with no such reason ("pending fixture") is a test to fix or delete.

Which kind of test

Read the file for what you are testing:

  • controllers.md: HTTP operations in internal/api, run against the whole router with RouterSuite. Who may call an endpoint, whose a resource is, fixtures, parallel suites.
  • store.md: the models and queries in internal/store, run against Postgres with StoreSuite.
  • ai-routing.md: STT, TTS, STS, LLM, search and the other AI providers and their routers. One shared suite per kind of AI that every provider embeds.

Before you push

Checks a reviewer runs and an author often skips:

  • Mutate every rule you added, at every call site, in a scratch copy: delete the clause, make the condition true, empty a migration's Down. A mutant no test fails is a missing test.
  • Run the touched suites on the merge with current origin/main. CI's green is from the main it ran on.
  • An entry added to a shared list (dataTables, importedModels, usageIndexes) changes every reader of that list: read each one.
  • Round-trip an id that moves, is derived or is replayed: A to B to A, and a second run, each end as one row.
  • A shipped migration never runs again: change it in a new one.
  • A new migration is expand-only: it drops or renames nothing the release before still reads or writes.
  • A migration's lock timeout is in the go skill's store.md ("Which database"). Its version slot is in the parallel-agents skill ("Migration versions").
  • Work moved onto context.WithoutCancel takes its follow-on calls (billing, the cache drop) with it.
  • A fix covers every path to the same data: each writer, and each copy of it (a cache, data_changes).

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Go Testing」では何ができますか?

How Go tests are written in acceleration/ and sdks/go. Read before adding a test or a test suite.

TypingMindでGo Testingを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Go Testingはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにGo Testingをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/GetStream/Agents/tree/main/.claude/skills/go-testingを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Go Testingを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Go Testingで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもGo Testingを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Go Testing」は無料ですか?

はい。GetStreamがApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇