API Reviewer
mitchdenny/hex1b
Guidelines for reviewing API design in the Hex1b codebase. An agent skill from mitchdenny/hex1b.
A skill your agent uses when designing or reviewing the request layer of a frontend project (web / uni-app / mini-program), including request.ts wrappers, interceptors, deduplication, mocks, error…
$ npx skills add jiushiwon/wg-skills --skill frontend-request-skill -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jiushiwon/wg-skills frontend-request-skill --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/vibeCoding/frontend/frontend-request-skill .claude/skills/frontend-request-skill && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "frontend-request-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/frontend/frontend-request-skill into .claude/skills/frontend-request-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "frontend-request-skill", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/frontend/frontend-request-skillType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add jiushiwon/wg-skills --skill frontend-request-skill -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jiushiwon/wg-skills frontend-request-skill --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/vibeCoding/frontend/frontend-request-skill .agents/skills/frontend-request-skill && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "frontend-request-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/frontend/frontend-request-skill into .agents/skills/frontend-request-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "frontend-request-skill", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jiushiwon/wg-skills --skill frontend-request-skill -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jiushiwon/wg-skills frontend-request-skill --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/vibeCoding/frontend/frontend-request-skill .cursor/skills/frontend-request-skill && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "frontend-request-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/frontend/frontend-request-skill into .cursor/skills/frontend-request-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "frontend-request-skill", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/jiushiwon/wg-skills.git --path vibeCoding/frontend/frontend-request-skill--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add jiushiwon/wg-skills --skill frontend-request-skill -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jiushiwon/wg-skills frontend-request-skill --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/vibeCoding/frontend/frontend-request-skill .gemini/skills/frontend-request-skill && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "frontend-request-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/frontend/frontend-request-skill into .gemini/skills/frontend-request-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "frontend-request-skill", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install jiushiwon/wg-skills frontend-request-skillInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add jiushiwon/wg-skills --skill frontend-request-skill -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/vibeCoding/frontend/frontend-request-skill .github/skills/frontend-request-skill && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "frontend-request-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/frontend/frontend-request-skill into .github/skills/frontend-request-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "frontend-request-skill", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jiushiwon/wg-skills --skill frontend-request-skill -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install jiushiwon/wg-skills frontend-request-skill --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/vibeCoding/frontend/frontend-request-skill .opencode/skills/frontend-request-skill && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "frontend-request-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/frontend/frontend-request-skill into .opencode/skills/frontend-request-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "frontend-request-skill", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
frontend-request-skillA skill your agent uses when designing or reviewing the request layer of a frontend project (web / uni-app / mini-program), including request.ts wrappers, interceptors, deduplication, mocks, error…
Frontend Request Skill is an agent skill from jiushiwon/wg-skills. Use when designing or reviewing the request layer of a frontend project (web / uni-app / mini-program), including request.ts wrappers, interceptors, deduplication, mocks, error handling, file upload, SSE streaming, or token refresh. Provides both a general frontend specification and a uniapp-specific adapter.
Its SKILL.md is about 3.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files, including reference files (for example `README.md`, `references/api-contract.md` and `references/auth-patterns.md`).
It sits in Backend & APIs, covering File uploads and storage, Data cleaning and API design. It works with React and Vue.js. The licence is Apache-2.0.
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 3569fb8. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
NO_AUTH_TOKENFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Frontend Request Skill loads about 3.6k tokens when it runs, and up to ~30k if it reads all its reference files. Until then it costs about 83 tokens; SKILL.md has 788 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from jiushiwon/wg-skills at commit 3569fb8, republished under its Apache-2.0 licence (© jiushiwon). 788 words, ~3,559 tokens.
.claude/skills/frontend-request-skill/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.只聚焦前端请求层设计:从 request.ts 出发,建立统一、健壮、可维护的请求体系。
本 skill 提供两层规范:
fetch / axios 实现。uni.request 实现。二者核心思想完全一致(统一入口、响应信封、鉴权拦截、错误码映射、Token 刷新队列、SSE、上传),仅底层网络 API 不同。
本 skill 只处理请求相关逻辑,不依赖其他 skill。
本 skill 的所有规范必须与
references/api-contract.md严格对齐。该契约文档是前后端桥接的唯一真理源,定义:
- 接口存放位置(vue/uniapp/react 统一
src/api/)- 登录页/管理页接口契约
- 请求头规范(Authorization / Content-Type / X-Request-ID)
- 响应信封
{ code, message, data }- 错误码契约(
code<0异常,>=0成功,-1特殊 = JWT 鉴权失效)- showError 参数语义(默认
false自动弹,true调用方自己处理)- HTTP 500 兜底(强制 swallow 用户 Toast,交给全局错误处理)
强约定:
api-contract.md| 痛点 | 后果 | 本技能方案 |
|---|---|---|
| 每个页面各自调原生请求 | 鉴权/错误处理重复 | 统一 request.ts |
| Token 过期无感知 | 用户操作失败 | 响应拦截器识别 401,统一交给 auth service 处理 |
| 重复点击导致重复请求 | 数据异常/资源浪费 | 防抖去重 |
| 后端接口未 ready | 前端阻塞 | Mock 机制 |
| 游客误触敏感接口 | 报错/白屏 | 请求层前置拦截 |
| 错误提示不统一 | 用户体验差 | 统一错误通知 |
| SSE/流式接口不知如何接入 | 聊天/AI 回复无法流式展示 | 跨端 SSE 封装 + 打字机效果 |
| Token 过期后并发请求全部失败 | 用户重复登录、数据丢失 | Token 刷新队列 + 失败请求自动重试 |
| 规范 | 适用场景 | 底层 API | 参考位置 |
|---|---|---|---|
| 通用前端规范 | Web / H5 / React / Vue 等 | fetch / axios | references/frontend-spec.md |
| uniapp 适配规范 | 微信小程序 / App / H5 | uni.request / uni.uploadFile | references/uniapp-spec.md |
二者仅在「底层网络 API」和「Token 存储方式」上有差异;响应信封、错误码、鉴权拦截、去重、Mock、SSE 解析逻辑完全一致。
| 能力 | 关键选项 | 参考位置 |
|---|---|---|
| 前后端契约 | 接口位置 / 错误码 / JWT | references/api-contract.md |
| 统一请求 | request<T>(options) | references/frontend-spec.md、references/uniapp-spec.md |
| Token 注入 | needAuth、authMode | references/auth-patterns.md |
| 401/403 处理 | skipAuthHandler | references/auth-patterns.md |
| 防抖去重 | skipDebounce | references/request-impl.md |
| Mock 数据 | USE_MOCK | references/mock-guide.md |
| 错误提示 | showError | references/error-handling.md |
| 文件上传 | upload<T>(options) | references/error-handling.md |
| SSE 流式请求 | sse<T>(options, onMessage) | references/sse-guide.md |
| Token 自动刷新 | auth.service.ts 队列 | references/auth-patterns.md |
强约定:所有前端项目(vue / uniapp / react)接口统一存放在
src/api/下。详细目录约定见 api-contract.md §2。
src/
├── api/ # 前后端桥接层(frontend-request-skill 管理)
│ ├── request.ts # 统一请求封装(核心)
│ ├── upload.ts # 文件上传封装
│ ├── sse.ts # SSE 流式请求封装
│ ├── modules/ # 业务模块 API(auth / user / role / menu / ...)
│ ├── _mocks_/ # Mock 数据字典
│ │ ├── index.ts # MOCK_MAP + MockEntry
│ │ └── *.mock.ts # 各模块 Mock
│ └── types/ # 接口请求/响应类型
├── services/
│ └── auth.service.ts # 鉴权服务:login / logout / handleUnauthorized
├── config/
│ ├── api.config.ts # BASE_URL / 超时 / Mock / 成功码 / 鉴权失败码 / 重试
│ └── error.config.ts # 错误码映射(与 api-contract.md 错误码表对齐)
├── utils/
│ ├── auth.ts # getToken / setToken
│ ├── toast.ts # 错误提示工具
│ └── error.ts # 错误信息提取
└── composables/
├── useAuth.ts # 游客判断 Hook
└── useTypewriter.ts # 打字机效果 Hook禁止把接口散落到
pages/api/、views/api/、utils/api/、service/等位置。uniapp 项目同样使用
src/api/,H5/小程序/App 三端一致。
本 skill 采用统一的响应结构(响应信封),与后端接口契约严格对齐:
export interface ApiResponse<T = any> {
code: number; // 业务状态码
message: string; // 提示信息
data: T; // 业务数据
}| code 范围 | 含义 | 处理方式 |
|---|---|---|
code = 0 | 业务成功 | 正常返回 data |
code < 0 | 业务异常 | 抛出 RequestError,错误码为对应的负数值 |
code = -1 | JWT 鉴权失效(未登录 / Token 无效 / 过期 / 未传递) | 触发 Token 刷新流程,等同 HTTP 401 |
code > 0 | 按项目约定(若存在) | 默认也视为业务异常 |
本项目示例默认
SUCCESS_CODES = [0]、AUTH_FAILURE_CODES = [-1]。如果你的后端约定不同,请在src/config/api.config.ts中调整。
核心约定:默认请求层自动弹 Toast,传
showError: true时不弹,调用方自己处理。
| 取值 | 含义 | 默认 |
|---|---|---|
false(默认) | 请求层按 ERROR_CODE_MAP 自动弹 Toast | ✅ |
true | 请求层不弹,调用方自行 try/catch 处理 | — |
设计理由:默认自动弹覆盖 80% 场景(页面直取数据);少数特殊场景(轮询、上传队列、批量提交)传
showError: true让调用方自己处理。
HTTP 500 / 502 / 503 / 504 类错误前端不弹任何用户 Toast。
理由:500 是服务端问题,用户弹 Toast 也无法解决;交给全局错误处理(Sentry / 监控平台 / 后端日志)。
业务调用方仍可感知(用于降级逻辑),但用户无感。
HTTP 层错误与业务 code 互不干扰,统一由 statusCode 判断:
| HTTP 状态 | 错误码 | 场景 |
|---|---|---|
| 401 | UNAUTHORIZED | 登录过期,触发 Token 刷新 |
| 403 | FORBIDDEN | 权限不足 |
| 400 / 404 / 500 等 | HTTP_ERROR | 请求异常 |
| 超时 / 断网 | TIMEOUT / NETWORK_ERROR | 网络异常 |
src/config/error.config.ts 中的 ERROR_CODE_MAP 用于把错误码转成用户友好文案。本 skill 内置的映射仅为示例,你必须按自己后端的真实 code 约定替换:
export const ERROR_CODE_MAP: Record<string, string> = {
// HTTP 状态异常(请求层)
UNAUTHORIZED: '登录已过期,请重新登录',
FORBIDDEN: '权限不足',
TIMEOUT: '请求超时,请检查网络',
NETWORK_ERROR: '网络异常,请稍后重试',
// 业务异常示例(按 code < 0 约定,需与后端契约保持一致)
'-1001': '参数校验错误',
'-1002': '未登录或 Token 无效',
'-1003': '无权限',
'-1004': '资源不存在',
'-1005': '资源冲突',
'-1006': '请求过于频繁',
'-2000': '系统繁忙,请稍后再试',
};重要:以上错误码与各 init-skill 内置契约(
fastapi-init-skill、springboot-init-skill等)保持一致。接入真实项目时,请与后端确认错误码表并替换。
前后端统一的分页请求/响应格式:
请求参数:
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
page | number | 1 | 页码,从 1 开始 |
pageSize | number | 20 | 每页条数,上限 100 |
响应结构(在 data 内):
export interface PageResponse<T> {
list: T[]; // 数据列表
total: number; // 总条数
page: number; // 当前页码
pageSize: number; // 每页条数
}各后端 init-skill(springboot / fastapi / go-gin)的分页格式已对齐此约定。
后端登录接口返回 Token 时,统一使用以下字段:
export interface TokenResponse {
accessToken: string; // 访问令牌(Java 后端 camelCase,Python 后端 snake_case 兼容)
refreshToken: string; // 刷新令牌
tokenType: string; // 固定 "Bearer"
expiresIn: number; // 过期时间(秒)
}注意:Java 后端使用 camelCase,Python 后端使用 snake_case。前端必须做兼容处理(优先 camelCase,fallback snake_case),详见 api-contract.md §10。
强约定:所有后端骨架(Go / Java / Python / NodeJS)必须使用 JWT 做无状态鉴权。
请求头:
Authorization: Bearer <token>。失效标识:
HTTP 401或code === -1。完整规范见 api-contract.md §11。
// src/api/request.ts
export interface RequestOptions {
url: string;
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS' | 'HEAD';
data?: any; // 请求体:通常为 plain object
header?: Record<string, string>;
timeout?: number;
needAuth?: boolean; // 是否需要 Token,默认 true
showError?: boolean; // 是否在请求层弹出错误 Toast;默认 false(自动弹)。true 时不弹,调用方自行处理
skipDebounce?: boolean; // 是否跳过防抖,默认 false
skipAuthHandler?: boolean; // 是否跳过 401 处理,默认 false
prefix?: string; // API 前缀,默认 DEFAULT_PREFIX
authMode?: 'bearer' | 'customer-token'; // Token 头格式
retry?: number; // 失败重试次数,默认 REQUEST_RETRY_COUNT
}
export interface RequestPromise<T> extends Promise<ApiResponse<T>> {
__abort?: () => void;
}
export interface ApiResponse<T = any> {
code: number;
message: string;
data: T;
}
export interface UploadOptions {
url: string;
file: File | string; // 通用前端用 File;uniapp 用文件路径 string
name?: string;
formData?: Record<string, any>;
header?: Record<string, string>;
timeout?: number;
onProgress?: (progress: number) => void; // 0-100
}
export function request<T = any>(options: RequestOptions): RequestPromise<T>;
export function get<T = any>(
url: string,
data?: any,
options?: Omit<RequestOptions, 'url' | 'method' | 'data'>
): RequestPromise<T>;
export function post<T = any>(
url: string,
data?: any,
options?: Omit<RequestOptions, 'url' | 'method' | 'data'>
): RequestPromise<T>;
export function put<T = any>(
url: string,
data?: any,
options?: Omit<RequestOptions, 'url' | 'method' | 'data'>
): RequestPromise<T>;
export function del<T = any>(
url: string,
data?: any,
options?: Omit<RequestOptions, 'url' | 'method' | 'data'>
): RequestPromise<T>;
export function upload<T = any>(options: UploadOptions): Promise<T>; // 直接返回业务 data,不包 ApiResponse完整实现见 references/frontend-spec.md(通用前端)与 references/uniapp-spec.md(uniapp 适配)。
本 skill 只负责请求层与鉴权的衔接点:
needAuth: false 跳过(如登录接口本身)authMode: 'bearer' | 'customer-token' 切换鉴权头格式auth.service.ts 统一处理userStore 方案重要:通用前端示例默认使用
localStorage;uniapp 示例默认使用uni.getStorageSync('token')。如果你使用 Pinia 管理登录态,请参考 references/auth-patterns.md 替换为userStore方案,请求层代码无需改动。
详细 Token 管理、401/403 处理、Token 刷新队列、登出回跳等见 references/auth-patterns.md。
请求层只做最小拦截:
import { formatError } from '@/utils/error';
if (options.needAuth !== false && !getToken()) {
return Promise.reject(formatError('NO_AUTH_TOKEN', '未登录'));
}业务层建议前置检查:
const { checkLogin } = useAuth();
function handleLike() {
if (!checkLogin()) return;
post('/api/like', { id: itemId });
}skipDebounce: trueUSE_MOCK 控制:开启后所有请求强制走 Mock,关闭后全部走真实接口MockEntry<T>)METHOD:/path 和 REST 路径参数匹配message / msg / error / detail)sse<T>(options, onMessage, onError?),支持 H5 EventSource 与小程序 enableChunked 双端| 错误 | 后果 | 正确做法 |
|---|---|---|
| 在请求层写死鉴权跳转逻辑 | 与 auth skill 重复、难以维护 | 请求层只识别 401/403,统一交给 auth.service.ts |
| 把 401 重试/Token 刷新在每个 API 里单独实现 | 代码重复、并发刷新导致多次登录 | 使用队列式 Token 刷新,统一收口到 auth.service.ts |
| 并发请求未做去重 | 重复点击导致重复提交 | 用 Map 缓存同一 key 的 pending Promise |
JSON.stringify 直接生成请求 key | 属性顺序不同导致 key 不同,去重失效 | 递归排序 key 后序列化 |
statusCode !== 200 判断成功 | 201/204 等合法状态被误判 | 200 <= statusCode < 300 |
| Mock 数据写进生产包 | 数据泄露、行为异常 | Mock 仅由 VITE_USE_MOCK 控制,生产环境设为 false |
| 文件上传复用 request 的防抖 | 大文件/多次选择文件被错误去重 | 上传单独封装,不走 request 防抖 |
| SSE 在小程序端使用 H5 的 EventSource | 小程序无原生 EventSource,直接报错 | 使用 enableChunked + 手动解析 chunk |
| SSE 不处理连接中断/页面卸载 | 内存泄漏、重复回调 | 返回可中断的 requestTask,页面 onUnload 时调用 |
| 401 时直接重试原请求但不刷新 Token | 重试仍失败,陷入死循环 | 先刷新 Token,再重试队列中的请求 |
| Token 刷新不排队 | 并发刷新导致多次登录请求 | 使用 isRefreshing + Promise 队列 |
接口散落到 pages/api/、views/api/、service/ | 跨项目无法复用,Mock 难统一 | 强约定:所有前端项目(vue/uniapp/react)统一放 src/api/,见 api-contract.md §2 |
| 凭直觉写接口路径/字段 | 前后端不对齐,联调失败 | 强约定:新加接口必须读 api-contract.md,没有就更新 |
| HTTP 500 给用户弹"服务器繁忙" Toast | 用户看到无意义提示,无法自助解决 | 强约定:500 类错误请求层 swallow,交给全局错误处理,见 api-contract.md §9 |
把业务异常用 showError: true 隐藏 | 用户不知道发生了什么 | showError: true 只用于轮询 / 静默重试 / 自定义提示场景 |
触发本 skill 时,按以下优先级输出:
references/api-contract.md,确认接口位置 / 错误码 / JWT 约定src/api/、src/config/、src/utils/、src/services/ 文件划分request.ts、upload.ts、错误处理工具的实现auth.service.tsreferences/ 中的对应文档| 范畴 | 本 skill 负责 | 本 skill 不负责 |
|---|---|---|
| 请求封装 | request.ts、拦截器、去重、Mock、错误提示、上传、SSE 衔接 | — |
| 鉴权实现 | 请求层 Token 注入、401/403 识别、刷新触发点 | Token 管理、登录态、登出回跳等完整鉴权体系 |
| Token 刷新队列 | — | 推荐由 auth.service.ts 统一实现,请求层只负责触发与重试 |
| 项目规范 | — | 目录结构、命名规范等通用规范 |
| 跨平台审计 | — | 多端兼容性检查 |
本 skill 的响应信封、错误码、JWT、请求头规范以
references/api-contract.md为准。
EnvelopeRoute 输出 { code, message, data }request.ts 按相同结构解析ERROR_CODE_MAP 直接复用契约 §7 错误码表code === -1 失效标识由契约 §11 约束后端 init-skill(fastapi-init-skill / springboot-init-skill / go-gin-init-skill / nodejs-init-skill)必须生成与 references/api-contract.md 兼容的 api-contract.md,否则前后端无法桥接。
© jiushiwon, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 9 other files (references) in vibeCoding/frontend/frontend-request-skill of jiushiwon/wg-skills.
Open the folder on GitHubat commit 3569fb8
Frontend Request Skill next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Frontend Request Skill this skilljiushiwon/wg-skills | 112 | — | ~3.6k | Automated safety check: Pass | Apache-2.0 | |
| API Reviewermitchdenny/hex1b | 178 | — | ~4k | Automated safety check: Pass | MIT | |
| Livewire Developmentcoollabsio/coolify | 63k | — | ~964 | Automated safety check: Pass | MIT | |
| Livewire Developmentyungifez/skuul | 409 | 1 repos | ~1.9k | Automated safety check: Pass | MIT | |
| Databuddydatabuddy-analytics/Databuddy | 1.2k | — | ~2.1k | Automated safety check: Pass | AGPL-3.0 | |
| Edgestore Setupedgestorejs/edgestore | 454 | — | ~1.8k | Automated safety check: Pass | MIT |
mitchdenny/hex1b
Guidelines for reviewing API design in the Hex1b codebase. An agent skill from mitchdenny/hex1b.
coollabsio/coolify
A skill your agent uses for any task or question involving Livewire.
yungifez/skuul
A skill your agent uses for any task or question involving Livewire.
databuddy-analytics/Databuddy
Integrate Databuddy analytics using the SDK, REST API, or MCP.
edgestorejs/edgestore
A skill your agent uses when adding, extending, or troubleshooting EdgeStore file uploads, upload UI, or bucket access policies in a TypeScript/React application.
slimani-dev/muraqib
A skill your agent uses for Laravel Wayfinder which auto-generates typed functions for Laravel controllers and routes.
jiushiwon/wg-skills
A skill your agent uses when generating UI for a specific scenario (mobile/PC/官网/管理端/营销页/文档/金融/原生/3D), when refactoring an existing HTML/Vue/React project to a unified design system, when extracting…
jiushiwon/wg-skills
A skill your agent uses when 用户想用一句话生成流程图、工作流图解、开发流程图、AI 流程图或任何步骤型图解,支持多风格输出(flat icon / 暖白手账风 / dark / cute),并提供现成模板一键出图。
jiushiwon/wg-skills
This skill should be used when the user wants to create a standardized uni-app project for WeChat mini-program, H5, and App from scratch.
jiushiwon/wg-skills
FastAPI 项目一键初始化技能。面向零基础小白,提供环境探测、自动安装、完整 Web 骨架生成、SSE 流式框架、JWT 鉴权、统一响应封装、文件上传接口、一键启动/重启脚本、Swagger 文档,内置 MySQL(默认)/ PostgreSQL / MongoDB 数据库选择。用户只需说"帮我搭一个 FastAPI 项目"即可一条命令完成从零到跑的完整链路。触发词:"FastAPI…
jiushiwon/wg-skills
FFmpeg 多媒体处理技能 — 将自然语言描述转为正确的 ffmpeg 命令,覆盖视频剪辑、转码、水印、合成、提取、生成等操作。内置一键安装脚本(Windows/Mac/Linux)。触发词:ffmpeg、视频剪辑、视频裁剪、视频转码、视频压缩、去水印、加水印、视频拼接、视频合成、提取音频、视频转…
jiushiwon/wg-skills
This skill should be used when the user wants to create a standardized React 18 + TypeScript + Vite + Zustand project from scratch.
Categories
A skill your agent uses when designing or reviewing the request layer of a frontend project (web / uni-app / mini-program), including request.ts wrappers, interceptors, deduplication, mocks, error…. Frontend Request Skill is an agent skill from jiushiwon/wg-skills.ts wrappers, interceptors, deduplication, mocks, error handling, file upload, SSE streaming, or token refresh.
Frontend Request Skill fits situations like: reviewing the request layer of a frontend project (web / uni-app / mini-program); including request.ts wrappers.
Run `npx skills add jiushiwon/wg-skills --skill frontend-request-skill -a claude-code`. Or copy the skill folder (vibeCoding/frontend/frontend-request-skill in jiushiwon/wg-skills) into .claude/skills/frontend-request-skill in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jiushiwon/wg-skills --skill frontend-request-skill -a codex`. Or copy the skill folder (vibeCoding/frontend/frontend-request-skill in jiushiwon/wg-skills) into .agents/skills/frontend-request-skill in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jiushiwon/wg-skills --skill frontend-request-skill -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/frontend-request-skill, .gemini/skills/frontend-request-skill, .github/skills/frontend-request-skill and .opencode/skills/frontend-request-skill in your project.
Going by SKILL.md and its folder, Frontend Request Skill needs credentials named NO_AUTH_TOKEN. Our summary lists: Python 3; Node.js.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Frontend Request Skill is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.6k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 26k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Frontend Request Skill: API Reviewer (mitchdenny/hex1b, 178 stars), Livewire Development (coollabsio/coolify, 63k stars), Livewire Development (yungifez/skuul, 409 stars) and Databuddy (databuddy-analytics/Databuddy, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
jiushiwon (a GitHub user) maintains it in jiushiwon/wg-skills, which has 112 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 7, 2026.
Source: jiushiwon/wg-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.