One-click install
npx skills add https://github.com/trypanic/skills --skill go-testing-strategy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-testing-strategy
Source: https://github.com/trypanic/skills/tree/main/go-testing-strategy
Command: npx skills add https://github.com/trypanic/skills --skill go-testing-strategy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go services often suffer from inconsistent test coverage, drifting mocks that don't match real wire contracts, unenforced rules for test type placement, and missed checks for concurrency or database atomicity bugs that only surface in production. This skill eliminates these gaps with a clear, enforceable testing strategy tailored to Go service architecture.

Core Features & Use Cases

  • Standardized Test Pyramid: Defines exact placement and scope for unit, integration (mocked dependencies), real-infrastructure integration, and end-to-end smoke tests to eliminate redundant or misplaced test effort.
  • Contract Safety: Mandates all HTTP mocks validate against JSON Schemas in both directions, preventing silent contract drift that breaks production integrations.
  • Workflow Gating: Requires all tests for a spec slice to pass before work advances to the next slice, ensuring acceptance criteria are always verified and no untested code ships.
  • Real-Infrastructure Testing: Enforces testing stored procedures, transactional locking, and atomic operations against real Postgres or broker instances instead of mocks that can't catch SQL or concurrency regressions.
  • Use Case: For a Go service with external HTTP orchestrators and Postgres stored procedures, this skill ensures you write unit tests for domain logic, schema-validated mocks for the orchestrator, real Postgres tests for stored procedure repositories, and block advancing to the next feature until all tests pass.

Quick Start

Use the go-testing-strategy skill to create a test plan for your new Go service workflow, including unit, integration, and e2e test layers with appropriate gating rules.

Frequently Asked Questions about go-testing-strategy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Go testing strategy for services with HTTP clients and stored procedures?

A Go testing strategy should use a standardized test pyramid to define exact placement for unit, integration, real-infrastructure, and end-to-end tests. This eliminates redundant effort by enforcing scope rules for domain logic, mocked HTTP clients, and real Postgres stored procedure tests.

How do I prevent HTTP mock contract drift in Go integration testing?

To prevent HTTP mock contract drift in Go integration testing, you should mandate that all HTTP mocks validate against JSON Schemas in both directions. This ensures mocked dependencies match real wire contracts and prevents silent integration failures.

How do I test stored procedures and database atomicity in Go without missing concurrency bugs?

To test stored procedures and database atomicity in Go, you should enforce real-infrastructure integration testing against actual Postgres instances. This approach catches SQL regressions, transactional locking issues, and concurrency bugs that mocked databases cannot detect.

How do I enforce workflow gates to block untested Go feature slices?

You can enforce workflow gates by requiring all tests for a spec-driven feature slice to pass before work advances to the next slice. This gating mechanism ensures acceptance criteria are always verified and no untested Go service code ships.

What is the best way to handle race-safe concurrency testing patterns in Go services?

The best way to handle race-safe concurrency testing patterns in Go services is to implement standardized test strategies that enforce real-infrastructure testing. This validates atomic operations and transactional locking against real brokers or Postgres instances to catch concurrency regressions.

Does this Go testing strategy work for spec-driven feature slices?

Yes, this Go testing strategy applies directly to spec-driven feature slices by applying workflow gating rules. It ensures all unit, integration, and end-to-end tests for a slice pass before advancing, verifying acceptance criteria across HTTP orchestrators and repositories.