← 返回 Skills 市场
damirikys

Demo Slap

作者 Damir Armanov · GitHub ↗ · v0.1.4 · MIT-0
cross-platform ✓ 安全检测通过
432
总下载
1
收藏
0
当前安装
7
版本数
在 OpenClaw 中安装
/install demo-slap
功能描述
Generate CS2 highlights and fragmovies from demos using the Demo-Slap API, with optional Leetify integration and Demo-Slap match history fallback to select r...
使用说明 (SKILL.md)

Demo-Slap Highlight Skill

Generate MP4 highlights and fragmovies from CS2 demos.

This skill is designed for OpenClaw environments where background jobs, local helper scripts, and chat-aware delivery are available. It uses Python 3 scripts and the requests package for HTTP API access.

Expected runtime inputs:

  • Required: DEMOSLAP_API_KEY
  • Optional: LEETIFY_API_KEY
  • Optional deployment helper: DEMO_SLAP_WATCHDOG_JOB_ID

Scripts

Run bundled scripts relative to the skill root, usually from scripts/.

Demo-Slap

Script Purpose
demo_slap_matches.py List recent matches from Demo-Slap /public-api/matches
demo_slap_resolve.py Try to resolve replay/demo URL from Demo-Slap match history by index; fail clearly if the API exposes only jobId
demo_slap_match_pick.py Pick a Demo-Slap match by index and return structured match info including jobId
demo_slap_analyze.py Submit a demo for analysis, poll until done, output highlights JSON
demo_slap_render.py Render one or more highlights, poll until done, output clip URL
demo_slap_common.py Shared utilities (config, API calls, state)

Leetify

Script Purpose
leetify/leetify_matches.py List recent matches
leetify/leetify_resolve.py Resolve replay URL by username + match index
leetify/leetify_save_id.py Save username -> Steam64 ID mapping
leetify/leetify_common.py Shared Leetify utilities

Match source selection

  • Prefer Leetify for recent match discovery when LEETIFY_API_KEY is available.
  • If LEETIFY_API_KEY is not configured but DEMOSLAP_API_KEY is available, use Demo-Slap match history from /public-api/matches.
  • Swagger: https://api-doc.demo-slap.net/
  • Treat Demo-Slap match history as the fallback discovery path for listing matches and selecting an existing analyzed match or replay context before analyze/render.

Runtime files

Use these files as optional local runtime state during execution:

  • data/state.json
  • data/highlights.json
  • data/history.log
  • data/steam_ids.json
  • data/config.json

These files are runtime helpers for local operation and are not required to understand or inspect the skill package itself.

state.json tracks the current operation:

{
  "status": "idle|analyzing|rendering|done|error",
  "job_id": "...",
  "render_job_id": "...",
  "chat_id": "telegram:182314856",
  "clip_urls": {"highlight_id": "https://..."},
  "progress": "polling 3/30",
  "last_completed_op": "analyze|render",
  "notification": {
    "sent": false,
    "sent_at": null,
    "last_attempt_at": null,
    "error": null
  },
  "updated_at": "ISO timestamp"
}

Workflow

1. Find the match

Preferred path when LEETIFY_API_KEY is available:

python3 scripts/leetify/leetify_matches.py \x3CUSERNAME> [--limit 10]

Fallback path when LEETIFY_API_KEY is missing but DEMOSLAP_API_KEY is available:

python3 scripts/demo_slap_matches.py [\x3CUSERNAME>] [--limit 10]
  • uses Demo-Slap /public-api/matches
  • use the Demo-Slap swagger docs at https://api-doc.demo-slap.net/ if schema details are needed
  • if \x3CUSERNAME> is provided and mapped, filter matches to that player's Steam ID when possible
  • after the user picks a match, run:
python3 scripts/demo_slap_match_pick.py [\x3CUSERNAME>] --match-index \x3CN>
  • treat the returned jobId as the primary handle for downstream Demo-Slap operations

2. Resolve replay URL

Preferred path when using Leetify:

python3 scripts/leetify/leetify_resolve.py \x3CUSERNAME> --match-index \x3CN>

When using Demo-Slap fallback:

python3 scripts/demo_slap_match_pick.py [\x3CUSERNAME>] --match-index \x3CN>
  • use the returned jobId as the selected match identifier
  • if demoUrl is present, you may still use analyze-by-URL
  • if demoUrl is absent, skip URL resolution and continue by API endpoints that accept the existing analyze jobId
  • use GET /public-api/analyze/{jobId}/status and GET /public-api/analyze/{jobId}/data to inspect existing highlights
  • if the user wants clips and highlights already exist, render directly from that jobId

3. Analyze in background

python3 -u scripts/demo_slap_analyze.py --url '\x3CREPLAY_URL>' --username \x3CUSERNAME> --chat-id \x3CCHAT_ID>

Run with exec(background: true) and keep the returned process/session id.

Optional deployment-specific watchdog pattern for OpenClaw environments:

  • Use a watchdog only when background analyze/render work benefits from periodic delivery checks.
  • Reuse an existing deployment watchdog when available instead of assuming a new persistent scheduler entry is always needed.
  • If a deployment chooses to create or enable a watchdog through the built-in cron tool, keep it scoped to the active run and disable it again after terminal delivery.
  • A 2 minute interval is a reasonable default.
  • Use scripts/demo_slap_watchdog.sh status|tail|job only as a local helper for inspecting runtime state, logs, or deployment-specific job references.
  • Treat data/state.json and data/highlights.json as the source of truth during runtime.

Agent workflow:

  1. Choose the match source:
    • Leetify if LEETIFY_API_KEY exists
    • Demo-Slap /public-api/matches if LEETIFY_API_KEY is missing and DEMOSLAP_API_KEY exists
  2. If using Leetify, resolve the replay URL and run analyze
  3. If using Demo-Slap fallback, pick a match and inspect the returned jobId
  4. If the selected Demo-Slap match already has analyze data, continue by jobId instead of forcing analyze-by-URL
  5. Use or enable a deployment watchdog only when long-running analyze/render work benefits from it
  6. Launch analyze or render and save the returned process/session id when applicable
  7. Let the watchdog deliver the result when a deployment uses one
  8. Disable the watchdog again after terminal delivery

4. Render in background

# Single highlight
python3 -u scripts/demo_slap_render.py \x3CJOB_ID> \x3CHIGHLIGHT_ID> --chat-id \x3CCHAT_ID>

# Fragmovie
python3 -u scripts/demo_slap_render.py \x3CJOB_ID> \x3CID1> \x3CID2> ... --fragmovie --chat-id \x3CCHAT_ID>

Run with exec(background: true) and keep the returned process/session id.

Optional deployment-specific watchdog pattern for OpenClaw environments:

  • Use a watchdog only when background analyze/render work benefits from periodic delivery checks.
  • Reuse an existing deployment watchdog when available instead of assuming a new persistent scheduler entry is always needed.
  • If a deployment chooses to create or enable a watchdog through the built-in cron tool, keep it scoped to the active run and disable it again after terminal delivery.
  • A 2 minute interval is a reasonable default.
  • Use scripts/demo_slap_watchdog.sh status|tail|job only as a local helper for inspecting runtime state, logs, or deployment-specific job references.
  • Treat data/state.json and data/highlights.json as the source of truth during runtime.

Agent workflow:

  1. Enable or reuse a deployment watchdog only when needed for the active run
  2. Launch render and save the returned process/session id
  3. Poll process output for the Estimated finish: line and tell the user the ETA if present
  4. Let the watchdog deliver the result when one is in use
  5. Disable the watchdog again after terminal delivery

Critical: set \x3CCHAT_ID> from inbound metadata of the originating request. Treat hardcoded chat identifiers as local examples only, not as a reusable default.

5. Check status

Read data/state.json.

Setup

Map username to Steam ID

python3 scripts/leetify/leetify_save_id.py \x3CUSERNAME> \x3CSTEAM_64_ID>

Configure API keys

Prefer environment variables:

  • DEMOSLAP_API_KEY - required
  • LEETIFY_API_KEY - optional, only for Leetify-backed match discovery
  • DEMO_SLAP_WATCHDOG_JOB_ID - optional deployment-specific helper for watchdog inspection scripts

Source selection rules:

  • If LEETIFY_API_KEY exists, use Leetify for match discovery.
  • If LEETIFY_API_KEY is absent but DEMOSLAP_API_KEY exists, use Demo-Slap /public-api/matches for match discovery.
  • DEMOSLAP_API_KEY is always required for analyze/render.

Optional local fallback for controlled self-hosted setups: put them in data/config.json.

