/spdd-api-test

/spdd-api-test is a command for Cursor from gszhangwei/open-spdd. It costs 26 tokens per session (6,698 once invoked), scanned A, original, MIT.

A command that generates a standalone shell script containing cURL requests for testing API endpoints. cURL is a command-line tool for sending web requests and checking responses.

In plain words
What is it for?
Use it to test endpoint scenarios described in source code, acceptance criteria, or an API specification. The generated script is saved as scripts/test-api.sh.
Why use it?
It turns API requirements or generated code into repeatable tests and shows expected versus actual results in tables, making failures easier to review.

Command for Cursor

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 commands/gszhangwei/open-spdd/spdd-api-test
Clone the repo
git clone --depth 1 https://github.com/gszhangwei/open-spdd

Made for: Cursor.

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 /spdd-api-test

README.md
[![agentmods](https://agentmods.dev/badge/commands/gszhangwei/open-spdd/spdd-api-test.svg)](https://agentmods.dev/commands/gszhangwei/open-spdd/spdd-api-test)
Your own site
<a href="https://agentmods.dev/commands/gszhangwei/open-spdd/spdd-api-test"><img src="https://agentmods.dev/badge/commands/gszhangwei/open-spdd/spdd-api-test.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,698 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00026 $0.06698
Opus 5 $0.00013 $0.03349
Sonnet 5 $0.00005 $0.01340
Haiku 4.5 $0.00003 $0.00670

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

Security

Grade A, and why

/spdd-api-test scanned grade A with 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

# - No external dependencies (no jq, only curl and bash)
.cursor/commands/spdd-api-test.md · 657 lines

How it starts

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

Generate a comprehensive, self-contained shell script (scripts/test-api.sh) with cURL commands to test all API scenarios defined in the codebase or acceptance criteria.

Key Feature: Structured Test Case Tables

The generated script includes human-reviewable test case tables:

  1. At script top: A structured table showing all test scenarios, inputs, and expected outputs
  2. After execution: A results table showing expected vs actual results with pass/fail status

This makes it easy for humans to:

  • Review test coverage at a glance
  • Verify expected values are correct
  • Quickly identify which tests failed and why

Input: The argument after /spdd-api-test is a reference to generated code, acceptance criteria document, or API specification.

Input can be provided in several ways:

  1. File/folder reference: Using @ to reference files containing API implementations or ACs
  2. Text description: Direct text describing the API endpoints to test
  3. Combined: Both file references and additional context

Examples:

# Reference to generated code
/spdd-api-test @src/main/java/com/example/controller/BillingController.java

# Reference to acceptance criteria
/spdd-api-test @spdd/prompt/GGQPA-XXX-202603131530-[Feat]-token-usage-billing.md

# Reference to multiple files
/spdd-api-test @src/controllers/ @requirements/api-spec.md

# With additional context
/spdd-api-test @src/api/ test the billing endpoints with edge cases for zero tokens

Steps

  1. Validate and consolidate input context

    a. If no input provided, use the AskUserQuestion tool (open-ended, no preset options) to ask:

    "Please provide the API implementation files, acceptance criteria, or API specification to generate tests for (you can use @file references or text description)."

    IMPORTANT: Do NOT proceed without input context.

    b. If input contains @ file/folder references:

    • Read ALL referenced files completely using the Read tool
    • For folder references, read all relevant API-related files (controllers, routes, handlers)
    • Consolidate all file contents into a unified API context

    c. Extract API information:

    • Identify all API endpoints (HTTP method, path, request body schema)
    • Extract acceptance criteria and expected behaviors
    • Identify validation rules and error scenarios
    • Note any seed data or test data requirements
  2. Identify seed data and test fixtures

    a. Search for existing seed data:

    • Look for seed SQL files, fixtures, or test data in common locations:
      • src/main/resources/db/migration/
      • src/test/resources/
      • fixtures/
      • seed/
      • scripts/seed*.sql
    • Read relevant seed files to understand available test data

    b. Document available test entities:

    • Customer IDs, names, and states
    • Plan IDs, pricing configurations
    • Quota configurations and limits
    • Any other domain-specific test data

    c. If no seed data found, derive test data from:

    • Entity definitions in the codebase
    • Example values in acceptance criteria
    • Common test data patterns
  3. Design structured test case tables

    Before generating the script, organize test cases into logical tables by test pattern.

    Group tests by their input/output structure:

    a. Validation Error Tests (expect HTTP 400/404):

    | Test ID | Description              | Customer     | Model      | Prompt | Completion | HTTP | Expected Error           |
    |---------|--------------------------|--------------|------------|--------|------------|------|--------------------------|
    | AC1.1   | Missing modelId          | CUST-001     | (missing)  | 1000   | 500        | 400  | Model ID is required     |
    | AC1.2   | Missing customerId       | (missing)    | fast-model | 1000   | 500        | 400  | Customer ID is required  |
    | AC1.6   | Non-existent customer    | NON-EXISTENT | fast-model | 1000   | 500        | 404  | Customer not found       |
    

Read the full file on GitHub · 657 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 · 657 lines · 26 tokens per session scan A 1bd87f056a6d

Subscribe to this mod's changes

/spdd-api-test is a command published in the GitHub repository gszhangwei/open-spdd (736 stars, last pushed 13d ago), licensed MIT. It adds 26 tokens to every session and 6,698 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.