Agent skill

X Request

by kqcoxn in kqcoxn/MaaPipelineEditor

“专注讲解 XRequest 的实际配置和使用,基于官方文档提供准确的配置说明”

— description from SKILL.md by kqcoxn
MITAuto-check passed

Install X Request

skills CLI
$ npx skills add kqcoxn/MaaPipelineEditor --skill x-request -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kqcoxn/MaaPipelineEditor x-request --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kqcoxn/MaaPipelineEditor.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/ant-design-x/skills/x-request .claude/skills/x-request && rm -rf skills-src

Use ~/.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/

Facts

Skill name
x-request
GitHub stars
408
Token cost
~1.8k tokens
SKILL.md length
248 words
Files
4
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

  • SKILL.md covers 依赖管理, 基础配置, 🏗️ 技术栈架构 and 🔑 核心概念, plus 7 more sections
  • Calls npm and tsc; reaches api.xxx.com and httpbin.org; needs API_KEY and DEBUG_API_KEY

About this skill

X Request is a skill in kqcoxn/MaaPipelineEditor (408 stars). Its SKILL.md is about 1.8k tokens, with 3 other files in the folder. Licence: MIT.

What it can do on your machine

Read from SKILL.md and the folder at commit e03dd0a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • tsc

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.xxx.com
    • httpbin.org
    • api.openai.com

    Also links to:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • API_KEY
    • DEBUG_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

X Request loads about 1.8k tokens when it runs. Until then it costs about 12 tokens; SKILL.md has 248 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~12
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from kqcoxn/MaaPipelineEditor at commit e03dd0a, republished under its MIT licence (© kqcoxn). 248 words, ~1,818 tokens.

Download SKILL.mdSave it as .claude/skills/x-request/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
x-request
description
专注讲解 XRequest 的实际配置和使用,基于官方文档提供准确的配置说明
version
2.9.0

🎯 技能定位

本技能专注解决:如何正确配置 XRequest 来适配各种流式接口需求。

目录导航

🚀 快速开始

依赖管理

📋 系统要求
依赖包版本要求自动安装作用
@ant-design/x-sdk≥2.2.2✅核心SDK,包含XRequest工具
🛠️ 一键安装
bash
# 推荐使用 tnpm
tnpm install @ant-design/x-sdk

# 或使用 npm
npm add @ant-design/x-sdk

# 检查版本
npm ls @ant-design/x-sdk

基础配置

最简单的使用方式
typescript
import { XRequest } from '@ant-design/x-sdk';

// 最简配置:仅需提供API地址
const request = XRequest('https://api.example.com/chat');

// 如需手动控制(用于Provider场景)
const providerRequest = XRequest('https://api.example.com/chat', {
  manual: true, // 仅此项通常需要显式配置
});

💡 提示:XRequest 已内置合理的默认配置,大多数情况下只需提供API地址即可使用。

📦 技术栈概览

🏗️ 技术栈架构

mermaid
graph TD
    A[XRequest] --> B[网络请求]
    A --> C[认证管理]
    A --> D[错误处理]
    A --> E[流式处理]
    B --> F[fetch封装]
    C --> G[Token管理]
    D --> H[重试机制]
    E --> I[Server-Sent Events]

🔑 核心概念

概念角色定位核心职责使用场景
XRequest🌐 请求工具处理所有网络通信、认证、错误处理统一请求管理
全局配置⚙️ 配置中心一次配置,多处使用减少重复代码
流式配置🔄 流式处理支持SSE和JSON响应格式AI对话场景

🔧 核心配置详解

核心功能参考内容 CORE.md

🛡️ 安全指南

环境安全配置

🌍 不同环境的安全策略
运行环境安全等级配置方式风险说明
浏览器前端🔴 高危❌ 禁止配置密钥密钥会直接暴露给用户
Node.js后端🟢 安全✅ 环境变量配置密钥存储在服务器端
代理服务🟢 安全✅ 同域代理转发密钥由代理服务管理
🔐 认证方式对比
认证方式适用环境配置示例安全性
Bearer TokenNode.jsBearer ${process.env.API_KEY}✅ 安全
API Key HeaderNode.jsX-API-Key: ${process.env.KEY}✅ 安全
代理转发浏览器/api/proxy/service✅ 安全
直接配置浏览器Bearer sk-xxx❌ 危险

