Token导航 LogoToken导航TokenDH.com
开发执行命令github未标认证来源可访问许可证需确认审计通过

wow-api-lua-environmentWOW API LUA environment 文档

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

190

周安装

8

GitHub Stars

22

下载量

67
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/jburlison/wowaddonapiagents --skill wow-api-lua-environment

简介

wow-api-lua-environment 用于辅助 API 设计、接口文档和错误码整理,适合生成 OpenAPI 草稿或联调支持。

  • 适用于前后端协作场景,如梳理 endpoint 或验证字段命名。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 使用时需确认业务语义和鉴权规则,避免凭空补字段。
  • 建议结合现有代码或接口样例提取事实信息。

SKILL.md

Lua Environment & Security (Retail — Patch 12.0.0)

Comprehensive reference for the WoW Lua sandbox, security model, taint system, secure execution, timers, hooks, logging, and restricted actions.

Source: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API Secure Execution: https://warcraft.wiki.gg/wiki/Secure_Execution_and_Tainting Lua Functions: https://warcraft.wiki.gg/wiki/Lua_functions Current as of: Patch 12.0.0 (Build 65655) — January 28, 2026 Scope: Retail only.

Scope

This skill covers:

  • Lua Sandbox — WoW's Lua 5.1 environment, restricted standard library, blocked functions
  • Taint System — How addon code becomes tainted and what tainted code cannot do
  • Secure Execution — Protected functions, secure frames, secure handlers
  • Combat Lockdown — What addons can and cannot do during combat
  • C_Timer — Timer functions (After, NewTicker, NewTimer)
  • Hooks — hooksecurefunc, securecallfunction, securecallmethod
  • C_RestrictedActions — Addon restriction state queries
  • C_Log — Logging utilities
  • FrameScript — Frame script environment, secret values, scrubbing
  • Debugging — Error handling, stack traces, debugging utilities

When to Use This Skill

Use this skill when you need to:

  • Understand what Lua functions are available vs blocked in WoW
  • Work with or debug taint issues
  • Write code that interacts with secure/protected frames
  • Use timers, delayed execution, or ticker patterns
  • Hook existing functions safely
  • Understand combat lockdown restrictions
  • Handle addon restriction states (12.0.0 instance restrictions)
  • Log messages for debugging
  • Work with secret values and the FrameScript sandbox

WoW Lua 5.1 Sandbox

WoW runs Lua 5.1.4 with significant modifications. The following standard library functions are blocked or removed:

Blocked Standard Functions

BlockedReason
loadfile()No filesystem access
dofile()No filesystem access
io.*No filesystem access
os.execute()No shell access
os.exit()Cannot close client
os.remove()No filesystem
os.rename()No filesystem
os.tmpname()No filesystem
os.getenv()No environment access
package.*No package system
require()No module loading
module()No module system
newproxy()Removed
getfenv()Limited — returns read-only
setfenv()Very restricted
collectgarbage()Limited modes

Available Standard Functions

Most core Lua functions work normally:

  • All string.*, table.*, math.* functions
  • type(), tostring(), tonumber(), rawget(), rawset(), rawequal(), rawlen()
  • pairs(), ipairs(), next(), select(), unpack()
  • pcall(), xpcall(), error(), assert()
  • setmetatable(), getmetatable()
  • coroutine.* (full coroutine support)
  • os.time(), os.date(), os.clock(), os.difftime()
  • print() — outputs to default chat frame

WoW-Added Global Functions

