AGENT SKILL

resume

暂无简介

适用职业人力资源
License 许可
MIT
所属仓库
vjt/claude-ircbot
最近更新
2026-11-12
Stars
★ 0
Forks
3

03 SKILL.md 正文

/resume — warm rehydrate after a /clear

The watchdog fires this after every /clear — this is the hot path, run thousands of times, so it must stay lean. This file is the canonical bringup protocol and is self-contained: never pull in /start to "understand" a step — doing so reloads the heavy cold-boot skill on every clear and burns the tokens this split exists to save. Everything needed to execute is right here. (Cold boot runs /start, which does its cold-only setup and then defers back to these same four steps.)

After /clear, CLAUDE.md + MEMORY.md auto-load; the activity-log body and the live bot state do NOT. These steps reseed that. Do it silently — no narration unless WIP found.

1. Reseed context from the activity log

grep -nE '^### [0-9]{4}-[0-9]{2}-[0-9]{2}' memory/project_activity_log.md
  • If today's ### YYYY-MM-DD heading (vs currentDate) is missing, append it at the bottom.
  • Read today's heading body in full (Read with offset at today's heading line → EOF). This is the mandatory seed: today's events, in-flight threads, PENDING/DA FARE markers reach you ONLY here. Skipping it = waking blind. If today's body is thin, also read yesterday's.
  • Trim is NOT done here — it's disk hygiene, not token hygiene (the log is read-on-demand, never auto-loaded, so an untrimmed log costs zero per-clear tokens). /start owns the >14d archive sweep.

2. Adopt the Monitors — THREE streams (don't duplicate)

Three event streams, three separate Monitors: Azzurra and Libera (same bot.py, two separate processes, each with its OWN stdout stream — the Azzurra Monitor never sees Libera events and vice-versa) plus Telegram (@gazzurbo_bot long-poller, a different transport entirely). The tail -F pipelines survive /clear; the Monitor task registrations do not. Handle ALL THREE. Libera and Telegram are the easy-to-forget ones — their processes often do NOT survive, so you usually attach them fresh even when Azzurra's got adopted. (IRCnet: quittato e unit disabilitata il 2026-11-03, ordine vjt — niente monitor.)

pgrep -af "tail -F.*vjt-claude/bot.stdout.log"          # Azzurra
pgrep -af "tail -F.*vjt-claude/bot.libera.stdout.log"   # Libera
pgrep -af "[t]g_poll.sh"                                # Telegram
systemctl --user is-active vjt-claude-bot.service vjt-claude-libera-bot.service \
  vjt-claude-aup-watchdog.service

For EACH stream independently:

  • pgrep hit on its *stdout.log → adopt it, skip attach (note monitor adopted (pid <n>)). A hit on bot.log / bot.libera.log (NOT *stdout.log) is a stale pre-2026-05-06 orphan — kill it, attach fresh.
  • No hit → attach one fresh Monitor:
    • Azzurra:
      Monitor: command: bash /home/vjt/code/IRC/vjt-claude/.claude/skills/start/start-monitor.sh
               persistent: true, timeout_ms: 3600000
               description: "IRC bot events (msgs+trust, invites, errors)"
      
    • Libera:
      Monitor: command: bash /home/vjt/code/IRC/vjt-claude/.claude/skills/start/start-monitor-libera.sh
               persistent: true, timeout_ms: 3600000
               description: "Libera IRC bot events (#grappa)"
      
    • Telegram (the support group and the group vjt and I share — who's in them and which chat is which lives in [[project_melablu_support]] / [[reference_telegram_bridge_handles]], not in this repo):
      Monitor: command: bash /home/vjt/code/IRC/vjt-claude/var/tg_poll.sh
               persistent: true, timeout_ms: 3600000
               description: "Telegram @gazzurbo_bot messages (Melablu support + shared group)"
      
      Token lives at ~/.config/gazzurbo/token (600, never printed); the poller persists its getUpdates offset in var/tg_offset, so a restart replays nothing. Reply with var/tg_say.sh (stdin, TG_CHAT_ID= to pick the chat). Only ONE poller may run — a second getUpdates on the same token gets 409 Conflict and both starve.
  • m42 alarms (4th Monitor, always attach fresh — vjt 2026-11-03: «metti dei monitor su questi eventi così puoi reagire»). The siem-* systemd user timers (/srv/siem/systemd/, scripts in /srv/siem/alarms/) DM vjt and append each alert to ~/.local/state/m42-alarms.log; this lets me see them too and act (investigate on m42, tell vjt):
    Monitor: command: tail -n0 -F /home/vjt/.local/state/m42-alarms.log /home/vjt/.local/state/pf-alarm.err /home/vjt/.local/state/mail-auth-alarm.err 2>/dev/null | /usr/bin/grep --line-buffered -v -e '^==> ' -e '^$'
             persistent: true, timeout_ms: 3600000
             description: "m42 security alarms (pf + mail auth) and alarm script errors"
    
    /usr/bin/grep, never bare grep: in an inline Monitor command the shell snapshot turns grep into the bundled ugrep, which on a tail -F pipe passes the blank lines and eats the content lines — measured 2026-11-12, the m42 alarms of 13:00 and 13:50 never arrived. Scripts (start-monitor*.sh, tg_poll.sh) are not affected: they get the real grep.
  • Any service not active → systemctl --user start <svc> (linger means they usually survive).

3. WIP sweep — resume only true gaps

git status --short
/home/vjt/code/IRC/vjt-claude/tools/sweep-bot-log.sh 50
  • Untracked/modified files = unfinished edits → read, finish (unless next step is destructive).
  • The sweep applies the SAME per-channel read policy as the Monitor (tools/chan_filter.awk, shared with start-monitor.sh): #italia dropped, #sniffo only the lines that name me plus my own outbound. Do not go back to a raw tail on bot.log — that bypasses the filter and re-reads channels I am not supposed to read (vjt, query 2026-09-10: "non avresti dovuto vederlo").
  • bot.log: read inbound AND outbound interleaved. For each inbound addressed to me, scan outbound with later timestamp in same chan/nick — if it plausibly answers, already handled, do not reply. Only true gaps (inbound, no matching outbound after) get a reply. Half-sent line → finish it.
  • When in doubt between replying and silence, stay silent. A dupe is worse than a miss.
  • Telegram has no log to sweep: a TG message landing during the /clear reaches nobody (2026-11-11 22:14, vjt's «abilita i quiz di mike» lost). Read the tail of the previous TG Monitor's output: ls -t scratchpad/claude-1000/*/*/tasks/*.output | head → tail the one whose lines start TG chat=, and answer what has no reply.
  • Don't announce "nothing found" — silence is correct when nothing's pending.

4. Report ready

One terse line, e.g. resumed — monitors: azzurra adopted (pid <n>) + libera/telegram attached, 4 svc active, no WIP.

Then resume standing behavior (reply policy, channel registers, activity-log appends) per CLAUDE.md.

04 同仓库更多 Skills