SuperAPI AI Directory

remote-control

General & other

View repository

Updated 10-16 09:44

About this skill

Remote Control Skill

⚡ Execute immediately upon activation

When this Skill is activated (Stop Hook triggered), directly execute the following steps, do not output any explanation or ask the user:

  1. Generate task summary - Summarize the work just completed in 1-2 sentences
  2. Send WeChat notification - Use gewe-cc wait-reply (run in background)
  3. Wait for reply - Use TaskOutput to get the WeChat reply
  4. Execute next step - Continue working or stop based on the reply

❌ Prohibited behaviors(after activation):

  • Output meta-information such as "I have understood the workflow", "Remote mode activated", etc.
  • Ask the user "What task would you like me to complete?"
  • Wait for the user to input anything in the terminal

✅ Correct behaviors(after activation):

  • Immediately generate a summary (e.g., "Answered a simple math question")
  • Immediately send WeChat notification and wait for reply
  • Continue to the next task or stop based on the reply

Overview

This Skill implements a WeChat-based remote collaboration mode. When a task is completed, you need to:

  1. Send a WeChat notification to inform the user that the task is complete
  2. Wait for the user to send the next instruction via WeChat
  3. Continue working or end remote mode based on the instruction

⚠️ Key constraint: Directly asking the user is prohibited

In remote collaboration mode, you cannot directly ask the user a question and wait for terminal input.

Problem scenario

❌ Prohibited behavior:

你:方案 A、B、C 各有优势,您觉得哪个更好?
[等待用户在终端输入...]

Consequence:

  • After your message is output,stop_reason: null
  • Stop Hook will not trigger
  • Remote mode loop is interrupted
  • The user will not receive the notification on WeChat

Correct approach: Ask via WeChat

✅ When user selection is needed, use gewe-cc wait-reply

# 步骤 1:后台运行询问命令
gewe-cc wait-reply -M "【Claude Code】
📁 项目: $(basename "$(pwd)")
❓ 需要选择实现方案

方案 A: 简单但功能受限
方案 B: 复杂但灵活
方案 C: 平衡(推荐)

请回复「A」「B」或「C」"

# 步骤 2:等待回复(使用 TaskOutput)
# 步骤 3:根据回复执行对应方案

Why it works:

  • gewe-cc wait-reply Blocks execution until a WeChat reply is received
  • After the reply, your output is complete,stop_reason normal
  • Stop Hook triggers normally, and remote mode continues the loop

Design principles

Ask when necessary: When user input is needed, obtain the WeChat reply through gewe-cc wait-reply , never directly ask the user a question and wait for terminal input.

Configuration information

Configuration is automatically read from ~/.gewe-cc/config.toml :

  • Target WeChat ID: In the configuration file, notification.wxid
  • Listen address: In the configuration file, notification.listen
  • Command tool: gewe-cc(wraps gewe-cli)

Workflow

Step 1: Generate task summary

Based on the work completed in this session, generatea concise 1-2 sentence summary。

Good examples:

  • "Created the user authentication module and added JWT support"
  • "Fixed the database connection pool leak issue"
  • "Refactored the configuration system to support environment variable overrides"

Avoid:

  • ❌ "Task completed" (too general)
  • ❌ "Modified 3 files, added 150 lines of code" (too technical)

Step 2: Send WeChat notification and wait for reply

There are two sending methods:Text message(short summary) or Link card(full transcript)

Method A: Send text message (short summary)

Suitable for cases where the summary is short (< 200 characters).

gewe-cc wait-reply -M "【Claude Code】
📁 项目: $(basename "$(pwd)")
✅ 任务完成
📝 摘要: <你生成的摘要>

回复任何内容继续,回复「停止」结束远程模式。"

Must use run_in_background=true parameter!

Method B: Send link card (full transcript)

Suitable for cases where the summary is long or the full conversation history needs to be viewed.

Pre-check:

Before sending the link card, you must first check whether the HTTP server is running:

# 检查 HTTP 服务器进程
if ! pgrep -f "gewe-cc serve" > /dev/null; then
    echo "⚠️ HTTP 服务器未运行,正在启动..."
    gewe-cc serve &
    sleep 2
fi

Prerequisites:

  1. Ensure that the configuration file has set transcript_domain

    gewe-cc config --transcript-domain "https://transcript.example.com"
    
  2. Ensure ~/.gewe-cc/assets/thumb.png exists and is less than 50KB

Usage:

# 从 Stop Hook 提示中提取 session_id
# 例如:"会话: 75f2b194-4b91-4c19-8e97-4ff5fe562ece"

SESSION_ID="<从提示中获取的 session_id>"

# 发送链接卡片并等待回复(一条命令完成)
gewe-cc send-link \
  --session-id "${SESSION_ID}" \
  --summary "<你生成的摘要>"

This command will automatically:

  • Read wxid and transcript_domain from the configuration
  • Build the complete transcript URL
  • Send the link card to WeChat
  • Wait for the user's reply
  • Return the user's reply content

Must use run_in_background=true parameter!

Advantages of link cards:

  • Display the full conversation history (including tool use, tool result)
  • Support Markdown rendering and code highlighting
  • Responsive design, mobile-friendly
  • Provide a "jump to bottom" button to quickly view the latest content

Selection suggestions:

  • Summary < 200 characters → use text message
  • Summary ≥ 200 characters → use link card
  • Need to view detailed tool calls → use link card

Step 3: Wait for and obtain the reply

Use the TaskOutput tool to wait for the background command to complete:

1. 从步骤 2 的返回中获取任务 ID
2. 使用 TaskOutput(task_id=<id>, block=true, timeout=300000) 阻塞等待

Timeout settings:

  • Default timeout 300000 milliseconds (5 minutes)
  • If it times out, ask the user whether to continue waiting

Step 4: Parse the reply content

Directly obtain the user's reply content from the TaskOutput output.

gewe-cc wait-reply output format:

<用户的回复内容>

The directly obtained output is the user's reply.

Step 5: Decide the next step based on the reply

Check the reply content (case-insensitive):

Case A: The user replies "stop"

If the reply is any of the following (case-insensitive):

  • 停止
  • stop
  • Stop
  • STOP

Perform the operation:

# 关闭当前会话的远程模式(保持全局远程模式启用)
gewe-cc off --session-id <会话ID>

Then inform the user that the current session has ended, and end normally (do not continue looping).

Session ID description: Obtained from the Stop Hook prompt, in the format:5e64d0b7 etc.

Case B: The user replies with other content

Execute the reply content as a new user instruction:

1. 将回复作为新任务
2. 执行该任务
3. 任务完成后回到步骤 1(重新循环)

Example:

用户回复:"添加单元测试"
  ↓
你应该:
1. 理解这是要添加单元测试的任务
2. 执行添加单元测试
3. 完成后再次生成摘要
4. 再次发送微信通知
5. 等待下一个指令

Error handling

gewe-cc command failed

If the gewe-cc wait-reply command fails:

1. 显示错误信息给用户
2. 询问用户是否退出远程模式
3. 如果用户确认,执行 gewe-cc off

TaskOutput timeout

If waiting exceeds 5 minutes without a reply:

询问用户:
"等待微信回复已超时(5 分钟)。是否继续等待?
1. 继续等待(再等 5 分钟)
2. 退出远程模式"

Complete example

Successful flow example

[Claude 完成任务:重构配置系统]
  ↓
Stop Hook 检测到远程模式
  ↓
remote-control Skill 激活
  ↓
生成摘要:"重构了配置系统,支持环境变量覆盖"
  ↓
发送微信(后台运行):
  gewe-cc wait-reply -M "【Claude Code】..."
  [返回任务 ID: abc123]
  ↓
使用 TaskOutput 等待:
  TaskOutput(task_id="abc123", block=true, timeout=300000)
  ↓
收到回复:"添加配置文档"
  ↓
执行新任务:添加配置文档
  ↓
[任务完成,回到开始循环]

Stop flow example

[Claude 完成任务]
  ↓
发送微信通知
  ↓
等待回复
  ↓
收到回复:"停止"
  ↓
执行命令:
  gewe-cc off
  ↓
告知用户:"✅ 远程模式已结束"
  ↓
正常结束(不再循环)

Notes

  1. Must use run_in_background

    • gewe-cc wait-reply Will block and wait for a reply
    • Must run in the background, otherwise it will get stuck
  2. The summary must be meaningful

    • Users view it through WeChat and need to quickly understand what was completed
    • Avoid using too much technical jargon
  3. Loop condition

    • It exits only after receiving the "stop" instruction
    • Any other reply continues execution
  4. Automatic configuration reading

    • gewe-cc will automatically read the configuration from ~/.gewe-cc/config.toml
    • No need to manually parse the configuration file
  5. Exit method

    • Use gewe-cc off command to disable remote mode
    • Do not manually delete files