Skip to content

Commit a47134e

Browse files
authored
Merge pull request #972 from Bre77/claude/address-pr-160759-feedback-AFElu
Address PR review feedback for raise-pull-request agent
2 parents a6c141d + 3b75b8a commit a47134e

1 file changed

Lines changed: 30 additions & 92 deletions

File tree

.claude/agents/raise-pull-request.md

Lines changed: 30 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,16 @@ From the file paths, identify:
7272

7373
## Step 3: Run Code Quality Checks
7474

75-
Run these checks and track results for checkbox states:
75+
Run `prek` to perform all code quality checks (formatting, linting, hassfest, etc.):
7676

7777
```bash
78-
# Format code with Ruff
79-
ruff format homeassistant/components/{integration} tests/components/{integration}
80-
81-
# Check for linting issues
82-
ruff check homeassistant/components/{integration} tests/components/{integration}
83-
84-
# Run hassfest to validate manifest and update generated files
85-
python -m script.hassfest --integration-path homeassistant/components/{integration}
78+
prek run --all-files
8679
```
8780

8881
**Track results:**
89-
- `RUFF_FORMAT_PASSED`: true if ruff format made no changes or only formatting changes that are now fixed
90-
- `RUFF_CHECK_PASSED`: true if ruff check reports no errors
91-
- `HASSFEST_PASSED`: true if hassfest completes without errors
82+
- `PREK_PASSED`: true if `prek run` exits with code 0
83+
84+
**If `prek` fails or is not available, STOP and report the failure to the user. Do not proceed with PR creation.**
9285

9386
## Step 4: Run Tests
9487

@@ -139,19 +132,19 @@ Select exactly ONE based on the changes. Mark the selected type with `[x]` and a
139132

140133
Based on the verification steps above, determine checkbox states:
141134

142-
| Placeholder | Condition to tick |
143-
|-------------|-------------------|
144-
| `tested_checkbox` | Tick only if `TESTS_PASSED` is true |
145-
| `tests_pass_checkbox` | Tick only if `TESTS_PASSED` is true |
146-
| `no_comments_checkbox` | Tick after verifying in Step 5 |
147-
| `dev_checklist_checkbox` | Tick only if all Step 5 items pass |
148-
| `perfect_pr_checkbox` | Tick if PR is focused on single change |
149-
| `ruff_checkbox` | Tick only if `RUFF_FORMAT_PASSED` and `RUFF_CHECK_PASSED` |
150-
| `tests_added_checkbox` | Tick only if test files were added/modified with new test functions |
151-
| `docs_checkbox` | Tick if documentation PR created (or not applicable) |
152-
| `manifest_checkbox` | Tick if `HASSFEST_PASSED` is true (or not applicable) |
153-
| `requirements_checkbox` | Tick if requirements_all.txt updated (or not applicable) |
154-
| `changelog_checkbox` | Tick if dependency changelog linked in PR description (or not applicable) |
135+
| Checkbox | Condition to tick |
136+
|----------|-------------------|
137+
| The code change is tested and works locally | Tick only if `TESTS_PASSED` is true |
138+
| Local tests pass | Tick only if `TESTS_PASSED` is true |
139+
| There is no commented out code | Tick after verifying in Step 5 |
140+
| Development checklist | Tick only if all Step 5 items pass |
141+
| Perfect PR recommendations | Tick if PR is focused on single change |
142+
| Formatted using Ruff | Tick only if `PREK_PASSED` is true |
143+
| Tests have been added | Tick only if test files were added/modified with new test functions |
144+
| Documentation added/updated | Tick if documentation PR created (or not applicable) |
145+
| Manifest file fields filled out | Tick if `PREK_PASSED` is true (or not applicable) |
146+
| Dependencies in requirements_all.txt | Tick if requirements_all.txt updated (or not applicable) |
147+
| Dependency changelog linked | Tick if dependency changelog linked in PR description (or not applicable) |
155148

156149
## Step 8: Breaking Change Section
157150

@@ -164,13 +157,13 @@ If it IS breaking or deprecation, keep the `## Breaking change` section and desc
164157

165158
## Step 9: Stage Any Changes from Checks
166159

167-
If ruff or hassfest made changes, stage them:
160+
If `prek` made any formatting or generated file changes, stage and commit them as a separate commit:
168161

169162
```bash
170163
git status --porcelain
171164
# If changes exist:
172165
git add -A
173-
git commit --amend --no-edit
166+
git commit -m "Apply prek formatting and generated file updates"
174167
```
175168

176169
## Step 10: Push Branch and Create PR
@@ -180,8 +173,8 @@ git commit --amend --no-edit
180173
BRANCH=$(git branch --show-current)
181174
GITHUB_USER=$(git remote get-url origin | sed -E 's/.*[:/]([^/]+)\/core.*/\1/')
182175

