| name | go-validation |
| description | 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. |
| license | Apache-2.0 |
| metadata | {"author":"y-miyazaki","version":"1.0.1"} |
Input
- Go path or directory (required)
- Validation script:
scripts/validate.sh (required, run from the go-validation skill directory)
- Optional flags:
--fix, --verbose
Output Specification
Return structured Markdown in accordance with references/common-output-format.md.
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).
- Do not review code design decisions (use go-review).
- Do not modify source files except
--fix formatting.
- 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
- verify coverage threshold and blocking validation status
DO NOT USE FOR:
- perform architecture or design reviews (use
go-review)
- generate new source code as a primary task
- validate non-Go projects
Reference Files Guide
Workflow
- Run
bash scripts/validate.sh.
- For fast iteration, run
bash scripts/validate.sh <path> where <path> is a Go package or directory.
- Use
--verbose to collect tool-level diagnostics.
- Use
--fix only for formatting issues, then review diffs.
- Retry at most 2 times after fixes; if checks still fail, return blocking failures and stop.
Error Handling
| Condition | Severity | Action |
|---|
scripts/validate.sh missing | Fatal | Stop; report missing script |
| No Go files under target path | Info | Report no reviewable Go code; stop |
| Single tool fails, others succeed | Recoverable | Report passing tools; defer failed tool with exit status |
| All tools fail | Fatal | Return status: failed with per-tool stderr summaries |
common-checklist.md unavailable | Fatal | Stop; report missing dependency |
common-output-format.md unavailable | Recoverable | Use inline output contract |
Examples
- Prompt:
Validate Go checks and report summary, tool results, and error details.
- Command:
bash scripts/validate.sh ./test/go/ --verbose
- Output:
## Checks Summary with per-tool pass/fail and coverage value.