# TOOLS.md - Local Notes

Skills define _how_ tools work. This file is for _your_ specifics — the stuff that's unique to your setup.

## What Goes Here

Things like:

- Camera names and locations
- SSH hosts and aliases
- Preferred voices for TTS
- Speaker/room names
- Device nicknames
- Anything environment-specific

## Examples

```markdown
### Cameras

- living-room → Main area, 180° wide angle
- front-door → Entrance, motion-triggered

### SSH

- home-server → 192.168.1.100, user: admin

### TTS

- Preferred voice: "Nova" (warm, slightly British)
- Default speaker: Kitchen HomePod
```

## Why Separate?

Skills are shared. Your setup is yours. Keeping them apart means you can update skills without losing your notes, and share skills without leaking your infrastructure.

---

## Image Generation
- **Always use:** `nano-banana-pro` skill (Gemini API) for image generation
- **Never use:** OpenAI image API
- **Default model:** `gemini-3.1-flash-image-preview` (**Nano Banana 2** — faster + sharper than Pro, updated 2026-02-26)
- **Command:** `uv run /usr/local/lib/node_modules/openclaw/skills/nano-banana-pro/scripts/generate_image.py`

### Nano Banana Prompt Framework (Official — @GeminiApp, April 2026)

Structure every prompt with these 6 dimensions. More specificity = better output.

| Dimension | Question | Example |
|-----------|----------|---------|
| **Subject** | Who or what is in the image? | A fluffy calico cat |
| **Composition** | How is the shot framed? | Extreme close-up |
| **Action** | What is happening? | Brewing a cup of coffee |
| **Location** | Where does the scene take place? | A sunny meadow |
| **Style** | What is the overall aesthetic? | Watercolor painting |
| **Editing Instructions** | *(edit mode only)* What to change? | Remove the car in the background |

**Prompt template:** `[Subject], [Composition], [Action], [Location], [Style]`

**Tips:**
- Lead with Subject — model anchors on the first noun
- Composition + Style have the biggest impact on final look; always specify both
- Edits: be direct — "Remove the car in the background" beats "clean up the background"
- One dominant style; avoid stacking conflicting aesthetics

## Skills

### arxiv-scout
- **Installed:** 2026-02-28
- **Location:** `/usr/local/lib/node_modules/openclaw/skills/arxiv-scout/`
- **Purpose:** Fetch + rank recent arXiv papers in AI, bio, health by Bo's interests
- **Run:** `python3 /usr/local/lib/node_modules/openclaw/skills/arxiv-scout/scripts/arxiv_scout.py --days 7 --top 10`
- **Flags:** `--days N` (lookback), `--top N` (results), `--fetch N` (pool size), `--min-score N`

### star-office-ui
- **Installed:** 2026-02-26
- **Location:** `/Users/bowang/.openclaw/workspace/star-office-ui/`
- **Source:** https://github.com/ringhyacinth/Star-Office-UI
- **Purpose:** Live pixel office UI — Moon walks between desk and break room based on state
- **Start server:** `cd /Users/bowang/.openclaw/workspace/star-office-ui/backend && python3 app.py`
- **Update state:** `python3 /Users/bowang/.openclaw/workspace/star-office-ui/set_state.py <state> "detail"`
  - States: `idle`, `writing`, `researching`, `executing`, `syncing`, `error`
- **URL:** `http://192.168.68.59:18791` (LAN) / `http://127.0.0.1:18791` (local)

### xiaohongshuskills ✅ (installed 2026-03-02)
- **Location:** `/usr/local/lib/node_modules/openclaw/skills/xiaohongshuskills/`
- **Purpose:** Automate Xiaohongshu/RedNote — publish posts, search trends, scrape analytics, post comments
- **Key scripts:**
  - `scripts/chrome_launcher.py` — launch CDP Chrome window
  - `scripts/cdp_publish.py` — main controller (search, publish, analytics)
  - `scripts/publish_pipeline.py` — image/video publish pipeline
