Borrowing it
Nothing to install: this file belongs to stacklok/toolhive-studio. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/stacklok/toolhive-studio/main/.claude/skills/testing-with-api-mocks/SKILL.mdgit clone --depth 1 https://github.com/stacklok/toolhive-studioWrote 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.
[](https://agentmods.dev/skills/stacklok/toolhive-studio/testing-with-api-mocks)<a href="https://agentmods.dev/skills/stacklok/toolhive-studio/testing-with-api-mocks"><img src="https://agentmods.dev/badge/skills/stacklok/toolhive-studio/testing-with-api-mocks/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.
<a href="https://agentmods.dev/skills/stacklok/toolhive-studio/testing-with-api-mocks"><img src="https://agentmods.dev/badge/skills/stacklok/toolhive-studio/testing-with-api-mocks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high Tool Misuse · line 118 Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00044 | $0.01438 |
| Opus 5.5 | $0.00018 | $0.00575 |
| Sonnet 5.5 | $0.00009 | $0.00288 |
| Haiku 4.5 | $0.00004 | $0.00144 |
Grade A, and why
testing-with-api-mocks 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 2mo 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.
How it starts
The opening of the file, as written. The whole thing — 199 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Testing with API Mocks
This is the starting point for all API mocking in tests. Read this skill first before working on any test that involves API calls.
This project uses MSW (Mock Service Worker) with auto-generated schema-based mocks. When writing tests for code that calls API endpoints, mocks are created automatically.
How It Works
- Run a test that triggers an API call (e.g., a component that fetches data)
- Mock auto-generates if no fixture exists for that endpoint
- Fixture saved to
renderer/src/common/mocks/fixtures/<endpoint>/<method>.ts - Subsequent runs use the saved fixture
No manual mock setup is required for basic tests.
Fixture Location
Fixtures are organized by endpoint path and HTTP method:
renderer/src/common/mocks/fixtures/
├── groups/
│ ├── get.ts # GET /api/v1beta/groups
│ └── post.ts # POST /api/v1beta/groups
├── workloads/
│ └── get.ts # GET /api/v1beta/workloads
├── workloads_name/
│ └── get.ts # GET /api/v1beta/workloads/:name
└── ...
Path parameters like :name become _name in the directory name.
Fixture Structure
Generated fixtures use the AutoAPIMock wrapper with types from the OpenAPI schema:
// renderer/src/common/mocks/fixtures/groups/get.ts
import type {
GetApiV1BetaGroupsResponse,
GetApiV1BetaGroupsData,
} from '@common/api/generated/types.gen'
import { AutoAPIMock } from '@mocks'
export const mockedGetApiV1BetaGroups = AutoAPIMock<
GetApiV1BetaGroupsResponse,
GetApiV1BetaGroupsData
>({
groups: [
{ name: 'default', registered_clients: ['client-a'] },
{ name: 'research', registered_clients: ['client-b'] },
],
})
The second type parameter (*Data) provides typed access to request parameters (query, path, body) for conditional overrides.
Naming Convention
Export names follow the pattern: mocked + HTTP method + endpoint path in PascalCase.
GET /api/v1beta/groups→mockedGetApiV1BetaGroupsPOST /api/v1beta/workloads→mockedPostApiV1BetaWorkloadsGET /api/v1beta/workloads/:name→mockedGetApiV1BetaWorkloadsByName
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.
- 2mo ago First seen · 199 lines · 44 tokens per session scan A 4d26b466a92a
testing-with-api-mocks is a skill published in the GitHub repository stacklok/toolhive-studio (173 stars, last pushed today), licensed Apache-2.0. It adds 44 tokens to every session and 1,438 once invoked, about $0.0002 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-08-30.
Other skills, from other repositories
run-tests
Run Embody's test suite and write new tests (Embody development).
testing
MUST READ before declaring any TouchDesigner build, fix or show done, and before any soak or performance test: the verification ladder (structure, errors, frame, motion, data, performance, soak, end to end), runsoaktest and the observer-effect rules that keep measuring from perturbing the show, the iterate-by-capture…
agent-tests
MUST READ before calling RunAgentTests or touching agent-tier test infrastructure -- these tests spawn real AI clients (Claude Code, Codex) and SPEND SUBSCRIPTION USAGE; never run casually. Tier model, async runner rationale, auth/isolation rules.
ganju-cli
Write, test, deploy and debug Ganju custom tools (Functions) with the ganju CLI and the @ganju/sdk handler API. Use this whenever the user works in a folder with a ganju.json, imports @ganju/sdk or defineTool, mentions @ganju/cli or any ganju command (init, link, build, test, deploy, logs, versions, rollback, secret…
elicitation-scenarios
Drive the elicitation tester's scenario catalogue over the modern protocol, where input requests arrive in the tool result and are answered from the chat.
elicitation-scenarios-legacy
Drive the elicitation tester's scenario catalogue over the legacy protocol, where the server sends elicitation requests during the call instead of returning them in the result.