Skip to content

ui: Custom Prompts - #25034

Closed
allozaur wants to merge 29 commits into
ggml-org:masterfrom
allozaur:feat/custom-instructions
Closed

allozaur wants to merge 29 commits into
ggml-org:masterfrom
allozaur:feat/custom-instructions

Conversation

@allozaur

@allozaur allozaur commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Close #20678

Demo

prompts-demo-h264.mp4

Prompts library (/prompts)

  • New landing route under the manage sidebar; prompts grouped by category, full-text search
  • "New chat" on a prompt card opens a conversation with a system message already referencing the prompt
  • Save any system message as a new prompt via DialogPromptAddNew (title, content, optional category)
  • Sync a system message from its library source with a CodeDiff preview before applying (DialogPromptSync)
  • Prompts persist across sessions (IndexedDB-backed)

System messages

  • One unified editor (ChatMessageEditForm) for user, assistant, and system messages; variant="system" wraps it in the dashed bubble so the read view matches the edit view
  • Three scenarios covered: library-referenced (with a "Newer version available" hint when stale), placeholder (keeps a prominent "Add to library" CTA), and a fresh in-chat system prompt
  • Compose-menu gets a system-message submenu: pick an existing library prompt or save a new one inline
  • Library references are tracked on the message itself (promptId extra), so the editor and the chat display can always look the referenced prompt up

MCP

  • Server prompt list is fetched eagerly on connect, so prompts, resources, completions, etc. are visible everywhere without an extra round trip
  • Resources browser dialog is usable on mobile
  • Removing an MCP server is reactive — its prompts/resources disappear from every UI surface (compose menu, prompts page, resources browser) automatically

UI primitives (new building blocks for future features)

  • Command (cmdk) palette
  • InputGroup (with addon / button / input / text / textarea parts)
  • Toggle, ToggleGroup

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES, MiniMax M3 on HF Inference Providers + Qwen3.6-35B-A3B / Qwen3.6-27B locally

@github-actions github-actions Bot added documentation Improvements or additions to documentation server/ui labels Jun 26, 2026
@allozaur
allozaur force-pushed the feat/custom-instructions branch from fa43e12 to 6c1629a Compare June 26, 2026 08:51
@engrtipusultan

Copy link
Copy Markdown

I actually vibed an MCP to achieve such functionality. MCP would scan folder and list mark down files as prompts and through MCP they will be available as assistant prompts.
What I miss is cherry studio like functionality to list them as assistants and group chats under each assistant or to have workflow that will go through multiple assistants.
Would that be possibility going forward?

Comment on lines +96 to +256
@@ -148,19 +210,50 @@
},
save: handleSaveEdit,
saveOnly: handleSaveEditOnly,
saveAsLibrary: handleSaveAsLibrary,
updateLibraryPrompt: handleUpdateLibraryPrompt,
cancel: handleCancelEdit,
startEdit: handleEdit
});

