fetch-api-data

A frontend guide for retrieving data from an API and starting a data-generation process, including handling API errors and receiving real-time updates.

In plain words
What is it for?
Use it when a frontend feature needs to fetch API results, handle an ApiError, start generation, or monitor generation progress.
Why use it?
It provides consistent patterns for connecting the interface to server data and for reporting failures during those requests.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/jnzader/repoforge/api
Any agent
npx skills add JNZader/repoforge --skill api
Clone the repo
git clone --depth 1 https://github.com/JNZader/repoforge

Made for: Claude Code, Codex.

Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 534 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00026 $0.00534
Opus 5 $0.00013 $0.00267
Sonnet 5 $0.00005 $0.00107
Haiku 4.5 $0.00003 $0.00053

Measured 2d ago against content hash eee775af3547, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fetch-api-data 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 2d 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.

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.

.claude/skills/frontend/api/SKILL.md · 99 lines

What it actually says

fetch-api-data

This skill covers patterns for fetching and managing API data.

Trigger: When working with API interactions in the frontend.

Quick Reference

Task Pattern
Fetch API data fetchApi
Start a generation process startGeneration

Critical Patterns (Summary)

  • Fetch API Data: Use fetchApi to retrieve data from the API.
  • Start Generation Process: Utilize startGeneration to initiate a data generation process.

Critical Patterns (Detailed)

Fetch API Data

Use fetchApi to retrieve data from the API, handling errors with ApiError.

import { fetchApi, ApiError } from './lib/api';

async function getData() {
  try {
    const data = await fetchApi('/endpoint');
    console.log(data);
  } catch (error) {
    if (error instanceof ApiError) {
      console.error('API Error:', error.message);
    }
  }
}

Start Generation Process

Utilize startGeneration to initiate a data generation process, allowing for real-time updates.

import { startGeneration } from './lib/api';

function initiateGeneration() {
  startGeneration({ type: 'example' })
    .then(response => console.log('Generation started:', response))
    .catch(error => console.error('Error starting generation:', error));
}

When to Use

  • When you need to fetch data from an external API.
  • When initiating a data generation process that requires real-time updates.

Commands

docker-compose up
python repoforge/cli.py fetch-data

Anti-Patterns

Don't: Ignore ApiError Handling

Ignoring ApiError can lead to unhandled exceptions and poor user experience.

// BAD
async function getData() {
  const data = await fetchApi('/endpoint'); // No error handling
  console.log(data);
}
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. 2d ago First seen · 99 lines · 26 tokens per session scan A eee775af3547

Subscribe to this mod's changes

fetch-api-data is a skill published in the GitHub repository JNZader/repoforge (5 stars, last pushed 8d ago), licensed MIT. It adds 26 tokens to every session and 534 once invoked, about $0.0001 per session on Opus 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-31.

Related

Other skills, from other repositories

html-ppt-zhangzara-capsule

A year-end self-review for a product manager — the role, the outcomes, the learning, and the ask, all evidence-backed. Built as a decision-grade career deck for manager, review committee.

nexu-io/open-design · 52 tokens

html-ppt-zhangzara-neo-grid-bold

A designer's portfolio narrative for a senior interview — three case studies, the craft, and the judgment behind each. Built as a decision-grade career deck for hiring panel.

nexu-io/open-design · 47 tokens

html-ppt-xhs-white-editorial

A staff-engineer promotion packet — scope, the proof moments, the artifacts, and the impact that clears the bar. Built as a decision-grade career deck for manager, calibration committee.

nexu-io/open-design · 46 tokens

multi-program-manager

Manage and compare multiple affiliate programs as a portfolio. Triggers on: "manage my affiliate programs", "compare my programs", "portfolio overview", "which program should I focus on", "diversify my affiliate income", "program switching", "affiliate portfolio", "program comparison", "revenue allocation", "which…

Affitor/affiliate-skills · 82 tokens

tailwind-css-patterns

Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.

figueroaignacio/ignaciofigueroa.dev · 62 tokens

criador-de-portfolio

Construção de portfólio profissional digital: seleção e apresentação de projetos, estrutura de cases com problema-solução-resultado, showcase de habilidades e estratégia de distribuição para atrair clientes e recrutadores.

ricneves-ai/flowgrammers-skills · 46 tokens