agentleFS
sevenschultesevenschulte/agentic-harness/.claude/skills/ship-pr/SKILL.md

ship-pr

Skill2 starsChanged 7 months agoMITView on GitHub

Ship the current branch as a pull request. Runs tests, formats code, commits any uncommitted work, pushes the branch, and opens a PR against the base branch with a generated body following the team's PR template. Use when the user says "ship it", "open a PR", "send this for review", or finishes a feature and wants it reviewed.

  • Reads credentials
  • Deletes or force-pushes
  • Commits and pushes

30 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ideate, triage and 7 more.

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.
  • OpenAISkill

    ideate

    Generate image-based alternatives, remixes, or new design directions from a Product Design brief. Use when the user asks for design variants, visual exploration, remixes, or image-generated approaches from provided context.

    Also in 4 projects that use this

  • Google CloudSkill

    triage

    Gather context on a change or bug and plan the implementation.

    Also in 4 projects that use this

  • GoogleSkill

    diagnosing-bugs

    Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.

    Also in 3 projects that use this

  • GoogleSkill

    domain-modeling

    Build and sharpen a project's domain model. Use when the user wants to pin down domain terminology or a ubiquitous language, record an architectural decision, or when another skill needs to maintain the domain model.

    Also in 3 projects that use this

  • Hugging FaceSkill

    implement

    Make tests pass. Invoke after /write-tests produces failing tests.

    Also in 3 projects that use this

  • MicrosoftSkill

    handoff

    Compact the current conversation into a handoff document for another agent to pick up.

    Also in 3 projects that use this

  • +3 more from google

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 30 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 3

    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. Distinctive:

    Before doing anything, verify:

    line 25
  2. Distinctive:

    If any check fails, stop and report.

    line 45
  3. Distinctive:

    If it exits non-zero, stop: Read the output, report the failure, and ask the user what to do.

    line 55
  4. Distinctive:

    If there are uncommitted changes:

    line 69
  5. Distinctive:

    Read the diff (don't just stage everything blindly)

    line 71
  6. Very specific:

    If they do: stage explicit files (git add <file1> <file2>), not git add -A

    line 73
  7. Very specific:

    Write a commit message following .claude/rules/conventions.md (Conventional Commits format)

    line 74
  8. Distinctive:

    If everything is already committed, skip to Step 3.

    line 78
  9. Distinctive:

    If the push is rejected (someone else pushed to your branch — rare but possible on shared feature branches):

    line 96
  10. Very specific:

    Never plain --force — --force-with-lease checks you're not clobbering work you haven't seen

    line 102
  11. Distinctive:

    Read the commits on this branch:

    line 107

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

Ship PR

You are about to ship the current branch as a pull request. The user has done the work; you are doing the handoff.

This skill is the worked example from the Harness Engineering article. It demonstrates the deterministic-where-possible / LLM-where-needed split: the script does the mechanical steps; you do the judgement steps (writing the PR body, deciding whether to ship at all).

Step 0 — Sanity checks

Before doing anything, verify:

# 1. We're in a git repo
git rev-parse --is-inside-work-tree

# 2. The current branch is not the base branch
CURRENT=$(git branch --show-current)
BASE="${1:-dev}"  # Default base from $ARGUMENTS, fallback to "dev"
# If your default base is "main", change the fallback above.
[ "$CURRENT" != "$BASE" ] || { echo "Refusing to ship: current branch is the base branch."; exit 1; }

# 3. The branch has at least one commit ahead of base
AHEAD=$(git rev-list --count "$BASE".."$CURRENT")
[ "$AHEAD" -gt 0 ] || { echo "Refusing to ship: branch has 0 commits ahead of $BASE."; exit 1; }

# 4. gh CLI is installed and authenticated
gh auth status

If any check fails, stop and report. Do not try to fix the underlying issue without explicit confirmation.

Step 1 — Run the deterministic part

.claude/skills/ship-pr/scripts/run-tests.sh

That script formats code, runs the test suite, and exits non-zero on any failure. If it exits non-zero, stop. Read the output, report the failure, and ask the user what to do. Do not retry, do not disable tests, do not push anyway.

This is the line you will not cross: never use --no-verify, never skip a failing test, never push known-broken code.

Step 2 — Stage and commit any uncommitted work

# Show the user what's about to be committed
git status --short
git diff --stat

If there are uncommitted changes:

  1. Read the diff (don't just stage everything blindly)
  2. Decide whether the changes belong in this PR or not. If they don't, ask
  3. If they do: stage explicit files (git add <file1> <file2>), not git add -A
  4. Write a commit message following .claude/rules/conventions.md (Conventional Commits format)
  5. Commit

If everything is already committed, skip to Step 3.

git add <specific files>
git commit -m "$(cat <<'EOF'
<type>(<scope>): <subject>

<body explaining why, wrapped at ~72 cols>
EOF
)"

Step 3 — Push the branch

git push -u origin "$CURRENT"

If the push is rejected (someone else pushed to your branch — rare but possible on shared feature branches):

  1. git fetch origin "$CURRENT"
  2. git rebase origin/$CURRENT
  3. Resolve conflicts, then git push --force-with-lease origin "$CURRENT"
  4. Never plain --force — --force-with-lease checks you're not clobbering work you haven't seen

Step 4 — Generate the PR body

Read the commits on this branch:

git log "$BASE".."$CURRENT" --oneline
git log "$BASE".."$CURRENT" --no-merges --format="%B%n---%n"

And the diff stats:

git diff "$BASE".."$CURRENT" --stat

Then draft a PR body following the template in .claude/rules/conventions.md:

## What

<1–3 sentences: the actual change, not a diff summary>

## Why

<the problem this solves; link to the issue if there is one>

## How

<the approach; flag non-obvious decisions>

## Test plan

- [ ] <how the reviewer can verify>
- [ ] <edge case>
- [ ] <regression check>

## Notes for reviewer

<anything you want a second opinion on, deferred work>

Fill it from the commits and diff. Do not invent intent. If the commits don't tell you the why, ask the user before writing the "Why" section.

Step 5 — Open the PR

gh pr create \
  --base "$BASE" \
  --head "$CURRENT" \
  --title "<type>(<scope>): <subject>" \
  --body "$(cat <<'EOF'
<the body you drafted in step 4>
EOF
)"

The title should match the lead commit's subject. If multiple commits, use the most-significant one's subject (or the user's own summary if they gave you one).

Step 6 — Report back

Output to the user:

Shipped: <PR URL>
Title: <title>
Base: <base> ← <branch>
Commits: <count>
Changed: +<additions> / -<deletions> across <files> files

Tests: passed
Format: clean

Next: reviewer is <github handle if known, else "open">.

What this skill will not do

  • It will not merge the PR. Merging is a separate decision and a separate action.
  • It will not request specific reviewers unless the user named them. Auto-tagging the wrong person is annoying.
  • It will not skip any step. If the test script fails, the PR doesn't open.
  • It will not commit .env, *.key, or anything matching a secret pattern. The pre-bash hook in .claude/hooks/pre-bash.sh will block it anyway.

When to use a different skill

  • You're reviewing someone else's PR → use review-pr
  • You're not done yet, just want to push WIP → just git push, don't use this skill
  • You want to merge an already-reviewed PR → that's a manual action; not in scope here

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.