sleipnir-plugin
Make or change a Sleipnir plugin and load it live (sleipnir tool).
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- sleipnir-plugin
- license
- MIT
- description
- Make or change a Sleipnir plugin and load it live (sleipnir tool).
03 SKILL.md 正文
Writing a Sleipnir plugin
A plugin is a directory. Sleipnir reads it when the session starts, so the loop is: write it, check it, install it, reload, try it.
This page is the whole contract: do not search for Sleipnir's source or documentation, and let plugins op check tell you what is
wrong.
The loop
- Write the plugin in a directory of its own:
$TMPDIR/<id>/for a plugin of the person's, orplugins/<id>/inside the project when it belongs to the project's repository. Never write into~/.sleipnir: install copies it there. sleipnirtool, actionplugins, opcheck, source = that directory. Fix every error; read every warning.- Op
installwith the same source (andreplace: truewhen you are updating a plugin that is already installed). Install turns it on in the person's own settings. - Action
reloadwithwhysaying what it adds. The session starts again with this conversation when your turn ends, and you are told to go on: then check it is there (sleipniractionhelp,run /skills, or the command itself) and tell the person.
The directory
<id>/
plugin.json the manifest (required)
skills/<name>/SKILL.md skills: front matter with name and description, then the instructions
commands/<name>.md slash commands: optional front matter (description, argument-hint), then the prompt; $ARGUMENTS is what follows the command
agents/<name>.md roles for the team: front matter (name, description, tools), then the role's instructions
hooks.json hooks: {"EventName": [{"matcher": "tool", "hooks": [{"type": "command", "command": "..."}]}]}
mcp.json tool servers: {"mcpServers": {"name": {"command": "...", "args": [...]}}}
web/card.js a card for the web page (optional web/card.css)
Only plugin.json is required; add only what the request needs. A skill is the cheapest way to teach the agents something; a slash
command gives the person a shortcut; a hook runs a command around tool calls or session events; a tool server gives the agents new
tools.
plugin.json:
{
"id": "standup",
"api": 1,
"title": "Standup",
"description": "a /standup command that summarises yesterday's commits",
"version": "1.0.0",
"requires": ["commands"],
"config": {"type": "object", "properties": {
"since": {"type": "string", "title": "Since", "description": "how far back", "default": "yesterday"}
}}
}
id: lower-case letters, digits and- _ . :; notcore:,view:orrole:, and not a built-in plugin's id.api: the plugin API it is written for. Always write it: the current one is whatplugins op checkreports. Sleipnir reads every API version it supports the same way across updates, so a plugin that names its version keeps working when Sleipnir is updated; a plugin of a newer API than the installed Sleipnir is refused with a reason instead of half working.version: raise it on every change you install withreplace.requires: plugin ids that must be on (skillsfor skills,commandsfor commands,agentsfor roles,hooksfor hooks,mcpfor tool servers).config: settings the Plugins page shows a form for (string,number,integer,boolean; anenumlist makes a choice).needs: leave it out unless the plugin runs a program the person may not have installed; check says what is wrong with one.
In hooks.json and mcp.json, ${SLEIPNIR_PLUGIN_ROOT} is the plugin's installed directory and ${setting:NAME} a setting's
value. Commands of a plugin are named <id>:<name> (/standup:today), skills <id>:<name>.
Keep it working across updates
- Use only what this page describes. Fields the API does not know are ignored, and check warns about them.
- Scripts a hook or tool server runs live inside the plugin and are referenced through
${SLEIPNIR_PLUGIN_ROOT}; pin the versions of anything they install. - After a Sleipnir update,
plugins op listshows each installed plugin's state and API; one in error says why.
Safety
A hook or tool server runs commands on the person's machine in every later session. Write only what the request needs, say in your reply what each hook runs, and never put a secret in a plugin's files: use a setting or an environment variable.
04 同仓库更多 Skills
spec
Goal to specification, vertical slices and milestones a judge can check. Load when planning a product or large feature or splitting work into tasks.
reverse-engineering-ui
Tear down a live site or web UI into an evidence-backed spec (layout, tokens, components, states, network) for an original rebuild. Use to clone or match one.
prototype
Throwaway prototype that settles a design question by observation. Load when choosing between layouts, interactions or state models.
plain-writing
Clear technical writing without machine-generated tells. Load before writing a README, docs, site copy, release notes, a commit or PR message.
diagnose
Feedback-loop-first diagnosis of hard bugs, flaky tests and performance regressions. Load before changing code when the cause is not obvious.
codebase-design
Deep modules, interfaces and seams. Load when designing or restructuring modules or deciding where an interface goes.