let mcpPromptExtra = $derived.by(() => {
if (message.role !== MessageRole.USER) return null;
if (message.content.trim()) return null;
if (!message.extra || message.extra.length !== 1) return null;
let mcpPromptExtra = $derived.by((): DatabaseMessageExtraMcpPrompt | null => {
if (message.role === MessageRole.USER) {
if (message.content.trim()) return null;
if (!message.extra || message.extra.length !== 1) return null;

const extra = message.extra[0];

if (extra.type === AttachmentType.MCP_PROMPT) {
return extra as DatabaseMessageExtraMcpPrompt;
}

return null;
}

if (message.role === MessageRole.SYSTEM) {
// System messages created from an MCP prompt carry the server/prompt
// identity through their synthetic `mcp:<server>:<prompt>` promptId.
// Treat them as MCP-prompt messages so they render with the same styled
// surface instead of a plain system textarea.
const custom = customPromptExtra;

if (!custom?.promptId.startsWith('mcp:')) return null;

const extra = message.extra[0];
const stripped = custom.promptId.slice('mcp:'.length);
const sepIndex = stripped.indexOf(':');

if (extra.type === AttachmentType.MCP_PROMPT) {
return extra as DatabaseMessageExtraMcpPrompt;
if (sepIndex <= 0) return null;

const serverName = stripped.slice(0, sepIndex);
const promptName = stripped.slice(sepIndex + 1);

return {
type: AttachmentType.MCP_PROMPT,
name: promptName,
serverName,
promptName,
content: message.content
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if possible, we should move this logic and related markup to somehow manage from ChatMessageCustomPrompt.svelte

Comment thread tools/ui/src/lib/utils/diff.ts Resolved
@awijshoff

Copy link
Copy Markdown

Very cool!

I think Importing/Exporting Prompts (or Prompt-collections), comparable to how chats can be imported/exported would be a nice feature for sharing prompts with other users. "Copying" prompts for A/B-tests might also be useful.

@allozaur

Copy link
Copy Markdown
Contributor Author

I actually vibed an MCP to achieve such functionality. MCP would scan folder and list mark down files as prompts and through MCP they will be available as assistant prompts. What I miss is cherry studio like functionality to list them as assistants and group chats under each assistant or to have workflow that will go through multiple assistants. Would that be possibility going forward?

we will develop this further to support skills in a similiar way. this PR is a beginning of this type of functionality

@allozaur

Copy link
Copy Markdown
Contributor Author

Very cool!

I think Importing/Exporting Prompts (or Prompt-collections), comparable to how chats can be imported/exported would be a nice feature for sharing prompts with other users. "Copying" prompts for A/B-tests might also be useful.

yeah, this one i can still squash in this PR

@allozaur
allozaur force-pushed the feat/custom-instructions branch 5 times, most recently from 8842ac0 to 552872d Compare June 30, 2026 14:30
@awijshoff

Copy link
Copy Markdown

May I ask how closely do you plan to follow the mcp- and skill-specs? Skills over mcp are still being discussed (modelcontextprotocol/modelcontextprotocol#2640).

I don't know if it is a good idea to mix mcp-prompts with agents-skills, since mcp-prompts are already quite well-defined by the modelcontextprotocol team and skills are defined by the agentskills team and have their own specification: https://github.com/agentskills/agentskills/blob/main/docs/specification.mdx.

I think mcp-prompts have their uses in chat as templates on how to get started with an mcp-server by giving the user examples, while skills allow for progressive disclosure of information for agents by having frontmatter, assets, scripts and references. What do you think?

@allozaur
allozaur force-pushed the feat/custom-instructions branch from 552872d to 31b816e Compare June 30, 2026 16:30
@allozaur

Copy link
Copy Markdown
Contributor Author

May I ask how closely do you plan to follow the mcp- and skill-specs? Skills over mcp are still being discussed (modelcontextprotocol/modelcontextprotocol#2640).

I don't know if it is a good idea to mix mcp-prompts with agents-skills, since mcp-prompts are already quite well-defined by the modelcontextprotocol team and skills are defined by the agentskills team and have their own specification: https://github.com/agentskills/agentskills/blob/main/docs/specification.mdx.

I think mcp-prompts have their uses in chat as templates on how to get started with an mcp-server by giving the user examples, while skills allow for progressive disclosure of information for agents by having frontmatter, assets, scripts and references. What do you think?

Skills and MCP Prompts live as separate entities from the stores & services point of view. Only the UI app layer is sth that's allowing to use them e. g. as a system/user message or a text attachment.

My intention is to have these 2 features have separate abstractions, but still allow to play with them and include in the conversations.

@allozaur allozaur changed the title ui: Custom Prompts library + improvements for System Message, MCP Prompts & Resources UI/UX ui: Skills library + improvements for System Message, MCP Prompts & Resources UI/UX Jun 30, 2026
@allozaur
allozaur force-pushed the feat/custom-instructions branch 9 times, most recently from 5207d72 to 8bc61ec Compare July 3, 2026 08:30
@allozaur
allozaur force-pushed the feat/custom-instructions branch from 8bc61ec to 7765e45 Compare July 3, 2026 09:15
@gugugiyu gugugiyu mentioned this pull request Aug 18, 2026
1 of 3 tasks
@allozaur allozaur changed the title ui: Skills library + improvements for System Message, MCP Prompts & Resources UI/UX ui: Custom Prompts Oct 20, 2026
@allozaur allozaur closed this Nov 11, 2026
@allozaur

Copy link
Copy Markdown
Contributor Author

Closing this one: it has been replaced by a prompt library I'm building on my fork (allozaur#29), which covers the same ground with a System message submenu and a Library page. I'll reference this PR when that work comes upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation server/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: support skills

3 participants