GitHub Issue Operations Skill
Overview
Programmatic GitHub Issue management (create, label, milestone, assign, comment) via gh CLI.
Prerequisites
ghCLI installed and authenticated (gh auth status)- Write access to target repository
jqavailable for JSON processing
Instructions
- Verify prerequisites:
gh --versionandgh auth status - Select the script for your operation (see Script Table below)
- Execute with required arguments (all scripts need
--repo owner/repo) - Check JSON output for
"error": false(success) or"error": true(failure) - Use
--output-file <path>in automated workflows to minimize token usage
Script Table
| Script | Purpose | Key Args |
|---|---|---|
amia_get_issue_context.py |
Get issue metadata | --issue N |
amia_create_issue.py |
Create new issue | --title "..." |
amia_set_issue_labels.py |
Add/remove/set labels | --add, --remove, --set |
amia_set_issue_milestone.py |
Assign milestone | --milestone "..." |
amia_post_issue_comment.py |
Post comment | --body "...", --marker |
Checklist
Copy this checklist and track your progress:
- gh CLI installed and authenticated
- Write access to target repository verified
- Correct script selected for operation
- Required arguments provided (all need
--repo) - JSON output checked for success/error
- Exit code handled (0=ok, 1=bad args, 2=not found, 3=API, 4=no auth, 5=idempotent skip)
Output
| Type | Format | Key Fields |
|---|---|---|
| Success | JSON | Operation-specific (number, url, labels, etc.) |
| Error | JSON | error: true, message, code |
Output discipline: All scripts support
--output-file <path>.
Error Handling
Check exit codes on failure: 1=bad args, 2=not found, 3=API error, 4=no auth, 5=idempotent skip. See the detailed guide in Resources for details.
Resources
All resources are in the references/ directory. Full guide: detailed-guide:
- Decision Tree
- Script Reference Table
- Examples
- Get Issue Context
- Create Issue
- Manage Labels
- Assign Milestone
- Post Idempotent Comment
- Error Handling
- Troubleshooting
- Exit Codes
- Integration with Integrator Agent
- Reference Document Listings
Examples
Create issue with labels
./scripts/amia_create_issue.py \
--repo owner/repo \
--title "Implement feature X" \
--labels "feature,P2" \
--assignee "dev1"
# Returns: {"number": 124, "url": "https://github.com/owner/repo/issues/124"}