Optionally create a draft PR to the upstream repo from a local source directory. Used by coding agents when a local source path is available in the context file.
67
80%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.github/agents-prototype/skills/submit-draft-pr/SKILL.mdOptional. Attempt this only when all of the following are true:
- Your context file provides a local source path (e.g.
OpenVINO source code: /path/to/openvino)- That path is accessible and is a git repository
ghCLI is available and authenticated (gh auth status)If any condition is not met — skip silently and log one line. Do not fail.
After completing your main implementation work and writing results to
agent-results/<agent>/, call this skill to open a draft PR from your
changes to the upstream repo.
This is in addition to — never instead of — generating patch files and
writing results to agent-results/.
# Is gh available and authenticated?
gh auth status || { echo "[draft-pr] gh not available — skipping"; exit 0; }
# Is the source path a git repo?
[ -d "${SOURCE_PATH}/.git" ] || { echo "[draft-pr] ${SOURCE_PATH} is not a git repo — skipping"; exit 0; }Use a descriptive kebab-case branch name derived from the work done:
agent/add-<op-name>-op # core op or FE op
agent/add-<pass-name>-transformation
agent/<model-id>-export # optimum-intel / tokenizers
agent/<component>-<short-desc> # generalBefore creating a new PR, check whether one already exists from the same branch to avoid duplicates:
BRANCH="agent/<descriptive-name>"
EXISTING=$(gh pr list \
--repo openvinotoolkit/openvino \
--head "$(gh api user -q .login):$BRANCH" \
--json url -q '.[0].url' 2>/dev/null)
if [ -n "$EXISTING" ]; then
echo "[draft-pr] PR already exists: $EXISTING — skipping creation"
exit 0
fiIf a PR exists, log the URL and stop — do not open a second one.
Every agent-generated PR must open with the following notice block (exact wording, first lines of the body before any other content):
> [!IMPORTANT]
> **This PR was generated by a Copilot coding agent and requires human review.**
> A maintainer must inspect the changes, run the relevant tests locally, and
> convert this draft to "Ready for review" only after verifying correctness.
> Do **not** merge without human sign-off.After the notice, follow the upstream pull_request_template.md structure:
> [!IMPORTANT]
> **This PR was generated by a Copilot coding agent and requires human review.**
> A maintainer must inspect the changes, run the relevant tests locally, and
> convert this draft to "Ready for review" only after verifying correctness.
> Do **not** merge without human sign-off.
### Details:
- <what was changed and why>
- Agent: <agent-name>
- Model tested: <model-id or N/A>
- Operator: <op-name or N/A>
### Tickets:
- <linked issue URL or N/A>
### AI Assistance:
- AI assistance used: yes
- Generated by GitHub Copilot agent (`<agent-name>`). Human validation required:
build verification, unit/functional tests, and inference sanity check.Write this body to agent-results/<agent>/pr_body.md before calling gh pr create.
cd <source_path>
BRANCH="fix/<descriptive-name>"
git checkout -b "$BRANCH"
git add -A
git commit -m "<one-line description>"
gh repo fork openvinotoolkit/openvino --clone=false 2>/dev/null || true
git remote add fork "$(gh repo view "$(gh api user -q .login)/openvino" --json sshUrl -q .sshUrl)" 2>/dev/null || true
git push fork "$BRANCH"
gh pr create --draft \
--repo openvinotoolkit/openvino \
--head "$(gh api user -q .login):$BRANCH" \
--title "<one-line description>" \
--body-file agent-results/<agent>/pr_body.mdAfter the script runs, record the outcome in agent-results/<agent>/session.md:
[draft-pr] PR opened: <pr_url>or
[draft-pr] Skipped: <reason>| Agent | Upstream repo |
|---|---|
| transformation, core-opspec, pytorch-fe, cpu, gpu, npu | openvinotoolkit/openvino |
| optimum-intel | huggingface/optimum-intel |
| openvino-tokenizers | openvinotoolkit/openvino_tokenizers |
| openvino-genai | openvinotoolkit/openvino.genai |
Pass --upstream <value> only when auto-detection from the git remote is likely
to fail (e.g. the local clone uses an internal mirror URL).
main/master of any repo.git push --force-with-lease fails (e.g. diverged history), skip and log — do not --force.4c20980
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.