--- name: raise-pr description: Create a GitHub PR for FlashList. Ensures no AI/Claude attribution in commits or PR body, follows repo conventions for title, description, and test plan. --- # Raise a FlashList PR **Prerequisite:** Run the `review-and-test` skill first. All checks must pass and device testing must be done before raising a PR. **DO NOT SKIP**. ## Rules 1. **NEVER push directly to `main`** — always create a branch and open a PR. 2. **NEVER mention Claude, AI, or any AI tool** in commit messages, PR title, PR body, or comments. No `Co-Authored-By` AI lines. The PR must read as if written entirely by a human. 3. **Only raise a PR when explicitly asked** by the user (exception: on CI, raise directly as part of the fix workflow). --- ## Step 0 — Kill Background Processes (MANDATORY on CI) Before creating the branch and PR, kill any background processes you started (Metro, emulators, etc.). On CI, leftover processes prevent the GitHub Actions job from exiting. ```bash lsof -ti:8081 | xargs kill -9 2>/dev/null || true ``` --- ## Step 1 — Create Branch and Commit ### Branch naming ``` fix/issue-- feat/ refactor/ ``` ### Commit message format ``` fix(): Fixes # ``` Scope examples: `layout`, `hooks`, `scroll`, `sticky-headers`, `recycling`, `viewability`. **Do NOT include**: - `Co-Authored-By` lines - Any mention of Claude, AI, Anthropic, or automated tools - `Generated by` or `Assisted by` attributions ### Commands ```bash git checkout -b fix/issue-- git add git commit -m "$(cat <<'EOF' fix(): Fixes # EOF )" git push -u origin fix/issue-- ``` --- ## Step 2 — Self-Review Run `git diff HEAD~1` and check for: - **Leftover debug code** — `console.log`, `fetch("http://localhost:...")`, temporary comments - **Unrelated changes** — files or hunks that aren't part of the fix - **`Co-Authored-By` lines** — check with `git log -1 --format=full` - **Fixture `index.js` left with `forceRTL(true)`** — always revert before committing Quick check: ```bash grep -r "console\.\(log\|warn\)\|localhost:9876\|forceRTL(true)" src/ fixture/react-native/index.js --include="*.ts" --include="*.tsx" --include="*.js" ``` Fix any issues found, then amend the commit before proceeding. --- ## Step 3 — Create the PR ### PR title - Under 70 characters - Same format as commit: `fix(): ` ### PR body template **Always use `--body-file`** — inline `--body` with markdown `#` headers triggers Claude Code permission checks and wastes turns. Use the `Write` tool to create the file (not `cat`, `echo`, or `touch`, which may be blocked by sandbox on CI). Write the following to `/tmp/pr-body.md` using the Write tool: ```markdown ## Description <1-3 sentences: what the bug was and how the fix works> Fixes # ## Reviewers' hat-rack :tophat: ## Screenshots or videos ## Test plan - [ ] Unit tests pass (`yarn test`) - [ ] Type check passes (`yarn type-check`) - [ ] Lint passes (`yarn lint`) - [ ] Verified on iOS simulator - [ ] No regressions on related screens EOF GH_TOKEN="$AGENT_PR_TOKEN" gh pr create \ --title "fix(): " \ --body-file /tmp/pr-body.md ``` > **CRITICAL — TOKEN VERIFICATION (read this before running `gh pr create`)** > > 1. First, verify the token is available: `[ -n "$AGENT_PR_TOKEN" ] && echo "token ok" || echo "TOKEN MISSING"` — do NOT echo the token value itself. > 2. You **MUST** use `GH_TOKEN="$AGENT_PR_TOKEN" gh pr create ...` — never bare `gh pr create`. > 3. PRs created with the default `GITHUB_TOKEN` show as `app/github-actions` and **cannot be merged**. > 4. After creating the PR, verify the author: `gh pr view --json author --jq '.author.login'` — it must NOT be `app/github-actions`. > > If `AGENT_PR_TOKEN` is empty, try `SHOPIFY_GH_ACCESS_TOKEN` as fallback: `GH_TOKEN="${AGENT_PR_TOKEN:-$SHOPIFY_GH_ACCESS_TOKEN}" gh pr create ...` Before running `gh pr create`, double-check: - [ ] Token is verified (see above) - [ ] No mention of Claude, AI, Anthropic, or any AI tool anywhere - [ ] Description explains the "what" and "why" clearly - [ ] Test plan is specific to the change --- ## Step 4 — Post-Creation Return the PR URL to the user. If the user asks to update the PR (interactive only — not available on CI): ```bash git add git commit --amend --no-edit git push --force-with-lease ``` On CI, create a new commit instead of amending — force-push is not permitted.