Skip to content
Closed
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
90 changes: 90 additions & 0 deletions .claude/skills/argent-find-testable-prs/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
name: argent-find-testable-prs
description: Scans open Expensify App PRs and filters to the mobile-native ones (the platforms the argent-qa-pr skill can actually drive), outputting a candidate shortlist with raw signals. It does NOT rate difficulty — the agent judges difficulty + setup/feasibility per candidate by reading the full PR. Use when asked "what PRs can I test/QA", "find PRs to test on mobile", "list QA candidates", or to pick the next PR for argent-qa-pr.
allowed-tools: Bash, Read, Write, Edit
---

# argent-find-testable-prs

The **scout** for the `[[argent-qa-pr]]` skill. Its job is the cheap, high-volume part: scan
open `Expensify/App` PRs and **filter to the ones `argent-qa-pr` can actually run** (mobile-native),
so you don't read 100 issue bodies by hand. It does **not** rate difficulty or decide testability —
**that judgment is yours** (the agent's), made per candidate from the full PR context. Scout filters;
you judge.

## When to use / not use
- **Use** to get the mobile-native candidate shortlist, then judge + pick the next one for `argent-qa-pr`.
- **Not** for actually testing a PR (that's `argent-qa-pr`), and not for web-only work.

## How to run

```bash
node .claude/skills/argent-find-testable-prs/helpers/scan-prs.mjs --limit 100 --json ai-qa-poc/triage-scan.json
```
Requires the `gh` CLI authenticated. Prints a markdown table of candidates (factual columns +
raw signals), then a collapsed skipped section, and writes JSON. Rows are **identified by PR number**
— the scout does **no** ranking or numbering (that's yours, after judging). One issue fetch per PR,
so a large `--limit` takes a little while — start at `--limit 80–120`.

**What the scout does (mechanical only — no judgment):**
1. Skip drafts, `[No QA]`, `[WIP]`/`[HOLD]`/revert.
2. Resolve the **linked issue** and read its **`## Platforms`** checkboxes.
3. Keep only PRs where **iOS App and/or Android App** is reproduced (mWeb is a browser → doesn't
count). Web/mWeb-only → `SKIPPED_WEB_ONLY`; no Platforms checklist → `SKIPPED_OTHER`; no linked
issue → `UNKNOWN`.
4. Emit each candidate's **platforms**, **repro step count**, and **raw keyword signals** (e.g.
`accounting`, `offline`, `signup`, `rooms`). **Signals are factual hints to prioritize reading
order — NOT a difficulty/feasibility verdict** (they over/under-fire: e.g. a stray "onboarding").

## Then YOU judge each candidate (the part that isn't a script)

For each candidate worth considering, **pull the full context and judge it yourself** — this is
where project knowledge beats keyword matching:

```bash
gh pr view <n> --repo Expensify/App --json title,body,headRefName
gh issue view <issue> --repo Expensify/App --json body # + follow the PROPOSAL link in the body
gh pr diff <n> --repo Expensify/App # pin the exact element + any beta/layout gate
```

Then rate **how hard to TEST** (not how hard to fix) and **plan the setup**, using the same lens as
`argent-qa-pr` Phase 1.5 (surmountable prep vs real blocker):

| | What it usually means |
| --- | --- |
| 🟢 **Easy** | pure UI / visual / navigation; logged-out or few steps; no data/state setup |
| 🟡 **Medium** | needs some state you can prepare — offline toggle, native share, a workspace/room/expense, a `+tag` fresh account, onboarding, a deep-link/gated entry |
| 🔴 **Hard** | heavy but still doable setup — multi-account (copilot/delegate via `+tag`), roles/workflows |
| **NOT_TESTABLE** | a **live external integration you can't stand up locally** — accounting (QBO/Xero/NetSuite/Sage/Certinia), bank/Plaid, card issuing, real payments — or a **backend-gated** beta |

Reason about **surmountable vs blocker** (don't treat prep as a wall): a fresh account is a `+tag`
alias, a missing workspace/room is created in-app, a UI-gating beta is an Onyx override, a hard-to-reach
screen is a deep link, a web precondition (OldDot signup) is done in a browser. Only genuine external
integrations are `NOT_TESTABLE`. Full recipes: `argent-qa-pr` → `references/methodology.md`.

## Output & next step

**Always present your judged candidates as a markdown table** (this is the required output format —
not a prose list). Sort rows by your verdict (testable easiest-first → harder-but-doable →
`NOT_TESTABLE` → already-done) and number them `1..N` in that order in a leading **`#`** column so the
user can pick by `#`. The scout itself does no numbering; you add it here. Use exactly these columns:

```
| # | PR | Title | Platforms | Difficulty | Setup |
| --- | --- | --- | --- | --- | --- |
| 1 | #93425 | avatar discard-changes guard | iOS | 🟢 best pick | change own avatar → back; self-contained |
| 2 | #93200 | scroll workspace list to top | Android | 🟡 clean | `+tag` fresh acct (no workspaces) + landscape |
| … | … | … | … | … | … |
| 7 | #93217 | Certinia export status | Android+iOS+web | ⛔ NOT_TESTABLE | needs Certinia connection |
```

- `#` = your rank (user picks by it); **PR number** stays as the stable id (`argent-qa-pr` takes it).
- Under the table, **recommend the top picks** — favor single-platform, self-contained, read-only
flows (least flaky), and call out which need prep vs which are blocked.
- Optionally fold the rows + your verdicts into **`ai-qa-poc/triage-log.md`** so reasons persist.
- To test a chosen PR: run **`argent-qa-pr <PR-number>`**.

## References
- Pairs with **`[[argent-qa-pr]]`** — same mobile-only scope, same surmountable-vs-blocker lens, same
`ai-qa-poc/` outputs. Scout filters; `argent-qa-pr` (and your judgment) does the rest.
- Helper: `helpers/scan-prs.mjs` (zero extra deps — only needs `gh` + Node).
130 changes: 130 additions & 0 deletions .claude/skills/argent-find-testable-prs/helpers/scan-prs.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
#!/usr/bin/env node
/**
* scan-prs.mjs — scan open Expensify/App PRs, keep the mobile-native ones, and rate how
* hard each would be to QA with the `argent-qa-pr` skill (🟢 Easy / 🟡 Medium / 🔴 Hard).
*
* node scan-prs.mjs [--limit 80] [--json <path>]
*
* Prints a markdown table (candidates easy→hard, then a collapsed skipped section).
* Requires the `gh` CLI to be authenticated. One issue fetch per PR, so it's a bit slow.
*
* The rating is a heuristic first pass from the linked issue's reproduced platforms +
* keyword flags + step count. It is meant to be sanity-checked by a human/agent, not
* trusted blindly — see SKILL.md.
*/
import {execSync} from 'node:child_process';
import fs from 'node:fs';

const arg = (n, d) => {
const i = process.argv.indexOf(`--${n}`);
return i >= 0 && process.argv[i + 1] ? process.argv[i + 1] : d;
};
const LIMIT = parseInt(arg('limit', '80'), 10);
const JSON_OUT = arg('json', '');
const REPO = 'Expensify/App';
const gh = (c) => {
try {
return execSync(c, {maxBuffer: 1e8, stdio: ['ignore', 'pipe', 'ignore']}).toString();
} catch (e) {
return e.stdout ? e.stdout.toString() : '';
}
};
const sec = (b, s, e) => {
const i = b.search(new RegExp(s, 'i'));
if (i < 0) return '';
const x = b.slice(i + s.length);
const j = e ? x.search(new RegExp(e, 'i')) : -1;
return (j < 0 ? x : x.slice(0, j)).trim();
};

console.error(`Scanning up to ${LIMIT} open PRs in ${REPO}...`);
const prs = JSON.parse(gh(`gh pr list --repo ${REPO} --state open --limit ${LIMIT} --json number,title,body,isDraft`) || '[]');
const rows = [];
const counts = {webOnly: 0, other: 0, noIssue: 0, drafts: 0};

for (const p of prs) {
if (p.isDraft) {
counts.drafts++;
continue;
}
if (/\[no ?qa\]/i.test(p.title)) {
counts.other++;
continue;
}
if (/\[(wip|hold)\]|\b(revert|do not merge|dnm)\b/i.test(p.title)) {
rows.push({pr: p.number, issue: '', title: p.title, plat: '', diff: '—', status: 'SKIPPED_OTHER', note: 'WIP / hold / revert'});
counts.other++;
continue;
}
const m = (p.body || '').match(/issues\/(\d+)/);
if (!m) {
counts.noIssue++;
rows.push({pr: p.number, issue: '', title: p.title, plat: '?', diff: '?', status: 'UNKNOWN', note: 'no linked issue — triage by hand'});
continue;
}
const issue = m[1];
const ij = JSON.parse(gh(`gh issue view ${issue} --repo ${REPO} --json body`) || '{}');
const b = ij.body || '';
const checked = b
.split('\n')
.filter((l) => /\[x\]/i.test(l) && /(Android|iOS|mWeb|MacOS|Windows)/i.test(l))
.map((l) => l.replace(/^\s*-?\s*\[x\]\s*/i, '').trim());
const native = checked.filter((c) => /^(Android: App|iOS: App)/i.test(c)).map((c) => c.split(':')[0].trim());
const hasWeb = checked.some((c) => /Windows|MacOS|mWeb/i.test(c));
if (native.length === 0) {
if (hasWeb) {
counts.webOnly++;
rows.push({pr: p.number, issue, title: p.title, plat: 'web/mWeb', diff: '—', status: 'SKIPPED_WEB_ONLY', note: 'only web/mWeb reproduced'});
} else {
counts.other++;
rows.push({pr: p.number, issue, title: p.title, plat: '—', diff: '—', status: 'SKIPPED_OTHER', note: 'no Platforms checklist (refactor/chore/tracking?) — triage by hand'});
}
continue;
}
const action = sec(b, '## Action Performed:?', '## Expected');
const steps = action.split('\n').filter((l) => /^\s*\d+\./.test(l)).length;
const lo = b.toLowerCase();
// Raw keyword SIGNALS — factual hints only (NOT a verdict). They help the agent decide which
// candidates to deep-dive first. The scout does NOT rate difficulty or setup: the agent judges
// that per candidate by reading the full PR + linked issue/PROPOSAL + `gh pr diff` (see SKILL.md).
const sig = [];
if (/qbo|quickbooks|xero|netsuite|sage|intacct|certinia|accounting/.test(lo)) sig.push('accounting');
if (/plaid|bank account|company card|expensify card|reimburs/.test(lo)) sig.push('bank/card');
if (/copilot|delegate/.test(lo)) sig.push('copilot/delegate');
if (/invite member|approver|workflow|submit workspace|\badmin\b/.test(lo)) sig.push('ws/roles');
if (/offline|airplane/.test(lo)) sig.push('offline');
if (/4 finger|four finger|test tool|biometric/.test(lo)) sig.push('test-tool');
if (/share (a )?(photo|image)|share sheet|native share/.test(lo)) sig.push('native-share');
if (/deep ?link|\/r\//.test(lo)) sig.push('deeplink');
if (/sign ?up|new gmail|new account/.test(lo)) sig.push('signup');
if (/onboarding|employee step/.test(lo)) sig.push('onboarding');
if (/\brooms?\b/.test(lo)) sig.push('rooms');
if (/(log|sign) ?out|logged ?out|anonymous|anon user/.test(lo)) sig.push('logged-out');

rows.push({pr: p.number, issue, title: p.title, plat: native.join('+') + (hasWeb ? '+web' : ''), status: 'CANDIDATE', signals: [...new Set(sig)].join(', '), steps});
}

const cands = rows.filter((r) => r.status === 'CANDIDATE');
const skipped = rows.filter((r) => r.status !== 'CANDIDATE');
const esc = (s) => (s || '').replace(/\|/g, '\\|').slice(0, 70);
// No row numbering here — PRs are identified by PR number. The agent re-ranks/numbers after judging.
const line = (r) => `| [#${r.pr}](https://github.com/Expensify/App/pull/${r.pr}) | ${r.issue || '—'} | ${esc(r.title)} | ${r.plat || ''} | ${r.status} | ${esc(r.note)} |`;
// Candidate line: FACTUAL columns only (platforms, step count, raw signals) — no verdict.
const cline = (r) => `| [#${r.pr}](https://github.com/Expensify/App/pull/${r.pr}) | ${r.issue || '—'} | ${esc(r.title)} | ${r.plat || ''} | ${r.steps || '?'} | ${esc(r.signals) || '—'} |`;

let out = `## Mobile-native QA candidates (${cands.length}) — agent judges each\n\n`;
out += "_The scout only filters to **mobile-native** PRs. **Difficulty + setup/feasibility is the agent's call**:\n";
out += 'for each candidate, read the full PR body + linked issue/PROPOSAL + `gh pr diff <n>`, then rate it and\n';
out += 'plan the setup (see `argent-qa-pr` SKILL.md → Phase 1.5). "Signals" below are raw keyword hits to help\n';
out += 'prioritize which to open first — they are NOT a verdict._\n\n';
out += '| PR | Issue | Title | Platforms | Steps | Signals (raw hints) |\n|---|---|---|---|---|---|\n';
out += cands.map((r) => cline(r)).join('\n') + '\n\n';
out += `<details><summary>Skipped / web-only / other (${skipped.length})</summary>\n\n`;
out += '| PR | Issue | Title | Platforms | Status | Note |\n|---|---|---|---|---|---|\n';
out += skipped.map((r) => line(r)).join('\n') + '\n</details>\n';
console.log(out);
console.error(`\nScanned ${prs.length} PRs → ${cands.length} candidates, ${counts.webOnly} web-only, ${counts.other} chore/WIP/NoQA, ${counts.noIssue} no-issue, ${counts.drafts} drafts.`);
if (JSON_OUT) {
fs.writeFileSync(JSON_OUT, JSON.stringify({generatedAt: new Date().toISOString(), candidates: cands, skipped}, null, 2));
console.error('Wrote ' + JSON_OUT);
}
11 changes: 11 additions & 0 deletions .claude/skills/argent-qa-pr/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Never commit real secrets. Each user fills in their own gitignored .env
# (from .env.example). These patterns are a safety net.
.env
.env.*
# ...but DO commit the template:
!.env.example
*.secret
**/credentials*

# Helper deps (installed locally, not committed)
node_modules/
Loading
Loading