APIDefs generation
SkillSearchHow Mechanic's APIDefs (the offline WoW API database behind api.search, api.info and the in-game API tab) are generated and refreshed: api.populate, api.generate, api.refresh and api.download, the canonical Mechanic/UI/APIDefs tree, and the secret-value flags. Load when refreshing APIs after a patch. Triggers: APIDefs, api.refresh, api.populate, api.generate, api.download, wow-ui-source, API database, Midnight impact, refresh API definitions.
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the APIDefs generation skill
What this skill tells your AI
The instructions your AI receives, as published by falkicon/mechanic in .agent/skills/k-apidefs/SKILL.md and read by ahel’s review.
Mechanic/UI/APIDefs/ is the only APIDefs tree (the one Mechanic.toc loads through UI\APIDefs\APIDefs.xml). It is generated: never edit the files by hand. The same data serves api.search, api.info, api.list, api.stats, the sandbox stub generator and the in-game API tab.
Pipeline
Blizzard_APIDocumentationGenerated (wow-ui-source or a Townlong Yak extract)
--api.populate--> api_database.json (default: <data_dir>/api_database.json)
--api.generate--> Mechanic/UI/APIDefs/<namespace>.lua + APIDefs.xml
| Command | Use |
|---|---|
api.refresh(source_path) | Normal case: populate + generate in one step. source_path is the wow-ui-source repo root or an extract |
api.populate(source_path, output_path?) | Parse docs into the database only. Reports the detected wow_version, api_count and any skipped_files with reasons |
api.generate(database_path?, output_path?) | Regenerate the Lua files from an existing database. output_path must be a folder named APIDefs unless allow_any_output_dir=true |
api.download(build_id, output_path?, refresh=true) | Fetch a FrameXML build from Townlong Yak (digits-only build id), extract under <data_dir>/framexml/<version>, optionally refresh. Network; only when asked |
All are mutating commands: preview intent with the user, and use a scratch output_path (with allow_any_output_dir if needed) when experimenting so the committed tree is not touched. api.populate uses the packaged resources/lua_dumper.lua when a Lua 5.1 executable is available (MECHANIC_LUA, desktop/bin, or PATH; tools.status reports it).
Refresh workflow
- Get Blizzard's source for the build you want (a
wow-ui-sourcecheckout ofliveorbeta, orapi.download). api.refresh(source_path=...); readapi_count,namespace_countandskipped_files.- Review the diff of
Mechanic/UI/APIDefs/: a large, unexplained change inapi_countmeans the parser or source changed, not the game. - Run the Lua checks and the desktop tests (run every
tests/*_regressions.luaharness; the APIDefs tree is loaded throughMechanic/UI/APIDefs/APIDefs.xml). - Verify in game with the reload protocol (using-mechanic): the API tab loads and lists the new build's APIs.
- Record the source build in the CHANGELOG entry.
Data semantics
- Each entry has
key,name,category,subcategory,funcPath,params,returnsand a secret-value classificationmidnightImpact(NORMAL, orRESTRICTEDwithprotected = true). - Only
SecretArguments = "NotAllowed"marks an APIRESTRICTED;AllowedWhenUntaintedisNORMAL. - Only functions are generated: widget script-object methods and events from the documentation are not global APIs. Entries carry
funcPath, not a function reference, and the addon resolves the function at run time (check existence before calling). - The API count depends on the build; the current number is whatever
api.statsreports for the checkout.
Related: s-research (using the data), k-desktop (changing the commands), k-mechanic (API tab).
Signals
- GitHub stars
- 19
- Forks
- 5
- Last commit
- Oct 2026
Advanced
- Item type
- skill
- Key
k-apidefs- Source
- github.com/falkicon/mechanic