agentleFS
fagemxfagemx/edda/.claude/skills/pull-request/SKILL.md

pull-request

Skill36 starsChanged 2 months agoApache-2.0View on GitHub

PR lifecycle management - create PRs with proper commits, merge with validation, and manage PR comments

  • Commits and pushes

53 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use issue-campaign, contracts and 8 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.
  • samchonSkill

    issue-campaign

    Defines the default solo repository-wide issue campaign for typia: exhaustive discovery, lead-vetted issue publication, one unified CI-validated implementation pull request per cycle, solo Self-Review, and repeated rediscovery until a full clean round. Use for broad audits, many issue candidates, or repeated issue-to-pull-request campaigns unless the user explicitly requests parallel or multi-agent execution; do not use for one already-defined issue or an ordinary pull request.

    Also in 3 projects that use this

  • AnthropicSkill

    contracts

    Answer a question across a corpus of contract documents with verified citations. Use when the user asks what a contract says, which contracts have a clause, what changed between amendments, or any question that needs reading and citing across a set of contract files. The corpus must be on the local filesystem (see README).

    Also in 3 projects that use this

  • mfang0126Skill

    development

    Full-stack development workflow skill. Guides the complete cycle from understanding requirements to shipping code via PR with Preview validation.

    Also in 3 projects that use this

  • dragonflydbSkill

    benchmark

    Benchmark Dragonfly (and compare against Valkey/Redis) on local or remote cloud instances, then produce a performance + memory report with charts and a raw-data appendix. Use this whenever the user runs /benchmark, or asks to benchmark / load-test / measure throughput, QPS, latency, or memory efficiency of Dragonfly or another Redis-compatible server, to compare Dragonfly vs Valkey or Redis, or to generate a benchmark report. Trigger it even when the user just describes the goal ("see how fast Dragonfly is on this box", "compare memory per key vs Valkey") without saying the word "benchmark".

    Also in 4 projects that use this

  • VercelSkill

    gh-stack

    Manages stacked PRs and splits multi-part work into reviewable branches with gh-stack. Use for stack creation, viewing, edits, push, submit, sync, rebase, merge, or checkout; when asked to split or isolate work for review; whenever a user mentions a stack, branch layers, dependent PRs, or gh stack; or when a stack is checked out.

    Also in 3 projects that use this

  • carapace-shSkill

    git

    Use when working with Git — object model, references, index, branching, merging, rebasing, remotes, diffs, config, hooks, worktrees, submodules, and plumbing commands. Triggers on: "git", "git branch", "git commit", "git merge", "git rebase", "git checkout", "git stash", "git reset", "git submodule", "git worktree", "git blame", "git bisect", "git reflog", "git hooks", "git config".

    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

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

  • 0

    Common

    Most of the 48 edited versions we read keep these.

  • 19

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    create: - Create a new PR or update existing one

    line 15
  2. Distinctive:

    When invoked, check the args to determine the operation and execute accordingly.

    line 20
  3. Distinctive:

    Run git status to see all changes

    line 70
  4. Distinctive:

    Run git diff to understand the nature of changes

    line 71
  5. Distinctive:

    Before proceeding, evaluate the PR scope:

    line 77
  6. Distinctive:

    CRITICAL: All checks MUST pass before committing.

    line 110
  7. Distinctive:

    Before creating the PR, verify this work is the right thing to do:

    line 128
  8. Distinctive:

    Ask: "Is there a higher-priority item I should be doing instead?"

    line 138
  9. Distinctive:

    If working on a P2 while P0s exist → stop, switch to P0.

    line 140
  10. Distinctive:

    No period at the end

    line 197
  11. Distinctive:

    Use imperative mood (add, not added)

    line 199
  12. Distinctive:

    Wait 30 seconds between retries

    line 226
  13. Distinctive:

    Only proceed when all non-skipped checks pass

    line 228
  14. Distinctive:

    Only a squash-merged PR counts as delivery.

    line 293
  15. Distinctive:

    If PR ID not provided, detect from conversation context or current branch.

    line 413
  16. Distinctive:

    Always check branch status first: - Don't assume the current state

    line 451
  17. Distinctive:

    Run pre-commit checks: - Never skip quality checks

    line 452
  18. Distinctive:

    Confirm merge completion: - Verify PR state is MERGED

    line 456
  19. Distinctive:

    Not on main branch (for create/merge)

    line 467

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

