К основному содержанию
скилл CX Codex

bot-process-control — скилл для Claude Code

Скилл bot-process-control регламентирует мониторинг процессов Gmail Commander и защищает от запуска конфликтующих локальных поллеров Telegram на рабочей станции.

MIT 117 установок ★ 3 обновлён 2026-10-25

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add terrylica/cc-skills --skill bot-process-control -a claude-code
Открыть на GitHub

Что делает bot-process-control

Скилл описывает архитектуру бота Gmail Commander и сервиса дайджеста, развёрнутых в изолированном тенанте Restate на Mac mini. В систему входят четыре компонента: GmailBot, GmailBotChat, GmailDigest и сервис авторизации GmailAuth. Навык даёт правила безопасной диагностики без вмешательства во внутренний деплой, команды которого вынесены в отдельный закрытый ранбук.

Запуск второго поллера с боевым токеном через scripts/bot.ts вызывает ошибку Telegram 409 Conflict и ломает доставку сообщений обоим клиентам. Поэтому инструкция требует сначала проверить окружение с помощью launchctl list и pgrep. Старые фоновые задачи launchd были выведены из эксплуатации 2026-09-24, а общую работоспособность сервиса проверяют отправкой команды /status боту в Telegram.

Какие задачи решает

  • предотвратить запуск второго поллера Telegram с рабочим токеном
  • проверить отсутствие устаревших локальных демонов launchd
  • продиагностировать статус бота через Telegram-команду /status
  • разобрать ошибку авторизации invalid_grant в сервисе GmailAuth

Примеры запросов агенту

  • Проверь статус процессов gmail bot и убедись, что локально ничего не запущено
  • Почему бот gmail bot down и не отвечает на команды в Telegram?
  • Выполни preflight-проверку окружения для Gmail Commander

Как установить bot-process-control

1Через Skills CLI (Vercel)

npx skills add terrylica/cc-skills --skill bot-process-control -a claude-code

2Вручную: положить файлы

~/.claude/skills/bot-process-control/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/bot-process-control/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о bot-process-control

Как установить bot-process-control в Claude Code?

Выполните команду npx skills add terrylica/cc-skills --skill bot-process-control -a claude-code. Файл навыка будет сохранён по пути ~/.claude/skills/bot-process-control/SKILL.md.

Что делает скилл bot-process-control?

Он задаёт сценарий проверки сервисов Gmail Commander в Restate и блокирует опасные попытки поднять локальные процессы с рабочими секретами.

Почему нельзя запускать scripts/bot.ts на рабочем компьютере?

Telegram разрешает только одно соединение getUpdates на бота. Локальный процесс приведёт к ошибке 409 Conflict, нарушит обработку входящих сообщений и вызовет алерт дежурному оператору.

Исходный текст

SKILL.md · MIT
---
name: bot-process-control
description: Gmail Commander bot and digest process control - they run unattended in a private Restate deployment, never as workstation launchd jobs. Where they run, how to check them, what not to start locally. TRIGGERS - bot start, bot stop, bot restart, bot status, gmail bot down
allowed-tools: Read, Bash, Grep, Glob
---

# Bot Process Control

Where the Gmail Commander bot and scheduled digest run, how to tell whether they are healthy, and what must never be started on a workstation.

> **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.

## Where the processes live

Neither process runs on a workstation. Both run in a **private Restate tenant on an always-on Mac mini**, deployed from a private repository:

