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.
npx skills add kagan-sh/kagan --skill kg-plugin-authoringgit clone --depth 1 https://github.com/kagan-sh/kaganWrote 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.
[](https://agentmods.dev/skills/kagan-sh/kagan/kg-plugin-authoring)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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.
-
Start from the starter.
kg plugin new <name>writes a folder that already works:kagan.json,main.js,jsconfig.jsonandkagan.d.ts. It has a left toolhellowith aKgButton, and a keyless commandhellothat 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 withkg keymap set <id>:hello <key>."header": truewith"when": "thread"draws a command as a button on the thread title. The id isdev.kagan.<name>, lowercase and hyphenated. -
Edit the manifest,
kagan.json. Required:id(reverse-DNS),name,version,kagan(">=0.1.0"), andentry("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 inreferences/manifest.md. -
Write the views and jobs in
main.js. The entry's default export is a View whoseinitstarts the job loop; every other View is an export named as the manifest says.references/host-and-jobs.mdhas the starter loop, the job kinds and the host calls. -
Use
KgButton, fromgpui-component, for every button: a plainButtoncannot be clicked throughkg uiandkg plugin checkwarns 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.
-
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. -
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. -
Test in the preview, never in the person's window. Put the
KG_DATA_DIRandKG_SOCKETit prints before each command:… kg ui snapshot,… kg ui click <id>,… kg plugin logs <id>. A save reloads it and errors go towatch.log; added powers fail the reload withpowers grew, so start the preview again. There,kg thread runtakes--project-id personal --environment personal. Stop withkg plugin preview stop <id>, no variables. -
Install, last.
kg plugin install <path>runs without the variables and adds it to the person's kagan. The person approves again. -
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 inreferences/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).
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.
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.
- today Changed 59244c241bf0
- 17d ago Changed · -3 lines c5fbf06dcf02
- 20d ago First seen · 37 lines · 68 tokens per session scan A 34f1eb265e2a
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.
kg-plugin-authoring compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| kg-plugin-authoringkagan-sh/kagan | Skill | 5 | today | Apache-2.0 | A | 68 | Claude Code, Codex |
| architecture-auditorg2AI/ORG2 | Skill | 2.5k | 28d ago | AGPL-3.0 | A | 70 | Claude Code, Codex |
| concord-relayGet-Concord-AI/concord-mcp | Skill | 1.7k | yesterday | MIT | A | 18 | Claude Code, Codex |
| idea-teammajiayu000/spellbook | Skill | 301 | yesterday | MIT | A | 182 | Claude Code |
| codex-agentmajiayu000/spellbook | Skill | 301 | yesterday | MIT | A | 45 | Claude Code |
| project-health-auditormajiayu000/spellbook | Skill | 301 | yesterday | MIT | A | 31 | Claude Code |
| review-gatemajiayu000/spellbook | Skill | 301 | yesterday | MIT | A | 95 | Claude Code, Codex |