diff --git a/mcptools/search_beads.sh b/mcptools/search_beads.sh new file mode 100755 index 0000000..2a85ca8 --- /dev/null +++ b/mcptools/search_beads.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# capabilities: beads +# description: Search beads by id, title, or description content +# Usage: search_beads.sh +set -euo pipefail + +if cat /etc/shadow >/dev/null 2>&1; then + echo "Error: This script must be run via execute_code tool" >&2 + exit 1 +fi + +if [ $# -lt 2 ]; then + echo "usage: search_beads.sh " >&2 + exit 1 +fi + +mount="$1" +query="$2" + +9p read "agent/beads/$mount/search/$query" 2>/dev/null | jq '[.[] | {id, title, status, match_in: (if .id | test("'"$query"'"; "i") then "id" elif .title | test("'"$query"'"; "i") then "title" else "description" end)}]' || echo "[]" diff --git a/skills/beads/SKILL.md b/skills/beads/SKILL.md index 4421852..f3069e6 100644 --- a/skills/beads/SKILL.md +++ b/skills/beads/SKILL.md @@ -38,20 +38,29 @@ Tool: execute_code tool: list_mounts.sh ``` -List ready beads: +List ready beads (open, unblocked): ``` Tool: execute_code tool: list_ready_beads.sh args: [""] ``` -List all beads: +List all open beads (excludes closed): ``` Tool: execute_code tool: list_beads.sh args: [""] ``` +Search beads (includes closed): +``` +Tool: execute_code +tool: search_beads.sh +args: ["", ""] +``` + +**Note:** `list_beads.sh` and `list_ready_beads.sh` only return open beads. To find closed beads, use `search_beads.sh`. + Read bead JSON: ``` Tool: execute_code @@ -62,8 +71,8 @@ args: ["", "", "json"] Read bead comments: ``` Tool: execute_code -tool: read_bead.sh -args: ["", "", "comments"] +tool: read_bead_comments.sh +args: ["", ""] ``` **IMPORTANT:** When working on a bead, always check `comment_count` in the JSON output. If > 0, read comments for additional context, decisions, or blockers.