add-test

add-test is a skill for Claude Code, Codex from fpindej/netrock. It costs 6 tokens per session (1,015 once invoked), scanned A, original, MIT.

A procedure for adding unit, component, and API integration tests according to the project's existing .NET test patterns. These test pure logic, services with dependencies, or the full HTTP request pipeline.

In plain words
What is it for?
Testing business logic, service results, database-backed components, authentication behavior, routes, validation, and HTTP status codes.
Why use it?
It makes new behavior easier to verify and helps catch regressions at the appropriate testing level.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/fpindej/netrock/add-test
Any agent
npx skills add fpindej/netrock --skill add-test
Clone the repo
git clone --depth 1 https://github.com/fpindej/netrock

Made for: Claude Code, Codex.

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 add-test

README.md
[![agentmods](https://agentmods.dev/badge/skills/fpindej/netrock/add-test.svg)](https://agentmods.dev/skills/fpindej/netrock/add-test)
Your own site
<a href="https://agentmods.dev/skills/fpindej/netrock/add-test"><img src="https://agentmods.dev/badge/skills/fpindej/netrock/add-test.svg" alt="Measured on agentmods" height="20"></a>
Per session 6 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,015 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00006 $0.01015
Opus 5 $0.00003 $0.00508
Sonnet 5 $0.00001 $0.00203
Haiku 4.5 $0.00001 $0.00102

Measured 4d ago against content hash 0f4305ce7bde, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

add-test 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/add-test/SKILL.md · 114 lines

How it starts

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

Adds tests. Specify test type or infer from context.

Unit Test

For pure logic in Shared, Domain, or Application layers.

  1. Create src/backend/tests/MyProject.Unit.Tests/{Layer}/{ClassUnderTest}Tests.cs
  2. Structure: {Method}_{Scenario}_{Expected} naming
  3. No mocking, no DI - test pure inputs and outputs
  4. Verify: dotnet test src/backend/tests/MyProject.Unit.Tests -c Release

Component Test

For service business logic with mocked dependencies.

  1. Create src/backend/tests/MyProject.Component.Tests/Services/{Service}Tests.cs
  2. Create mocks in constructor:
    private readonly MyProjectDbContext _dbContext = TestDbContextFactory.Create();
    private readonly IOrderRepository _orderRepo = Substitute.For<IOrderRepository>();
    private readonly HybridCache _cache = Substitute.For<HybridCache>();
    
  3. For Identity: IdentityMockHelpers.CreateMockUserManager() / CreateMockRoleManager()
  4. Assert on Result: Assert.True(result.IsSuccess); Assert.Equal(expectedId, result.Value);
  5. Verify: dotnet test src/backend/tests/MyProject.Component.Tests -c Release

API Integration Test

For testing the full HTTP pipeline (routes, auth, validation, status codes).

  1. Create src/backend/tests/MyProject.Api.Tests/Controllers/{Controller}Tests.cs
  2. Structure:
    public class OrdersControllerTests : IClassFixture<CustomWebApplicationFactory>, IDisposable
    {
        private readonly CustomWebApplicationFactory _factory;
        private readonly HttpClient _client;
        public OrdersControllerTests(CustomWebApplicationFactory factory)
        {
            _factory = factory;
            _client = factory.CreateClient();
        }
        public void Dispose() => _client.Dispose();
    }
    
  3. Auth per-request via Authorization header:
    • "Test" - basic authenticated user
    • TestAuth.WithPermissions(AppPermissions.Users.View) - specific permissions
    • TestAuth.Superuser() - bypasses all checks
    • No header - unauthenticated (401)
  4. Configure mock returns: _factory.AdminService.Method(...).Returns(...);
  5. If service interface not mocked in CustomWebApplicationFactory, add it there first
  6. For 200/201 responses, add response contract assertions using frozen records in Contracts/ResponseContracts.cs
  7. Verify: dotnet test src/backend/tests/MyProject.Api.Tests -c Release

Read the full file on GitHub · 114 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. 4d ago First seen · 114 lines · 6 tokens per session scan A 0f4305ce7bde

Subscribe to this mod's changes

add-test is a skill published in the GitHub repository fpindej/netrock (231 stars, last pushed 5d ago), licensed MIT. It adds 6 tokens to every session and 1,015 once invoked, about $0.0000 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-30.