| Service        | Role                                                                                                |
| -------------- | --------------------------------------------------------------------------------------------------- |
| `GmailBot`     | Owns the Telegram `getUpdates` chain (one durable, self-re-arming poll) and dispatches each update  |
| `GmailBotChat` | Runs one update through the grammY bot built by this plugin's `buildBot()`, in per-chat order       |
| `GmailDigest`  | Scheduled email digest to Telegram, several times a day (its own implementation, not this plugin's) |
| `GmailAuth`    | Mints Gmail access tokens on demand from a refresh token held in the deployment's secret store      |

**Starting, stopping, restarting, deploying, reading logs, rotating secrets and OAuth re-consent are all done through that repository's runbook.** This public skill intentionally carries no host names, deploy commands or credential paths for it. If you do not have access to that repository, stop and ask the operator.

The laptop launchd jobs `com.example.gmail-commander-bot` and `com.example.gmail-commander-digest` were **retired on 2026-09-24**. Do not recreate their plists, launcher scripts or env files.

## Mandatory Preflight

### Step 1: Confirm nothing is running locally (read-only)

```bash
echo "=== Local gmail-commander launchd jobs (expected: none) ==="
launchctl list | grep -F gmail-commander || echo "none"

echo ""
echo "=== Local gmail-commander plists (expected: none) ==="
ls ~/Library/LaunchAgents 2>/dev/null | grep -F gmail-commander || echo "none"

echo ""
echo "=== Local standalone bot process (expected: none) ==="
pgrep -fl "gmail-commander/scripts/bot.ts" || echo "none"
```

If any of these finds something, **report it to the operator instead of loading, unloading or killing it yourself**: a live local poller competes with the tenant for the same bot token.

### Step 2: Check the deployed bot from the user's side

The one check that needs no deployment access: send `/status` to the bot in its Telegram chat. A reply with uptime and counters means `GmailBotChat` is handling updates. No reply within a minute means the poll chain or the tenant is down — escalate through the runbook.

## Never start a second poller

`scripts/bot.ts` still has a standalone long-polling `main()`, guarded by `import.meta.main` so that importing `buildBot()` never polls. **Do not run it with the production bot token.** Telegram allows exactly one `getUpdates` consumer per token; a second one makes Telegram answer `409 Conflict` and both pollers become unreliable, and the tenant pages the operator when it sees that conflict.

The standalone entry point exists for other installations of this public plugin, with their own bot token. It takes a PID lock at `/tmp/gmail-commander-bot.pid` and reads the variables listed in the [plugin CLAUDE.md](../../CLAUDE.md#environment-variables). This plugin no longer ships process-supervisor templates for it.

## Telegram Commands

| Command  | Description                             |
| -------- | --------------------------------------- |
| /inbox   | Show recent inbox emails                |
| /search  | Search emails (Gmail query syntax)      |
| /read    | Read email by ID                        |
| /compose | Compose a new email                     |
| /reply   | Reply to an email                       |
| /abort   | Cancel current compose/reply action     |
| /drafts  | List draft emails                       |
| /digest  | Triage the last N hours now (default 6) |
| /status  | Bot status and stats                    |
| /help    | Show all commands                       |

> **Note**: `/abort` cancels any in-progress compose or reply session. Works at any step in the flow.

## OAuth failures in the deployment

When Google rejects the deployment's refresh token (`invalid_grant`), `GmailAuth` pages the operator. Recovery needs a browser consent on a workstation and a secret update in the deployment, both described in the private runbook. The CLI's own `invalid_grant` recovery on a workstation is a different token and is covered in [gmail-access](../gmail-access/SKILL.md#diagnosing-invalid_grant).

## Post-Change Checklist

- [ ] YAML frontmatter valid (no colons in description)
- [ ] Trigger keywords current
- [ ] Path patterns use $HOME not hardcoded paths
- [ ] No launchd templates, host names or credential paths reintroduced
- [ ] `buildBot()` contract in the plugin CLAUDE.md still matches `scripts/bot.ts`

## Post-Execution Reflection

After this skill completes, reflect before closing the task:

0. **Locate yourself.** — Find this SKILL.md's canonical path before editing.
1. **What failed?** — Fix the instruction that caused it.
2. **What worked better than expected?** — Promote to recommended practice.
3. **What drifted?** — Fix any script, reference, or dependency that no longer matches reality.
4. **Log it.** — Evolution-log entry with trigger, fix, and evidence.

Do NOT defer. The next invocation inherits whatever you leave behind.

© terrylica · MIT · terrylica/cc-skills

Похожие скиллы

Все скиллы по теме «DevOps и инфраструктура» →
ops-inbox Lifecycle Innovations Limited Скилл ops-inbox сканирует входящие сообщения во всех подключённых каналах и помогает разобрать переписки до нуля. CX Codex +1 ★ 3 785звёзд репо telegram-bot claude-office-skills Скилл telegram-bot для Claude Code и других платформ: чат-боты, уведомления, ИИ-ассистенты и автоматизация групп. Собирает обработчики сообщений и сценарии. CX Codex +1 6 500установок telegram-group-analytics-bot reason-machines Скилл telegram-group-analytics-bot собирает статистику Telegram-группы: прирост участников, сообщения, активность по часам и автоматические отчёты. CX Codex +1 615установок binance-futures-signal-bot reason-machines Скилл binance-futures-signal-bot для настройки торгового бота на фьючерсах Binance, Bybit и OKX: сигналы из Telegram, TradingView и своего API, стратегии и дашборд P&L. CX Codex +1 608установок bot-developer curiositech Скилл bot-developer для Claude Code помогает проектировать ботов для Discord, Telegram и Slack — от обработки событий до ограничений запросов и модерации. Описывает чат-ботов с диалогами в несколько ходов. CX Codex +1 218установок telegram-bot-broadcast mrhlaingbwardev Скилл telegram-bot-broadcast для Claude Code проверяет Telegram-ботов и помогает отправлять сообщения в каналы и группы. Запускается по запросам о токенах ботов, подписчиках и массовых публикациях. CX Codex +1 ★ 326звёзд репо

Из того же набора79

Весь набор →
distributed-job-safety Скилл distributed-job-safety для Claude Code находит гонки и сбои в параллельных пайплайнах на pueue, moon и systemd-run. Выявляет риски при одновременной записи файлов и работе с общими ресурсами. CX Codex +1 120установок project-directory-migration Скилл project-directory-migration переносит сессии, историю и контекст Claude Code, когда вы переименовываете или перемещаете папку проекта. Работает в интерактивном режиме с dry-run проверкой и откатом. CX Codex +1 119установок infra-deploy Скилл infra-deploy разворачивает self-hosted Cal.com в GCP Cloud Run с базой Supabase PostgreSQL или поднимает его локально через Docker Compose. CX Codex +1 119установок email-triage Скилл email-triage для Claude Code сортирует недавние письма Gmail по трём категориям и уровням срочности. Разбирает входящие по запросу через команду бота /digest. CX Codex +1 117установок interactive-bot Скилл interactive-bot объясняет устройство Telegram-бота Gmail Commander: слэш-команды для почты, ИИ-роутинг свободного текста через MCP, сессии compose/reply. CX Codex +1 114установок symmetric-dogfooding Скилл symmetric-dogfooding организует двустороннее интеграционное тестирование между двумя репозиториями перед релизом без использования моков. CX Codex +1 112установок calcom-access Скилл calcom-access для Claude Code и пяти других платформ даёт агенту доступ к Cal.com API для работы с бронированиями, типами событий, расписаниями и доступностью слотов. Ключ API берётся из 1Password через CALCOM_OP_UUID. CX Codex +1 107установок claude-code-proxy-patterns Скилл claude-code-proxy-patterns описывает схемы прокси для маршрутизации моделей Claude Code к разным провайдерам. Пригодится при настройке OAuth и разборе ошибок авторизации. CX Codex +1 106установок

Ещё в каталоге

Спонсоры проекта

Компании, которые помогают держать аналитику открытой