copilot-dev: Skill for Claude Code

.github/skills/api-endpoint-generator/SKILL.md

api-endpoint-generator is a skill for Claude Code from timothywarner/copilot-dev. It costs 92 tokens per session (2,277 once invoked), scanned A, original, MIT.

A generator for REST API endpoints, which are web routes that let software read or change data, in Express.js with TypeScript or FastAPI with Python.

In plain words
What is it for?
Use it to scaffold routes such as creating users or fetching orders, after specifying the framework, resource, method, path, data fields, response, and business rules.
Why use it?
It helps turn an endpoint request into a consistent starting structure with validation, typed inputs and outputs, error handling, documentation, and a test stub.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

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

Reuse

Borrowing it

Nothing to install: this file belongs to timothywarner/copilot-dev. 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/timothywarner/copilot-dev/main/.github/skills/api-endpoint-generator/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/timothywarner/copilot-dev

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 api-endpoint-generator

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/timothywarner/copilot-dev/api-endpoint-generator"><img src="https://agentmods.dev/badge/skills/timothywarner/copilot-dev/api-endpoint-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 92 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,277 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.00092 $0.02277
Opus 5.5 $0.00037 $0.00911
Sonnet 5.5 $0.00018 $0.00455
Haiku 4.5 $0.00009 $0.00228

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

Security

Grade A, and why

api-endpoint-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 2mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (endpoint-template.py, endpoint-template.ts), 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.

.github/skills/api-endpoint-generator/SKILL.md · 268 lines

How it starts

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

API Endpoint Generator Skill

You are an expert API designer. When this skill activates, you generate complete, production-ready REST API endpoints for either TypeScript/Express or Python/FastAPI. Follow every step below exactly.

Step 1: Gather Requirements

Before generating any code, determine:

  1. Framework: TypeScript + Express, or Python + FastAPI?
  2. Resource: What entity is being managed? (e.g., User, Order, Product)
  3. HTTP method and path: GET /users/:id, POST /products, etc.
  4. Input shape: What fields does the request body, path params, or query params contain?
  5. Output shape: What does a success response look like?
  6. Business rules: Any constraints on the input? (e.g., email must be unique, age >= 18)

If any of these are missing from the user's prompt, ask for them before generating.

Step 2: Apply the Standard Output Structure

Every generated endpoint must include all five layers:

Layer Purpose
Schema / Validator Zod (TS) or Pydantic (Python) defines input shape and validates at the boundary
Route Handler The async function that orchestrates validation, logic, and response
Typed Request/Response TypeScript generics or Python type hints — no any, no dict without hints
Error Handling RFC 7807 Problem Details format for all 4xx/5xx responses
Unit Test Stub Vitest (TS) or pytest (Python) — all happy path + key error paths

Step 3: TypeScript / Express Pattern

Follow this exact template for TypeScript endpoints:

import { Router, Request, Response, NextFunction } from 'express';
import { z } from 'zod';

// --- 1. Input schema (validates and infers the TS type simultaneously) ---
const CreateUserSchema = z.object({
  email: z.string().email({ message: 'Must be a valid email address' }),
  name: z.string().min(2).max(100),
  age: z.number().int().min(0).max(150),
});

// Infer the TypeScript type from the schema — single source of truth
type CreateUserInput = z.infer<typeof CreateUserSchema>;

// --- 2. Response type ---
interface UserResponse {
  id: string;
  email: string;
  name: string;
  createdAt: string;
}

// --- 3. Route handler ---
/**
 * POST /users
 *
 * Creates a new user account.
 *
 * @param req.body - {@link CreateUserInput}
 * @returns 201 with the created {@link UserResponse}
 * @throws 400 if the request body fails validation
 * @throws 409 if the email address is already registered
 */
async function createUser(
  req: Request,
  res: Response<UserResponse>,
  next: NextFunction,
): Promise<void> {
  // Validate input — parse() throws ZodError on failure
  const parseResult = CreateUserSchema.safeParse(req.body);

  if (!parseResult.success) {
    // RFC 7807 Problem Details — consistent error envelope
    res.status(400).json({
      type: 'https://errors.myapp.com/validation-error',
      title: 'Validation Error',
      status: 400,
      detail: 'One or more fields failed validation.',
      errors: parseResult.error.flatten().fieldErrors,
    } as any);
    return;
  }

  // parseResult.data is now fully typed as CreateUserInput
  const input: CreateUserInput = parseResult.data;

  try {
    // Replace with your actual service/repository call
    const user = await userService.create(input);

    // Return immutable response — never mutate the entity object directly
    res.status(201).json({
      id: user.id,
      email: user.email,
      name: user.name,
      createdAt: user.createdAt.toISOString(),
    });
  } catch (error) {
    // Delegate unexpected errors to Express error middleware
    next(error);
  }
}

// --- 4. Router registration ---
export const userRouter = Router();
userRouter.post('/', createUser);

Read the full file on GitHub · 268 lines

Files

What ships with it

2 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. 2mo ago First seen · 268 lines · 92 tokens per session scan A c3d3f0d47c82

Subscribe to this mod's changes

api-endpoint-generator is a skill published in the GitHub repository timothywarner/copilot-dev (46 stars, last pushed 1mo ago), licensed MIT. It adds 92 tokens to every session and 2,277 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

sync-new-data-type

Adds scaffolding for a new Sync data type in Chromium across protocol buffers, DataType definitions, feature flags, controller builders, unit tests, and metrics.

chromium/chromium · 36 tokens

generate-testability-wrappers

DO NOT USE when the target already consumes an injected interface or built-in abstraction such as IFileSystem or TimeProvider, even if the request says "generate a wrapper"; no new wrapper is needed. Use only when C# source calls an ambient/static dependency and no injectable seam exists: first-time TimeProvider…

dotnet/skills · 147 tokens

convex-test

Generate convex-test tests for the app's Convex functions.

openclaw/clawhub · 16 tokens

testing

Testing and code quality context for Jest, React Testing Library, ESLint, and test patterns. Use when writing tests or fixing linting issues.

Team-Commonly/commonly · 31 tokens

platform-apex-test-generate

Use to generate and validate Apex test classes with TestDataFactory patterns, bulk testing (251+ records), mocking, assertions, and disciplined test-fix loops. Use when creating Apex test classes (for triggers, services, controllers, batch jobs, queueables, and callouts), improving coverage, debugging or fixing…

forcedotcom/sf-skills · 116 tokens

platform-apex-test-run

Apex test execution, coverage analysis, and test-fix loops with 120-point scoring. Use when the user runs Apex tests, checks code coverage, fixes failing tests, or touches Test.cls / Test.cls files. DO NOT TRIGGER when writing Apex production code (use platform-apex-generate), Agentforce agent testing (use…

forcedotcom/sf-skills · 92 tokens