Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/ralph-two-pass-scan-skill.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

Add ralph-two-pass-scan skill — lightweight issue list scan before selective hydration, cutting Ralph's GitHub API calls by ~72% per round (resolves #596)
35 changes: 35 additions & 0 deletions .squad/skills/ralph-two-pass-scan/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Skill: Ralph — Two-Pass Issue Scanning
**Confidence:** high
**Domain:** work-monitoring
**Last validated:** 2026-03-24
Comment on lines +1 to +4

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This SKILL.md lacks the YAML frontmatter used by the skill tooling (e.g., consult extraction classifies skills by frontmatter containing at least name: and confidence:). Without it, this file may be treated as a generic decision/markdown doc and lose its skill metadata (name/domain) in listings/extraction. Add --- frontmatter with name, description, domain, confidence (and optionally source/tools/triggers/roles) and move/remove the current bold metadata lines to avoid duplication.

Suggested change
# Skill: Ralph — Two-Pass Issue Scanning
**Confidence:** high
**Domain:** work-monitoring
**Last validated:** 2026-03-24
---
name: Ralph — Two-Pass Issue Scanning
description: Two-pass GitHub issue scanning to reduce GitHub API calls via selective hydration.
domain: work-monitoring
confidence: high
last_validated: 2026-03-24
---
# Skill: Ralph — Two-Pass Issue Scanning

Copilot uses AI. Check for mistakes.

## Context
Cuts GitHub API calls from N+1 to ~7 per round (~72% reduction) by separating list scanning from full hydration.

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call-count claim here (“N+1 to ~7 per round”, “~72% reduction”) doesn’t follow from the documented algorithm below. Two-pass scanning changes calls from (1 + N hydrations) to (1 + M hydrations), where M is the number of issues that survive Pass 1 (e.g., with a 30% hydration target and limit 100, that’s up to 31 calls, not ~7). Consider rewriting this to an equation/assumption-based statement so it stays accurate across repos.

Suggested change
Cuts GitHub API calls from N+1 to ~7 per round (~72% reduction) by separating list scanning from full hydration.
Reduces GitHub API calls by moving from full hydration (1 + N calls for N listed issues) to selective hydration (1 + M calls, where M is the number of issues that survive Pass 1 and typically M ≪ N; for example, with N = 100 and a 30% hydration target, this is at most 31 calls vs 101, ~69% reduction) by separating list scanning from full hydration.

Copilot uses AI. Check for mistakes.
Addresses the scanning inefficiency described in issue #596.

## Pattern

### Pass 1 — Lightweight Scan

```
gh issue list --state open --json number,title,labels,assignees --limit 100
```
Comment on lines +14 to +16

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These command snippets omit the language tag on the fenced code block. Other skills typically use tagged fences (e.g., bash / sql) for readability and consistent rendering in docs tooling; consider tagging this block as bash.

Copilot uses AI. Check for mistakes.

**Skip hydration if ANY of these match:**

| Condition | Skip reason |
|-----------|-------------|
| `assignees` non-empty AND no `status:needs-review` | Already owned |
| Labels contain `status:blocked` or `status:waiting-external` | Externally gated |
| Labels contain `status:done` or `status:postponed` | Closed loop |
| Title matches stale/noisy pattern (`[chore]`, `[auto]`) | Low-signal |

### Pass 2 — Selective Hydration

For each issue surviving Pass 1:

```
gh issue view <number> --json number,title,body,labels,assignees,comments,state
```
Comment on lines +31 to +33

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: tag this fenced block with a language (bash) to match the rest of the skill docs and improve readability.

Copilot uses AI. Check for mistakes.

Then apply normal Ralph triage logic. Rule of thumb: hydrate ≤ 30% of scanned list. If more than 30% survive Pass 1, tighten filter rules.
Loading