Repository navigation
feat(skills): shorter built-in skills, a plugin-commands skill and a customize guide - #113
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
kg-uiandkg-plugin-authoringsay "Use when…" with the words a person says.kg-cli's socket rules andkg-threads's--environmenttext are cut and point to their guide chapters.kg-skill-creatorgains a "Test it" step (trigger prompt, near-miss prompt, with and without the skill).<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.kg-plugin-authoring14.9 KB → 4.1 KB entry + 5 references.kg-plugin-port22.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'clicommands and their manifestusage; absent when none. Manifestclinames andusageare 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 indocs/customize.md. A test runs everykg …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.