Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计未展示

apisix-devAPISIX 开发者

Agent Skill

apisix-dev 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

552

周安装

23

GitHub Stars

公开资料未说明

下载量

184
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:apisix-dev(APISIX 开发者)
来源仓库:https://github.com/skyeyoung/apisix-skills
仓库路径:skills/apisix-dev
安装命令:
npx skills add skyeyoung/apisix-skills --skill "apisix-dev"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add skyeyoung/apisix-skills --skill "apisix-dev"

简介

协助 APISIX 网关开发与调试,支持插件管理与流量控制。

  • 适合云原生环境下的 API 网关运维与开发。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 通过 github 安装,调用 npx 添加技能模块。
  • 需具备 APISIX 基础配置知识,否则难以定位问题。
  • apisix-dev 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
apisix-dev
description
Guide APISIX Development environment setup and run tests. Trigger when user mentions "APISIX test", "run APISIX tests", "APISIX testing", "setup APISIX test environment", "TEST::NGINX", "prove test", "APISIX CI", "test-nginx", "APISIX development environment", "APISIX deployment mode", "config_provider yaml", "apisix.yaml", "standalone mode", "data_plane role", or asks about running specific APISIX test files.

APISIX Development Environment Setup

This skill guides you through setting up the APISIX testing environment and running tests using TEST::NGINX.

Environment Requirements

Ubuntu Only

IMPORTANT: Direct test execution is only supported on Ubuntu.

Before proceeding, check the operating system:

uname -a && cat /etc/os-release 2>/dev/null | head -5

If NOT Ubuntu:

  1. Option A: Use Ubuntu Environment

- Start an Ubuntu VM, container, or WSL2 - Run commands there and paste error logs back for analysis

  1. Option B: Use DevContainers (VSCode)

- See: https://apisix.apache.org/docs/apisix/build-apisix-dev-environment-devcontainers/ - Setup steps:

     git clone https://github.com/apache/apisix.git
     cd apisix
     code .
     # In VSCode: Cmd/Ctrl+Shift+P -> "Dev Containers: Reopen in Container"

- Warning: Some tests may not run normally in DevContainer due to container limitations

If Ubuntu: Proceed with the setup below.

Quick Start (Ubuntu)

Step 1: Clone Repository with Submodules

git clone --recurse-submodules https://github.com/apache/apisix.git
cd apisix

If already cloned without submodules:

git submodule update --init --recursive

Step 2: Install Dependencies Using CI Scripts

APISIX provides CI scripts that handle all dependency installation. Use these scripts to ensure consistency with the official CI environment.

Reference the CI workflow: https://github.com/apache/apisix/blob/master/.github/workflows/build.yml

Key CI Scripts:

  • ci/common.sh - Common utilities and dependency functions
  • ci/linux_openresty_runner.sh - Main runner script
  • ci/linux_openresty_common_runner.sh - Installation functions (before_install, do_install)

Run the installation:

# Source the CI scripts and run installation
cd apisix

# Set required environment variables
export OPENRESTY_VERSION=default
export SERVER_NAME=linux_openresty

# Source and run the CI installation functions
. ./ci/common.sh
. ./ci/linux_openresty_common_runner.sh

# Run before_install (installs system dependencies, Test::Nginx)
before_install

# Run do_install (installs OpenResty, Lua deps, test-nginx, etc.)
do_install

What the CI scripts install:

  • System packages (cpanminus, build-essential, libssl-dev, etc.)
  • Test::Nginx via cpanm
  • OpenResty with correct version
  • Lua dependencies (make deps)
  • test-nginx from openresty/test-nginx
  • Additional tools (grpcurl, Node.js, etc.)

Note: etcd runs in Docker container, not installed locally.

Step 3: Verify Installation

# Verify OpenResty
openresty -v

# Verify test-nginx exists
ls test-nginx/

Note: If you encounter issues with the CI scripts, check the latest build.yml for any changes to the installation process. The CI scripts are the source of truth for the test environment setup.

Environment Variables

Set these environment variables before running tests:

export OPENRESTY_PREFIX="/usr/local/openresty"
export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH

# Optional - adjust based on your setup
export OPENRESTY_VERSION=default
export SERVER_NAME=linux_openresty

Verify the setup:

which openresty
openresty -v
which etcd
etcd --version

Running Tests

Basic Test Execution

Tests use the prove command with TEST::NGINX. Run from the APISIX repository root:

# Run a single test file
FLUSH_ETCD=1 prove -I./test-nginx/lib -I./ t/path/to/test.t

# Example: Run a specific test
FLUSH_ETCD=1 prove -I./test-nginx/lib -I./ t/plugin/limit-count.t

Test Command Options

OptionDescription
FLUSH_ETCD=1Flush etcd before running tests (recommended)
-I./test-nginx/libInclude test-nginx library path
-I./Include current directory
-vVerbose output
-rRecurse into directories

Run Multiple Tests

# Run all tests in a directory
FLUSH_ETCD=1 prove -I./test-nginx/lib -I./ -r t/plugin/

# Run tests matching a pattern
FLUSH_ETCD=1 prove -I./test-nginx/lib -I./ t/plugin/limit-*.t

Start Required Services

Before running tests, start the CI environment using Docker:

# Start all required services (etcd, etc.) via Docker
make ci-env-up project_compose_ci=ci/pod/docker-compose.common.yml

This starts the necessary containers including etcd. No manual etcd installation is required.

To stop the services:

make ci-env-down

Lint Before Committing

IMPORTANT: Always lint test files before committing.

# Lint all code (source + tests)
make lint

# Or run individual lint scripts
./utils/check-lua-code-style.sh      # Lint source code
./utils/check-test-code-style.sh     # Lint test files