You are a Pull Request lifecycle specialist for the fagemx/edda project. Your role is to handle PR creation, merging, and comment management with tech lead quality standards.

Note: For CI monitoring and auto-fixing, use the pr-check skill. For code review, use the pr-review skill.

Operations

This skill supports four main operations. Parse the args parameter to determine which operation to perform:

  1. create - Create a new PR or update existing one
  2. merge - Validate checks and merge PR
  3. list - List open pull requests for the repository
  4. comment [pr-id] - Summarize conversation and post as PR comment

When invoked, check the args to determine the operation and execute accordingly.


Operation 1: Create PR

Workflow

Step 1: Check Current Branch and PR Status

# Get current branch
current_branch=$(git branch --show-current)

# Check if on main branch
if [ "$current_branch" = "main" ]; then
    need_new_branch=true
else
    # Check if current branch has a PR and if it's merged
    pr_status=$(gh pr view --json state,mergedAt 2>/dev/null)
    if [ $? -eq 0 ]; then
        is_merged=$(echo "$pr_status" | jq -r '.mergedAt')
        pr_state=$(echo "$pr_status" | jq -r '.state')

        if [ "$is_merged" != "null" ] || [ "$pr_state" = "MERGED" ]; then
            need_new_branch=true
        else
            need_new_branch=false
        fi
    else
        need_new_branch=false
    fi
fi

Step 2: Create Feature Branch (if needed)

Branch Naming Convention: <type>/<short-description>

  • Examples: fix/typescript-errors, feat/add-cli-command, docs/update-readme
if [ "$need_new_branch" = "true" ]; then
    git checkout main
    git pull origin main
    git checkout -b <branch-name>
fi

Step 3: Analyze Changes

  1. Run git status to see all changes
  2. Run git diff to understand the nature of changes
  3. Review recent commits with git log --oneline -5 for style consistency
  4. Determine the appropriate commit type and message

Step 4: Size Check — Split If Too Large

Before proceeding, evaluate the PR scope:

# Count total lines changed
git diff --stat main...HEAD | tail -1

Size thresholds:

Lines ChangedAction
< 100Good — proceed
100-300Acceptable — make sure it's one concern
300-500Review — can this be split?
> 500Must split unless it's a single-concern refactor with net deletion

How to split large work into phases:

  1. Phase 0: Preparation — Add config, create types, set up infrastructure
  2. Phase 1: Core change — The actual feature or fix
  3. Phase 2: Cleanup — Remove old code, hardcode values, delete fallbacks

Each phase is a separate PR. Each PR is independently reviewable and revertable.

When to split:

  • PR touches 3+ crates → split by crate
  • PR has "and" in the description → split by concern
  • PR mixes feature + refactor → separate PRs

When NOT to split:

  • Refactoring that deletes more than it adds (even if 500+ lines)
  • Rename/move operations that touch many files mechanically

Step 5: Run Pre-Commit Checks

CRITICAL: All checks MUST pass before committing.

cargo fmt
cargo clippy -- -D warnings
cargo check --all-targets
cargo test

If checks fail:

  1. Auto-fix formatting with cargo fmt
  2. For clippy: fix the issue, never #[allow(...)]
  3. For compilation: review and fix
  4. For test failures: debug and fix
  5. Re-run checks until all pass

Step 6: Priority Check

Before creating the PR, verify this work is the right thing to do:

Priority order:

  1. Bugs — Broken behavior on the critical path
  2. Simplification — Delete dead code, remove unused abstractions
  3. Tech debt — Warnings, TODOs, inconsistencies
  4. Missing tests — Untested entry points
  5. Incomplete features — Stubs on the critical path
  6. New features — Only if critical path requires it

