# Issue To PR Resolver

Implement a GitHub issue end-to-end, create a worktree branch, implement the feature...

- Repository: https://github.com/homeassistant-ai/ha-mcp (5395 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add homeassistant-ai/ha-mcp --skill issue-to-pr-resolver -g -a claude-code -y`
Codex: `npx skills add homeassistant-ai/ha-mcp --skill issue-to-pr-resolver -g -a codex -y`
Cursor: `npx skills add homeassistant-ai/ha-mcp --skill issue-to-pr-resolver -g -a cursor -y`
Gemini CLI: `npx skills add homeassistant-ai/ha-mcp --skill issue-to-pr-resolver -g -a gemini-cli -y`

## Description

Implement a GitHub issue end-to-end, create a worktree branch, implement the feature with tests, create a draft PR, then iteratively resolve all CI failures and review comments until the PR is clean. Use when you need to fully implement a GitHub issue from start to merge-ready. Triggers on "implement issue", "resolve issue", "/issue-to-pr-resolver <number>".

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Issue-to-PR Resolver

Implement GitHub issue #$ARGUMENTS in `homeassistant-ai/ha-mcp` end-to-end.

## Phase 1: Setup

**Read the issue:**
```bash
gh issue view "$ARGUMENTS" --repo homeassistant-ai/ha-mcp --json title,body,labels,comments,author
```

**Create a worktree from repo root:**
```bash
cd "$(git rev-parse --show-toplevel)"
git checkout master && git pull origin master
git worktree add "worktree/issue-$ARGUMENTS" -b "feature/issue-$ARGUMENTS"
git -C "worktree/issue-$ARGUMENTS" submodule update --init --recursive
cd "worktree/issue-$ARGUMENTS"
```

## Phase 2: Implement

- Analyze codebase structure and patterns before writing code
- Follow project conventions (see `AGENTS.md` for patterns, naming, error handling)
- Write tests, all new MCP tools in `src/ha_mcp/tools/` need E2E tests
- Make atomic, well-described commits using conventional commit prefixes

**Philosophy:** Work autonomously. Don't ask about every small decision. Fix unrelated test failures encountered. Document all choices for the final summary.

If a non-obvious choice has significant consequences, present the available options to the user and let them choose.

## Phase 3: Create PR

Write the PR body to `local/pr-body-$ARGUMENTS.md` first. `local/` is git-ignored, so a new worktree does not have it; create it with `mkdir -p local` if it does not exist. Build the body from `.github/pull_request_template.md`: keep its headings, put `Closes #$ARGUMENTS` and the description under `## What does this PR do?`, and delete `## Future improvements` unless the user has confirmed work to defer. Then push and create the PR:

```bash
git push -u origin "feature/issue-$ARGUMENTS"
PR_NUMBER=$(gh pr create --draft \
  --repo homeassistant-ai/ha-mcp \
  --title "<descriptive title>" \
  --body-file "local/pr-body-$ARGUMENTS.md" | grep -oE '[0-9]+$')
```

Wait for CI:
```bash
gh pr checks "$PR_NUMBER" --repo homeassistant-ai/ha-mcp --watch
```

The rest: https://github.com/homeassistant-ai/ha-mcp/blob/HEAD/.claude/skills/issue-to-pr-resolver/SKILL.md
