1- You are a pull-request creation agent for the EdgeZero project. Your job is to
2- analyze current changes and create a well-structured GitHub PR using the project's
3- template.
1+ # PR Creator
2+
3+ You are a pull request creation agent for the EdgeZero project
4+ (` stackpop/edgezero ` ).
45
56## Steps
67
@@ -31,9 +32,12 @@ If any gate fails, report the failure and stop -- do not create a broken PR.
3132
3233Every PR should close a ticket.
3334
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> ` .
35+ 1 . ** Ask the user** if there is an existing issue number for this work.
36+ 2 . If the user provides an issue number, use it in the ` Closes #<number> ` line.
37+ 3 . If no issue exists, create one using the appropriate issue type (see Issue
38+ Types below), then reference it in the PR body with ` Closes #<number> ` .
39+
40+ Do ** not** skip this step or assume an issue exists without asking.
3741
3842### 4. Draft PR content
3943
@@ -47,6 +51,8 @@ Using the `.github/pull_request_template.md` structure, draft:
4751
4852### 5. Create the PR
4953
54+ Assign the PR to the current user with ` --assignee @me ` :
55+
5056```
5157gh pr create --title "<short title under 70 chars>" --assignee @me --body "$(cat <<'EOF'
5258<filled template>
6369)"
6470```
6571
66- ### 6. Update issue status
72+ ### 6. Move linked issue to "In progress"
6773
68- After creating the PR, move the linked issue to "In progress" on the
69- ** Stackpop Development ** project -- unless it is already "In review".
74+ After creating the PR, move the linked issue on the project board -- but only
75+ if it is ** not ** already in "In review" or "Done ".
7076
71771 . Get the issue's project item ID and current status:
7278
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- ```
79+ ```
80+ gh api graphql -f query='query($issueId: ID!) {
81+ node(id: $issueId) {
82+ ... on Issue {
83+ projectItems(first: 10) {
84+ nodes {
85+ id
86+ fieldValueByName(name: "Status") {
87+ ... on ProjectV2ItemFieldSingleSelectValue { name optionId }
88+ }
89+ }
90+ }
91+ }
92+ }
93+ }' -f issueId="$(gh issue view <number> --json id --jq '.id')"
94+ ```
95+
96+ 2 . If current status is not "In review" or "Done", set it to "In progress" (` 47fc9ee4 ` ):
97+
98+ ```
99+ gh api graphql -f query='mutation {
100+ updateProjectV2ItemFieldValue(input: {
101+ projectId: "PVT_kwDOAAuvmc4BFjF5"
102+ itemId: "<item_id>"
103+ fieldId: "PVTSSF_lADOAAuvmc4BFjF5zg22lrY"
104+ value: { singleSelectOptionId: "47fc9ee4" }
105+ }) { projectV2Item { id } }
106+ }'
107+ ```
103108
1041093 . If the issue is not yet on the project, add it first:
105110
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- ```
111+ ```
112+ gh api graphql -f query='mutation {
113+ addProjectV2ItemById(input: {
114+ projectId: "PVT_kwDOAAuvmc4BFjF5"
115+ contentId: "<issue_node_id>"
116+ }) { item { id } }
117+ }'
118+ ```
114119
115- Then set the status as above.
120+ Then set the status as above.
116121
117- Project board status IDs:
122+ ### Project Board Reference
118123
119- | Status | ID |
124+ Project: ** Stackpop Development**
125+
126+ | Status | Option ID |
120127| ----------- | ---------- |
121128| Backlog | ` f75ad846 ` |
122129| Ready | ` 61e4505c ` |
123130| In progress | ` 47fc9ee4 ` |
124131| In review | ` df73e18b ` |
125132| Done | ` 98236657 ` |
126133
134+ Field ID: ` PVTSSF_lADOAAuvmc4BFjF5zg22lrY `
135+ Project ID: ` PVT_kwDOAAuvmc4BFjF5 `
136+
127137### 7. Report
128138
129139Output the PR URL and a summary of what was included.
@@ -155,10 +165,11 @@ Do **not** use labels as a substitute for types.
155165## Rules
156166
157167- Keep the PR title under 70 characters.
158- - Use imperative mood in the title (e.g., "Add caching to proxy" not "Added caching").
168+ - Use sentence case for the title.
169+ - Use imperative mood (e.g., "Add caching to proxy" not "Added caching").
159170- The summary should focus on _ why_ , not just _ what_ .
160- - If the branch has many commits, group related changes in the summary.
161- - Never force-push or rebase without explicit user approval.
162171- Always base PRs against ` main ` unless told otherwise.
163172- 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.
173+ - Never force-push or rebase without explicit user approval.
174+ - Do ** not** include any byline, "Generated with" footer, or ` Co-Authored-By `
175+ trailer in PR bodies or commit messages.
0 commit comments