Skip to content
Back to search

clawra-selfie

SkillWorks with Claude CodeGitHub

Edit Clawra's reference image with Grok Imagine (xAI Aurora) and send selfies to messaging channels via OpenClaw

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/sumelabs--clawra/badge.svg)](/listings/sumelabs--clawra)

HTML

<a href="/listings/sumelabs--clawra"><img src="/api/listings/sumelabs--clawra/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

npx clawra@latest

This will: 1. Check OpenClaw is installed 2. Guide you to get a fal.ai API key 3. Install the skill to `~/.openclaw/skills/clawra-selfie/` 4. Configure OpenClaw to use the skill 5. Add selfie capabilities to your agent's SOUL.md

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 412 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: clawra-selfie
  3. description: Edit Clawra's reference image with Grok Imagine (xAI Aurora) and send selfies to messaging channels via OpenClaw
  4. allowed-tools: Bash(npm:*) Bash(npx:*) Bash(openclaw:*) Bash(curl:*) Read Write WebFetch
  5. ---
  6. # Clawra Selfie
  7. Edit a fixed reference image using xAI's Grok Imagine model and distribute it across messaging platforms (WhatsApp, Telegram, Discord, Slack, etc.) via OpenClaw.
  8. ## Reference Image
  9. The skill uses a fixed reference image hosted on jsDelivr CDN:
  10. ```
  11. https://cdn.jsdelivr.net/gh/SumeLabs/clawra@main/assets/clawra.png
  12. ```
  13. ## When to Use
  14. - User says "send a pic", "send me a pic", "send a photo", "send a selfie"
  15. - User says "send a pic of you...", "send a selfie of you..."
  16. - User asks "what are you doing?", "how are you doing?", "where are you?"
  17. - User describes a context: "send a pic wearing...", "send a pic at..."
  18. - User wants Clawra to appear in a specific outfit, location, or situation
  19. ## Quick Reference
  20. ### Required Environment Variables
  21. ```bash
  22. FAL_KEY=your_fal_api_key # Get from https://fal.ai/dashboard/keys
  23. OPENCLAW_GATEWAY_TOKEN=your_token # From: openclaw doctor --generate-gateway-token
  24. ```
  25. ### Workflow
  26. 1. **Get user prompt** for how to edit the image
  27. 2. **Edit image** via fal.ai Grok Imagine Edit API with fixed reference
  28. 3. **Extract image URL** from response
  29. 4. **Send to OpenClaw** with target channel(s)
  30. ## Step-by-Step Instructions
  31. ### Step 1: Collect User Input
  32. Ask the user for:
  33. - **User context**: What should the person in the image be doing/wearing/where?
  34. - **Mode** (optional): `mirror` or `direct` selfie style
  35. - **Target channel(s)**: Where should it be sent? (e.g., `#general`, `@username`, channel ID)
  36. - **Platform** (optional): Which platform? (discord, telegram, whatsapp, slack)
  37. ## Prompt Modes
  38. ### Mode 1: Mirror Selfie (default)
  39. Best for: outfit showcases, full-body shots, fashion content
  40. ```
  41. make a pic of this person, but [user's context]. the person is taking a mirror selfie
  42. ```
  43. **Example**: "wearing a santa hat" →
  44. ```
  45. make a pic of this person, but wearing a santa hat. the person is taking a mirror selfie
  46. ```
  47. ### Mode 2: Direct Selfie
  48. Best for: close-up portraits, location shots, emotional expressions
  49. ```
  50. a close-up selfie taken by herself at [user's context], direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arm's length, face fully visible
  51. ```
  52. **Example**: "a cozy cafe with warm lighting" →
  53. ```
  54. a close-up selfie taken by herself at a cozy cafe with warm lighting, direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arm's length, face fully visible
  55. ```
  56. ### Mode Selection Logic
  57. | Keywords in Request | Auto-Select Mode |
  58. |---------------------|------------------|
  59. | outfit, wearing, clothes, dress, suit, fashion | `mirror` |
  60. | cafe, restaurant, beach, park, city, location | `direct` |
  61. | close-up, portrait, face, eyes, smile | `direct` |
  62. | full-body, mirror, reflection | `mirror` |
  63. ### Step 2: Edit Image with Grok Imagine
  64. Use the fal.ai API to edit the reference image:
  65. ```bash
  66. REFERENCE_IMAGE="https://cdn.jsdelivr.net/gh/SumeLabs/clawra@main/assets/clawra.png"
  67. # Mode 1: Mirror Selfie
  68. PROMPT="make a pic of this person, but <USER_CONTEXT>. the person is taking a mirror selfie"
  69. # Mode 2: Direct Selfie
  70. PROMPT="a close-up selfie taken by herself at <USER_CONTEXT>, direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arm's length, face fully visible"
  71. # Build JSON payload with jq (handles escaping properly)
  72. JSON_PAYLOAD=$(jq -n \
  73. --arg image_url "$REFERENCE_IMAGE" \
  74. --arg prompt "$PROMPT" \
  75. '{image_url: $image_url, prompt: $prompt, num_images: 1, output_format: "jpeg"}')
  76. curl -X POST "https://fal.run/xai/grok-imagine-image/edit" \
  77. -H "Authorization: Key $FAL_KEY" \
  78. -H "Content-Type: application/json" \
  79. -d "$JSON_PAYLOAD"
  80. ```
  81. **Response Format:**
  82. ```json
  83. {
  84. "images": [
  85. {
  86. "url": "https://v3b.fal.media/files/...",
  87. "content_type": "image/jpeg",
  88. "width": 1024,
  89. "height": 1024
  90. }
  91. ],
  92. "revised_prompt": "Enhanced prompt text..."
  93. }
  94. ```
  95. ### Step 3: Send Image via OpenClaw
  96. Use the OpenClaw messaging API to send the edited image:
  97. ```bash
  98. openclaw message send \
  99. --action send \
  100. --channel "<TARGET_CHANNEL>" \
  101. --message "<CAPTION_TEXT>" \
  102. --media "<IMAGE_URL>"
  103. ```
  104. **Alternative: Direct API call**
  105. ```bash
  106. curl -X POST "http://localhost:18789/message" \
  107. -H "Authorization: Bearer $OPENCLAW_GATEWAY_TOKEN" \
  108. -H "Content-Type: application/json" \
  109. -d '{
  110. "action": "send",
  111. "channel": "<TARGET_CHANNEL>",
  112. "message": "<CAPTION_TEXT>",
  113. "media": "<IMAGE_URL>"
  114. }'
  115. ```
  116. ## Complete Script Example
  117. ```bash
  118. #!/bin/bash
  119. # grok-imagine-edit-send.sh
  120. # Check required environment variables
  121. if [ -z "$FAL_KEY" ]; then
  122. echo "Error: FAL_KEY environment variable not set"
  123. exit 1
  124. fi
  125. # Fixed reference image
  126. REFERENCE_IMAGE="https://cdn.jsdelivr.net/gh/SumeLabs/clawra@main/assets/clawra.png"
  127. USER_CONTEXT="$1"
  128. CHANNEL="$2"
  129. MODE="${3:-auto}" # mirror, direct, or auto
  130. CAPTION="${4:-Edited with Grok Imagine}"
  131. if [ -z "$USER_CONTEXT" ] || [ -z "$CHANNEL" ]; then
  132. echo "Usage: $0 <user_context> <channel> [mode] [caption]"
  133. echo "Modes: mirror, direct, auto (default)"
  134. echo "Example: $0 'wearing a cowboy hat' '#general' mirror"
  135. echo "Example: $0 'a cozy cafe' '#general' direct"
  136. exit 1
  137. fi
  138. # Auto-detect mode based on keywords
  139. if [ "$MODE" == "auto" ]; then
  140. if echo "$USER_CONTEXT" | grep -qiE "outfit|wearing|clothes|dress|suit|fashion|full-body|mirror"; then
  141. MODE="mirror"
  142. elif echo "$USER_CONTEXT" | grep -qiE "cafe|restaurant|beach|park|city|close-up|portrait|face|eyes|smile"; then
  143. MODE="direct"
  144. else
  145. MODE="mirror" # default
  146. fi
  147. echo "Auto-detected mode: $MODE"
  148. fi
  149. # Construct the prompt based on mode
  150. if [ "$MODE" == "direct" ]; then
  151. EDIT_PROMPT="a close-up selfie taken by herself at $USER_CONTEXT, direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arm's length, face fully visible"
  152. else
  153. EDIT_PROMPT="make a pic of this person, but $USER_CONTEXT. the person is taking a mirror selfie"
  154. fi
  155. echo "Mode: $MODE"
  156. echo "Editing reference image with prompt: $EDIT_PROMPT"
  157. # Edit image (using jq for proper JSON escaping)
  158. JSON_PAYLOAD=$(jq -n \
  159. --arg image_url "$REFERENCE_IMAGE" \
  160. --arg prompt "$EDIT_PROMPT" \
  161. '{image_url: $image_url, prompt: $prompt, num_images: 1, output_format: "jpeg"}')
  162. RESPONSE=$(curl -s -X POST "https://fal.run/xai/grok-imagine-image/edit" \
  163. -H "Authorization: Key $FAL_KEY" \
  164. -H "Content-Type: application/json" \
  165. -d "$JSON_PAYLOAD")
  166. # Extract image URL
  167. IMAGE_URL=$(echo "$RESPONSE" | jq -r '.images[0].url')
  168. if [ "$IMAGE_URL" == "null" ] || [ -z "$IMAGE_URL" ]; then
  169. echo "Error: Failed to edit image"
  170. echo "Response: $RESPONSE"
  171. exit 1
  172. fi
  173. echo "Image edited: $IMAGE_URL"
  174. echo "Sending to channel: $CHANNEL"
  175. # Send via OpenClaw
  176. openclaw message send \
  177. --action send \
  178. --channel "$CHANNEL" \
  179. --message "$CAPTION" \
  180. --media "$IMAGE_URL"
  181. echo "Done!"
  182. ```
  183. ## Node.js/TypeScript Implementation
  184. ```typescript
  185. import { fal } from "@fal-ai/client";
  186. import { exec } from "child_process";
  187. import { promisify } from "util";
  188. const execAsync = promisify(exec);
  189. const REFERENCE_IMAGE = "https://cdn.jsdelivr.net/gh/SumeLabs/clawra@main/assets/clawra.png";
  190. interface GrokImagineResult {
  191. images: Array<{
  192. url: string;
  193. content_type: string;
  194. width: number;
  195. height: number;
  196. }>;
  197. revised_prompt?: string;
  198. }
  199. type SelfieMode = "mirror" | "direct" | "auto";
  200. function detectMode(userContext: string): "mirror" | "direct" {
  201. const mirrorKeywords = /outfit|wearing|clothes|dress|suit|fashion|full-body|mirror/i;
  202. const directKeywords = /cafe|restaurant|beach|park|city|close-up|portrait|face|eyes|smile/i;
  203. if (directKeywords.test(userContext)) return "direct";
  204. if (mirrorKeywords.test(userContext)) return "mirror";
  205. return "mirror"; // default
  206. }
  207. function buildPrompt(userContext: string, mode: "mirror" | "direct"): string {
  208. if (mode === "direct") {
  209. return `a close-up selfie taken by herself at ${userContext}, direct eye contact with the camera, looking straight into the lens, eyes centered and clearly visible, not a mirror selfie, phone held at arm's length, face fully visible`;
  210. }
  211. return `make a pic of this person, but ${userContext}. the person is taking a mirror selfie`;
  212. }
  213. async function editAndSend(
  214. userContext: string,
  215. channel: string,
  216. mode: SelfieMode = "auto",
  217. caption?: string
  218. ): Promise<string> {
  219. // Configure fal.ai client
  220. fal.config({
  221. credentials: process.env.FAL_KEY!
  222. });
  223. // Determine mode
  224. const actualMode = mode === "auto" ? detectMode(userContext) : mode;
  225. console.log(`Mode: ${actualMode}`);
  226. // Construct the prompt
  227. const editPrompt = buildPrompt(userContext, actualMode);
  228. // Edit reference image with Grok Imagine
  229. console.log(`Editing image: "${editPrompt}"`);
  230. const result = await fal.subscribe("xai/grok-imagine-image/edit", {
  231. input: {
  232. image_url: REFERENCE_IMAGE,
  233. prompt: editPrompt,
  234. num_images: 1,
  235. output_format: "jpeg"
  236. }
  237. }) as { data: GrokImagineResult };
  238. const imageUrl = result.data.images[0].url;
  239. console.log(`Edited image URL: ${imageUrl}`);
  240. // Send via OpenClaw
  241. const messageCaption = caption || `Edited with Grok Imagine`;
  242. await execAsync(
  243. `openclaw message send --action send --channel "${channel}" --message "${messageCaption}" --media "${imageUrl}"`
  244. );
  245. console.log(`Sent to ${channel}`);
  246. return imageUrl;
  247. }
  248. // Usage Examples
  249. // Mirror mode (auto-detected from "wearing")
  250. editAndSend(
  251. "wearing a cyberpunk outfit with neon lights",
  252. "#art-gallery",
  253. "auto",
  254. "Check out this AI-edited art!"
  255. );
  256. // → Mode: mirror
  257. // → Prompt: "make a pic of this person, but wearing a cyberpunk outfit with neon lights. the person is taking a mirror selfie"
  258. // Direct mode (auto-detected from "cafe")
  259. editAndSend(
  260. "a cozy cafe with warm lighting",
  261. "#photography",
  262. "auto"
  263. );
  264. // → Mode: direct
  265. // → Prompt: "a close-up selfie taken by herself at a cozy cafe with warm lighting, direct eye contact..."
  266. // Explicit mode override
  267. editAndSend("casual street style", "#fashion", "direct");
  268. ```
  269. ## Supported Platforms
  270. OpenClaw supports sending to:
  271. | Platform | Channel Format | Example |
  272. |----------|----------------|---------|
  273. | Discord | `#channel-name` or channel ID | `#general`, `123456789` |
  274. | Telegram | `@username` or chat ID | `@mychannel`, `-100123456` |
  275. | WhatsApp | Phone number (JID format) | `1234567890@s.whatsapp.net` |
  276. | Slack | `#channel-name` | `#random` |
  277. | Signal | Phone number | `+1234567890` |
  278. | MS Teams | Channel reference | (varies) |
  279. ## Grok Imagine Edit Parameters
  280. | Parameter | Type | Default | Description |
  281. |-----------|------|---------|-------------|
  282. | `image_url` | string | required | URL of image to edit (fixed in this skill) |
  283. | `prompt` | string | required | Edit instruction |
  284. | `num_images` | 1-4 | 1 | Number of images to generate |
  285. | `output_format` | enum | "jpeg" | jpeg, png, webp |
  286. ## Setup Requirements
  287. ### 1. Install fal.ai client (for Node.js usage)
  288. ```bash
  289. npm install @fal-ai/client
  290. ```
  291. ### 2. Install OpenClaw CLI
  292. ```bash
  293. npm install -g openclaw
  294. ```
  295. ### 3. Configure OpenClaw Gateway
  296. ```bash
  297. openclaw config set gateway.mode=local
  298. openclaw doctor --generate-gateway-token
  299. ```
  300. ### 4. Start OpenClaw Gateway
  301. ```bash
  302. openclaw gateway start
  303. ```
  304. ## Error Handling
  305. - **FAL_KEY missing**: Ensure the API key is set in environment
  306. - **Image edit failed**: Check prompt content and API quota
  307. - **OpenClaw send failed**: Verify gateway is running and channel exists
  308. - **Rate limits**: fal.ai has rate limits; implement retry logic if needed
  309. ## Tips
  310. 1. **Mirror mode context examples** (outfit focus):
  311. - "wearing a santa hat"
  312. - "in a business suit"
  313. - "wearing a summer dress"
  314. - "in streetwear fashion"
  315. 2. **Direct mode context examples** (location/portrait focus):
  316. - "a cozy cafe with warm lighting"
  317. - "a sunny beach at sunset"
  318. - "a busy city street at night"
  319. - "a peaceful park in autumn"
  320. 3. **Mode selection**: Let auto-detect work, or explicitly specify for control
  321. 4. **Batch sending**: Edit once, send to multiple channels
  322. 5. **Scheduling**: Combine with OpenClaw scheduler for automated posts
