Skip to content

Commit

Permalink
Add some new prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
slimslenderslacks committed Jan 9, 2025
1 parent ed0305d commit 1b2c586
Show file tree
Hide file tree
Showing 12 changed files with 166 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
/tools_vector_store/tools.db
/tools_vector_store/chroma_db/
/docker-mcp-server.out
/**/.DS_Store
Binary file removed graphs/prompts/.DS_Store
Binary file not shown.
25 changes: 25 additions & 0 deletions prompts/examples/claude_resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
description: Examples for creating resources in Claude Desktop
model: claude-3-5-sonnet-20241022
tools:
- name: append-insight
description: Add a business insight to the memo
parameters:
type: object
properties:
insight:
type: string
description: Business insight discovered from data analysis
container:
image: vonwig/bash_alpine
command:
- "-c"
- "echo '{{insight|safe}}' >> /mcp/insights.txt"
volumes:
- "mcp-test:/mcp"
prompt-format: django
---

# prompt user

Add a business insight of 'some great data'
9 changes: 9 additions & 0 deletions prompts/examples/imagemagick/svg-to-png.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
tools:
- name: imagemagick
---

# prompt user

Use Imagemagick to convert the prompts/examples/imagemagick/*.svg files into a png images.

11 changes: 11 additions & 0 deletions prompts/examples/jq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
tools:
- name: qrencode
---

# Prompt user

Read the man page for qrencode

Now construct a large QR Code in svg format for the url `https://www.docker.com` and save it to a file named docker.svg

42 changes: 42 additions & 0 deletions prompts/examples/mcp-filesystem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
model: claude-3-5-sonnet-20241022
tools:
- name: read_file
description: |
read a file from disk
Read the complete contents of a file from the file system.
Handles various text encodings and provides detailed error messages
if the file cannot be read. Use this tool when you need to examine
the contents of a single file. Only works within allowed directories.
parameters:
type: object
properties:
path:
type: string
container:
image: vonwig/bash_alpine
entrypoint: cat
command:
- "{{path|safe}}"
- name: write_file
description: |
Create a new file or completely overwrite an existing file with new content.
Use with caution as it will overwrite existing files without warning.
Handles text content with proper encoding. Only works within allowed directories.
parameters:
type: object
properties:
path:
type: string
content:
type: string
container:
image: vonwig/bash_alpine
command:
- "-c"
- "echo {{content|safe}} > {{path|safe}}"
---

# prompt user

read the file deps.edn and then write the string "blah.txt" into the file test.txt
45 changes: 27 additions & 18 deletions prompts/examples/mcp-sqlite.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,48 @@
---
description: |
A prompt to seed the database with initial data and demonstrate what you can do with an SQLite MCP Server + Claude
description: A prompt to seed the database with initial data and demonstrate what you can do with an SQLite MCP Server + Claude
model: claude-3-5-sonnet-20241022
tools:
- name: read-query
description: Execute a SELECT query on the SQLite database
parameters: &query
parameters:
type: object
properties:
query:
type: string
description: SELECT SQL query to execute
container: &sqlite
image: vonwig/sqlite:latest
container: &sqlite-container
image: &sqlite-image vonwig/sqlite:latest
command:
- "/mcp/test1.db"
- &db "/mcp/test1.db"
- "{{query|safe}}"
mounts: &mounts
volumes: &mounts
- "mcp-test:/mcp"
- name: write-query
description: Execute an INSERT, UPDATE, or DELETE query on the SQLite database
parameters: *query
container: *sqlite
parameters:
type: object
properties:
query:
type: string
description: SQL query to execute
container: *sqlite-container
- name: create-table
description: Create a new table in the SQLite database
parameters: *query
container: *sqlite
parameters:
type: object
properties:
query:
type: string
description: CREATE TABLE SQL statement
container: *sqlite-container
- name: list-tables
description: List all tables in the SQLite database
container:
image: vonwig/sqlite:latest
image: *sqlite-image
command:
- "/mcp/test1.db"
- *db
- "SELECT name from sqlite_master WHERE type='table'"
mounts: *mounts
volumes: *mounts
- name: describe-table
description: Get the schema information for a specific table
parameters:
Expand All @@ -43,11 +52,11 @@ tools:
type: string
description: Name of the table to describe
container:
image: vonwig/sqlite:latest
image: *sqlite-image
command:
- "/mcp/test1.db"
- *db
- "PRAGMA table_info({{table_name}})"
mounts: *mounts
volumes: *mounts
- name: append-insight
description: Add a business insight to the memo
parameters:
Expand All @@ -61,7 +70,7 @@ tools:
command:
- "-c"
- "echo '{{insight|safe}}' >> /mcp/insights.txt"
mounts: *mounts
volumes: *mounts
prompt-format: django
parameter-values:
topic: Ocean Conservation
Expand Down
13 changes: 13 additions & 0 deletions prompts/examples/mcp_servers/extract.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
description: Add a new capability to your desktop
tools:
- name: curl
prompt-format: django
parameter-values:
image: mcp/puppeteer
---

# prompt user

Use curl and the dockerhub api to fetch the full_description for the {{image}} image.
Then read the full description and just extract the json definition for how to configure it.
19 changes: 19 additions & 0 deletions prompts/examples/ollama.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
extractors:
- name: project-facts
url: http://host.docker.internal:11434/v1/chat/completions
model: llama3.2
stream: false
---

# Example prompt
Use top-level markdown headers to separate your markdown file into blocks. Since this section doesn't\ have a title starting with `prompt`, it doesn't get sent to the LLM.

# Prompt system
You are an assistant who can write comedic monologues in the style of Stephen Colbert.

# Prompt user
Tell me about my project.

My project uses the following languages:
{{project-facts.languages}}
17 changes: 17 additions & 0 deletions prompts/examples/update-nix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
mcp:
- mcp/fetch
- mcp/filesystem
model: claude-3-5-sonnet-20241022
---

# prompt user

My nix configuration is at /Users/slim/slimslenderslacks/nixos-config.

My home manager configuration is at the relative path ./users/slim/home-manager.nix.

Read and then update the flake.nix in the root of this project to add an input for ghostty.
Use the content at https://www.reddit.com/r/NixOS/s/7qH6JhQNF to figure out how to do this.

Ready and then update my home manager configuration to add ghostty to my default profile.
Binary file added prompts/sql/Chinook.db
Binary file not shown.
4 changes: 2 additions & 2 deletions src/docker.clj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
;; Tty wraps the process in a pseudo terminal
{:StdinOnce true
:OpenStdin true}
(defn create-container [{:keys [image entrypoint workdir command host-dir env thread-id opts mounts] :or {opts {:Tty true}} :as m}]
(defn create-container [{:keys [image entrypoint workdir command host-dir env thread-id opts mounts volumes] :or {opts {:Tty true}} :as m}]
#_(jsonrpc/notify :message {:content (str m)})
(let [payload (json/generate-string
(merge
Expand All @@ -123,7 +123,7 @@
"/var/run/docker.sock:/var/run/docker.sock"]
(when host-dir [(format "%s:/project:rw" host-dir)])
(when thread-id [(format "%s:/thread:rw" thread-id)])
mounts)}
(or volumes mounts))}
:WorkingDir (or workdir "/project")}
(when entrypoint {:Entrypoint entrypoint})
(when command {:Cmd command})))]
Expand Down

0 comments on commit 1b2c586

Please sign in to comment.