Borrowing it
Nothing to install: this file belongs to Piyush8296/claude-workspace. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Piyush8296/claude-workspace/main/.claude/skills/api-layer/SKILL.mdgit clone --depth 1 https://github.com/Piyush8296/claude-workspaceWrote 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/skills/piyush8296/claude-workspace/api-layer)<a href="https://agentmods.dev/skills/piyush8296/claude-workspace/api-layer"><img src="https://agentmods.dev/badge/skills/piyush8296/claude-workspace/api-layer/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/skills/piyush8296/claude-workspace/api-layer"><img src="https://agentmods.dev/badge/skills/piyush8296/claude-workspace/api-layer.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.00056 | $0.01875 |
| Opus 5.5 | $0.00022 | $0.00750 |
| Sonnet 5.5 | $0.00011 | $0.00375 |
| Haiku 4.5 | $0.00006 | $0.00187 |
Grade A, and why
api-layer 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 res = await fetch(url.toString(), { How it starts
The opening of the file, as written. The whole thing — 273 lines — stays where its author put it; the contents beside it link to each section on GitHub.
API Layer
Architecture
Never scatter raw fetch() calls across components. Build a typed API client that handles auth, errors, retries, and cancellation in one place.
Component → TanStack Query hook → API client function → fetchClient (interceptors) → fetch()
Typed Fetch Client
// lib/api/client.ts
import { env } from '@/lib/env';
interface FetchOptions extends Omit<RequestInit, 'body'> {
body?: unknown;
params?: Record<string, string | number | undefined>;
timeout?: number;
}
class ApiError extends Error {
constructor(
public status: number,
public statusText: string,
public data: unknown,
public url: string,
) {
super(`${status} ${statusText}: ${url}`);
this.name = 'ApiError';
}
get isUnauthorized() { return this.status === 401; }
get isForbidden() { return this.status === 403; }
get isNotFound() { return this.status === 404; }
get isRateLimit() { return this.status === 429; }
get isServerError() { return this.status >= 500; }
}
async function fetchClient<T>(path: string, options: FetchOptions = {}): Promise<T> {
const { body, params, timeout = 10_000, headers: customHeaders, ...rest } = options;
// Build URL with query params
const url = new URL(path, env.API_BASE_URL);
if (params) {
Object.entries(params).forEach(([k, v]) => {
if (v !== undefined) url.searchParams.set(k, String(v));
});
}
// Timeout via AbortController
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), timeout);
try {
const res = await fetch(url.toString(), {
...rest,
signal: controller.signal,
headers: {
'Content-Type': 'application/json',
...customHeaders,
},
body: body ? JSON.stringify(body) : undefined,
});
if (!res.ok) {
const data = await res.json().catch(() => null);
throw new ApiError(res.status, res.statusText, data, url.toString());
}
// Handle 204 No Content
if (res.status === 204) return undefined as T;
return res.json() as Promise<T>;
} finally {
clearTimeout(timer);
}
}
export { fetchClient, ApiError };
export type { FetchOptions };
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 · 273 lines · 56 tokens per session scan A bad6f8074f81
api-layer is a skill published in the GitHub repository Piyush8296/claude-workspace (2 stars, last pushed 6mo ago), licensed MIT. It adds 56 tokens to every session and 1,875 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.
Other skills, from other repositories
senior-dev
Activates the SeniorDev agent for full-stack software engineering. Use this skill when you need production-ready code: Next.js 14 frontends, FastAPI backends, TypeScript strict-mode components, PostgreSQL schemas, Redis caching, authentication flows, or complete REST/GraphQL APIs. SeniorDev always outputs complete…
fullstack-developer
Modern web development expertise covering React, Node.js, databases, and full-stack architecture. Use when: building web applications, developing APIs, creating frontends, setting up databases, deploying web apps, or when user mentions React, Next.js, Express, REST API, GraphQL, MongoDB, PostgreSQL, or full-stack…
authentication-patterns
OAuth 2.0, JWT, SSO, MFA, NextAuth/Clerk/Supabase Auth implementation patterns.
email-systems
Transactional email (Resend, SendGrid, SES), templates (React Email, MJML), deliverability (SPF/DKIM/DMARC), and inboxing best practices. Use when building email infrastructure, designing templates, or troubleshooting deliverability.
microservices-architecture
Microservices architecture patterns and best practices. Use when designing distributed systems, breaking down monoliths, or implementing service communication.
event-driven-architecture
Kafka, RabbitMQ, SQS/SNS, event sourcing, CQRS, saga patterns, dead letter queues, and idempotency. Use when designing asynchronous systems, implementing message-driven workflows, or building event streaming pipelines.