Skip to content

Commit fbf8a61

Browse files
authored
Add instructions to AGENTS.md for GitHub issue creation with CLI (#612)
* Add instructions for GitHub issue creation with CLI Added a new section detailing how to create GitHub issues using the GitHub CLI, including prerequisites, drafting, user review, and cleanup steps. This provides a standardized workflow for reporting and tracking issues. * Add instructions for labeling issues with GitHub CLI Expanded the documentation to include steps for adding labels when creating issues using the GitHub CLI. Also added guidance on discovering available labels in the repository.
1 parent 6795c14 commit fbf8a61

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

AGENTS.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,55 @@
5959
- `ignore-missing-imports`: Enabled to allow for gradual adoption of type hints without requiring all third-party libraries to have stubs.
6060
- `additional_dependencies`: Includes `numpy` and `pandas-stubs` to provide type information for these libraries.
6161
- **Execution**: Run automatically via `pre-commit run --all-files` or on commit.
62+
63+
## GitHub Issue Creation
64+
65+
When you or the user identify an issue (bug, enhancement, or task), you can automatically create a GitHub issue using the GitHub CLI.
66+
67+
### Prerequisites
68+
69+
- **Install GitHub CLI**: If `gh` is not available, install it:
70+
- macOS: `brew install gh`
71+
- Linux: See https://github.com/cli/cli/blob/trunk/docs/install_linux.md
72+
- Windows: `winget install --id GitHub.cli`
73+
- **Authenticate**: Run `gh auth login` and follow the prompts to authorize access to the repository.
74+
75+
### Creating an Issue
76+
77+
1. **Generate the issue body**: Create a markdown file (e.g., `issue.md`) describing the issue with:
78+
- A clear problem statement or feature request
79+
- Steps to reproduce (for bugs)
80+
- Expected vs actual behavior (for bugs)
81+
- Relevant code snippets or error messages
82+
- Proposed solution (if applicable)
83+
84+
2. **User review**: Always present the draft issue to the user for review before filing. The user should have the opportunity to view, modify, or approve the issue content before it is submitted.
85+
86+
3. **Create the issue**: After the user approves, run the following command:
87+
```bash
88+
gh issue create --title "<descriptive title>" --body-file issue.md
89+
```
90+
91+
**Adding labels**: Use the `--label` flag to categorize the issue appropriately:
92+
```bash
93+
gh issue create --title "<descriptive title>" --body-file issue.md --label "<label>"
94+
```
95+
96+
Common labels include:
97+
- `bug` - Something isn't working correctly
98+
- `enhancement` - New feature or improvement request
99+
- `documentation` - Documentation improvements or additions
100+
- `question` - Further information is requested
101+
102+
Multiple labels can be added by repeating the flag: `--label "bug" --label "high priority"`
103+
104+
**Discovering available labels**: To see what labels are available in the repository:
105+
```bash
106+
# List all labels defined in the repo, along with their descriptions
107+
gh label list --limit 100
108+
109+
# Find unique labels from existing issues
110+
gh issue list --state all --limit 100 --json labels --jq '.[].labels[].name' | sort -u
111+
```
112+
113+
4. **Clean up**: Delete the temporary `issue.md` file after the issue is created.

0 commit comments

Comments
 (0)