More screenshots
Works with the AI Agents you already use
Full Stack API Integration & Security Suite
Automates type-safe SDK generation, OWASP sanitization, and unit tests from OpenAPI specs.
$51
Full Stack API Integration & Security Suite
Example session with this skill installed
Parse the OpenAPI spec located at ./openapi.json and generate a type-safe TypeScript SDK, a Zod runtime validation middleware layer, and a complete Jest unit test suite covering success and failure states.
- Read your context and instructions
- Compiled the full stack api
[SUCCESS] OpenAPI spec parsed successfully. Normalized 12 endpoints from ./openapi.json to ./manifest.json.
SUMMARY OF GENERATED ASSETS
This execution produced a complete 3-part integration package: a type-safe Fetch client with exponential backoff retries, an OWASP-compliant Zod input sanitization middleware, and a mock-driven Jest unit test suite covering success and failure states.
- Type-Safe Client SDK (src/apiClient.ts)
TypeScript
import { ZodError } from 'zod';
export class APIError extends Error {
constructor(public status: number, message: string, public details?: unknown) {
super(message);
this.name = 'APIError';
}
}
export interface FetchOptions extends RequestInit {
timeoutMs?: number;
retries?: number;
}
export async function fetchWithRetry<T>(url: string, options: FetchOptions = {}): Promise<T> {
const { timeoutMs = 5000, retries = 3, ...fetchOpts } = options;
let attempt = 0;
while (attempt < retries) {
try {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
const response = await fetch(url, { ...fetchOpts, signal: controller.signal });
clearTimeout(timeoutId);
if (!response.ok) {
const errorBody = await response.json().catch(() => ({}));
throw new APIError(response.status, response.statusText, errorBody);
}
return (await response.json()) as T;
} catch (err) {
attempt++;
if (attempt >= retries) throw err;
await new Promise((res) => setTimeout(res, Math.pow(2, attempt) * 250));
}
}
throw new APIError(500, 'Max retries exceeded');
}
- OWASP Input Validation Middleware (src/middleware/validate.ts)
TypeScript
import { Request, Response, NextFunction } from 'express';
import { z, ZodSchema } from 'zod';
export const UserRegistrationSchema = z.object({
email: z.string().email().trim().toLowerCase(),
password: z.string().min(12).max(128),
username: z.string().min(3).max(30).regex(/^[a-zA-Z0-9_]+$/)
});
export const validateBody = (schema: ZodSchema) => {
return (req: Request, res: Response, next: NextFunction) => {
try {
req.body = schema.parse(req.body);
next();
} catch (error) {
if (error instanceof ZodError) {
return res.status(400).json({
type: 'https://tools.ietf.org/html/rfc7807',
title: 'Invalid Request Body',
status: 400,
errors: error.errors
});
}
next(error);
}
};
};
- Jest Test Suite (src/tests/apiClient.test.ts)
TypeScript
import { fetchWithRetry, APIError } from '../apiClient';
global.fetch = jest.fn();
describe('fetchWithRetry Unit Tests', () => {
afterEach(() => jest.clearAllMocks());
it('should return parsed JSON data on 200 OK', async () => {
(global.fetch as jest.Mock).mockResolvedValueOnce({
ok: true,
json: async () => ({ id: 'usr_123', name: 'AlphaZolo' })
});
const data = await fetchWithRetry<{ id: string; name: string }>('https://api.example.com/user');
expect(data.id).toBe('usr_123');
});
it('should retry on network failure and succeed', async () => {
(global.fetch as jest.Mock)
.mockRejectedValueOnce(new Error('Network failure'))
.mockResolvedValueOnce({
ok: true,
json: async () => ({ status: 'active' })
});
const data = await fetchWithRetry('https://api.example.com/status', { retries: 2 });
expect(data).toEqual({ status: 'active' });
expect(global.fetch).toHaveBeenCalledTimes(2);
});
});
NEXT STEPS
Import validateBody(UserRegistrationSchema) into your Express routing pipeline to enforce payload sanitization.
Run npm test src/tests/apiClient.test.ts to execute automated test validation across all mock endpoints.
Connects securely to your tools. The creator never sees your data.
About this skill
The Full-Stack API Integration & Security Suite accelerates backend engineering workflows by converting raw OpenAPI (Swagger) v3.0/v3.1 definitions into production-ready frontend and backend integration components.
Key Features
Deterministic Spec Normalization: Python-powered script dereferences recursive $ref pointers and flattens endpoints, query params, and payloads into clean JSON manifests.
Type-Safe SDK Generation: Generates strongly typed TypeScript or Python client libraries featuring custom error classes (APIError, NetworkError) with zero any types.
OWASP Hardened Middleware: Automatically injects runtime input validation schemas (Zod/Joi), Helmet security headers, rate-limiting rules, and payload limit guards.
Resilient Execution Scaffolding: Equips API callers with exponential backoff retries, configurable request timeout signals, and circuit-breaker patterns.
Automated Unit Testing: Auto-generates complete Jest or PyTest test files covering 200 OK, 400 validation failures, 401 unauthorized errors, and 503 service timeouts via Mock Service Worker (msw).
OpenAPI Version Boundary: Native spec parsing is optimized for OpenAPI 3.0.x and 3.1.x (JSON/YAML). OpenAPI v2.0 (Swagger) specs require conversion to v3.0 prior to processing.
External Schema Dereferencing: Deeply nested local $ref pointers are automatically dereferenced, but external remote HTTP schema URIs require an active internet connection or local file download prior to execution.
Language Runtime Target: Automated code generation output targets TypeScript (Node.js 18+ / Bun / Deno) and Python 3.8+ runtimes. Other target languages (Go, Rust, Java) are not included in this release.
Dynamic Validation Boundaries: Generated Zod schemas enforce strict structural, format, and type validation; business-logic validation (such as database uniqueness checks) must be implemented inside your controller layer.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago