diff --git a/src/clojure_mcp/prompts.clj b/src/clojure_mcp/prompts.clj index 64673cba..3bb35fc8 100644 --- a/src/clojure_mcp/prompts.clj +++ b/src/clojure_mcp/prompts.clj @@ -280,6 +280,31 @@ After doing this provide a very brief (8 lines) summary of where we are and then (.getPath file) (.getMessage e))}]})))))))}) +(def save-new-prompt + {:name "save_new_prompt" + :description "Asks the user for a new prompt and a name, and saves them to their user config" + :prompt-fn (fn [_ request-args clj-result-k] + (clj-result-k + {:description "Help user create/update a custom prompt" + :messages [{:role :user + :content "Here is how you create a new prompt: +1. In the `.clojure-mcp` project folder, find the `config.edn` file. +2. Under the `:prompts` key will be a map of strings (which name the prompts) and maps (which define the prompts). +3. Note that each prompt has a description and content, and may also have arguments. +4. Read each prompt, and ask the user if they want to create a new prompt or edit an existing prompt. +5. Ask the user what they want the prompt to do. +6. Help the user compose the content of the prompt, including any arguments, if required. +7. If this is a new prompt, save it as described below. +8. If this is an existing prompt, update the existing prompt. + +How to save a prompt: + +Save prompt in the `.clojure-mcp` project folder, in the `config.edn` file under the `:prompts` key using the STRING name of the prompt as the key, +and using the following format: +`:description` - \"Custom user-added prompt\" +`:content` - %s +`:args` - vector of args, where each arg is a map of `:name`, `:description`, and a `:required?` flag."}]}))}) + (defn create-prompt-from-config "Creates a prompt from configuration map. Config should have :description, :args, and either :file-path or :content. @@ -338,6 +363,7 @@ After doing this provide a very brief (8 lines) summary of where we are and then (str (load-prompt-from-resource "clojure-mcp/prompts/system/clojure_repl_form_edit.md") (load-prompt-from-resource "clojure-mcp/prompts/system/clojure_form_edit.md")))} + save-new-prompt (create-project-summary working-dir) chat-session-summary resume-chat-session