agentleFS
y-miyazakiy-miyazaki/config/.agents/skills/go-validation/SKILL.md

go-validation

Skill1 starsChanged 10 days agoApache-2.0View on GitHub

Validate Go formatting, linting, tests, and vulnerabilities for maintainable and secure code delivery. Use when committing Go changes, running CI validation, or debugging failing checks in repositories.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    run deterministic Go validation before commit or merge

    line 37
  2. Distinctive:

    check blocking validation status and the (non-blocking) coverage threshold warning

    line 39
  3. Very specific:

    Use --verbose to collect tool-level diagnostics.

    line 60
  4. Very specific:

    Use --fix only for formatting, go mod tidy, and linter auto-fixes, then review diffs.

    line 61

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Input

  • Go path or directory (required)
  • Validation script (required): scripts/validate.sh (run from the go-validation skill directory)
  • --fix (optional): applies go mod tidy and golangci-lint auto-fixes in place
  • --verbose (optional): tool-level diagnostics and benchmark tests
  • --skip-tests (optional): skip go test, race, and coverage checks
  • --dry-run (optional): print planned commands without running them

Output Specification

Return structured Markdown in accordance with references/common-output-format.md. That file is the source of truth for the output contract.

Structured validation results in fixed tool order.

Execution Scope

  • Always use scripts/validate.sh for comprehensive validation. Do not run individual commands.
  • Individual commands are for debugging only (see references/common-individual-commands.md).
  • The script runs every step even after a failure (no fail-fast); see references/common-checklist.md for order and skip conditions.
  • Do not modify source files except through --fix.
  • Do not create or delete files.

USE FOR:

  • run deterministic Go validation before commit or merge
  • reproduce CI failures for Go format/lint/test/vulnerability checks
  • check blocking validation status and the (non-blocking) coverage threshold warning

DO NOT USE FOR:

  • perform architecture or design reviews
  • generate new source code as a primary task
  • validate non-Go projects

Reference Files Guide

  • common-checklist.md (always read)
  • common-output-format.md (always read)
  • common-troubleshooting.md (read on failure)
  • common-individual-commands.md (read on debugging)
  • category-security.md (read on failure)
  • category-testing.md (read on failure)

Workflow

  1. Run bash scripts/validate.sh.
  2. For fast iteration, run bash scripts/validate.sh <path> where <path> is a Go package or directory.
  3. Use --verbose to collect tool-level diagnostics.
  4. Use --fix only for formatting, go mod tidy, and linter auto-fixes, then review diffs.
  5. Retry at most 2 times after fixes; if checks still fail, return blocking failures and stop.

Error Handling

ConditionSeverityAction
scripts/validate.sh missingFatalStop; report missing script
No Go files under target pathInfoScript exits non-zero before any check (No Go files found); report no reviewable Go code and stop
go or golangci-lint missingFatalStop; report the missing binary; set Status: ❌ FAIL
govulncheck missingRecoverableScript logs govulncheck not installed and skips it, but its final Result block still prints ✅ for govulncheck; trust the warning and report govulncheck as ⊘ Skipped (not installed)
Single tool fails, others succeedRecoverableReport every tool; mark the failed tool ❌ Fail with exit status
All tools failFatalSet Status: ❌ FAIL with per-tool stderr summaries in ## Error Details
common-checklist.md unavailableFatalStop; report missing dependency
common-output-format.md unavailableRecoverableNote missing file; emit ## Summary, ## Tool Results, and ## Error Details only

Examples

  • Prompt: Validate Go formatting, lint, tests, and vulnerabilities
  • Command: bash scripts/validate.sh --verbose
  • Result: Structured report per references/common-output-format.md (per-tool pass/fail).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.