8000 feat(skills): shorter built-in skills, a plugin-commands skill and a customize guide by aorumbayev · Pull Request #113 · kagan-sh/kagan · GitHub
[go: up one dir, main page]

Skip to content

feat(skills): shorter built-in skills, a plugin-commands skill and a customize guide - #113

Merged
aorumbayev merged 20 commits into
mainfrom
feat/skill-texts
Nov 10, 2026
Merged

aorumbayev merged 20 commits into
mainfrom
feat/skill-texts

Conversation

@aorumbayev
Copy link
Copy Markdown
Member

Makes kagan's built-in skills shorter and easier for agents to pick, and gives agents a map of plugin commands and of how to customize kagan.

What changed

  • Trigger lines: kg-ui and kg-plugin-authoring say "Use when…" with the words a person says. kg-cli's socket rules and kg-threads's --environment text are cut and point to their guide chapters. kg-skill-creator gains a "Test it" step (trigger prompt, near-miss prompt, with and without the skill).
  • Bundled skills carry files (decision 207). Each bundled skill is a folder; each read places it at <dataDir>/agent/bundled/<hash> (temp folder, then rename; a lost race keeps the winner's folder). Each read checks the folder against the binary; a damaged one is moved aside and rebuilt. Leftover temp and broken folders older than an hour are swept.
  • Split: kg-plugin-authoring 14.9 KB → 4.1 KB entry + 5 references. kg-plugin-port 22.5 KB → 3.8 KB entry + 6 references. Nothing lost (checked line by line by script, twice).
  • kg-plugin-commands (decision 208): generated from running plugins' cli commands and their manifest usage; absent when none. Manifest cli names and usage are now checked (one plain line, ≤200 chars, no backticks or control characters). The name is reserved from plugins.
  • kg guide customize + kg-customize (decision 209): themes, keys, preferences (the one list now), instructions.md (which programs get it), skill folders. The chapter lives in docs/customize.md. A test runs every kg … command the chapter names against the CLI tree.

Checked

fmt, clippy -D warnings, 1820 tests, size budget (71,013 of 71,092) and the other scripts. A fresh reviewer's findings are fixed, each behaviour fix with a test shown failing first.

Note

#112 also adds decision 207 and touches the size budget; whichever merges second renumbers.

Say when the kg-ui and kg-plugin-authoring skills apply, in the words a person uses.
Cut the long socket and environment paragraphs down to the rules an agent acts on,
and point to kg guide for the rest. Drop the kagan-developer line from kg-skill-creator
and add a step that tests the skill with a near-miss prompt and against no skill.
Each bundled skill is now a folder of files compiled into the binary. Each read writes
the folders to <dataDir>/agent/bundled/<hash>, named by the content hash, so Show and
Files list real paths and the native catalog copies them. The folder is built beside
its name and renamed into place. Decision 207.
… references

kg-plugin-authoring (15 KB) and kg-plugin-port (23 KB) keep a short SKILL.md with the
steps in order, and move each rule into a reference file that the entry names. The
bundled table lists each file, so skill_load and kg skill files reach them. Tests check
the entry size, that every named file ships, and that a native copy keeps them.
When a running plugin declares a kg command, the skill catalog adds a generated
kg-plugin-commands skill that lists each command, its usage from the manifest, and the
plugin id. It is rebuilt on each catalog read, so a changed plugin reaches new threads.
No plugin runs for its help. Decision 208.
kg guide customize names where each theme, key, preference, agent rule and skill folder
lives, with its command and limit. The bundled kg-customize skill says what to do in order
and points to that chapter. kg-cli points to it too. Decision 209.
Two catalog reads that find a new bundled hash folder can both rename a built folder
into it. The loser's rename failed, and that failed the catalog and every thread start.
place() now keeps the folder that is already there, since it has the same content.
A changed, missing or extra file in a bundled hash folder was served as the bundled skill
until the next upgrade, and a missing SKILL.md failed every catalog read. materialize now
compares the whole folder with the binary's text, and moves a damaged folder aside
(it is not deleted, since a reader may be inside it) before it rebuilds.
A killed run leaves a .tmp- or .broken- folder that nothing removed. materialize now
removes those older than an hour. Decision 208 names what makes folders pile up.
A plugin's cli usage became part of a skill labelled bundled, so a multi-line or
backticked usage could add its own headings or break the code span. Check now refuses
names that are not lowercase words, and a usage that is not one plain line of at most
200 characters, naming the field.
A plugin skill with that name showed up as the generated list when no plugin had a
command, and was dropped when one did. It is now dropped in every case. Decision 208.
Guards the current behaviour: the skill is rebuilt from running plugins on each read, so
disabling one removes its commands and the skill with them. It passes on the code as is.
instructions.md reaches only claude, codex, cursor-agent and pi, and only with agent
integration on; kimi and opencode get none. Restoring a key takes an empty chord with
--reset. The chapter moves to docs/customize.md, which the guide includes, so it reads as
one document.
The key list was in guide-map.md, the chapter and clap help. The map now points to the
chapter, the preference test reads the chapter, and the chapter keeps the two facts the
copy had lost (update-check is off by default; slot values). A test runs every kg command
the chapter names against the command tree, and the instruction cap and prefix come from
the constants. The word-list tests are gone.
The facts (keys, limits, names) stay in kg guide customize, so the two cannot drift.
…n skill

Plugin commands do not answer kg <name> --help alone; the generated list names each usage.
The book lists kg-customize. The plugin skill drops a duplicate sentence and a doubled blank line.
@aorumbayev
aorumbayev merged commit d85a422 into main Nov 10, 2026
19 checks passed
@aorumbayev
aorumbayev deleted the feat/skill-texts branch November 10, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0