pr-preflight
The pr-preflight skill runs a comprehensive merge-readiness check before opening or merging pull requests in the liaohch3/claude-tap repository. It validates PR metadata, GitHub Actions CI status, local gates including linting and testing via ruff and pytest, and PR body policy requirements, returning a READY or NOT_READY verdict with specific failure reasons and appropriate exit codes for automation integration.
git clone --depth 1 https://github.com/liaohch3/claude-tap /tmp/pr-preflight && cp -r /tmp/pr-preflight/.agents/skills/pr-preflight ~/.claude/skills/pr-preflightSKILL.md
# PR Preflight One-command merge-readiness check that combines local gates, CI status, and PR policy checks. Mirrors what reviewers look for so issues are caught before review, not during. ## Check an existing PR ```bash scripts/check_pr.sh <pr_number> ``` This runs: 1. **PR metadata** — fetches title, state, draft status, merge state, branch info 2. **CI checks** — counts pass/fail/pending GitHub Actions checks 3. **Local gates** — runs lint, format, and tests locally: - `uv run ruff check .` - `uv run ruff format --check .` - `uv run pytest tests/ -x --timeout=60` 4. **PR body policy** — validates required sections, evidence links, and blocked artifacts 5. **Verdict** — `READY` or `NOT_READY` with specific reasons ### Options | Flag | Purpose | |------|---------| | `--repo OWNER/REPO` | Override repository (default: auto-detect via `gh`) | | `--no-tests` | Skip local test gates (useful when you just want CI + metadata check) | ### Exit codes | Code | Meaning | |------|---------| | 0 | All checks passed — ready to merge | | 1 | Script error (missing tool, network failure) | | 2 | Not ready — at least one check failed | ## Run local gates only (no PR needed) If you haven't opened a PR yet and just want to validate locally: ```bash uv run ruff check . && uv run ruff format --check . && uv run pytest tests/ -x --timeout=60 ``` Or use the pre-commit hook (auto-runs lint on commit): ```bash git config core.hooksPath .githooks ``` ## What blocks merge The script reports `NOT_READY` if any of these are true: - PR is not in OPEN state - PR is still a draft - Merge state is not CLEAN or HAS_HOOKS - Any CI check is failing - Any CI check is still pending - Local gates (lint/format/tests) fail - PR body policy fails, such as missing evidence for runtime/viewer/client changes ## Typical workflow ```bash # 1. Make sure local gates pass uv run ruff check . && uv run ruff format --check . && uv run pytest tests/ -x --timeout=60 # 2. Push and open PR git push origin my-branch gh pr create --title "feat: ..." --body "..." # 3. Wait for CI, then run full preflight scripts/check_pr.sh <pr_number> ```
Generate demo assets (GIF/MP4) from real tmux E2E runs and viewer screenshots using asciinema and Playwright
Test JS logic embedded in HTML using two-layer strategy - Python unit tests + Playwright browser integration tests
Validate maintainer docs structure, standards freshness, manifest paths, and plan state. Run this after modifying any file under .agents/docs/standards/, .agents/docs/plans/, .agents/docs/architecture/, or AGENTS.md — it catches stale metadata, broken manifest paths, and plan state drift before CI does.
Record browser test videos with Playwright for PR review and bug fix verification
Push to GitHub and optionally bump version to trigger PyPI release
Validate screenshot and viewer HTML quality for PR evidence. Run this after adding or modifying images under .agents/evidence/pr/ or .agents/recordings/, or after generating a new viewer HTML file. Combines image quality checks (resolution, blankness, file size) with Playwright-based viewer rendering verification.
Fill missing i18n translations in the viewer source JSON. Run this after adding or modifying English or Chinese UI strings in claude_tap/viewer_i18n.json — it auto-translates to ja, ko, fr, ar, de, ru via OpenRouter.