pr-create

GitHub

通过GitHub CLI创建PR,自动获取描述、执行预检(lint/测试等)、推送分支并提交草稿PR。

.agents/skills/pr-create/SKILL.md strands-agents/harness-sdk

Trigger Scenarios

用户请求创建或提交PR 需要打开GitHub Pull Request

Install

npx skills add strands-agents/harness-sdk --skill pr-create -g -y
More Options

Non-standard path

npx skills add https://github.com/strands-agents/harness-sdk/tree/main/.agents/skills/pr-create -g -y

Use without installing

npx skills use strands-agents/harness-sdk@pr-create

指定 Agent (Claude Code)

npx skills add strands-agents/harness-sdk --skill pr-create -a claude-code -g -y

安装 repo 全部 skill

npx skills add strands-agents/harness-sdk --all -g -y

预览 repo 内 skill

npx skills add strands-agents/harness-sdk --list

SKILL.md

Frontmatter
{
    "name": "pr-create",
    "description": "Creates a GitHub pull request using the gh CLI. Use when the user asks to create, open, or submit a PR on GitHub."
}

GitHub PR Create Skill

Process

1. Get the PR Description

  • Check for .local/pr-body.md. If it exists, re-read it fresh and sanity-check that its content matches the current branch's changes (e.g. the description references files, features, or issues consistent with the current diff). If it looks stale or unrelated to the current changes, warn the user and offer to regenerate it.
  • Else if the user already generated a PR description earlier in the conversation, use that.
  • Otherwise, fall back to the pr-writer skill to generate the title and body.

2. Pre-flight Checks

Check for CONTRIBUTING.md (at the repo root or in docs/) and .github/PULL_REQUEST_TEMPLATE.md. Scan them for any recommended steps before opening a PR — common examples:

  • Running a linter or formatter (e.g. npm run lint, cargo fmt)
  • Running tests (e.g. npm test, pytest)
  • Building the project
  • Updating documentation or changelogs

If you find any such steps, list them and ask the user which ones they'd like you to run. Run whichever the user approves. If any step fails, show the output and ask how to proceed before continuing.

If neither file exists or they contain no actionable pre-PR steps, skip this and move on.

To run the local equivalent of the CI merge gate before opening the PR (lint, format, type-check, tests for the areas the change touches), use the pre-push skill — bash .agents/skills/pre-push/run-checks.sh.

3. Push the Branch (if needed)

Check whether the current branch has an upstream tracking branch with all commits pushed. If not, push before creating the PR. If the push fails, show the error and stop.

4. Create the PR

Ensure the final PR body is written to .local/pr-body.md (create .local/ if needed), overwriting any earlier draft. Then create the PR:

gh pr create \
  --title "<title>" \
  --body-file .local/pr-body.md \
  --draft
  • Default to --draft. Only omit it if the user explicitly asks for a non-draft PR.
  • Do NOT pass --repo — let gh infer the upstream from the git remotes so the PR targets the correct upstream repository.

Rules

  • If gh is not authenticated or the command fails, show the error and stop.

Version History

  • 2b6af5a Current 2026-08-20 16:58

Same Skill Collection

.agents/skills/docs-audit/SKILL.md
.agents/skills/docs-diagrams/SKILL.md
.agents/skills/docs-planner/SKILL.md
.agents/skills/docs-reviewer/SKILL.md
.agents/skills/docs-writer/SKILL.md
.agents/skills/pr-feedback/SKILL.md
.agents/skills/pr-writer/SKILL.md
.agents/skills/pre-push/SKILL.md
.agents/skills/strands/SKILL.md
.agents/skills/strands/skills/add-mcp-server/SKILL.md
.agents/skills/strands/skills/add-tool/SKILL.md
.agents/skills/strands/skills/build-with-strands/SKILL.md
.agents/skills/strands/skills/port-from-langgraph/SKILL.md
.agents/skills/strands/skills/scaffold-agent/SKILL.md
.agents/skills/strands-review/SKILL.md

Metadata

Files
0
Version
1adcaf9
Hash
2e9343b6
Indexed
2026-08-20 16:58

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-25 01:02
浙ICP备14020137号-1