19a00aae0c37fad80611b2e951802c9980e2169d

Author
TheEdgeOfRage <git@theedgeofrage.com>
Committer
TheEdgeOfRage <git@theedgeofrage.com>
Date

Message

Add github CLI skill

Diff

This diff is truncated to protect this page.

  1diff --git a/dot_agents/skills/github-cli/SKILL.md b/dot_agents/skills/github-cli/SKILL.md
  2new file mode 100644
  3index 0000000000000000000000000000000000000000..5f7b5bf3bcff689206f8399490692d00c2e8da0b
  4--- /dev/null
  5+++ b/dot_agents/skills/github-cli/SKILL.md
  6@@ -0,0 +1,130 @@
  7+---
  8+name: github-cli
  9+description: "GitHub CLI (gh) patterns for PRs, workflow runs, repos, and raw API calls. Read this first before using gh"
 10+---
 11+
 12+# Skill: github-cli
 13+
 14+GitHub CLI (`gh`) reference.
 15+Plain `git` + `gh` is the default workflow.
 16+
 17+---
 18+
 19+## GitHub CLI (`gh`)
 20+
 21+### Pull Requests
 22+
 23+#### View
 24+
 25+```bash
 26+gh pr list [--author @me] [--state open|closed|merged]
 27+gh pr view <num> [--comments]
 28+gh pr view <num> --json number,title,state,body,mergeable,reviews,statusCheckRollup
 29+gh pr diff <num>
 30+gh pr checks <num> [--watch]
 31+```
 32+
 33+#### Review
 34+
 35+```bash
 36+gh pr review <num> --approve [--body "..."]
 37+gh pr review <num> --request-changes --body "..."
 38+gh pr comment <num> --body "..."
 39+gh api repos/{owner}/{repo}/pulls/<num>/comments  # view inline comments
 40+```
 41+
 42+#### Inline review comments
 43+
 44+Use the PR head SHA, not a branch name or stale commit. An inline comment can only target a line that is present in the PR diff; unchanged context lines cannot be resolved by the API.
 45+
 46+```bash
 47+head_sha="$(gh pr view <num> -R owner/repo --json headRefOid --jq .headRefOid)"
 48+
 49+gh api repos/owner/repo/pulls/<num>/comments -X POST \
 50+  -f commit_id="$head_sha" \
 51+  -f path=path/to/file.kt \
 52+  -F line=123 \
 53+  -f side=RIGHT \
 54+  -f body="Review comment"
 55+```
 56+
 57+- Use `-F` for numeric fields such as `line`; `-f line=123` sends a string and is rejected.
 58+- Use `side=RIGHT` for added or modified lines and `side=LEFT` for deleted lines.
 59+- First confirm the target line is part of the current PR diff. Do not guess a line number from the complete file.
 60+- If the finding applies to unchanged context or the API cannot resolve the line, post a file-level comment instead. Do not retry with a fabricated `position`.
 61+
 62+```bash
 63+gh api repos/owner/repo/pulls/<num>/comments -X POST \
 64+  -f commit_id="$head_sha" \
 65+  -f path=path/to/file.kt \
 66+  -f subject_type=file \
 67+  -f body="Review comment"
 68+```
 69+
 70+#### Edit
 71+
 72+```bash
 73+gh pr edit <num> --add-reviewer user --add-label label
 74+gh pr ready <num>  # draft → ready for review
 75+```
 76+
 77+#### Merge (non-stacked PRs only)
 78+
 79+```bash
 80+gh pr merge <num> --squash --delete-branch
 81+gh pr merge <num> --auto --squash  # auto-merge when checks pass
 82+```
 83+
 84+Always confirm with the user before merging.
 85+
 86+### Workflow Runs / CI
 87+
 88+```bash
 89+# List runs
 90+gh run list [--workflow ci.yml] [--branch main] [--status failure]
 91+gh run list --json status,conclusion,headBranch,workflowName
 92+
 93+# View run details
 94+gh run view <run-id> [--verbose]
 95+
 96+# Debug failures
 97+gh run view <run-id> --log-failed
 98+
 99+# Re-run
100+gh run rerun <run-id> --failed  # only re-run failed jobs
101+
102+# Watch in real-time
103+gh run watch <run-id> --exit-status
104+
105+# Trigger manually