Context-efficient PR comment triage. Evaluate, decide, act. Fix important issues, resolve the rest silently.
Replies are SECONDARY to addressing concerns.
βββββββββββββββββββββββββββββββββββββββββββββββ
β EVALUATE β DECIDE β ACT β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β 1. FETCH UNREPLIED (metadata only) β
β β Get root comments without replies β
β β ~100 bytes/comment, paginated β
β β
β 2. EVALUATE each comment β
β β Fetch body only if path looks importantβ
β β Skip: metadata files, style nits β
β β Check: security, correctness, tests β
β β
β 3. DECIDE action β
β β FIX: implement change, reply, resolve β
β β RESOLVE: close silently, no reply β
β β DEFER: create cell, resolve β
β β
β 4. ACT β
β β Fix issues in code β
β β Resolve threads (not reply) β
β β Reply ONLY when you fixed something β
β β
βββββββββββββββββββββββββββββββββββββββββββββββ
| Comment Type | Action | Reply? |
|---|---|---|
| Security/correctness bug | FIX β reply with commit | β Yes |
| Valid improvement, in scope | FIX β reply with commit | β Yes |
| Valid but out of scope | Create cell β resolve | β No |
| Style/formatting nit | Resolve silently | β No |
| Metadata file (.jsonl, etc) | Resolve silently | β No |
| Already fixed | Reply with commit β resolve | β Yes |
| Disagree with suggestion | Resolve silently | β No |
# Get unreplied root comments (start here)
bun run scripts/pr-comments.ts unreplied owner/repo 42
# Evaluate: fetch body for specific comment
bun run scripts/pr-comments.ts expand owner/repo 123456
# Act: resolve without reply (preferred)
bun run scripts/pr-comments.ts resolve owner/repo 42 123456
# Act: reply then resolve (only when you fixed something)
bun run scripts/pr-comments.ts reply owner/repo 42 123456 "β
Fixed in abc123"
# Helpers
bun run scripts/pr-comments.ts summary owner/repo 42 # File-level overview
bun run scripts/pr-comments.ts list owner/repo 42 # All metadata
import { fetchMetadata, fetchBody, resolveThread, reply, getThreadId } from "./scripts/pr-comments.ts";
const comments = await fetchMetadata("owner/repo", 42);
// Find unreplied root comments
const repliedTo = new Set(comments.filter(c => c.inReplyToId).map(c => c.inReplyToId));
const unreplied = comments.filter(c => !c.inReplyToId && !repliedTo.has(c.id));
for (const c of unreplied) {
// Skip metadata files - resolve silently
if (c.path.endsWith('.jsonl') || c.path.includes('.hive/')) {
const threadId = await getThreadId("owner/repo", 42, c.id);
if (threadId) await resolveThread("owner/repo", threadId);
continue;
}
// Evaluate important files
const full = await fetchBody("owner/repo", c.id);
if (full.body.includes('Critical') || full.body.includes('security')) {
// FIX IT, then reply
// ... implement fix ...
await reply("owner/repo", 42, c.id, "β
Fixed in abc123");
}
// Resolve either way
const threadId = await getThreadId("owner/repo", 42, c.id);
if (threadId) await resolveThread("owner/repo", threadId);
}
.hive/issues.jsonl - auto-generated metadata.hive/memories.jsonl - auto-generated metadata | Action | Context Cost |
|---|---|
unreplied |
~100 bytes/comment |
expand (1 comment) |
~5KB |
resolve |
0 (GraphQL mutation) |
reply |
~200 bytes |
Rule: Fetch <10 bodies per triage session.
scripts/pr-comments.ts - Full SDK with Zod schemasreferences/gh-api-patterns.md - Raw jq patterns, GraphQL, pagination