Agent skills
The skills plugin generates agent skills for one database from its stored definitions.
While the database is open, it updates them in the configured output directory.
An agent harness that reads SKILL.md files learns from them how to operate this database through the bindings.
Enable skills in the plugin selection at open, with the settings below.
Calls without it report the unavailable status.
Settings
Set dir to a dedicated directory for the skills:
{
"skills": {
"dir": "agent/skills",
"debounce": {
"#dur": "PT0.25S"
},
"maxWait": {
"#dur": "PT2S"
}
}
}
| Member | Value | Result |
|---|---|---|
dir | Directory path | A dedicated directory for the skills. The plugin controls all its contents. A relative path is relative to the working directory of the process at open. A missing directory is created. |
site | http or https origin, the Stardust website when absent | The website that the skills link for Reference and Theory articles. |
debounce | #dur duration, PT0.25S when absent | How long definition commits must stay quiet before the plugin generates again. |
maxWait | #dur duration, PT2S when absent | The longest wait after the first definition commit. |
Without dir, the plugin publishes nothing. sync then generates the skills without writing them, which reports naming failures.
Settings apply until the database closes.
The skills
Each skill is a directory with a SKILL.md file whose frontmatter names the skill and describes when to use it.
| Skill | Contents |
|---|---|
stardust | Opening the database, its data model, and the other skills |
stardust-query | Stored and inline queries, with a reference file per stored query |
stardust-mutate | Mutations, with a reference file per stored mutation |
stardust-schema | Schemas, with a reference file per stored schema |
stardust-expression | Expressions and macros, with a reference file per stored expression and macro |
stardust-entities | Merge patches, temporary names and conditional writes |
stardust-live | Query subscriptions |
stardust-import | Importing an external dataset |
stardust-objects | The object store, only when the database enables objects |
stardust-ops | Indexes, plans, history and the plugins that the database enables |
A reference file lists a definition's parameters, result and stored document in DUST, for example stardust-query/reference/queries/people__adults.md for the query people/adults.
When the database also enables SDK generation with output languages, each query, mutation and expression reference shows the generated typed call in each of those languages.
Without them, the reference names the generic operations to call.
Guidance for each plugin appears only when the database enables that plugin. Supported plugins include reactors, history, objects, backups, adaptive planner and blackholes.
The skills link the published Reference and Theory articles instead of copying them.
Copy or link the whole output directory into the harness's skills directory, so that each skill keeps its reference files.
Runs
The plugin generates the skills when the database opens, then again after definition commits, after the debounce.
Data commits do not start a run.
A run replaces the complete contents of the directory.
Two definitions whose file names collide, such as the queries a/b and a__b, fail the run: the directory keeps the last skills, and status reports the failure with its diagnostics.
status returns a document with these members:
| Member | Contents |
|---|---|
enabled | Always true |
pending | Whether a definition change waits for a run |
runs | Finished runs since open |
fingerprint | The native SHA-256 value {#sha256 ...} for the definitions that the last run described; absent before a model is built |
failure | The last run's code and message; absent after a successful run |
outputs | The published directory with the files written and removed |
diagnostics | Each diagnostic about a definition |
When to call sync
Your definition commit can finish before the skills describe it.
Call sync before an agent reads skills that must include a definition you just stored.
Its options accept only the common maxWait option. Success covers the definitions committed before the call.
A failed run reports failed.
File ownership
The plugin owns the entire output directory and clears it before every successful run, including its first run after open. Keep other files and databases elsewhere. A failed write can leave the directory empty or partial; the next successful run rebuilds it.
Operations
| Operation | Returns | Summary |
|---|---|---|
| status | Unavailable | skills.status() returns the agent skills generator's owned status document. |
| sync | Unavailable | skills.sync(options) waits until the agent skills include the definitions committed before the call. |
status
C calls plugin operations through stardust_db_plugin_call and stardust_db_plugin_stream_open with a request document.
Also calls: stardust_db_plugin_call, stardust_result_take_document, stardust_result_error, stardust_result_release
sync
C calls plugin operations through stardust_db_plugin_call and stardust_db_plugin_stream_open with a request document.
Also calls: stardust_db_plugin_call, stardust_result_take_document, stardust_result_error, stardust_result_release