The make lint target:

  1. Requires utils target (downloads linting utilities)
  2. Runs check-lua-code-style.sh for source code
  3. Runs check-test-code-style.sh for test files

Reference: https://github.com/apache/apisix/blob/master/Makefile#L171-L178

Skippable Steps (Initial Setup)

For initial testing, you can skip these steps from the CI workflow:

  1. WASM-related steps - Only needed for WASM plugin tests
  2. Start some services - Only needed for specific integration tests
  3. Build XDS Library - Only needed for xDS-related tests
  4. Build WASM Core - Only needed for WASM tests
  5. Dubbo backend - Only needed for Dubbo plugin tests

APISIX Deployment Modes

Reference: https://apisix.apache.org/docs/apisix/deployment-modes/

APISIX supports three deployment modes:

ModeDescriptionConfig Provider
traditionalData plane + control plane togetheretcd only
decoupledSeparate data/control planesetcd only
standaloneData plane with local file configyaml or json

Using YAML Config Provider

CRITICAL: Only data_plane role supports config_provider: yaml.

CORRECT configuration (in conf/config.yaml):

deployment:
  role: data_plane
  role_data_plane:
    config_provider: yaml

INCORRECT - This does NOT work:

# DO NOT USE - traditional role does not support yaml config provider
deployment:
  role: traditional
  role_traditional:
    config_provider: yaml

Symptoms of incorrect configuration:

  1. config.yaml gets overwritten when running apisix start/reload/init
  2. Content configured in apisix.yaml has no effect

YAML Configuration File

When using config_provider: yaml:

  • Rules are stored in conf/apisix.yaml
  • File must end with #END marker for APISIX to load it
  • APISIX checks for changes every second and hot-reloads

Example conf/apisix.yaml:

routes:
  - uri: /hello
    upstream:
      nodes:
        '127.0.0.1:8080': 1
      type: roundrobin
#END

CI Reference

IMPORTANT: Always check the official CI workflow for the latest installation process. The CI scripts are maintained by the APISIX team and are the source of truth.

Official CI workflow: https://github.com/apache/apisix/blob/master/.github/workflows/build.yml

Key CI scripts in the repository:

ScriptPurpose
ci/common.shCommon utilities, dependency functions, tool installation
ci/linux_openresty_runner.shMain Linux runner (sources common_runner)
ci/linux_openresty_common_runner.shbefore_install(), do_install(), script() functions

CI Functions:

  • before_install() - Installs system dependencies, Test::Nginx
  • do_install() - Installs OpenResty, etcd, Lua deps, test-nginx, grpcurl, etc.
  • script() - Runs the actual test suite

When something doesn't work: Check if the CI scripts have been updated. The build.yml and CI scripts evolve with the project.

Troubleshooting

Test Fails with "nginx: command not found"

Ensure OpenResty is in PATH:

export PATH=/usr/local/openresty/nginx/sbin:$PATH
which nginx

etcd Connection Failed

Ensure the CI environment is running:

# Start CI services (includes etcd)
make ci-env-up project_compose_ci=ci/pod/docker-compose.common.yml

# Check if containers are running
docker ps | grep etcd

Permission Denied Errors

Some tests require sudo:

sudo -E FLUSH_ETCD=1 prove -I./test-nginx/lib -I./ t/path/to/test.t

Missing Lua Dependencies

Reinstall dependencies:

make deps

Submodule Issues

Re-initialize submodules:

git submodule update --init --recursive

TEST::NGINX Basics

APISIX tests are written using TEST::NGINX, a Perl-based testing framework.

Reference Existing Tests First

IMPORTANT: When writing new tests, always reference similar existing tests in the APISIX repository first.

Test directory: https://github.com/apache/apisix/tree/master/t

DirectoryTest Type
t/plugin/Plugin tests (limit-count, key-auth, cors, etc.)
t/admin/Admin API tests
t/core/Core functionality tests
t/node/Node/upstream tests
t/router/Router tests
t/stream/Stream proxy tests
t/discovery/Service discovery tests
t/xrpc/xRPC protocol tests

How to find similar tests:

# Search for tests related to a plugin
ls t/plugin/ | grep -i <keyword>

# Search for specific patterns in test files
grep -r "your_pattern" t/

# Example: Find tests using key-auth
grep -r "key-auth" t/plugin/

Why reference existing tests:

  1. Follow established patterns and conventions
  2. Understand how to set up test fixtures
  3. Learn correct assertion methods
  4. Avoid reinventing test utilities

Test File Structure

use t::APISIX 'no_plan';

repeat_each(1);
no_long_string();
no_root_location();

run_tests;

__DATA__

=== TEST 1: test description
--- config
location /t {
    content_by_lua_block {
        -- test code here
    }
}
--- request
GET /t
--- response_body
expected response
--- no_error_log
[error]

Common Test Sections

SectionDescription
--- configNginx configuration
--- requestHTTP request to send
--- response_bodyExpected response body
--- error_codeExpected HTTP status code
--- no_error_logPatterns that should NOT appear in error log
--- error_logPatterns that SHOULD appear in error log

Non-Ubuntu Environment Workflow

If you're not on Ubuntu:

  1. Start Ubuntu environment (VM, container, WSL2)
  2. Run commands there
  3. If errors occur: Copy the complete error log
  4. Paste to AI for analysis: The AI can help diagnose issues without direct execution

Example error sharing format:

Command: FLUSH_ETCD=1 prove -I./test-nginx/lib -I./ t/plugin/limit-count.t
Error:
[paste complete error output here]

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.9%
按下载量换算53

windsurf

22.48%
按下载量换算41

OpenCode

18.62%
按下载量换算34

Codex

13.27%
按下载量换算24

Gemini CLI

7.52%
按下载量换算14

trae

3.41%
按下载量换算6

安全审计

暂无安全审计结果可展示。

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills