agentleFS
notum-cznotum-cz/strapi-next-monorepo-starter/.claude/skills/make-pr/SKILL.md

make-pr

Skill316 starsChanged 5 months agoMITView on GitHub

Use when the user is ready to submit work for review and wants a GitHub pull request opened — e.g. "open PR", "create pull request", "prepare PR", "make PR", "submit for review".

  • Reads credentials
  • Commits and pushes

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use commit.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Commit / branch conventions: apps/docs/docs/reference/workflow.md.

    line 15
  2. Distinctive:

    Be automated: Do not ask for confirmations unless something is genuinely ambiguous.

    line 17
  3. Distinctive:

    If multiple, separate with spaces.

    line 27
  4. Very specific:

    If on dev or main, abort: "You're on a base branch.

    line 37
  5. Very specific:

    Default dev. Override via $ARGUMENTS.

    line 41
  6. Distinctive:

    Commit. If the pre-commit hook (Lefthook + commitlint) fails:

    line 81
  7. Distinctive:

    If rejected for remote-ahead, abort: tell the user to pull/rebase first.

    line 94
  8. Very specific:

    Check for a PR template at .github/pull_request_template.md (also .github/PULL_REQUEST_TEMPLATE.md or .github/PULL_REQUEST_TEMPLATE/).

    line 102
  9. Distinctive:

    When a template is present, apply these mapping rules:

    line 106
  10. Distinctive:

    Leave human-only items unchecked (Assignee, Reviewers, Labels, screenshots, etc.)

    line 117
  11. Very specific:

    If the template has no Task Link section but an issue was resolved, prepend Closes #<num> above the body.

    line 121
  12. Very specific:

    Use a tempfile via mktemp to avoid shell-escaping the multi-line body.

    line 133
  13. Very specific:

    Never push with --force or --force-with-lease unless the user explicitly asks.

    line 155
  14. Very specific:

    Never --amend after a hook failure.

    line 156
  15. Distinctive:

    Don't reference Asana, Linear, or Jira — they're out of scope for v1.

    line 157
  16. Distinctive:

    If multiple issues plausibly match the branch number, ask the user.

    line 158

“Common” is measured: kept by at least 6 in 10 of the 9 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

Create Pull Request

Commit any uncommitted work in logical groups, push, then open a pull request (a merge request on GitLab) filled against the project PR template. GitHub is automated end-to-end via gh; on other hosts the work is still committed and pushed, and you hand the user a ready-to-open PR/MR link.

Commit / branch conventions: apps/docs/docs/reference/workflow.md.

Be automated. Do not ask for confirmations unless something is genuinely ambiguous. Only stop to ask the user if you cannot resolve the issue link or the diff is too large to summarize confidently.

Arguments

Optional $ARGUMENTS:

  • A base branch name → use as merge target (default: dev)
  • A GitHub issue URL or #<number> → fetch via gh issue view and link in PR body
  • Free-text → treat as additional context for the description

If multiple, separate with spaces. Auto-detect each arg by shape.

Phase 1 — Gather context

1.1 Determine current branch

git branch --show-current

If on dev or main, abort: "You're on a base branch. Switch to a feature branch first."

1.2 Determine base branch

Default dev. Override via $ARGUMENTS. Verify it exists with git rev-parse --verify <base>. Fall back to main if dev missing.

1.3 Analyze all changes since branching

Run in parallel:

  • git diff <base>...HEAD --stat
  • git diff --stat
  • git diff --cached --stat
  • git status --short
  • git log <base>..HEAD --oneline

Read actual diffs:

  • git diff <base>...HEAD
  • git diff

1.4 Resolve issue link (optional)

Resolution order — stop at first match:

  1. $ARGUMENTS contains a GitHub issue URL or #<number> → fetch with gh issue view <num> --json title,body,url.
  2. Branch name contains <digits> at the end (e.g. feat/foo-284) → try gh issue view <num> and verify the title looks related.
  3. Skip — leave issue link out of the PR body.

