Skill: terrycarter1985/research-assistant-bear (version 0.1.0)

--- name: research-assistant description: Read Bear notes tagged "待整理", extract topic keywords, search for relevant GIFs via gifgrep, insert them into the note, and remove the tag. Use when the user wants to auto-illustrate or finalize research notes from Bear. version: 0.1.0 author: ClawdBot tags: [research, bear, gif, automation] metadata: openclaw: requires: bins: ["grizzly"] --- # Research Assistant Automate the workflow of enriching Bear research notes with topical GIFs. ## Prerequisites - Bear app running with a valid API token (`~/.config/grizzly/token`) - `grizzly` CLI installed - gifgrep skill available (for GIF search) ## Workflow 1. **Fetch notes** — List all notes with the `待整理` tag: ```bash grizzly open-tag --name "待整理" --enable-callback --json --token-file ~/.config/grizzly/token ``` 2. **For each note:** a. Read the note content via `grizzly open-note --id <ID> --enable-callback --json`. b. Extract 2–3 topic keywords from the title and key-findings sections. c. Search for a relevant GIF using gifgrep (or `web_search` + `web_fetch` for a GIF URL) with those keywords. d. Append the GIF as markdown to the note's "Supporting Media" section: ```bash echo '![topic](GIF_URL)' | grizzly add-text --id <ID> --mode append --token-file ~/.config/grizzly/token ``` e. Remove the `待整理` tag by replacing tags (exclude `待整理`, keep all others). 3. **Report** — Summarize which notes were processed and how many GIFs were inserted. ## Notes - If a note already has content in "Supporting Media", insert the GIF on a new line below existing media. - If no relevant GIF is found, skip insertion and note it in the report. - Prefer GIFs that visually represent the research topic (e.g., data visualization, concept animation). - The `待整理` tag signals "needs processing"; removing it marks the note as finalized.

path: scripts/fetch_pending.sh
content: #!/usr/bin/env bash
# research-assistant: fetch Bear notes tagged "待整理", insert topic-relevant GIFs
set -euo pipefail

TOKEN_FILE="${GRIZZLY_TOKEN_FILE:-$HOME/.config/grizzly/token}"
TAG="待整理"

if [ ! -f "$TOKEN_FILE" ]; then
  echo "Error: Bear token not found at $TOKEN_FILE"
  exit 1
fi

echo "🔍 Fetching notes with tag: $TAG"
NOTES_JSON=$(grizzly open-tag --name "$TAG" --enable-callback --json --token-file "$TOKEN_FILE" 2>/dev/null || echo '[]')

NOTE_COUNT=$(echo "$NOTES_JSON" | jq 'if type == "array" then length elif type == "object" then 1 else 0 end')
echo "Found $NOTE_COUNT note(s) to process"

echo "$NOTES_JSON" | jq -c '.[] | .identifier' 2>/dev/null | while read -r NOTE_ID; do
  echo "📄 Processing note: $NOTE_ID"
  NOTE_DATA=$(grizzly open-note --id "$NOTE_ID" --enable-callback --json --token-file "$TOKEN_FILE" 2>/dev/null || echo '{}')
  TITLE=$(echo "$NOTE_DATA" | jq -r '.title // "untitled"')
  echo "   Title: $TITLE"
  # Keyword extraction and GIF search are handled by the agent using web_search/gifgrep
  echo "   → Agent should extract keywords from: $TITLE and search for a GIF"
done

echo "✅ Note listing complete. Agent handles GIF insertion and tag removal."


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)