Skip to main content

submit-draft-pr

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.

소스 정보

저장소
openvinotoolkit/openvino
최근 소스 활동
2026년 5월 27일 04:32
감지된 SKILL.md 언어
영어
스타
11,007
포크
3,458

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
submit-draft-pr
description
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.
# 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 ```bash # 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: ```bash 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): ```markdown > [!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: ```markdown > [!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 ```bash 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.
GitHub에서 보기