Skip to content
Agentmart
Submit a tool

commit-push-pr

Commit, push, and create a PR in one flow — checks state at each stage, confirms push target, collects accuracy/benchmark data, drafts PR in HackMD format for…

Skill by yichiche

IndexedMIT★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/yichiche-commit-push-pr

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Commit, push, and create a PR in one flow — checks state at each stage, confirms push target, collects accuracy/benchmark data, drafts PR in HackMD format for review before submitting. Only a push to SGLang runs the /pr-merge-triage gate. Every other repo skips it. A SGLang PR is not opened while accuracy or performance evidence would fail.

Use cases: data

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/commit-push-pr

What's inside

Skill name
commit-push-pr
Description
Commit, push, and create a PR in one flow — checks state at each stage, confirms push target, collects accuracy/benchmark data, drafts PR in HackMD format for review before submitting. Only a push to SGLang runs the /pr-merge-triage gate. Every other repo skips it. A SGLang PR is not opened while accuracy or performance evidence would fail.
License
MIT
Instructions
492 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Agent Skills spec issues

  • body: contains an absolute path from the author's machine

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Commit, Push, and Create PR

Follow these steps precisely. This skill chains to `/commit-push` (which itself chains to `/commit`).
Read `_shared/repo-config.md` for repo table, remote URLs, PR draft location/naming, and safety rules.

## PIPELINE_MODE (from `/kernel-fusion-pipeline`)

When invoked with a CONFIG object containing `"pipeline_mode": true`, run **fully autonomously** —
NEVER use `AskUserQuestion`, never wait for human review. Skip all interactive steps (2, 4-review,
6, 8, 11). Use CONFIG fields instead of asking. This is the SAME commit/PR contract as the
interactive flow; only the "ask the user" gates are replaced by CONFIG values.

**CONFIG fields:**
- `worktree` — run all git/gh commands from here (`cd "$worktree"` or `git -C "$worktree"`).
- `repo` — base repo for the PR (e.g. `sgl-project/sglang`).
- `base` — PR base branch (e.g. `main`).
- `commit_subject` — exact commit subject (already `[<Tag>] [AMD] <area>: …` formatted).
- `pr_title` — exact PR title.
- `pr_body_file` — path to a file with the full PR body (already composed; use VERBATIM).
- `update_pr` — optional PR number; if set, UPDATE that PR's body instead of creating a new one.
- `gh_env` — optional env prefix for gh, e.g. `GH_CONFIG_DIR=/home/yichiche/.gh GH_TOKEN=""`.
- `sglang_root` — repo root to return to for worktree cleanup.

**Flow:**

1. `cd "$worktree"`.

2. **Fix lint BEFORE committing** (CI enforces pre-commit; a dirty lint state fails CI):
   - `pip3 install -q -U pre-commit` (fine if already present)
   - `git add -A`
   - `pre-commit run --all-files` — let hooks auto-fix (isort, ruff F401/F821, black, codespell,
     clang-format, nbstripout).
   - If files changed: `git add -A && pre-commit run --all-files`; repeat up to 3×.
   - If a hook still fails (e.g. ruff F821 it cannot auto-fix), read the error, fix the code in the
     worktree, then retry from `git add -A`.
   - If `--all-files` reformats files UNRELATED to this change, reset them
     (`git checkout -- <file>`) so the commit stays focused on this change only.
   - Do not proceed until pre-commit exits clean.

3. Commit (only if there are staged changes): `git commit -m "<commit_subject>"`.
   **Never add `Co-Authored-By` trailers** (in subject or body).

3b. **SGLang triage gate, before push.** Run this only when `<repo>` is
    `sgl-project/sglang`. For every other repo, skip it. Do not read
    `/pr-merge-triage`, and do not run `path_cover.py` or `test_seam.py`.
    When the repo is SGLang, follow Step 3b of `/commit-push` on this worktree.
    Score `git diff <base>...HEAD`. Fix failing Affected Scope, AMD Guard,
    Unit Test Quality, and Flags rows, then commit each fix and score again,
    at most 3 times. `BLOCKED — SPLIT FIRST` is not auto-split. If a row still
    fails, do not push. Return `{ status: fail, error: <the failing row> }`.

4. Push the branch: `git push` (use `git push -u origin HEAD` if no upstream is set).
   Only after step 3b passes for SGLang.

