← 返回 Skills 市场
nissan

Demo Precacher

作者 Nissan Dookeran · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
347
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install demo-precacher
功能描述
Pre-generate and cache all demo content before live presentations — hit every API endpoint in advance, verify playback, report coverage gaps. Use before hack...
使用说明 (SKILL.md)

Demo Precacher

The golden rule of AI demos: never rely on live API calls during a presentation. This skill provides a systematic approach to pre-generating and verifying all demo content before you go live.

Why This Exists

In a 48-hour hackathon, we had 18 stories across 10 languages with audio narration, sound effects, and background music. During the demo, the Mistral API had a 3-second latency spike. Because everything was pre-cached, the demo played flawlessly from cache while the audience assumed it was generating in real-time.

The Pattern

async def precache_demo():
    scenarios = [
        {"name": "Sophie", "language": "fr", "prompt": "A story about cloud whales..."},
        {"name": "Kai", "language": "ja", "prompt": "A story about bamboo forests..."},
    ]
    
    for s in scenarios:
        # Step 1: Generate content (hits the real API)
        story = await generate_story(s["prompt"], s["name"], s["language"])
        
        # Step 2: Cache the result
        await cache.set(s, story)
        
        # Step 3: Generate all derived content (audio, images)
        for scene in story["scenes"]:
            audio = await generate_tts(scene["text"], voice_id)
            await cache.set(f"audio_{scene['id']}", audio)
        
        # Step 4: Verify playback
        cached = await cache.get(s)
        assert cached is not None, f"Cache miss for {s['name']}"
    
    # Step 5: Report coverage
    print(f"Cached {len(scenarios)} scenarios, all verified ✅")

Checklist

Before any live demo, verify:

  • All primary scenarios cached and verified
  • Audio files playable (correct format, no corruption)
  • Fallback content available if cache miss occurs
  • Demo account credentials working
  • Network not required for cached playback
  • Cache TTL won't expire during the presentation

Files

  • scripts/precache_demo.py — Example precacher with verification and coverage reporting
安全使用建议
This skill generally does what it says: call your LLM/TTS/SFX/image APIs, encode outputs, and save them in Turso. Before installing or running it: (1) Verify and be comfortable with the three declared secrets; provide a Turso token with least privilege and verify the target TURSO_URL is correct (the script currently uses a placeholder). (2) Note that the script optionally uses GEMINI_API_KEY for image generation but that key is not declared — if you don't want image generation enabled, leave GEMINI_API_KEY unset so the script will skip it. (3) The script requires Python and third-party packages (httpx, mistralai, google.generativeai) — run it in an isolated environment (sandbox or container) and install only the needed deps. (4) Review the code yourself (or run in a safe test account) to ensure no unexpected endpoints or behaviors are present before supplying real credentials.
功能分析
Type: OpenClaw Skill Name: demo-precacher Version: 1.0.1 The skill bundle is designed to pre-generate and cache AI content (audio, text, images) using ElevenLabs, Mistral, and Gemini APIs, storing the results in a Turso database to avoid latency during live demos. The code in scripts/precache_demo.py aligns perfectly with the documentation in SKILL.md, and the use of base64 encoding is appropriately limited to handling binary audio data for storage. No indicators of data exfiltration, unauthorized execution, or malicious intent were found.
能力评估
Purpose & Capability
Name/description align with the behavior: the script generates stories (Mistral), TTS/SFX (ElevenLabs), and stores cached assets in a Turso DB. The required env vars (ELEVENLABS_API_KEY, MISTRAL_API_KEY, TURSO_AUTH_TOKEN) are reasonable for that purpose.
Instruction Scope
SKILL.md and script instruct the agent to call external APIs (Mistral, ElevenLabs, optionally Gemini) and to write generated content to Turso. The instructions do not read unrelated local files or attempt to modify other skills. However, the included Python script references GEMINI_API_KEY for image generation even though that key is not declared in the skill metadata.
Install Mechanism
No install spec (instruction-only) — lower install risk. The shipped script imports httpx, mistralai, and google.generativeai; these dependencies and a Python runtime are not declared. That means the environment running this script must already have these libraries, or the operator must install them — a missing declaration to be aware of.
Credentials
The declared environment variables (ELEVENLABS_API_KEY, MISTRAL_API_KEY, TURSO_AUTH_TOKEN) are proportional to the stated functionality. However, the script optionally reads GEMINI_API_KEY (via os.environ.get) but GEMINI_API_KEY is not listed as a required env var in the skill metadata. Also, TURSO_AUTH_TOKEN grants write access to a database; ensure you provide a token with minimum required scope and that storing base64-encoded audio/images in your Turso DB is acceptable.
Persistence & Privilege
always is false and the skill does not request persistent platform privileges. It performs network calls and writes to a user-provided Turso DB only, which is consistent with its stated job.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install demo-precacher
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /demo-precacher 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Added TURSO_AUTH_TOKEN to required environment variables. - Updated metadata formatting and structure. - Included a security note about base64 usage for encoding cached binary content. - Changed the metadata emoji from 🏃 to 🏃 (now specified as a Unicode character, not escaped).
v1.0.0
- Initial release of demo-precacher (v1.0.0). - Pre-generates and caches all demo content before live presentations. - Supports advance content generation for audio, images, and text by hitting API endpoints before the demo. - Verifies cache completeness and playback, with coverage reporting and checklist guidance. - Requires API keys for ElevenLabs and Mistral. - Designed to prevent live demo interruptions caused by external API latency or downtime.
元数据
Slug demo-precacher
版本 1.0.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 2
常见问题

Demo Precacher 是什么?

Pre-generate and cache all demo content before live presentations — hit every API endpoint in advance, verify playback, report coverage gaps. Use before hack... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 347 次。

如何安装 Demo Precacher?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install demo-precacher」即可一键安装,无需额外配置。

Demo Precacher 是免费的吗?

是的,Demo Precacher 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Demo Precacher 支持哪些平台?

Demo Precacher 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Demo Precacher?

由 Nissan Dookeran(@nissan)开发并维护,当前版本 v1.0.1。

💬 留言讨论