submit-github-pr
Skill290 starsChanged 45 days agoApache-2.0View on GitHub
Use when publishing an existing TensorRT-Model-Connect change as a GitHub pull request. Verifies authenticated repository access, branch and diff scope, validation evidence, commit identity, reviewer-facing text, exact pushed head, and the created draft PR without merging it.
- Commits and pushes
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- website/static/llms.txtllms.txt
- debug-trt-mismatchSkill
- doc-syncSkill
- fp16-trt-networkSkill
- optimize-model-precisionSkill
- pr-babysitterSkill
- profile-modelSkill
- review-trtmc-prSkill
- setup-trtmc-environmentSkill
- submit-github-bug-issueSkill
- transform-modelSkill
- write-git-messagesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 5 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 15
Use the local github remote and target GitHub main.
- Distinctive: line 16
Never push directly to main.
- Distinctive: line 20
Do not add labels, reviewers, milestones, projects, or auto-merge unless the user explicitly requests them.
- Very specific: line 23
Do not merge from this skill.
- Very specific: line 24
Use $write-git-messages for commit, PR, squash, and rebase text.
- Very specific: line 62
commit messages containing Claude.
- Very specific: line 64
If the branch is behind or diverged from current github/main, rebase only when that history rewrite is within the user's request.
- Very specific: line 69
Run git diff --check plus checks appropriate to the changed surface.
- Distinctive: line 81
Create or update an architectural record only when an existing repository policy, template, maintainer request, or user instruction …
- Distinctive: line 108
Do not force-push unless the user authorized the history rewrite and the exact remote branch was resolved first.
- Distinctive: line 126
Verify the immutable facts:
- Very specific: line 162
If the exact head already has PENDING or PASS for TRTMC Internal CI / Automated premerge gate, do not trigger it again.
- Very specific: line 172
If authorization fails and retains the label, remove run-internal-ci before adding it again after the reported prerequisite is satisfied.
- Very specific: line 176
Never use the legacy run-ci label.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Submit GitHub PR
Boundaries
- Active repository:
NVIDIA/TensorRT-Model-Connect. - Use the local
githubremote and target GitHubmain. - Never push directly to
main. - Publish only the change the user placed in scope.
- Open a draft PR by default; omit
--draftonly when the user explicitly asks for a ready-for-review PR and the evidence supports that state. - Do not add labels, reviewers, milestones, projects, or auto-merge unless the user explicitly requests them. The authorized Internal CI trigger is the exception described below.
- Do not merge from this skill. Use
$pr-babysitterfor monitoring and merge. - Use
$write-git-messagesfor commit, PR, squash, and rebase text.
1. Authenticate And Verify The Remote
gh auth status
gh repo view NVIDIA/TensorRT-Model-Connect \
--json nameWithOwner,url,defaultBranchRef
git remote get-url github
git fetch github mainThe remote URL must resolve to
https://github.com/NVIDIA/TensorRT-Model-Connect.git or its authorized SSH
equivalent. If gh cannot read the private repository, stop for safe
reauthentication. Do not inspect or replay stored credentials.
2. Confirm Branch And Exact Scope
BRANCH=$(git branch --show-current)
test -n "$BRANCH"
test "$BRANCH" != main
BASE_SHA=$(git rev-parse github/main)
HEAD_SHA=$(git rev-parse HEAD)
git status --short --branch
git merge-base --is-ancestor "$BASE_SHA" "$HEAD_SHA"
git diff --stat "$BASE_SHA"...HEAD
git diff --name-status "$BASE_SHA"...HEAD
git log --oneline "$BASE_SHA"..HEADReview focused diffs, staged changes, and untracked files. Do not publish:
- unrelated user changes;
- generated artifacts or secrets not intended for review;
- an empty branch;
- a branch based on the wrong repository or target;
- commit messages containing
Claude.
If the branch is behind or diverged from current github/main, rebase only when
that history rewrite is within the user's request. Revalidate after any rebase.
3. Validate The Publishable Head
Run git diff --check plus checks appropriate to the changed surface. Record
the exact command and pass/fail/skip/not-run result. Do not present:
- a dry run as execution;
- compilation as model parity;
- static docs checks as target-hardware proof;
- a check on a prior SHA as evidence for the current head.
Confirm the worktree contains no unsaved in-scope change before committing or
pushing. If a new commit is needed, use $write-git-messages and a GitHub-safe
author email; do not change global Git identity implicitly.
Create or update an architectural record only when an existing repository policy, template, maintainer request, or user instruction requires it. This skill does not invent ADR policy or files merely from the size/type of a diff.
4. Draft Reviewer Text
Give $write-git-messages:
- exact base and head SHA/ref;
- changed files and behavioral purpose;
- exit criteria and non-goals;
- validation commands with outcomes;
- unrun CI, GPU, model, performance, or qualification gates;
- dependency and merge order;
- compatibility, security, migration, rollback, and review-order notes.
The PR title should match the expected squash/rebase title and follow repository convention. Keep the body focused on one purpose.
5. Push The Named Branch
git push -u github "$BRANCH"
PUSHED_SHA=$(git rev-parse "github/$BRANCH")
test "$PUSHED_SHA" = "$(git rev-parse HEAD)"Do not force-push unless the user authorized the history rewrite and the exact remote branch was resolved first. When rewriting an existing branch, prefer an explicit lease for that branch and its previously observed SHA.
6. Create And Verify The PR
Pass the reviewed body on stdin to avoid leaving an unnecessary local file:
gh pr create \
--repo NVIDIA/TensorRT-Model-Connect \
--base main \
--head "$BRANCH" \
--draft \
--title "<type(scope): concise summary>" \
--body-file -Verify the immutable facts:
gh pr view <number-or-url> \
--repo NVIDIA/TensorRT-Model-Connect \
--json number,url,isDraft,baseRefName,headRefName,headRefOid,title,stateThe base must be main, head name must match, and headRefOid must equal
PUSHED_SHA. Then inspect initial checks:
gh pr checks <number-or-url> \
--repo NVIDIA/TensorRT-Model-ConnectQueued, missing, skipped, or failed checks are not green.
7. Start Exact-Head Premerge When Authorized
Creating or pushing the PR does not start premerge. When CI execution is authorized, resolve the current PR API head before adding the one-shot trigger:
REPOSITORY=NVIDIA/TensorRT-Model-Connect
PR_NUMBER=<number>
pull=$(gh api "repos/$REPOSITORY/pulls/$PR_NUMBER")
PR_HEAD_SHA=$(jq -er '.head.sha' <<<"$pull")
test "$PR_HEAD_SHA" = "$PUSHED_SHA"
gh api \
"repos/$REPOSITORY/commits/$PR_HEAD_SHA/status" \
--jq '[.statuses[] |
select(.context == "TRTMC Internal CI / Automated premerge gate")][0]'If the exact head already has PENDING or PASS for
TRTMC Internal CI / Automated premerge gate, do not trigger it again. Otherwise an actor with
maintain or admin permission may run:
gh pr edit "$PR_NUMBER" \
--repo "$REPOSITORY" \
--add-label run-internal-ciIf authorization fails and retains the label, remove run-internal-ci before
adding it again after the reported prerequisite is satisfied. Re-adding an
already-present label is a no-op and does not trigger the bridge.
Never use the legacy run-ci label. The bridge consumes the trigger, verifies
the exact head, and dispatches private Internal CI. A successful Source bridge
run is not a passing premerge result: only TRTMC Internal CI / Automated premerge gate=PASS on
the current head is a pass. Raw Internal CI logs, artifacts, packages, runner
details, and URLs stay private and must not be copied to the Source PR.
8. Report And Hand Off
Report the PR URL and number, draft state, pushed head SHA, validation evidence,
initial exact-head CI state, and any dependency or unrun gate. Hand monitoring
and any merge work to $pr-babysitter; this skill never merges.
<!-- Collaborative review anchor: batch 2. -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

