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.
npx agentmods add skills/piyush8296/claude-workspace/api-layernpx skills add Piyush8296/claude-workspace --skill api-layergit 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.svg" alt="Measured on agentmods" 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 | $0.00056 | $0.01875 |
| Opus 5 | $0.00028 | $0.00937 |
| Sonnet 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 4d 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.
- 4d 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 4mo ago), licensed MIT. It adds 56 tokens to every session and 1,875 once invoked, about $0.0003 per session on Opus 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
ring:applying-composition-patterns
React composition patterns that scale. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or during architecture review. Skip for simple components with 1-2 props…
landing-page-generator
Generates high-converting landing pages as complete Next.js/React (TSX) components with Tailwind CSS. Creates hero sections, feature grids, pricing tables, FAQ accordions, testimonial blocks, and CTA sections using proven copy frameworks (PAS, AIDA, BAB). Outputs SEO meta tags, structured data, and…
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI).…
state-management
React Query and Zustand patterns for state management. Use when implementing data fetching, caching, mutations, or client-side state. Triggers on tasks involving useQuery, useMutation, Zustand stores, caching, or state management.
nextjs-app-router
Master Next.js 14+ App Router with Server Components, streaming, parallel routes, and advanced data fetching. Use when building Next.js applications, implementing SSR/SSG, or optimizing React Server Components.
typescript-react-patterns
TypeScript best practices for React development. Use when writing typed React components, hooks, events, refs, or generic components. Triggers on tasks involving TypeScript errors, type definitions, props typing, or type-safe React patterns.