Skip to content

Commit e13ad05

Browse files
committed
Add project board integration to agent workflows
- pr-creator step 6: move linked issue to "In progress" on Stackpop Development board (skip if already "In review"); add status ID table - issue-creator step 5: add new issues to board and set status to "Ready" with status ID reference table - Fix mojibake em dashes, add --assignee @me, add no-byline rule to CLAUDE.md - Update step 3 to ask user for issue number before auto-creating
1 parent 8888306 commit e13ad05

3 files changed

Lines changed: 110 additions & 8 deletions

File tree

.claude/agents/issue-creator.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,45 @@ Get the issue node ID with:
5151
gh issue view <number> --json id --jq '.id'
5252
```
5353

54-
### 5. Report
54+
### 5. Add to project board and set status
55+
56+
Add the issue to the **Stackpop Development** project and set its status to
57+
"Ready". The `addProjectV2ItemById` mutation returns the project item ID needed
58+
for the status update.
59+
60+
```
61+
ITEM_ID=$(gh api graphql -f query='mutation {
62+
addProjectV2ItemById(input: {
63+
projectId: "PVT_kwDOAAuvmc4BFjF5",
64+
contentId: "<issue_node_id>"
65+
}) { item { id } }
66+
}' --jq '.data.addProjectV2ItemById.item.id')
67+
```
68+
69+
Then set status to "Ready":
70+
71+
```
72+
gh api graphql -f query='mutation {
73+
updateProjectV2ItemFieldValue(input: {
74+
projectId: "PVT_kwDOAAuvmc4BFjF5",
75+
itemId: "'"$ITEM_ID"'",
76+
fieldId: "PVTSSF_lADOAAuvmc4BFjF5zg22lrY",
77+
value: { singleSelectOptionId: "61e4505c" }
78+
}) { projectV2Item { id } }
79+
}'
80+
```
81+
82+
Project board status IDs:
83+
84+
| Status | ID |
85+
| ----------- | ---------- |
86+
| Backlog | `f75ad846` |
87+
| Ready | `61e4505c` |
88+
| In progress | `47fc9ee4` |
89+
| In review | `df73e18b` |
90+
| Done | `98236657` |
91+
92+
### 6. Report
5593

5694
Output the issue URL and type.
5795

.claude/agents/pr-creator.md

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ cargo test --workspace --all-targets
2525
cargo check --workspace --all-targets --features "fastly cloudflare"
2626
```
2727

28-
If any gate fails, report the failure and stop do not create a broken PR.
28+
If any gate fails, report the failure and stop -- do not create a broken PR.
2929

3030
### 3. Ensure a linked issue exists
3131

32-
Every PR should close a ticket. If no issue exists for this work:
32+
Every PR should close a ticket.
3333

34-
1. Create one using the appropriate issue type (see Issue Types below).
35-
2. Reference it in the PR body with `Closes #<number>`.
34+
1. Ask the user for the issue number to close, or whether to create a new one.
35+
2. If creating a new issue, use the appropriate issue type (see Issue Types below).
36+
3. Reference it in the PR body with `Closes #<number>`.
3637

3738
### 4. Draft PR content
3839

@@ -47,7 +48,7 @@ Using the `.github/pull_request_template.md` structure, draft:
4748
### 5. Create the PR
4849

4950
```
50-
gh pr create --title "<short title under 70 chars>" --body "$(cat <<'EOF'
51+
gh pr create --title "<short title under 70 chars>" --assignee @me --body "$(cat <<'EOF'
5152
<filled template>
5253
EOF
5354
)"
@@ -62,7 +63,68 @@ EOF
6263
)"
6364
```
6465

65-
### 6. Report
66+
### 6. Update issue status
67+
68+
After creating the PR, move the linked issue to "In progress" on the
69+
**Stackpop Development** project -- unless it is already "In review".
70+
71+
1. Get the issue's project item ID and current status:
72+
73+
```
74+
gh api graphql -f query='query($issueId: ID!) {
75+
node(id: $issueId) {
76+
... on Issue {
77+
projectItems(first: 10) {
78+
nodes {
79+
id
80+
fieldValueByName(name: "Status") {
81+
... on ProjectV2ItemFieldSingleSelectValue { name optionId }
82+
}
83+
}
84+
}
85+
}
86+
}
87+
}' -f issueId="<issue_node_id>"
88+
```
89+
90+
2. If the current status is **not** "In review" (`df73e18b`), set it to
91+
"In progress" (`47fc9ee4`):
92+
93+
```
94+
gh api graphql -f query='mutation {
95+
updateProjectV2ItemFieldValue(input: {
96+
projectId: "PVT_kwDOAAuvmc4BFjF5",
97+
itemId: "<project_item_id>",
98+
fieldId: "PVTSSF_lADOAAuvmc4BFjF5zg22lrY",
99+
value: { singleSelectOptionId: "47fc9ee4" }
100+
}) { projectV2Item { id } }
101+
}'
102+
```
103+
104+
3. If the issue is not yet on the project, add it first:
105+
106+
```
107+
gh api graphql -f query='mutation {
108+
addProjectV2ItemById(input: {
109+
projectId: "PVT_kwDOAAuvmc4BFjF5",
110+
contentId: "<issue_node_id>"
111+
}) { item { id } }
112+
}'
113+
```
114+
115+
Then set the status as above.
116+
117+
Project board status IDs:
118+
119+
| Status | ID |
120+
| ----------- | ---------- |
121+
| Backlog | `f75ad846` |
122+
| Ready | `61e4505c` |
123+
| In progress | `47fc9ee4` |
124+
| In review | `df73e18b` |
125+
| Done | `98236657` |
126+
127+
### 7. Report
66128

67129
Output the PR URL and a summary of what was included.
68130

@@ -98,4 +160,5 @@ Do **not** use labels as a substitute for types.
98160
- If the branch has many commits, group related changes in the summary.
99161
- Never force-push or rebase without explicit user approval.
100162
- Always base PRs against `main` unless told otherwise.
101-
- Do **not** include any byline, "Generated with" footer, or `Co-Authored-By` trailer — in PR bodies or commit messages.
163+
- Always assign the PR to the current user (`--assignee @me`).
164+
- Do **not** include any byline, "Generated with" footer, or `Co-Authored-By` trailer -- in PR bodies or commit messages.

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,3 +318,4 @@ Custom commands live in `.claude/commands/`:
318318
- Don't make large, sweeping refactors — keep changes minimal and focused.
319319
- Don't commit without running `cargo test` first.
320320
- Don't skip `cargo fmt` and `cargo clippy` — CI will reject the PR.
321+
- Don't include `Co-Authored-By` trailers, "Generated with" footers, or any AI bylines in commits or PR bodies.

0 commit comments

Comments
 (0)