FunctionDescription
strsplit(delimiter, str [, pieces])Split string by delimiter
strsplittable(delimiter, str [, pieces])Split to table
strjoin(delimiter,...)Join strings
strtrim(str [, chars])Trim whitespace
tContains(table, value)Table contains value?
tInsert(table, value)Insert into table (alias)
tDeleteItem(table, value)Remove first occurrence of value
tInvert(table)Invert key/value pairs
wipe(table)Clear table (preserving reference)
CopyTable(table [, shallow])Deep or shallow copy
MergeTable(dest, source)Merge source into dest
Mixin(object,...)Copy mixin methods to object
CreateFromMixins(...)Create new object from mixins
CreateAndInitFromMixin(mixin,...)Create + call Init
format(formatString,...)Alias for string.format
tostringall(...)Convert all args to strings
DevTools_Dump(value, startKey)Dump value for debugging

Taint System

All addon code runs as "tainted" (insecure). Blizzard UI code runs as "secure" (untainted). The taint system prevents addons from calling protected functions or modifying secure frames.

How Taint Works

  1. Any variable set by addon code becomes tainted
  2. Tainted values propagate — if tainted data flows into Blizzard code, it taints that path
  3. Protected functions check taint before executing — they fail if execution path is tainted
  4. Secure frames inherit security from their creation context

Checking Taint

-- Check if a global variable is tainted
local isTainted, source = issecurevariable("SomeGlobalVar")
-- isTainted: false = secure, true = tainted
-- source: string name of the addon that tainted it (or nil if secure)

-- Check table field
local isTainted, source = issecurevariable(someTable, "someKey")

Common Taint Pitfalls

-- WRONG — This taints the Blizzard settings table
Settings.RegisterAddOnCategory = myFunc  -- TAINT!

-- WRONG — Modifying secure frame in insecure context
local btn = PlayerFrame  -- This is a secure Blizzard frame
btn:SetAttribute("type", "spell")  -- TAINT — can cause action blocked errors

-- RIGHT — Use hooksecurefunc for observation without tainting
hooksecurefunc("SomeBlizzardFunction", function(...)
    -- Your code runs AFTER the original — doesn't taint
end)

Secure Execution & Protected Functions

Protected Function Restrictions

Functions marked #protected can only be called from:

  • Secure (Blizzard) code
  • Secure click handlers triggered by hardware events
  • Inside SecureActionButtonTemplate handlers

Protected functions include:

  • All combat-related casting: CastSpellByName(), CastSpellByID(), UseAction()
  • Item use: UseItemByName(), UseContainerItem() (in combat)
  • Target changes: TargetUnit(), AssistUnit(), FocusUnit()
  • Movement: MoveForwardStart(), JumpOrAscendStart()
  • UI state: SetAttribute() on secure frames (in combat)

Combat Lockdown

-- Check if in combat lockdown
if InCombatLockdown() then
    -- Cannot: create/destroy secure frames, change secure attributes
    -- Cannot: set points on secure frames, change parent/visibility of secure frames
    -- Can: read attributes, modify non-secure frames, queue changes for later
    return
end

-- Queue changes for after combat
local frame = CreateFrame("Frame")
frame:RegisterEvent("PLAYER_REGEN_ENABLED")
frame:SetScript("OnEvent", function()
    -- Combat ended — safe to modify secure frames now
    DoSecureFrameChanges()
end)

Secure Handlers & Templates

-- SecureActionButtonTemplate — allows protected actions via user clicks
local btn = CreateFrame("Button", "MySecureBtn", UIParent, "SecureActionButtonTemplate")
btn:SetAttribute("type", "spell")
btn:SetAttribute("spell", "Fireball")
-- When clicked by hardware event, this will cast Fireball

-- SecureHandlerBaseTemplate — run secure snippets
local frame = CreateFrame("Frame", nil, UIParent, "SecureHandlerBaseTemplate")
frame:SetAttribute("_onstate-combat", [[
    -- This snippet runs in the secure environment
    if newstate == "combat" then
        self:Hide()
    else
        self:Show()
    end
]])
RegisterStateDriver(frame, "combat", "[combat] combat; nocombat")

State Drivers

-- Register a state driver for automatic secure attribute updates
RegisterStateDriver(frame, "stateName", "conditionalString")
-- e.g., RegisterStateDriver(frame, "visibility", "[combat] hide; show")

