Comprehensive guide for contributing to the Next.js open source project, including development setup, testing, documentation, and best practices for submitting pull requests.
A comprehensive guide for contributing to the Next.js open source project. This skill helps you understand the contribution workflow, set up your development environment, write tests, add documentation, and submit high-quality pull requests to the Next.js repository.
This skill provides step-by-step guidance for:
1. **Research Existing Work**
- Search [existing PRs](https://github.com/vercel/next.js/pulls) for similar submissions
- Check [open issues](https://github.com/vercel/next.js/issues) for related discussions
- Watch the [40-minute contribution walkthrough video](https://www.youtube.com/watch?v=cuoNzXFLitc)
- Review Vercel's [Commitment to Open Source](https://vercel.com/oss)
2. **Understand the Scope**
- Identify if your contribution is a bug fix, new feature, documentation improvement, or test addition
- Read the relevant sections below based on your contribution type
1. **Fork and Clone**
- Fork the [Next.js repository](https://github.com/vercel/next.js)
- Clone your fork locally: `git clone https://github.com/YOUR_USERNAME/next.js.git`
- Add upstream remote: `git remote add upstream https://github.com/vercel/next.js.git`
2. **Install Dependencies**
- Ensure you have Node.js and pnpm installed
- Run `pnpm install` in the repository root
- Refer to `contributing/core/developing.md` for detailed setup instructions
3. **Understand the Structure**
- Review the repository structure and key directories
- Familiarize yourself with the linting rules (`contributing/repository/linting.md`)
- Understand the triaging process (`contributing/repository/triaging.md`)
**For Bug Fixes or Features:**
1. **Create a Branch**
- Create a descriptive branch name: `git checkout -b fix/issue-description` or `git checkout -b feat/feature-name`
2. **Make Your Changes**
- Follow the coding standards and linting rules
- Write clean, well-documented code
- Refer to `contributing/core/developing.md` for development best practices
- For new features, consult `contributing/core/adding-features.md`
3. **Build Locally**
- Run `pnpm build` to compile Next.js
- Follow instructions in `contributing/core/building.md` for detailed build steps
- Test your changes with a local app (`contributing/core/developing-using-local-app.md`)
4. **Write Tests**
- Add or update tests for your changes
- Run tests with `pnpm test` or relevant test commands
- Ensure all tests pass before submitting
- Follow guidelines in `contributing/core/testing.md`
5. **Add Error Links (if applicable)**
- If adding new error messages, follow `contributing/core/adding-error-links.md`
**For Documentation:**
1. **Review Documentation Standards**
- Read `contributing/docs/adding-documentation.md` for style and format guidelines
2. **Make Your Changes**
- Add or update documentation in the `docs/` directory
- Ensure clarity, accuracy, and consistency with existing docs
3. **Preview Locally**
- Build and preview documentation locally to verify formatting
1. **Commit Your Changes**
- Write clear, descriptive commit messages
- Follow conventional commit format if applicable
2. **Push to Your Fork**
- Push your branch: `git push origin your-branch-name`
3. **Open a Pull Request**
- Go to the Next.js repository and open a PR from your fork
- Follow the PR description template (`contributing/repository/pull-request-descriptions.md`)
- Provide a clear title and detailed description
- Reference any related issues with `Fixes #issue-number` or `Closes #issue-number`
4. **Respond to Feedback**
- Monitor your PR for review comments
- Make requested changes promptly
- Push additional commits to address feedback
1. **Stay Engaged**
- Respond to reviewer questions and comments
- Be patient—large projects like Next.js receive many contributions
2. **Learn from the Process**
- Use feedback to improve future contributions
- Consider helping with triaging or reviewing other PRs
Your contribution is ready when:
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/nextjs-contributing-guide/raw