Go Testing Skill
Focused, practical testing patterns for Go, Bubbletea TUI, and golden files.
The skill is a purely instructional guide with no code execution, external network calls, or sensitive data handling. It instructs using t.TempDir() and skippable integration tests, reflecting least privilege and isolation. It defines golden file update flow and test scope clearly, providing clear data flow. Deductions: lacks explicit user confirmation mechanism, permissions for external commands like go test not detailed, and publisher identity unverified with limited attribution.
Instructions are self-consistent, decision gates and steps are clear, specific code examples provided. Dependencies like bubbletea and teatest listed in go.mod, mainstream. But static review cannot execute tests, no explicit failure feedback for abnormal input like invalid test parameters. Deductions: no failure handling guidance and key paths unverified.
Clearly targeted at Go testing, bubbletea TUI, and golden files scenarios, trigger conditions precise, decision gates and steps clear. Limited Chinese support but skill doesn't depend on overseas services. Deductions: boundaries not explicit (e.g., not for non-Go projects), no Chinese docs potentially affecting Chinese users.
Documentation well structured, includes sections and steps, examples and FAQ (not provided but referenced), declares Apache-2.0 license and version 1.0, author clear. Lacks changelog, maintenance responsibility, and known limitations. Deductions: version and license present, but no version history or maintenance path, examples file incomplete.
Skill clearly accomplishes test writing and review tasks, decision gates and output contract clear, command line examples provided, marginal value evident. But no execution evidence to validate output quality, no cost-benefit analysis of different test methods. Deductions: no execution evidence, direct usability unverified.
Content is plain text, no executable tests, CI evidence, or third-party execution records. Code examples provided but key paths like specific teatest integration not covered. Deductions: no verifiable test results or independent validation, low credibility.
- The skill is safe but users should be cautious that recommended go test commands may execute external commands; run in controlled environments.
- The skill lacks user confirmation mechanisms; confirm test scope before running.
- Dependencies on charmbracelet may fetch from overseas, potentially affecting use under network restrictions.
What does this skill do, and when should you use it?
This skill provides a structured approach to writing or reviewing Go tests, with a strong emphasis on table-driven tests, behavior verification, and state transition testing for Bubbletea/TUI apps. It covers unit, integration, and golden file tests, and offers a clear decision gate for when to use which pattern. The skill emphasizes pragmatic best practices like using t.TempDir() for filesystem isolation and testing.Short() to make integration tests skippable. It is part of the larger Gentle-AI ecosystem, installed via the same installer.
The skill guides testing practice by prescribing patterns and rules contained in its SKILL.md. It advises on approaches when writing or reviewing tests, including table-driven tests, direct Model.Update() testing for TUI state, teatest for full TUI interaction, and golden files for rendered output. It also specifies execution steps, such as running the narrowest test first, updating golden files only via the -update path, and rerunning tests without -update to verify.
- A developer adding test coverage to a Go project, wanting to follow recognized patterns.
- An engineer reviewing test code, checking whether the tests cover the right scenarios.
- A developer writing tests for a Bubbletea app, deciding between direct model testing and teatest.
- A tester maintaining golden files for a CLI tool, needing deterministic output and a safe update flow.
- A team wanting to keep integration tests skippable in short mode for CI quick checks.
What are this skill's strengths and limitations?
- Provides a clear decision gate for common testing scenarios.
- Enforces practical best practices like t.TempDir() and testing.Short() skips.
- Handles TUI testing elegantly via direct Model.Update() testing.
- Integrates well with golden file update workflow.
- Part of a larger ecosystem, benefiting from centralized installation and updates.
- No ready-made scripts or templates; it's advisory, requiring the agent to execute.
- Doesn't mention support for specific assertion libraries like testify, which may be too limiting.
- Golden file update path is not detailed; requires user familiarity with Go testing conventions.
- Compatibility is only text-based; no Windows-specific issues mentioned.
How do you install this skill?
This skill is part of the larger Gentle-AI monorepo. To install:
- Clone or download the Gentle-AI repository:
git clone https://github.com/Gentleman-Programming/gentle-ai - Copy the
internal/assets/skills/go-testing/folder into your agent skills directory (e.g.,~/.claude/skills/for Claude Code, or a project.claude/skills/). - Alternatively, run the official install script (macOS/Linux:
curl -fsSL https://raw.githubusercontent.com/Gentleman-Programming/gentle-ai/main/scripts/install.sh | bash; Windows PowerShell:irm https://raw.githubusercontent.com/Gentleman-Programming/gentle-ai/main/scripts/install.ps1 | iex) and select this skill when prompted.
How do you use this skill?
When writing or reviewing Go tests, invoke the skill with a natural language prompt, e.g., "Use the go-testing skill to write tests for this function" or "Review these tests using the go-testing skill." The agent will follow the skill's guidance to choose the appropriate pattern, execute the tests, and report results. For golden files, run go test -update when updates are needed, review the diff, then run go test again to confirm.