| name | creating-extensions |
| description | Author kli user extensions in Common Lisp - slash commands, event handlers, tools, and other live contributions loaded from ~/.config/kli/extensions/ with hot reload via /reload. Use when asked to create, modify, or debug a kli extension, add a custom command, react to kli events, or automate kli behavior. |
| allowed-tools | Bash(kli docs:*) |
Creating kli Extensions
An extension is a named bundle of contributions - slash commands, event
handlers, tools, and more - installed into a running kli session and
retractable at any time. Extensions load from files on disk and hot-reload
with /reload: no rebuild, no restart.
Start here
This file is a discovery stub, not the usage guide. Before writing or editing
an extension, load the current API from the docs:
kli docs
kli docs extend/lisp-extensions/anatomy
kli docs extend/lisp-extensions/contribution-kinds
kli docs extend/lisp-extensions/write-your-first
kli docs extend/lisp-extensions/examples
kli docs extend/lisp-extensions/recoding-live
kli docs extend/lisp-extensions/loading-and-managing
kli docs config/capabilities
Find anything else by topic:
kli docs search <topic>
The docs are fetched live and always describe the current extension API, so
these instructions never go stale. This stub carries no API of its own, which
is why it just points at kli docs.
A Lisp extension is the deepest tier. For lighter automation, first check
whether a skill or a prompt template fits the task:
kli docs extend/choosing-a-tier
The dev loop
This loop does not change between releases:
- Write the extension file into
~/.config/kli/extensions/ (or
<project>/.kli/extensions/ when it is specific to the project kli was
launched in).
/reload re-indexes every user extension from disk and reinstalls the
enabled set. Loading is fail-soft: a broken file is isolated with a warning
while the rest keep working.
/extensions lists what is available and enabled; /enable NAME and
/disable NAME toggle one live.
- Exercise the new behavior. If a file failed to load, fix it and
/reload
again.
Acting on "make me an extension that X"
- Load the API:
kli docs extend/lisp-extensions/anatomy and
kli docs extend/lisp-extensions/contribution-kinds, adding
kli docs config/capabilities when the extension touches anything gated.
- Write the file into
~/.config/kli/extensions/, or
<project>/.kli/extensions/ when it belongs to the current project.
- Run
/reload yourself if you can invoke commands, or ask the user to.
- Confirm with
/extensions that it shows as enabled, then exercise it.