[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75T8EED6K10HVYF07VCV913":3,"skill-same:01M75T8EED6K10HVYF07VCV913":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M75T8EED6K10HVYF07VCV913","ai-sommelier",null,"OpenClaw skill for the AI Sommelier R1 Creation. Receives camera image data for wine label OCR and analysis, processes occasion-based wine recommendations, and identifies wines from blind tasting descriptions. Routes all three command types to a vision\u002FLLM backend on your local machine.","ajohnsonnow\u002Fr1-warren","ajohnsonnow","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F8867891?v=4","01M75T7TQ3B5VRHJF6X2Q7AWWW","Anthony Johnson","01M75T7TQPJG8YZTAVCH4SQW27",0,"MIT","https:\u002F\u002Fgithub.com\u002Fajohnsonnow\u002Fr1-warren\u002Fblob\u002Fmain\u002Fai-sommelier\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: ai-sommelier\ndescription: OpenClaw skill for the AI Sommelier R1 Creation. Receives camera image data for wine label OCR and analysis, processes occasion-based wine recommendations, and identifies wines from blind tasting descriptions. Routes all three command types to a vision\u002FLLM backend on your local machine.\nversion: 1.0.0\nauthor: rabbit-r1-skillz\n---\n\n# AI Sommelier — OpenClaw Skill\n\nThe AI Sommelier R1 Creation communicates with your local machine via the OpenClaw shared-storage bridge. This skill listens for three commands sent by the R1, routes them to a vision or text LLM backend, and writes the response back so the R1 can speak it and display results.\n\n---\n\n## Commands\n\n| Command | Triggered by | What the skill does |\n|---|---|---|\n| `scan-label` | PTT press in Scan mode | Extracts the camera image embedded in `systemPrompt`, sends it to a vision LLM, returns a JSON wine analysis (identity, tasting profile, food pairings, drink window, price, alternatives) |\n| `occasion` | Voice submission in Occasion mode | Sends the user's spoken occasion description to a text LLM, returns a JSON wine recommendation with name, meta, and spoken text |\n| `blind-taste` | Voice submission in Blind mode | Sends the user's spoken tasting\u002Faroma description to a text LLM, returns a JSON guess at grape variety and region with confidence and reasoning |\n\n---\n\n## Prerequisites\n\n### 1. OpenClaw daemon\n\nInstall and run OpenClaw on the same machine that will call the LLM APIs. OpenClaw polls a shared R1 storage key for commands and writes responses back.\n\n- Repo: [OpenClaw](https:\u002F\u002Fgithub.com\u002Frabbit-r1-community\u002Fopenclaw) (community project)\n- Complete OpenClaw's own setup before configuring this skill.\n\n### 2. Node.js 18+ or Python 3.10+\n\nThe skill handler runs as a local script. Examples in this document use Node.js. A Python port works equally well.\n\n```bash\nnode --version   # must be >= 18\n```\n\n### 3. LLM backend — choose one\n\n**Option A — Anthropic API (recommended for scan-label)**\n\n`scan-label` sends a base64-encoded JPEG embedded in the system prompt, so it requires a vision-capable model. `claude-sonnet-4-6` or higher is recommended.\n\n```bash\nexport ANTHROPIC_API_KEY=sk-ant-...\n```\n\n**Option B — Ollama with a vision model (free, fully local)**\n\n`scan-label` requires a multimodal model (e.g. `llava:13b`, `moondream`, or `llava-phi3`). Text-only commands (`occasion`, `blind-taste`) work with any Ollama model.\n\n```bash\nollama pull llava:13b          # or another vision-capable model\nexport AI_SOMMELIER_BACKEND=ollama\nexport OLLAMA_HOST=http:\u002F\u002Flocalhost:11434\nexport OLLAMA_MODEL=llava:13b\n```\n\n---\n\n## Skill Installation\n\n```bash\n# Copy this skill into your OpenClaw skills directory\ncp -r ai-sommelier\u002F ~\u002F.openclaw\u002Fskills\u002Fai-sommelier\u002F\n\n# Install Node.js dependencies\ncd ~\u002F.openclaw\u002Fskills\u002Fai-sommelier\nnpm install @anthropic-ai\u002Fsdk node-fetch\n```\n\nRegister the skill in `~\u002F.openclaw\u002Fconfig.json`:\n\n```json\n{\n  \"skills\": [\n    {\n      \"name\": \"ai-sommelier\",\n      \"path\": \"~\u002F.openclaw\u002Fskills\u002Fai-sommelier\u002Fhandler.js\",\n      \"entry\": \"handle\",\n      \"commands\": [\"scan-label\", \"occasion\", \"blind-taste\"]\n    }\n  ]\n}\n```\n\nThen restart OpenClaw:\n\n```bash\nopenclaw restart\n```\n\n---\n\n## How Each Command Works\n\n### scan-label\n\nThe R1 calls:\n\n```js\nawait R1.ocSend('ai-sommelier', 'scan-label', {\n  systemPrompt: SCAN_SYSTEM_PROMPT,   \u002F\u002F full system prompt; camera JPEG is embedded by the R1 SDK\n  ts: Date.now(),\n});\nconst resp = await R1.ocReceive({ timeoutMs: 60000 });\n```\n\nThe `systemPrompt` field contains the expert sommelier instructions. The R1 SDK embeds the current camera frame as a base64 JPEG inside this payload via the OpenClaw camera bridge. The skill forwards the image and prompt to a vision LLM and returns a JSON wine analysis string.\n\n**Expected response shape** (raw JSON string in `data.text` or `data.result`):\n\n```json\n{\n  \"winery\": \"Château Rayas\",\n  \"wine\": \"Châteauneuf-du-Pape\",\n  \"vintage\": \"2019\",\n  \"variety\": \"Grenache blend\",\n  \"region\": \"Châteauneuf-du-Pape, Southern Rhône, France\",\n  \"identity\": \"One vivid sentence introducing the wine.\",\n  \"tasting\": \"Tasting profile — aromas, palate, structure, finish.\",\n  \"food\": \"3-4 specific food pairing suggestions.\",\n  \"drinkWindow\": \"Advice on current drinkability and aging potential.\",\n  \"drinkStatus\": \"window\",\n  \"price\": \"Retail $85–$120. Restaurant $160–$200.\",\n  \"alternative\": \"One comparable wine at lower price and why.\",\n  \"speakSummary\": \"30-60 second spoken summary for a dinner guest.\"\n}\n```\n\n`drinkStatus` is one of: `window` | `young` | `peak` | `past`.\n\nIf no readable label is visible the LLM returns `{\"error\": \"...\"}` and the R1 shows an error screen.\n\n---\n\n### occasion\n\nThe R1 calls:\n\n```js\nawait R1.ocSend('ai-sommelier', 'occasion', {\n  userInput:    transcribedText,       \u002F\u002F user's spoken occasion description\n  systemPrompt: OCCASION_SYSTEM_PROMPT,\n  ts: Date.now(),\n});\nconst resp = await R1.ocReceive({ timeoutMs: 45000 });\n```\n\nThe skill sends `userInput` as the user message and `systemPrompt` as the system prompt to a text LLM (vision is not needed here).\n\n**Expected response shape:**\n\n```json\n{\n  \"name\": \"Barolo by Giacomo Conterno\",\n  \"meta\": \"2016–2018 vintages · Barolo DOCG · $80–$120\",\n  \"recommendation\": \"3-4 sentences on why this wine fits the occasion.\",\n  \"speakText\": \"Natural spoken recommendation, 20-40 seconds.\"\n}\n```\n\n---\n\n### blind-taste\n\nThe R1 calls:\n\n```js\nawait R1.ocSend('ai-sommelier', 'blind-taste', {\n  userInput:    transcribedText,       \u002F\u002F user's spoken tasting\u002Faroma description\n  systemPrompt: BLIND_SYSTEM_PROMPT,\n  ts: Date.now(),\n});\nconst resp = await R1.ocReceive({ timeoutMs: 45000 });\n```\n\nThe skill sends `userInput` and `systemPrompt` to a text LLM and returns a structured guess.\n\n**Expected response shape:**\n\n```json\n{\n  \"variety\": \"Pinot Noir\",\n  \"region\": \"Burgundy, France\",\n  \"confidence\": \"high\",\n  \"reasoning\": \"2-3 sentences on what clues support the guess.\",\n  \"speakText\": \"Natural spoken assessment, 20-35 seconds.\"\n}\n```\n\n`confidence` is one of: `high` | `medium` | `low`.\n\n---\n\n## Skill Handler (`handler.js`)\n\n```js\n\"use strict\";\nconst Anthropic = require(\"@anthropic-ai\u002Fsdk\");\n\nconst BACKEND = process.env.AI_SOMMELIER_BACKEND || \"anthropic\";\nconst OLLAMA_HOST = process.env.OLLAMA_HOST || \"http:\u002F\u002Flocalhost:11434\";\nconst OLLAMA_MODEL = process.env.OLLAMA_MODEL || \"llava:13b\";\n\nconst client = BACKEND === \"anthropic\" ? new Anthropic() : null;\n\nasync function handle(command, params) {\n  switch (command) {\n    case \"scan-label\":  return cmdScanLabel(params);\n    case \"occasion\":    return cmdText(params);\n    case \"blind-taste\": return cmdText(params);\n    default:            return { error: `Unknown command: ${command}` };\n  }\n}\n\n\u002F\u002F scan-label — requires a vision-capable model\nasync function cmdScanLabel(params) {\n  const systemPrompt = params.systemPrompt || \"\";\n  \u002F\u002F The R1 SDK \u002F OpenClaw bridge extracts the JPEG from the payload.\n  \u002F\u002F By the time this handler runs, params.imageB64 holds the base64 JPEG.\n  const imageB64 = params.imageB64 || \"\";\n\n  if (!imageB64) {\n    return { text: JSON.stringify({ error: \"No camera image received. Ensure OpenClaw camera bridge is enabled.\" }) };\n  }\n\n  if (BACKEND === \"anthropic\") {\n    const resp = await client.messages.create({\n      model: \"claude-sonnet-4-6\",\n      max_tokens: 1024,\n      system: systemPrompt,\n      messages: [{\n        role: \"user\",\n        content: [\n          { type: \"image\", source: { type: \"base64\", media_type: \"image\u002Fjpeg\", data: imageB64 } },\n          { type: \"text\", text: \"Analyze this wine label and return the JSON as instructed.\" },\n        ],\n      }],\n    });\n    return { text: resp.content[0].text };\n  }\n\n  if (BACKEND === \"ollama\") {\n    const r = await fetch(`${OLLAMA_HOST}\u002Fapi\u002Fgenerate`, {\n      method: \"POST\",\n      headers: { \"Content-Type\": \"application\u002Fjson\" },\n      body: JSON.stringify({\n        model: OLLAMA_MODEL,\n        prompt: systemPrompt + \"\\n\\nAnalyze this wine label and return the JSON as instructed.\",\n        images: [imageB64],\n        stream: false,\n      }),\n    });\n    const data = await r.json();\n    return { text: data.response };\n  }\n\n  return { text: JSON.stringify({ error: \"No LLM backend configured.\" }) };\n}\n\n\u002F\u002F occasion + blind-taste — text only, no image\nasync function cmdText(params) {\n  const systemPrompt = params.systemPrompt || \"\";\n  const userInput = params.userInput || \"\";\n\n  if (BACKEND === \"anthropic\") {\n    const resp = await client.messages.create({\n      model: \"claude-sonnet-4-6\",\n      max_tokens: 512,\n      system: systemPrompt,\n      messages: [{ role: \"user\", content: userInput }],\n    });\n    return { text: resp.content[0].text };\n  }\n\n  if (BACKEND === \"ollama\") {\n    const r = await fetch(`${OLLAMA_HOST}\u002Fapi\u002Fgenerate`, {\n      method: \"POST\",\n      headers: { \"Content-Type\": \"application\u002Fjson\" },\n      body: JSON.stringify({\n        model: OLLAMA_MODEL,\n        system: systemPrompt,\n        prompt: userInput,\n        stream: false,\n      }),\n    });\n    const data = await r.json();\n    return { text: data.response };\n  }\n\n  return { text: JSON.stringify({ error: \"No LLM backend configured.\" }) };\n}\n\nmodule.exports = { handle };\n```\n\n---\n\n## Configuration\n\n| Environment variable | Required | Default | Description |\n|---|---|---|---|\n| `AI_SOMMELIER_BACKEND` | No | `anthropic` | `anthropic` or `ollama` |\n| `ANTHROPIC_API_KEY` | When using Anthropic | — | Your Anthropic API key |\n| `OLLAMA_HOST` | When using Ollama | `http:\u002F\u002Flocalhost:11434` | Ollama server URL |\n| `OLLAMA_MODEL` | When using Ollama | `llava:13b` | Model name; must be vision-capable for `scan-label` |\n\nSet variables in your shell profile or pass them to the OpenClaw daemon's environment:\n\n```bash\n# ~\u002F.bashrc or ~\u002F.zshrc\nexport AI_SOMMELIER_BACKEND=anthropic\nexport ANTHROPIC_API_KEY=sk-ant-...\n```\n\nOr for Ollama:\n\n```bash\nexport AI_SOMMELIER_BACKEND=ollama\nexport OLLAMA_HOST=http:\u002F\u002Flocalhost:11434\nexport OLLAMA_MODEL=llava:13b\n```\n\n---\n\n## Response Contract\n\nThe R1 reads the response as:\n\n```js\nconst raw = resp?.data?.text || resp?.data?.result || '';\n```\n\nYour handler must return an object with a `text` or `result` key containing a raw JSON string (no markdown fences). The R1 calls `JSON.parse()` on this string after stripping any accidental backtick fences.\n\n**Timeouts:**\n\n| Command | R1 timeout |\n|---|---|\n| `scan-label` | 60 seconds |\n| `occasion` | 45 seconds |\n| `blind-taste` | 45 seconds |\n\nIf the skill does not respond within these windows the R1 shows an error toast and prompts the user to check that the skill is running.\n\n---\n\n## Security\n\nWine label images are processed entirely on your local machine and sent only to the LLM backend you configure. No image data is written to disk by this skill. When using the Anthropic API, images are transmitted over HTTPS to Anthropic's servers and are subject to Anthropic's [privacy policy](https:\u002F\u002Fwww.anthropic.com\u002Fprivacy). When using Ollama, all image data stays on your machine.\n\nThe `accountKey` used by the R1 hardware for WebSocket connections is a static bearer credential — do not expose it in logs or environment dumps. OpenClaw handles this credential; the skill handler itself never sees it.\n\n---\n\n## Troubleshooting\n\n| Symptom | Likely cause | Fix |\n|---|---|---|\n| \"No connection to OpenClaw\" toast on scan | OpenClaw daemon not running | Run `openclaw start`; verify with `openclaw status` |\n| `scan-label` returns error about no image | OpenClaw camera bridge not enabled or version too old | Ensure OpenClaw >= 0.4 with `camera_bridge: true` in `openclaw.yaml` |\n| JSON parse error on R1 \u002F blank result screen | LLM returned markdown fences around the JSON | The R1 strips common fence patterns; if your model wraps output differently, add a strip step in `cmdScanLabel` \u002F `cmdText` before returning |\n| \"No LLM backend configured\" in response | `AI_SOMMELIER_BACKEND` is set to an unknown value | Set it to `anthropic` or `ollama` |\n| Anthropic API 401 \u002F auth error | Invalid or missing API key | Verify `ANTHROPIC_API_KEY` is exported in the same shell session that runs OpenClaw |\n| Ollama connection refused | Ollama server not running | Run `ollama serve` and confirm the model is pulled (`ollama list`) |\n| `scan-label` times out at 60s with Ollama | Vision inference too slow on this hardware | Try a smaller model (`moondream`, `llava-phi3`) or increase your machine's GPU memory allocation |\n| `occasion` \u002F `blind-taste` return wrong structure | Text-only Ollama model hallucinating JSON keys | Switch to `anthropic` backend for these commands, or use a model known to follow JSON instructions reliably |\n| Cellar data lost between sessions | Unrelated to this skill — cellar is stored in R1 `creationStorage` | Check R1 storage quota and whether the Creation was force-closed |\n","# AI Sommelier — OpenClaw Skill\n\nThe AI Sommelier R1 Creation communicates with your local machine via the OpenClaw shared-storage bridge. This skill listens for three commands sent by the R1, routes them to a vision or text LLM backend, and writes the response back so the R1 can speak it and display results.\n\n---\n\n## Commands\n\n| Command | Triggered by | What the skill does |\n|---|---|---|\n| `scan-label` | PTT press in Scan mode | Extracts the camera image embedded in `systemPrompt`, sends it to a vision LLM, returns a JSON wine analysis (identity, tasting profile, food pairings, drink window, price, alternatives) |\n| `occasion` | Voice submission in Occasion mode | Sends the user's spoken occasion description to a text LLM, returns a JSON wine recommendation with name, meta, and spoken text |\n| `blind-taste` | Voice submission in Blind mode | Sends the user's spoken tasting\u002Faroma description to a text LLM, returns a JSON guess at grape variety and region with confidence and reasoning |\n\n---\n\n## Prerequisites\n\n### 1. OpenClaw daemon\n\nInstall and run OpenClaw on the same machine that will call the LLM APIs. OpenClaw polls a shared R1 storage key for commands and writes responses back.\n\n- Repo: [OpenClaw](https:\u002F\u002Fgithub.com\u002Frabbit-r1-community\u002Fopenclaw) (community project)\n- Complete OpenClaw's own setup before configuring this skill.\n\n### 2. Node.js 18+ or Python 3.10+\n\nThe skill handler runs as a local script. Examples in this document use Node.js. A Python port works equally well.\n\n```bash\nnode --version   # must be >= 18\n```\n\n### 3. LLM backend — choose one\n\n**Option A — Anthropic API (recommended for scan-label)**\n\n`scan-label` sends a base64-encoded JPEG embedded in the system prompt, so it requires a vision-capable model. `claude-sonnet-4-6` or higher is recommended.\n\n```bash\nexport ANTHROPIC_API_KEY=sk-ant-...\n```\n\n**Option B — Ollama with a vision model (free, fully local)**\n\n`scan-label` requires a multimodal model (e.g. `llava:13b`, `moondream`, or `llava-phi3`). Text-only commands (`occasion`, `blind-taste`) work with any Ollama model.\n\n```bash\nollama pull llava:13b          # or another vision-capable model\nexport AI_SOMMELIER_BACKEND=ollama\nexport OLLAMA_HOST=http:\u002F\u002Flocalhost:11434\nexport OLLAMA_MODEL=llava:13b\n```\n\n---\n\n## Skill Installation\n\n```bash\n# Copy this skill into your OpenClaw skills directory\ncp -r ai-sommelier\u002F ~\u002F.openclaw\u002Fskills\u002Fai-sommelier\u002F\n\n# Install Node.js dependencies\ncd ~\u002F.openclaw\u002Fskills\u002Fai-sommelier\nnpm install @anthropic-ai\u002Fsdk node-fetch\n```\n\nRegister the skill in `~\u002F.openclaw\u002Fconfig.json`:\n\n```json\n{\n  \"skills\": [\n    {\n      \"name\": \"ai-sommelier\",\n      \"path\": \"~\u002F.openclaw\u002Fskills\u002Fai-sommelier\u002Fhandler.js\",\n      \"entry\": \"handle\",\n      \"commands\": [\"scan-label\", \"occasion\", \"blind-taste\"]\n    }\n  ]\n}\n```\n\nThen restart OpenClaw:\n\n```bash\nopenclaw restart\n```\n\n---\n\n## How Each Command Works\n\n### scan-label\n\nThe R1 calls:\n\n```js\nawait R1.ocSend('ai-sommelier', 'scan-label', {\n  systemPrompt: SCAN_SYSTEM_PROMPT,   \u002F\u002F full system prompt; camera JPEG is embedded by the R1 SDK\n  ts: Date.now(),\n});\nconst resp = await R1.ocReceive({ timeoutMs: 60000 });\n```\n\nThe `systemPrompt` field contains the expert sommelier instructions. The R1 SDK embeds the current camera frame as a base64 JPEG inside this payload via the OpenClaw camera bridge. The skill forwards the image and prompt to a vision LLM and returns a JSON wine analysis string.\n\n**Expected response shape** (raw JSON string in `data.text` or `data.result`):\n\n```json\n{\n  \"winery\": \"Château Rayas\",\n  \"wine\": \"Châteauneuf-du-Pape\",\n  \"vintage\": \"2019\",\n  \"variety\": \"Grenache blend\",\n  \"region\": \"Châteauneuf-du-Pape, Southern Rhône, France\",\n  \"identity\": \"One vivid sentence introducing the wine.\",\n  \"tasting\": \"Tasting profile — aromas, palate, structure, finish.\",\n  \"food\": \"3-4 specific food pairing suggestions.\",\n  \"drinkWindow\": \"Advice on current drinkability and aging potential.\",\n  \"drinkStatus\": \"window\",\n  \"price\": \"Retail $85–$120. Restaurant $160–$200.\",\n  \"alternative\": \"One comparable wine at lower price and why.\",\n  \"speakSummary\": \"30-60 second spoken summary for a dinner guest.\"\n}\n```\n\n`drinkStatus` is one of: `window` | `young` | `peak` | `past`.\n\nIf no readable label is visible the LLM returns `{\"error\": \"...\"}` and the R1 shows an error screen.\n\n---\n\n### occasion\n\nThe R1 calls:\n\n```js\nawait R1.ocSend('ai-sommelier', 'occasion', {\n  userInput:    transcribedText,       \u002F\u002F user's spoken occasion description\n  systemPrompt: OCCASION_SYSTEM_PROMPT,\n  ts: Date.now(),\n});\nconst resp = await R1.ocReceive({ timeoutMs: 45000 });\n```\n\nThe skill sends `userInput` as the user message and `systemPrompt` as the system prompt to a text LLM (vision is not needed here).\n\n**Expected response shape:**\n\n```json\n{\n  \"name\": \"Barolo by Giacomo Conterno\",\n  \"meta\": \"2016–2018 vintages · Barolo DOCG · $80–$120\",\n  \"recommendation\": \"3-4 sentences on why this wine fits the occasion.\",\n  \"speakText\": \"Natural spoken recommendation, 20-40 seconds.\"\n}\n```\n\n---\n\n### blind-taste\n\nThe R1 calls:\n\n```js\nawait R1.ocSend('ai-sommelier', 'blind-taste', {\n  userInput:    transcribedText,       \u002F\u002F user's spoken tasting\u002Faroma description\n  systemPrompt: BLIND_SYSTEM_PROMPT,\n  ts: Date.now(),\n});\nconst resp = await R1.ocReceive({ timeoutMs: 45000 });\n```\n\nThe skill sends `userInput` and `systemPrompt` to a text LLM and returns a structured guess.\n\n**Expected response shape:**\n\n```json\n{\n  \"variety\": \"Pinot Noir\",\n  \"region\": \"Burgundy, France\",\n  \"confidence\": \"high\",\n  \"reasoning\": \"2-3 sentences on what clues support the guess.\",\n  \"speakText\": \"Natural spoken assessment, 20-35 seconds.\"\n}\n```\n\n`confidence` is one of: `high` | `medium` | `low`.\n\n---\n\n## Skill Handler (`handler.js`)\n\n```js\n\"use strict\";\nconst Anthropic = require(\"@anthropic-ai\u002Fsdk\");\n\nconst BACKEND = process.env.AI_SOMMELIER_BACKEND || \"anthropic\";\nconst OLLAMA_HOST = process.env.OLLAMA_HOST || \"http:\u002F\u002Flocalhost:11434\";\nconst OLLAMA_MODEL = process.env.OLLAMA_MODEL || \"llava:13b\";\n\nconst client = BACKEND === \"anthropic\" ? new Anthropic() : null;\n\nasync function handle(command, params) {\n  switch (command) {\n    case \"scan-label\":  return cmdScanLabel(params);\n    case \"occasion\":    return cmdText(params);\n    case \"blind-taste\": return cmdText(params);\n    default:            return { error: `Unknown command: ${command}` };\n  }\n}\n\n\u002F\u002F scan-label — requires a vision-capable model\nasync function cmdScanLabel(params) {\n  const systemPrompt = params.systemPrompt || \"\";\n  \u002F\u002F The R1 SDK \u002F OpenClaw bridge extracts the JPEG from the payload.\n  \u002F\u002F By the time this handler runs, params.imageB64 holds the base64 JPEG.\n  const imageB64 = params.imageB64 || \"\";\n\n  if (!imageB64) {\n    return { text: JSON.stringify({ error: \"No camera image received. Ensure OpenClaw camera bridge is enabled.\" }) };\n  }\n\n  if (BACKEND === \"anthropic\") {\n    const resp = await client.messages.create({\n      model: \"claude-sonnet-4-6\",\n      max_tokens: 1024,\n      system: systemPrompt,\n      messages: [{\n        role: \"user\",\n        content: [\n          { type: \"image\", source: { type: \"base64\", media_type: \"image\u002Fjpeg\", data: imageB64 } },\n          { type: \"text\", text: \"Analyze this wine label and return the JSON as instructed.\" },\n        ],\n      }],\n    });\n    return { text: resp.content[0].text };\n  }\n\n  if (BACKEND === \"ollama\") {\n    const r = await fetch(`${OLLAMA_HOST}\u002Fapi\u002Fgenerate`, {\n      method: \"POST\",\n      headers: { \"Content-Type\": \"application\u002Fjson\" },\n      body: JSON.stringify({\n        model: OLLAMA_MODEL,\n        prompt: systemPrompt + \"\\n\\nAnalyze this wine label and return the JSON as instructed.\",\n        images: [imageB64],\n        stream: false,\n      }),\n    });\n    const data = await r.json();\n    return { text: data.response };\n  }\n\n  return { text: JSON.stringify({ error: \"No LLM backend configured.\" }) };\n}\n\n\u002F\u002F occasion + blind-taste — text only, no image\nasync function cmdText(params) {\n  const systemPrompt = params.systemPrompt || \"\";\n  const userInput = params.userInput || \"\";\n\n  if (BACKEND === \"anthropic\") {\n    const resp = await client.messages.create({\n      model: \"claude-sonnet-4-6\",\n      max_tokens: 512,\n      system: systemPrompt,\n      messages: [{ role: \"user\", content: userInput }],\n    });\n    return { text: resp.content[0].text };\n  }\n\n  if (BACKEND === \"ollama\") {\n    const r = await fetch(`${OLLAMA_HOST}\u002Fapi\u002Fgenerate`, {\n      method: \"POST\",\n      headers: { \"Content-Type\": \"application\u002Fjson\" },\n      body: JSON.stringify({\n        model: OLLAMA_MODEL,\n        system: systemPrompt,\n        prompt: userInput,\n        stream: false,\n      }),\n    });\n    const data = await r.json();\n    return { text: data.response };\n  }\n\n  return { text: JSON.stringify({ error: \"No LLM backend configured.\" }) };\n}\n\nmodule.exports = { handle };\n```\n\n---\n\n## Configuration\n\n| Environment variable | Required | Default | Description |\n|---|---|---|---|\n| `AI_SOMMELIER_BACKEND` | No | `anthropic` | `anthropic` or `ollama` |\n| `ANTHROPIC_API_KEY` | When using Anthropic | — | Your Anthropic API key |\n| `OLLAMA_HOST` | When using Ollama | `http:\u002F\u002Flocalhost:11434` | Ollama server URL |\n| `OLLAMA_MODEL` | When using Ollama | `llava:13b` | Model name; must be vision-capable for `scan-label` |\n\nSet variables in your shell profile or pass them to the OpenClaw daemon's environment:\n\n```bash\n# ~\u002F.bashrc or ~\u002F.zshrc\nexport AI_SOMMELIER_BACKEND=anthropic\nexport ANTHROPIC_API_KEY=sk-ant-...\n```\n\nOr for Ollama:\n\n```bash\nexport AI_SOMMELIER_BACKEND=ollama\nexport OLLAMA_HOST=http:\u002F\u002Flocalhost:11434\nexport OLLAMA_MODEL=llava:13b\n```\n\n---\n\n## Response Contract\n\nThe R1 reads the response as:\n\n```js\nconst raw = resp?.data?.text || resp?.data?.result || '';\n```\n\nYour handler must return an object with a `text` or `result` key containing a raw JSON string (no markdown fences). The R1 calls `JSON.parse()` on this string after stripping any accidental backtick fences.\n\n**Timeouts:**\n\n| Command | R1 timeout |\n|---|---|\n| `scan-label` | 60 seconds |\n| `occasion` | 45 seconds |\n| `blind-taste` | 45 seconds |\n\nIf the skill does not respond within these windows the R1 shows an error toast and prompts the user to check that the skill is running.\n\n---\n\n## Security\n\nWine label images are processed entirely on your local machine and sent only to the LLM backend you configure. No image data is written to disk by this skill. When using the Anthropic API, images are transmitted over HTTPS to Anthropic's servers and are subject to Anthropic's [privacy policy](https:\u002F\u002Fwww.anthropic.com\u002Fprivacy). When using Ollama, all image data stays on your machine.\n\nThe `accountKey` used by the R1 hardware for WebSocket connections is a static bearer credential — do not expose it in logs or environment dumps. OpenClaw handles this credential; the skill handler itself never sees it.\n\n---\n\n## Troubleshooting\n\n| Symptom | Likely cause | Fix |\n|---|---|---|\n| \"No connection to OpenClaw\" toast on scan | OpenClaw daemon not running | Run `openclaw start`; verify with `openclaw status` |\n| `scan-label` returns error about no image | OpenClaw camera bridge not enabled or version too old | Ensure OpenClaw >= 0.4 with `camera_bridge: true` in `openclaw.yaml` |\n| JSON parse error on R1 \u002F blank result screen | LLM returned markdown fences around the JSON | The R1 strips common fence patterns; if your model wraps output differently, add a strip step in `cmdScanLabel` \u002F `cmdText` before returning |\n| \"No LLM backend configured\" in response | `AI_SOMMELIER_BACKEND` is set to an unknown value | Set it to `anthropic` or `ollama` |\n| Anthropic API 401 \u002F auth error | Invalid or missing API key | Verify `ANTHROPIC_API_KEY` is exported in the same shell session that runs OpenClaw |\n| Ollama connection refused | Ollama server not running | Run `ollama serve` and confirm the model is pulled (`ollama list`) |\n| `scan-label` times out at 60s with Ollama | Vision inference too slow on this hardware | Try a smaller model (`moondream`, `llava-phi3`) or increase your machine's GPU memory allocation |\n| `occasion` \u002F `blind-taste` return wrong structure | Text-only Ollama model hallucinating JSON keys | Switch to `anthropic` backend for these commands, or use a model known to follow JSON instructions reliably |\n| Cellar data lost between sessions | Unrelated to this skill — cellar is stored in R1 `creationStorage` | Check R1 storage quota and whether the Creation was force-closed |\n",{"name":5,"author":24,"version":25,"description":7},"rabbit-r1-skillz","1.0.0","main","734489c70f6293d3b800cd956559034acaa9f563","https:\u002F\u002Fgithub.com\u002Fajohnsonnow\u002Fr1-warren","https:\u002F\u002Fgithub.com\u002Fajohnsonnow","structuredforgrowth.com","2026-09-04 21:06:25",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add ajohnsonnow\u002Fr1-warren --skill ai-sommelier",{"tool":38,"command":39},"bunx","bunx skills add ajohnsonnow\u002Fr1-warren --skill ai-sommelier",{"tool":41,"command":42},"pnpm","pnpm dlx skills add ajohnsonnow\u002Fr1-warren --skill ai-sommelier","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fajohnsonnow\u002Fr1-warren\u002Fblob\u002Fmain\u002Fai-sommelier\u002FSKILL.md",true,[46,52,56],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"card.jpg","ASSET","资产文件",19872,"https:\u002F\u002Fgithub.com\u002Fajohnsonnow\u002Fr1-warren\u002Fblob\u002Fmain\u002Fai-sommelier\u002Fcard.jpg",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"icon.png",11245,"https:\u002F\u002Fgithub.com\u002Fajohnsonnow\u002Fr1-warren\u002Fblob\u002Fmain\u002Fai-sommelier\u002Ficon.png",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"index.html","REFERENCE","参考文档",56840,"https:\u002F\u002Fgithub.com\u002Fajohnsonnow\u002Fr1-warren\u002Fblob\u002Fmain\u002Fai-sommelier\u002Findex.html",[63,70,77,84,91,98],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M75THZJQ1XYR8QDWB9RXC9QV","whisper-quiz","WhisperQuiz — voice-answered trivia game for Rabbit R1. Generates questions via the R1's built-in LLM, captures spoken answers via STT, and evaluates correctness with flexible LLM-based matching.","https:\u002F\u002Fgithub.com\u002Fajohnsonnow\u002Fr1-warren\u002Fblob\u002Fmain\u002Fwhisper-quiz\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M75THW5BJRSQQM3QP6M568FT","walk-cast","Walking podcast production skill. Receives raw audio metadata and transcript from the R1, removes long pauses, applies noise reduction and normalization, generates AI chapter titles and episode metadata via LLM, and uploads the final episode to your configured podcast RSS host (Spotify for Podcasters \u002F Anchor, Podbean, Buzzsprout, RSS.com, or any FTP-accessible feed).","https:\u002F\u002Fgithub.com\u002Fajohnsonnow\u002Fr1-warren\u002Fblob\u002Fmain\u002Fwalk-cast\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M75THTANZTS2AMDDBP615RTA","voice-novel","Local machine skill for VoiceNovel — handles story export to disk.","https:\u002F\u002Fgithub.com\u002Fajohnsonnow\u002Fr1-warren\u002Fblob\u002Fmain\u002Fvoice-novel\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M75THQ175ZRJ3E0GPFW7QKM8","voice-guide","Environment description and navigation assistant for blind and low-vision users. Analyzes camera frames via a vision LLM, reads visible text, identifies scene categories (people\u002Fvehicles\u002Ffood\u002Fhazards\u002Fexits), performs 360° scans, retrieves GPS position, and sends emergency SMS alerts — all via audio feedback with zero screen dependency.","https:\u002F\u002Fgithub.com\u002Fajohnsonnow\u002Fr1-warren\u002Fblob\u002Fmain\u002Fvoice-guide\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M75THKAJR69WV7QQYJ26X95C","voice-draft","Voice-driven document drafting for the Rabbit R1. Dictate stream-of-consciousness speech; the R1 formats it into Email, Blog Post, Report, Proposal, Meeting Notes, Creative Writing, Code Comments, Cover Letter, or Tweet Thread — then saves the result to a configured folder on your local machine via OpenClaw.","https:\u002F\u002Fgithub.com\u002Fajohnsonnow\u002Fr1-warren\u002Fblob\u002Fmain\u002Fvoice-draft\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M75THGKGY2JY59MM9PREXCXX","voice-commit","Hands-free git and CI workflow voice controller for the Rabbit R1. Speak git\u002FCI commands and hear results — commit, push, status, PR management, test runs, and deploy, all voice-driven via OpenClaw.","https:\u002F\u002Fgithub.com\u002Fajohnsonnow\u002Fr1-warren\u002Fblob\u002Fmain\u002Fvoice-commit\u002FSKILL.md",[],[]]