[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71NF31P2TGXYMW5RMG5TDKX":3,"skill-same:01M71NF31P2TGXYMW5RMG5TDKX":103},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":63,"commitSha":64,"skillDirectory":65,"forksCount":66,"repositoryHtmlUrl":67,"repositoryHomepageUrl":6,"ownerHtmlUrl":68,"ownerBlogUrl":6,"ownerDescription":69,"updatedAt":70,"install":71,"resources":84},"01M71NF31P2TGXYMW5RMG5TDKX","github-pr-workflow",null,"Full pull request lifecycle — create branches, commit changes, open PRs, monitor CI status, auto-fix failures, and merge. Works with gh CLI or falls back to git + GitHub REST API via curl.","q2805187159\u002FAnvil","q2805187159","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F105276843?v=4","01M71KF4TN999VNJX9FY9QT06A","铁甲勇士宋小宝","01M71KF4V97XXQ7AGES97R4Q9F",3,"MIT","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fgithub\u002Fgithub-pr-workflow\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"github","workflow","pr","github pr","pr workflow","github pr workflow","auto-fix","review","branches","back","auto","fix","open","api","ci","code-review","pull-requests","code","commit","auth","2026-11-10 10:56:23",false,"---\nname: github-pr-workflow\ndescription: Full pull request lifecycle — create branches, commit changes, open PRs, monitor CI status, auto-fix failures, and merge. Works with gh CLI or falls back to git + GitHub REST API via curl.\nversion: 1.1.0\nauthor: Hermes Agent\nlicense: MIT\nmetadata:\n  hermes:\n    tags: [GitHub, Pull-Requests, CI\u002FCD, Git, Automation, Merge]\n    related_skills: [github-auth, github-code-review]\n---\n\n# GitHub Pull Request Workflow\n\nComplete guide for managing the PR lifecycle. Each section shows the `gh` way first, then the `git` + `curl` fallback for machines without `gh`.\n\n## Prerequisites\n\n- Authenticated with GitHub (see `github-auth` skill)\n- Inside a git repository with a GitHub remote\n\n### Quick Auth Detection\n\n```bash\n# Determine which method to use throughout this workflow\nif command -v gh &>\u002Fdev\u002Fnull && gh auth status &>\u002Fdev\u002Fnull; then\n  AUTH=\"gh\"\nelse\n  AUTH=\"git\"\n  # Ensure we have a token for API calls\n  if [ -z \"$GITHUB_TOKEN\" ]; then\n    if [ -f ~\u002F.hermes\u002F.env ] && grep -q \"^GITHUB_TOKEN=\" ~\u002F.hermes\u002F.env; then\n      GITHUB_TOKEN=$(grep \"^GITHUB_TOKEN=\" ~\u002F.hermes\u002F.env | head -1 | cut -d= -f2 | tr -d '\\n\\r')\n    elif grep -q \"github.com\" ~\u002F.git-credentials 2>\u002Fdev\u002Fnull; then\n      GITHUB_TOKEN=$(grep \"github.com\" ~\u002F.git-credentials 2>\u002Fdev\u002Fnull | head -1 | sed 's|https:\u002F\u002F[^:]*:\\([^@]*\\)@.*|\\1|')\n    fi\n  fi\nfi\necho \"Using: $AUTH\"\n```\n\n### Extracting Owner\u002FRepo from the Git Remote\n\nMany `curl` commands need `owner\u002Frepo`. Extract it from the git remote:\n\n```bash\n# Works for both HTTPS and SSH remote URLs\nREMOTE_URL=$(git remote get-url origin)\nOWNER_REPO=$(echo \"$REMOTE_URL\" | sed -E 's|.*github\\.com[:\u002F]||; s|\\.git$||')\nOWNER=$(echo \"$OWNER_REPO\" | cut -d\u002F -f1)\nREPO=$(echo \"$OWNER_REPO\" | cut -d\u002F -f2)\necho \"Owner: $OWNER, Repo: $REPO\"\n```\n\n---\n\n## 1. Branch Creation\n\nThis part is pure `git` — identical either way:\n\n```bash\n# Make sure you're up to date\ngit fetch origin\ngit checkout main && git pull origin main\n\n# Create and switch to a new branch\ngit checkout -b feat\u002Fadd-user-authentication\n```\n\nBranch naming conventions:\n- `feat\u002Fdescription` — new features\n- `fix\u002Fdescription` — bug fixes\n- `refactor\u002Fdescription` — code restructuring\n- `docs\u002Fdescription` — documentation\n- `ci\u002Fdescription` — CI\u002FCD changes\n\n## 2. Making Commits\n\nUse the agent's file tools (`write_file`, `patch`) to make changes, then commit:\n\n```bash\n# Stage specific files\ngit add src\u002Fauth.py src\u002Fmodels\u002Fuser.py tests\u002Ftest_auth.py\n\n# Commit with a conventional commit message\ngit commit -m \"feat: add JWT-based user authentication\n\n- Add login\u002Fregister endpoints\n- Add User model with password hashing\n- Add auth middleware for protected routes\n- Add unit tests for auth flow\"\n```\n\nCommit message format (Conventional Commits):\n```\ntype(scope): short description\n\nLonger explanation if needed. Wrap at 72 characters.\n```\n\nTypes: `feat`, `fix`, `refactor`, `docs`, `test`, `ci`, `chore`, `perf`\n\n## 3. Pushing and Creating a PR\n\n### Push the Branch (same either way)\n\n```bash\ngit push -u origin HEAD\n```\n\n### Create the PR\n\n**With gh:**\n\n```bash\ngh pr create \\\n  --title \"feat: add JWT-based user authentication\" \\\n  --body \"## Summary\n- Adds login and register API endpoints\n- JWT token generation and validation\n\n## Test Plan\n- [ ] Unit tests pass\n\nCloses #42\"\n```\n\nOptions: `--draft`, `--reviewer user1,user2`, `--label \"enhancement\"`, `--base develop`\n\n**With git + curl:**\n\n```bash\nBRANCH=$(git branch --show-current)\n\ncurl -s -X POST \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  -H \"Accept: application\u002Fvnd.github.v3+json\" \\\n  https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fpulls \\\n  -d \"{\n    \\\"title\\\": \\\"feat: add JWT-based user authentication\\\",\n    \\\"body\\\": \\\"## Summary\\nAdds login and register API endpoints.\\n\\nCloses #42\\\",\n    \\\"head\\\": \\\"$BRANCH\\\",\n    \\\"base\\\": \\\"main\\\"\n  }\"\n```\n\nThe response JSON includes the PR `number` — save it for later commands.\n\nTo create as a draft, add `\"draft\": true` to the JSON body.\n\n## 4. Monitoring CI Status\n\n### Check CI Status\n\n**With gh:**\n\n```bash\n# One-shot check\ngh pr checks\n\n# Watch until all checks finish (polls every 10s)\ngh pr checks --watch\n```\n\n**With git + curl:**\n\n```bash\n# Get the latest commit SHA on the current branch\nSHA=$(git rev-parse HEAD)\n\n# Query the combined status\ncurl -s \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fcommits\u002F$SHA\u002Fstatus \\\n  | python3 -c \"\nimport sys, json\ndata = json.load(sys.stdin)\nprint(f\\\"Overall: {data['state']}\\\")\nfor s in data.get('statuses', []):\n    print(f\\\"  {s['context']}: {s['state']} - {s.get('description', '')}\\\")\"\n\n# Also check GitHub Actions check runs (separate endpoint)\ncurl -s \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fcommits\u002F$SHA\u002Fcheck-runs \\\n  | python3 -c \"\nimport sys, json\ndata = json.load(sys.stdin)\nfor cr in data.get('check_runs', []):\n    print(f\\\"  {cr['name']}: {cr['status']} \u002F {cr['conclusion'] or 'pending'}\\\")\"\n```\n\n### Poll Until Complete (git + curl)\n\n```bash\n# Simple polling loop — check every 30 seconds, up to 10 minutes\nSHA=$(git rev-parse HEAD)\nfor i in $(seq 1 20); do\n  STATUS=$(curl -s \\\n    -H \"Authorization: token $GITHUB_TOKEN\" \\\n    https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fcommits\u002F$SHA\u002Fstatus \\\n    | python3 -c \"import sys,json; print(json.load(sys.stdin)['state'])\")\n  echo \"Check $i: $STATUS\"\n  if [ \"$STATUS\" = \"success\" ] || [ \"$STATUS\" = \"failure\" ] || [ \"$STATUS\" = \"error\" ]; then\n    break\n  fi\n  sleep 30\ndone\n```\n\n## 5. Auto-Fixing CI Failures\n\nWhen CI fails, diagnose and fix. This loop works with either auth method.\n\n### Step 1: Get Failure Details\n\n**With gh:**\n\n```bash\n# List recent workflow runs on this branch\ngh run list --branch $(git branch --show-current) --limit 5\n\n# View failed logs\ngh run view \u003CRUN_ID> --log-failed\n```\n\n**With git + curl:**\n\n```bash\nBRANCH=$(git branch --show-current)\n\n# List workflow runs on this branch\ncurl -s \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  \"https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Factions\u002Fruns?branch=$BRANCH&per_page=5\" \\\n  | python3 -c \"\nimport sys, json\nruns = json.load(sys.stdin)['workflow_runs']\nfor r in runs:\n    print(f\\\"Run {r['id']}: {r['name']} - {r['conclusion'] or r['status']}\\\")\"\n\n# Get failed job logs (download as zip, extract, read)\nRUN_ID=\u003Crun_id>\ncurl -s -L \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Factions\u002Fruns\u002F$RUN_ID\u002Flogs \\\n  -o \u002Ftmp\u002Fci-logs.zip\ncd \u002Ftmp && unzip -o ci-logs.zip -d ci-logs && cat ci-logs\u002F*.txt\n```\n\n### Step 2: Fix and Push\n\nAfter identifying the issue, use file tools (`patch`, `write_file`) to fix it:\n\n```bash\ngit add \u003Cfixed_files>\ngit commit -m \"fix: resolve CI failure in \u003Ccheck_name>\"\ngit push\n```\n\n### Step 3: Verify\n\nRe-check CI status using the commands from Section 4 above.\n\n### Auto-Fix Loop Pattern\n\nWhen asked to auto-fix CI, follow this loop:\n\n1. Check CI status → identify failures\n2. Read failure logs → understand the error\n3. Use `read_file` + `patch`\u002F`write_file` → fix the code\n4. `git add . && git commit -m \"fix: ...\" && git push`\n5. Wait for CI → re-check status\n6. Repeat if still failing (up to 3 attempts, then ask the user)\n\n## 6. Merging\n\n**With gh:**\n\n```bash\n# Squash merge + delete branch (cleanest for feature branches)\ngh pr merge --squash --delete-branch\n\n# Enable auto-merge (merges when all checks pass)\ngh pr merge --auto --squash --delete-branch\n```\n\n**With git + curl:**\n\n```bash\nPR_NUMBER=\u003Cnumber>\n\n# Merge the PR via API (squash)\ncurl -s -X PUT \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fpulls\u002F$PR_NUMBER\u002Fmerge \\\n  -d \"{\n    \\\"merge_method\\\": \\\"squash\\\",\n    \\\"commit_title\\\": \\\"feat: add user authentication (#$PR_NUMBER)\\\"\n  }\"\n\n# Delete the remote branch after merge\nBRANCH=$(git branch --show-current)\ngit push origin --delete $BRANCH\n\n# Switch back to main locally\ngit checkout main && git pull origin main\ngit branch -d $BRANCH\n```\n\nMerge methods: `\"merge\"` (merge commit), `\"squash\"`, `\"rebase\"`\n\n### Enable Auto-Merge (curl)\n\n```bash\n# Auto-merge requires the repo to have it enabled in settings.\n# This uses the GraphQL API since REST doesn't support auto-merge.\nPR_NODE_ID=$(curl -s \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fpulls\u002F$PR_NUMBER \\\n  | python3 -c \"import sys,json; print(json.load(sys.stdin)['node_id'])\")\n\ncurl -s -X POST \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  https:\u002F\u002Fapi.github.com\u002Fgraphql \\\n  -d \"{\\\"query\\\": \\\"mutation { enablePullRequestAutoMerge(input: {pullRequestId: \\\\\\\"$PR_NODE_ID\\\\\\\", mergeMethod: SQUASH}) { clientMutationId } }\\\"}\"\n```\n\n## 7. Complete Workflow Example\n\n```bash\n# 1. Start from clean main\ngit checkout main && git pull origin main\n\n# 2. Branch\ngit checkout -b fix\u002Flogin-redirect-bug\n\n# 3. (Agent makes code changes with file tools)\n\n# 4. Commit\ngit add src\u002Fauth\u002Flogin.py tests\u002Ftest_login.py\ngit commit -m \"fix: correct redirect URL after login\n\nPreserves the ?next= parameter instead of always redirecting to \u002Fdashboard.\"\n\n# 5. Push\ngit push -u origin HEAD\n\n# 6. Create PR (picks gh or curl based on what's available)\n# ... (see Section 3)\n\n# 7. Monitor CI (see Section 4)\n\n# 8. Merge when green (see Section 6)\n```\n\n## Useful PR Commands Reference\n\n| Action | gh | git + curl |\n|--------|-----|-----------|\n| List my PRs | `gh pr list --author @me` | `curl -s -H \"Authorization: token $GITHUB_TOKEN\" \"https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fpulls?state=open\"` |\n| View PR diff | `gh pr diff` | `git diff main...HEAD` (local) or `curl -H \"Accept: application\u002Fvnd.github.diff\" ...` |\n| Add comment | `gh pr comment N --body \"...\"` | `curl -X POST ...\u002Fissues\u002FN\u002Fcomments -d '{\"body\":\"...\"}'` |\n| Request review | `gh pr edit N --add-reviewer user` | `curl -X POST ...\u002Fpulls\u002FN\u002Frequested_reviewers -d '{\"reviewers\":[\"user\"]}'` |\n| Close PR | `gh pr close N` | `curl -X PATCH ...\u002Fpulls\u002FN -d '{\"state\":\"closed\"}'` |\n| Check out someone's PR | `gh pr checkout N` | `git fetch origin pull\u002FN\u002Fhead:pr-N && git checkout pr-N` |\n","# GitHub Pull Request Workflow\n\nComplete guide for managing the PR lifecycle. Each section shows the `gh` way first, then the `git` + `curl` fallback for machines without `gh`.\n\n## Prerequisites\n\n- Authenticated with GitHub (see `github-auth` skill)\n- Inside a git repository with a GitHub remote\n\n### Quick Auth Detection\n\n```bash\n# Determine which method to use throughout this workflow\nif command -v gh &>\u002Fdev\u002Fnull && gh auth status &>\u002Fdev\u002Fnull; then\n  AUTH=\"gh\"\nelse\n  AUTH=\"git\"\n  # Ensure we have a token for API calls\n  if [ -z \"$GITHUB_TOKEN\" ]; then\n    if [ -f ~\u002F.hermes\u002F.env ] && grep -q \"^GITHUB_TOKEN=\" ~\u002F.hermes\u002F.env; then\n      GITHUB_TOKEN=$(grep \"^GITHUB_TOKEN=\" ~\u002F.hermes\u002F.env | head -1 | cut -d= -f2 | tr -d '\\n\\r')\n    elif grep -q \"github.com\" ~\u002F.git-credentials 2>\u002Fdev\u002Fnull; then\n      GITHUB_TOKEN=$(grep \"github.com\" ~\u002F.git-credentials 2>\u002Fdev\u002Fnull | head -1 | sed 's|https:\u002F\u002F[^:]*:\\([^@]*\\)@.*|\\1|')\n    fi\n  fi\nfi\necho \"Using: $AUTH\"\n```\n\n### Extracting Owner\u002FRepo from the Git Remote\n\nMany `curl` commands need `owner\u002Frepo`. Extract it from the git remote:\n\n```bash\n# Works for both HTTPS and SSH remote URLs\nREMOTE_URL=$(git remote get-url origin)\nOWNER_REPO=$(echo \"$REMOTE_URL\" | sed -E 's|.*github\\.com[:\u002F]||; s|\\.git$||')\nOWNER=$(echo \"$OWNER_REPO\" | cut -d\u002F -f1)\nREPO=$(echo \"$OWNER_REPO\" | cut -d\u002F -f2)\necho \"Owner: $OWNER, Repo: $REPO\"\n```\n\n---\n\n## 1. Branch Creation\n\nThis part is pure `git` — identical either way:\n\n```bash\n# Make sure you're up to date\ngit fetch origin\ngit checkout main && git pull origin main\n\n# Create and switch to a new branch\ngit checkout -b feat\u002Fadd-user-authentication\n```\n\nBranch naming conventions:\n- `feat\u002Fdescription` — new features\n- `fix\u002Fdescription` — bug fixes\n- `refactor\u002Fdescription` — code restructuring\n- `docs\u002Fdescription` — documentation\n- `ci\u002Fdescription` — CI\u002FCD changes\n\n## 2. Making Commits\n\nUse the agent's file tools (`write_file`, `patch`) to make changes, then commit:\n\n```bash\n# Stage specific files\ngit add src\u002Fauth.py src\u002Fmodels\u002Fuser.py tests\u002Ftest_auth.py\n\n# Commit with a conventional commit message\ngit commit -m \"feat: add JWT-based user authentication\n\n- Add login\u002Fregister endpoints\n- Add User model with password hashing\n- Add auth middleware for protected routes\n- Add unit tests for auth flow\"\n```\n\nCommit message format (Conventional Commits):\n```\ntype(scope): short description\n\nLonger explanation if needed. Wrap at 72 characters.\n```\n\nTypes: `feat`, `fix`, `refactor`, `docs`, `test`, `ci`, `chore`, `perf`\n\n## 3. Pushing and Creating a PR\n\n### Push the Branch (same either way)\n\n```bash\ngit push -u origin HEAD\n```\n\n### Create the PR\n\n**With gh:**\n\n```bash\ngh pr create \\\n  --title \"feat: add JWT-based user authentication\" \\\n  --body \"## Summary\n- Adds login and register API endpoints\n- JWT token generation and validation\n\n## Test Plan\n- [ ] Unit tests pass\n\nCloses #42\"\n```\n\nOptions: `--draft`, `--reviewer user1,user2`, `--label \"enhancement\"`, `--base develop`\n\n**With git + curl:**\n\n```bash\nBRANCH=$(git branch --show-current)\n\ncurl -s -X POST \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  -H \"Accept: application\u002Fvnd.github.v3+json\" \\\n  https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fpulls \\\n  -d \"{\n    \\\"title\\\": \\\"feat: add JWT-based user authentication\\\",\n    \\\"body\\\": \\\"## Summary\\nAdds login and register API endpoints.\\n\\nCloses #42\\\",\n    \\\"head\\\": \\\"$BRANCH\\\",\n    \\\"base\\\": \\\"main\\\"\n  }\"\n```\n\nThe response JSON includes the PR `number` — save it for later commands.\n\nTo create as a draft, add `\"draft\": true` to the JSON body.\n\n## 4. Monitoring CI Status\n\n### Check CI Status\n\n**With gh:**\n\n```bash\n# One-shot check\ngh pr checks\n\n# Watch until all checks finish (polls every 10s)\ngh pr checks --watch\n```\n\n**With git + curl:**\n\n```bash\n# Get the latest commit SHA on the current branch\nSHA=$(git rev-parse HEAD)\n\n# Query the combined status\ncurl -s \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fcommits\u002F$SHA\u002Fstatus \\\n  | python3 -c \"\nimport sys, json\ndata = json.load(sys.stdin)\nprint(f\\\"Overall: {data['state']}\\\")\nfor s in data.get('statuses', []):\n    print(f\\\"  {s['context']}: {s['state']} - {s.get('description', '')}\\\")\"\n\n# Also check GitHub Actions check runs (separate endpoint)\ncurl -s \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fcommits\u002F$SHA\u002Fcheck-runs \\\n  | python3 -c \"\nimport sys, json\ndata = json.load(sys.stdin)\nfor cr in data.get('check_runs', []):\n    print(f\\\"  {cr['name']}: {cr['status']} \u002F {cr['conclusion'] or 'pending'}\\\")\"\n```\n\n### Poll Until Complete (git + curl)\n\n```bash\n# Simple polling loop — check every 30 seconds, up to 10 minutes\nSHA=$(git rev-parse HEAD)\nfor i in $(seq 1 20); do\n  STATUS=$(curl -s \\\n    -H \"Authorization: token $GITHUB_TOKEN\" \\\n    https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fcommits\u002F$SHA\u002Fstatus \\\n    | python3 -c \"import sys,json; print(json.load(sys.stdin)['state'])\")\n  echo \"Check $i: $STATUS\"\n  if [ \"$STATUS\" = \"success\" ] || [ \"$STATUS\" = \"failure\" ] || [ \"$STATUS\" = \"error\" ]; then\n    break\n  fi\n  sleep 30\ndone\n```\n\n## 5. Auto-Fixing CI Failures\n\nWhen CI fails, diagnose and fix. This loop works with either auth method.\n\n### Step 1: Get Failure Details\n\n**With gh:**\n\n```bash\n# List recent workflow runs on this branch\ngh run list --branch $(git branch --show-current) --limit 5\n\n# View failed logs\ngh run view \u003CRUN_ID> --log-failed\n```\n\n**With git + curl:**\n\n```bash\nBRANCH=$(git branch --show-current)\n\n# List workflow runs on this branch\ncurl -s \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  \"https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Factions\u002Fruns?branch=$BRANCH&per_page=5\" \\\n  | python3 -c \"\nimport sys, json\nruns = json.load(sys.stdin)['workflow_runs']\nfor r in runs:\n    print(f\\\"Run {r['id']}: {r['name']} - {r['conclusion'] or r['status']}\\\")\"\n\n# Get failed job logs (download as zip, extract, read)\nRUN_ID=\u003Crun_id>\ncurl -s -L \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Factions\u002Fruns\u002F$RUN_ID\u002Flogs \\\n  -o \u002Ftmp\u002Fci-logs.zip\ncd \u002Ftmp && unzip -o ci-logs.zip -d ci-logs && cat ci-logs\u002F*.txt\n```\n\n### Step 2: Fix and Push\n\nAfter identifying the issue, use file tools (`patch`, `write_file`) to fix it:\n\n```bash\ngit add \u003Cfixed_files>\ngit commit -m \"fix: resolve CI failure in \u003Ccheck_name>\"\ngit push\n```\n\n### Step 3: Verify\n\nRe-check CI status using the commands from Section 4 above.\n\n### Auto-Fix Loop Pattern\n\nWhen asked to auto-fix CI, follow this loop:\n\n1. Check CI status → identify failures\n2. Read failure logs → understand the error\n3. Use `read_file` + `patch`\u002F`write_file` → fix the code\n4. `git add . && git commit -m \"fix: ...\" && git push`\n5. Wait for CI → re-check status\n6. Repeat if still failing (up to 3 attempts, then ask the user)\n\n## 6. Merging\n\n**With gh:**\n\n```bash\n# Squash merge + delete branch (cleanest for feature branches)\ngh pr merge --squash --delete-branch\n\n# Enable auto-merge (merges when all checks pass)\ngh pr merge --auto --squash --delete-branch\n```\n\n**With git + curl:**\n\n```bash\nPR_NUMBER=\u003Cnumber>\n\n# Merge the PR via API (squash)\ncurl -s -X PUT \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fpulls\u002F$PR_NUMBER\u002Fmerge \\\n  -d \"{\n    \\\"merge_method\\\": \\\"squash\\\",\n    \\\"commit_title\\\": \\\"feat: add user authentication (#$PR_NUMBER)\\\"\n  }\"\n\n# Delete the remote branch after merge\nBRANCH=$(git branch --show-current)\ngit push origin --delete $BRANCH\n\n# Switch back to main locally\ngit checkout main && git pull origin main\ngit branch -d $BRANCH\n```\n\nMerge methods: `\"merge\"` (merge commit), `\"squash\"`, `\"rebase\"`\n\n### Enable Auto-Merge (curl)\n\n```bash\n# Auto-merge requires the repo to have it enabled in settings.\n# This uses the GraphQL API since REST doesn't support auto-merge.\nPR_NODE_ID=$(curl -s \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fpulls\u002F$PR_NUMBER \\\n  | python3 -c \"import sys,json; print(json.load(sys.stdin)['node_id'])\")\n\ncurl -s -X POST \\\n  -H \"Authorization: token $GITHUB_TOKEN\" \\\n  https:\u002F\u002Fapi.github.com\u002Fgraphql \\\n  -d \"{\\\"query\\\": \\\"mutation { enablePullRequestAutoMerge(input: {pullRequestId: \\\\\\\"$PR_NODE_ID\\\\\\\", mergeMethod: SQUASH}) { clientMutationId } }\\\"}\"\n```\n\n## 7. Complete Workflow Example\n\n```bash\n# 1. Start from clean main\ngit checkout main && git pull origin main\n\n# 2. Branch\ngit checkout -b fix\u002Flogin-redirect-bug\n\n# 3. (Agent makes code changes with file tools)\n\n# 4. Commit\ngit add src\u002Fauth\u002Flogin.py tests\u002Ftest_login.py\ngit commit -m \"fix: correct redirect URL after login\n\nPreserves the ?next= parameter instead of always redirecting to \u002Fdashboard.\"\n\n# 5. Push\ngit push -u origin HEAD\n\n# 6. Create PR (picks gh or curl based on what's available)\n# ... (see Section 3)\n\n# 7. Monitor CI (see Section 4)\n\n# 8. Merge when green (see Section 6)\n```\n\n## Useful PR Commands Reference\n\n| Action | gh | git + curl |\n|--------|-----|-----------|\n| List my PRs | `gh pr list --author @me` | `curl -s -H \"Authorization: token $GITHUB_TOKEN\" \"https:\u002F\u002Fapi.github.com\u002Frepos\u002F$OWNER\u002F$REPO\u002Fpulls?state=open\"` |\n| View PR diff | `gh pr diff` | `git diff main...HEAD` (local) or `curl -H \"Accept: application\u002Fvnd.github.diff\" ...` |\n| Add comment | `gh pr comment N --body \"...\"` | `curl -X POST ...\u002Fissues\u002FN\u002Fcomments -d '{\"body\":\"...\"}'` |\n| Request review | `gh pr edit N --add-reviewer user` | `curl -X POST ...\u002Fpulls\u002FN\u002Frequested_reviewers -d '{\"reviewers\":[\"user\"]}'` |\n| Close PR | `gh pr close N` | `curl -X PATCH ...\u002Fpulls\u002FN -d '{\"state\":\"closed\"}'` |\n| Check out someone's PR | `gh pr checkout N` | `git fetch origin pull\u002FN\u002Fhead:pr-N && git checkout pr-N` |\n",{"name":5,"author":49,"license":15,"version":50,"metadata":51,"description":7},"Hermes Agent","1.1.0",{"hermes":52},{"tags":53,"related_skills":60},[54,55,56,57,58,59],"GitHub","Pull-Requests","CI\u002FCD","Git","Automation","Merge",[61,62],"github-auth","github-code-review","main","6ffadc67c9777282fa1f9330ec12ac8778064409","skills\u002Fgithub\u002Fgithub-pr-workflow",0,"https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil","https:\u002F\u002Fgithub.com\u002Fq2805187159","Independent Researcher\r\n\r\nEmail: q2805187159@gmail.com\r\n\r\nGithub: q2805187159\r\n\r\nResearch Interests:\r\n- LLM Agents\r\n- Tool Routing\r\n- RAG","2026-06-24 18:31:41",{"source":8,"skillName":5,"commands":72,"prompt":82,"zipAvailable":83},[73,76,79],{"tool":74,"command":75},"npx","npx skills add q2805187159\u002FAnvil --skill github-pr-workflow",{"tool":77,"command":78},"bunx","bunx skills add q2805187159\u002FAnvil --skill github-pr-workflow",{"tool":80,"command":81},"pnpm","pnpm dlx skills add q2805187159\u002FAnvil --skill github-pr-workflow","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fgithub\u002Fgithub-pr-workflow\u002FSKILL.md",true,[85,91,95,99],{"path":86,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fci-troubleshooting.md","REFERENCE","参考文档",4879,"https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fgithub\u002Fgithub-pr-workflow\u002Freferences\u002Fci-troubleshooting.md",{"path":92,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fconventional-commits.md",2417,"https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fgithub\u002Fgithub-pr-workflow\u002Freferences\u002Fconventional-commits.md",{"path":96,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":97,"sourceHtmlUrl":98},"templates\u002Fpr-body-bugfix.md",513,"https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fgithub\u002Fgithub-pr-workflow\u002Ftemplates\u002Fpr-body-bugfix.md",{"path":100,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":101,"sourceHtmlUrl":102},"templates\u002Fpr-body-feature.md",580,"https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fgithub\u002Fgithub-pr-workflow\u002Ftemplates\u002Fpr-body-feature.md",[104,136,167,174,198,221],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":109,"sourceHtmlUrl":110,"categories":111,"keywords":118,"publishedAt":44},"01M71NPWVVMB1AZ8XGKNJFT0YP","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[112,115],{"categoryNo":113,"categoryName":114,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":116,"categoryName":117,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135],"webapp","testing","webapp testing","for","applications","local","frontend","debugging","toolkit","logs","browser","with","playwright","web","behavior","ui","screenshots",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":150,"publishedAt":44},"01M71NPTQ96H4XSZVZT422BNRB","web-design-guidelines","Review UI code for Web Interface Guidelines compliance. Use when asked to \"review my UI\", \"check accessibility\", \"audit design\", \"review UX\", or \"check my site against best practices\".","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fweb-design-guidelines\u002FSKILL.md",[142,145],{"categoryNo":143,"categoryName":144,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":146,"categoryName":147,"taxonomyType":148,"taxonomyTypeDesc":149},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[151,152,132,153,154,122,155,156,157,158,159,160,161,41,31,162,163,164,165,166],"guidelines","design","web design guidelines","web design","vercel","interface","web interface guidelines","use","when","best practices","file","check","compliance","audit","ux","accessibility",{"skillNo":168,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":169,"categories":170,"keywords":173,"publishedAt":44},"01M71NPS2D31Y2BGFYA9DB7CE4","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fweb-design-guidelines copy\u002FSKILL.md",[171,172],{"categoryNo":143,"categoryName":144,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":146,"categoryName":147,"taxonomyType":148,"taxonomyTypeDesc":149},[151,152,132,153,154,122,155,156,157,158,159,160,161,41,31,162,163,164,165,166],{"skillNo":175,"name":176,"nameZh":6,"description":177,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":178,"categories":179,"keywords":184,"publishedAt":44},"01M71NPQ9DRT54QSQJ0BHBM3VG","video-generation","Use this skill when the user requests to generate, create, or imagine videos. Supports structured prompts and reference image for guided generation.","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fvideo-generation\u002FSKILL.md",[180,183],{"categoryNo":181,"categoryName":182,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[185,186,187,122,158,159,188,189,190,191,192,193,194,195,196,197],"Video","video generation","generation","image","create","imagine","requests","generate","videos","reference","prompts","user","structured",{"skillNo":199,"name":200,"nameZh":6,"description":201,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":202,"categories":203,"keywords":205,"publishedAt":44},"01M71NPN57CT154SWXAS52475X","youtube-downloader","Download YouTube videos with customizable quality and format options. Use this skill when the user asks to download, save, or grab YouTube videos. Supports various quality settings (best, 1080p, 720p, 480p, 360p), multiple formats (mp4, webm, mkv), and audio-only downloads as MP3.","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fvideo-downloader\u002FSKILL.md",[204],{"categoryNo":181,"categoryName":182,"taxonomyType":21,"taxonomyTypeDesc":22},[206,207,208,209,210,211,212,158,159,213,130,214,215,216,217,218,193,219,196,220],"youtube","youtube downloader","mp4","as","downloads","Audio","only","mp3","options","quality","format","settings","grab","formats","download",{"skillNo":222,"name":223,"nameZh":6,"description":224,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":225,"categories":226,"keywords":227,"publishedAt":44},"01M71NPKD95YB8N3J6J78QGFFW","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[228,229,230,231,232,233,234,158,235,159,236,237,238,239,240,241],"verification","verification before completion","running","evidence","complete","prs","claim","assertions","committing","output","claims","work","about","commands"]