README.md · README · 125 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Clawra
  2. <img width="300" alt="image" src="https://github.com/user-attachments/assets/41512c51-e61d-4550-b461-eed06a1b0ec8" />
  3. ## Quick Start
  4. ```bash
  5. npx clawra@latest
  6. ```
  7. This will:
  8. 1. Check OpenClaw is installed
  9. 2. Guide you to get a fal.ai API key
  10. 3. Install the skill to `~/.openclaw/skills/clawra-selfie/`
  11. 4. Configure OpenClaw to use the skill
  12. 5. Add selfie capabilities to your agent's SOUL.md
  13. ## What It Does
  14. Clawra Selfie enables your OpenClaw agent to:
  15. - **Generate selfies** using a consistent reference image
  16. - **Send photos** across all messaging platforms (Discord, Telegram, WhatsApp, etc.)
  17. - **Respond visually** to "what are you doing?" and "send a pic" requests
  18. ### Selfie Modes
  19. | Mode | Best For | Keywords |
  20. |------|----------|----------|
  21. | **Mirror** | Full-body shots, outfits | wearing, outfit, fashion |
  22. | **Direct** | Close-ups, locations | cafe, beach, portrait, smile |
  23. ## Prerequisites
  24. - [OpenClaw](https://github.com/openclaw/openclaw) installed and configured
  25. - [fal.ai](https://fal.ai) account (free tier available)
  26. ## Manual Installation
  27. If you prefer manual setup:
  28. ### 1. Get API Key
  29. Visit [fal.ai/dashboard/keys](https://fal.ai/dashboard/keys) and create an API key.
  30. ### 2. Clone the Skill
  31. ```bash
  32. git clone https://github.com/SumeLabs/clawra ~/.openclaw/skills/clawra-selfie
  33. ```
  34. ### 3. Configure OpenClaw
  35. Add to `~/.openclaw/openclaw.json`:
  36. ```json
  37. {
  38. "skills": {
  39. "entries": {
  40. "clawra-selfie": {
  41. "enabled": true,
  42. "env": {
  43. "FAL_KEY": "your_fal_key_here"
  44. }
  45. }
  46. }
  47. }
  48. }
  49. ```
  50. ### 4. Update SOUL.md
  51. Add the selfie persona to `~/.openclaw/workspace/SOUL.md`:
  52. ```markdown
  53. ## Clawra Selfie Capability
  54. You have a physical appearance and can take selfies!
  55. When users ask for pictures, use the clawra-selfie skill.
  56. ```
  57. ## Usage Examples
  58. Once installed, your agent responds to:
  59. ```
  60. "Send me a selfie"
  61. "Send a pic wearing a cowboy hat"
  62. "What are you doing right now?"
  63. "Show me you at a coffee shop"
  64. ```
  65. ## Reference Image
  66. The skill uses a fixed reference image hosted on CDN:
  67. ```
  68. https://cdn.jsdelivr.net/gh/SumeLabs/clawra@main/assets/clawra.png
  69. ```
  70. This ensures consistent appearance across all generated images.
  71. ## Technical Details
  72. - **Image Generation**: xAI Grok Imagine via fal.ai
  73. - **Messaging**: OpenClaw Gateway API
  74. - **Supported Platforms**: Discord, Telegram, WhatsApp, Slack, Signal, MS Teams
  75. ## Project Structure
  76. ```
  77. clawra/
  78. ├── bin/
  79. │ └── cli.js # npx installer
  80. ├── skill/
  81. │ ├── SKILL.md # Skill definition
  82. │ ├── scripts/ # Generation scripts
  83. │ └── assets/ # Reference image
  84. ├── templates/
  85. │ └── soul-injection.md # Persona template
  86. └── package.json
  87. ```
  88. ## License
  89. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.