aiagent: Skill for Claude Code

.claude/skills/write-tests/SKILL.md

write-tests is a skill for Claude Code from drujensen/aiagent. It costs 35 tokens per session (389 once invoked), scanned A, original, MIT.

A test-writing workflow for Go code that creates unit and integration tests with the project's existing patterns. Unit tests check one part in isolation; integration tests check parts working together.

In plain words
What is it for?
Use it to test a function, file, or feature, including acceptance criteria. It also runs the project's tests with race detection, which looks for unsafe concurrent access.
Why use it?
It removes the need to manually design common test cases and helps catch success cases, failures, and edge cases before changes are merged.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

This is drujensen/aiagent's own configuration. It tells Claude Code how to work on aiagent itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything aiagent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to drujensen/aiagent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/drujensen/aiagent/main/.claude/skills/write-tests/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/drujensen/aiagent

Made for: Claude Code.

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 write-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/drujensen/aiagent/write-tests/github.svg)](https://agentmods.dev/skills/drujensen/aiagent/write-tests)
Your own site
<a href="https://agentmods.dev/skills/drujensen/aiagent/write-tests"><img src="https://agentmods.dev/badge/skills/drujensen/aiagent/write-tests/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 write-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/drujensen/aiagent/write-tests"><img src="https://agentmods.dev/badge/skills/drujensen/aiagent/write-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 389 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.00035 $0.00389
Opus 5.5 $0.00014 $0.00156
Sonnet 5.5 $0.00007 $0.00078
Haiku 4.5 $0.00003 $0.00039

Measured 4d ago against content hash a009e95c3d1e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

write-tests 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 4d 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.

.claude/skills/write-tests/SKILL.md · 48 lines

What it actually says

Write Tests

Write tests for:

Instructions

Use the Agent tool with subagent_type: "tester" to write tests.

Pass it:

  • What to test (file path, function name, or feature description)
  • Acceptance criteria (if available — each criterion should map to at least one test)

The tester will:

  1. Read the code under test thoroughly
  2. Read existing test files in the same package for style reference
  3. Write tests using testify (assert + mock)
  4. Cover: happy paths, all error paths, edge cases
  5. Mock only at domain interface boundaries
  6. Run go test ./... -race to verify tests pass

Test Patterns in This Project

  • Domain service tests: mock repositories implementing domain interfaces via testify/mock
  • Tool tests: real behavior, t.TempDir() for file isolation
  • Integration tests: guarded with if os.Getenv("API_KEY") == "" { t.Skip(...) }
  • Test names: TestXxx_scenarioDescription
  • Table-driven: preferred for multiple input/output scenarios

Output

The tester will report:

  • Test files written/modified
  • Coverage result: go test ./pkg -cover
  • Race detection result: go test ./pkg -race
  • List of acceptance criteria covered

Important

  • This is a standalone skill — use /test-review for the full test + review loop
  • All new tests must pass with -race flag
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. 4d ago First seen · 48 lines · 35 tokens per session scan A a009e95c3d1e

Subscribe to this mod's changes

write-tests is a skill published in the GitHub repository drujensen/aiagent (5 stars, last pushed 2mo ago), licensed MIT. It adds 35 tokens to every session and 389 once invoked, about $0.0001 per session on Opus 5.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-10-03.