- **First-time setup:**
  1. `python3 scripts/chrome_launcher.py` (opens Chrome window)
  2. `python3 scripts/cdp_publish.py login` (scan QR to log in)
- **Trend search:** `python3 scripts/cdp_publish.py search-feeds --keyword "AI" --sort-by 最新`
- **Analytics export:** `python3 scripts/cdp_publish.py content-data --csv-file /path/to/out.csv`
- **⚠️ Security note:** VirusTotal flagged suspicious (medium); has full Chrome profile access — use dedicated Chrome profile

### x-tweet-fetcher
- **Installed:** 2026-02-21
- **Location:** `/usr/local/lib/node_modules/openclaw/skills/x-tweet-fetcher/`
- **Source:** https://github.com/ythx-101/x-tweet-fetcher
- **Purpose:** Fetch tweets, stats, media from X/Twitter — zero API key needed
- **Engine:** FxTwitter public API
- **Basic usage:**
  ```bash
  python3 scripts/fetch_tweet.py --url "https://x.com/user/status/ID" --text-only
  python3 scripts/fetch_tweet.py --url "https://x.com/user/status/ID" --pretty
  ```
- **What it fetches:** Full text, likes, retweets, bookmarks, views, replies count, images
- **Advanced features (require Camofox):** Reply threads, user timelines, Chinese platforms
- **Tested & working** ✅ (tested 2026-02-21 with real tweets)

---

### gws (Google Workspace CLI) ✅ (installed 2026-03-05)
- **Binary:** `gws` (v0.3.5, `npm install -g @googleworkspace/cli`)
- **Auth account:** moon.clawdbot@gmail.com (7 scopes: Drive, Sheets, Gmail, Calendar, Docs, Slides, Tasks)
- **Credentials:** `~/Library/Application Support/gws/credentials.enc` (AES-256-GCM)
- **Client config:** `~/Library/Application Support/gws/client_secret.json` (project: moon-assistant-485417)
- **Skills symlinked:** gws-gmail, gws-calendar, gws-drive, gws-docs, gws-sheets, gws-slides, gws-tasks, gws-meet, gws-people, gws-keep, gws-chat + workflows/recipes (28 total)
- **Skills source:** `/Users/bowang/.openclaw/workspace/gws-cli/skills/`
- **Syntax:** `gws <service> <resource> [sub-resource] <method> --params '{"key": "val"}'`
- **Examples:**
  - Gmail: `gws gmail users messages list --params '{"userId": "me", "q": "newer_than:1d", "maxResults": 5}'`
  - Drive: `gws drive files list --params '{"pageSize": 10}'`
  - Calendar: `gws calendar events list --params '{"calendarId": "primary", "maxResults": 5}'`
  - Docs create: `gws docs documents create --json '{"title": "My Doc"}'`
  - Tasks: `gws tasks tasklists list --params '{}'`
- **⚠️ Note:** moon.clawdbot@gmail.com is Moon's own Gmail, not Bo's personal account

### web-scraper ✅ (installed 2026-03-04)
- **Location:** `/usr/local/lib/node_modules/openclaw/skills/web-scraper/`
- **Purpose:** Adaptive web scraping via Scrapling — bypasses Cloudflare, anti-bot, CAPTCHAs without proxies
- **Run:** `uv run --with "scrapling[all]" python3 /usr/local/lib/node_modules/openclaw/skills/web-scraper/scripts/scrape.py --url <URL> [options]`
- **Modes:** `--mode text` (default) | `--mode html` | `--mode json` | `--mode links`
- **Fetchers:** default (fast) | `--stealth` (Cloudflare bypass) | `--dynamic` (JS-rendered)
- **CSS extraction:** `--css "h1, .content"` 
- **Save to file:** `--out output.txt`
- **Full crawls:** See `references/spider.md` for Spider API (concurrency, pause/resume, proxy rotation)

---

Add whatever helps you do your job. This is your cheat sheet.
