Ops Pocket 标志

Ops Pocket

组织
Lifecycle-Innovations-Limited
ops-pocket

OPS on-demand: This skill should be used when the user asks to "pocket memos", "voice memo pipeline"…

概览

发布者Lifecycle-Innovations-Limited
代码仓库claude-ops
技能名称ops-pocket
星标数
543
复刻数
64
附带文件
5
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 5 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 Lifecycle-Innovations-Limited 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Ops Pocket AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/Lifecycle-Innovations-Limited/claude-ops/tree/main/claude-ops/skills/ops-pocket
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Lifecycle-Innovations-Limited/claude-ops.git /tmp/claude-ops
mkdir -p .claude/skills
cp -r /tmp/claude-ops/claude-ops/skills/ops-pocket .claude/skills/ops-pocket
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Ops Pocket,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Ops Pocket。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Ops Pocket 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

OPS ► POCKET

Load ops-rules before acting. Public repo (no personal data). Outbound: one draft → one approval → one send. If AskUserQuestion / Workflow are missing, follow Rule 10 in ops-rules (Hermes: numbered options / two-turn Telegram card; delegate_task).

Surfaces the Pocket voice-memo pipeline as a discoverable slash command. The pipeline was previously orphaned — 7 scripts, no entry point. This skill is the entry point.

For the full architecture reference (every state file, every script, every failure mode) see STATUS.md sibling to this file.

Runtime Context

Before any route runs, resolve:

  1. State dir: ${POCKET_STATE_DIR:-$HOME/.claude/state/pocket}. Every file mentioned below is relative to this dir.
  2. Plugin root: ${CLAUDE_PLUGIN_ROOT} — used to invoke pipeline scripts under scripts/.
  3. Daemon health snapshot: ${CLAUDE_PLUGIN_DATA_DIR:-$HOME/.claude/plugins/data/ops-ops-marketplace}/daemon-health.json — surface its pocket-* service status if present.

If $POCKET_STATE_DIR does not exist on disk, the pipeline has never been bootstrapped — route to setup automatically (no autoroute on status if the user explicitly asked for status).

Routing table

Parse $ARGUMENTS and route immediately. First token decides the route.

First argRoute
(empty) / statusStatus dashboard — daemon health + queue depths + cursors + counts
setupDelegate to skills/setup/channels/pocket.md if present; else inline steps
tasksPending + in-progress + recently-completed task list
testEnd-to-end synthetic completion test (covered below)
logs [N]Tail N lines (default 50) of notifier + run + executor logs
restartKickstart launchd notifier + (re)spawn pocket-exec tmux supervisor
whatsapp on / offToggle WhatsApp self-chat sink
email on / offToggle email self-mail sink

Anything else: print the routing table and exit.


Route — status (default)

The default route. Read state files, render a compact dashboard.

Read these — in parallel where possible:

bash
STATE_DIR="${POCKET_STATE_DIR:-$HOME/.claude/state/pocket}"

# Daemon plist liveness
launchctl list com.claude-ops.pocket-activity-notifier 2>/dev/null \
  | awk '/PID/{print "pid="$3} /LastExitStatus/{print "exit="$3}'

# Supervisor tmux session
tmux has-session -t pocket-exec 2>/dev/null && echo "tmux=up" || echo "tmux=down"
tmux list-windows -t pocket-exec 2>/dev/null | wc -l

# Queue depths (line counts)
wc -l < "$STATE_DIR/pending-triage.jsonl" 2>/dev/null
wc -l < "$STATE_DIR/tasks.jsonl" 2>/dev/null
wc -l < "$STATE_DIR/spawn-ledger.jsonl" 2>/dev/null
wc -l < "$STATE_DIR/supervisor-out-queue.jsonl" 2>/dev/null

# Completed reports
ls "$STATE_DIR/executor-results/"*.done.json 2>/dev/null | wc -l

# Last pull cursor
cat "$STATE_DIR/cursor.txt" 2>/dev/null

