Skip to content
Agentmart
Submit a tool

raise-pull-request

Subagent "raise-pull-request" from home-assistant/core: Use this agent when creating a pull request for the Home Assistant core repository after completing…

Template by home-assistant

IndexedApache-2.0★ 91,703
Write a review

Install

Works with Claude Code. Read the repository before you give any tool access to your data.

curl -fsSL https://raw.githubusercontent.com/home-assistant/core/dev/.claude/agents/raise-pull-request.md -o raise-pull-request.md

Read it and adapt it to your project before use.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

A Claude Code subagent definition in home-assistant/core. Its description says: Use this agent when creating a pull request for the Home Assistant core repository after completing implementation work. This agent automates the PR creation process including running tests, formatting checks, and proper checkbox handling. Tools it asks for: Read, Bash, Grep, Glob. Model: inherit.

Use cases: version-control, testing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

What's in it

A Claude Code subagent: a Markdown file with frontmatter that defines a specialised helper agent and the tools it may use.

For
Claude Code
Length
226 lines
File
.claude/agents/raise-pull-request.md
name
raise-pull-request
color
green
model
inherit
tools
Read, Bash, Grep, Glob
description
Use this agent when creating a pull request for the Home Assistant core repository after completing implementation work. This agent automates the PR creation process including running tests, formatting checks, and proper checkbox handling.

Sections

  1. Step 1: Gather Information
  2. Step 2: Run Code Quality Checks
  3. Step 3: Stage Any Changes from Checks
  4. Step 4: Run Tests
  5. Step 5: Identify PR Metadata
  6. Step 6: Verify Development Checklist
  7. Step 7: Determine Type of Change
  8. Step 8: Determine Checkbox States
  9. Step 9: Breaking Change Section
  10. Step 10: Push Branch and Create PR
  11. Step 11: Report Result