UnregisterStateDriver(frame, "stateName")

C_Timer — Timer API

Wiki: https://warcraft.wiki.gg/wiki/API_C_Timer.After

Timer Functions

FunctionReturnsDescription
C_Timer.After(seconds, callback)One-shot timer
C_Timer.NewTimer(seconds, callback)timerCancellable one-shot timer
C_Timer.NewTicker(seconds, callback [, iterations])tickerRepeating timer

Timer Object Methods

local timer = C_Timer.NewTimer(5, function()
    print("5 seconds elapsed")
end)
timer:Cancel()  -- Cancel before it fires

local ticker = C_Timer.NewTicker(1, function()
    print("Every second")
end, 10)  -- Stop after 10 iterations
ticker:Cancel()  -- Or cancel early

-- Simple delay (non-cancellable)
C_Timer.After(2, function()
    print("2 seconds later")
end)

Hooks — Function Hooking

hooksecurefunc

The primary safe hooking mechanism. Your hook runs after the original function, without tainting it.

-- Hook a global function
hooksecurefunc("UseAction", function(slot, checkCursor, onSelf)
    print("Action used:", slot)
end)

-- Hook a method on an object
hooksecurefunc(GameTooltip, "SetUnitAura", function(self, ...)
    -- Runs after GameTooltip:SetUnitAura
end)

-- IMPORTANT: You CANNOT prevent the original from executing
-- IMPORTANT: You CANNOT modify the return values
-- IMPORTANT: Your hook does NOT taint the original function

securecallfunction / securecallmethod

-- Call a function in secure context (if possible)
securecallfunction(func, arg1, arg2)

-- Call a method in secure context
securecallmethod(object, "MethodName", arg1, arg2)

C_RestrictedActions — Addon Restriction State

New in 12.0.0. Tracks when addon restrictions are active (e.g., inside instances).

FunctionReturnsDescription
C_RestrictedActions.GetAddOnRestrictionState(type)stateCurrent restriction state
C_RestrictedActions.IsAddOnRestrictionActive(type)activeIs restriction currently active?
C_RestrictedActions.CheckAllowProtectedFunctions(object [, silent])protectedFunctionsAllowedCan object call protected funcs?
InCombatLockdown()inCombatLockdownCombat lockdown active?

Restriction Events

EventDescription
ADDON_RESTRICTION_STATE_CHANGEDRestriction state changed (entering/leaving instance)
PLAYER_REGEN_DISABLEDEntering combat
PLAYER_REGEN_ENABLEDLeaving combat

C_Log — Logging

FunctionDescription
C_Log.LogMessage(message)Log info message
C_Log.LogWarningMessage(message)Log warning
C_Log.LogErrorMessage(message)Log error
C_Log.LogMessageWithPriority(priority, message)Log with specific priority
Note: ConsolePrint() was removed in 12.0.0. Use C_Log.LogMessage() instead.

FrameScript Functions

WoW provides special FrameScript functions for working with the secure/secret value system:

FunctionReturnsDescription
issecurevariable([table,] name)isSecure, taintSourceCheck taint status
issecretvalue(value)isSecretIs value a secret?
issecrettable(table)isSecretOrContentsSecretIs table or contents secret?
canaccessvalue(value)isAccessibleCan addon access this value?
hasanysecretvalues(values)isAnyValueSecretAny arg secret?
scrubsecretvalues(values)scrubbedReplace secrets with nil
secretwrap(values)wrappedWrap values as secrets
mapvalues(func, values)mappedMap function over values (secret-safe)
securecallfunction(func,...)resultsCall in secure context
securecallmethod(obj, method,...)resultsCall method in secure context
forceinsecure()Force insecure execution
seterrorhandler(handler)Set global error handler
geterrorhandler()handlerGet current error handler

Debugging Utilities

Error Handling

-- Set a custom error handler
seterrorhandler(function(msg)
    -- msg is the error string
    print("ERROR:", msg)
end)

-- Protected call with error handling
local success, err = pcall(function()
    -- Code that might error
end)
if not success then
    print("Error:", err)
end

-- xpcall with message handler
local success, err = xpcall(function()
    error("something broke")
end, function(msg)
    return msg .. "\n" .. debugstack(2)
end)

Debug Stack & Info

-- Get a stack trace
local stack = debugstack([thread,] [start [, count1 [, count2]]])

-- Get debug info
local info = debuglocals([thread,] [level])

-- Profile timing
debugprofilestart()
-- ... code to measure ...
local elapsed = debugprofilestop()  -- microseconds

Slash Commands for Debugging

-- /dump expression — evaluates and prints
-- /run code — executes Lua code
-- /script code — same as /run
-- /console cvarName [value] — get/set console variables

Common Patterns

Deferred Initialization (Wait for Login)

local frame = CreateFrame("Frame")
frame:RegisterEvent("PLAYER_LOGIN")
frame:SetScript("OnEvent", function(self, event)
    -- Safe to initialize — player is logged in
    self:UnregisterEvent(event)
    InitializeAddon()
end)

Safe OnUpdate Throttle

local elapsed = 0
local THROTTLE = 0.1  -- 100ms
frame:SetScript("OnUpdate", function(self, dt)
    elapsed = elapsed + dt
    if elapsed < THROTTLE then return end
    elapsed = 0
    -- Do periodic work
end)

Post-Combat Action Queue

local pendingActions = {}

local function QueueAction(action)
    if InCombatLockdown() then
        tinsert(pendingActions, action)
    else
        action()
    end
end

local frame = CreateFrame("Frame")
frame:RegisterEvent("PLAYER_REGEN_ENABLED")
frame:SetScript("OnEvent", function()
    for _, action in ipairs(pendingActions) do
        action()
    end
    wipe(pendingActions)
end)

Graceful Secret Value Handling (12.0.0)

-- When values might be secret, pass them directly to widgets
local name = UnitName(unit)  -- may be secret
myFontString:SetText(name)   -- widgets accept secrets

-- Check if a value is secret before trying operations
if not issecretvalue(someValue) then
    -- Safe to compare, do arithmetic, etc.
    if someValue == "expected" then ... end
else
    -- Cannot inspect — pass to UI widget directly
    myWidget:SetText(someValue)
end

Gotchas & Restrictions

  1. No require() — WoW has no module system. Use the TOC file to control load order. Libraries are embedded directly.
  2. setfenv() / getfenv() — Severely restricted. Do not rely on environment manipulation.
  3. collectgarbage() — Only "count" mode works. Cannot force GC collection.
  4. Taint is sticky — Once a variable is tainted, it stays tainted. Even if you set it back to the original value, the taint remains.
  5. print() goes to chat — Unlike standard Lua, print() outputs to the default chat frame, not stdout.
  6. String library additions — WoW adds strsplit, strjoin, strtrim, and strmatch as globals (in addition to string.match).
  7. No os.exit() — Cannot terminate the client programmatically.
  8. Coroutines work — Full coroutine support is available and commonly used for async patterns.
  9. Secret values (12.0.0) — Some API returns are now opaque "secret" values that cannot be inspected, compared, or used in arithmetic. See the wow-api-important instructions for full details.
  10. Instance restrictions (12.0.0)SendAddonMessage() is blocked in instances. Design addons to work without inter-player communication during instanced content.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

展示第三方安全扫描或审计结果

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

平台分布

Codex

34.07%
按下载量换算23

Claude

29.24%
按下载量换算20

Cursor

20.68%
按下载量换算14

Gemini CLI

9.76%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/jburlison/wowaddonapiagents --skill wow-api-lua-environment 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

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

来源信息

继续浏览同类 Skills