Token导航 LogoToken导航

Agent Skill · 开发规范

jclaw-polling-best-practices(jclaw 民意调查最佳实践)

jclaw-polling-best-practices 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 OpenClaw 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

jclaw-polling-best-practices 是开发规范类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为执行命令;许可证为 MIT-0,第三方扫描有提醒项,按安装量在开发规范类的 1,265 个 Skill 里排第 336。

总安装 2,889周安装 118GitHub Stars 公开资料未说明下载 935核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
2.0.0

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:jclaw-polling-best-practices(jclaw 民意调查最佳实践)
来源仓库:https://github.com/skywalker-lili/jclaw-polling-best-practices
安装命令:
openclaw skills install jclaw-polling-best-practices
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install jclaw-polling-best-practices

这个 Skill 是做什么的

开发规范类 Skill 用来统一代码风格、目录结构和评审口径,产出多为检查清单或改写建议。

采用 cron 式轮询机制处理长时间异步任务的自动化管理工具。适用于监控后台 CLI 命令执行状态或定期轮询 API 接口的场景。可设置定时检查点并记录任务进度,确保关键操作不遗漏。

安装命令:openclaw skills install jclaw-polling-best-practices,通过 clawhub 安装。需配置系统定时任务权限,避免与其他进程产生资源冲突。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install jclaw-polling-best-practices;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

jclaw-polling-best-practices 怎么安装?

在终端执行 openclaw skills install jclaw-polling-best-practices。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

jclaw-polling-best-practices 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

jclaw-polling-best-practices 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 openclaw skills install jclaw-polling-best-practices 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

jclaw-polling-best-practices 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

jclaw-polling-best-practices 用的人多吗?

公开数据是累计安装 2,889 次,近一周安装 118 次,下载 935 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

jclaw-polling-best-practices 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理开发规范类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发规范类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
vercel-react-best-practices

Vercel React 最佳实践 · Codex、Claude

8,490,72025,918操作浏览器MIT通过
web-design-guidelines

网页设计指南 · Codex、Claude

6,686,01625,885需要联网MIT有提醒
remotion-best-practices

Remotion 最佳实践 · Codex、Claude

6,505,6323,027操作浏览器MIT有提醒
supabase-postgres-best-practices

Supabase Postgres 最佳实践 · Codex、Claude

3,175,5232,030需要联网MIT通过
next-best-practices

Next.js 最佳实践 · Codex、Claude

1,848,240841操作浏览器MIT通过
jclaw-polling-best-practices

jclaw 民意调查最佳实践 · 本页

2,889—执行命令MIT-0有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
polling-best-practices
description
Best practices for automating long-running, asynchronous tasks via cron-style polling. Use when the user wants to monitor a background CLI command or API call that does not return an immediate result — such as waiting for a report to generate, a podcast to be created, a deep research job to complete, or any task with a clear completion condition. Triggers on requests like "monitor X until done", "poll for Y", "wait for Z to complete in the background", "run X in the background and notify me when ready", "long-running task automation", "async task monitor". This skill is NOT for tasks requiring real-time interaction, complex LLM judgment during execution, or streaming output. It is a guidance-only skill — it does not install scripts or tools; the agent applies these principles manually based on the guidance here. A template polling script is provided in the scripts/ directory for convenience.

Polling Best Practices

A guidance-style skill for automating long-running, asynchronous tasks using a cron-compatible polling pattern. When a task cannot complete synchronously (e.g., a CLI command that triggers a background job and returns a job ID), this skill guides the agent through: (1) deciding whether polling is appropriate, (2) pre-flight confirmation with the user, (3) setting up a task directory, (4) writing the polling script, (5) launching the background job, and (6) monitoring it to completion or timeout.

Language: All confirmation messages to the user should be written in the user's current session language (check the session language — if the user is writing in Chinese, reply in Chinese; if in English, reply in English).


1. Suitability Checklist

Before proceeding, the agent must answer:

✅ Suitable for Polling — if ALL of the following are true:

  • [ ] The target command/API returns immediately with a process ID, job ID, artifact ID, or similar handle
  • [ ] There is a clear, machine-parseable completion condition (e.g., a JSON/TOML field, a status string, an exit code, a file appearing)
  • [ ] The condition can be checked by re-running the same command or a lightweight query command
  • [ ] The wait time is predictable (typically 1–15 minutes)
  • [ ] No real-time user interaction is needed during execution

