Created
February 20, 2026 14:48
-
-
Save smith/498d8a2d3d04d319c17d4e02874c263a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| description: Code review workflow — triggered by "let's do code review", "review", or "review <number/URL>" | |
| globs: | |
| alwaysApply: false | |
| --- | |
| ## Code Review Process | |
| When the user says "let's do code review", "review", or similar: | |
| ### 1. Fetch requested reviews | |
| Use `gh` to find PRs where review is requested from the user, excluding drafts: | |
| ```bash | |
| gh api 'search/issues?q=type:pr+state:open+review-requested:smith+-is:draft+sort:created-asc&per_page=100' --jq '.items[] | {number, title, html_url, created_at, repository_url, user: .user.login}' | |
| ``` | |
| This covers all repos (kibana, observability-dev, other elastic repos) — the equivalent of https://github.com/pulls?q=is%3Aopen+is%3Apr+review-requested%3Asmith. | |
| ### 2. Present the oldest PR first | |
| Show a **one-page summary** of the oldest non-draft PR: | |
| - Title, author, repo, PR number/link, age | |
| - Description summary (from PR body) | |
| - Files changed: count and key areas affected | |
| - CI status (passing/failing) | |
| - Key changes: a concise technical summary of what the PR does | |
| - Relevant Kibana areas (plugins, packages, configs) | |
| - Whether it has Storybook stories | |
| - Whether there's a relevant UI page to navigate to | |
| Use `gh api` to fetch PR details, diff stats, files changed, and checks. | |
| ### 3. "review X" — review a specific PR | |
| If the user says "review 12345" or "review https://github.com/elastic/kibana/pull/12345", find that PR in their review-requested list and present the same summary. | |
| ### 4. Checking out and running | |
| When the user asks to check it out: | |
| - Follow the **kibana-sre-session-start** rule to check out the branch and get Kibana running | |
| - For Kibana PRs: `git fetch origin pull/<number>/head:<branch> && git checkout <branch>`, then bootstrap + start | |
| - If the PR includes Storybook stories, offer to start Storybook | |
| - If there's a relevant UI page, navigate Playwright there so the user sees the change in-browser | |
| ### 5. No reviews pending | |
| If there are no requested reviews, report that and ask the user about the next workflow (failing tests, assigned issues, etc.). | |
| ## Important | |
| - **Never fetch or show draft PRs.** The search query excludes them; if one slips through, skip it. | |
| - Work oldest to newest. | |
| - The user's GitHub handle is `smith`. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment