360 Secure SkillHub
360 安全技能中心

Doppleganger

该 Skill 提供 check/guard 命令,接收任务字符串,查询既有子代理跟踪结果,判断同一任务是否已在运行:无重复返回 duplicate=false 可安全创建,有重复则返回 duplicate=true 及原因、会话 ID 和键,并约定退出码 0/1/2;支持 --json 输出,供编排器在启动子代理前调用。

RuneweaverStudios
RuneweaverStudios
热度 64.00
最近更新 2026-05-20 03:38:59
分类:自动化依赖:代码执行应用场景:工作流 / 任务管理 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add doppleganger
Metadata
name
doppleganger
displayName
Doppleganger
description
Prevents duplicate subagent sessions running the same task. Saves tokens and reduces lag—no more "multiple Spidermen" doing the same work.
version
1.0.0

Doppleganger

Description

Prevents duplicate subagent sessions running the same task. Saves tokens and reduces lag—no more "multiple Spidermen" doing the same work.

Doppleganger

One task, one agent. Doppleganger stops duplicate subagent sessions from running the same task. That prevents token overspend, UI lag, and the chaos of five identical "task completed" announcements.

Usage

  • The orchestrator already runs a duplicate check before sessions_spawn (see delegate rule); Doppleganger is the named skill for that behavior.
  • User says: "prevent duplicate agents", "stop dopplegangers", "why are so many agents doing the same thing?"
  • You want a single entry point to check whether a task is already running before spawning.
python3 /Users/ghost/.openclaw/workspace/skills/doppleganger/scripts/doppleganger.py check "<task string>" [--json]
python3 /Users/ghost/.openclaw/workspace/skills/doppleganger/scripts/doppleganger.py guard --task "<task>" [--json]

JSON output:

  • {"duplicate": false, "doppleganger_ok": true} → safe to spawn.
  • {"duplicate": true, "reason": "running", "sessionId": "...", "key": "...", "doppleganger_ok": true} → do not spawn; reply that the task is already running.

Exit codes: 0 = no duplicate (or check ok). 1 = error. 2 = duplicate detected.

What it does

  • check / guard — Given a task string (the same one you would pass to sessions_spawn), returns whether that task is already running. If yes, the orchestrator must not spawn again.
  • Uses the subagent-tracker's check-duplicate under the hood (one source of truth for runs/sessions).

Orchestrator

The delegate rule runs a duplicate check before every sessions_spawn; that check can be implemented by calling Doppleganger (or subagent-tracker check-duplicate) with the router's task string. If duplicate: true, do not call sessions_spawn.

Name

"Doppleganger" = the duplicate agent doing the same thing. One Spiderman is enough.