# Xmake Plugins

> Use when invoking built-in Xmake plugins (project generators, compile_commands, doxygen, etc.) or writing a custom task/plugin with `task(...)`.

- **Type:** Skill
- **Install:** `agentstack add skill-xmake-io-xmake-skills-xmake-plugins`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [xmake-io](https://agentstack.voostack.com/s/xmake-io)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [xmake-io](https://github.com/xmake-io)
- **Source:** https://github.com/xmake-io/xmake-skills/tree/master/skills/scripting/xmake-plugins

## Install

```sh
agentstack add skill-xmake-io-xmake-skills-xmake-plugins
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Xmake Plugins & Tasks

Plugins extend the `xmake` CLI with new subcommands. Xmake ships many built-in plugins; you can also define project-local tasks in `xmake.lua`.

## Common built-in plugins

```bash
xmake project -k compile_commands        # compile_commands.json (clangd/LSP)
xmake project -k cmakelists              # export CMakeLists.txt
xmake project -k ninja                   # build.ninja
xmake project -k vsxmake -m "debug,release"   # Visual Studio
xmake project -k xcode                   # Xcode

xmake doxygen                            # generate API docs via doxygen
xmake lua                        # run a Lua snippet in xmake env
xmake l path/to/script.lua               # shorthand
xmake macro --begin ... --end            # record a macro of commands
xmake repo --add myrepo https://...      # manage xrepo repositories
```

Auto-regenerate `compile_commands.json` on every build:

```lua
add_rules("plugin.compile_commands.autoupdate", {outputdir = "."})
```

## Listing plugins

```bash
xmake show -l plugins
```

## Defining a custom task

A task is a named script reachable via `xmake `.

```lua
task("hello")
    set_menu {
        usage = "xmake hello [options]",
        description = "Say hello",
        options = {
            {"n", "name", "kv", "world", "name to greet"}
        }
    }
    on_run(function ()
        import("core.base.option")
        print("hello, %s!", option.get("name"))
    end)
```

```bash
xmake hello --name=ruki
```

Option spec: `{short, long, kind, default, description}` where `kind` is `"k"` (flag), `"kv"` (key-value), or `"vs"` (values).

## Calling Xmake modules from a task

```lua
task("count_files")
    set_menu {usage = "xmake count_files", description = "Count .cpp files"}
    on_run(function ()
        import("core.project.project")
        for _, target in pairs(project.targets()) do
            local n = #target:sourcefiles()
            print("%s: %d files", target:name(), n)
        end
    end)
```

Commonly imported modules: `core.base.option`, `core.project.project`, `core.project.config`, `core.platform.platform`, `lib.detect.find_tool`, `core.tool.toolchain`.

## Tasks vs rules vs plugins

- **Rule**: shapes *how a target is built* (file extensions, per-target hooks).
- **Task**: adds a *new xmake subcommand* the user can invoke.
- **Plugin**: a task packaged for distribution (same `task(...)` API, lives under `~/.xmake/plugins` or a repo).

## When to branch out

- File-extension handling / codegen → `xmake-rules`
- Configure/build/test commands → `xmake-commands`

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [xmake-io](https://github.com/xmake-io)
- **Source:** [xmake-io/xmake-skills](https://github.com/xmake-io/xmake-skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-xmake-io-xmake-skills-xmake-plugins
- Seller: https://agentstack.voostack.com/s/xmake-io
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
