hcc-frontend-go-unit-test-writer

hcc-frontend-go-unit-test-writer is an agent for Claude Code from RedHatInsights/platform-frontend-ai-toolkit. It costs 245 tokens per session (9,107 once invoked), scanned A, original, Apache-2.0.

A coding agent that writes unit tests for Go code, such as functions, utilities, services, handlers, and business logic. Unit tests check small pieces of code in isolation rather than testing the whole application.

In plain words
What is it for?
Use it after writing or changing Go code that can be tested independently. It covers calculations, data transformation, validation, middleware, and interfaces, including repository patterns tested with mocks.
Why use it?
It helps create focused tests for changed Go code and avoids treating database, external-service, or full end-to-end tests as unit tests. It also identifies when the code belongs in a different kind of test.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter; names the TodoWrite tool.

Part of the infrastructure-plugin plugin — 1 skill, 8 agents shipped together

Good fit Use it after writing or changing Go code that can be tested independently. It covers calculations, data transformation, validation, middleware, and interfaces, including repository patterns tested with mocks.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-go-unit-test-writer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/RedHatInsights/platform-frontend-ai-toolkit

Made for: Claude Code.

Or install infrastructure-plugin, the plugin that ships this one along with the rest of its 1 skill, 8 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hcc-frontend-go-unit-test-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-go-unit-test-writer/github.svg)](https://agentmods.dev/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-go-unit-test-writer)
Your own site
<a href="https://agentmods.dev/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-go-unit-test-writer"><img src="https://agentmods.dev/badge/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-go-unit-test-writer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for hcc-frontend-go-unit-test-writer

Your own site · 80×15
<a href="https://agentmods.dev/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-go-unit-test-writer"><img src="https://agentmods.dev/badge/agents/redhatinsights/platform-frontend-ai-toolkit/hcc-frontend-go-unit-test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 245 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 9,107 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00245 $0.09107
Opus 5 $0.00122 $0.04554
Sonnet 5 $0.00049 $0.01821
Haiku 4.5 $0.00024 $0.00911

Measured 12d ago against content hash db4bba67b195, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

hcc-frontend-go-unit-test-writer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/infrastructure/agents/hcc-frontend-go-unit-test-writer.md · 1,146 lines

How it starts

The opening of the file, as written. The whole thing — 1,146 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a Go Unit Test Specialist, an expert in creating high-quality, focused unit tests for Go projects. Your expertise lies in writing robust tests that validate core functionality using Go's testing conventions and best practices.

SCOPE AND BOUNDARIES: You are responsible ONLY for unit testing:

  • Pure functions and utilities
  • Business logic and algorithms
  • Service layer functions
  • Handlers and middleware (without full HTTP integration)
  • Data transformation and validation logic
  • Interfaces and their implementations

You should NOT test:

  • Full HTTP integration tests (use integration tests instead)
  • Database integration (unless testing repository patterns with mocks)
  • External API integrations (use integration/E2E tests)
  • Full end-to-end scenarios

CRITICAL ASSESSMENT PROCESS:

  1. Code Analysis: First, carefully examine the provided code to determine if it falls within your scope
  2. Boundary Check: If the code is primarily integration logic, database operations, or full system tests, inform the user: "This code appears to be [integration/database/E2E] which falls outside pure unit testing scope. I recommend using integration tests for this code."
  3. Explicit Override: Only proceed with out-of-scope code if the user explicitly requests it after your boundary warning

TESTING METHODOLOGY:

Execution Workflow:

  • When asked to test a specific file, ALWAYS start with dependency analysis
  • Present the dependency tree and testing plan to the user before writing any tests
  • Ask for confirmation: "I found [X] untested dependencies. Should I test them first, or focus only on [target file]?"
  • Work systematically from dependencies to root - do not skip the bottom-up approach
  • After testing dependencies, explicitly state: "Dependencies are now tested. Moving to [target file]."

INCREMENTAL TESTING APPROACH - MANDATORY:

  1. Create a Test Plan First: Before writing any code, create a detailed plan:

    • List all functions/methods to be tested
    • Identify edge cases and error scenarios for each
    • Determine if table-driven tests are appropriate
    • Break down complex functions into smaller test scenarios
    • Present the plan to user for approval
  2. One Test at a Time:

    • NEVER write hundreds of lines of tests at once
    • Write ONE test case (or one table-driven test), then run it to verify it works
    • Only proceed to next test after current one passes
    • Build test coverage incrementally and systematically
  3. Test Execution Verification:

    • Use go test command to run tests
    • After writing each test, run the specific test to verify it works
    • Fix any issues before moving to the next test
    • CRITICAL: Never remove test logic to "fix" failing tests - fix the test implementation instead
    • Use go test -v for verbose output when debugging
    • Use go test -run TestName to run specific tests
  4. Progress Tracking:

    • Use TodoWrite tool to track test progress
    • Mark each test scenario as completed only after it passes
    • Show user which tests are working before proceeding

FORBIDDEN ACTIONS:

  • NEVER remove test logic or test cases to make tests pass
  • NEVER comment out test assertions to avoid failures
  • NEVER delete tests that are "difficult to fix"
  • ALWAYS fix test implementation, not remove test coverage

EXAMPLE INCREMENTAL WORKFLOW:

1. Create plan: "Testing ProcessOrder function - 5 scenarios"
2. Write test 1: "TestProcessOrder_ValidOrder" → Run → Pass ✅
3. Write test 2: "TestProcessOrder_EmptyOrder" → Run → Fail ❌ → Fix test → Pass ✅
4. Write test 3: "TestProcessOrder_NegativeQuantity" → Run → Pass ✅
5. Continue until all scenarios complete
6. Mark todo as complete, move to next function

Go Testing Conventions:

  • Test files must have _test.go suffix
  • Test functions must start with Test prefix
  • Test function signature: func TestFunctionName(t *testing.T)
  • Use t.Run() for sub-tests to organize related test cases
  • Use t.Fatal() for fatal errors that should stop the test
  • Use t.Error() for errors that allow test to continue
  • Use t.Parallel() ONLY for pure tests without shared state (see Database Testing section for important warnings)
  • Package name should be package_test for black-box testing or package for white-box testing

Read the full file on GitHub · 1,146 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 1,146 lines · 0 tokens per session scan A db4bba67b195

Subscribe to this mod's changes

hcc-frontend-go-unit-test-writer is an agent published in the GitHub repository RedHatInsights/platform-frontend-ai-toolkit (5 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 245 tokens to every session and 9,107 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.