Skip to content

Commit 8e8ea5a

Browse files
authored
codex skill for reading github issues, PRs and milestones (#5685)
1 parent ea83bd7 commit 8e8ea5a

File tree

2 files changed

+431
-0
lines changed

2 files changed

+431
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: gh-read-inspector
3+
description: Retrieve GitHub issues, pull requests, and milestones with read-only, whitelisted `gh` commands only. Use when you need complete issue or PR context, need to resolve a PR from commit ID/PR ID/issue ID, fetch milestone metadata, or list all issues in a milestone (labels, status, assignees, and related fields).
4+
---
5+
6+
# gh-read-inspector
7+
8+
Use this skill for GitHub metadata lookup only. No write operations.
9+
10+
## Guardrails
11+
12+
- Use only `python3 .codex/skills/gh-read-inspector/scripts/gh_read_inspector.py ...`.
13+
- Do not run ad-hoc `gh` commands from this skill.
14+
- If `gh` is missing, stop and ask the user to install GitHub CLI (`https://cli.github.com/`).
15+
16+
## Commands
17+
18+
- Issue details:
19+
- `python3 .codex/skills/gh-read-inspector/scripts/gh_read_inspector.py issue --repo owner/repo --issue 123`
20+
- PR details by PR number:
21+
- `python3 .codex/skills/gh-read-inspector/scripts/gh_read_inspector.py pr --repo owner/repo --pr 123`
22+
- PR details by issue number:
23+
- `python3 .codex/skills/gh-read-inspector/scripts/gh_read_inspector.py pr --repo owner/repo --issue 123`
24+
- PR details by commit SHA:
25+
- `python3 .codex/skills/gh-read-inspector/scripts/gh_read_inspector.py pr --repo owner/repo --commit <sha>`
26+
- Milestone details (number or exact title):
27+
- `python3 .codex/skills/gh-read-inspector/scripts/gh_read_inspector.py milestone --repo owner/repo --milestone 7`
28+
- `python3 .codex/skills/gh-read-inspector/scripts/gh_read_inspector.py milestone --repo owner/repo --milestone "Release 4.3"`
29+
- Milestone issues:
30+
- `python3 .codex/skills/gh-read-inspector/scripts/gh_read_inspector.py milestone-issues --repo owner/repo --milestone 7 --state all`
31+
- Show exact whitelist:
32+
- `python3 .codex/skills/gh-read-inspector/scripts/gh_read_inspector.py whitelist`
33+
34+
## Whitelist
35+
36+
The script can execute only these command templates:
37+
38+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/issues/{issue}`
39+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/issues/{issue}/comments?per_page={per_page}&page={page}`
40+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/issues/{issue}/events?per_page={per_page}&page={page}`
41+
- `gh api -H "Accept: application/vnd.github+json,application/vnd.github.mockingbird-preview+json" /repos/{repo}/issues/{issue}/timeline?per_page={per_page}&page={page}`
42+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/pulls/{pr}`
43+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/issues/{pr}/comments?per_page={per_page}&page={page}`
44+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/pulls/{pr}/reviews?per_page={per_page}&page={page}`
45+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/pulls/{pr}/comments?per_page={per_page}&page={page}`
46+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/issues/{pr}/events?per_page={per_page}&page={page}`
47+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/pulls/{pr}/commits?per_page={per_page}&page={page}`
48+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/pulls/{pr}/files?per_page={per_page}&page={page}`
49+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/commits/{commit}/pulls?per_page={per_page}&page={page}`
50+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/commits/{commit}/check-runs`
51+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/commits/{commit}/status`
52+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/milestones/{milestone}`
53+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/milestones?state=all&per_page={per_page}&page={page}`
54+
- `gh api -H "Accept: application/vnd.github+json" /repos/{repo}/issues?milestone={milestone}&state={state}&per_page={per_page}&page={page}`

0 commit comments

Comments
 (0)