home / skills / falkicon / mechanic / k-mechanic

k-mechanic skill

/.agent/skills/k-mechanic

This skill helps WoW addon developers master Mechanic tooling by guiding CLI, MCP, dashboard, and in-game modules with practical workflows.

npx playbooks add skill falkicon/mechanic --skill k-mechanic

Review the files below or copy the command above to add this skill to your agents.

Files (6)
SKILL.md
4.0 KB
---
name: k-mechanic
description: >
  Context for Mechanic - the WoW addon development hub. Covers the CLI,
  MCP server, dashboard, in-game modules, and MechanicLib. Load this for
  deep understanding of Mechanic tooling.
  Triggers: mechanic, mech, cli, mcp, dashboard, tools, development hub.
---

# Mechanic Development Hub

Mechanic is the unified platform for WoW addon development, providing CLI tools, MCP integration, a web dashboard, and in-game diagnostics.

## Architecture

```
┌─────────────────────────────────────────────────────┐
│                   Mechanic Desktop                   │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  │
│  │  CLI (mech) │  │ MCP Server  │  │  Dashboard  │  │
│  └─────────────┘  └─────────────┘  └─────────────┘  │
└─────────────────────────┬───────────────────────────┘
                          │ SavedVariables Sync
┌─────────────────────────▼───────────────────────────┐
│                  !Mechanic Addon                     │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  │
│  │   Console   │  │   Errors    │  │    Tests    │  │
│  └─────────────┘  └─────────────┘  └─────────────┘  │
└─────────────────────────────────────────────────────┘
```

## MCP Tools (Use These First)

> **MANDATORY**: ALWAYS use MCP tools directly instead of the shell.

| Task | MCP Tool |
|------|----------|
| Env Status | `env.status()` |
| Get Addon Output | `addon.output(agent_mode=true)` |
| Lint Addon | `addon.lint(addon="MyAddon")` |
| Format Addon | `addon.format(addon="MyAddon")` |
| Run Tests | `addon.test(addon="MyAddon")` |
| Sync Addon | `addon.sync(addon="MyAddon")` |
| Search APIs | `api.search(query="*Spell*")` |

## Components

### CLI (`mech`)

Command-line interface for all operations:
- `mech lint <addon>` - Run Luacheck
- `mech format <addon>` - Run StyLua
- `mech test <addon>` - Run Busted tests
- `mech release <addon> <version> "<message>"` - Full release workflow

### MCP Server

Exposes 53 AFD commands as MCP tools for AI agents. All functionality available via `mech call <command>` is also available as MCP tools.

### Dashboard

Web UI at `http://localhost:5173`:
- Real-time SavedVariables sync
- Reload trigger button
- Error/test/console log viewer

### In-Game Modules

The `!Mechanic` addon provides:
- **Console** - Aggregated print output from all registered addons
- **Errors** - BugGrabber integration for Lua error capture
- **Tests** - In-game test results from MechanicLib tests
- **Inspect** - Frame inspector for UI debugging
- **API Bench** - Performance testing for WoW APIs

## MechanicLib Integration

Addons register with Mechanic via MechanicLib:

```lua
local ML = LibStub("MechanicLib")
ML:RegisterAddon("MyAddon", {
    version = "1.0.0",
    Print = function(...) ML:Print("MyAddon", ...) end,
})
```

## Routing Logic

| Request type | Load reference |
|--------------|----------------|
| CLI commands | [references/cli-commands.md](references/cli-commands.md) |
| AFD commands | [references/afd-commands.md](references/afd-commands.md) |
| In-game modules | [references/ingame-modules.md](references/ingame-modules.md) |
| MechanicLib | [references/mechaniclib.md](references/mechaniclib.md) |
| Dashboard | [references/dashboard.md](references/dashboard.md) |

Overview

This skill provides deep context for Mechanic, the World of Warcraft addon development hub. It explains the CLI, MCP server, web dashboard, in-game modules, and MechanicLib integration so agents can operate the full Mechanic toolchain. Load it to enable accurate commands, diagnostics, and workflows for WoW addon development.

How this skill works

The skill describes Mechanic’s architecture and how desktop components (CLI, MCP server, dashboard) synchronize with the in-game !Mechanic addon via SavedVariables. It documents MCP tools that wrap AFD commands, CLI commands for linting/formatting/testing/releasing, dashboard capabilities, and in-game modules for console, error capture, tests, and performance inspection. MechanicLib registration patterns are provided so agents can identify and interact with registered addons.

When to use it

  • When an agent must run or translate CLI workflows like lint/format/test/release for an addon
  • When interacting with MCP tools or issuing mech call commands via the MCP server
  • When diagnosing runtime behavior using the web dashboard or in-game console/errors/tests
  • When instrumenting or registering an addon with MechanicLib for in-game integration
  • When needing to sync SavedVariables or trigger reloads across desktop and in-game components

Best practices

  • Prefer MCP tools over shell commands for authoritative operations (use env.status(), addon.lint(), etc.)
  • Use the CLI for local workflow automation but rely on MCP for interactions that require in-game context
  • Keep MechanicLib registration minimal and include a Print wrapper for unified output
  • Use the dashboard for real-time SavedVariables sync and to view aggregated logs before acting
  • Run tests through addon.test(addon) and verify results in both dashboard and in-game Tests module

Example use cases

  • Run a full release: mech release <addon> <version> "message" to build and tag, then confirm via dashboard
  • Debug a Lua error captured by the Errors module and view the stack trace in the dashboard before patching code
  • Run lint and format: mech lint <addon> and mech format <addon>, or use addon.lint/addon.format via MCP tools
  • Write a MechanicLib registration snippet for an addon to ensure console aggregation and unified Print output
  • Use the API Bench and Inspect modules in-game to find UI performance bottlenecks and frame issues

FAQ

Should I call mech shell commands or MCP tools for operations affecting the game?

Use MCP tools for any operation that depends on in-game state; they are the authoritative interface. Use CLI commands for offline build, lint, format, and test automation.

How do addons integrate with Mechanic for unified logging?

Register the addon with MechanicLib and provide a Print function that calls ML:Print("MyAddon", ...). This ensures console aggregation and consistent output across desktop and in-game views.