Skip to content

Commit 8080c72

Browse files
Render /list-claude-pr-status output as a markdown table (#1437)
The command previously left table rendering to the assistant. Move formatting into the script itself so output is a complete, ready-to-show markdown table with clickable PR links, READY rows first then RUNNING. Add an explicit fallback message for the empty-result case. Verified locally against current open claude/* PRs and against an empty TSV before opening the PR. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f75e4dd commit 8080c72

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

.claude/commands/list-claude-pr-status.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: List Claude-authored PRs that haven't failed (ready or still running) with their actual check state
33
---
44

5-
List open PRs authored by Claude (branches starting with `claude/`) that have **not** had any check fail. Show each PR's actual state (READY when all checks finished green, RUNNING when sweeps are still queued/in-progress) along with a per-status check breakdown.
5+
List open PRs authored by Claude (branches starting with `claude/`) that have **not** had any check fail. Show each PR's actual state (READY when all checks finished green, RUNNING when sweeps are still queued/in-progress) along with a per-status check breakdown, rendered as a markdown table.
66

77
## Step 1 — list candidate `claude/*` PRs
88

@@ -49,13 +49,21 @@ while IFS=$'\t' read -r pr title; do
4949
done < /tmp/claude_pr_candidates.tsv
5050
```
5151

52-
## Step 3 — present the result
52+
## Step 3 — render markdown table
5353

54-
Sort READY first, then RUNNING. Render a markdown table with columns:
54+
Print the result directly as a markdown table. READY rows first, then RUNNING. Each PR is a clickable link.
5555

56-
| PR | State | Check breakdown | Title |
57-
|---|---|---|---|
56+
```bash
57+
{
58+
printf '| PR | State | Check breakdown | Title |\n'
59+
printf '|---|---|---|---|\n'
60+
# READY first, then RUNNING; within each group keep input order (descending PR number from gh)
61+
awk -F'\t' '$2 == "READY"' /tmp/claude_pr_status.tsv
62+
awk -F'\t' '$2 == "RUNNING"' /tmp/claude_pr_status.tsv
63+
} | awk -F'\t' 'NR<=2 {print; next}
64+
{printf "| [#%s](https://github.com/SemiAnalysisAI/InferenceX/pull/%s) | %s | `%s` | %s |\n", $1, $1, $2, $3, $4}'
65+
```
5866

59-
Each PR cell should be a markdown link to `https://github.com/SemiAnalysisAI/InferenceX/pull/<number>`. The check breakdown column should show the per-state counts (e.g. `SUCCESS=44 SKIPPED=7 NEUTRAL=1` or `SUCCESS=9 QUEUED=34 IN_PROGRESS=14 SKIPPED=6 NEUTRAL=1`).
67+
If `/tmp/claude_pr_status.tsv` is empty, print: `_No claude/* PRs are currently READY or RUNNING — all open Claude PRs have failures or no sweep results._`
6068

61-
Do **not** auto-merge. This command is informational only.
69+
Output the resulting markdown table to the user verbatim. This command is informational only — do **not** auto-merge.

0 commit comments

Comments
 (0)