wow-lua-patterns

Standardize WoW addon Lua coding with namespaces, caching, and secure hooks.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Xerrion/opencode --skill wow-lua-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wow-lua-patterns
Source: https://github.com/Xerrion/opencode/tree/main/skills/wow-lua-patterns
Command: npx skills add https://github.com/Xerrion/opencode --skill wow-lua-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing WoW addon Lua code often leads to globals, inconsistent patterns, and maintainability issues across projects. This Skill standardizes common patterns to improve reliability, readability, and performance across addons.

Core Features & Use Cases

  • Namespace pattern to share state without polluting globals
  • Global caching and optimized access to API calls
  • SavedVariables and version guards for stable persistence
  • Metatables and OOP-style composition for modular addon design
  • Secure hooks and Slash Commands for safe integration
  • String patterns and table management strategies

Use cases: When starting a new addon, refactoring an existing one, or introducing consistent coding guidelines across a team.

Quick Start

Load this skill during addon development to adopt the patterns in your Lua files.

Frequently Asked Questions about wow-lua-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure WoW addon Lua code to avoid global namespace pollution?

To avoid global namespace pollution in WoW addon Lua code, implement a namespace pattern to share state securely. This approach isolates your addon's variables and functions within a centralized table, preventing global conflicts and improving overall addon maintainability.

What is the best way to manage SavedVariables in WoW addon development?

The best way to manage SavedVariables in WoW addon development is using version guards during initialization. This pattern ensures stable persistence across game updates by safely handling data structure changes and validating saved variable formats when your addon loads.

How do I use metatables for OOP-style composition in Lua addons?

Metatables enable OOP-style composition in Lua addons by defining reusable object blueprints. You set up metatables to handle inheritance and method resolution, allowing you to create modular, maintainable addon designs rather than relying on repetitive procedural code.

How do I implement secure hooks and safe slash commands in WoW addons?

Secure hooks and safe slash commands in WoW addons are implemented by adhering to Blizzard's secure hook usage guidelines and using protected slash command handlers. This ensures safe integration with the game's UI without triggering taint or execution errors.

How do I optimize WoW addon performance with Lua caching patterns?

WoW addon performance is optimized by applying global caching patterns to store and reuse API call results. By properly caching frequently accessed game API functions in local variables, you reduce overhead and significantly boost your addon's runtime execution speed.