🔍 调试与测试

调试配置

🛠️ 调试模板

Node.js调试配置:

typescript
// 安全的调试配置(Node.js 环境)
const debugRequest = XRequest('https://your-api.com/chat', {
  headers: {
    Authorization: `Bearer ${process.env.DEBUG_API_KEY}`,
  },
  params: { query: '测试消息' },
});

前端调试配置:

typescript
// 安全的调试配置(前端环境)
const debugRequest = XRequest('/api/debug/chat', {
  params: { query: '测试消息' },
});

配置验证

✅ 安全检查工具
typescript
// 安全配置验证函数
const validateSecurity = (config: any) => {
  const isBrowser = typeof window !== 'undefined';
  const hasAuth = config.headers?.Authorization || config.headers?.authorization;

  if (isBrowser && hasAuth) {
    throw new Error('❌ 前端环境禁止配置 Authorization,存在密钥泄漏风险!');
  }

  console.log('✅ 安全配置检查通过');
  return true;
};

// 使用示例
validateSecurity({
  headers: {
    // 不要包含 Authorization
  },
});

📋 使用场景

独立使用

🎯 直接发起请求
typescript
import { XRequest } from '@ant-design/x-sdk';

// 测试接口可用性
const testRequest = XRequest('https://httpbin.org/post', {
  params: { test: 'data' },
});

// 立即发送请求
const response = await testRequest();
console.log(response);

配合其他技能

🔄 技能协作流程
mermaid
graph TD
    A[x-request] -->|配置请求| B[x-chat-provider]
    A -->|配置请求| C[use-x-chat]
    B -->|提供Provider| C
    A --> D[直接请求]
使用方式配合技能作用示例
独立使用无直接发起网络请求测试接口可用性
配合 x-chat-providerx-chat-provider为自定义 Provider 配置请求配置私有 API
配合 use-x-chatuse-x-chat为内置 Provider 配置请求配置 OpenAI API
完整 AI 应用x-request → x-chat-provider → use-x-chat为整个系统配置请求完整 AI 对话应用
⚠️ useXChat 集成安全警告

重要警告:useXChat 仅用于前端环境,XRequest 配置中禁止包含 Authorization!

❌ 错误配置(危险):

typescript
// 极度危险:密钥会直接暴露给浏览器
const unsafeRequest = XRequest('https://api.openai.com/v1/chat/completions', {
  headers: {
    Authorization: 'Bearer sk-xxxxxxxxxxxxxx', // ❌ 危险!
  },
  manual: true,
});

✅ 正确配置(安全):

typescript
// 前端安全配置:使用代理服务
const safeRequest = XRequest('/api/proxy/openai', {
  params: {
    model: 'gpt-3.5-turbo',
    stream: true,
  },
  manual: true,
});

🚨 开发规则

测试用例规则

  • 如果用户没有明确需要测试用例,则不要添加测试文件
  • 仅在用户明确要求时才创建测试用例

代码质量规则

  • 完成编写后必须检查类型:运行 tsc --noEmit 确保无类型错误
  • 保持代码整洁:移除所有未使用的变量和导入

✅ 配置检查清单

使用 XRequest 前请确认以下配置已正确设置:

