Skip to content

Commit 94d3c71

Browse files
authored
Merge pull request #519 from openclimatefix/claude/skill-note-closing-refs-correction
Correct the closing-issue check: commit messages are a second route
2 parents e22e2b4 + 5208f14 commit 94d3c71

1 file changed

Lines changed: 18 additions & 11 deletions

File tree

  • .claude/skills/github-issue-pr-workflow

.claude/skills/github-issue-pr-workflow/SKILL.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,29 @@ Never squash-merge. Jack wants the full commit history preserved in `main`, so u
5050
(`gh pr merge --merge`) or rebase (`gh pr merge --rebase`), not `gh pr merge --squash`. Under the
5151
`implement-issue` routine you stop and wait for Jack's review rather than merging at all.
5252

53-
**Check what the merge will close, before you merge:**
53+
**Check what the merge will close, before you merge.** Issues are closed by two independent
54+
routes, and you have to check both — neither one shows you the other's:
5455

5556
```bash
5657
gh pr view <N> --json closingIssuesReferences --jq '.closingIssuesReferences[].number'
58+
git log origin/main..HEAD --format='%B' | grep -inE '(close[sd]?|fix(e[sd])?|resolve[sd]?) +#[0-9]+'
5759
```
5860

59-
Every number listed is closed the moment the PR merges. The list is *sticky*: a closing keyword
60-
in an early draft of the PR body, or in any commit message on the branch, registers the link
61-
permanently, and later editing that text away does not remove it. So a PR whose body now says
62-
"filed rather than fixed, see #512" can still be holding a closing link to #512 from a draft —
63-
reading the current body is not enough, and neither is grepping the commits.
64-
65-
If the list contains an issue you did not mean to close, either sort it out before merging or
66-
watch for it afterwards: `gh issue reopen <N>`, then put its project Status back (the board
67-
automation moves a closed issue to Done, and reopening it lands on In Progress, not Todo — see
68-
the `github-graphql` skill for `gh project item-edit`).
61+
The first lists the links registered from the **PR body** (and the Development sidebar). That list
62+
is *sticky*: GitHub registers a link when the text containing the keyword is first saved and does
63+
not drop it when the text is edited away. A PR whose body now reads "filed rather than fixed, see
64+
\#512" can still hold a closing link to 512 from an early draft, so reading the current body proves
65+
nothing. A link you did not intend cannot be edited out either — close the PR and open it again
66+
from the same branch with a clean body.
67+
68+
The second catches keywords in **commit messages**, which close their issue when the commit lands
69+
on `main` and are invisible to `closingIssuesReferences` beforehand — that field stays `[]` right
70+
up to the merge. Prose *about* a closure counts: "Merging #514 closed #512" in a commit message
71+
closes 512. Keep those words away from any issue reference when writing about one.
72+
73+
When something is closed that should not have been: `gh issue reopen <N>`, then put its project
74+
Status back explicitly. The board automation moves a closed issue to Done, and reopening lands it
75+
on In Progress rather than Todo — see the `github-graphql` skill for `gh project item-edit`.
6976

7077
## GraphQL calls
7178

0 commit comments

Comments
 (0)