# Last 3 notifications (from out-queue-sent.jsonl)
tail -n 3 "$STATE_DIR/out-queue-sent.jsonl" 2>/dev/null

# Per-component health
for h in .activity-notifier-health .out-queue-health .email-bridge-health .health; do
  cat "$STATE_DIR/$h" 2>/dev/null
done

Output format (desktop):

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 OPS ► POCKET — [timestamp]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

DAEMONS
  watcher          [running|stalled]    last tick [Xs ago]
  triage           [running|idle]
  executor watchdog [running|stalled]   tmux pocket-exec=[up|down] (N windows)
  activity-notifier [running|stalled]   pid [N]
  out-queue        [running|disabled|error]
  email-bridge     [running|disabled|error]

QUEUES
  pending-triage   [N items]            (awaiting ACT/SKIP decision)
  tasks.jsonl      [N items]            (canonical task store)
  spawn-ledger     [N spawns]
  out-queue        [N pending]
  executor-results [N .done.json]

CURSORS
  watcher last pull   [ISO timestamp from cursor.txt]
  last completion     [latest .done.json mtime]

CHANNELS
  whatsapp         [on|off|misconfigured]   chat_jid=[masked tail]
  email            [on|off|misconfigured]   to=[masked]

LAST 3 NOTIFICATIONS
  [N. kind type | task_id | sent_at]
──────────────────────────────────────────────────────

Mobile mode (Rule 7 — $SSH_CONNECTION/$SSH_CLIENT/$SSH_TTY set OR $OPS_MOBILE=1 OR $COLUMNS<80): plain text lines, no boxes, no emoji prefixes:

pocket: watcher running, exec tmux=up, notifier pid=N
queues: triage 0, tasks 12 (3 active), out 0
last pull: 5m ago. last done: 12m ago.
channels: whatsapp on, email off.

After the dashboard, use AskUserQuestion (max 4 — Rule 1) ONLY if there is something actionable (stalled daemon, pending-triage > 0, etc.). On a clean board, exit silently.


Route — setup

Delegate to the setup channel doc when it exists:

bash
SETUP_DOC="$CLAUDE_PLUGIN_ROOT/skills/setup/channels/pocket.md"
[[ -f "$SETUP_DOC" ]] && cat "$SETUP_DOC"

If pocket.md does not exist, print the inline onboarding sequence:

  1. Confirm pocket-cli (or equivalent Pocket API auth) is on PATH.
  2. Drop a whatsapp-config.json and/or email-config.json under $STATE_DIR (see STATUS.md for schemas).
  3. Run bash $CLAUDE_PLUGIN_ROOT/scripts/install-pocket-notifier.sh to register the launchd LaunchAgent.
  4. Verify with /ops:pocket status.

Per Rule 4 (background by default during setup) and Rule 2 (never delegate commands to the user) — run the install script via Bash with run_in_background: true. Per Rule 3, never auto-skip channel selection — if whatsapp-config.json and email-config.json are both missing, ask via AskUserQuestion which to configure first ([WhatsApp] / [Email] / [Both] / [Skip]).


Route — tasks

Render a single combined list. No AskUserQuestion — read-only by default.

bash
STATE_DIR="${POCKET_STATE_DIR:-$HOME/.claude/state/pocket}"

# Pending triage (awaiting ACT/SKIP)
tail -n 50 "$STATE_DIR/pending-triage.jsonl" 2>/dev/null

# Live tasks (canonical store)
tail -n 50 "$STATE_DIR/tasks.jsonl" 2>/dev/null

# In-flight workers (windows in pocket-exec tmux, excluding _idle + supervisor)
tmux list-windows -t pocket-exec -F '#{window_name}' 2>/dev/null \
  | grep -vE '^(_idle|supervisor)$'

# Recently completed (.done.json sorted by mtime, last 10)
ls -t "$STATE_DIR/executor-results/"*.done.json 2>/dev/null | head -10

Format:

PENDING TRIAGE (N)
  [id] [created] [title]

ACTIVE TASKS (N)
  [task_id] [status] [title] [started]

IN-FLIGHT WORKERS (N)
  [tmux window name] [up since]

RECENTLY COMPLETED (last 10)
  [task_id] [duration] [report file]

Route — test (synthetic end-to-end)

Smoke-tests the full notifier → out-queue → both bridges path without going through the watcher or triage. Same flow as the manual session-level test that was run when the notifier shipped.

Steps:

  1. Pre-flight: verify $STATE_DIR/whatsapp-config.json OR email-config.json has enabled: true. If neither: print not configured — run /ops:pocket setup and exit.
  2. Generate a synthetic task_id like test-$(date +%s).
  3. Append a tasks.jsonl entry for the synthetic task (so the notifier can title-resolve it):
    bash
    echo "{\"task_id\":\"$TID\",\"title\":\"synthetic pocket test\",\"created_at\":\"$(date -u +%FT%TZ)\",\"verdict\":\"ACT\"}" \
      >> "$STATE_DIR/tasks.jsonl"
  4. Drop a synthetic .done.json into executor-results/:
    bash
    cat > "$STATE_DIR/executor-results/$TID.done.json" <<EOF
    {"task_id":"$TID","status":"done","completed_at":"$(date -u +%FT%TZ)","report_file":"$TID.out.md"}
    EOF
    echo "# Synthetic test report\n\nThis is a test artifact from /ops:pocket test." \
      > "$STATE_DIR/executor-results/$TID.out.md"
  5. Manually invoke the notifier once (don't wait 60s for launchd):
    bash
    "$CLAUDE_PLUGIN_ROOT/scripts/ops-pocket-activity-notifier.py" --once 2>&1 | tail -20
    (If --once is not supported, run the script with POCKET_NOTIFIER_ONESHOT=1 env var, or just python3 ops-pocket-activity-notifier.py.)
  6. Drain both bridges in parallel:
    bash
    "$CLAUDE_PLUGIN_ROOT/scripts/ops-pocket-out-queue.py" 2>&1 | tail -10
    "$CLAUDE_PLUGIN_ROOT/scripts/ops-pocket-email-bridge.py" 2>&1 | tail -10
  7. Verify delivery — for each enabled channel:
    • WhatsApp: tail $STATE_DIR/out-queue-sent.jsonl for an entry with the synthetic task_id. (Do NOT use mcp__whatsapp__list_messages — the bridge's own sent ledger is the source of truth.)
    • Email: tail $STATE_DIR/email-bridge.log for SENT on the synthetic task_id.
  8. Cleanup:
    bash
    rm -f "$STATE_DIR/executor-results/$TID.done.json" \
          "$STATE_DIR/executor-results/$TID.out.md"
    Leave the tasks.jsonl line (append-only log; harmless).

Report:

POCKET ► TEST
  task_id: [tid]
  whatsapp: [SENT|SKIPPED-disabled|FAIL: reason]
  email:    [SENT|SKIPPED-disabled|FAIL: reason]
  duration: [Xs]

If any channel fails, surface the last error line from the corresponding *.log and .health file.


Route — logs [N]

bash
N="${ARG_2:-50}"
STATE_DIR="${POCKET_STATE_DIR:-$HOME/.claude/state/pocket}"

for f in activity-notifier.log run.log executor.log out-queue.log email-bridge.log; do
  echo "==> $f <=="
  tail -n "$N" "$STATE_DIR/$f" 2>/dev/null || echo "(missing)"
done

For Rule 7 mobile mode, default N=20 and skip per-file headers.


Route — restart

bash
# 1. Kickstart the launchd activity-notifier
launchctl kickstart -k "gui/$(id -u)/com.claude-ops.pocket-activity-notifier" 2>&1

# 2. (Re)spawn the pocket-exec supervisor via the executor watchdog cron script
"$CLAUDE_PLUGIN_ROOT/scripts/ops-cron-pocket-executor.py" 2>&1 | tail -10

If the launchd label is missing (notifier never installed), prompt via AskUserQuestion: [Install notifier now] / [Skip]. On install: run scripts/install-pocket-notifier.sh (Rule 4: run_in_background: true).


Route — whatsapp on|off and email on|off

Both routes mutate a small JSON config file. Never overwrite the whole file — patch in place.

bash
STATE_DIR="${POCKET_STATE_DIR:-$HOME/.claude/state/pocket}"
CFG="$STATE_DIR/whatsapp-config.json"   # or email-config.json
ACTION="${ARG_2}"                        # on | off
mkdir -p "$STATE_DIR"

if [[ ! -f "$CFG" ]]; then
  # Bootstrap empty config with enabled=false so subsequent `on` is meaningful.
  echo '{"enabled":false}' > "$CFG"
fi

case "$ACTION" in
  on)  python3 -c "import json,sys,pathlib; p=pathlib.Path('$CFG'); d=json.loads(p.read_text()); d['enabled']=True; p.write_text(json.dumps(d,indent=2))" ;;
  off) python3 -c "import json,sys,pathlib; p=pathlib.Path('$CFG'); d=json.loads(p.read_text()); d['enabled']=False; p.write_text(json.dumps(d,indent=2))" ;;
  *)   echo "usage: /ops:pocket {whatsapp|email} {on|off}"; exit 2 ;;