❌ NOT Suitable — if ANY of the following are true:

  • [ ] The task requires complex LLM judgment to determine if it's "done" (e.g., "is this output good enough?")
  • [ ] The task requires streaming or real-time output to be shown to the user
  • [ ] The task outcome changes during polling based on intermediate results
  • [ ] The completion condition is ambiguous or subjective
  • [ ] The user wants to stop or redirect the task mid-execution

If the task is NOT suitable for polling, inform the user and propose an alternative approach (e.g., run synchronously, use a sub-agent with polling only for the final wait, etc.).


2. Post-Poll Actions (轮询后行为)

After polling completes (success, failure, or timeout), one or more actions may be needed. Always define these before writing the poll script.

Category A — Notify (通知)

ActionCommandWhen to Use
Direct notify useropenclaw message send --channel discord --target "$CHAT_ID" -m "msg"Failure, timeout, simple completion. No agent processing needed.
Trigger agentopenclaw agent --channel discord --message "msg" --deliver --timeout 600Success requiring next workflow step. Agent receives instructions and executes downstream skill.

Rules:

  • Failure/timeout → always notify_user (direct). Never trigger agent on failure.
  • Success, no chaining → notify_user (direct). Simple "task done" message.
  • Success, needs chaining → trigger_agent with all parameters the next step needs.

Category B — Artifact (产物处理)

ActionCode PatternWhen to Use
Downloadnlm download audio $ID --id $ART_ID -o $PATHExternal service generated a file; bring it local.
Verify[[ -s "$output_path" ]]Confirm file exists and is non-empty before declaring success.
Move/Copycp "$temp_path" "$final_path"User specified a destination; move from temp to final location.

Category C — Cleanup (清理)

ActionCode PatternWhen to Use
Keep temp folder(default)For debugging, resume, or manual inspection.
Delete temp folderrm -rf "$TASK_DIR"Only if user explicitly requested cleanup. Never auto-delete.

Decision Matrix

ScenarioNotifyArtifactCleanup
Simple task done, no output filenotify_user—Keep
File generated, user wants itnotify_userVerify + MoveKeep
Chaining to next skilltrigger_agent— (next skill handles)Keep
Timeoutnotify_user with error details—Keep (for debug)
Failurenotify_user with error details—Keep (for debug)

3. Pre-Flight Confirmation (One-Time, All Parameters)

Before starting any polling task, ask the user to confirm all parameters in a single message. This avoids back-and-forth and sets clear expectations.

Confirm in the user's current session language. Include the post-poll actions in the confirmation.

Example (Chinese):

启动前请确认以下参数:

① 轮询对象
  - 任务:[简短描述]
  - 状态查询命令:[具体命令]
  - 成功判定条件:[例如输出包含 "status": "completed"]

② 轮询频率:每 [X] 分钟一次(默认:5 分钟)
③ 最长持续时间:最多 [Y] 次轮询 = [Z] 分钟(默认:40 分钟 / 8 次)

④ 完成后动作:
  - [ ] 通知用户(默认:是)
  - [ ] 下载产物 → 保存到 [路径]
  - [ ] 触发下一步工作流(说明:...)
  - [ ] 清理临时文件夹

⑤ 失败/超时时动作:
  - [ ] 通知用户(默认:是)

直接回复修改项,或"确认"以默认参数启动。

Do not begin polling until the user confirms. If triggered by an upstream skill (agent mode), skip confirmation and use the parameters from the trigger message.


4. Temp Folder Structure

Every polling task gets its own temp folder. This makes the task self-contained, resumable, and easy to inspect or clean up later.

/tmp/<category>/                          ← category: e.g., notebooklm, deep-research, generic
  <YYMMDD-HHmm>_<sanitized-task-name>/  ← timestamped per-task folder
    task.json          ← task metadata, all parameters, AND post-poll actions
    progress.json      ← current polling state (poll count, last check time, handles)
    poll.log           ← log of every poll attempt (timestamp + result)
    error.log          ← errors encountered
    done.flag          ← empty file, created on successful completion
    <output files>     ← any downloaded/generated artifacts

Naming rules:

  • Category folder: lowercase, hyphenated, descriptive of the task type (e.g., notebooklm-audio, deep-research, generic-async)
  • Task subfolder: YYMMDD-HHmm + _ + sanitized task name (spaces→hyphens, max 40 chars, strip special chars)

If a category folder doesn't exist yet, create it. If a task subfolder already exists (e.g., from a previous attempt), ask the user: "Resume the previous task or start fresh?"

task.json schema

Include post-poll actions in the task config so the script knows what to do on completion:

{
  "category": "notebooklm-audio",
  "task_name": "example-notebook-audio",
  "poll_command": "nlm studio status <notebook_id>",
  "parse_rule": {
    "type": "json",
    "path": ".[0].status",
    "success_value": "completed",
    "failure_value": "failed"
  },
  "on_complete_command": "nlm download audio <notebook_id> --id <artifact_id> -o <output_path>",
  "verify_output": true,
  "poll_interval_seconds": 300,
  "max_polls": 8,
  "output_path": "/path/to/output.m4a",
  "temp_dir": "/tmp/notebooklm-audio/260325-1400_example-audio",
  "created_at": "2026-03-25T22:00:00Z",
  "user_confirmed": true,

  "post_poll": {
    "on_success": {
      "notify_user": true,
      "download": false,
      "download_path": null,
      "trigger_agent": false,
      "agent_message": null
    },
    "on_failure": {
      "notify_user": true
    },
    "on_timeout": {
      "notify_user": true
    }
  }
}

progress.json schema

{
  "poll_count": 3,
  "last_poll_at": "2026-03-25T22:15:00Z",
  "last_poll_result": "in_progress",
  "artifact_id": "abc123...",
  "current_handle": "..."
}

5. Writing the Polling Script

Write the script to the task's temp folder (<temp_dir>/poll.sh). The script must be self-contained — no external dependencies beyond standard Unix tools and the specific CLI tools for the task.

Required properties:

  • set -euo pipefail at the top
  • Check for done.flag at start — if it exists, exit 0 immediately (already done)
  • On any error (auth expired, command failed, timeout), log to error.log and save progress before exiting
  • Save progress.json after every poll attempt
  • Append every poll result to poll.log (timestamp + truncated output)
  • Never delete the temp folder — the user decides when to clean up
  • CHAT_ID must be injected by the agent at script generation time

Script Template

#!/bin/bash
set -euo pipefail

# ─── Config ────────────────────────────────────────────────────────────────
TASK_DIR="/tmp/category/YYMMDD-HHmm_taskname"
cd "$TASK_DIR"

[[ -f done.flag ]] && echo "Already complete." && exit 0

CHAT_ID="INJECT_CHAT_ID"  # ← Agent: replace with Discord channel ID
POLL_COUNT=$(grep '"poll_count"' progress.json 2>/dev/null | sed 's/[^0-9]//g') || POLL_COUNT=0
MAX_POLLS=8
INTERVAL=300

# ─── Helpers ───────────────────────────────────────────────────────────────

log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" | tee -a poll.log; }

notify_user() {
  local message="$1"
  openclaw message send --channel discord --target "$CHAT_ID" -m "$message" 2>/dev/null || log "WARNING: notification failed"
}

trigger_agent() {
  local message="$1"
  openclaw agent --channel discord --message "$message" --deliver --timeout 600 2>/dev/null || {
    log "WARNING: agent trigger failed, falling back to direct message"
    notify_user "$message"
  }
}

# ─── Main Loop ─────────────────────────────────────────────────────────────

