agentleFS
NVIDIAKnown publisherNVIDIA/TensorRT-Model-Connect/plugins/trtmc-agent-skills/skills/submit-github-pr/SKILL.md

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

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
  1. Very specific:

    Use the local github remote and target GitHub main.

    line 15
  2. Distinctive:

    Never push directly to main.

    line 16
  3. Distinctive:

    Do not add labels, reviewers, milestones, projects, or auto-merge unless the user explicitly requests them.

    line 20
  4. Very specific:

    Do not merge from this skill.

    line 23
  5. Very specific:

    Use $write-git-messages for commit, PR, squash, and rebase text.

    line 24
  6. Very specific:

    commit messages containing Claude.

    line 62
  7. Very specific:

    If the branch is behind or diverged from current github/main, rebase only when that history rewrite is within the user's request.

    line 64
  8. Very specific:

    Run git diff --check plus checks appropriate to the changed surface.

    line 69
  9. Distinctive:

    Create or update an architectural record only when an existing repository policy, template, maintainer request, or user instruction …

    line 81
  10. Distinctive:

    Do not force-push unless the user authorized the history rewrite and the exact remote branch was resolved first.

    line 108
  11. Distinctive:

    Verify the immutable facts:

    line 126
  12. Very specific:

    If the exact head already has PENDING or PASS for TRTMC Internal CI / Automated premerge gate, do not trigger it again.

    line 162
  13. Very specific:

    If authorization fails and retains the label, remove run-internal-ci before adding it again after the reported prerequisite is satisfied.

    line 172
  14. Very specific:

    Never use the legacy run-ci label.

    line 176

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Submit GitHub PR

Boundaries

  • Active repository: NVIDIA/TensorRT-Model-Connect.
  • Use the local github remote and target GitHub main.
  • Never push directly to main.
  • Publish only the change the user placed in scope.
  • Open a draft PR by default; omit --draft only 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-babysitter for monitoring and merge.
  • Use $write-git-messages for 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 main

The 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"..HEAD

Review 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,state

The 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-Connect

Queued, 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-ci

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

Download now (ZIP)

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.