Skip to main content
ClaudeWave
Skill3.1k estrellas del repoactualizado 1mo ago

libtv-video

libtv-video generates images and videos via the Seedance 2.0 model and other AI engines through a unified LibTV Gateway interface. Use it to create text-to-image, image-to-video, text-to-video, and style transfer outputs, with results automatically delivered to Feishu chats. Supports both Nexu-managed keys (mgk_...) and direct LibTV keys (sk-libtv-...) for flexible API access.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/nexu-io/nexu /tmp/libtv-video && cp -r /tmp/libtv-video/apps/desktop/static/bundled-skills/libtv-video ~/.claude/skills/libtv-video
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# LibTV - Image & Video Generation (Seedance 2.0)

Generate AI **images** and **videos** through one bundled LibTV skill, powered by Seedance 2.0. Supports text-to-image, image-to-image, text-to-video, and image-to-video workflows, via both Nexu-managed Seedance execution and direct LibTV execution with a user-owned `sk-libtv-...` key.

Key routing:

- `mgk_...` keys use Nexu-managed Seedance through `https://seedance.nexu.io/`
- `sk-libtv-...` keys use direct LibTV OpenAPI through `https://im.liblib.tv`

Delivery architecture (currently Feishu only):
- `create-session` captures `OPENCLAW_CHANNEL_TYPE` + `OPENCLAW_CHAT_ID`,
  persists them as the session's `delivery` block, forks a detached
  `wait-and-deliver` background process via `subprocess.Popen(...,
  start_new_session=True)`, and returns immediately with a single-line
  JSON submit confirmation on stdout.
- The forked waiter polls the upstream LibTV API (Seedance gateway or
  direct LibTV) and, on terminal success, shells out to
  `feishu_send_video.py` — the same proven helper used by `medeo-video` —
  which downloads each result URL, uploads it to Feishu's file API, and
  posts a native media message to the originating chat.
- The waiter's output is captured in `$NEXU_HOME/libtv-waiter-<id>.log`
  for post-hoc debugging. A `delivered_at` timestamp is persisted when
  the Feishu helper reports success, so re-invoking `wait-and-deliver`
  on a delivered session is a safe no-op.

No `sessions_spawn`, no subagent model-speech contract, no HTTP
notification callback, no stale routing fields. Delivery is a direct
HTTP call using stable per-user identifiers (`open_id` / `chat_id`)
that never go stale the way the old `account_id` did.

Multi-channel support is a follow-up: adding Discord / Slack / WeChat
means dropping a new `<channel>_send_video.py` helper next to
`feishu_send_video.py` and adding one branch in `_deliver_results`.

## Requirements

- Python 3.8+
- `apiKey` configured in `~/.nexu/libtv.json`
- default `videoRatio` configured in `~/.nexu/libtv.json` or implicit default `16:9`
- `mgk_...` keys target `https://seedance.nexu.io/`
- `sk-libtv-...` keys target `https://im.liblib.tv`

## First-Time Setup

If the user has not configured an API Key, guide them to:
1. Choose the correct key type:
   - Nexu-managed key: `mgk_...`
   - personal LibTV key: `sk-libtv-...`
2. Run: `python3 scripts/libtv_video.py setup --api-key <your_key> --video-ratio 16:9`
3. Run: `python3 scripts/libtv_video.py check` to confirm the configuration is correct

To change only the default ratio later:

```bash
python3 scripts/libtv_video.py update-ratio --video-ratio 9:16
```

## Pre-Generation Check (must run before each generation)

1. Run `python3 scripts/libtv_video.py check`
2. Interpret the output:
   - "API Key not configured" → guide the user to contact the admin for a key, then run setup
   - Nexu-managed key valid with remaining uses → proceed with generation
   - direct LibTV key configured → proceed with generation
   - "Key expired / exhausted" → guide the user to contact the admin, run update-key
   - "Cannot connect to gateway" or "Cannot connect to direct LibTV API" → suggest checking network connectivity
3. Only proceed with generation after check passes

## Core Principle: Relay, Don't Create

You are a **messenger**, not a creator. The backend agent handles model selection, prompt engineering, and workflow orchestration. Your job is three things only:

1. **Upload**: User provides a local file → `upload` to get OSS URL
2. **Relay**: Pass the user's original description + OSS URL verbatim to `create-session`
3. **Collect**: Poll for results → download → present to user

**Never do these:**
- Don't rewrite, expand, translate, or embellish the user's prompt
- Don't break tasks into multiple sessions (e.g. don't split "generate 9 storyboards" into 9 calls)
- Don't add your own prompt engineering (e.g. "ultra-realistic, cinematic lighting, 8K")
- Don't arrange shots, plan storylines, or analyze styles yourself

