frontend-request-skill

frontend-request-skill is a skill for Claude Code, Codex from jiushiwon/wg-skills. It costs 66 tokens per session (5,985 once invoked), scanned A, original, Apache-2.0.

A design guide for the request layer of a frontend application, meaning the code that sends requests to a backend service and handles its responses. It covers web projects as well as uni-app projects for mobile apps, mini-programs, and web pages.

In plain words
What is it for?
Use it to design request wrappers, response and authentication interceptors, token-refresh queues, mock responses, request deduplication, file uploads, error messages, and Server-Sent Events for streaming updates such as AI chat replies.
Why use it?
It prevents every page from implementing authentication, errors, retries, duplicate-request prevention, and loading behavior differently. A shared request layer makes these network rules easier to maintain.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to design request wrappers, response and authentication interceptors, token-refresh queues, mock responses, request deduplication, file uploads, error messages, and Server-Sent Events for streaming updates such as AI chat replies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jiushiwon/wg-skills/frontend-request-skill
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.

Any agent
npx skills add jiushiwon/wg-skills --skill frontend-request-skill
Clone the repo
git clone --depth 1 https://github.com/jiushiwon/wg-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for frontend-request-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/jiushiwon/wg-skills/frontend-request-skill/github.svg)](https://agentmods.dev/skills/jiushiwon/wg-skills/frontend-request-skill)
Your own site
<a href="https://agentmods.dev/skills/jiushiwon/wg-skills/frontend-request-skill"><img src="https://agentmods.dev/badge/skills/jiushiwon/wg-skills/frontend-request-skill/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.

agentmods 80×15 button for frontend-request-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/jiushiwon/wg-skills/frontend-request-skill"><img src="https://agentmods.dev/badge/skills/jiushiwon/wg-skills/frontend-request-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,985 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Tool Misuse · line 72
    Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
    Fix: Override unsafe defaults with secure settings (verify=True, auth required, restrictive permissions). Review and harden all tool configurations.
  • medium Tool Misuse · line 180
    Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
    Fix: Override unsafe defaults with secure settings (verify=True, auth required, restrictive permissions). Review and harden all tool configurations.
How audits are shown
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.1 $0.00066 $0.05985
Opus 5.5 $0.00026 $0.02394
Sonnet 5.5 $0.00013 $0.01197
Haiku 4.5 $0.00007 $0.00598

Measured 23d ago against content hash 27c2ec658fb5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

frontend-request-skill 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 23d 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.

frontend/frontend-request-skill/SKILL.md · 457 lines

How it starts

The opening of the file, as written. The whole thing — 457 lines — stays where its author put it; the contents beside it link to each section on GitHub.

前端请求层设计 Skill

定位

只聚焦前端请求层设计:从 request.ts 出发,建立统一、健壮、可维护的请求体系。

本 skill 提供两层规范:

  1. 通用前端规范:面向 Web/H5/React/Vue 等标准前端项目,基于 fetch / axios 实现。
  2. uniapp 适配规范:面向 uni-app 小程序/APP/H5 跨端项目,基于 uni.request 实现。

二者核心思想完全一致(统一入口、响应信封、鉴权拦截、错误码映射、Token 刷新队列、SSE、上传),仅底层网络 API 不同。

本 skill 只处理请求相关逻辑,不依赖其他 skill。

前后端契约(强约定)

本 skill 的前端消费流程遵循 references/api-contract.md;响应信封、错误码、JWT、分页的公共定义以 backend/shared/ 为准,业务接口以项目 api-contract.md 为准。

该消费规范只定义前端落地方式:

  • 接口存放位置(vue/uniapp/react 统一 src/api/)
  • 接口存放位置(vue/uniapp/react 统一 src/api/)
  • 读取项目 api-contract.md 的顺序与目录落位
  • showError 参数语义(默认 false 自动弹,true 调用方自己处理)
  • HTTP 500 兜底(强制 swallow 用户 Toast,交给全局错误处理)

强约定:

  • 后端新生成业务 → 必须更新后端 api-contract.md
  • 前端新加接口 → 必须读取契约,按契约定义路径/字段/code
  • 契约变更必须前后端同步

解决的问题

痛点 后果 本技能方案
每个页面各自调原生请求 鉴权/错误处理重复 统一 request.ts
Token 过期无感知 用户操作失败 响应拦截器识别 401,统一交给 auth service 处理
重复点击导致重复请求 数据异常/资源浪费 防抖去重
后端接口未 ready 前端阻塞 Mock 机制
游客误触敏感接口 报错/白屏 请求层前置拦截
错误提示不统一 用户体验差 统一错误通知
SSE/流式接口不知如何接入 聊天/AI 回复无法流式展示 跨端 SSE 封装 + 打字机效果
Token 过期后并发请求全部失败 用户重复登录、数据丢失 Token 刷新队列 + 失败请求自动重试

When to Use

  • "请求封装"
  • "request.ts 怎么写"
  • "前端请求统一处理"
  • "uniapp 请求统一处理"
  • "接口拦截"
  • "Token 刷新"(请求层衔接部分,详见 references/auth-patterns.md)
  • "游客模式拦截"
  • "Mock 数据配置"
  • "接口防抖"
  • "错误处理"
  • "文件上传"
  • "SSE 流式请求"
  • "打字机效果"
  • "Server-Sent Events"
  • "AI 聊天流式回复"

When NOT to Use

  • 需要完整登录鉴权/权限设计 → 本 skill 只提供请求层衔接,完整鉴权体系需单独设计
  • 需要项目整体规范化/目录结构诊断 → 不在本 skill 范围内
  • 需要跨平台兼容性审计 → 不在本 skill 范围内

两层规范速查

规范 适用场景 底层 API 参考位置
通用前端规范 Web / H5 / React / Vue 等 fetch / axios references/frontend-spec.md
uniapp 适配规范 微信小程序 / App / H5 uni.request / uni.uploadFile references/uniapp-spec.md

Read the full file on GitHub · 457 lines

Files

What ships with it

9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 23d ago Changed 27c2ec658fb5
  2. 25d ago Changed f4e9ca008245
  3. 1mo ago Changed · +4 lines 924b24230b21
  4. 2mo ago Changed · +106 lines 7ab572d65d8e
  5. 3mo ago First seen · 347 lines · 66 tokens per session scan A fede8a5888f5

Subscribe to this mod's changes

frontend-request-skill is a skill published in the GitHub repository jiushiwon/wg-skills (154 stars, last pushed 6d ago), licensed Apache-2.0. It adds 66 tokens to every session and 5,985 once invoked, about $0.0003 per session on Opus 5.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-30.

Related

frontend-request-skill compared with skills from other repositories

frontend-request-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
frontend-request-skilljiushiwon/wg-skillsSkill1546d agoApache-2.0A66Claude Code, Codex
mem0-oss-to-platformmem0ai/mem0Skill70k3d agoApache-2.0A217Claude Code, Codex
tao-run-inference-serviceNVIDIA/skillsSkill4.2ktodayApache-2.0A92Claude Code
azure-mgmt-botservice-dotnetmicrosoft/skillsSkill3.3kyesterdayMITA78Claude Code
fastapi-router-pymicrosoft/skillsSkill3.3kyesterdayMITA46Claude Code
dev-runtimelangwatch/langwatchSkill5.1ktodayApache-2.0A172Claude Code
api-designericrisco/rsc-harnessSkill6915d agoMITA105Claude Code, Codex