Github.cosmetic check PR

From gpsaggese/helpers · View interactive version

Github.cosmetic check PR is an AI agent skill from the GitHub repository gpsaggese/helpers. Check a PR for file size, binaries, directory, title, and conventions

How to use this skill

Skill file

Goal

Workflow

Get the Input

https://github.com/<OWNER>/<REPO>/pull/<PR_NUM>/changes

<PR_URL>

```bash

> gh repo view --json nameWithOwner -q .nameWithOwner

```

Fetch the PR Metadata

```bash

> gh pr view <PR_URL> --json number,title,url,headRefName,baseRefName,body,isDraft

```

Create the Worktree

current client, since its remote can have another name or point to a fork

a recursive fetch fail with not our ref

```bash

> git fetch --no-recurse-submodules <REPO_URL> pull/<PR_NUM>/head

> git rev-parse FETCH_HEAD

> git fetch --no-recurse-submodules <REPO_URL> <BASE_BRANCH>

> git rev-parse FETCH_HEAD

```

```bash

> git merge-base <BASE_SHA> <HEAD_SHA>

```

are checked and not the changes that landed in the base after the PR started

```bash

> git worktree add --detach ~/wt_pr<PR_NUM> <HEAD_SHA>

```

```bash

> git -C <WORKTREE> rev-parse HEAD

```

git worktree remove <WORKTREE>: never delete it

above

origin, not a detached worktree on a PR head commit

fork is available only as pull/<PR_NUM>/head

List the Changed Files

```bash

> git -C <WORKTREE> diff --no-renames --name-only <MERGE_BASE> <HEAD_SHA>

```

```bash

> git -C <WORKTREE> diff --no-renames --diff-filter=AM --numstat <MERGE_BASE> <HEAD_SHA>

```

Run CHK1: File Size and Binary Files

the blob SHAs (the 4th column of the --raw output):

```bash

> git -C <WORKTREE> diff --no-renames --diff-filter=AM --raw <MERGE_BASE> <HEAD_SHA>

> git -C <WORKTREE> cat-file --batch-check='%(objectname) %(objectsize)'

```

to its path

hundreds of files, so print only the failing files

zip, tar, gz, tgz, bz2, 7z, rar, pkl, pickle, npy, npz,

parquet, feather, h5, hdf5, db, sqlite, sqlite3, pt, pth, onnx,

ckpt, safetensors, so, dylib, dll, exe, pyc, mp3, mp4, mov,

wav, xlsx, docx, pptx, ttf, woff

case, so the size rule applies to it

(dev_scripts_helpers/git/git_hooks/utils.py): it skips .ipynb files and reads

the files of the current client and not the blobs of the PR

binary)

```bash

> git rm --cached <PATH>

```

and add a pattern to .gitignore

notebook or a script) or a link, and keep only a sample under 512KB if the code

needs one

```bash

> jupyter nbconvert --clear-output --inplace <PATH>

```

checking it in

Run CHK2: Project Directory

case

class_project/msml610/

class_project/README.md ### Add Files Only in Your Project Directory:

```

class_project/<COURSE>/<TERM><YEAR>/projects/<PROJECT_DIR>/

```

UmdTask645_DATA605_Spring2026_Redis_cache_1 accepts the directory

UmdTask645_DATA605_Spring2026_Redis_cache

say so in the report: CHK3 reports the branch problem

directory

```bash

> git mv <OLD_PATH> <NEW_PATH>

```

move it to its own PR

Run CHK3: PR Title

period

UmdTask<ISSUE_NUM>_<CLASS>_<TERM><YEAR>_<PROJECT_TITLE> or the same with a

trailing _<N>

```bash

> gh issue view <ISSUE_NUM> --repo <OWNER>/<REPO> --json title,state

```

without the UmdTask<ISSUE_NUM>_ prefix and without the _<N> suffix

Related to #<ISSUE_NUM>, or the number differs from the one in the title

```

Add Redis tutorial & notebook

```

```

DATA605_Spring2026_Redis_cache_to_fetch_user_profiles

```

```

UmdTask645_DATA605_Spring2026_Redis_cache_to_fetch_user_profiles

```

run it:

```bash

> gh pr edit <PR_NUM> --repo <OWNER>/<REPO> --title "<EXPECTED_TITLE>"

```

author to push the branch under the new name and to open a new PR

Run CHK4: Code Conventions

and gitleaks, both from the current Git client

type hints, headers, line length, notebook structure

the current client

```bash

> class_project/create_project.py --dst_dir <WORKTREE>/<PROJECT_PATH> --only_action compare_docker_files --dry_run

```

the current client

different, missing_in_src, or missing_in_dst

must use the template files

current client: remove this one file after the run

```bash

> rm -f class_project/create_project.py.log

```

<NAME>.API.ipynb and <NAME>.example.ipynb, and each notebook has its paired

.py file

pre-commit hook

(under helpers_root/ when helpers is a submodule)

```bash

> gitleaks git -c <RULES_FILE> --log-opts="<MERGE_BASE>..<HEAD_SHA>" --no-banner --redact <WORKTREE>

```

secret

diff for secrets

almost always unintended

Write the Report

> prefix

Conventions

.claude/skills/text.rules.md

policies/pr_process.how_to_guide.md

Constraints

and gitleaks

gh repo view

it and CHK4 removes it

Examples

large file:

````

# PR #123 Check: Add Redis tutorial

step or a link

```bash

> git rm --cached data/users.csv docs/arch.png

```

and not in a project directory

```bash

> git mv class_project/data605/Spring2026/redis_utils.py class_project/data605/Spring2026/projects/UmdTask645_DATA605_Spring2026_Redis_cache/redis_utils.py

```

UmdTask645_DATA605_Spring2026_Redis_cache

```bash

> gh pr edit 123 --repo <OWNER>/<REPO> --title "UmdTask645_DATA605_Spring2026_Redis_cache"

```

```bash

> git worktree remove ~/wt_pr123

```

````

Verification

checked

class_project/create_project.py.log

unknown

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.