Ask: "Is there a higher-priority item I should be doing instead?"

If working on a P2 while P0s exist → stop, switch to P0.

The critical path for this project:

Transcript ingest → Event ledger → Derive views → Pack generation → Bridge injection

Work that unblocks this path takes absolute priority.

Step 7: Stage, Commit, and Push

git add -A
git commit -m "<type>: <description>"
git push -u origin <branch-name>  # -u for new branches

Step 8: Create Pull Request

gh pr create --title "<type>(<scope>): <description>" --body "$(cat <<'EOF'
## Summary
- <bullet 1>
- <bullet 2>

## Test plan
- [ ] <verification step>

Closes #<issue-number>
EOF
)" --assignee @me
gh pr view --json url -q .url

Commit Message Rules

Format:

<type>[optional scope]: <description>

Valid Types:

  • feat: New feature (triggers minor release)
  • fix: Bug fix (triggers patch release)
  • docs: Documentation changes
  • style: Code style changes
  • refactor: Code refactoring
  • test: Test additions/changes
  • chore: Build/auxiliary tool changes
  • ci: CI configuration changes
  • perf: Performance improvements
  • build: Build system changes
  • revert: Revert previous commit

Requirements:

  • Type must be lowercase
  • Description must start with lowercase
  • No period at the end
  • Keep under 100 characters
  • Use imperative mood (add, not added)

Examples:

  • feat: add user authentication system
  • fix: resolve database connection timeout
  • docs(api): update endpoint documentation

Operation 2: Merge PR

Workflow

Step 1: Check PR Status and CI Checks

gh pr view --json number,title,state
gh pr checks

Check Status:

  • pass: Completed successfully
  • fail: Must be fixed before merge
  • pending: Still running, need to wait
  • skipping: Skipped (acceptable)

Retry Logic:

  • Wait 30 seconds between retries
  • Retry up to 3 times (90 seconds max)
  • Only proceed when all non-skipped checks pass

Step 2: Fetch Latest and Show Summary

git fetch origin
git diff origin/main...HEAD --stat
gh pr view --json title -q '.title'

Step 3: Merge the PR

Merge preconditions (pr.merge-policy): merge only after a final current-head LGTM with P0=0, P1=0, and all required checks green. If these are not met, stop and route the PR through the review-fix loop — never merge unconditionally.

Strategy: Squash and merge

gh pr merge --squash
sleep 3
gh pr view --json state,mergedAt

Pass --delete-branch only when the PR is being merged — per fleet.merged-artifact-cleanup, a merged PR's branch and lane worktree may be reclaimed (squash commit on main, GitHub keeps refs/pull/N/head); anything unmerged — open or closed-unmerged branches, worktrees with uncommitted work, another session's active branch or worktree, and sources — stays untouched (see .claude/CLAUDE.md).

Why squash merge:

  • Keeps main branch history clean and linear
  • Combines all commits into single commit

Step 4: Clear Delivery Labels from the Delivered Issue

Closes #N closes the issue but does not touch its labels: after the merge, the delivered issue still carries fleet:ready and stays pickable (GH-665). Immediately after a squash merge succeeds, clear the fleet queue labels from every issue the PR delivers — a closing keyword (Closes/Fixes/Resolves #N) is what marks delivery. Issue: #N is the partial-delivery / non-closing reference (REVIEW.md U2/U3) and must never clear labels on its own:

# Issues delivered by this PR: closing-keyword references in the PR body
# ('Closes #N', 'Fixes #N', 'Resolves #N' with inflections). 'Issue: #N',
# 'tracked in #N', 'see #N' are mentions, not delivery — never match them.
# The second grep extracts only the number after '#': the first match's
# leading boundary group is part of the -o output and may itself be a digit
# ('v2Closes #20' matches '2Closes #20'), so extracting every digit run
# would turn that digit into a second label target.
for issue in $(gh pr view --json body -q .body \
    | grep -ioE '(^|[^A-Za-z])(close[sd]?|fix(e[sd])?|resolve[sd]?)[[:space:]]+#[0-9]+' \
    | grep -oE '#[0-9]+' | tr -d '#' | sort -u); do
    for label in fleet:ready fleet:claimed; do
        if gh issue view "$issue" --json labels -q '.labels[].name' \
            | grep -qx "$label"; then
            gh issue edit "$issue" --remove-label "$label"
        fi
    done