🔍 配置检查清单
检查项状态说明
API 地址✅ 必须配置XRequest('https://api.xxx.com')
认证信息⚠️ 环境相关前端❌禁止,Node.js✅可用
manual配置✅ Provider场景在Provider中需要设为true,其他场景需要根据实际情况设置
其他配置❌ 无需配置已内置合理默认值
接口可用性✅ 建议测试使用调试配置验证
🛠️ 快速验证脚本
typescript
// 运行前检查配置
const checkConfig = () => {
  const checks = [
    {
      name: '全局配置',
      test: () => {
        // 检查是否已设置全局配置
        return true; // 根据实际情况检查
      },
    },
    {
      name: '安全配置',
      test: () => validateSecurity(globalConfig),
    },
    {
      name: '类型检查',
      test: () => {
        // 运行 tsc --noEmit
        return true;
      },
    },
  ];

  checks.forEach((check) => {
    console.log(`${check.name}: ${check.test() ? '✅' : '❌'}`);
  });
};

🎯 技能协作

mermaid
graph LR
    A[x-request] -->|配置请求| B[x-chat-provider]
    A -->|配置请求| C[use-x-chat]
    B -->|提供Provider| C
📊 技能使用对照表
使用场景所需技能使用顺序完成时间
测试接口x-request直接使用2分钟
私有API适配x-request → x-chat-provider先配置请求,再创建Provider10分钟
标准AI应用x-request → use-x-chat先配置请求,再构建界面15分钟
完整自定义x-request → x-chat-provider → use-x-chat完整工作流30分钟

🔗 参考资源

📚 核心参考文档

🌐 SDK官方文档

💻 示例代码

© kqcoxn, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files in .agents/skills/ant-design-x/skills/x-request of kqcoxn/MaaPipelineEditor.

  • SKILL.md
  • reference/API.md
  • reference/CORE.md
  • reference/EXAMPLES_SERVICE_PROVIDER.md

Open the folder on GitHubat commit e03dd0a

Compare with similar skills

X Request 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.

X Request compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
X Request this skillkqcoxn/MaaPipelineEditor408—~1.8kAutomated safety check: PassMIT
Chart Visualizationbytedance/deer-flow83k2 repos~840Automated safety check: PassMIT
Web Access via Browser CDPeze-is/web-access9.1k4 repos~2.2kAutomated safety check: PassMIT
Knap Markdown Templateskepano/obsidian-skills49k2 repos~986Automated safety check: PassMIT
Electron Multi-Process ArchitectureiOfficeAI/AionUi33k1 repos~1.8kAutomated safety check: PassApache-2.0
Chrome CDP Browser Controlzenstory-ai/oh-story-claudecode7.4k3 repos~1.2kAutomated safety check: PassMIT

Similar skills

  • Chart Visualization

    bytedance/deer-flow

    Picks a suitable chart type from 26 options for your data, maps the data to that chart's parameters and generates a chart image through a JavaScript script.

    83k GitHub starsUsed in 2 repos~840 tokens
    Data & AnalyticsAuto-check passed
  • Routes every web task, from searching to logged-in browsing, through a tiered choice of search, fetch, curl or a real Chrome or Edge session driven over CDP.

    9.1k GitHub starsUsed in 4 repos~2.2k tokens
    Productivity & AutomationAuto-check passed
  • Knap Markdown Templates

    kepano/obsidian-skills

    Renders Markdown notes from Knap templates and JSON data on the command line, including notes built from Defuddle web page output.

    49k GitHub starsUsed in 2 repos~986 tokens
    Documents & OfficeAuto-check passed
  • Tells the agent where new code belongs in an Electron multi-process project and which APIs each process may use, with rules for new bridges, services, agents and workers.

    33k GitHub starsUsed in 1 repo~1.8k tokens
    DevelopmentAuto-check passed
  • Chrome CDP Browser Control

    zenstory-ai/oh-story-claudecode

    Drives a Chrome window over the DevTools Protocol with the agent-browser CLI, so the agent can reuse your logged-in sessions, read pages and pull tokens.

    7.4k GitHub starsUsed in 3 repos~1.2k tokens
    Productivity & AutomationAuto-check passed
  • DeerFlow Smoke Test

    bytedance/deer-flow

    Walks through an end-to-end smoke test of a DeerFlow deployment: pull the latest code, deploy with Docker or locally, verify services, run health checks and write a report.

    83k GitHub stars~2.5k tokensUpdated today
    Testing & QAAuto-check: notes

More from kqcoxn/MaaPipelineEditor

All 11 skills in this repo
  • Ant Design

    kqcoxn/MaaPipelineEditor

    Decision guide for antd 6.x, Ant Design Pro 5/ProComponents, Ant Design X v2, and the offline @ant-design/cli.

    408 GitHub starsUsed in 1 repo~1.1k tokens
    Auto-check passed
  • Maafw

    kqcoxn/MaaPipelineEditor

    MaaFramework 开发与集成指南。当任务涉及 MaaFramework 项目结构、Pipeline 协议、ProjectInterface V2 协议、自定义识别/动作(Custom/Agent)、Python/NodeJS/CSharp 等语言 Binding 集成、控制器配置、回调协议或运行时行为时使用。

    408 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Use X Chat

    kqcoxn/MaaPipelineEditor

    专注讲解如何使用 useXChat Hook,包括自定义 Provider 的集成、消息管理、错误处理、多会话管理等. An agent skill from kqcoxn/MaaPipelineEditor.

    408 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • X Card

    kqcoxn/MaaPipelineEditor

    当需要用 @ant-design/x-card 让 AI Agent 动态渲染富交互 UI 时使用——涵盖 XCard.Box、XCard.Card、A2UI v0.9 命令、数据绑定、Catalog、Actions 和流式渲染模式。

    408 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • X Chat Provider

    kqcoxn/MaaPipelineEditor

    专注于自定义 Chat Provider 的实现,帮助将任意流式接口适配为 Ant Design X 标准格式. An agent skill from kqcoxn/MaaPipelineEditor.

    408 GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • X Components

    kqcoxn/MaaPipelineEditor

    使用 @ant-design/x 组件库构建 AI 对话 UI 时使用 —— 涵盖 Bubble、Sender、Conversations、Prompts、ThoughtChain、Actions、Welcome、Attachments、Sources、Suggestion、Think、FileCard、CodeHighlighter、Mermaid、Folder、XProvider 和…

    408 GitHub stars~1.6k tokensUpdated today
    Auto-check passed

Works with

Questions about X Request

How do I install X Request in Claude Code?

Run `npx skills add kqcoxn/MaaPipelineEditor --skill x-request -a claude-code`. Or copy the skill folder (.agents/skills/ant-design-x/skills/x-request in kqcoxn/MaaPipelineEditor) into .claude/skills/x-request in your project. Claude Code loads it when a task matches its description.

How do I install X Request in Codex?

Run `npx skills add kqcoxn/MaaPipelineEditor --skill x-request -a codex`. Or copy the skill folder (.agents/skills/ant-design-x/skills/x-request in kqcoxn/MaaPipelineEditor) into .agents/skills/x-request in your project. Codex loads it when a task matches its description.

Can I use X Request in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kqcoxn/MaaPipelineEditor --skill x-request -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/x-request, .gemini/skills/x-request, .github/skills/x-request and .opencode/skills/x-request in your project.

What does X Request need to run?

Going by SKILL.md and its folder, X Request needs the command-line tools its instructions call (npm and tsc) and credentials named API_KEY and DEBUG_API_KEY.

Does X Request access the network?

SKILL.md names 4 domains. In commands or code: api.xxx.com, httpbin.org and api.openai.com; the agent is likely to contact these when it follows the instructions. As links in the text: github.com. This is read from the text; nothing was executed.

Is X Request safe to install?

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.

What licence does X Request use?

X Request is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does X Request use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to X Request?

Skills that share tags, products or a category with X Request: Chart Visualization (bytedance/deer-flow, 83k stars), Web Access via Browser CDP (eze-is/web-access, 9.1k stars), Knap Markdown Templates (kepano/obsidian-skills, 49k stars) and Electron Multi-Process Architecture (iOfficeAI/AionUi, 33k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains X Request?

kqcoxn (a GitHub user) maintains it in kqcoxn/MaaPipelineEditor, which has 408 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 8, 2026.

Source: kqcoxn/MaaPipelineEditor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.