agentleFS
gollem-devgollem-dev/gollem/.claude/skills/test-with-gt/SKILL.md

test-with-gt

Skill199 starsChanged 6 months agoApache-2.0View on GitHub

Write Go test code using the gt library. Use when writing tests, creating test files, or when the user asks to add tests for Go code.

  • In this repositoryOne other file it gives its agents.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When writing Go test code, use the gt library for type-safe assertions.

    line 9
  2. Very specific:

    If gt is available, read the relevant documentation from $GT_DIR/docs/:

    line 19

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Writing Tests with gt

When writing Go test code, use the gt library for type-safe assertions.

Step 1: Locate gt documentation

First, find where gt is installed and read its documentation:

GT_DIR=$(go list -m -f '{{.Dir}}' github.com/m-mizutani/gt 2>/dev/null)

If gt is available, read the relevant documentation from $GT_DIR/docs/:

  • docs/README.md - Overview and quick reference
  • docs/types/*.md - Detailed documentation for each test type
  • docs/patterns/*.md - Common patterns (method chaining, Required, Describe)

Step 2: Choose the right test type

Data TypeUseNOT
[]T (slice)gt.Array(t, arr).Length(3)gt.Value(t, len(arr)).Equal(3)
stringgt.String(t, s).Contains("x")gt.Bool(t, strings.Contains(s, "x")).True()
errorgt.NoError(t, err)gt.Value(t, err).Nil()
int, float, etc.gt.Number(t, n).Greater(5)gt.Bool(t, n > 5).True()
map[K]Vgt.Map(t, m).HasKey("k")manual check with gt.Bool
boolgt.Bool(t, b).True()gt.Value(t, b).Equal(true)

Step 3: Apply common patterns

Use Required() for fail-fast

gt.NoError(t, err).Required()  // Stop immediately if error
gt.Value(t, result).NotNil().Required()  // Stop if nil

Use Describef() for context

gt.Array(t, users).
    Describef("Users for tenant %s", tenantID).
    Length(5)

Handle function returns with R1/R2/R3

result := gt.R1(parseJSON(input)).NoError(t)
gt.String(t, result.Name).Equal("Alice")

Quick Reference

Constructors: gt.Value, gt.Array, gt.Map, gt.Number, gt.String, gt.Bool, gt.Error, gt.NoError, gt.File, gt.Cast, gt.R1/R2/R3

Short aliases: gt.V, gt.A, gt.M, gt.N, gt.S, gt.B, gt.F, gt.C

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.