## Video / Image Generation (async, non-blocking)

### CRITICAL: always pass `--channel` and `--chat-id`

Before running `create-session` you **must** extract the originating
channel and the user's stable identifier from the inbound message
metadata block and pass them as CLI args. Without these the background
waiter cannot deliver the finished video back to the user automatically;
the user will have to ask for the result manually.

- For **Feishu**: the inbound user message has an `untrusted metadata`
  JSON block containing `sender_id`. That value is the stable `open_id`
  (always starts with `ou_`). Pass it as `--chat-id` and pass
  `--channel feishu`.

Example extraction and invocation:

```text
Conversation info (untrusted metadata):
{
  "message_id": "om_x100...",
  "sender_id": "ou_33314772052f837a3cb2f919aa4605de",
  ...
}
```

becomes:

```bash
python3 scripts/libtv_video.py create-session "user's video description" \
  --channel feishu \
  --chat-id ou_33314772052f837a3cb2f919aa4605de
```

The `stdout` JSON returned by `create-session` includes a `deliverable`
flag. If it is `false`, your `--channel` / `--chat-id` were missing and
the user will have to ask you for the result later.

### Text-Only Generation

```bash
python3 scripts/libtv_video.py create-session "user's video description" \
  --channel feishu --chat-id <ou_xxx from inbound metadata>
```

Message rules:

- Nexu-managed `mgk_...` mode appends the Seedance 2.0 hint unless the user already chose a model
- direct `sk-libtv-...` mode follows the upstream relay discipline and does not add the Seedance model hint
- both modes relay the configured video ratio, defaulting to `16:9`

### Image+Text Generation (image-to-video)

```bash
# 1. Upload the image first
python3 scripts/libtv_video.py upload --file /path/to/image.png
# Output: url=https://libtv-res.liblib.art/...

# 2. Create session with the image URL in the message
python3 scripts/libtv_video.py create-se
process-pr-reviewsSkill

Use when the user asks to process, triage, fetch, view, count, list, or resolve review feedback in a GitHub PR. Supports both CodeRabbit and Codex review workflows. In this workflow, “real review feedback” is strictly defined as actionable inline comments; for CodeRabbit, exclude review summaries and nitpicks, and for Codex, exclude review summary cards and use PR main-thread reactions only as status signals.

clawhubSkill

Use the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawhub CLI.

coding-agentSkill

Delegate coding tasks to Codex, Claude Code, or Pi agents via background process. Use when: (1) building/creating new features or apps, (2) reviewing PRs (spawn in temp dir), (3) refactoring large codebases, (4) iterative coding that needs file exploration. NOT for: simple one-liner fixes (just edit), reading code (use read tool), thread-bound ACP harness requests in chat (for example spawn/run Codex or Claude Code in a Discord thread; use sessions_spawn with runtime:"acp"), or any work in ~/clawd workspace (never spawn agents here). Claude Code: use --print --permission-mode bypassPermissions (no PTY). Codex/Pi/OpenCode: pty:true required.

deep-researchSkill

|

gh-issuesSkill

Fetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]

nano-banana-one-shopSkill

All-in-one image generation with Gemini models. Supports Nano Banana (3.1 Flash), Nano Banana Pro (3 Pro), and Nano Banana 2 (2.5 Flash). Triggers on "generate image", "image generation", "nano banana", "edit image".

qiaomu-mondo-poster-designSkill

一句话生成大师级海报、书籍封面、专辑封面和各类设计作品。无需懂PS、配色或艺术史,AI自动选择最佳风格(基于33+位传奇设计师)。支持多平台多比例:公众号封面(21:9)、小红书配图(3:4)、文章配图(16:9)、书籍封面(9:16)、专辑封面(1:1)、电影海报(9:16)。包含AI提示词优化、风格对比、图生图转换功能。触发词:"Mondo风格"、"书籍封面设计"、"专辑封面"、"海报设计"、"读书笔记配图"、"公众号封面"、"小红书配图"、"文章配图"。One-sentence generation of master-level posters, book covers, album covers and designs. 33+ legendary designer styles with multi-platform aspect ratio support (21:9, 16:9, 3:4, 1:1, 9:16).

research-to-diagramSkill

深度调研主题并自动生成知识关系图谱PDF。接收研究主题后自动进行网络调研、信息收集、知识整理,最终生成专业的可视化关系图谱。适用于"研究...并做图"、"深度分析...并可视化"、"生成知识图谱"等场景。