while true; do
  POLL_COUNT=$((POLL_COUNT + 1))

  if [[ $POLL_COUNT -gt $MAX_POLLS ]]; then
    echo "[$(date)] TIMEOUT after $MAX_POLLS polls" >> error.log
    notify_user "❌ 任务超时(已达最大轮询次数 $MAX_POLLS)。"
    exit 1
  fi

  log "[Poll $POLL_COUNT/$MAX_POLLS] Checking..."
  RESULT=$(<your_poll_command> 2>&1) || true
  echo "$RESULT" >> poll.log

  # Parse status — adapt to your command's output
  STATUS=$(echo "$RESULT" | python3 -c "
import sys, json
try:
    d = json.loads(sys.stdin.read())
    print(d.get('status', 'unknown'))
except: print('parse_error')
" 2>/dev/null)

  log "Status: $STATUS"

  # ── Success ──────────────────────────────────────────────────────────────
  if [[ "$STATUS" == "completed" ]]; then
    touch done.flag

    # (B1) Download artifact if needed
    # <your_download_command> >> poll.log 2>&1 || true

    # (B2) Verify output if needed
    # [[ -s "$OUTPUT_PATH" ]] || { notify_user "⚠️ 产物文件为空"; exit 1; }

    # (A) Notify
    notify_user "✅ 任务完成!共 $POLL_COUNT 轮轮询。"

    # (A) Trigger agent for chaining (uncomment if needed)
    # trigger_agent "✅ 任务完成。产物已就绪。请启动下一步:..."

    log "Done."
    exit 0
  fi

  # ── Failure ──────────────────────────────────────────────────────────────
  if [[ "$STATUS" == "failed" ]]; then
    echo "[$(date)] FAILED" >> error.log
    notify_user "❌ 任务失败。"
    exit 1
  fi

  # ── Still in progress ────────────────────────────────────────────────────
  sed -i "s/\"poll_count\": [0-9]*/\"poll_count\": $POLL_COUNT/" progress.json
  log "Still in_progress. Sleeping ${INTERVAL}s..."
  sleep "$INTERVAL"
done

6. Launching and Monitoring

Start the background job

  1. First, run the trigger command (e.g., nlm audio create <notebook_id>) to start the background task and capture its ID/handle.
  2. Save the returned ID to progress.json and task.json.
  3. Then launch the polling script as a background process.
# In the task's temp dir:
nohup bash poll.sh > /dev/null 2>&1 &
echo "Polling started in background (PID: $!)"

The polling script should outlive the OpenClaw session. The agent should not need to stay alive for polling to continue.

Monitoring strategy

  • Do not poll from within the OpenClaw session (sub-agents or exec loops waste resources and complicate recovery).
  • If OpenClaw receives a user message asking "is it done yet?", the agent can check done.flag or poll.log in the temp folder to answer without starting a new poll.
  • If a new session starts and the user asks to check on a task, read progress.json to determine current status.

7. Timeout and Error Handling

SituationAction
Max polls reached (timeout)Log to error.log, notify user with details, do NOT delete temp folder
Auth expiredLog to error.log, notify user to re-authenticate, exit
Download/generation failedLog to error.log, notify user, exit
Temp folder already exists (duplicate start)Ask user: resume or restart

After timeout/failure: Do not auto-retry. Tell the user the task did not complete and present options:

  1. Re-run with the same parameters
  2. Adjust parameters and re-run
  3. Clean up the temp folder

8. Template-Ready Tasks (Frequent Patterns)

If the same type of task is performed frequently (e.g., NotebookLM audio generation, Gemini Deep Research status checks), extract the polling logic into a reusable script template stored in a category-level folder:

/tmp/notebooklm-audio/
  poll-template.sh        ← reusable template for this category
  /260325-1400_task1/    ← individual task folders use the template
  /260326-0915_task2/

The per-task poll.sh either copies from the template or is generated from it, keeping the per-task folder minimal.


9. Summary Checklist

Before launching a polling task, confirm ALL of:

  • [ ] Task is suitable for polling (all suitability ✅)
  • [ ] User confirmed all parameters in one message (or triggered by upstream skill)
  • [ ] Post-poll actions defined: notify, download, trigger_agent, cleanup
  • [ ] Temp folder created with correct task.json and progress.json
  • [ ] Trigger command run, ID/handle captured
  • [ ] CHAT_ID injected into poll script
  • [ ] poll.sh written and tested for syntax (bash -n)
  • [ ] Background process started with nohup
  • [ ] User informed: task started, how to check status, what happens on completion

平台分布

OpenClaw

95.13%
按下载量换算889

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 openclaw skills install jclaw-polling-best-practices 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills