Summary
Rules need to be importable on a global/system-wide level. Importing rules should be configurable/automatic. The above can be achieved by initializing the Prompt Store LMDB instance from a set of local files, similar to how prompt_overrides currently works.
Details
Currently these are stored in: ~/.config/zed/prompts/prompts-library-db.0.mdb as a binary LMDB. Ideally they would be in a plaintext format so they can be version controlled. This feature is intentionally narrowly scoped to not include dynamic application of rules (e.g. use these rules for Lua, and these rules for Rust) -- and is just getting them into a human readable/backupable/mergable format.
Simplest possible implementation would be a directory of markdown files.
Enables
- Users can share Rules across multiple devices (e.g. by linking zed's config directory to a shared filesystem)
- Users can version control Rules (e.g. linking zed's config directory to a git repo)
more details
Motivation / Details
The old Prompt Library was quite nice for customizing slash commands in the Assistant Context Editor. One use case of these that was under-appreciated was the ability to copy the system prompts from e.g. Claude.ai or ChatGPT to recreate their personalities in the Zed Assistant.
This Prompt Library had some fundamental limitations:
- No shared state - if I'm using Zed on multiple devices, there's no way to share these prompts across those devices.
- No importable state - similar to the above, there's no way to import prompts in the Prompt Library from files, so syncing prompts across devices had to be done completely manually through the UI. But this leads to other issues, like prompts not being version-controllable.
- Default message: No way to customize the default conversation in the Assistant Context Editor (now called New Text Thread). IMO this is what "default prompt" always misunderstood -- the editor exposes a beautiful ChatML editor, but only allows you to configure the default ChatML conversation very strictly, i.e. forces you to stuff default prompts into the first user message. For the system prompt use case mentioned above, I find myself having to key in
cmd-r cmd-r backspace backspace shift-enter cmd-r to get to my desired state. This should easily be configurable according to a ChatML-like Handlebars template that can be overriden by prompt_overrides.
Now Prompt Library has become Rules Library, but Rules have inherited all of the above limitations!
Discussed in #31458 by @jvmncs
Summary
Rules need to be importable on a global/system-wide level. Importing rules should be configurable/automatic. The above can be achieved by initializing the Prompt Store LMDB instance from a set of local files, similar to how
prompt_overridescurrently works.Details
Currently these are stored in:
~/.config/zed/prompts/prompts-library-db.0.mdbas a binary LMDB. Ideally they would be in a plaintext format so they can be version controlled. This feature is intentionally narrowly scoped to not include dynamic application of rules (e.g. use these rules for Lua, and these rules for Rust) -- and is just getting them into a human readable/backupable/mergable format.Simplest possible implementation would be a directory of markdown files.
Enables
more details
Motivation / Details
The old Prompt Library was quite nice for customizing slash commands in the Assistant Context Editor. One use case of these that was under-appreciated was the ability to copy the system prompts from e.g. Claude.ai or ChatGPT to recreate their personalities in the Zed Assistant.
This Prompt Library had some fundamental limitations:
cmd-r cmd-r backspace backspace shift-enter cmd-rto get to my desired state. This should easily be configurable according to a ChatML-like Handlebars template that can be overriden byprompt_overrides.Now Prompt Library has become Rules Library, but Rules have inherited all of the above limitations!
Discussed in #31458 by @jvmncs