agentleFS
hhhyyyy99hhhyyyy99/prot-skills/.agents/skills/submit-pr/SKILL.md

submit-pr

Skill7 starsChanged 5 months agoMITView on GitHub

Submit a PR to main with auto-merge. Scans current changes, assesses risk, creates the PR, enables auto-merge when safe, and reports any blockers. Use when asked to "提交PR", "提个PR", "create a PR", "open a PR", "submit PR", "提PR到main", "merge to main", or when code changes are ready for review.

  • Commits and pushes

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 0 are common, 14 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 14

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After completing a feature, fix, or refactor on a task branch

    line 14
  2. Distinctive:

    When the user wants to merge work into main

    line 15
  3. Distinctive:

    Before creating the PR, understand what blocks auto-merge on this repo:

    line 25
  4. Distinctive:

    Check for uncommitted changes:

    line 47
  5. Distinctive:

    If there are uncommitted changes, stop and tell the user to commit or stash first.

    line 53
  6. Very specific:

    Test-only changes (*.test.ts, *.test.tsx, src/tests/)

    line 67
  7. Distinctive:

    If the branch has not been pushed to the remote yet:

    line 92
  8. Very specific:

    Use the conventional commit format: type(scope): description

    line 103
  9. Distinctive:

    Create the PR and capture the PR number:

    line 112
  10. Distinctive:

    If auto-merge enables successfully:

    line 136
  11. Distinctive:

    If auto-merge fails to enable, check the reason:

    line 144
  12. Distinctive:

    If the risk is low (docs, tests, config only):

    line 166
  13. Distinctive:

    If the risk is medium:

    line 170
  14. Distinctive:

    If the risk is high:

    line 174
  15. Distinctive:

    On main: do not create a PR from main.

    line 192
  16. Distinctive:

    CI not starting: check if the workflow triggers on the branch's file changes.

    line 197

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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 PR

Creates a PR targeting main, analyzes the diff to assess whether auto-merge is safe, enables auto-merge when possible, and reports any blockers that prevent immediate merge.

When to Use

  • Code changes are committed and ready for review
  • Any request to "提PR", "提交PR", "create PR", "open PR"
  • After completing a feature, fix, or refactor on a task branch
  • When the user wants to merge work into main

Prerequisites

  • On a non-main branch with committed changes
  • gh CLI authenticated
  • Remote branch pushed (the skill handles this if not yet pushed)

Branch Protection Rules

Before creating the PR, understand what blocks auto-merge on this repo:

RuleRequirement
Required status checksFrontend Checks, Backend Checks, ai-review
Required reviews1 approving review
Conversation resolutionAll threads must be resolved

Auto-merge can be enabled even before reviews are done — it queues the merge and executes once all gates pass. The skill enables auto-merge whenever possible and tells the user what manual steps remain.

Workflow


Phase 1 — Scan Changes

  1. Confirm current branch and that it is not main:

    git branch --show-current
  2. Check for uncommitted changes:

    git status --short

    If there are uncommitted changes, stop and tell the user to commit or stash first.

  3. Get the diff summary against main:

    git diff main...HEAD --stat
    git log main..HEAD --oneline
  4. Classify the change risk based on the diff:

    Low risk (safe for auto-merge):

    • Docs-only changes (*.md, docs/)
    • Config/tooling changes (.github/, scripts/, .agents/)
    • Test-only changes (*.test.ts, *.test.tsx, src/tests/)
    • Style/formatting changes

    Medium risk (auto-merge OK, but flag for careful review):

    • Frontend component changes (src/components/, src/pages/)
    • Hook or utility changes (src/hooks/, src/lib/)
    • Design token changes (src/design/)

    High risk (recommend manual review before merge):

    • Backend/Rust changes (src-tauri/)
    • Tauri config changes (tauri.conf.json)
    • Dependency changes (package.json, Cargo.toml)
    • API surface changes (src/api/)
    • Auth, permissions, or security-related changes
  5. Report the scan result to the user:

    Diff summary: {N} files changed, {insertions}+/{deletions}- Change type: {low/medium/high} risk Files: {list key files} Auto-merge: {recommended / OK with review / not recommended}


Phase 2 — Push Branch

If the branch has not been pushed to the remote yet:

git push -u origin HEAD

Phase 3 — Create PR

  1. Generate the PR title from the branch name and commit messages:
    • Use the conventional commit format: type(scope): description
    • Derive from the branch name or the first commit message
  2. Generate the PR body from the commit log:

    git log main..HEAD --format="- %s"
  3. Create the PR and capture the PR number:

    gh pr create \
      --base main \
      --head "$(git branch --show-current)" \
      --title "<title>" \
      --body "<body>"
    
    PR_NUMBER=$(gh pr view --json number -q .number)

Output: PR_URL and PR_NUMBER created.


Phase 4 — Enable Auto-Merge

  1. Enable auto-merge with squash:

    gh pr merge "$PR_NUMBER" --auto --squash
  2. If auto-merge enables successfully:

    Auto-merge is ON. The PR will merge automatically once:

    • All CI checks pass (Frontend Checks, Backend Checks, ai-review)
    • At least 1 review approval is received
    • All review conversations are resolved
  3. If auto-merge fails to enable, check the reason:
    • Not enabled on repo: tell the user to enable auto-merge in repo settings
    • Branch protection blocks it: report the specific blocker

Output: auto-merge status and remaining steps.


Phase 5 — Report

Report the full status to the user:

PR #{NUMBER}: {title}
URL: {PR_URL}
Auto-merge: {ON/OFF}
Change risk: {low/medium/high}

Remaining steps:
- {list what's needed before merge}

If the risk is low (docs, tests, config only):

Changes look safe. Once a reviewer approves and CI passes, this will merge automatically.

If the risk is medium:

Changes touch application code. A reviewer should look at this before it merges. Auto-merge is queued — it will merge after approval + CI.

If the risk is high:

Changes touch backend, dependencies, or security-sensitive areas. Recommend careful review. Auto-merge is enabled but will only merge after explicit approval.


Quick Reference

StepCommand
Diff against maingit diff main...HEAD --stat
Create PRgh pr create --base main --head <branch>
Enable auto-mergegh pr merge <N> --auto --squash
Check PR statusgh pr view <N> --json state,reviewDecision,statusCheckRollup
Check branch protectiongh api repos/{owner}/{repo}/branches/main/protection

Error Handling

  • On main: do not create a PR from main. Tell the user to create a task branch first.
  • No changes: nothing to PR. Tell the user.
  • Branch not pushed: push first, then create PR.
  • PR already exists: find the existing PR with gh pr list --head <branch> and report its URL.
  • Auto-merge unavailable: report the PR URL and explain what's blocking.
  • CI not starting: check if the workflow triggers on the branch's file changes.

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.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.