Support

For access and support, please join our Discord community: https://discord.gg/8nfh26W9wQ

安全使用建议
This skill appears coherent with its purpose. Before installing: ensure you trust the Demo‑Slap and Leetify endpoints (api.demo-slap.net and api-public.cs-prod.leetify.com), provide a valid DEMOSLAP_API_KEY (and LEETIFY_API_KEY only if you want that integration), and confirm the runtime has python3 and the Python requests package available. The scripts call the local 'openclaw' binary to emit system events/watchdog actions, so verify that running openclaw commands from the agent is acceptable in your environment. Also be aware the skill writes small state files under data/ (state.json, highlights.json, history.log); if you need stricter isolation, run it in a sandboxed deployment or inspect/clear those files after runs.
功能分析
Type: OpenClaw Skill Name: demo-slap Version: 0.1.4 The skill bundle provides a legitimate integration for generating Counter-Strike 2 highlights and fragmovies using the Demo-Slap and Leetify APIs. The scripts (e.g., demo_slap_analyze.py, demo_slap_render.py) follow a standard pattern of submitting requests to official API endpoints (api.demo-slap.net and leetify.com), polling for status, and managing local state in a data/ directory. While the workflow involves high-privilege operations like using a 'watchdog' via the system cron and executing 'openclaw' system events via subprocess, these are clearly documented as necessary for handling long-running video rendering tasks and include instructions for the agent to disable them upon completion.
能力评估
Purpose & Capability
Name/description (Demo‑Slap highlights/fragmovies) align with the included scripts and the single required credential DEMOSLAP_API_KEY. The optional LEETIFY_API_KEY usage is documented and sensible. Required binaries (python3 and openclaw) are used by the scripts (Python to run scripts; openclaw to emit system events/watchdog hooks).
Instruction Scope
SKILL.md and scripts restrict activity to: calling Demo‑Slap and Leetify APIs, polling job status, writing small local state files under data/, and optionally invoking openclaw system event/cron helpers. There are no instructions to read arbitrary system files, exfiltrate unrelated secrets, or contact unexpected external endpoints.
Install Mechanism
No install spec (instruction-only) — the package includes runnable Python scripts (no network installs). One practical omission: Python dependencies (requests) are used but not documented as an install step; the environment must already provide the requests package or the operator must install it.
Credentials
Only DEMOSLAP_API_KEY is required. LEETIFY_API_KEY and DEMO_SLAP_WATCHDOG_JOB_ID are optional and justified by the fallback and watchdog behaviors. The scripts also read local config/data files in the skill's data/ directory (config.json, steam_ids.json) — these are reasonable local state, not broad system credentials.
Persistence & Privilege
Skill does not request always:true and does not modify other skills or system-wide agent settings. It persists small runtime files under its own data/ directory and optionally suggests using the deployment's cron/watchdog; those are scoped to the skill and documented.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install demo-slap
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /demo-slap 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.4
Metadata/docs cleanup: documented optional Leetify and watchdog env inputs explicitly, clarified deployment-provided watchdog job id, and polished runtime requirements text.
v0.1.3
Security wording cleanup: made Leetify truly optional in metadata, removed hardcoded watchdog job id and absolute paths, and reframed watchdog guidance as deployment-specific.
v0.1.2
Refined public wording: clarified OpenClaw runtime assumptions, declared Leetify env/bin context, and softened watchdog/runtime guidance without changing functionality.
v0.1.1
ClawHub cleanup: removed runtime data files and pycache, restored runtime requirements metadata, and cleaned SKILL.md paths/docs.
v0.1.0
Initial public release: Demo-Slap highlights/fragmovies skill with Leetify integration and Demo-Slap match history fallback.
v1.0.1
Added metadata requirements (DEMOSLAP_API_KEY, ffmpeg)
v1.0.0
Initial release
元数据
Slug demo-slap
版本 0.1.4
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 7
常见问题

Demo Slap 是什么?

Generate CS2 highlights and fragmovies from demos using the Demo-Slap API, with optional Leetify integration and Demo-Slap match history fallback to select r... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 432 次。

如何安装 Demo Slap?

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

Demo Slap 是免费的吗?

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

Demo Slap 支持哪些平台?

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

谁开发了 Demo Slap?

由 Damir Armanov(@damirikys)开发并维护,当前版本 v0.1.4。

💬 留言讨论