[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74F86RMS223HXM4PVSWX3D7":3,"skill-same:01M74F86RMS223HXM4PVSWX3D7":75},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":13,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":42,"install":43,"resources":56},"01M74F86RMS223HXM4PVSWX3D7","github-pr-workflow",null,"GitHub PR lifecycle: branch, commit, open, CI, merge.","LyrikNilpferd71\u002FHermes-Backup","LyrikNilpferd71","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F187173780?v=4","01M727S8GPB77P0S9ECRRMZT58","01M727S8HF63B0MD53F496MK1V",0,"MIT","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-05-17T14-00-48+0200\u002Fskills\u002Fgithub\u002Fgithub-pr-workflow\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: github-pr-workflow\ndescription: \"GitHub PR lifecycle: branch, commit, open, CI, merge.\"\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":23,"license":14,"version":24,"metadata":25,"description":7},"Hermes Agent","1.1.0",{"hermes":26},{"tags":27,"related_skills":34},[28,29,30,31,32,33],"GitHub","Pull-Requests","CI\u002FCD","Git","Automation","Merge",[35,36],"github-auth","github-code-review","main","404fd33aabef3b6bc1cc913117ba2160ade62625","snapshots\u002F2026-05-17T14-00-48+0200\u002Fskills\u002Fgithub\u002Fgithub-pr-workflow","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71","2026-11-08 20:00:57",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add LyrikNilpferd71\u002FHermes-Backup --skill github-pr-workflow",{"tool":49,"command":50},"bunx","bunx skills add LyrikNilpferd71\u002FHermes-Backup --skill github-pr-workflow",{"tool":52,"command":53},"pnpm","pnpm dlx skills add LyrikNilpferd71\u002FHermes-Backup --skill github-pr-workflow","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-05-17T14-00-48+0200\u002Fskills\u002Fgithub\u002Fgithub-pr-workflow\u002FSKILL.md",true,[57,63,67,71],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fci-troubleshooting.md","REFERENCE","参考文档",4879,"https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-05-17T14-00-48+0200\u002Fskills\u002Fgithub\u002Fgithub-pr-workflow\u002Freferences\u002Fci-troubleshooting.md",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fconventional-commits.md",2417,"https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-05-17T14-00-48+0200\u002Fskills\u002Fgithub\u002Fgithub-pr-workflow\u002Freferences\u002Fconventional-commits.md",{"path":68,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":69,"sourceHtmlUrl":70},"templates\u002Fpr-body-bugfix.md",513,"https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-05-17T14-00-48+0200\u002Fskills\u002Fgithub\u002Fgithub-pr-workflow\u002Ftemplates\u002Fpr-body-bugfix.md",{"path":72,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":73,"sourceHtmlUrl":74},"templates\u002Fpr-body-feature.md",580,"https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-05-17T14-00-48+0200\u002Fskills\u002Fgithub\u002Fgithub-pr-workflow\u002Ftemplates\u002Fpr-body-feature.md",[76,84,91,98,105,112],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":83},"01M76BBCCNA7WQ82Q8QNZH8PBK","writing-plans","Write implementation plans: bite-sized tasks, paths, code.","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-11-08T13-00-51+0100\u002Fskills\u002Fsoftware-development\u002Fwriting-plans\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":83},"01M76BB8YS41CA3NKW0YMSSB88","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-11-08T13-00-51+0100\u002Fskills\u002Fsoftware-development\u002Fsystematic-debugging\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":83},"01M76BB680FPNT998E1GM2QW10","subagent-driven-development","Execute plans via delegate_task subagents (2-stage review).","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-11-08T13-00-51+0100\u002Fskills\u002Fsoftware-development\u002Fsubagent-driven-development\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":83},"01M76BB3C4ZB9S4RWPMM8MX0YB","plan","Write a markdown plan to .hermes\u002Fplans\u002F; no execution.","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-11-08T13-00-51+0100\u002Fskills\u002Fsoftware-development\u002Fplan\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":83},"01M76BB0NK28KMP51YDB5R3EXA","hermes-agent-skill-authoring","Author in-repo SKILL.md files: frontmatter and structure.","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-11-08T13-00-51+0100\u002Fskills\u002Fsoftware-development\u002Fhermes-agent-skill-authoring\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":83},"01M76BAYV58H0CKNSTZE3ZH4NY","debugging-hermes-tui-commands","Debug Hermes TUI slash commands: Python, gateway, Ink UI.","https:\u002F\u002Fgithub.com\u002FLyrikNilpferd71\u002FHermes-Backup\u002Fblob\u002Fmain\u002Fsnapshots\u002F2026-11-08T13-00-51+0100\u002Fskills\u002Fsoftware-development\u002Fdebugging-hermes-tui-commands\u002FSKILL.md",[],[]]