5. PR — pick ONE path:
   - **Create** (no `update_pr`):
     `<gh_env> gh pr create --repo <repo> --base <base> --title "<pr_title>" --body-file <pr_body_file>`
     Use `--body-file` (never `--body`) so markdown tables survive shell quoting.
   - **Update existing** (`update_pr` set): `gh pr edit` currently fails on a projects-classic
     GraphQL deprecation, so update the body via the REST API:
     `<gh_env> gh api -X PATCH repos/<repo>/pulls/<update_pr> -f body="$(cat <pr_body_file>)"`
   - If `gh pr create` fails on auth/permission, fall through Step 9's Attempts 2-4
     (`--web`, `curl` REST POST, prefill URL). In pipeline_mode do NOT block on the user —
     record the failure and return `status: fail` with the reason.

5b. **Tag `run-ci` label** (when `<repo>` is `sgl-project/sglang` and the PR was created
    programmatically): follow Step 9b below. Non-fatal on failure — record
    `run_ci_tagged: true/false` in the return JSON.

6. Cleanup: `cd "$sglang_root"` then `git worktree remove <worktree>` (keep the local branch).

7. Return JSON: `{ slug, commit_hash, pr_url, run_ci_tagged, status }` (`status` = `pass`/`fail`,
   plus `error` if failed).

---

## Repo-specific fast paths

Detect the repo in Step 1. If it is **InferenceX** — also called **InferenceMax** —
(`SemiAnalysisAI/InferenceX`), read the InferenceX section of `_shared/repo-config.md` **before**
Step 2 and apply these deltas:

- **Step 2 (push target)**: push goes to `origin` = `SemiAnalysisAI/InferenceX` directly — there is
  no fork. Base `main`. The working branch must be named **`amd/<branch_name>`**; if the current
  branch is not, create one (`git checkout -b amd/<name>`) before pushing. Titles and commit
  subjects are **`[AMD][<model_name>] <title>`** (e.g. `[AMD][Qwen3.5] …`).
- **Step 3 (commit/push)**: no pre-commit config exists — skip the lint loop. Plain `git push`
  fails on a missing credential helper; use the `GIT_CONFIG_COUNT=1 … '!gh auth git-credential'`
  prefix from repo-config. A human `Co-Authored-By` trailer is allowed here when the user names one;
  a Claude co-author trailer never is.
- **Step 6 (data collection)**: for recipe/config/image-bump PRs there is no local benchmark to
  collect — the GPU sweep runs in CI. Skip 6a-6c and instead record the evidence that the change is
  valid (e.g. the Docker Hub tag check returning 200), then go straight to Step 7.
- **Step 7 (draft)**: use `_shared/pr-template-simple.md`. Write **English only — no Chinese
  characters anywhere** (this overrides the bilingual rule in the repo's `AGENTS.md`); the same
  applies to commit messages and PR comments. Every recipe or perf-affecting change
  also needs an appended `perf-changelog.yaml` entry **in the same commit** — see repo-config for the
  append-only / trailing-newline rules and the read-then-write footgun.
- **Step 9 (submit)**: `gh pr create --label full-sweep-fail-fast` works. Any later title/body edit
  must go through `gh api -X PATCH repos/.../pulls/<num>` — `gh pr edit` fails on this repo with a
  projects-classic GraphQL deprecation error.
- **Step 9b**: not applicable (that is sglang's `run-ci` label). The InferenceX equivalent is the
  `full-sweep-fail-fast` label, already applied at create time. Verify with
  `gh pr checks <num> --repo SemiAnalysisAI/InferenceX`.
- **After creating the PR**: patch the `pr-link:` placeholder in the `perf-changelog.yaml` entry with
  the real PR URL, amend, and force-push. Re-verify the trailing newline and `git diff origin/main
  --stat` before pushing — an amend is the step most likely to silently corrupt that file.
- **Bulk image bumps** across many recipes are a different job — use the repo's `/nuke` command
  (`.claude/commands/nuke.md`), which owns the one-PR-per-model+precision+SKU grouping rules.

## Step 0: Ensure `gh` CLI is available and authenticated

Check that the GitHub CLI is the real one (v2.x+, not the pip `gh` v0.0.4):
```bash
gh --version 2>&1
```
If missing or wrong version, follow the install steps in `_shared/repo-config.md`.

After `gh` is installed, check authentication:

From yichiche/agent-box, MIT.

More from yichiche/agent-box

Signals

Stars
2
Forks
0
Open issues
0
Last commit (this folder)
Oct 22, 2026 (6 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from yichiche

Cite this page

commit-push-pr skill. Agent Mart. https://agentmart.dev/skills/yichiche-commit-push-pr (last updated 2026-10-24)