add_go_test

Add or extend Go unit tests matching existing package test style.

2.0k|126|Updated Jun 16, 2020
One-click install
npx skills add https://github.com/authgear/authgear-server --skill add-go-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add_go_test
Source: https://github.com/authgear/authgear-server/tree/main/.claude/skills/add_go_test
Command: npx skills add https://github.com/authgear/authgear-server --skill add-go-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill makes it easy to satisfy requests for new or improved Go unit tests by guiding the implementation while preserving the existing package conventions.

Core Features & Use Cases

  • Test Guidance: Inspect the package and existing _test.go files to mirror the current style, whether that means table-driven checks or using goconvey.
  • Minimal Scope: Add the smallest test file that covers the requested behavior, keeping fixtures local unless reuse is necessary elsewhere.
  • Release Confidence: Run go test on the affected package and extend to related packages when shared code is touched to ensure safety.
  • Use Case: When asked to validate a new authentication path, review the package style, write the targeted assertions, and verify success with go test.

Quick Start

Ask add_go_test to inspect the target Go package and expand or add the unit tests required by the user request.

Frequently Asked Questions about add_go_test

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

FAQPage Schema
How do I add Go unit tests that match my existing test style?

To add Go unit tests that match existing style, inspect the package and current _test.go files to mirror conventions like table-driven checks or goconvey, then write the smallest test file covering the requested behavior.

What's the best way to increase test coverage for a specific Go package?

The best way to increase Go test coverage is to add targeted assertions for missing behaviors, keep fixtures local unless reuse is necessary, and run go test on the affected package to verify the new tests pass.

Can I use goconvey when extending Go unit tests in my repo?

Yes, you can use goconvey when extending Go unit tests. The test guidance inspects existing _test.go files to mirror the current style, ensuring new assertions match whether the package uses goconvey or standard table-driven checks.

How do I ensure new Go tests don't break related packages?

To ensure new Go tests don't break related packages, run go test on the affected package first, then extend the test run to related packages when shared code is touched to verify overall repository safety and release confidence.

Do I need to manually run go test after adding new unit tests?

You do not need to manually run go test after adding new unit tests. The process automatically runs go test on the affected package and broadens to related packages when shared code is modified to ensure all tests pass.