Using Mechanic (agent protocol)
SkillDev toolsProtocol for calling Mechanic MCP tools correctly: pick a diagnostic target, queue code, wait for the user's confirmed /reload, then read addon.output. Covers MCP-first rules, mutation and dry_run handling, and error codes. Load before any live in-game verification or any mutating Mechanic command. Triggers: diagnostic target, addon.output, reload, lua.queue, api.queue, TARGET_AMBIGUOUS, dry_run, MCP tools, verify in game.
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 Using Mechanic (agent protocol) skill
What this skill tells your AI
The instructions your AI receives, as published by falkicon/mechanic in .agent/skills/using-mechanic/SKILL.md and read by ahel’s review.
This is the single home of the diagnostic-target and reload protocol. Other skills link here instead of repeating it.
MCP first
- Call Mechanic MCP tools directly. Registry names use dots (
addon.output); the MCP adapter exposes the same commands with dashes (addon-output).fencore-*are dashed in both. - Do not run the
mechCLI for agent work and do not use the shell as a substitute. The CLI is for people (cli-commands). - If the Mechanic MCP server is unavailable, say so. Fall back to source inspection and offline checks (tests, lint) and never claim they verified installed game state.
- The command list, inputs, defaults and mutation flags are generated from the registry: afd-commands.
commands.listreturns the same data live; trust it over any prose.
Diagnostic target
SavedVariables and queue files belong to one client / account / character / profile. Commands that read or write them take an optional target object.
- Call
diagnostic.targets. Each entry hasclient,account,character,profile,sv_path,addon_path. - Choose one (ask the user when several plausibly match) and pass the same object as
targetto every related call:lua.queue,api.queue,lua.results,addon.output,sv.parse,diagnostic.metricsand thefencore-*commands. - Omitting
targetonly works when exactly one candidate exists. Otherwise the command fails withTARGET_AMBIGUOUS(several matches) orTARGET_NOT_FOUND;error.details.candidateslists the options. Never pick a profile or client by newest file or first match. diagnostic.metricswith atargetalso returns that target's last saved overhead snapshot.
Reload protocol (live verification)
An edit in a worktree does not change the installed addon, and file-watcher events do not prove a reload finished.
- Make the change and complete the offline checks first (
addon.lint,addon.test/sandbox.test, the repo's regression harnesses). - Make sure the installed addon is the changed code (junction links via
addon.sync, or the user copies/links it). Documentation-only changes need no reload. - To run code in game:
lua.queue(orapi.queue) with the selectedtarget. The queue is written into that client's!Mechanicaddon and runs on the next load. - Ask the user to
/reload, then wait for their explicit confirmation. Do not infer completion from elapsed time or watcher events.reload.triggerdoes not exist; the dashboard Reload button only shows instructions. - Only then read results:
addon.outputwithagent_mode=trueand the sametarget(also covers Lua eval results), orlua.resultsfor just the queue results. - Check freshness:
addon.outputreports the profile's last sync time (else the last Lua eval run). Older than your reload means the reload has not been captured yet; ask the user again rather than guessing. ABUGGRABBER_UNREADABLEwarning means the error list could not be read. - State what was and was not verified in game.
Mutating commands
Read-only commands are safe to call freely. Mutating commands (flag in the reference) change files, git state, launch things or execute code.
release.all,addon.sync,libs.syncandassets.syncsupportdry_run. Always rundry_run: truefirst, show the plan to the user, and run the real call only after they confirm.- Never run
git.commit,git.tag,version.bump,changelog.add,release.all(real run),api.downloadorresearch.query(network) unless the user asked for that action. sandbox.execandsandbox.testrun Lua in a restricted environment (whitelisted globals, noos/io/require/load*, 30s timeout, 256KB output cap, memory not limited).addon.testruns Busted with the addon's own code; treat it as code execution.- The
perf.*commands are flagged mutating even when they only read.
Errors and warnings
Results are {success, data, error, warnings, reasoning}. Failures carry error.code, error.message and error.suggestion; follow the suggestion.
| Code | Meaning |
|---|---|
TARGET_AMBIGUOUS / TARGET_NOT_FOUND / TARGET_READ_ERROR | Target selection failed; see error.details.candidates and call diagnostic.targets |
VALIDATION_ERROR | Invalid input; error.details.errors lists field, message, type |
ADDON_NOT_FOUND | Addon name or path wrong; addons are looked up in the configured _dev_ folder |
NOT_RUNNING | server.shutdown was called outside a dashboard process |
CATALOG_NOT_FOUND | FenCore did not register a catalog in the selected MechanicDB (load FenCore, /reload) |
INVALID_CATEGORY | Unknown value in an analyzer's categories input |
Warnings worth acting on: DEPRECATION_DB_LIMITED (the deprecation database is incomplete; see s-audit).
Pick the right tool
| Goal | Tools |
|---|---|
| Environment and tool status | env.status, tools.status |
| Static quality | addon.validate, addon.lint, addon.format (check=true to only check), addon.security, addon.complexity, addon.deadcode, addon.deprecations, docs.stale, locale.validate |
| Offline tests | sandbox.test (Core layer), addon.test (Busted) |
| Live game evidence | diagnostic.targets, lua.queue, api.queue, addon.output, lua.results |
| WoW API lookup (offline) | api.search, api.info, api.list, api.stats |
| Releases | addon.validate, release.all (dry run first) |
| Dashboard / process | dashboard.metrics, diagnostic.metrics, server.shutdown |
More: k-mechanic (architecture), k-ecosystem (components), s-debug (evidence-based debugging).
Signals
- GitHub stars
- 19
- Forks
- 5
- Last commit
- Oct 2026
Advanced
- Item type
- skill
- Key
using-mechanic- Source
- github.com/falkicon/mechanic