Agent skill

Add Service Unit Test

by wso2 in wso2/agent-manager

Write a service-layer unit test in agent-manager-service (the Go control plane).

Apache-2.0Auto-check passedTesting & QA

Install Add Service Unit Test

skills CLI
$ npx skills add wso2/agent-manager --skill add-service-unit-test -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install wso2/agent-manager add-service-unit-test --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/wso2/agent-manager.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/add-service-unit-test .claude/skills/add-service-unit-test && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-service-unit-test
GitHub stars
108
Token cost
~997 tokens
SKILL.md length
389 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
Apache-2.0

At a glance

Write a service-layer unit test in agent-manager-service (the Go control plane).

  • The user asks to add
  • SKILL.md covers Rules that decide correctness, Mocks, Reference and CI lint traps (CI lints test…, plus 3 more sections
  • Calls make and go; needs ENCRYPTION_KEY
  • Fix a unit test for a service

What it does

Add Service Unit Test is an agent skill from wso2/agent-manager. Write a service-layer unit test in agent-manager-service (the Go control plane). Use when the user asks to add or fix a unit test for a service, mock a repository/client, or when CI lint fails on a test file (nilnil, goheader, exhaustruct, errorlint). Enforces the no-build-tag unit tier, moq-generated mocks, and the strict CI lint config that also lints test files.

Its SKILL.md is about 1000 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Unit testing and Linting and formatting. The repository describes itself as: WSO2 AI Agent Manager is an open control plane designed for enterprises to deploy, manage, and govern AI agents at scale. The licence is Apache-2.0.

When your agent uses it

  • The user asks to add
  • Fix a unit test for a service
  • Mock a repository/client
  • CI lint fails on a test file (nilnil

Example prompts

  • “/add-service-unit-test”

Requirements

  • A credential in ENCRYPTION_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit 84899da. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • make
    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • ENCRYPTION_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add Service Unit Test loads about 997 tokens when it runs. Until then it costs about 97 tokens; SKILL.md has 389 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~97
When it runs · the whole SKILL.md, loaded when a task matches
~997

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from wso2/agent-manager at commit 84899da, republished under its Apache-2.0 licence (© wso2). 389 words, ~997 tokens.

Download SKILL.mdSave it as .claude/skills/add-service-unit-test/SKILL.md (or your agent's skills folder).
name
add-service-unit-test
description
Write a service-layer unit test in agent-manager-service (the Go control plane). Use when the user asks to add or fix a unit test for a service, mock a repository/client, or when CI lint fails on a test file (nilnil, goheader, exhaustruct, errorlint). Enforces the no-build-tag unit tier, moq-generated mocks, and the strict CI lint config that also lints test files.

Write a service unit test (agent-manager-service)

Fast, DB-free tests of service logic with collaborators mocked.

Read first: agent-manager-service/AGENTS.md → the "Testing" section (two tiers, what goes where, mocks, CI lint traps). This skill is the executable checklist.

Rules that decide correctness

  • File: services/<service>_unit_test.go, package services, no build tag — omit the //go:build line entirely. A //go:build integration line makes it an integration (DB) test.
  • Only test the service layer. Never unit-test the repository (mocking a repo to test the repo is circular) — that's the integration tier.
  • Inject mocks via the NewXxx(...) constructor, not by reaching into fields.
  • Assert the service's own logic — error mapping, validation gates, branching, fan-out. Use assert.ErrorIs / assert.NotErrorIs for sentinels, and explicitly check that a real error is not masked as not-found.

Mocks

  • Repositories → repomocks.<Iface>Mock; clients → clientmocks.<Iface>Mock (both moq-generated; run make codegen if the interface is new).
  • Configure <Method>Func fields. Leaving a func nil and having it called panics — use that deliberately to assert a path must not be reached.
  • In-package interfaces with no generated mock (e.g. MonitorExecutor, GitCredentialsService) → hand-write a func-field stub in the test file, same <Method>Func shape.
  • Reuse shared helpers, don't redeclare (duplicate = compile error): strPtr (in llm_deployment_service_test.go), discardLogger (in evaluator_manager_unit_test.go).

Reference

Copy the shape of services/agent_kind_service_unit_test.go.

Show full SKILL.md (188 more words)Show less

CI lint traps (CI lints test files too, with .github/linters/.golangci.yaml)

  • nilnil — never return nil, nil. Return an empty typed value (return []*models.Foo{}, nil). If (nil, nil) is genuinely under test: //nolint:nilnil // <reason>.
  • goheader — every .go file (tests included) needs the Apache license header; copy from an existing file.
  • errorlint / nilerr — compare with errors.Is, not ==; don't return nil after a non-nil error check.
  • nolintlint — a bare //nolint is itself an error; always //nolint:<linter> // <reason>.
  • exhaustruct is off for _test.go (partial struct literals fine in fixtures) but still applies to production code you touch.

Run

bash
make test-unit                 # runs unit tier + sets required config env vars
# single test (env vars load at import time):
go test -run 'TestAgentKindService' ./services/    # needs DB_*/OPEN_CHOREO_BASE_URL/ENCRYPTION_KEY/SERVER_PORT set

Services that sign tokens need make gen-keys first.

Services that emit audit events

Operations that must not happen unrecorded — minting a token, rotating a key, deploying, deleting — refuse to proceed when no audit recorder is installed. A bare context.Background() therefore makes them fail with audit: recorder unavailable.

Pass auditableCtx(t) (declared in services/audit_testing_test.go, do not redeclare it):

go
resp, err := svc.RotateAPIKey(auditableCtx(t), ouID, proj, agent, env, keyName, req)

To assert the refusal itself, pass a bare context and expect audit.ErrRecorderUnavailable.

Done checklist

  • make test-unit passes.
  • go build -tags=integration ./... compiles (catches helper-name collisions across tiers).
  • CI lint clean: golangci-lint run --config .github/linters/.golangci.yaml ./...
  • gofmt -l clean on changed files.

© wso2, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/add-service-unit-test of wso2/agent-manager.

Open the folder on GitHubat commit 84899da

Compare with similar skills

Add Service Unit Test next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Add Service Unit Test compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Service Unit Test this skillwso2/agent-manager108—~997Automated safety check: PassApache-2.0
Run Pre Gen ChecksGoogleCloudPlatform/magic-modules974—~492Automated safety check: PassCustom licence
Simple Modern Uvjlevy/simple-modern-uv301—~1.9kAutomated safety check: PassMIT
Pierre Testing and Verification Guidepierrecomputer/pierre6.3k—~608Automated safety check: PassApache-2.0
Ha Frontend Testinghome-assistant/frontend5.7k—~1.7kAutomated safety check: PassApache-2.0
Eslint Vitest Rule Testerantfu-collective/eslint-vitest-rule-tester142—~1.3kAutomated safety check: PassMIT

Similar skills

  • Run Pre Gen Checks

    GoogleCloudPlatform/magic-modules

    Run fast static checks that don't require generating downstreams, including git submodule verification, gofmt formatting, YAML linting, template validation (version-guard and unused-tmpl), mmv1 core…

    974 GitHub stars~492 tokensUpdated today
    Testing & QAAuto-check passed
  • Simple Modern Uv

    jlevy/simple-modern-uv

    Start, selectively modernize, fully migrate, or update Python projects using simple-modern-uv practices: uv, ruff, BasedPyright, pytest, GitHub Actions CI, and tag-driven PyPI publishing.

    301 GitHub stars~1.9k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Chooses the right verification step after a code change in Pierre's monorepo: format and lint, a typecheck, Bun unit tests, snapshots, or Playwright E2E.

    6.3k GitHub stars~608 tokensUpdated today
    Testing & QAAuto-check passed
  • Ha Frontend Testing

    home-assistant/frontend

    Home Assistant frontend testing and validation workflow. An agent skill from home-assistant/frontend.

    5.7k GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Eslint Vitest Rule Tester

    antfu-collective/eslint-vitest-rule-tester

    Help users test ESLint rules with Vitest, supporting snapshot testing and custom assertions

    142 GitHub stars~1.3k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Run Tests

    artcc/freelingo

    A skill your agent uses when the user asks to run tests, ejecutar tests, lanzar tests, pytest, vitest, check types, typecheck, lint, or verify the codebase.

    165 GitHub stars~976 tokensUpdated today
    Testing & QAAuto-check passed

More from wso2/agent-manager

  • Add Audit Event

    wso2/agent-manager

    Add a semantic audit event to agent-manager-service (the Go control plane).

    108 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • Add Console API Feature

    wso2/agent-manager

    Add an API-backed feature to the console (React/TypeScript web UI).

    108 GitHub stars~761 tokensUpdated yesterday
    Auto-check passed
  • Add Evaluator

    wso2/agent-manager

    Add a new evaluator to the amp-evaluation Python library. An agent skill from wso2/agent-manager.

    108 GitHub stars~710 tokensUpdated yesterday
    Auto-check passed
  • Add API Resource

    wso2/agent-manager

    Add or change a REST API resource in agent-manager-service (the Go control plane).

    108 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Add Service Unit Test

What does Add Service Unit Test do?

Write a service-layer unit test in agent-manager-service (the Go control plane). Add Service Unit Test is an agent skill from wso2/agent-manager. Write a service-layer unit test in agent-manager-service (the Go control plane).

When should I use Add Service Unit Test?

Add Service Unit Test fits situations like: the user asks to add; fix a unit test for a service; mock a repository/client; CI lint fails on a test file (nilnil.

How do I install Add Service Unit Test in Claude Code?

Run `npx skills add wso2/agent-manager --skill add-service-unit-test -a claude-code`. Or copy the skill folder (.claude/skills/add-service-unit-test in wso2/agent-manager) into .claude/skills/add-service-unit-test in your project. Claude Code loads it when a task matches its description.

How do I install Add Service Unit Test in Codex?

Run `npx skills add wso2/agent-manager --skill add-service-unit-test -a codex`. Or copy the skill folder (.claude/skills/add-service-unit-test in wso2/agent-manager) into .agents/skills/add-service-unit-test in your project. Codex loads it when a task matches its description.

Can I use Add Service Unit Test in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wso2/agent-manager --skill add-service-unit-test -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-service-unit-test, .gemini/skills/add-service-unit-test, .github/skills/add-service-unit-test and .opencode/skills/add-service-unit-test in your project.

What does Add Service Unit Test need to run?

Going by SKILL.md and its folder, Add Service Unit Test needs the command-line tools its instructions call (make and go) and credentials named ENCRYPTION_KEY. Our summary lists: A credential in ENCRYPTION_KEY.

Does Add Service Unit Test access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Add Service Unit Test safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add Service Unit Test use?

Add Service Unit Test is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add Service Unit Test use?

About 997 tokens (SKILL.md is roughly 4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Add Service Unit Test?

Skills that share tags, products or a category with Add Service Unit Test: Run Pre Gen Checks (GoogleCloudPlatform/magic-modules, 974 stars), Simple Modern Uv (jlevy/simple-modern-uv, 301 stars), Pierre Testing and Verification Guide (pierrecomputer/pierre, 6.3k stars) and Ha Frontend Testing (home-assistant/frontend, 5.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Service Unit Test?

wso2 (a GitHub organization) maintains it in wso2/agent-manager, which has 108 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 9, 2026.

Source: wso2/agent-manager on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.