一键导入
bot-process-control
Start, stop, or restart the Telegram sync bot process. TRIGGERS - start bot, stop bot, restart bot, bot process, bot status, bot control.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Start, stop, or restart the Telegram sync bot process. TRIGGERS - start bot, stop bot, restart bot, bot process, bot status, bot control.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
user wants to send a WhatsApp message, share a link or document via WhatsApp, generate a wa.me click-to-chat link, or message a contact on WhatsApp by phone number.
Claude Code hooks development guide. TRIGGERS - create hook, PostToolUse, PreToolUse, Stop hook, hook lifecycle, decision block.
Deploy static HTML files to Cloudflare Workers with 1Password credential management.
Dual-channel notifications on watchexec events. TRIGGERS - watchexec alerts, Telegram+Pushover, file change notifications.
Session log provenance tracking. TRIGGERS - who created, trace origin, session archaeology, ADR reference.
Generate custom Claude Code slash commands via guided question flow. TRIGGERS - create slash command, generate command, custom command.
| name | bot-process-control |
| description | Start, stop, or restart the Telegram sync bot process. TRIGGERS - start bot, stop bot, restart bot, bot process, bot status, bot control. |
| allowed-tools | Read, Bash, Glob, AskUserQuestion |
Start, stop, restart, and monitor the Telegram sync bot process. Provides lifecycle management for the bun --watch bot runner with process verification and log access.
Platform: macOS (Apple Silicon)
Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
~/.claude/automation/claude-telegram-sync/~/.claude/.secrets/ccterrybot-telegramShow current bot process state using pgrep:
pgrep -la 'bun.*src/main.ts'
If no output, the bot is not running. If multiple lines appear, there are duplicate instances that need cleanup.
Use AskUserQuestion to determine the desired action:
bun --watchIn production, launchd manages the bot via a compiled Swift runner binary. The runner uses bun --watch, so code changes auto-restart the service.
Restart (production — kill bun, Swift runner respawns it):
pkill -f 'bun.*src/main.ts'
sleep 2
pgrep -la 'bun.*src/main.ts'
Stop (full — kills both runner and bun):
pkill -f 'telegram-bot-runner'
pkill -f 'bun.*src/main.ts'
Start (production — via launchd):
launchctl kickstart -k gui/$(id -u)/com.terryli.telegram-bot
Start (ad-hoc — shell session, for debugging):
cd ~/.claude/automation/claude-telegram-sync && bun --watch run src/main.ts >> /private/tmp/telegram-bot.log 2>&1 &
Logs:
tail -50 /private/tmp/telegram-bot.log
# Or structured logs:
tail -50 ~/.local/state/launchd-logs/telegram-bot/stderr.log
Confirm the process state changed as expected:
pgrep -la 'bun.*src/main.ts'
1. [Check] Show current bot process status with pgrep
2. [Action] Present start/stop/restart/logs options via AskUserQuestion
3. [Execute] Run the selected action command
4. [Verify] Confirm process state changed as expected
5. [Logs] Optionally tail recent logs for confirmation
6. [Done] Report final process status to user
| Issue | Cause | Solution |
|---|---|---|
| Bot not running | Process crashed or was never started | Check with pgrep, runner should auto-respawn; if runner also dead, launchctl kickstart |
| Multiple instances | Previous stop did not fully terminate | pkill -f 'telegram-bot-runner'; pkill -f 'bun.*src/main.ts', then restart via launchd |
| Code changes not picked up | Bot started without --watch | Kill bun process — runner respawns with --watch; or recompile runner if it's outdated |
--watch not reloading | File outside watch scope changed | bun --watch monitors the entry file's dependency tree; config-only changes (mise.toml) need a kill |
| Logs not writing | Log directory missing or permissions | Verify ~/.local/state/launchd-logs/telegram-bot/ exists and is writable |
| bun not found | mise shims not in PATH | Runner sets PATH explicitly; recompile runner if shims path changed |
| Bot starts but crashes immediately | Missing env vars or secrets | Check ~/.claude/.secrets/ccterrybot-telegram exists; verify mise.toml env section |
bun --watch design rationaleAfter this skill completes, reflect before closing the task: