knowledge-forge-ai/agentic-praxis-grimoire/go-test-profile

Claude Code and agent skill by knowledge-forge-ai/agentic-praxis-grimoire

Trust tier 1
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when native Go test judgment is material to package placement, subtests, helper attribution, cleanup and isolation, TestMain, parallelism, goroutine reporting, examples, benchmarks, fuzzing, caching, effective language version, or warning and crisis thresholds beyond repository policy.

Install

npx vskill@latest install knowledge-forge-ai/agentic-praxis-grimoire/go-test-profile

SKILL.md

The same SKILL.md was published earlier as knowledge-forge-ai/agentic-praxis-grimoire/go-test-profile.

Go Test Profile

Core principle

Apply native Go test judgment only when the task materially depends on the testing package or go test behavior. Establish the repository's module go directive, effective per-file language version, and selected toolchain before relying on any version-sensitive semantics. Use the highest justified Green — routine, Yellow — caution, Orange — warning, or Red — crisis / stop response for the current coherent decision.

Own test package placement, tests and subtests, helper attribution, fatal and nonfatal reporting, cleanup and isolation, TestMain, parallelism, goroutine reporting boundaries, examples, benchmarks, fuzzing, selection and caching. Leave general Go structure, errors, context, interfaces, generics, and concurrency design to go-language-profile when those semantics are independently material.

Do not use

Do not use this profile for:

  • ordinary Go implementation or review with no material test-specific decision;
  • general Go semantics already owned by go-language-profile;
  • choosing whether to adopt an assertion or comparison dependency;
  • assertion-library behavior after selection, owned by project-owned assertion

policy unless a retained version-bounded owner exists;

  • go-cmp comparison behavior after selection, owned by

go-cmp-test-profile when that retained owner is available, otherwise by explicit project policy;

  • generic implementation, debugging, planning, or review procedure;
  • selecting Go releases, commands, flags, race, coverage, fuzz duration,

benchmark, worker, platform, or CI policy;

  • authorizing live services, host mutation, credentials, or destructive action;
  • a typo, comment, rename, or test edit with no test-specific judgment; or
  • structural judgment of generated, vendored, fixture, snapshot, or

data-driven artifacts before classification.

Procedure

  1. Establish task authority, repository policy, module go directive,

effective file language version, selected toolchain, package layout, test placement, exact checks, and rollback.

  1. Classify the artifact as maintained test, helper, legacy, generated,

vendored, fixture, snapshot, or data. Classification never suppresses a semantic Red stop.

  1. Determine what each test must prove and whether the evidence is static,

unit, or integration. Mocked behavior is never integration evidence.

  1. Inspect placement and visibility, subtest naming and selection, helper

attribution, fatal and nonfatal reporting, cleanup and resource lifetime, temporary directory, environment and working-directory isolation, TestMain, parallelism, goroutine reporting, examples, benchmarks, fuzz surfaces, and caching.

  1. Assign the highest level justified by a concrete risk in the structural

contract below. Coupled signals may explain one higher-level risk, but their count never manufactures Orange or Red. One semantic Red remains Red. Do not aggregate unrelated findings.

  1. Proceed proportionally for Green; inspect policy and evidence for Yellow;

require an accepted local design, rationale, rollback, and focused validation for Orange; stop a Red false-pass, leak, unsafe mutation, exposure, or crisis-level growth.

  1. Pair independently with a process skill and, only when material, with

go-language-profile or a selected component profile. A behavior change can keep implementing-with-test-discipline primary; a test review can keep reviewing-and-verifying-repository-work primary.

  1. Preserve stricter repository policy. Relax only a profile default through

accepted scope, rationale, evidence, validation, and rollback; never relax a superior safety, privacy, truthfulness, or authority stop.

  1. Report level, signals, version assumptions, evidence class, isolation and

cleanup evidence, exception if any, and rollback.

Effective language version

The selected toolchain is not the language version. The module go directive establishes the module version, while a file constraint naming a Go release can establish a different effective file version under the current language rules. For a module at Go 1.21, for example, a go1.22 file constraint can select Go 1.22 semantics for that file. A vendored or generated file can therefore have different semantics from a neighbouring file.

Route general language-version consequences to go-language-profile. Retain the test-specific consequence: from language version go1.22, each for iteration has its own iteration variables. Table-driven subtests and parallel subtests that capture the loop variable therefore behave differently across the boundary. Establish the effective version from the module and file rather than from the installed toolchain. Asserting capture behavior from the toolchain alone is Red.

TestMain

TestMain runs on the main goroutine, and flag.Parse has not run when it is called. The generated test binary calls TestMain(m) and then exits with the runner's recorded exit code, so a normal return propagates the recorded result without an explicit os.Exit. Distinguish three cases:

  • Normal package lifecycle. TestMain performs setup, calls m.Run, and

