github-contributor · diff
git:20260311.eb2917d to git:20260517.c1adae2
187 added, 384 removed. Audit A to A.
---
name: github-contributor
- description: Strategic guide for becoming an effective GitHub contributor. Covers opportunity discovery, project selection, high-quality PR creation, and reputation building. Use when looking to contribute to open-source projects, building GitHub presence, or learning contribution best practices.
+ description: End-to-end playbook for shipping high-quality pull requests to open-source projects you don't maintain. Use whenever the user is creating, editing, or pushing a PR to a third-party GitHub repo — even if they just say "submit a PR", "open a PR", "fix this upstream", "rebase against main", "respond to the bot review", or names a target repo in the form `owner/repo`. Covers project discovery, CONTRIBUTING.md compliance, PR-size sanity check, minimal-diff implementation, isolated GUI E2E verification, PR description writing with AI-assisted disclosure, conflict resolution with fixup + autosquash, and post-submission bot/maintainer interaction. Also triggers on Chinese phrases like "提 PR"、"上游 PR"、"贡献代码"、"rebase 冲突"、"PR 描述写不好"、"回应维护者"、"AI 贡献声明".
---
# GitHub Contributor
- Strategic guide for becoming an effective GitHub contributor and building your open-source reputation.
-
- ## Prerequisites
-
- - Install GitHub CLI and verify availability: `gh --version`
- - Authenticate before running commands: `gh auth status || gh auth login`
-
- ## The Strategy
-
- **Core insight**: Many open-source projects have room for improvement. By contributing high-quality PRs, you:
- - Build contributor reputation
- - Learn from top codebases
- - Expand professional network
- - Create public proof of skills
+ A phase-based playbook for shipping pull requests that maintainers actually want to merge. The skill is structured around the real PR lifecycle — discovery → implementation → quality gates → description → post-submission — because each phase has its own failure modes and the most common mistake is doing the right thing at the wrong phase (e.g., writing the perfect description for a PR that's 10× too large).
- ## Contribution Types
+ ## Phase 0 — When to use this skill
- ### 1. Documentation Improvements
+ Use this skill when **all** of these are true:
- **Lowest barrier, high impact.**
+ - You are contributing to a repo you do **not** maintain (the maintainer can close your PR without explanation).
+ - The work touches one or more of: source code, tests, docs, build config.
+ - You want the PR merged, not just submitted.
- - Fix typos, grammar, unclear explanations
- - Add missing examples
- - Improve README structure
- - Translate documentation
+ Do **not** use this for: your own repos, internal team PRs with shared context, hot-fix branches where a maintainer is waiting on you, or trivial single-line changes (one comment is enough).
- ```
- Opportunity signals:
- - "docs", "documentation" labels
- - Issues asking "how do I..."
- - Outdated screenshots or examples
- ```
+ ## Phase 1 — Pre-PR Discovery
- ### 2. Code Quality Enhancements
+ The most common reason PRs get closed is a mismatch between what the contributor assumes is acceptable and what the maintainer has already written down. Solve this before writing code.
- **Medium effort, demonstrates technical skill.**
+ ### Step 1.1 — Read CONTRIBUTING.md as a hard contract
- - Fix linter warnings
- - Add type annotations
- - Improve error messages
- - Refactor for readability
+ CONTRIBUTING.md is **not** style advice. Treat every numbered rule as a precondition for merge. Pay special attention to:
- ```
- Opportunity signals:
- - "good first issue" label
- - "tech debt" or "refactor" labels
- - Code without tests
- ```
+ - **AI-assisted contribution clauses.** Many projects added these in 2024-2026 after the AI PR wave. Typical phrasing: "AI-generated PRs without prior discussion may be closed", "you must be able to explain every line", "one issue, one PR". If this clause exists, you owe the project explicit disclosure (see Phase 4) and you must keep the PR small.
+ - **Issue-first rules.** Some projects require a feature-request issue to exist before any feature PR is opened.
+ - **Per-language test commands.** If CONTRIBUTING.md says `pnpm test:unit && cargo test`, those are the commands you run, not whatever your IDE prefers.
- ### 3. Bug Fixes
+ If CONTRIBUTING.md is missing, that itself is a red flag — see [`references/project_evaluation.md`](references/project_evaluation.md).
- **High impact, builds trust.**
+ ### Step 1.2 — Sanity-check your PR size against the project's baseline
- - Reproduce and fix reported bugs
- - Add regression tests
- - Document root cause
+ A "small PR" is relative. Before opening a PR, run:
- ```
- Opportunity signals:
- - "bug" label with reproduction steps
- - Issues with many thumbs up
- - Stale bugs (maintainers busy)
+ ```bash
+ gh pr list --repo <owner>/<repo> --state merged --limit 10 \
+ --json number,title,author,additions,deletions \
+ --jq '.[] | "#\(.number) +\(.additions)/-\(.deletions): \(.title)"'
```
- ### 4. Feature Additions
-
- **Highest effort, highest visibility.**
-
- - Implement requested features
- - Add integrations
- - Performance improvements
-
- ```
- Opportunity signals:
- - "help wanted" label
- - Features with clear specs
- - Issues linked to roadmap
- ```
+ This tells you the project's actual merged-PR size distribution. If your PR is **5–10× larger than the biggest recent merge**, that is a red signal — split before submitting. See [`references/phase1_discovery.md`](references/phase1_discovery.md) for the baseline rubric and split heuristics.
- ## Project Selection
+ ### Step 1.3 — Write a one-paragraph scope contract before coding
- ### Good First Projects
+ A scope contract is a single paragraph you write **to yourself** before opening your editor:
- | Criteria | Why |
- |----------|-----|
- | Active maintainers | PRs get reviewed |
- | Clear contribution guide | Know expectations |
- | "good first issue" labels | Curated entry points |
- | Recent merged PRs | Project is alive |
- | Friendly community | Supportive feedback |
+ > Goal: <one sentence>. In scope: <bullet list, 3–5 items>. Explicitly out of scope: <bullet list — be specific about what you will resist adding when it's tempting>.
- ### Red Flags
+ Then, every time you make an edit, ask: "Is this in scope?" If you find yourself "while I'm in here…"-ing, stop and revisit the contract. Scope creep is the single biggest source of close-without-merge — see [`references/phase2_implementation.md`](references/phase2_implementation.md) for the scope-discipline section.
- - No activity in 6+ months
- - Many open PRs without review
- - Hostile issue discussions
- - No contribution guidelines
+ ## Phase 2 — Implementation
- ### Finding Projects
+ ### Step 2.1 — Branch off `main` immediately after fetching upstream
```bash
- # GitHub search for good first issues
- gh search issues "good first issue" --language=python --sort=created --state=open
-
- # Search by topic
- gh search repos "topic:cli" --sort=stars --limit=20
-
- # Find repos you use
- # Check dependencies in your projects
+ git fetch origin
+ git switch -c feat/short-descriptive-name origin/main
```
- ## PR Excellence
-
- ### The High-Quality PR Formula
+ Always branch from upstream `main` (or the project's default branch), never from your fork's `main`, which may be stale.
- Based on real-world successful contributions to major open-source projects:
+ ### Step 2.2 — Make the smallest diff that solves the problem
- ```
- 1. Deep investigation (post to issue, not PR)
- 2. Minimal, surgical fix (only change what's necessary)
- 3. Regression test (prevent future breakage)
- 4. CHANGELOG entry (if project uses it)
- 5. End-to-end validation (prove bug exists, prove fix works)
- 6. Clear PR structure (~50 lines, focused)
- 7. Professional communication
- 8. Separate concerns (detailed analysis in issue, fix summary in PR)
- 9. No internal/irrelevant details
- 10. Responsive to feedback
- ```
+ Resist any change that is not directly required by your scope contract. In particular:
+ - Do **not** "while I'm here" refactor surrounding code.
+ - Do **not** reformat lines you didn't touch (your formatter may differ from the project's, even if both say "Prettier").
+ - Do **not** rename variables for clarity unless the renaming is the fix.
- ### Before Writing Code
+ If a follow-up improvement is genuinely valuable, file a separate issue or open a separate PR after this one is merged.
- ```
- Pre-PR Checklist:
- - [ ] Read CONTRIBUTING.md
- - [ ] Check existing PRs for similar changes
- - [ ] Comment on issue to claim it
- - [ ] Understand project conventions
- - [ ] Set up development environment
- - [ ] Trace through git history for context
- - [ ] Identify root cause with evidence
- ```
+ ### Step 2.3 — Conventional Commits, one logical change per commit
- ### Investigation Phase (Post to Issue)
+ Use [Conventional Commits](https://www.conventionalcommits.org/): `<type>(<scope>): <description>` where type is `feat | fix | docs | refactor | test | chore | ci | perf`. Each commit should be reviewable on its own.
- **Do this BEFORE coding**:
+ When a review prompts a fix, use `git commit --fixup=<sha>` and squash with `git -c sequence.editor=: rebase -i --autosquash origin/main` before pushing — see [`references/phase2_implementation.md`](references/phase2_implementation.md) for the full fixup workflow.
- 1. **Reproduce the bug** with exact commands and output
- 2. **Trace git history** to understand context
- ```bash
- git log --all --grep="keyword" --oneline
- git blame file.ts | grep "relevant_line"
- ```
- 3. **Link related issues/PRs** that provide context
- 4. **Post detailed analysis to issue** (not PR)
- - Timeline of related changes
- - Root cause explanation
- - Why previous approaches didn't work
+ ## Phase 3 — Quality Gates
- **Example structure**:
- ```markdown
- ## Investigation
+ Maintainers' trust is built by evidence, not by claims. The point of this phase is to produce evidence you can paste into the PR.
- I traced this through the codebase history:
+ ### Step 3.1 — Run the project's full lint + test suite locally
- 1. [Date]: #[PR] introduced [feature]
- 2. [Date]: #[PR] added [workaround] because [reason]
- 3. [Date]: #[PR] changed [parameter]
- 4. Now: Safe to [fix] because [explanation]
+ Read the exact commands from CONTRIBUTING.md. Typical examples (use what your project specifies):
- [Detailed evidence with code references]
+ ```bash
+ pnpm typecheck && pnpm format:check && pnpm test:unit
+ cargo fmt --check && cargo clippy --all-targets && cargo test
```
- ### Writing the PR
+ If any check fails, fix it before continuing. Do not push a PR with red local checks expecting CI to clarify — that wastes maintainer time.
- **Title**: Clear, conventional format
+ ### Step 3.2 — For GUI / desktop apps: run real end-to-end with isolation
- ```
- feat(config): add support for YAML config files
- fix(pool): resolve race condition in connection pool
- docs(readme): update installation instructions for Windows
- refactor(validation): extract validation logic into separate module
- ```
+ For Tauri/Electron/Cocoa apps you almost certainly cannot use `pnpm dev` directly without contaminating your real installation. The pattern is **isolate the data directory first, then run the real binary**:
- **Keep PR description focused** (~50 lines):
- - Summary (1-2 sentences)
- - Root cause (technical, with code refs)
- - Changes (bullet list)
- - Why it's safe
- - Testing approach
- - Related issues
+ 1. Find the project's test-isolation hook (often `XXX_TEST_HOME`, `XXX_DATA_DIR`, or a config flag in `config.rs` / `paths.go`).
+ 2. Point it at `/tmp/<app-name>-e2e/` before launching.
+ 3. Trigger the feature through whatever real surface the user would (URL scheme, CLI arg, deeplink).
+ 4. Verify by reading the actual persisted state (SQLite, JSON files), not just by visual inspection.
+ 5. Capture screenshots of the GUI for the PR description.
- **Move detailed investigation to issue comments**, not PR.
+ The full isolation recipe, including how to trigger deeplinks via Tauri's single-instance forward without touching macOS LaunchServices, is in [`references/phase3_quality_gates_and_e2e.md`](references/phase3_quality_gates_and_e2e.md).
- ### Evidence Loop
+ ### Step 3.3 — Self-audit: did you actually do what you're about to claim?
- **Critical**: Prove the change with a reproducible fail → fix → pass loop.
+ Before writing the PR description, list every "I tested…" / "I verified…" / "I ran…" statement you intend to make. For each one, ask: "What's my evidence?" If the answer is "I think I did" or "it should work", you have not actually done it. Write only what you can defend.
- 1. **Reproduce failure** with original version
- ```bash
- # Test with original version
- npm install -g package@original-version
- [command that triggers bug]
- # Capture: error messages, exit codes, timestamps
- ```
+ This rule prevents the most damaging trust failure: a maintainer running your "tested" command and finding it doesn't work.
- 2. **Apply fix** and test with patched version
- ```bash
- # Test with fixed version
- npm install -g package@fixed-version
- [same command]
- # Capture: success output, normal exit codes
- ```
+ ## Phase 4 — PR Description Writing
- 3. **Document both** with timestamps, PIDs, exit codes, logs
+ A great PR description does three jobs: (1) lets the maintainer decide in 30 seconds whether to merge, (2) gives reviewers everything they need to verify without DM'ing you, (3) creates a written record that survives team turnover.
- 4. **Redact sensitive info**:
- - Local absolute paths (`/Users/...`, `/home/...`)
- - Secrets/tokens/API keys
- - Internal URLs/hostnames
- - Recheck every pasted block before submitting
+ ### Step 4.1 — Structure
- **Description**: Focused and reviewable (~50 lines)
+ Use this skeleton. Detailed templates and a test-coverage-matrix example are in [`references/phase4_pr_description.md`](references/phase4_pr_description.md) and [`references/communication_templates.md`](references/communication_templates.md).
- ````markdown
- ## Summary
- [1-2 sentences: what this fixes and why]
+ ```
+ ## Summary / 概述
+ <two sentences — what changed and why it matters>
- ## Root Cause
- [Technical explanation with code references]
+ ## What / 变更内容
+ <bulleted list of commits with their purpose, or files with their purpose>
- ## Changes
- - [Actual code changes]
- - [Tests added]
- - [Docs updated]
+ ## Why / 动机
+ <the problem this solves; if no prior issue, briefly justify why>
- ## Why This Is Safe
- [Explain why it won't break anything]
+ ## Test Plan / 测试计划
+ <exact commands a maintainer can run; coverage matrix for non-trivial changes>
- ## Testing
+ ## Backward Compatibility / 向后兼容
+ <state explicitly; don't make the maintainer infer>
- ### Test 1: Reproduce Bug (Original Version)
- Command: `[command]`
- Result:
- ```text
- [failure output with timestamps, exit codes]
- ```
+ ## Security Considerations
+ <only if the change touches auth, inputs, or shared state>
- ### Test 2: Validate Fix (Patched Version)
- Command: `[same command]`
- Result:
- ```text
- [success output with timestamps, exit codes]
- ```
+ ## Screenshots / 截图
+ <for UI changes — see Step 4.3>
- ## Related
- - Fixes #[issue]
- - Related: #[other issues/PRs]
- ````
+ ## Related Issue
+ <Fixes #N, or explain why no issue exists>
- **What NOT to include in PR**:
- - ❌ Detailed timeline analysis (put in issue)
- - ❌ Historical context (put in issue)
- - ❌ Internal tooling mentions
- - ❌ Speculation or uncertainty
- - ❌ Walls of text (>100 lines)
+ ## Checklist
+ <the project's PR template checklist, with real evidence of each>
- ### Code Changes Best Practices
+ ## AI-Assisted Disclosure
+ <see Step 4.4>
+ ```
- **Minimal, surgical fixes**:
- - ✅ Only change what's necessary to fix the bug
- - ✅ Add regression test to prevent future breakage
- - ✅ Update CHANGELOG if project uses it
- - ❌ Don't refactor surrounding code
- - ❌ Don't add "improvements" beyond the fix
- - ❌ Don't change unrelated files
+ ### Step 4.2 — Test coverage matrix (for non-trivial changes)
- **Example** (OpenClaw PR #39763):
- ```
- Files changed: 2
- - src/infra/process-respawn.ts (3 lines removed, 1 added)
- - src/infra/process-respawn.test.ts (regression test added)
+ When you've added more than 2 tests, present them as a table mapping each test to the behavior it locks in. This makes review much faster than reading test code:
- Result: 278K star project, clean approval
+ ```markdown
+ | Layer | Test | What it proves |
+ |---|---|---|
+ | URL parsing | `test_parse_provider_with_extra_env` | extraEnv query param extracted |
+ | Security | `test_extra_env_stringifies_scalars_and_skips_invalid_values` | bool/number stringified; null/array/object dropped |
```
- ### Separation of Concerns
+ ### Step 4.3 — Screenshots without polluting the repo
- **Issue comments**: Detailed investigation
- - Timeline analysis
- - Historical context
- - Related PRs/issues
- - Root cause deep dive
+ `gh` CLI does **not** support image attachments to PRs (the underlying upload API at `uploads.github.com` is browser-only and rejects PAT tokens). Three workable approaches:
- **PR description**: Focused on the fix
- - Summary (1-2 sentences)
- - Root cause (technical)
- - Changes (bullet list)
- - Testing validation
- - ~50 lines total
+ 1. **Preferred — let the user drag images in the GitHub web UI.** Leave clearly marked placeholders in your PR body draft (e.g. `[SCREENSHOT_1_PLACEHOLDER]`). When the user edits the PR on github.com, they drag images into the markdown, GitHub uploads them to `user-images.githubusercontent.com`, and the placeholders are replaced. Zero pollution.
+ 2. **Fallback — orphan branch on your fork.** Create an orphan branch (e.g. named `assets-pr-N-screenshots`), commit images, reference them via `raw.githubusercontent.com`. Pollutes your fork but not the PR diff.
+ 3. **Last resort — third-party image host.** Persistence + privacy are unclear; avoid for anything sensitive.
- **Separate test comment**: End-to-end validation
- - Test with original version (prove bug)
- - Test with fixed version (prove fix)
- - Full logs with timestamps
+ ### Step 4.4 — AI-Assisted Disclosure (when CONTRIBUTING.md or maintainer norms call for it)
- ### After Submitting
+ If the project's CONTRIBUTING.md mentions AI-assisted PRs, or the maintainer has commented skeptically about AI output on past PRs, add a short disclosure at the bottom of the PR body. Be specific about what you did, not vague reassurances.
- - Monitor CI results
- - Respond to feedback promptly (within 24 hours)
- - Make requested changes quickly
- - Be grateful for reviews
- - Don't argue, discuss professionally
- - If you need to update PR:
- - Add new commits (don't force push during review)
- - Explain what changed in comment
- - Re-request review when ready
+ ```markdown
+ ## AI-Assisted Disclosure
- **Professional responses**:
- ```
- ✅ "Good point! I've updated the implementation to..."
- ✅ "Thanks for catching that. Fixed in commit abc123."
- ✅ "I see what you mean. I chose this approach because...
- Would you prefer if I changed it to...?"
+ Per CONTRIBUTING.md §N:
- ❌ "That's just your opinion."
- ❌ "It works on my machine."
- ❌ "This is how I always do it."
+ 1. I have read every line; happy to walk through any function or design choice.
+ 2. Tested locally: <list actual commands you ran with their results>.
+ 3. Single-topic PR scoped to <one sentence>.
+ 4. <opened/will open> Issue #N for discussion.
+ 5. AI tools used: Claude Code for drafting; <list any others>. Final review and decisions are mine.
```
- ## Building Reputation
+ The disclosure is not magic — it doesn't excuse a bad PR. But missing it on a project that asks for it is an instant trust hit.
- ### The Contribution Ladder
+ ## Phase 5 — Post-Submission
- ```
- Level 1: Documentation fixes
- ↓ (build familiarity)
- Level 2: Small bug fixes
- ↓ (understand codebase)
- Level 3: Feature contributions
- ↓ (trusted contributor)
- Level 4: Maintainer status
- ```
+ ### Step 5.1 — Respond to automated bot reviews explicitly
- ### Consistency Over Volume
+ Modern projects use Codex, Claude bot, CodeRabbit, etc. for first-pass review. Their comments appear as **review comments on specific lines**, not as PR-level comments. Reply to each finding directly (so maintainers see the resolution next to the finding), citing the commit hash and the function/test that resolves it:
- ```
- ❌ 10 PRs in one week, then nothing
- ✅ 1-2 PRs per week, sustained
+ ```bash
+ gh api repos/<owner>/<repo>/pulls/<pr>/comments \
+ -X POST \
+ -F in_reply_to=<finding_comment_id> \
+ -f body="Addressed in commit \`<sha>\`: <function or test name>. <one-sentence explanation>. Thanks for the catch!"
```
- ### Engage Beyond PRs
+ `<finding_comment_id>` is the numeric ID from the comment's URL (`#discussion_rXXXXXXXX`). Full bot-reply workflow in [`references/phase5_post_submission.md`](references/phase5_post_submission.md).
- - Answer questions in issues
- - Help triage bug reports
- - Review others' PRs (if welcome)
- - Join project Discord/Slack
+ ### Step 5.2 — Rebase against upstream main without losing review history
- ## Common Mistakes
+ When upstream `main` advances and your PR conflicts:
- ### Don't
+ ```bash
+ git fetch origin
+ git rebase origin/main
+ # resolve conflicts file by file
+ git add <files>
+ git -c sequence.editor=: rebase --continue
+ git push fork <branch> --force-with-lease
+ ```
- - Submit drive-by PRs without investigation
- - Include detailed timeline in PR (put in issue)
- - Mention internal tooling or infrastructure
- - Argue with maintainers
- - Ignore code style guidelines
- - Make massive changes without discussion
- - Ghost after submitting
- - Refactor code unrelated to the fix
- - Add "improvements" beyond what was requested
- - Force push during review (unless asked)
+ Use `--force-with-lease`, never plain `--force`. The `lease` variant aborts if someone else (or a bot) pushed to your branch in between, which prevents you from silently destroying review threads.
- ### Do
+ If you applied a small post-review cleanup (a `--fixup` commit), squash it into the relevant commit with autosquash so the merged history stays clean. See [`references/phase2_implementation.md`](references/phase2_implementation.md) for the full sequence.
- - Investigate thoroughly BEFORE coding
- - Post detailed analysis to issue, not PR
- - Keep PR focused and minimal (~50 lines)
- - Start with small, focused PRs
- - Follow project conventions exactly
- - Add regression tests
- - Update CHANGELOG if project uses it
- - Communicate proactively
- - Accept feedback gracefully
- - Build relationships over time
- - Test with both original and fixed versions
- - Redact sensitive info from logs
+ ### Step 5.3 — When sub-agent / counter-review surfaces "findings", filter before responding
- ## Workflow Template
+ If you run a counter-review agent (or a maintainer's bot floods you with 20+ findings), don't paste them all into the PR. For each finding ask three questions:
- ```
- High-Quality Contribution Workflow:
+ | Filter | Discard if |
+ |---|---|
+ | Probability | "Could this actually happen in this codebase?" → No |
+ | Cost | "Would fixing it cost more than the risk?" → Yes |
+ | Scenario | "Is this scenario already prevented upstream?" → Yes |
- Investigation Phase:
- - [ ] Find project with "good first issue"
- - [ ] Read contribution guidelines
- - [ ] Comment on issue to claim
- - [ ] Reproduce bug with original version
- - [ ] Trace git history for context
- - [ ] Identify root cause with evidence
- - [ ] Post detailed analysis to issue
+ The point of counter-review is to surface things you didn't think of, not to mandate fixing every theoretical concern. Filter ruthlessly, then explain in the PR why you accepted vs. declined each suggestion.
- Implementation Phase:
- - [ ] Fork and set up locally
- - [ ] Make minimal, focused changes
- - [ ] Add regression test
- - [ ] Update CHANGELOG (if applicable)
- - [ ] Follow project conventions exactly
+ ## Reference Files
- Validation Phase:
- - [ ] Test with original version (prove bug exists)
- - [ ] Test with fixed version (prove fix works)
- - [ ] Document both with timestamps/logs
- - [ ] Redact paths/secrets/internal hosts
+ | File | Use for |
+ |---|---|
+ | [`references/phase1_discovery.md`](references/phase1_discovery.md) | CONTRIBUTING.md parsing, PR size baseline rubric, scope-contract templates |
+ | [`references/phase2_implementation.md`](references/phase2_implementation.md) | Fixup commit + autosquash workflow, scope-discipline anti-patterns |
+ | [`references/phase3_quality_gates_and_e2e.md`](references/phase3_quality_gates_and_e2e.md) | Isolated-home pattern, single-instance forward, SQLite verification, screencapture + window focus |
+ | [`references/phase4_pr_description.md`](references/phase4_pr_description.md) | Body skeleton, test-coverage-matrix, AI disclosure templates, screenshot placeholder pattern |
+ | [`references/phase5_post_submission.md`](references/phase5_post_submission.md) | `gh api in_reply_to` recipe, `--force-with-lease` semantics, counter-review filtering |
+ | [`references/case_study_cc-switch_pr_2634.md`](references/case_study_cc-switch_pr_2634.md) | Full real-world walkthrough including dev log, SQLite dump, screenshots |
+ | [`references/pr_checklist.md`](references/pr_checklist.md) | Original consolidated checklist (legacy; phase docs supersede the workflow sections) |
+ | [`references/project_evaluation.md`](references/project_evaluation.md) | Project health rubric for the discovery step |
+ | [`references/communication_templates.md`](references/communication_templates.md) | Issue-claim, review-response, and after-merge templates |
+ | [`references/high_quality_pr_case_study.md`](references/high_quality_pr_case_study.md) | OpenClaw PR #39763 walkthrough — small-fix case study |
- Submission Phase:
- - [ ] Write focused PR description (~50 lines)
- - [ ] Link to detailed issue analysis
- - [ ] Post end-to-end test results
- - [ ] Ensure CI passes
+ ## Anti-Patterns to Avoid
- Review Phase:
- - [ ] Respond to feedback within 24 hours
- - [ ] Make requested changes quickly
- - [ ] Don't force push during review
- - [ ] Thank reviewers
- - [ ] Celebrate when merged! 🎉
- ```
+ These are the failure modes that close PRs even when the underlying code is fine. Each one comes from a real PR.
+ 1. **Fabricated test claims.** Writing "tested locally with `pnpm dev`" when you actually only ran the unit tests. A maintainer will try it and lose trust permanently.
+ 2. **PR 5–10× the project's recent merge baseline.** Even good code at this size signals "AI dump" to many maintainers.
+ 3. **Rebase-time scope creep.** Bringing an unrelated upstream feature into your branch "while resolving conflicts" turns a fix PR into a feature PR with no warning.
+ 4. **Mixing refactors into a fix commit.** Reviewers can't tell which line caused the bug fix; either split or use a `--fixup` commit on the refactor.
+ 5. **Force-pushing without `--lease`** mid-review. Destroys review threads silently.
+ 6. **Ignoring bot review comments.** Even when the bot is wrong, reply explaining why — silence reads as "didn't notice".
+ 7. **Burying the disclosure.** AI-assisted disclosure goes in the PR body, not as a footnote in a commit message no one reads.
+ 8. **Reading CONTRIBUTING.md after writing the PR.** Half of CONTRIBUTING.md rules are about how the PR is structured, not what the code does.
+ 9. **Submitting features without an issue when the project requires one.** Even if the issue is created retroactively the same hour, the timestamp matters to maintainers.
+ 10. **Pasting raw counter-review output.** 20 findings in a PR body looks like noise. Filter, then respond.
+
## Quick Reference
- ### GitHub CLI Commands
+ ### Required gh CLI commands
```bash
- # Fork a repo
- gh repo fork owner/repo --clone
-
- # Create PR
- gh pr create --title "feat(scope): ..." --body "..."
-
- # Check PR status
- gh pr status
-
- # View project issues
- gh issue list --repo owner/repo --label "good first issue" --state=open
+ gh repo view <owner>/<repo> --json visibility,isPrivate,defaultBranchRef
+ gh pr list --repo <owner>/<repo> --state merged --limit 10
+ gh pr view <pr-number> --repo <owner>/<repo> --json title,body,commits,mergeable,reviewDecision
+ gh pr edit <pr-number> --repo <owner>/<repo> --body-file pr_body.md
+ gh api repos/<owner>/<repo>/pulls/<pr>/comments -X POST -F in_reply_to=<id> -f body="..."
```
- ### Commit Message Format
+ ### Conventional Commits cheat sheet
```
- <type>(<scope>): <description>
-
- [optional body]
-
- [optional footer]
+ feat(<scope>): user-visible new behavior
+ fix(<scope>): user-visible bug fix
+ refactor(<scope>): no behavior change
+ docs(<scope>): documentation only
+ test(<scope>): tests only
+ chore(<scope>): tooling / build / housekeeping
+ perf(<scope>): measurable performance change
+ ci(<scope>): CI config only
```
- Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
-
- ## References
-
- - `references/pr_checklist.md` - Complete PR quality checklist
- - `references/project_evaluation.md` - How to evaluate projects
- - `references/communication_templates.md` - Issue/PR templates
- - `references/high_quality_pr_case_study.md` - Real-world successful PR walkthrough (OpenClaw #39763)
-
- ## Success Indicators
-
- You know you have a high-quality PR when:
-
- - ✅ Maintainers understand the problem immediately
- - ✅ Reviewers can verify the fix easily
- - ✅ CI passes on first try
- - ✅ No "can you explain..." questions
- - ✅ Minimal back-and-forth
- - ✅ Quick approval
-
- ## Key Metrics for Quality PRs
+ ### Key metrics for a high-quality PR
- Based on successful contributions to major projects:
+ Based on successful contributions to active projects:
- - **Files changed**: 1-3 (focused scope)
- - **Lines changed**: 10-50 (minimal fix)
- - **PR description**: ~50 lines (concise)
- - **Issue investigation**: 100-300 lines (thorough)
- - **Time to first draft**: 2-3 days (proper investigation)
- - **Time to ready**: 3-5 days (including validation)
- - **Response time**: <24 hours (professional)
+ - Files changed: 1-5 for fixes, up to ~15 for features with tests
+ - Production code diff: under 200 lines if possible; rest is tests / docs
+ - PR description: 200-600 lines including evidence; matrix tables welcome
+ - First-response time to bot/maintainer: under 24h
+ - CI passing on first push: target
+ If your PR misses two or more of these by a lot, re-read Phase 1 before submitting.