plugins/go-dev/skills/testing-go/SKILL.md
Writes tests following TDD (using go test, testify, and rapid) best practices. Use when writing unit tests, integration tests, or table-driven tests in Go.
npx skillsauth add qte77/claude-code-plugins testing-goInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Target: $ARGUMENTS
Writes focused, behavior-driven tests following project testing strategy.
TDD methodology (language-agnostic): See tdd-core plugin (testing-tdd skill)
Go-specific documentation: references/
references/testing-strategy.md — Go tools (go test, testify, rapid, gomock)references/tdd-best-practices.md — Go TDD examples (extends tdd-core)go test (default): Use table-driven tests for known cases. Works at unit/integration levels.
rapid (edge cases): Use for invariants that must hold for ALL inputs.
See references/testing-strategy.md for full methodology comparison.
Cycle: RED (failing test / compile error) -> GREEN (minimal pass) -> REFACTOR (clean up)
Structure: Arrange-Act-Assert (AAA)
func TestOrderCalculator_Total_SumsItemPrices(t *testing.T) {
// ARRANGE
calc := NewOrderCalculator()
items := []Item{{Price: 10.00, Qty: 2}, {Price: 5.00, Qty: 1}}
// ACT
total := calc.Total(items)
// ASSERT
assert.Equal(t, 25.00, total)
}
func TestValidateEmail(t *testing.T) {
tests := []struct {
name string
email string
wantErr bool
}{
{name: "valid", email: "[email protected]", wantErr: false},
{name: "missing @", email: "userexample.com", wantErr: true},
{name: "empty", email: "", wantErr: true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
err := ValidateEmail(tt.email)
if tt.wantErr {
require.Error(t, err)
} else {
require.NoError(t, err)
}
})
}
}
High-Value: Business logic, error paths, integration points, contracts
Avoid: Stdlib behavior, trivial getters, default zero values, type existence
See references/testing-strategy.md -> "Patterns to Remove" for full list.
Format: Test{Type}_{Method}_{Behavior}
TestUserService_Create_ReturnsIDOnSuccess
TestValidateEmail_MissingAt
TestCalculateTotal_EmptyItems
go test ./... # All tests
go test -run TestUserService ./... # Filter by name
go test -race ./... # Race detector
go test -v -run TestValidateAge ./... # Verbose single test
go test ./...)var _ Interface = (*fake)(nil) compile checkdevelopment
Verify an external or AI-generated security report against the actual codebase before acting on it. Use when handed a scanner PDF, automated teardown, audit report, or bug-bounty submission — classifies every finding CONFIRMED / OVERSTATED / FALSE-POSITIVE / FABRICATED and salvages the real work items.
development
Audits a site's SEO and AI-search (GEO) readiness — meta tags, Open Graph/Twitter, JSON-LD, robots/llms conventions — and generates fixes. Use when reviewing search visibility, social previews, structured data, or LLM/AI-crawler discoverability.
documentation
Generate or update README.md files across three scopes — repo (with project-type detection), account (GitHub user profile), and org (organization profile). Use when creating, updating, or aligning a README to org conventions.
development
Audit README.md files against best practices for repos, accounts, or orgs. Detects missing sections, stale links, inconsistent formatting, and convention violations. Use when reviewing README quality across one or many repos.