falkicon/mechanic
Overview
This skill ensures Lua code quality for World of Warcraft addons using Luacheck for linting and StyLua for formatting. It helps detect common warnings, enforce consistent style, and apply automated fixes so code is review-ready. Use it to catch bugs early and maintain a uniform codebase across contributors.
How this skill works
The skill runs Luacheck to identify syntax errors, undefined globals, unused variables, shadowing, and other common issues. It applies StyLua to format files according to a configurable style (.stylua.toml). Additional tools provide security and complexity analysis to surface runtime safety and maintainability problems.
When to use it
- Before committing or opening a pull request
- When preparing an addon for review or public release
- During CI to enforce style and lint gates
- To hunt down undefined globals or unused code
- When auditing for security or combat-taint risks
Best practices
- Run lint before every commit to catch issues early
- Keep a project .luacheckrc and .stylua.toml under version control
- Add addon-specific globals to read_globals instead of silencing warnings
- Prefix intentionally unused variables or args with an underscore (e.g., _event)
- Run format then lint: format fixes style, lint catches logic and API issues
Example use cases
- Run addon.lint(addon="MyAddon") to list Luacheck warnings before a release
- Use addon.format(addon="MyAddon") to auto-format the entire addon
- CI pipeline: fail build if addon.format(..., check=true) or addon.lint reports issues
- Run addon.security(addon="MyAddon") to find combat_violation, taint_risk, or secret_leak problems
- Use addon.complexity(addon="MyAddon") to locate long functions and deep nesting for refactoring
FAQ
Expect undefined globals (W111/W112/W113), unused locals/args (W211/W212), value assigned but not used (W311), and shadowing (W431). Configure .luacheckrc and use _ prefixes to resolve many of them.
How do I enforce formatting in CI?
Use StyLua in check mode (addon.format(addon="MyAddon", check=true)) and fail the build when formatting differs. Combine with addon.lint to enforce both style and code quality.
Will formatting change my code behavior?
StyLua only adjusts whitespace and layout; it does not change semantics. Always run tests or lint after formatting to confirm no regressions.
10 skills
This skill helps you enforce Lua code quality for World of Warcraft addons by linting with Luacheck and formatting with StyLua.
This skill helps diagnose and fix WoW addon bugs using evidence-based debugging, runtime instrumentation, and hypothesis-driven investigation.
This skill provides pure, testable FenCore utility functions for WoW addons, enabling safe math, table, and environment operations.
This skill helps you design World of Warcraft addons with event-driven patterns, SavedVariables, and resilient APIs using Ace3.
This skill performs a comprehensive WoW addon audit, combining security, complexity, deprecation, and dead code analysis for quality.
This skill guides you through Mechanic/Fen WoW addon development, providing tooling, context, and best practices for everyday addon work.
This skill helps you write and run unit tests for World of Warcraft addons using Busted and Mechanic, improving coverage and reliability.
This skill helps you build consistent, themed FenUI WoW addons by guiding layout, widgets, and theming across panels, frames, and tabs.
This skill provides a concise index of Mechanic documentation with summaries and links to help you locate topics quickly.
This skill helps WoW addon developers master Mechanic tooling by guiding CLI, MCP, dashboard, and in-game modules with practical workflows.