diff --git a/prompts/SYSTEM_PROMPT.md b/prompts/SYSTEM_PROMPT.md index a06fb84..684fe0a 100644 --- a/prompts/SYSTEM_PROMPT.md +++ b/prompts/SYSTEM_PROMPT.md @@ -43,17 +43,21 @@ The ollie 9P filesystem is mounted at `${OLLIE_9MOUNT:-$HOME/mnt/ollie}`. All pe Tool scripts live at `${OLLIE_9MOUNT:-$HOME/mnt/ollie}/t/`. Run them with `execute_tool` or as steps in an `execute_pipe` pipeline. -```sh -ls ${OLLIE_9MOUNT:-$HOME/mnt/ollie}/t/ # list available tools +Supported languages are detected from the script's shebang line: +- `#!/usr/bin/env bash` — runs with `bash -c` +- `#!/usr/bin/env python3` — runs with `python3 -c`; `sys.argv` is set automatically when args are provided + +Unlike built-in tools, shell tools have no injected schema. Before using an unfamiliar tool, discover available tools and their usage: + +``` +execute_tool {tool: "tools"} # list all tools with descriptions and args ``` -Supported languages are detected from the script's shebang line: -- `#!/usr/bin/env bash` (or any bash shebang) — runs with `bash -c` -- `#!/usr/bin/env python3` (or any python shebang) — runs with `python3 -c`; `sys.argv` is set automatically when args are provided - -Task planning tools are available in `t/`: -- `task_plan` — create a plan: `execute_tool {tool: "task_plan", args: ["", "", "", ...]}` -- `task_complete` — mark a step done: `execute_tool {tool: "task_complete", args: ["", ""]}` +Each tool's header also documents itself directly: +``` +# description: +# Args: [arg2] ... +``` # Skills diff --git a/tools/tools.sh b/tools/tools.sh new file mode 100644 index 0000000..6523496 --- /dev/null +++ b/tools/tools.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# description: List all available tools with their descriptions and usage +set -euo pipefail + +OLLIE="${OLLIE_9MOUNT:-$HOME/mnt/ollie}" + +for f in "$OLLIE/t/"*; do + [ -f "$f" ] || continue + name=$(basename "$f") + desc=$(grep -m1 "^# description:" "$f" 2>/dev/null | sed 's/^# description: *//') + args=$(grep -m1 "^# [Aa]rgs:" "$f" 2>/dev/null | sed 's/^# [Aa]rgs: *//') + printf '%-28s %s\n' "$name" "$desc" + [ -n "$args" ] && printf '%-28s Args: %s\n' "" "$args" +done