esac

# Echo new state
cat "$CFG"

Required keys per channel (validated by status):

  • whatsapp-config.json — chat_jid (WhatsApp JID of the self-chat, e.g. <digits>@s.whatsapp.net).
  • email-config.json — to (self-email address).

If on is requested but the required key is missing, switch state to enabled: false and route the user to setup via AskUserQuestion.


Rule reminders

  • Rule 1: Max 4 options per AskUserQuestion. None of the routes above need more.
  • Rule 2: Never delegate commands to the user — every command runs through Bash.
  • Rule 3: Never auto-skip channels in setup — always ask explicitly.
  • Rule 4: Background by default in setup (run_in_background: true).
  • Rule 5: This skill performs NO destructive ops — no deletes, no terminates, no force-kills beyond launchctl kickstart -k (which is a graceful restart, not a wipe).
  • Rule 6: No outbound comms staged from this skill except the synthetic test message in test, which goes to the operator's OWN self-chat / self-email (already enabled by the user) — not to third parties. Per-message approval rule is satisfied by the test being a no-args opt-in.
  • Rule 7: Mobile mode renders plain text only — see status example.

Native tool usage

  • AskUserQuestion: only when there is a real choice to make (stalled daemon → restart? missing channel config → bootstrap?). Never required on a green status.
  • Skill: setup route may delegate to the setup channel doc.

See also

  • STATUS.md — full architecture: 8 scripts, every state file, lifecycle, troubleshooting.
  • scripts/ops-cron-pocket-watcher.py, scripts/ops-pocket-triage.py, scripts/ops-cron-pocket-executor.py, scripts/ops-pocket-activity-notifier.py, scripts/ops-pocket-out-queue.py, scripts/ops-pocket-email-bridge.py, scripts/ops-pocket-whatsapp-bridge.py.
  • scripts/install-pocket-notifier.sh, scripts/com.claude-ops.pocket-activity-notifier.plist.
  • templates/pocket-supervisor-prompt.md — the prompt the long-lived supervisor runs under.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Ops Pocket AI 技能有什么作用?

OPS on-demand: This skill should be used when the user asks to "pocket memos", "voice memo pipeline"…

为什么在 TypingMind 中使用 Ops Pocket?

因为您只需安装一次,就能搭配任何模型使用。Ops Pocket 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Ops Pocket?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/Lifecycle-Innovations-Limited/claude-ops/tree/main/claude-ops/skills/ops-pocket。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Ops Pocket?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Ops Pocket 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Ops Pocket 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Ops Pocket AI 技能免费吗?

是的。Lifecycle-Innovations-Limited 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