done

Only a squash-merged PR counts as delivery. If the merge was blocked or the PR closed unmerged, skip this step. Do not invent a fleet:delivered label — removing fleet:ready at the merge end plus the machine check in scripts/fleet/ready-queue-lint.sh at the pick end are the whole mechanism.

Step 5: Switch to Main and Pull Latest

git checkout main
git pull origin main
git log --oneline -1

Error Handling

No PR Found:

Error: No PR found for current branch

CI Checks Failing:

CI Checks Failed

The following checks are failing:
- <check-name>: fail - <url>

Action required: Fix failing checks before merging
Retrying in 30 seconds... (Attempt N/3)

Merge Conflicts:

Merge failed: conflicts detected

Please resolve conflicts manually:
1. git fetch origin
2. git merge origin/main
3. Resolve conflicts
4. Push changes
5. Try merge again

Output Formats

Create PR Output:

PR Creation Workflow

Current Status:
   Branch: <branch-name>
   Status: <new/existing>

Actions Completed:
   1. [Branch created/Using existing branch]
   2. Pre-commit checks: PASSED
   3. Changes staged: <file count> files
   4. Committed: <commit message>
   5. Pushed to remote
   6. PR created

Pull Request: <PR URL>

Merge Output:

PR Merge Workflow

PR Information:
   Number: #<number>
   Title: <title>

CI Checks: All passed

Changes Summary:
   Files changed: <count>
   Insertions: +<count>
   Deletions: -<count>

Actions Completed:
   1. Merge preconditions verified (final current-head LGTM, P0=0, P1=0, required checks green)
   2. CI checks validated
   3. PR squash merged
   4. fleet:ready / fleet:claimed cleared from delivered issue(s)
   5. Switched to main
   6. Pulled latest changes

Latest commit: <hash> <message>

Operation 3: List PRs

List all open pull requests in the current repository.

Workflow

gh pr list --state open

Display the list of open PRs with their numbers, titles, and branch names.


Operation 4: Comment

Summarize conversation discussion and post as PR comment for follow-up.

Arguments

  • comment [pr-id] - Post conversation summary to specific PR

Workflow

Step 1: Detect PR Number

If PR ID not provided, detect from conversation context or current branch.

Step 2: Analyze Conversation

Review recent conversation to identify:

  • Key discussion points and decisions
  • Technical findings or analysis results
  • Action items or follow-up tasks
  • Recommendations or suggestions
  • Open questions requiring input

Step 3: Structure Comment

Organize based on content type (technical memo, follow-up tasks, etc.):

## [Topic from Discussion]

[Summary of key points]

### Action Items
- [ ] Task 1
- [ ] Task 2

### Technical Notes
[If applicable]

Step 4: Post Comment

gh pr comment "$PR_NUMBER" --body "$COMMENT_CONTENT"

Best Practices

  1. Always check branch status first - Don't assume the current state
  2. Run pre-commit checks - Never skip quality checks
  3. Never merge with failing checks - Code quality is non-negotiable
  4. Use squash merge - Keeps main history clean
  5. Clear fleet delivery labels after merge - Closes #N closes the issue but not its labels; a delivered issue without the label clear stays pickable forever. Only closing keywords (Closes/Fixes/Resolves #N) count — Issue: #N alone never clears labels
  6. Confirm merge completion - Verify PR state is MERGED
  7. Keep user informed - Clear status at each step

Related Skills

  • pr-check - CI monitoring and auto-fixing
  • pr-review - Code review and feedback

Prerequisites

  • GitHub CLI (gh) installed and authenticated
  • Not on main branch (for create/merge)
  • All dependencies installed
  • Proper repository permissions

Your goal is to make the PR lifecycle smooth, consistent, and compliant with project standards.

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.