Skip to content

Author the plugin once. Compile every agent host.

Validate the skill graph once, then ship self-contained skills, a visual catalog, portable hooks, and exact manifests for every supported agent host. Deterministic output keeps local builds and CI aligned.

npm install --save-dev --save-exact @fam-tung-lam/ptlam-agent-plugin-compiler

One exact version in the lockfile, so CI compiles with the compiler you did.

What the compiler gives you

From a skill graph to a release-ready plugin.

Every compile walks these stages in order, and stops at the first one that cannot prove its result.

  1. 01model

    Declare the graph and lifecycle

    Give dependencies, visibility, status, migration guidance, and manual-only invocation one source of truth in plugin/plugin.yml.

  2. 02validate

    Catch stale contracts before output

    Validate schema, source layout, Markdown links, lifecycle rules, and recursive dependencies before any generated path changes.

  3. 03package

    Ship complete installable skills

    Compile each public root with generated frontmatter, dependency instructions, supporting files, and every required skill nested recursively.

  4. 04catalog

    Review the published graph

    Generate an installable-skill table and Mermaid dependency graph, grouped by category and labelled with lifecycle status and visibility.

  5. 05translate

    Target five hosts from one source

    Emit exact manifests and translate portable hooks only where Claude, Codex, Copilot, Gemini, or Kimi exposes equivalent native events.

  6. 06verify

    Make generated state a build gate

    Write bounded output with atomic file and tree operations, verify it from disk, and use read-only check to fail CI on deterministic drift.

Supported hosts

Five adapters, one validated model

Select any combination in plugin/plugin.yml, or override the selection for a single run. Each adapter declares the exact manifest files it owns, and receives portable hooks only where the host exposes an equivalent native event.

  • Claude pluginclaude

    • .claude-plugin/plugin.json
    • .claude-plugin/marketplace.json
  • Codex plugincodex

    • .codex-plugin/plugin.json
  • GitHub Copilot CLIcopilot

    • plugin.json
  • Gemini CLI extensiongemini

    • gemini-extension.json
  • Kimi Code CLI pluginkimi

    • kimi.plugin.json

The shared skills/** tree is generated either way, so a plugin that targets no host manifest still gets self-contained skills. Node.js callers can register an adapter for a host the compiler does not ship — see Providers.

Command surface

Four commands, and only two of them write

The package installs one executable, plugin-compiler. Run it through npm exec -- in a repository that has the package installed.

  • init writes missing source paths

    Create a safe starter

  • validatereads only

    Validate manifest, skills, hooks, and graph

  • compile writes managed output

    Compile and verify managed output

  • checkreads only

    Report generated drift

Every command takes --root, and validate, compile, and check take one provider selection — see the CLI reference.

Verifiable in CI

Stale generated output becomes a failing build

The same authored source always compiles to the same bytes, and the compiler declares exactly which paths it owns. So it can compare the committed output with what the source implies.

plugin-compiler checkexit 1

$ npm exec -- plugin-compiler check
Output check found 1 drift entry:
- skills/prepare-change-plan/SKILL.md: content-differs

check writes nothing, names every path that drifted, and exits non-zero. No extra scripting is needed to fail a job.

Exit codes

0
The request completed successfully
1
Compilation, validation, or generated-state verification failed
2
CLI syntax or option usage was invalid

Wire it into a workflow with Continuous integration.

Released under the MIT License.