Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/clojure_mcp/prompts.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down