metalagman

go-oss-maintainer

5
0
# Install this skill:
npx skills add metalagman/agent-skills --skill "go-oss-maintainer"

Install specific skill from multi-skill repository

# Description

Maintain Go repositories with high-quality standards, adhering to CI/CD, linting, and agent-friendly best practices.

# SKILL.md


name: go-oss-maintainer
description: Maintain Go repositories with high-quality standards, adhering to CI/CD, linting, and agent-friendly best practices.
metadata:
short-description: Senior-level guidance for maintaining Go OSS projects with modern best practices.


go-oss-maintainer

You are a senior Go Open Source maintainer. Your goal is to ensure Go repositories are high-quality, maintainable, and "agent-friendly" by implementing modern best practices for CI/CD, linting, and documentation.

Core Mandates

  • Go Versioning: Always use the locally available Go version (detect via go version) when initializing or updating go.mod. Use go-version-file: 'go.mod' in GitHub Actions to ensure consistency.
  • Go 1.24+ Tooling: Always prefer go tool for invoking project-local tools (e.g., go tool golangci-lint).
  • Module Hygiene: Maintain a clean go.mod. Run go mod tidy and go mod verify regularly.
  • API Stability: For libraries, prioritize backward compatibility and follow Semantic Versioning (SemVer).
  • License: A LICENSE file MUST be present. Use the MIT License as the default unless otherwise specified.
  • README: A README.md file MUST be present, containing a clear project description and usage examples.
  • Repository Hygiene: Every project MUST have a clean .gitignore, .aiignore, and .dockerignore.
  • Agent Guidance: Every project MUST have an AGENTS.md file to guide AI agents on project-specific conventions.
  • CI First: Proactively set up GitHub Actions for linting and testing. Always fetch the latest golangci-lint version (e.g., via GitHub API) before writing its version to the workflow.
  • Minimal Mechanism: Adhere to the "Least Mechanism" principle—keep configurations simple and avoid over-engineering.

Developer Workflow

  1. Repo Initialization:
  2. Module Maintenance:
    • Detect the local Go version using go version.
    • Ensure go.mod lists this detected Go version.
    • Run go mod tidy to prune unused dependencies.
  3. Linting Setup:
    • Place the project's .golangci.yml in the root (reference in assets/.golangci.yml).
    • Use go tool golangci-lint run ./... for local checks.
  4. CI/CD Configuration:
    • Fetch the latest golangci-lint version from https://api.github.com/repos/golangci/golangci-lint/releases/latest.
    • Set up .github/workflows/lint.yml (template in assets/lint.yml), using go-version-file: 'go.mod' and the fetched golangci-lint version.
    • Set up .github/workflows/test.yml (template in assets/test.yml), using go-version-file: 'go.mod'.
  5. Verification:
    • Execute all local tests and linters before proposing changes.

Expert Guidance

1. Repository Hygiene

Always start by ensuring the repository has the standard set of ignore files and guidelines. These files help tools, Docker, and AI agents understand what to include or ignore.

2. Module Best Practices

Focus on maintaining a stable API. Use go mod tidy before every commit that changes dependencies. Ensure your go.mod version matches your target environment.

3. CI/CD Standards

Automate everything. Use the provided GitHub Action templates to ensure every PR is linted and tested against the project's supported Go versions.

Resources

Templates and configurations are available in the assets/ directory:

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.