.agents/skills/complete-partial-pr/SKILL.md
Use this when a PR or issue patch fixes a small visible failure but may not address the full integration contract. The goal is to turn a narrow contribution into a maintainable Pydantic AI change, or to explain precisely why it should stay narrow.
This is not limited to UI or provider integrations. Apply it to any patch that touches one variant of a broader surface: parse/dump, request/response, streaming/non-streaming, static/dynamic, sync/async, native/provider/local tools, metadata, state machines, durable execution, docs, or tests.
Do not use this as a replacement for /review-branch when the task is only a general code review. If the PR has no local context yet, run /adopt-pr first.
Separate three things before implementing:
Only (3) determines the final shape. The submitted patch is evidence, not the boundary.
Use subagents for independent research and review lanes. Keep the critical path local: branch selection, final synthesis, implementation, and push decisions.
Good subagent lanes:
git blame, git log, previous PRs, review comments, and decision logs around the touched code. Return historical decisions with source links.Give each subagent a narrow question, known PR/issue number, relevant file paths, and the exact output you need. Do not ask multiple subagents to answer the same question. Claims that answer the task need a source.
Read the local context before scoping:
CLAUDE.md and CLAUDE.local.mdagent_docs/index.md.claude/skills/branch-context/issue-brief.md and .claude/skills/branch-context/pr-decisions.md, if present.claude/skills/pyai-knowledge/feature-map.md for the affected feature group.claude/skills/pyai-knowledge/internals-model.md for layer ownership.claude/skills/pyai-knowledge/maintainer-mindset.md for review tellsIf the investigation spans multiple surfaces or subagents, create a short working note under local-notes/, for example local-notes/complete-partial-pr.md. Keep facts, sources, and open questions there. Do not put research prose in issue-brief.md.
Use gh for GitHub context.
gh pr view <PR> --json number,title,url,state,body,author,headRepository,headRepositoryOwner,headRefName,maintainerCanModify,baseRefName,comments,reviews,closingIssuesReferences
Read linked issues, PR comments, review threads, and CI context. If the work item is an issue with no PR, inspect the linked branch or proposed patch if one exists.
For fork PRs, record:
headRepository.nameWithOwnerheadRefNamemaintainerCanModifygit push targets the actual PR branchNever force push. If updating a contributor PR and maintainerCanModify allows it, push to the contributor's PR branch. If not, create a separate branch and report the limitation.
Write a short local working note, even if it only lives in the final report:
This note keeps the implementation from being scoped by the first test the contributor happened to write.
Find authoritative sources before changing code:
For external technical specs, use primary sources. If the spec is versioned, note the version used by Pydantic AI and whether the PR targets the same version. Distinguish confirmed spec behavior from inference.
Search for symmetric and adjacent code paths. Typical pairs and variants:
Do not assume a one-line parser fix is sufficient until this map is complete.
Use local git history and GitHub history around the touched code:
git blame -- <path>
git log --oneline -- <path>
gh pr list --search '<symbol-or-file> repo:pydantic/pydantic-ai' --state all --json number,title,url,state
Read previous PRs or comments that introduced the relevant behavior. Capture any decision that constrains the new change. If the new approach contradicts history, call that out explicitly before implementing.
Classify missing work:
Push back on expanding the PR only when the broader behavior is genuinely a separate product decision. Otherwise, complete the contract.
If choosing broader scope or explicitly deferring an adjacent surface, append a concise entry to .claude/skills/branch-context/pr-decisions.md with the source that justified the decision.
If the broader fix changes public API, provider semantics, durable behavior, or safety posture in a non-obvious way, ask David before coding or draft a PR comment/proposal instead of silently expanding the branch.
Prefer small changes that fit existing abstractions. Preserve backwards compatibility and avoid new public API unless the full contract requires it.
For tests:
Run targeted checks first, for example:
uv run pytest tests/<target>.py::<test_name>
PYRIGHT_PYTHON_IGNORE_WARNINGS=1 uv run pyright <changed-file.py>
Escalate to broader checks only when the blast radius warrants it.
After code changes, run /review-branch unless the change is documentation-only or the user explicitly asks for a narrower pass.
Before pushing, verify the remote target:
git remote -v
git branch -vv
git status --short --branch
If posting a GitHub comment, start with David's AICA here: . Summarize:
If the work changes durable project knowledge, update the relevant docs, branch-context, or skill files.
End with a concise report containing: