Co-Pilot / 辅助式
更新于 25 days ago

skill-open-source-contribution

Rronantakizawa
0.0k
ronantakizawa/skill-open-source-contribution
86
Agent 评分

💡 摘要

该技能指导开发人员完成开源贡献过程,从寻找项目到撰写有效的拉取请求。

🎯 适合人群

希望参与开源的新开发人员希望提升贡献技能的经验丰富的开发人员寻求改善贡献者互动的项目维护者记录贡献过程的技术作家教授开源实践的软件工程教育工作者

🤖 AI 吐槽:看起来很能打,但别让配置把人劝退。

安全分析中风险

风险:Medium。建议检查:是否执行 shell/命令行指令;是否发起外网请求(SSRF/数据外发);API Key/Token 的获取、存储与泄露风险。以最小权限运行,并在生产环境启用前审计代码与依赖。


name: open-source-contribution description: Guides developers through open source contributions including finding projects, writing PRs, conventional commits, and communicating with maintainers. Covers enterprise standards (Linux Kernel, Apache) and security disclosure. Use when contributing to GitHub/GitLab projects, writing commit messages, responding to code review, or reporting vulnerabilities.

Contributing to Open Source

Quick Navigation

| Topic | Description | |-------|-------------| | Finding Projects | Resources and labels for finding issues | | Understanding Codebases | How to navigate unfamiliar code | | Writing PRs | Branch strategy, commits, descriptions | | Code Review | How to handle feedback | | Communicating with Maintainers | Principles and templates | | Maintainer Perspective | What maintainers want | | Common Mistakes | Anti-patterns to avoid | | What Counts as Meaningful | High-value contributions |

Reference Files:

Templates:


Finding Projects

Resources

Labels to Look For

| Label | Meaning | |-------|---------| | good first issue | GitHub's official beginner label | | first-timers-only | Reserved for first-time contributors | | help wanted | Maintainers actively seeking help | | documentation | Often good entry points |

Evaluating a Project

Before contributing, verify:

  • Has an OSI-approved open source license
  • Recent commits (within last 3 months)
  • Maintainers respond to issues/PRs
  • Has CONTRIBUTING.md or contribution guidelines
  • Automated tests (CI/CD) exist

Understanding Large Codebases

Step 1: Documentation First

Read in order: README.md → CONTRIBUTING.md → Architecture docs → API docs

Step 2: Build and Run Locally

git clone https://github.com/<owner>/<repo>.git cd <repo> # Follow setup instructions, run tests

Step 3: Explore Strategically

Find important files:

git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -20

Understand entry points: Look for main, index, app, or server files.

Read tests: They document expected behavior and show component usage.

Step 4: Focus on Your Target

Don't try to understand everything:

  1. Identify the module related to your issue
  2. Read that module thoroughly
  3. Trace dependencies one level up and down
  4. Treat unrelated code as "black boxes"

Step 5: Use Git as Documentation

git log --oneline <file> # File history git log --grep="<keyword>" # Find relevant PRs git blame <file> # Who to ask

Writing Effective Pull Requests

Before You Start

  1. Claim the issue: Comment to let maintainers know you're working on it
  2. Ask questions: If requirements are unclear, ask before coding
  3. Check for duplicates: Search existing PRs

Forking Workflow

For projects where you don't have write access:

# 1. Fork on GitHub, then clone your fork git clone https://github.com/YOUR-USERNAME/<repo>.git cd <repo> # 2. Add upstream remote git remote add upstream https://github.com/ORIGINAL-OWNER/<repo>.git # 3. Keep fork updated git fetch upstream git checkout main git merge upstream/main # 4. Create feature branch and work git checkout -b fix/your-fix # ... make changes ... git push origin fix/your-fix # 5. Open PR from your fork to upstream

Branch Strategy

git checkout -b <type>/<short-description> # Examples: git checkout -b fix/null-pointer-exception git checkout -b feat/add-dark-mode git checkout -b docs/update-readme

Commit Messages

Follow Conventional Commits:

<type>[scope]: <description>

[optional body]

[optional footer]

Quick reference:

| Type | Use For | |------|---------| | feat | New feature | | fix | Bug fix | | docs | Documentation | | refactor | Code restructure | | test | Tests | | chore | Maintenance |

Example:

fix(auth): resolve token refresh race condition

Fixes #123

For complete guide: See reference/conventional-commits.md

PR Description Template

## Summary Brief description of what this PR does and why. ## Changes - Change 1 - Change 2 ## Related Issues Fixes #123 ## Testing - [ ] Existing tests pass - [ ] Added new tests - [ ] Manually tested

PR Sizing Best Practices

Research shows smaller PRs get better reviews:

| Size | Lines Changed | Review Quality | |------|---------------|----------------| | Ideal | ~50 lines | Thorough review | | Good | <200 lines | Good feedback | | Acceptable | <400 lines | Adequate review | | Too Large | 400+ lines | Likely to miss issues |

PR Best Practices

  • One concern per PR: Don't mix features, fixes, and refactors
  • Self-review first: Read your own diff before requesting review
  • Use draft PRs: Open early for feedback on approach
  • Include tests: Maintainers rarely merge untested code
  • Respond promptly: Don't let PRs go stale

What NOT to Include in PRs

Remove before committing:

  • .env, .env.local, credentials, API keys
  • IDE/editor configs (.idea/, .vscode/ unless project-standard)
  • Personal notes, TODOs, planning files
  • Debug code, console.logs, print statements
  • Unrelated formatting changes
  • Large binary files, screenshots (unless required)

Check for secrets before pushing:

# Search for common secret patterns git diff --cached | grep -iE "(api_key|password|secret|token).*="

GitHub CLI Essentials

# Create PR interactively gh pr create # Create PR with title and body gh pr create --title "Fix: resolve null pointer" --body "Fixes #123" # Create draft PR gh pr create --draft # Check PR status gh pr status # View PR in browser gh pr view --web

Responding to Code Review

Mindset

Code review is collaborative, not adversarial. Reviewers want to help improve the code.

Response Templates

When you agree:

Good catch! Fixed in [commit hash].

When you need clarification:

I want to make sure I understand—are you suggesting [X] because of [Y]?

When you disagree:

I went with [current approach] because:
- [Reason 1]
- [Reason 2]

Open to changing if you think [alternative] better serves the project.

When asked for big changes:

Great suggestion. Would it make sense to address this in a follow-up PR?

Guidelines

  • Address all comments
  • Stay calm—step away if frustrated
  • Re-request review after addressing feedback

Communicating with Maintainers

Principles

  • Keep communication public (others benefit)
  • Be concise (maintainers have limited time)
  • Do homework first (search existing issues)
  • Be patient (follow up after one week, politely)

Bug Report Template

## Description Clear description of the bug. ## Steps to Reproduce 1. Step 1 2. Step 2 3. See error ## Expected vs Actual Behavior Expected: X Actual: Y ## Environment - OS: [e.g., macOS 14.0] - Version: [e.g., v2.1.0]

Feature Request Template

## Summary What you're proposing. ## Problem What problem this solves. ## Proposed Solution How you envision it working. ## Alternatives Considered Other approaches you considered.

Understanding Maintainer Perspective

What Maintainers Deal With

  • Overwhelm: Popular projects receive hundreds of issues/PRs
  • Volunteer work: Most maintainers aren't paid
  • Burnout: Endless notifications and demanding users
  • Quality gates: Must protect codebase from bugs and technical debt

What Maintainers Want

  1. Contributors who read the docs first
  2. Well-tested code
  3. Clear communication about what and why
  4. Patience (days or weeks to respond is normal)
  5. Follow-through (don't abandon PRs mid-review)

Quotes from Experienced Maintainers

"The best good first issue is the one you created yourself. Try going through the product, and in the process of testing and understanding it, you'll find your good first issue."

"All the projects I've contributed to are things I've used in some way. I never saw the point of just 'showing up' to a project."


Common Mistakes to Avoid

Before Starting

  1. Skipping CONTRIBUTING.md: Always read contribution guidelines first
  2. Not checking existing work: Search PRs/issues for duplicates
  3. Working on assigned issues: Check if someone is already on it
  4. Building unsolicited features: Propose in an issue first, wait for approval
  5. Not understanding the project: Use it before contributing to it

During Development

  1. Working on main branch: Always use feature branches
  2. Giant PRs: Break into smaller, focused PRs (<200 lines ideal)
  3. No tests: Maintainers rarely merge untested code
  4. Including secrets: Check for API keys, passwords, tokens
  5. **Committing debug c
五维分析
清晰度9/10
创新性7/10
实用性10/10
完整性9/10
可维护性8/10
优缺点分析

优点

  • 提供全面的开源贡献指导
  • 涵盖技术和沟通方面
  • 包括常见任务的模板
  • 解决常见的陷阱和错误

缺点

  • 可能会让初学者因信息过多而感到不知所措
  • 假设用户熟悉Git和GitHub
  • 某些概念缺乏具体示例
  • 不针对小众开源项目量身定制

相关技能

pytorch

S
toolCode Lib / 代码库
92/ 100

“它是深度学习的瑞士军刀,但祝你好运能从47种安装方法里找到那个不会搞崩你系统的那一个。”

agno

S
toolCode Lib / 代码库
90/ 100

“它承诺成为智能体领域的Kubernetes,但得看开发者有没有耐心学习又一个编排层。”

nuxt-skills

S
toolCo-Pilot / 辅助式
90/ 100

“这本质上是一份组织良好的小抄,能把你的 AI 助手变成一只 Nuxt 框架的复读机。”

免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。

版权归原作者所有 ronantakizawa.