Tooluck logoTooluck
SKILL.md

go-testing

Agent skill fromGentleman-Programming/gentle-ai

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

How to install go-testing

install go-testing
# install the gentle-ai pack with the skills CLI
npx skills add Gentleman-Programming/gentle-ai

# or add only this skill to Claude Code: copy the folder

internal/assets/skills/go-testing/

# into

~/.claude/skills/go-testing/ (all projects)

.claude/skills/go-testing/ (one project)

internal/assets/skills/go-testing/SKILL.md

MITFull file
1## Activation Contract
2
3Load this skill when writing or reviewing Go tests, adding coverage, testing Bubbletea/TUI flows, using `teatest`, or updating golden files.
4
5## Hard Rules
6
7- Prefer table-driven tests for multiple cases; use `t.Run(tt.name, ...)`.
8- Test behavior and state transitions, not implementation trivia.
9- Use `t.TempDir()` for filesystem tests; never rely on a real home directory.
10- Keep integration tests skippable with `testing.Short()` when they run external commands or slow flows.
11- For Bubbletea, test `Model.Update()` directly for state changes; use `teatest` only for interactive flows.
12- Golden files must be deterministic; update only through the repo's `-update` path and rerun tests without `-update`.
13- Use small mocks/interfaces around system or command execution boundaries.
14
15## Decision Gates
16
17| Target | Test pattern |
18|---|---|
19| Pure function or parser | Table-driven unit test. |
20| Error behavior | Explicit success and failure cases. |
21| File operations | `t.TempDir()` plus focused assertions. |
22| TUI state transition | Direct `Model.Update()` call with `tea.Msg`. |
23| Full TUI interaction | `teatest.NewTestModel()`. |
24| Rendered output | Golden file test. |
25| Real external command | Integration test; skip in `-short`. |
26
27## Execution Steps
28
291. Identify behavior under test and the smallest public boundary that proves it.
302. Choose the test pattern from the decision gate.
313. Name cases by scenario, not input mechanics.
32…

Excerpt shown under the repository's MIT license.

More skills in gentle-ai

Keep exploring

Similar skill repositories

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates