@archships/dim-plugin-skills
v0.0.13
Published
Official skills plugin for dim-agent-sdk.
Downloads
141
Readme
@archships/dim-plugin-skills
Official metadata-first skills plugin for dim-agent-sdk.
What it does
- scans skills from
~/.agents/skillsby default - optionally keeps
${cwd}/.agents/skillsas a compatibility root - merges extra
rootswith stable priority - injects a
<skills_instructions>metadata segment into every model turn - lists each skill with name and description
- documents
skill: nameas a direct trigger for theskilltool - exposes a single
skilltool so the model can load full instructions by name - returns full
SKILL.mdinstruction bodies as theskilltool result - exports
installSkillBundle()for host-side skill installation
Skill layout
Each skill is a directory with a required SKILL.md file and optional bundled resources:
demo-skill/
├── SKILL.md
├── references/
├── scripts/
└── assets/SKILL.md must start with YAML frontmatter:
---
name: "demo-skill"
description: "Short description"
allowedTools:
- Read
- Grep
- Bash(git:*)
---
# Demo Skill
Read references/checklist.md before acting.
Run scripts/lint.sh with the exec tool when needed.Usage
import { createAgent, createModel } from '@archships/dim-agent-sdk'
import { createSkillsPlugin } from '@archships/dim-plugin-skills'
const agent = createAgent({
model: createModel(adapter),
cwd: process.cwd(),
plugins: [
createSkillsPlugin({
userSkillsDir: '~/.agents/skills',
roots: ['/absolute/path/to/shared-skills'],
includeWorkspaceCompatRoot: true,
}),
],
})Runtime behavior
<skills_instructions>metadata is always injected into the runtime system prompt.- The metadata prompt lists skill names and descriptions, then tells the model to call
skill. - User input containing
skill: nametells the model to callskill({ skill_name: 'name' }). - Full skill instructions are returned immediately by
skill({ skill_name })in the same model turn, prefixed with the skill's absoluteSKILL.mdpath. - Only an explicit
skill({ skill_name })tool call loads a skill.
Session controller
The plugin exposes a host-facing controller through session.getPlugin('skills'):
const controller = session.getPlugin('skills')
await controller?.getState()
await controller?.refreshCatalog()Installer helper
Use installSkillBundle() from host code or settings UI to normalize a bundle into the canonical install root:
import { installSkillBundle } from '@archships/dim-plugin-skills'
await installSkillBundle('/tmp/incoming/my-review-skill', {
targetRoot: '~/.agents/skills',
replaceExisting: false,
})Behavior notes:
- the target directory is always
${targetRoot}/${frontmatter.name} - if the source directory name differs from
frontmatter.name, only the installed copy is renamed - runtime catalog caches must be refreshed with
controller.refreshCatalog()after install / remove
Notes
allowedToolsis normalized to current SDK tool names and exposed as metadata only- scoped shell forms such as
Bash(git:*)degrade toexec; command-level exec restrictions are not enforced by this plugin - bundled files are not eagerly inlined into the prompt; loaded skills should reference them relative to the
SKILL.mddirectory and use existing tools such asreadorexec
