summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-11 22:45:41 +0200
committerPaul Buetow <paul@buetow.org>2026-02-11 22:45:41 +0200
commit95af492ff0ebcc61c5ffaad978ec2ab2b4510a64 (patch)
tree1875b63928c269c95592a09677aa7f9c4dd5e35a
parent36d7c0b01e9e5a01f079784e4bf9f052c974c91e (diff)
feat: add delete_prompt built-in meta-prompt
Adds a third built-in meta-prompt for interactively deleting custom prompts with confirmation. This completes the prompt management trilogy (save, update, delete). Changes: - Add delete_prompt meta-prompt with prompt_name argument - Interactive workflow: show prompt → confirm → delete via delete_prompt tool - Update test to expect 3 built-in prompts (was 2) - Includes safety notes about built-in prompts and backups The meta-prompt ensures users see what they're deleting and must explicitly confirm before the delete_prompt tool is called. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
-rw-r--r--internal/promptstore/default_prompts.go36
-rw-r--r--internal/promptstore/store_test.go6
2 files changed, 39 insertions, 3 deletions
diff --git a/internal/promptstore/default_prompts.go b/internal/promptstore/default_prompts.go
index 09a998a..d985500 100644
--- a/internal/promptstore/default_prompts.go
+++ b/internal/promptstore/default_prompts.go
@@ -145,5 +145,41 @@ Start by fetching and showing me the current prompt, then ask clarifying questio
Created: now,
Updated: now,
},
+ {
+ Name: "delete_prompt",
+ Title: "Delete Custom Prompt",
+ Description: "Interactively delete an existing custom prompt with confirmation. Claude will show the current prompt, ask for confirmation, and only delete after explicit approval. Built-in prompts cannot be deleted.",
+ Arguments: []PromptArgument{
+ {
+ Name: "prompt_name",
+ Description: "Name of the existing prompt to delete",
+ Required: true,
+ },
+ },
+ Messages: []PromptMessage{
+ {
+ Role: "user",
+ Content: MessageContent{
+ Type: "text",
+ Text: `I want to delete the existing prompt '{{prompt_name}}'.
+
+Please help me by:
+1) First, show me the current prompt so I can confirm it's the right one
+2) Ask me to explicitly confirm the deletion
+3) Only after I explicitly confirm, use the delete_prompt tool to delete it
+
+IMPORTANT NOTES:
+- Built-in prompts (save_prompt, update_prompt, delete_prompt) cannot be deleted
+- Only custom prompts stored in user.jsonl can be deleted
+- This action cannot be undone (though backups are automatically created)
+
+Start by showing me the prompt details.`,
+ },
+ },
+ },
+ Tags: []string{"meta", "prompt-management", "interactive"},
+ Created: now,
+ Updated: now,
+ },
}
}
diff --git a/internal/promptstore/store_test.go b/internal/promptstore/store_test.go
index 6e74b17..2c95ad7 100644
--- a/internal/promptstore/store_test.go
+++ b/internal/promptstore/store_test.go
@@ -84,9 +84,9 @@ func TestJSONLStore_List(t *testing.T) {
t.Fatalf("List() error = %v", err)
}
- // Should have all prompts (7 user + 2 built-ins)
- if len(prompts) != 9 {
- t.Errorf("List() got %d prompts, want 9 (7 user + 2 built-ins)", len(prompts))
+ // Should have all prompts (7 user + 3 built-ins)
+ if len(prompts) != 10 {
+ t.Errorf("List() got %d prompts, want 10 (7 user + 3 built-ins)", len(prompts))
}
// No cursor for full list