lets the recorded result propagate. A project may instead call os.Exit, but that ends the process without running deferred functions, so all required cleanup must already have occurred. Green or Yellow.

  • Intentional package-level suppression or custom result. A package may

deliberately return without running its tests, or exit with a project-chosen code. The recorded exit code defaults to zero, so a package that never runs its tests still reports success. This is exceptional, project-owned behavior that requires an explicit accepted rationale, and the result must never be described as evidence that the package's tests ran. Orange.

  • Missing or accidental `m.Run`, or a hardcoded success code. The binary

reports success while the package's required tests never executed. Red false-pass and omitted-test stop.

The API does not universally require calling m.Run. The truthfulness contract does: never state that package tests ran or passed unless they did.

Goroutine and reporting boundary

FailNow, Fatal, Fatalf, SkipNow, Skip, Skipf, and Parallel must be called only from the goroutine running the test function. The Log and Error variants may be called simultaneously from multiple goroutines. A test also ends when its function returns, so reporting after that point is unsafe.

There is no universal rule that every goroutine must be joined. Apply a bounded truthfulness contract instead:

  • no goroutine may let required behavior false-pass;
  • a result-bearing goroutine must deliver its required result and the test must

check that result before the owner returns;

  • a resource-owning goroutine must complete or be cancelled, with release

confirmed before the owner returns;

  • a goroutine that is genuinely independent of the result and owns nothing the

test must release may outlive the test when the repository accepts it;

  • a fatal or skip call from a non-test goroutine is Red;
  • project policy may require stricter joining, and stricter policy wins.
Cleanup and isolation

Registered cleanup functions are unwound in reverse registration order after the test and its descendants finish. A per-test temporary directory is removed by the framework after that owner completes. Environment and working-directory helpers restore prior process state through cleanup, and because both affect the whole process they cannot be used in a parallel test or a test with a parallel ancestor. Treating either as parallel-safe is Red.

Confirm release of every process, port, environment change, and external object. Unexpected, unauthorized, unbounded, or privacy-unsafe persistence is Red. A retained test artifact that the repository explicitly authorizes, minimizes, and bounds is not automatically Red; record its owner and removal policy. On toolchains that provide ArtifactDir, retention still depends on the selected artifact policy and flags.

Benchmarks

Separate measured work from setup and teardown. The supported benchmark loop form depends on the selected toolchain and project support floor, not merely on the effective file language version. In particular, use B.Loop only after confirming that the selected standard library provides the behavior the benchmark expects. Exact commands, repetitions, time, memory reporting, and performance acceptance remain project-owned.

Fuzzing

Keep these surfaces distinct:

  • Setup and seed registration. F methods may be called only before the

fuzz target is provided. Seed entries come from F.Add and from the fuzz test's directory under testdata/fuzz.

  • Target execution. The target receives a *T followed by supported input

types. Use the test object for target reporting; only the documented fuzz queries remain valid through the fuzz owner. Each invocation must produce a repeatable result from its arguments, avoid mutable cross-invocation state, and leave the supplied input storage untouched after return.

  • Coverage corpus. Inputs that expand coverage can be retained under the

fuzz cache. They are engine-owned search material and are not automatically part of ordinary test execution.

  • Failures and replay. A failing input is written under

testdata/fuzz/<Name> only when writable; otherwise it is retained in the fuzz cache. Package seed files are replayed by ordinary test runs. Cache entries and repository seed files are different artifact classes and need separate retention, review, and cleanup policy.

Fuzz duration, worker count, and corpus retention are project-owned. Classify generated and persisted inputs before use. Stop Red when protected data would cross an unauthorized boundary or an input could cause an unauthorized destructive effect; generation alone is not a crisis.

Structural threshold contract

Measured against maintained small, medium, large, parallel, and integration-heavy Go repositories as well as the Go toolchain corpus, absolute file size and test-function count do not predict ownership or truthfulness risk: routine, well-maintained test files in that corpus reach many hundreds of lines and dozens of test functions. Numeric size cutoffs are therefore not used as crisis signals here, and a large but coherent test file is not by itself a finding.

Apply these categorical conditions to the actual maintained lifecycle owner. That can be one _test.go file, a cross-file suite, or a package-wide owner governed by TestMain or package-global state. Include every helper and fixture that participates in the claimed lifecycle.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 64 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
3

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/knowledge-forge-ai/agentic-praxis-grimoire/go-test-profile/badge)](https://verified-skill.com/skills/knowledge-forge-ai/agentic-praxis-grimoire/go-test-profile)

Something wrong with this skill or its page? Tell us.