# Work Pr

> Open and drive a single-issue PR to merge-ready in django-oauth-toolkit. Use when implementing a bug/feature that ships as its own PR, or when babysitting an open PR through CI and Copilot review.

- Skill: `django-oauth/work-pr` (Agent Skill)
- Install (CLI): `npx skillmds@latest add django-oauth/work-pr`
- Raw SKILL.md: https://api.skillmd.com/api/skills/django-oauth/work-pr/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: django-oauth (https://skillmd.com/u/django-oauth)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/django-oauth/work-pr

---


# Work a PR

One issue → one branch → one PR. Drive to green CI with no open review threads.

## Open
1. Branch off `master`: `claude/fix-<issue>-<slug>`.
2. Implement the smallest correct change. Add a regression test that **fails before, passes after**.
3. Add a `## [unreleased]` entry in `CHANGELOG.md` referencing `#<issue>` (skip for changes that aren't user-relevant, e.g. tooling).
4. Lint and run related tests locally: `ruff check` + `ruff format --check`, and `DJANGO_SETTINGS_MODULE=tests.settings python -m pytest <paths>`.
5. Commit, push `-u`. Open the PR filling `.github/pull_request_template.md`; `Fixes #<issue>`.
6. Request a Copilot review. Subscribe to PR activity. Arm a ~1h fallback check-in.

## On each CI / review event
- **Fix** if confident and small; **rebut** if the suggestion is wrong; **skip** duplicates/no-ops.
- Push the fix (prefer a follow-up commit; only force-push when you intentionally rebased, and always use `--force-with-lease`).
- **Reply on each review thread, then resolve it** — not a PR-level comment.
- Re-request Copilot review. Repeat until **CI green and Copilot has no comments**.

## When master advances
When the branch falls behind master while the PR is open — it shows merge conflicts against the base, or CI ran against a now-stale base — rebase onto the latest master and force-push with lease:

```
git fetch upstream
git rebase --autostash upstream/master
# resolve conflicts, re-run the affected tests
git push --force-with-lease
```

## Rules
- Reply on threads only; no PR-level status comments.
- Never `git add -A` — stage explicit paths, so stray untracked files (local venvs, build output, editor scratch) are never committed.
- Don't poll with sleep; events + the fallback check-in wake you. Re-arm it silently if nothing changed.
- Don't self-merge. A subscription ends only when the PR is merged/closed.

