Index of every page on this site: llms.txt
All skills
openvinotoolkit avatar

/submit-draft-pr

@993f33e
Run it yourself

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.

  • 1 file
  • 4.9 KB
  • Updated 6 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/openvinotoolkit/openvino/submit-draft-pr

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈45 tokens for metadata: the name and description. ≈1.2k when used: this file.

Description uses 2.2% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈179 characters, or 2.2%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Skill: Submit Draft PR

Optional. 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
  • gh CLI is available and authenticated (gh auth status)

If any condition is not met — skip silently and log one line. Do not fail.


When to invoke

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/.


Steps

1. Verify prerequisites

# 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; }

2. Choose a branch name

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>      # general

3. Check for an existing PR

Before 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
fi

If a PR exists, log the URL and stop — do not open a second one.

4. Compose the PR body

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.

5. Create branch, commit, and open draft PR

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.md

6. Log the result

After the script runs, record the outcome in agent-results/<agent>/session.md:

[draft-pr] PR opened: <pr_url>

or

[draft-pr] Skipped: <reason>

Per-repo upstream table

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).


Important constraints

  • Always create PRs as drafts — never ready-for-review.
  • PR target is the upstream repo, not the fork.
  • Do not push to main/master of any repo.
  • If git push --force-with-lease fails (e.g. diverged history), skip and log — do not --force.
  • Do not block the agent's completion on PR success — log the failure and continue.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 993f33e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 14 hours ago.

Activeupdated 6 months ago

README badge

README badge for openvinotoolkit/openvino/submit-draft-pr