Skip to main content
ClaudeWave
Skill55 repo starsupdated 2mo ago

oss-prep-to-contribute

|

Install in Claude Code
Copy
git clone --depth 1 https://github.com/chiruu12/OSS-Skills /tmp/oss-prep-to-contribute && cp -r /tmp/oss-prep-to-contribute/skills/oss-prep-to-contribute ~/.claude/skills/oss-prep-to-contribute
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Prep to Contribute

Get ready to contribute. not by writing code, but by understanding what you're walking into. This skill reads the rules, checks if you're eligible, figures out what you don't know yet, and fills those gaps.

## Purpose

Most rejected PRs fail before the first line of code. wrong branch, wrong style, missing CLA, or solving a problem the maintainer didn't actually want solved. This skill front-loads that understanding so you don't waste effort. It also checks what YOU know, because contributing to a codebase you don't understand produces garbage contributions.

## Prerequisites

- A specific repo to contribute to
- An issue to work on (ideally from `oss-find-issue`)
- `gh` CLI authenticated

## Process

### 1. Read the rules

Read every contribution-relevant doc in the repo. Not skim. read:

```bash
# Core docs (check both root and .github/)
for doc in CONTRIBUTING.md CODE_OF_CONDUCT.md README.md CLAUDE.md ARCHITECTURE.md DEVELOPMENT.md; do
  for path in "$doc" ".github/$doc" "docs/$doc"; do
    gh api "repos/{owner}/{repo}/contents/$path" --jq '.content' 2>/dev/null | base64 -d 2>/dev/null && echo "--- Found: $path ---"
  done
done
```

Extract and present to the user in structured form:

```
## Contribution Requirements for {repo}

**Eligibility**: {open to all / CLA required / org members only / unclear}
**CLA**: {none / required. link to sign}
**Dev setup**: {step-by-step from their docs}
**Branch convention**: {e.g., "feature/issue-123-description"}
**Commit convention**: {e.g., "conventional commits", "no squash", "sign-off required"}
**PR process**: {template required? reviewers auto-assigned? CI must pass?}
**Test requirements**: {must add tests? coverage threshold? specific framework?}
**Communication**: {Discord/Slack/mailing list for questions}
**Response time**: {typical PR review turnaround based on recent merged PRs}
```

### 2. Verify contribution eligibility

This is a hard gate. Check:

- **CLA status**: If required, has the user signed it? If not, point them to the signing process.
- **External contributor policy**: Some repos have explicit policies. Check recent merged PRs from non-members.
- **Issue assignment policy**: Some repos require maintainer assignment before you start working.

```bash
# Check recent external contributor success rate
gh pr list -R {owner}/{repo} --state merged --limit 30 \
  --json author,authorAssociation,mergedAt | \
  jq '[.[] | select(.authorAssociation == "NONE" or .authorAssociation == "CONTRIBUTOR")] | length'
```

If zero external PRs merged in the last 30 merged PRs, **warn the user**: "This repo doesn't appear to merge external contributions frequently. You may want to ask in their communication channel before investing time."

### 3. Map the codebase architecture

Use Explore agents to build a structural map:

- Entry points (main files, router definitions, CLI commands)
- Directory layout and what each top-level dir contains
- Key abstractions (interfaces, base classes, core types)
- Test location and framework
- Build system and CI pipeline

Present as a concise summary. not a file dump. The user needs a mental model, not a directory listing.

```
## Codebase Map

**Stack**: {language, framework, key deps}
**Architecture**: {pattern in one sentence. e.g., "layered: routes → services → models"}
**Entry point**: {file path}
**Where the issue lives**: {directory/module relevant to their issue}
**Test framework**: {jest/pytest/cargo test/etc.}
**CI**: {GitHub Actions / CircleCI / etc. What runs on PR}
```

### 4. Knowledge check

This is where the skill earns its value. Ask the user targeted questions about what they need to know for THIS specific contribution. One question at a time.

**Pattern**: Ask → If they know it, move on → If they don't, explain concisely + point to where to learn more.

Questions to ask (adapt based on the issue):

- "This repo uses {framework}. Are you comfortable with {specific concept the issue touches}?"
- "The issue involves {area}. Can you explain how {relevant concept} works in this codebase?"
- "The test suite uses {framework}. Have you written tests with it before?"
- "The PR process requires {specific thing. e.g., signed commits, conventional commit messages}. Do you know how to set that up?"

**Do NOT dump all questions at once.** Ask one, process the answer, then ask the next. Each question builds on the previous.

For each gap identified:
- Give a 2-3 sentence explanation of the concept
- Point to the specific file/code in the repo that demonstrates it
- Optionally link to external docs if the concept is framework-specific

### 5. Trace the issue's code path

Now connect the issue to the actual code:

```bash
# Search for keywords from the issue
grep -r "keyword_from_issue" src/ --include="*.ts" --include="*.py" --include="*.go" --include="*.rs" -l

# Check git history for the relevant area
git log --oneline -10 -- "path/to/relevant/files"

# Find related tests
find . -name "*test*" -o -name "*spec*" | xargs grep -l "relevant_function" 2>/dev/null
```

Present:
- The exact files involved (with file:line references)
- How the code flows through the issue's area
- What tests already exist for this code
- What adjacent code might be affected

### 6. Thinking gate: user explains the plan

Before moving to actual contribution, the user must articulate:

> "Now that you've seen the codebase and the issue. explain to me in your own words:
> 1. What is the repo's architecture? (Look at the codebase map above. describe it in one sentence)
> 2. What does the issue ask for? (Restate it, don't just copy the title)
> 3. Where in the code does this need to change? (I showed you the relevant files. which ones and why?)
> 4. What's your rough plan? (Not the full implementation. just the high-level approach)"

**If the user can't answer these**, they're not ready. Go back to step 4 and fill more gaps. Do NOT let them proceed to coding without this understanding. it's the whole point.

If th