183-
# Push branch (force if we amended)
184-
git push -u origin "$BRANCH" --force-with-lease
176+
# Push branch
177+
git push -u origin "$BRANCH"
185178

186179
# Create PR
187180
gh pr create --repo home-assistant/core --base dev \
@@ -195,72 +188,17 @@ EOF
195188

196189
## PR Body Template
197190

198-
Construct the body based on all verification results. **Important: Preserve all template options exactly as shown - only modify checkbox states, do not remove unselected items or reorder sections.**
199-
200-
```markdown
201-
## Breaking change
202-
203-
[If type is "Breaking change" or "Deprecation", describe what breaks, how users can fix it, and why. Otherwise, REMOVE this entire section including the heading.]
204-
205-
## Proposed change
206-
207-
[Describe the change and why - extract from commit messages]
208-
209-
## Type of change
210-
211-
- [{dependency_checkbox}] Dependency upgrade
212-
- [{bugfix_checkbox}] Bugfix (non-breaking change which fixes an issue)
213-
- [{new_integration_checkbox}] New integration (thank you!)
214-
- [{new_feature_checkbox}] New feature (which adds functionality to an existing integration)
215-
- [{deprecation_checkbox}] Deprecation (breaking change to happen in the future)
216-
- [{breaking_checkbox}] Breaking change (fix/feature causing existing functionality to break)
217-
- [{code_quality_checkbox}] Code quality improvements to existing code or addition of tests
218-
219-
## Additional information
191+
Read the PR template from `.github/PULL_REQUEST_TEMPLATE.md` and use it as the basis for the PR body. **Do not hardcode the template — always read it from the file to stay in sync with upstream changes.**
220192

221-
- This PR fixes or closes issue: fixes #
222-
- This PR is related to issue:
223-
- Link to documentation pull request:
224-
- Link to developer documentation pull request:
225-
- Link to frontend pull request:
193+
Strip out all HTML comments (`<!-- ... -->`) from the template, then fill in the sections:
226194

227-
## Checklist
228-
229-
- [ ] I understand the code I am submitting and can explain how it works.
230-
- [{tested_checkbox}] The code change is tested and works locally.
231-
- [{tests_pass_checkbox}] Local tests pass. **Your PR cannot be merged unless tests pass**
232-
- [{no_comments_checkbox}] There is no commented out code in this PR.
233-
- [{dev_checklist_checkbox}] I have followed the [development checklist][dev-checklist]
234-
- [{perfect_pr_checkbox}] I have followed the [perfect PR recommendations][perfect-pr]
235-
- [{ruff_checkbox}] The code has been formatted using Ruff (`ruff format homeassistant tests`)
236-
- [{tests_added_checkbox}] Tests have been added to verify that the new code works.
237-
- [ ] Any generated code has been carefully reviewed for correctness and compliance with project standards.
238-
239-
If user exposed functionality or configuration variables are added/changed:
240-
241-
- [{docs_checkbox}] Documentation added/updated for [www.home-assistant.io][docs-repository]
242-
243-
If the code communicates with devices, web services, or third-party tools:
244-
245-
- [{manifest_checkbox}] The [manifest file][manifest-docs] has all fields filled out correctly.
246-
Updated and included derived files by running: `python3 -m script.hassfest`.
247-
- [{requirements_checkbox}] New or updated dependencies have been added to `requirements_all.txt`.
248-
Updated by running `python3 -m script.gen_requirements_all`.
249-
- [{changelog_checkbox}] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
250-
251-
To help with the load of incoming pull requests:
252-
253-
- [ ] I have reviewed two other [open pull requests][prs] in this repository.
254-
255-
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
256-
[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/
257-
[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/
258-
[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/
259-
[docs-repository]: https://github.com/home-assistant/home-assistant.io
260-
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr
261-
```
195+
1. **Breaking change section**: If the type is NOT "Breaking change" or "Deprecation", remove the entire `## Breaking change` section (heading and body). Otherwise, describe what breaks, how users can fix it, and why.
196+
2. **Proposed change section**: Fill in a description of the change extracted from commit messages.
197+
3. **Type of change**: Check exactly ONE checkbox matching the determined type from Step 6. Leave all others unchecked.
198+
4. **Additional information**: Fill in any related issue numbers if known.
199+
5. **Checklist**: Check boxes based on the verification results from Steps 3-5 and the conditions in Step 7.
262200

263-
**Note:** Replace each `{*_checkbox}` placeholder with `x` if the condition passed, or ` ` (space) if it did not. This applies to both the "Type of change" checkboxes (only one should be `x`) and the "Checklist" checkboxes (multiple can be `x` based on verification results).
201+
**Important:** Preserve all template structure, options, and link references exactly as they appear in the file — only modify checkbox states and fill in content sections.
264202

265203
## Step 11: Report Result
266204

0 commit comments

Comments
 (0)