Skip to content

Commit c07c4c1

Browse files
authored
Restructure issue-tracker doc and fix issue-creation conventions (#1878)
Group the doc by topic (issue commands, creating issues, pull requests, PR triage, related issues) instead of interleaving issues and PRs, and correct how issue type, parent, and dependencies are set. - Set type/parent/blocked-by/blocking via gh issue create flags (gh 2.94.0+) instead of a post-creation REST PATCH and a GraphQL addSubIssue workaround - Document gh issue edit flags for changing relationships after creation - Require parent and blocked-by/blocking to exist as native GitHub fields, not prose alone - Note that the Related Issues section applies to both issue and PR bodies, with the descriptors each uses
1 parent cf29dc1 commit c07c4c1

1 file changed

Lines changed: 35 additions & 30 deletions

File tree

docs/agents/issue-tracker.md

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,68 @@ Issues and PRDs for this repo live as GitHub issues. Use the `gh` CLI for all op
55
- Never delete an issue or PR, or change its status, unless explicitly requested
66
- Never mention CVEs, security vulnerabilities, or advisories in issues or PRs. Describe the change as a dependency update (e.g. "Update fast-xml-parser to latest version", not "Fix CVE-2026-25896").
77

8-
## Commands
8+
## Issue commands
99

10-
- **Create**: `gh issue create --title "..." --body "..."` (heredoc for multi-line bodies)
1110
- **Read**: `gh issue view <number> --comments`
1211
- **List**: `gh issue list --state open --json number,title,body,labels,comments --jq '[.[] | {number, title, body, labels: [.labels[].name], comments: [.comments[].body]}]'` with `--label` / `--state` filters as needed
1312
- **Comment**: `gh issue comment <number> --body "..."`
1413
- **Label**: `gh issue edit <number> --add-label "..."` / `--remove-label "..."`
1514
- **Close**: `gh issue close <number> --comment "..."`
15+
- **Create**: see [Creating issues](#creating-issues) — a real issue needs `--type`, often `--parent`, and sometimes dependency flags
1616

1717
When a skill says "publish to the issue tracker", create a GitHub issue. When it says "fetch the relevant ticket", run `gh issue view <number> --comments`.
1818

19-
## Pull requests as a triage surface
19+
## Creating issues
2020

21-
**PRs as a request surface: yes.** `/triage` pulls external PRs into the same queue as issues and runs them through the same labels and states, using the `gh pr` equivalents (collaborators' in-flight PRs are left alone):
21+
- Assign the issue type, parent, and any dependencies in the single create command (requires `gh` 2.94.0+):
2222

23-
- **Read a PR**: `gh pr view <number> --comments`, plus `gh pr diff <number>` for the diff.
24-
- **List external PRs for triage**: `gh pr list --state open --json number,title,body,labels,author,authorAssociation,comments`, then keep only `authorAssociation` of `CONTRIBUTOR`, `FIRST_TIME_CONTRIBUTOR`, or `NONE` (drop `OWNER`/`MEMBER`/`COLLABORATOR`).
25-
- **Comment / label / close**: `gh pr comment`, `gh pr edit --add-label`/`--remove-label`, `gh pr close`.
23+
```bash
24+
gh issue create --title "..." --body "..." --label "..." --type "<type>" \
25+
--parent <parent-number-or-url> \
26+
--blocked-by <numbers> --blocking <numbers>
27+
```
2628

27-
GitHub shares one number space across issues and PRs, so a bare `#42` may be either — resolve with `gh pr view 42` and fall back to `gh issue view 42`.
28-
29-
## Issues
29+
`--type` is one of `Bug`, `Feature`, `Epic`, `Task`, or `Spike`. `--parent` links the issue as a sub-issue. `--blocked-by`/`--blocking` mark dependencies (comma-separated numbers or URLs). Omit any flag you don't need.
3030

31-
- Assign an issue type on creation: `Bug`, `Feature`, `Epic`, `Task`, or `Spike`. Set it via REST after creation: `gh api -X PATCH repos/{owner}/{repo}/issues/{number} --field type={type_name}`
31+
- The issue type is set with `--type`, never as a label.
3232
- Use the matching template in `.github/ISSUE_TEMPLATE/`: Bug → `01-bug-report.md`, Feature → `02-feature-request.md`, Epic → `03-epic.md`, Task → `04-task.md`, Spike → `05-spike.md`
3333
- Fill in detail from the codebase or web when creating issues
34-
- A `Task` or `Spike` must have a parent issue typed `Bug`, `Feature`, or `Epic`
34+
- A `Task` or `Spike` generally has a parent issue typed `Bug`, `Feature`, or `Epic` — pass it with `--parent`
3535
- Only apply labels from the existing set; never create new labels, and don't add or remove labels unless explicitly requested
3636
- Audience labels (internal vs. community) and their footers: see `docs/agents/issue-audience.md`
3737

38-
## Sub-issues
38+
To change these on an existing issue, use `gh issue edit <number>` — note the flag names differ from create: `--parent <n>` / `--remove-parent`, `--add-blocked-by <n>` / `--remove-blocked-by <n>`, `--add-blocking <n>` / `--remove-blocking <n>`, and `--add-sub-issue <n>` / `--remove-sub-issue <n>`.
3939

40-
`gh issue create` has no `--parent`. Create the child first, then link via GraphQL:
40+
## Pull requests
4141

42-
```bash
43-
PARENT_ID=$(gh issue view <parent-number> --json id --jq '.id')
44-
CHILD_ID=$(gh issue view <child-number> --json id --jq '.id')
45-
gh api graphql \
46-
-H "GraphQL-Features: sub_issues" \
47-
-f query="mutation { addSubIssue(input: { issueId: \"$PARENT_ID\", subIssueId: \"$CHILD_ID\" }) { issue { title } subIssue { title } } }"
48-
```
42+
- Always publish as a draft, and set up remote tracking when publishing a branch
43+
- Title describes the change conceptually (e.g. "Add vertex filtering to graph view"); no conventional-commit prefixes (`docs:`, `fix:`, etc.)
44+
- Follow `.github/pull_request_template.md`; link the issue when one exists (e.g. `Fixes #123`)
45+
- Keep the description concise: a bulleted list of conceptual changes with the reason for each so reviewers can scan
46+
- Only check a template checklist item if that action was actually performed this session (e.g. only check `pnpm checks`/`pnpm test` if you ran them and they passed); leave unchecked when unsure
47+
48+
## Pull requests as a triage surface
49+
50+
**PRs as a request surface: yes.** `/triage` pulls external PRs into the same queue as issues and runs them through the same labels and states, using the `gh pr` equivalents (collaborators' in-flight PRs are left alone):
51+
52+
- **Read a PR**: `gh pr view <number> --comments`, plus `gh pr diff <number>` for the diff.
53+
- **List external PRs for triage**: `gh pr list --state open --json number,title,body,labels,author,authorAssociation,comments`, then keep only `authorAssociation` of `CONTRIBUTOR`, `FIRST_TIME_CONTRIBUTOR`, or `NONE` (drop `OWNER`/`MEMBER`/`COLLABORATOR`).
54+
- **Comment / label / close**: `gh pr comment`, `gh pr edit --add-label`/`--remove-label`, `gh pr close`.
55+
56+
GitHub shares one number space across issues and PRs, so a bare `#42` may be either — resolve with `gh pr view 42` and fall back to `gh issue view 42`.
4957

5058
## Related issues
5159

52-
When an issue or PR relates to another, add a `## Related Issues` section as a list (always a list, even for one item — GitHub expands the reference into the item's title). Prefix each with a relationship descriptor: `Fixes`/`Resolves` (closes it), `Part of` (larger effort), `Parent`, `Duplicate`, or another brief one.
60+
Both issues and PRs can carry a `## Related Issues` section in their body — a list (always a list, even for one item; GitHub expands each reference into the linked item's title). Prefix each entry with a relationship descriptor:
61+
62+
- An **issue** links to other issues: `Part of` (larger effort), `Parent`, `Duplicate`, `Blocked by`/`Blocking`, or another brief one.
63+
- A **PR** links to its originating issue with `Fixes`/`Resolves` (closes it on merge), and to any other related issues or PRs with the same descriptors.
64+
65+
**Parent** and **blocked-by/blocking** are native GitHub fields — set them with the `gh` flags (see [Creating issues](#creating-issues)), not prose alone. Listing them here as well is fine, but the relationship must exist as the structural field, never only in prose.
5366

5467
```markdown
5568
## Related Issues
5669

5770
- Resolves #123
5871
- Part of #456
5972
```
60-
61-
## Pull requests
62-
63-
- Always publish as a draft, and set up remote tracking when publishing a branch
64-
- Title describes the change conceptually (e.g. "Add vertex filtering to graph view"); no conventional-commit prefixes (`docs:`, `fix:`, etc.)
65-
- Follow `.github/pull_request_template.md`; link the issue when one exists (e.g. `Fixes #123`)
66-
- Keep the description concise: a bulleted list of conceptual changes with the reason for each so reviewers can scan
67-
- Only check a template checklist item if that action was actually performed this session (e.g. only check `pnpm checks`/`pnpm test` if you ran them and they passed); leave unchecked when unsure

0 commit comments

Comments
 (0)