home / skills / shotaiuchi / dotclaude / wf7-pr
This skill creates or updates a pull request after verification passes, guiding you through title, body, and state updates.
npx playbooks add skill shotaiuchi/dotclaude --skill wf7-prReview the files below or copy the command above to add this skill to your agents.
---
name: wf7-pr
description: PRを作成または更新
argument-hint: "[update]"
---
**Always respond in Japanese.**
# /wf7-pr
Create or update a Pull Request after verification passes.
## Usage
```
/wf7-pr [subcommand]
```
## Subcommands
- `(none)`: Create a new PR
- `update`: Update existing PR (push changes and optionally update description)
## Processing
### 1. Check Prerequisites
Get active work from state.json. Verify current phase is `wf6-verify` or later. Check that verification has passed (no test/build failures recorded).
### 2. Check Existing PR
Query `gh pr view` to check if a PR already exists for the current branch. If exists and no `update` subcommand, inform user and suggest `update`.
### 3. Push Branch
```bash
git push -u origin <branch>
```
Get branch name from state.json.
### 4. Generate PR Title
1. Read Goal from `01_KICKOFF.md`
2. For GitHub source: append `(#<issue_number>)` to link the issue
3. Keep title concise (under 72 characters)
### 5. Create PR (`gh pr create`)
Generate PR body with:
```markdown
## Summary
<1-3 bullet points from Kickoff Goal and Spec>
## Changes
<List of main changes from Plan steps>
## Test Plan
<Testing approach from Spec or verification results>
## Related Issues
Closes #<issue_number>
---
📄 [Kickoff](docs/wf/<work-id>/01_KICKOFF.md) | [Spec](docs/wf/<work-id>/02_SPEC.md) | [Plan](docs/wf/<work-id>/03_PLAN.md)
```
Execute:
```bash
gh pr create --title "<title>" --body "<body>"
```
### 6. Update PR (`update` subcommand)
1. Push latest changes: `git push`
2. Optionally update PR description via `gh pr edit` if significant changes
### 7. Update state.json
```json
{
"current": "wf7-pr",
"next": "complete",
"pr": {
"number": 123,
"url": "https://github.com/..."
}
}
```
### 8. Completion Message
Display:
- PR number and URL
- PR title
- Base ← Branch
- Suggest requesting review
## Error Handling
| Error | Action |
|-------|--------|
| Verification not passed | Instruct to run `/wf6-verify` first |
| PR already exists | Suggest `update` subcommand |
| Push fails | Show error, suggest checking remote status |
| `gh` not authenticated | Instruct `gh auth login` |
## Notes
- Cannot create PR if verification has not passed
- Issue number is automatically linked via `(#N)` in title and `Closes #N` in body
- Existing PR is detected and handled gracefully
This skill automates creating or updating a Pull Request after verification passes. It ensures the branch is pushed, generates a concise title and a structured PR body, and records the PR metadata in state.json. It prevents PR creation if verification failed and guides updates for existing PRs.
The skill reads the current work state and ensures the workflow is at or past the verification phase with no failures. It checks for an existing PR for the branch, pushes the branch to origin, builds a title from the kickoff Goal (optionally linking an issue), composes a markdown body from Kickoff/Spec/Plan, and runs gh pr create or gh pr edit as needed. After success it updates state.json with PR number and URL and prints the summary.
What happens if verification has not passed?
The skill stops and instructs you to run the verification step (wf6-verify) before creating a PR.
How does the title link an issue?
The title appends (#<issue_number>) when an issue is referenced so GitHub links it automatically; the body also includes 'Closes #N'.
How do I update an existing PR?
Use the update subcommand: it pushes recent commits and can call gh pr edit to update the description if significant changes occurred.