kg-plugin-authoring

kg-plugin-authoring is a skill for Claude Code, Codex from kagan-sh/kagan. It costs 68 tokens per session (1,052 once invoked), scanned A, original, Apache-2.0.

A guide for building, checking, installing, and testing Kagan plugins, which are extensions that add panels, commands, agent tools, or skills. It treats the running app's available interface as the source of truth.

In plain words
What is it for?
Use it to start a plugin, define its manifest, add a panel or command, generate type information, and check the result.
Why use it?
It reduces failures caused by unsupported host functions, incorrect plugin manifests, or unverified behavior. It also gives a defined build order and checking process.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to start a plugin, define its manifest, add a panel or command, generate type information, and check the result.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kagan-sh/kagan/kg-plugin-authoring
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kagan-sh/kagan --skill kg-plugin-authoring
Clone the repo
git clone --depth 1 https://github.com/kagan-sh/kagan

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kg-plugin-authoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/kagan-sh/kagan/kg-plugin-authoring/github.svg)](https://agentmods.dev/skills/kagan-sh/kagan/kg-plugin-authoring)
Your own site
<a href="https://agentmods.dev/skills/kagan-sh/kagan/kg-plugin-authoring"><img src="https://agentmods.dev/badge/skills/kagan-sh/kagan/kg-plugin-authoring/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kg-plugin-authoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/kagan-sh/kagan/kg-plugin-authoring"><img src="https://agentmods.dev/badge/skills/kagan-sh/kagan/kg-plugin-authoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,052 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.01052
Opus 5.5 $0.00027 $0.00421
Sonnet 5.5 $0.00014 $0.00210
Haiku 4.5 $0.00007 $0.00105

Measured today against content hash 59244c241bf0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

kg-plugin-authoring scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

crates/core/skills/kg-plugin-authoring/SKILL.md · 34 lines

What it actually says

The running app is the contract: kg plugin types <path> rewrites kagan.d.ts and gpui-kit.d.ts, so run it again after upgrading kagan and before you call a host function or component you have not used. references/check.md says what kg plugin check refuses, and what it does not run.

Build a plugin in this order. Each step names the command to run.

  1. Start from the starter. kg plugin new <name> writes a folder that already works: kagan.json, main.js, jsconfig.json and kagan.d.ts. It has a left tool hello with a KgButton, and a keyless command hello that writes a line to the plugin log. A fixed key would clash with the next starter, so the person binds one in Settings → Keyboard or with kg keymap set <id>:hello <key>. "header": true with "when": "thread" draws a command as a button on the thread title. The id is dev.kagan.<name>, lowercase and hyphenated.

  2. Edit the manifest, kagan.json. Required: id (reverse-DNS), name, version, kagan (">=0.1.0"), and entry ("main.js"). Optional: instructions, "instruct": true, powers, settings, commands, ui, tools, cli, skills, events, schedules, themes, icon. Every contribution, setting, power, event, schedule and call is in references/manifest.md.

  3. Write the views and jobs in main.js. The entry's default export is a View whose init starts the job loop; every other View is an export named as the manifest says. references/host-and-jobs.md has the starter loop, the job kinds and the host calls.

  4. Use KgButton, from gpui-component, for every button: a plain Button cannot be clicked through kg ui and kg plugin check warns about it. Give every control a stable id.

4b. Draw or extend the chat. A center panel with "replaces": "chat" and "follows": "thread", granted by "areas": ["chat"], draws an ACP thread's transcript with kagan/chat; a command with "prompt": true sits before Send. Read references/chat.md.

  1. Check it. kg plugin check <path> reads the manifest, the entry, and each contribution the same way install does, and reports a refused contribution by name. It also refuses a missing host export and a field constructor the component schema rejects. Fix every error before install.

  2. Preview it first. kg plugin preview start <path> starts a hidden kagan with the plugin and blocks until the person approves it once, in their window.

  3. Test in the preview, never in the person's window. Put the KG_DATA_DIR and KG_SOCKET it prints before each command: … kg ui snapshot, … kg ui click <id>, … kg plugin logs <id>. A save reloads it and errors go to watch.log; added powers fail the reload with powers grew, so start the preview again. There, kg thread run takes --project-id personal --environment personal. Stop with kg plugin preview stop <id>, no variables.

  4. Install, last. kg plugin install <path> runs without the variables and adds it to the person's kagan. The person approves again.

  5. Share it. Commit and push the plugin, then run kg plugin share <path>. The index entry, the team index, and how teammates install the plugin are in references/share.md.

Unavailable host areas fail explicitly. Do not invent an API: if a call is not in kagan.d.ts, it does not exist in this version.

Never answer an approval; never approve powers; a chat plugin draws, the host types and answers.

References

In the references folder: manifest.md (every field and contribution), host-and-jobs.md (the job loop, job kinds, host calls), ui-controls.md (buttons, fields, web pages, drag and drop), chat.md (a chat's transcript and prompt row), check.md (what types and check cover), share.md (publishing for a team).

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed 59244c241bf0
  2. 17d ago Changed · -3 lines c5fbf06dcf02
  3. 20d ago First seen · 37 lines · 68 tokens per session scan A 34f1eb265e2a

Subscribe to this mod's changes

kg-plugin-authoring is a skill published in the GitHub repository kagan-sh/kagan (5 stars, last pushed today), licensed Apache-2.0. It adds 68 tokens to every session and 1,052 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-11.

Related

kg-plugin-authoring compared with skills from other repositories

kg-plugin-authoring next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
kg-plugin-authoringkagan-sh/kaganSkill5todayApache-2.0A68Claude Code, Codex
architecture-auditorg2AI/ORG2Skill2.5k28d agoAGPL-3.0A70Claude Code, Codex
concord-relayGet-Concord-AI/concord-mcpSkill1.7kyesterdayMITA18Claude Code, Codex
idea-teammajiayu000/spellbookSkill301yesterdayMITA182Claude Code
codex-agentmajiayu000/spellbookSkill301yesterdayMITA45Claude Code
project-health-auditormajiayu000/spellbookSkill301yesterdayMITA31Claude Code
review-gatemajiayu000/spellbookSkill301yesterdayMITA95Claude Code, Codex