---
name: go-contributor
description: Helps with contributing to the Go project. Use when you need to format or check a commit message for Go standards or interact with Gerrit using the `git-codereview` tool.
license: Apache-2.0
metadata:
  category: development
  tags: [go, gerrit, git, contribution]
allowed-tools: [git, git-codereview, bash]
compatibility:
  gemini-cli: ">=0.30.0"
---

# Go Contributor Skill

This skill helps you follow the Go contribution process, specifically focusing on commit message formatting and interaction with Gerrit.

## Workflows

### 1. Formatting a Commit Message

A good Go commit message follows a strict format:

- **First Line**: Prefix with package (e.g., `math: `). Summary should complete "This change modifies Go to _____." No leading capital, no trailing period.
- **Body**: Detailed context, wrap at 72 columns, blank line after first line.
- **Issues**: Use `Fixes #12345` or `Updates #12345`. For x/ repositories, use `Fixes golang/go#12345`.

See [references/commit_message_template.md](references/commit_message_template.md) for more details.

### 2. Checking a Commit Message

You can use the provided script to validate a commit message:

```bash
./scripts/check_commit_msg.sh <commit_msg_file>
```

### 3. Interacting with Gerrit

Use the `git-codereview` tool (often aliased to `git`).

- `git codereview change`: Create or amend a single commit in your branch.
- `git codereview mail`: Send your changes to Gerrit for review.
- `git codereview sync`: Sync your local branch with the master.
- `git codereview submit`: Submit an approved change (usually done by maintainers).

## Additional Resources

- **Gerrit Review Voting**:
  - `+1`: Looks good, but may need minor changes or reviewer is not an approver.
  - `+2`: Approved for merge (only by maintainers).
  - `Hold +1`: Do not submit yet.
- **Trybots**: Triggered by maintainers to run full test suite. Failures must be fixed and re-uploaded.

## Common Shortcuts

Add these to your `.gitconfig`:

```text
[alias]
    change = codereview change
    gofmt = codereview gofmt
    mail = codereview mail
    pending = codereview pending
    submit = codereview submit
    sync = codereview sync
```
