rest-api-test-generator

rest-api-test-generator is a skill for Claude Code from timwukp/agent-skills-best-practice. It costs 48 tokens per session (1,014 once invoked), scanned A, original, MIT.

A tool that creates tests for REST APIs using RestAssured or MockMvc. REST APIs are web endpoints that accept requests and return data, while these libraries help Java projects test them.

In plain words
What is it for?
Discovering endpoint details and generating three test scenarios at a time for cases such as successful requests, invalid input, missing resources, or conflicts.
Why use it?
It structures API testing around success, validation, and business-rule failures, while limiting batches and checking results incrementally.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the engineering-skills plugin — 18 skills shipped together

Good fit Discovering endpoint details and generating three test scenarios at a time for cases such as successful requests, invalid input, missing resources, or conflicts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/timwukp/agent-skills-best-practice/rest-api-test-generator
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.

Any agent
npx skills add timwukp/agent-skills-best-practice --skill rest-api-test-generator
Clone the repo
git clone --depth 1 https://github.com/timwukp/agent-skills-best-practice

Made for: Claude Code.

Or install engineering-skills, the plugin that ships this one along with the rest of its 18 skills.

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 rest-api-test-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/timwukp/agent-skills-best-practice/rest-api-test-generator/github.svg)](https://agentmods.dev/skills/timwukp/agent-skills-best-practice/rest-api-test-generator)
Your own site
<a href="https://agentmods.dev/skills/timwukp/agent-skills-best-practice/rest-api-test-generator"><img src="https://agentmods.dev/badge/skills/timwukp/agent-skills-best-practice/rest-api-test-generator/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 rest-api-test-generator

Your own site · 80×15
<a href="https://agentmods.dev/skills/timwukp/agent-skills-best-practice/rest-api-test-generator"><img src="https://agentmods.dev/badge/skills/timwukp/agent-skills-best-practice/rest-api-test-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,014 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00048 $0.01014
Opus 5 $0.00024 $0.00507
Sonnet 5 $0.00010 $0.00203
Haiku 4.5 $0.00005 $0.00101

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

Security

Grade A, and why

rest-api-test-generator 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 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/validate_api_tests.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/skills/rest-api-test-generator/SKILL.md · 140 lines

How it starts

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

REST API Test Generator

Instructions

Step 1: API Discovery

Ask the user:

  1. Which endpoint? (e.g., POST /api/users)
  2. Framework? (RestAssured, MockMvc)
  3. Authentication? (Bearer token, Basic auth, none)
  4. Test environment? (Mock server, local, staging)
  5. Request body example and expected response codes

Provide an upfront estimate: 15-20 credits per test scenario.

Step 2: Generate 3 Scenarios Per Batch

Generate exactly 3 test scenarios:

  1. Success case (e.g., 201 Created)
  2. Validation error (e.g., 400 Bad Request)
  3. Business logic error (e.g., 409 Conflict, 404 Not Found)

Use RestAssured template:

@Test
void shouldCreateUser_whenValidRequest() {
    given()
        .contentType(ContentType.JSON)
        .body(validUserRequest)
    .when()
        .post("/api/users")
    .then()
        .statusCode(201)
        .body("id", notNullValue())
        .body("email", equalTo("[email protected]"));
}

STOP after 3 tests. Ask the user to run and confirm responses match.

Step 3: Validation Gate

Validation command:

python scripts/validate_api_tests.py <TestClassName> --base-url http://localhost:8080

Do NOT generate more tests until the user confirms the current batch passes.

Step 4: Fix or Skip (Max 2 Attempts)

If tests fail:

  • Attempt 1: Check request/response format, Content-Type, auth token
  • Attempt 2: Adjust assertions (nested paths, flexible matchers like hasKey, anyOf)
  • After 2 failures: Skip and document expected vs. actual behavior

This usually indicates an API contract mismatch or environment issue -- not something more iterations will fix.

Step 5: Iterate or Finish

After a passing batch, offer:

  • Auth tests (401, 403)
  • Additional validation scenarios
  • Other endpoints
  • Stop and produce summary

Step 6: Summary Report

Endpoint: POST /api/users
Tests Generated: N
Status Codes Covered: 201, 400, 401, 409
Skipped: N (with reasons)

Measuring Credit Cost for Your Endpoints

Read the full file on GitHub · 140 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 140 lines · 48 tokens per session scan A 82d5c60ed999

Subscribe to this mod's changes

rest-api-test-generator is a skill published in the GitHub repository timwukp/agent-skills-best-practice (10 stars, last pushed 2d ago), licensed MIT. It adds 48 tokens to every session and 1,014 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

prowler-test-api

Testing patterns for Prowler API: JSON:API, Celery tasks, RLS isolation, RBAC. Trigger: When writing tests for api/ (JSON:API requests/assertions, cross-tenant isolation, RBAC, Celery tasks, viewsets/serializers).

prowler-cloud/prowler · 62 tokens

pytest

Pytest testing patterns for Python. Trigger: When writing or refactoring pytest tests (fixtures, mocking, parametrize, markers). For Prowler-specific API/SDK testing conventions, also use prowler-test-api or prowler-test-sdk.

prowler-cloud/prowler · 51 tokens

api-gateway

AWS API Gateway for REST and HTTP API management. Use when creating APIs, configuring integrations, setting up authorization, managing stages, implementing rate limiting, or troubleshooting API issues.

itsmostafa/aws-agent-skills · 38 tokens

cognito

AWS Cognito user authentication and authorization service. Use when setting up user pools, configuring identity pools, implementing OAuth flows, managing user attributes, or integrating with social identity providers.

itsmostafa/aws-agent-skills · 38 tokens

sns

AWS SNS notification service for pub/sub messaging. Use when creating topics, managing subscriptions, configuring message filtering, sending notifications, or setting up mobile push.

itsmostafa/aws-agent-skills · 32 tokens

sqs

AWS SQS message queue service for decoupled architectures. Use when creating queues, configuring dead-letter queues, managing visibility timeouts, implementing FIFO ordering, or integrating with Lambda.

itsmostafa/aws-agent-skills · 39 tokens