autoframe: Skill for Claude Code

.claude/skills/new-api-spec/SKILL.md

new-api-spec is a skill for Claude Code from kint4/autoframe. It costs 41 tokens per session (704 once invoked), scanned A, original, MIT.

A generator for Playwright tests that call an API, which is a program interface used by software to exchange data. It creates cases for successful requests, errors, authentication failures, and invalid input.

In plain words
What is it for?
Use it with an endpoint and HTTP methods such as GET or POST to create a test file that checks status codes, response shapes, authentication, and invalid requests.
Why use it?
It provides a consistent starting point for checking both API responses and the data structure returned by an endpoint.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is kint4/autoframe's own configuration. It tells Claude Code how to work on autoframe 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 autoframe configures →

Reuse

Borrowing it

Nothing to install: this file belongs to kint4/autoframe. 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/kint4/autoframe/main/.claude/skills/new-api-spec/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/kint4/autoframe

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 new-api-spec

README.md
[![agentmods](https://agentmods.dev/badge/skills/kint4/autoframe/new-api-spec/github.svg)](https://agentmods.dev/skills/kint4/autoframe/new-api-spec)
Your own site
<a href="https://agentmods.dev/skills/kint4/autoframe/new-api-spec"><img src="https://agentmods.dev/badge/skills/kint4/autoframe/new-api-spec/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 new-api-spec

Your own site · 80×15
<a href="https://agentmods.dev/skills/kint4/autoframe/new-api-spec"><img src="https://agentmods.dev/badge/skills/kint4/autoframe/new-api-spec.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 704 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00041 $0.00704
Opus 5.5 $0.00016 $0.00282
Sonnet 5.5 $0.00008 $0.00141
Haiku 4.5 $0.00004 $0.00070

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

Security

Grade A, and why

new-api-spec 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 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.

Makes network callslowCapability

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

2. **Probe the endpoint first** (one `curl` per case) to learn its real semantics before
.claude/skills/new-api-spec/SKILL.md · 62 lines

How it starts

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

/new-api-spec — Generate an API Test File

Type: API Description: Generates a Playwright API test file for a given endpoint, covering success, error, auth failure, and invalid input with response schema validation.


Input Format

The user provides:

  • An endpoint path (e.g. /api/users)
  • The HTTP methods to cover (GET / POST / PUT / DELETE)
  • Optionally, the expected response shape and auth requirement

Ask up to 3 clarifying questions if the schema or auth model is unclear.

Output Format

An API test file at tests/api/[feature-name]/[feature].api.spec.ts following the API conventions in CLAUDE.md:

  • Imports test, expect from @playwright/test
  • Uses the request fixture
  • Validates status code and response schema with toMatchObject
  • Uses process.env.API_TOKEN for auth — never hardcoded
  • Covers success, error, auth failure (401), and invalid input (400)

Step-by-Step Instructions

  1. Read the API test conventions in CLAUDE.md.
  2. Probe the endpoint first (one curl per case) to learn its real semantics before writing assertions. Two common deviations from the template:
    • Some APIs always answer HTTP 200 and embed the real status in the body (e.g. {"responseCode": 405}). Assert on the body field, and note the quirk in a comment at the top of the spec.
    • Some APIs serve JSON with a text/html content type — use JSON.parse(await response.text()) instead of response.json() if parsing fails.
  3. Match the API's actual auth model. Bearer tokens are the template default, but not universal — if auth is credential-based (e.g. a verifyLogin endpoint), the "auth failure" case is wrong/missing credentials, not a missing header.
  4. Determine the feature folder (kebab-case) and file name with the .api.spec.ts suffix.
  5. For each method, generate tests covering:
    • Success — valid request → expected status + schema (toMatchObject).
    • Auth failure — no/invalid token → 401 (or the API's credential-failure equivalent).
    • Invalid input — bad payload → 400.
    • Error/edge — not found, conflict, unsupported method, etc., as relevant.
  6. Read auth tokens and URLs from environment variables only. Use data/factories/ for request payloads that need realistic data.
  7. Group tests in a test.describe('[Endpoint] API') block.
  8. Save to tests/api/[feature-name]/[feature].api.spec.ts.
  9. Suggest /api-coverage to see overall API coverage.

Read the full file on GitHub · 62 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. 2mo ago First seen · 62 lines · 41 tokens per session scan A adc2639b899a

Subscribe to this mod's changes

new-api-spec is a skill published in the GitHub repository kint4/autoframe (8 stars, last pushed 4mo ago), licensed MIT. It adds 41 tokens to every session and 704 once invoked, about $0.0002 per session on Opus 5.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-31.