docs: 新增 Claude Code github-pr skill,规范贡献者向上游提交 Issue 和 PR 的工作流#82
docs: 新增 Claude Code github-pr skill,规范贡献者向上游提交 Issue 和 PR 的工作流#82opensourceways-bot merged 1 commit intoopensourceways:mainfrom
Conversation
CLA Signature PassZhengZhenyu, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
CLA Signature PassZhengZhenyu, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
CLA Signature PassZhengZhenyu, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive documentation for contributing to the upstream opensourceways/openGecko repository through a new Claude Code skill. The documentation establishes a standardized workflow for creating GitHub issues and pull requests from contributor forks.
Changes:
- New
.claude/skills/github-pr/SKILL.mddefining the complete Issue + PR submission workflow with runtime fork detection, commit-to-template mapping, and CLI alternatives - Updated
CLAUDE.mdwith a new "Contributing to Upstream" section explaining when and how to use the github-pr skill - Documentation of single-commit requirement and squashing workflow
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
.claude/skills/github-pr/SKILL.md |
Comprehensive skill documentation covering fork detection, issue template selection, workflow steps, CLI alternatives, and edge case handling |
CLAUDE.md |
Added "Contributing to Upstream" section with skill overview, remote conventions, and squash requirement |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 6. **Match commit prefix to template** — `feat:` → Feature Request, `fix:` → Bug Report, `docs:` → Documentation, `[Governance]:` → Governance Task. | ||
| 7. **PR body language** — section headers and user-facing text in Chinese; code, variable names, and CLI output in English (matches project language conventions). | ||
| 8. **YAML templates can't be used with `--template`** — compose body manually to mirror template sections, or use the web UI. | ||
| 9. **Single commit per PR (no `needs-squash`)** — the upstream CI bot adds a `needs-squash` label that **blocks merging** when a PR contains more than one commit. Always squash all commits into one before pushing: |
There was a problem hiding this comment.
The documentation claims "the upstream CI bot adds a needs-squash label that blocks merging when a PR has more than one commit" (line 300, 366, and 609), but there is no evidence of such a CI bot in the repository's GitHub Actions workflows (.github/workflows/pr-checks.yml does not check commit count or add this label).
Either:
- Add the CI workflow that implements this check, or
- Clarify that this is a manual/external process, or
- Remove the claim that a CI bot automatically adds this label
This affects multiple locations: SKILL.md lines 300 and 320, CLAUDE.md lines 366, 370, and 609.
| # 3. Push | ||
| git push origin "$BRANCH" | ||
|
|
||
| # 4. PR |
There was a problem hiding this comment.
The Example Invocation section does not include the squashing step that is described as critical in Key Rule #9 and in CLAUDE.md line 366. Step 3 in the example just pushes without squashing first, which contradicts the claim that the skill "squashes all commits into one before pushing."
Add the squashing commands between step 2 and 3 to match the workflow described elsewhere in the documentation.
| # 3. Push | |
| git push origin "$BRANCH" | |
| # 4. PR | |
| # 3. Squash commits into one | |
| git fetch upstream | |
| git reset --soft upstream/main | |
| git commit -m 'feat: ...' | |
| # 4. Push | |
| git push origin "$BRANCH" --force-with-lease | |
| # 5. PR |
|
|
||
| 1. **Auto-detects fork identity** from `git remote get-url origin` — no username is ever hardcoded. | ||
| 2. **Creates an issue** on `opensourceways/openGecko` describing the feature/fix. | ||
| 3. **Squashes all commits into one** before pushing — the upstream CI bot adds a `needs-squash` label that **blocks merging** when a PR has more than one commit. |
There was a problem hiding this comment.
The claim that the skill "squashes all commits into one before pushing" is inconsistent with the actual Step-by-Step Workflow (lines 128-236) and Example Invocation (lines 324-346), which both omit the squashing step entirely.
Either update this description to accurately reflect what the workflow does, or ensure the workflow sections include the squashing step as claimed here.
| | `feat:` | New feature or enhancement | Feature Request | `[Feature]: ` | | ||
| | `fix:` | Bug fix | Bug Report | `[Bug]: ` | | ||
| | `docs:` | Documentation improvement | Documentation | `[Docs]: ` | | ||
| | `refactor:` | Code refactoring (no behaviour change) | Feature Request (or skip issue) | `[Feature]: ` | |
There was a problem hiding this comment.
Inconsistent spelling: "behaviour" should be "behavior" to match the American English spelling used consistently throughout the codebase (see other .md files in the project).
| | `refactor:` | Code refactoring (no behaviour change) | Feature Request (or skip issue) | `[Feature]: ` | | |
| | `refactor:` | Code refactoring (no behavior change) | Feature Request (or skip issue) | `[Feature]: ` | |
| ### Step 3 — Push the branch to fork | ||
|
|
||
| Check whether origin is up to date first; pull+rebase if behind. | ||
|
|
||
| ```bash | ||
| # Check if ahead/behind | ||
| git fetch origin "$BRANCH" 2>/dev/null | ||
| BEHIND=$(git rev-list --count "HEAD..origin/$BRANCH" 2>/dev/null || echo 0) | ||
|
|
||
| if [ "$BEHIND" -gt 0 ]; then | ||
| git pull origin "$BRANCH" --rebase | ||
| fi | ||
|
|
||
| git push origin "$BRANCH" | ||
| ``` |
There was a problem hiding this comment.
The Step-by-Step Workflow is missing the critical squashing step mentioned in Key Rule #9 and in CLAUDE.md line 366. According to the documentation, the skill should "squash all commits into one before pushing," but Step 3 only checks if origin is ahead and pushes without squashing.
Add a squashing step between the current Step 2 (Create issue) and Step 3 (Push branch), or integrate it into Step 3. The step should include the commands from Key Rule #9 to ensure all commits are squashed into one before pushing.
|
/lgtm |
Review Code Feedback
Tips
|
Review Code Feedback
Tips
|
PR Merge Failed
|
关联 Issue
Closes #81
变更概述
新增
.claude/skills/github-pr/SKILL.md,封装向opensourceways/openGecko提交 Issue + PR 的完整工作流;同步更新CLAUDE.md,新增「Contributing to Upstream」章节。主要变更
文档
.claude/skills/github-pr/SKILL.mdfeat:/fix:/docs:/[Governance]:).yml格式模板)ghCLI 替代方案:Option Acurl+ PAT、Option B GitHub Web UI、Option ChubCLAUDE.md/github-prskill 及 upstream/origin 远端约定测试
测试验证
文档类变更,无需运行测试套件。
测试计划
bash命令在本地验证可执行