.agents/skills/kbn-github/SKILL.md
gh CLI for all GitHub interactions.GH_PAGER=cat for all gh calls to avoid interactive pagers.elastic/kibana; when not inside a local clone, prefer -R elastic/kibana for gh subcommands. For gh api, -R is not supported; use explicit repos/elastic/kibana/... endpoints or set GH_REPO=elastic/kibana when using {owner}/{repo} placeholders.gh pr view --json number -q .number.gh pr create --draft.gh pr checks.gh pr view.gh pr diff.gh pr diff --name-only.gh api repos/elastic/kibana/pulls/{number}/comments.Closes #X or Addresses #X before creating the PR.gh issue view {number}.gh issue list --search "query".gh issue create.Read references/review.md before creating or modifying any PR review. It contains mandatory instructions for comment anchoring, verification, and avoiding irreversible API mistakes.
event in a review-creation payload (POST /repos/{o}/{r}/pulls/{n}/reviews). Without event the review stays PENDING; with it, the review is immediately and irreversibly published.gh api repos/{o}/{r}/pulls/{n}/reviews --input <file> with the body in a JSON file. Do not pass -f event=... or -F event=... to the review-creation endpoint — every quoting form (bare, single-quoted, double-quoted, whole-pair quoted, $(...), backticks, ${VAR:-...}) is denied by the strip-review-event hook because the only safe sanitisation is parsing the JSON file."event" key before submitting.POST /repos/{o}/{r}/pulls/{n}/reviews/{id}/events with -f event=APPROVE (or COMMENT / REQUEST_CHANGES). The hook only denies event= on the review-creation endpoint, not on submission.See references/review.md for inline, file-level, threaded reply, and PR-level comment examples.
gh subcommands, use gh api with the GitHub REST or GraphQL endpoints.$'...' so \n becomes real newlines. Do NOT rely on \\n escapes inside normal quotes (especially gh api -f body=...).gh api ... --input /path/to/payload.json over -f/-F flags to avoid shell escaping issues.gh api call, use -X GET. In practice, adding -f or -F without -X GET can cause gh to hit the POST schema by default.?ref=... in endpoints (triggers no matches found). Prefer: gh api -X GET repos/elastic/kibana/contents/PATH -F ref=main.gh/API) and report the URL, identifier, or resulting state.Do not add/modify repo .github/* templates unless the user explicitly asks.
GitHub's sub-issue API creates real parent-child relationships (not tasklists).
Create hierarchy:
Create child issues first with full descriptions.
Get GraphQL IDs:
gh api graphql -f query='{ repository(owner:"elastic",name:"kibana") { issue(number:N) { id } } }'
Link:
gh api graphql -f query="mutation { addSubIssue(input:{issueId:\"PARENT_ID\",subIssueId:\"CHILD_ID\"}) { issue { number } } }"
Verify: gh api repos/elastic/kibana/issues/NUM/sub_issues
Mutations: addSubIssue, removeSubIssue, reprioritizeSubIssue