Skip to content

feat: add watch-comments skill#7

Merged
kvendrik merged 5 commits intomainfrom
feat/watch-comments-skill
Apr 9, 2026
Merged

feat: add watch-comments skill#7
kvendrik merged 5 commits intomainfrom
feat/watch-comments-skill

Conversation

@kvendrik
Copy link
Copy Markdown
Owner

@kvendrik kvendrik commented Apr 9, 2026

Summary

Adds a skill + Bun script for watching GitHub repos for new comments on issues and PRs.

Usage

# Watch all open issues + PRs
bun watch-comments.ts owner/repo

# Watch one PR only
bun watch-comments.ts owner/repo --pr 42

# One-shot check (run once and exit)
bun watch-comments.ts owner/repo --once

What it does

  • Polls all three GitHub comment streams per PR: top-level comments, inline review comments, submitted review bodies
  • Persists seen comment IDs to state/<owner>-<repo>.json — no duplicate notifications across restarts
  • Prints new comments to stdout with author, timestamp, URL, and a 300-char preview
  • Sends Telegram notifications if TELEGRAM_BOT_TOKEN + TELEGRAM_CHAT_ID are in the environment
  • Supports background execution with log/PID file pattern documented in the skill

Files

  • skills/watch-comments/scripts/watch-comments.ts — the poller (300 lines, Bun)
  • skills/watch-comments/SKILL.md — usage docs, all flags, background pattern, state management
  • skills/watch-comments/state/.gitkeep — keeps the state dir in the repo; *.json files are gitignored

Backoffice added 5 commits April 9, 2026 09:10
- Clamp minutes to 1–20 (default 5), times to 1–3 (default 1)
- Serve HTML as application/octet-stream to prevent browser JS execution
- Sanitize Content-Disposition filename (strip control chars and quotes)
- Re-read store before decrement to narrow concurrent-request race window
Adds a skill + script for polling GitHub repos for new comments on
issues and PRs.

Script (scripts/watch-comments.ts):
- Takes <owner/repo> as the first arg
- Flags: --interval, --pr, --issue, --once, --state-dir
- Checks all three GitHub comment streams per PR:
  issue comments, inline review comments, submitted review bodies
- Persists seen comment IDs to state/<owner>-<repo>.json so it
  never re-reports old comments across runs
- Prints new comments to stdout
- Sends Telegram notifications if TELEGRAM_BOT_TOKEN + TELEGRAM_CHAT_ID
  are set in the environment

Skill (SKILL.md):
- Quick start commands for all watch modes
- Background execution pattern with PID tracking
- Log tailing and watcher health check
- Telegram setup
- State file management (reset, custom dir)
- Options reference table
- Rename skill watch-comments -> gh-comments
- Rename script watch-comments.ts -> gh-comments.ts
- Default mode: fetch new comments once and exit
- --watch flag: poll continuously (previous behaviour)
- --all flag: ignore state, show all comments
- Update SKILL.md to match new interface
@kvendrik kvendrik merged commit d228703 into main Apr 9, 2026
1 check passed
@kvendrik kvendrik deleted the feat/watch-comments-skill branch April 9, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant