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.
git clone --depth 1 https://github.com/Farzannajipour/cursor-react-rulesWrote 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.
[](https://agentmods.dev/commands/farzannajipour/cursor-react-rules/create-api-client)<a href="https://agentmods.dev/commands/farzannajipour/cursor-react-rules/create-api-client"><img src="https://agentmods.dev/badge/commands/farzannajipour/cursor-react-rules/create-api-client/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.
<a href="https://agentmods.dev/commands/farzannajipour/cursor-react-rules/create-api-client"><img src="https://agentmods.dev/badge/commands/farzannajipour/cursor-react-rules/create-api-client.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.02037 |
| Opus 5.5 | $0.00000 | $0.00815 |
| Sonnet 5.5 | $0.00000 | $0.00407 |
| Haiku 4.5 | $0.00000 | $0.00204 |
Grade A, and why
create-api-client 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 1mo 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.
const response = await fetch(url, config); How it starts
The opening of the file, as written. The whole thing — 346 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Create API Client
Overview
Set up a centralized API client with error handling, interceptors, and TypeScript types.
Steps
-
Create base client
- Configure base URL
- Set default headers
- Add request/response interceptors
-
Add error handling
- Handle network errors
- Handle HTTP errors
- Format error messages
-
Create typed methods
- GET, POST, PUT, DELETE methods
- TypeScript generics for responses
- Request/response type safety
-
Add utilities
- Authentication token handling
- Request cancellation
- Retry logic
Template
Basic API Client
// lib/api-client.ts
class APIClient {
private baseURL: string;
private defaultHeaders: HeadersInit;
constructor(baseURL: string) {
this.baseURL = baseURL;
this.defaultHeaders = {
'Content-Type': 'application/json',
};
}
private async request<T>(
endpoint: string,
options: RequestInit = {}
): Promise<T> {
const url = `${this.baseURL}${endpoint}`;
const config: RequestInit = {
...options,
headers: {
...this.defaultHeaders,
...options.headers,
},
};
try {
const response = await fetch(url, config);
if (!response.ok) {
const error = await response.json().catch(() => ({}));
throw new APIError(
error.message || `HTTP ${response.status}: ${response.statusText}`,
response.status
);
}
// Handle empty responses
const contentType = response.headers.get('content-type');
if (contentType && contentType.includes('application/json')) {
return await response.json();
}
return {} as T;
} catch (error) {
if (error instanceof APIError) {
throw error;
}
throw new APIError('Network error', 0);
}
}
async get<T>(endpoint: string, options?: RequestInit): Promise<T> {
return this.request<T>(endpoint, { ...options, method: 'GET' });
}
async post<T>(endpoint: string, data?: any, options?: RequestInit): Promise<T> {
return this.request<T>(endpoint, {
...options,
method: 'POST',
body: JSON.stringify(data),
});
}
async put<T>(endpoint: string, data?: any, options?: RequestInit): Promise<T> {
return this.request<T>(endpoint, {
...options,
method: 'PUT',
body: JSON.stringify(data),
});
}
async delete<T>(endpoint: string, options?: RequestInit): Promise<T> {
return this.request<T>(endpoint, { ...options, method: 'DELETE' });
}
setAuthToken(token: string) {
this.defaultHeaders = {
...this.defaultHeaders,
Authorization: `Bearer ${token}`,
};
}
clearAuthToken() {
const { Authorization, ...rest } = this.defaultHeaders;
this.defaultHeaders = rest;
}
}
class APIError extends Error {
constructor(message: string, public status: number) {
super(message);
this.name = 'APIError';
}
}
export const apiClient = new APIClient(process.env.NEXT_PUBLIC_API_URL || '/api');
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.
- 1mo ago First seen · 346 lines · 0 tokens per session scan A b17f3d25f331
create-api-client is a command published in the GitHub repository Farzannajipour/cursor-react-rules (3 stars, last pushed 8mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,037 tokens. 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.
Other commands, from other repositories
init
Initialize configurations for Supabase local development.
http-service
Build, review or debug a Bun HTTP service. Loads the http-service skill, then works the task through its workflow.
api-contract-review
Review an API contract (shapes, errors, auth model) BEFORE implementation for naming, versioning, pagination, idempotency, and fit with existing endpoints. Use when designing or changing endpoints. Do not use when the API is already implemented (use review-hard or repo-consistency-sweep).
start-10-1
A guided lesson on setting up clasp, a command-line tool for managing Google Apps Script projects, and connecting it to Google’s Apps Script API.
build
Discover an AI Gateway's models and MCP tools, retrieve a credential, and integrate them into your app — call a model, connect MCP tools, or scaffold a runnable agent.
fastapi
FastAPI application design and implementation conventions. Use this skill when building, updating, or reviewing FastAPI services, routers, dependencies, request/response schemas, streaming endpoints, or API tests. Trigger on FastAPI-specific work such as path operation design, dependency injection, response models…