Skip to content
Back to skills

Write Go Code

ASecurity

Apply Go style from Google's guide, Effective Go, and Code Review Comments, plus Cobra CLI behavior. Use when writing, reviewing, or refactoring Go.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 2, 2026
ai-agentsgotestingrefactoringgit

Works with

  • cli

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned October 2, 2026

npx -y skills add cboone/agent-harness-plugins --skill write-go-code --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Write Go Code?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Write Go Code
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/cboone-write-go-code/badge)](https://www.skillsdirectory.com/skills/cboone-write-go-code)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: write-go-code
description: >-
  Apply Go style from Google's guide, Effective Go, and Code Review Comments,
  plus Cobra CLI behavior. Use when writing, reviewing, or refactoring Go.
---

# Write Go Code

## Core Principles

1. **Clarity over cleverness** - Code should be obvious to readers
1. **Simplicity** - Accomplish goals in the most straightforward way
1. **Consistency** - Match surrounding code and project conventions
1. **Minimal indentation** - Handle errors early, keep happy path unindented

## Workflow

1. Run automated checks (`make lint`, `make fmt` or `gofmt`, `goimports`)
1. Review against essential checklist: `references/essential/checklist.md`
1. For specific questions, consult: `references/comprehensive/{topic}.md`
1. When creating or editing Cobra root commands, consult: `references/comprehensive/cobra.md`

## Reference Navigation

**Quick reviews (default):**

- `references/essential/checklist.md` - Condensed, actionable rules

**Deep dives by topic:**

- `references/comprehensive/naming.md` - Package names, identifiers, receivers
- `references/comprehensive/errors.md` - Error handling, panic/recover
- `references/comprehensive/concurrency.md` - Goroutines, channels, context
- `references/comprehensive/testing.md` - Test quality and patterns
- `references/comprehensive/code-organization.md` - Imports, packages, structure
- `references/comprehensive/data-types.md` - new vs make, slices, maps
- `references/comprehensive/functions.md` - Multiple returns, defer
- `references/comprehensive/interfaces.md` - Embedding, type assertions
- `references/comprehensive/makefile-conventions.md` - Required CI targets, fmt vs format
- `references/comprehensive/cobra.md` - Cobra root command usage templates

## Pull Request Review

When reviewing a pull request, apply `./references/review-checklist.md`: the rules of this guide that a reviewer can check in a diff, ranked as Important, Nits and Do not flag. The same checklist is installed into repositories for automated reviewers, so update it whenever a rule here changes.

## Sources

- [Effective Go](https://go.dev/doc/effective_go)
- [Google Go Style Guide](https://google.github.io/styleguide/go/)
- [Go Code Review Comments](https://go.dev/wiki/CodeReviewComments)

Files in this skill

  • SKILL.md2.2 KB
  • references/comprehensive/cobra.md5.4 KB
  • references/comprehensive/code-organization.md3.6 KB
  • references/comprehensive/concurrency.md3.5 KB
  • references/comprehensive/data-types.md3.8 KB
  • references/comprehensive/errors.md3.2 KB
  • references/comprehensive/functions.md4.2 KB
  • references/comprehensive/interfaces.md4.8 KB
  • references/comprehensive/makefile-conventions.md1.7 KB
  • references/comprehensive/naming.md3.1 KB
  • references/comprehensive/testing.md3.2 KB
  • references/essential/checklist.md4.4 KB
  • references/review-checklist.md4.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…