Auto-fetch uses gh, so it resolves GitHub issues only. On other hosts (or if gh is missing/unauthenticated), skip the fetch and continue — the branch's ticket id still lands in the title/body.

Phase 2 — Smart commits

Skip if working tree is clean.

Grouping rules

  1. Dependency changes (package.json, pnpm-lock.yaml) → separate commit: chore(deps): update dependencies.
  2. Remaining changes → group by logical context. One context = one commit. Don't split fix + its test into two.

For each group

  1. Stage explicit files: git add <file...> (never -A or .).
  2. Generate a conventional commit subject (type(scope): subject, under 50 chars). Type from branch prefix (feat/ → feat, etc.) or change context.
  3. Commit. If the pre-commit hook (Lefthook + commitlint) fails:
    • Read the error.
    • Fix lint/format/commitlint complaint.
    • Re-stage and create a new commit (do NOT --amend).

Phase 3 — Push & open PR

3.1 Push

git push -u origin HEAD

If rejected for remote-ahead, abort: tell the user to pull/rebase first.

3.2 Title

Concise conventional-commit-style subject. Under 70 chars. Example: fix(ui): footer renders wrong colour on dark mode.

3.3 Body — fill the PR template

Check for a PR template at .github/pull_request_template.md (also .github/PULL_REQUEST_TEMPLATE.md or .github/PULL_REQUEST_TEMPLATE/). If present, fill it in and preserve its structure exactly.

If no template file exists (current state of this starter), build the body from these sections: a 2–4 sentence Description (WHY before WHAT), a one-line TL;DR, New environmental variables (or None), and a short Test plan. Then skip to "Create PR".

When a template is present, apply these mapping rules:

  • Task Link → if an issue was resolved in Phase 1, replace placeholder URL with the real one. Otherwise leave the placeholder.
  • Description → 2–4 sentences. WHY before WHAT. Reference root cause if it's a fix.
  • TL;DR → one sentence.
  • Screenshots/Videos → N/A if no UI change, otherwise leave the prompt for the author to fill.
  • New environmental variables → list any new env vars touched in the diff (grep diff for process.env. adds, .env* edits). If none, write None.
  • Checklist – author → tick only what the diff clearly satisfies:
    • Description once written
    • Environmental variables if you listed them or wrote None
    • Unit/Integration tests if test files were added
    • Leave human-only items unchecked (Assignee, Reviewers, Labels, screenshots, etc.)
  • Before merging → leave all unchecked.
  • Checklist – reviewer → leave all unchecked.

If the template has no Task Link section but an issue was resolved, prepend Closes #<num> above the body.

3.4 Open the PR

Detect the remote host from git remote get-url origin:

  • GitHub, with gh available:

    gh pr create --base "<base>" --title "<title>" --body-file <tmpfile>

    Use a tempfile via mktemp to avoid shell-escaping the multi-line body. Parse the output for the PR URL.

  • Any other host, or gh missing/unauthenticated — the branch is already pushed, so don't fail. Print the title and body and hand the user a ready-to-open link for the detected host:

    • GitLab → <repo-web-url>/-/merge_requests/new?merge_request%5Bsource_branch%5D=<branch>
    • Bitbucket → <repo-web-url>/pull-requests/new?source=<branch>
    • Azure Repos / unknown host → confirm the push and tell the user to open the PR in their host's UI against <base>.

    Derive <repo-web-url> from the origin remote (strip a trailing .git, convert git@host:org/repo to https://host/org/repo).

Report

Print:

PR/MR: <url>   (or "open manually — link printed above")
Branch: <branch> -> <base>
Commits on branch: <n>
Issue: <#num title> (or "no issue linked")

Notes

  • Never push with --force or --force-with-lease unless the user explicitly asks.
  • Never --amend after a hook failure.
  • Don't reference Asana, Linear, or Jira — they're out of scope for v1.
  • If multiple issues plausibly match the branch number, ask the user.

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.