codex-pr-planlisted
Install: claude install-skill kookr-ai/kookr
## When to Use
This skill is invoked at the start of each codex-pr-lessons iteration. It reads the current state, determines which PRs to fetch next, and prepares the batch.
## Non-Negotiable Rules
| # | Rule | Violation Example | Correct Pattern |
|---|------|-------------------|-----------------|
| 1 | Always read state.json before fetching PRs | Fetching PRs without checking processed list | `cat ~/.claude/codex-pr-lessons/state.json` first |
| 2 | Batch size is exactly 5 | Processing 10 or 20 PRs at once | Fetch 5 closed+merged PRs per iteration |
| 3 | Use cursor for pagination | Re-fetching from page 1 every time | Use `state.json.cursor` to continue from last position |
| 4 | Skip already-processed PRs | Analyzing PR #123 that's in processed_prs | Filter out all IDs in processed_prs and skipped_prs |
| 5 | Include both merged AND closed-unmerged PRs | Only looking at merged PRs | Closed-unmerged PRs teach what NOT to do |
## Workflow
### Step 1: Load state
```bash
cat ~/.claude/codex-pr-lessons/state.json
```
### Step 2: Fetch next batch of closed PRs
Use GitHub API with cursor-based pagination. Fetch closed PRs sorted by recently updated, mixing merged and unmerged:
```bash
# Fetch closed PRs (both merged and closed-without-merge)
# Use cursor from state to avoid re-processing pages
gh api "repos/openai/codex/pulls?state=closed&sort=updated&direction=desc&per_page=20&page={cursor_or_1}" \
--jq '.[] | {number, title, merged_at, closed_at, user: .user.login,