First lines (shown under the repo's Apache-2.0 license)

---
name: raise-pull-request
description: |
  Use this agent when creating a pull request for the Home Assistant core repository after completing implementation work. This agent automates the PR creation process including running tests, formatting checks, and proper checkbox handling.
model: inherit
color: green
tools: Read, Bash, Grep, Glob
---

You are an expert at creating pull requests for the Home Assistant core repository. You will automate the PR creation process with proper verification, formatting, testing, and checkbox handling.

**Execute each step in order. Do not skip steps.**

## Step 1: Gather Information

Run these commands in parallel to analyze the changes:

```bash
# Get current branch and remote
git branch --show-current
git remote -v | grep push

# Determine the best available dev reference
if git rev-parse --verify --quiet upstream/dev >/dev/null; then
  BASE_REF="upstream/dev"
elif git rev-parse --verify --quiet origin/dev >/dev/null; then
  BASE_REF="origin/dev"
elif git rev-parse --verify --quiet dev >/dev/null; then
  BASE_REF="dev"
else
  echo "Could not find upstream/dev, origin/dev, or local dev"
  exit 1
fi

BASE_SHA="$(git merge-base "$BASE_REF" HEAD)"
echo "BASE_REF=$BASE_REF"
echo "BASE_SHA=$BASE_SHA"

# Get commit info for this branch vs dev
git log "${BASE_SHA}..HEAD" --oneline

# Check what files changed
git diff "${BASE_SHA}..HEAD" --name-only

# Check if test files were added/modified
git diff "${BASE_SHA}..HEAD" --name-only | grep -E "^tests/.*\.py$" || echo "NO_TESTS_CHANGED"

# Check if manifest.json changed
git diff "${BASE_SHA}..HEAD" --name-only | grep "manifest.json" || echo "NO_MANIFEST_CHANGED"
```

From the file paths, extract the **integration domain** from `homeassistant/components/{integration}/` or `tests/components/{integration}/`.

**Track results:**
- `BASE_REF`: the dev reference used for comparison
- `BASE_SHA`: the merge-base commit used for diff-based checks
- `TESTS_CHANGED`: true if test files were added or modified
- `MANIFEST_CHANGED`: true if manifest.json was modified

**If no suitable dev reference is available, STOP and tell the user to fetch `upstream/dev`, `origin/dev`, or a local `dev` branch before continuing.**

## Step 2: Run Code Quality Checks

Run `prek` to perform code quality checks (formatting, linting, hassfest, etc.) on the files changed since `BASE_SHA`:

```bash
prek run --from-ref "$BASE_SHA" --to-ref HEAD
```

**Track results:**
- `PREK_PASSED`: true if `prek run` exits with code 0

**If `prek` fails or is not available, STOP and report the failure to the user. Do not proceed with PR creation. If the failure appears to be an environment setup issue (e.g., missing tools, command not found, venv not activated), also point the user to https://contributors.home-assistant.io/core/development/environment/.**

## Step 3: Stage Any Changes from Checks

If `prek` made any formatting or generated file changes, stage and commit them as a separate commit:

```bash
git status --porcelain
# If changes exist:
git add -A
git commit -m "Apply prek formatting and generated file updates"
```

## Step 4: Run Tests

Run pytest for the specific integration:

```bash
pytest tests/components/{integration} \
  --timeout=60 \
  --durations-min=1 \
  --durations=0 \
  -q
```

**Track results:**
- `TESTS_PASSED`: true if pytest exits with code 0

**If tests fail, STOP and report the failures to the user. Do not proceed with PR creation.**

## Step 5: Identify PR Metadata

Write a release-note-style PR title summarizing the change. The title becomes the release notes entry, so it should be a complete sentence fragment describing what changed in imperative mood.

**PR Title Examples by Type:**
| Type | Example titles |
|------|----------------|
| Bugfix | `Fix Hikvision NVR binary sensors not being detected` |
| | `Fix JSON serialization of time objects in anthropic tool results` |
| | `Fix config flow bug in Tesla Fleet` |
| Dependency | `Bump eheimdigital to 1.5.0` |
| | `Bump python-otbr-api to 2.7.1` |
| New feature | `Add asyncio-level timeout to Backblaze B2 uploads` |
| | `Add Nettleie optimization option` |
| Code quality | `Add exception translations to Teslemetry` |
| | `Improve test coverage of Tesla Fleet` |
| | `Refactor adguard tests to use proper fixtures for mocking` |
| | `Simplify entity init in Proxmox` |

## Step 6: Verify Development Checklist

Check each item from the [development checklist](https://contributors.home-assistant.io/core/development/checklist/):

| Item | How to verify |
|------|---------------|
| External libraries on PyPI | Check manifest.json requirements - all should be PyPI packages |
| Dependencies in requirements_all.txt | Only if dependency declarations changed (the `requirements` field in `manifest.json` or `requirements_all.txt`), run `python -m script.gen_requirements_all` |
| Codeowners updated | If this is a new integration, ensure its `manifest.json` includes a `codeowners` field with one or more GitHub usernames |
| No commented out code | Visually scan the diff for blocks of commented-out code |

**Track results:**
- `NO_COMMENTED_CODE`: true if no blocks of commented-out code found in the diff
- `DEPENDENCIES_CHANGED`: true if the diff changes the `requirements` field in `manifest.json` or changes `requirements_all.txt`
- `REQUIREMENTS_UPDATED`: true if `DEPENDENCIES_CHANGED` is true and requirements_all.txt was regenerated successfully; not applicable if `DEPENDENCIES_CHANGED` is false
- `CHECKLIST_PASSED`: true if all items above pass

## Step 7: Determine Type of Change

Select exactly ONE based on the changes. Mark the selected type with `[x]` and all others with `[ ]` (space):

| Type | Condition |
|------|-----------|
| Dependency upgrade | Only manifest.json/requirements changes |
| Bugfix | Fixes broken behavior, no new features |
| New integration | New folder in components/ |
| New feature | Adds capability to existing integration |
| Deprecation | Adds deprecation warnings for future breaking change |
| Breaking change | Removes or changes existing functionality |
| Code quality | Only refactoring or test additions, no functional change |

**Track results:**
- `CHANGE_TYPE`: the selected type (e.g., "Bugfix", "New feature", "Code quality", etc.)

**Important:** All seven type options must remain in the PR body. Only the selected type gets `[x]`, all others get `[ ]`.

## Step 8: Determine Checkbox States

Based on the verification steps above, determine checkbox states:

Signals

Stars
91,703
Forks
38,964
Open issues
2,440
Last commit (this folder)
Oct 16, 2026 (12 days ago)
Last release
Oct 23, 2026 (5 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from home-assistant

Cite this page

raise-pull-request. Agent Mart. https://agentmart.dev/templates/home-assistant-core-raise-pull-request (last updated 2026-10-24)