--- name: pull-request description: Use when preparing, opening, or editing a GitHub pull request in this repository (before running gh pr create or gh pr edit). Enforces PR title format, linked-issue rules, the PR template sections checked by .github/workflows/triage-pr-standards.yml, PR sizing, and pre-push checks including bun run lint:changed. --- # Opening and Updating Pull Requests Run this checklist before `gh pr create` (or when fixing a flagged PR with `gh pr edit`). The automated checks live in `.github/workflows/triage-pr-standards.yml` and `.github/workflows/check.yml`. ## 1. Branch and Base - Base branches on `origin/dev` and target `dev` unless told otherwise. - Branch name: at most three hyphen-separated words, with no slashes or type prefixes (`session-recovery`, not `feat/session-recovery`). ## 2. Size and Scope Inspect `git diff --stat origin/dev...HEAD` before opening: - Keep each PR to one logical change. - If the diff combines independent features or exceeds ~500 changed lines outside tests and generated files across many files, pause and suggest splitting it into smaller PRs first. Automated review closes oversized multi-feature PRs. ## 3. Pre-Push Verification - **GUI packages** (`packages/app/`, `packages/desktop/`, `packages/gui-plugins/`, `packages/plugin/src/gui/`, `packages/ui/`, `packages/session-ui/`): run `bun run lint:changed`. `bun run check` does not run it, while CI's `typecheck` job runs `bun run lint:changed HEAD^1` and fails on warn-level `anti-slop` oxlint rules across any touched file. - Run `bun run lint` and `bun run typecheck:tsc` for affected packages (CI uses `tsc`, not `bun check`). - After changing the public Protocol or Server `HttpApi`, run `bun run generate` from `packages/client`. - Run relevant tests from the affected package directory (never from repo root). ## 4. PR Title `check-standards` validates titles against: ```regex ^(feat|fix|docs|chore|refactor|test)\s*(\([a-zA-Z0-9-]+\))?\s*: ``` - Use a **single** `[a-zA-Z0-9-]+` scope or omit the scope. - Never use comma-separated scopes like `feat(app,desktop):` — they fail `needs:title` and also fail the `feat`/`docs`/`refactor` exemption check in `check-compliance`. ## 5. Linked Issue - `fix`, `chore`, and `test` PRs must reference an existing issue (`Closes #` or `Fixes #`) under `### Issue for this PR`. If none exists, search open issues or ask before opening the PR. - `feat`, `docs`, and `refactor` PRs are exempt from the automated linked-issue check. ## 6. PR Description Read `.github/pull_request_template.md` and preserve all required `###` headings verbatim: - `### Issue for this PR` — `Closes #` (required for `fix`/`chore`/`test`), or `N/A` / `Related to #` for exempt types. - `### Type of change` — at least one `- [x]` checkbox selected. - `### What does this PR do?` — concise explanation of the problem, change, why it works, and which feature flag guards it (or why none is needed, per `AGENTS.md`). Remove template placeholder text and avoid long AI-generated walls of text. - `### How did you verify your code works?` — concrete commands and checks run (must be non-empty). - `### Screenshots / recordings` — before/after screenshots or a short recording for UI changes; brief `N/A` note otherwise. - `### Checklist` — both `- [x]` checkboxes checked (`check-compliance` requires at least 2 checked items). Verify all of the above before calling `gh pr create`.