ring:dev-verify-code

Installation
SKILL.md

Verify Code

Atomic code verification for Go projects. Run everything, get a verdict.

This skill only REPORTS — it does NOT fix anything.


Step 0: Discover Available Commands

Before running any checks, discover what is available in the project.

MUST perform these checks:

  1. Verify go.mod exists — if not, STOP and report: "Not a Go project."
  2. Read Makefile (if present) to discover available targets
  3. Check tool availability: goimports, gofmt (both ship with Go toolchain; goimports may need install)

Command Discovery from Makefile:

Default Command Makefile Override How to Detect
go vet ./... make vet Check if vet: target exists
goimports -l . make imports Check if imports: target exists
gofmt -l . make fmt or make format Check if fmt: or format: target exists
make lint make lint Check if lint: target exists
make generate-docs make generate-docs or make docs Check if target exists
make test-unit make test-unit or make test Check if target exists
make test-integration make test-integration Check if target exists
make test-e2e make test-e2e Check if target exists

If a Makefile target does not exist, fall back to the default command. If neither exists, mark that check as SKIP.


Phase 1: Static Analysis + Unit Tests (parallel)

Run all Phase 1 commands simultaneously using parallel Bash tool calls. Capture stdout, stderr, exit code, and duration for each.

# Check Default Command Notes
1 Lint make lint golangci-lint or equivalent
2 Vet go vet ./... Suspicious constructs the compiler misses
3 Imports goimports -l . FAIL if any output (listed files need fixing)
4 Format gofmt -l . FAIL if any output (listed files need formatting)
5 Docs make generate-docs FAIL if it modifies files (docs were stale)
6 Unit Tests make test-unit Full test suite — do NOT use -short flag

Execution rules:

  • MUST run all 6 in parallel (use parallel Bash tool calls)
  • Capture output of each independently
  • goimports -l . and gofmt -l . FAIL if they produce any output (listed files need fixing)
  • If make generate-docs modifies files, report which files changed — docs were stale
  • If a command is unavailable (no Makefile target, tool not installed), mark as SKIP

Phase 1 gate:

  • ALL 6 pass → proceed to Phase 2
  • ANY fails → still proceed to Phase 2, but final verdict will be NEEDS_FIX

Phase 2: Integration + E2E Tests (sequential)

Run sequentially. Continue even if one fails.

# Check Default Command Notes
7 Integration Tests make test-integration DB, external services, testcontainers
8 E2E Tests make test-e2e Full user flows

Execution rules:

  • MUST run make test-integration first
  • Regardless of result, MUST run make test-e2e next
  • Capture output, exit code, and duration for each
  • If a Makefile target does not exist, mark as SKIP (not a failure)

Phase 3: Executive Summary

After both phases complete, present the summary to the user.

Summary Format

============================================
  VERIFICATION SUMMARY
============================================

Phase 1 — Static Analysis + Unit Tests: PASS / FAIL
Phase 2 — Integration + E2E Tests:      PASS / FAIL / SKIP
Total time: Xs

┌───┬──────────────────────┬────────┬──────────┐
│ # │ Check                │ Status │ Duration │
├───┼──────────────────────┼────────┼──────────┤
│ 1 │ lint                 │ PASS   │ 3.2s     │
│ 2 │ vet                  │ PASS   │ 1.1s     │
│ 3 │ imports              │ FAIL   │ 0.4s     │
│ 4 │ format               │ PASS   │ 0.3s     │
│ 5 │ docs                 │ PASS   │ 2.1s     │
│ 6 │ unit tests           │ PASS   │ 8.5s     │
│ 7 │ integration tests    │ PASS   │ 22.3s    │
│ 8 │ e2e tests            │ SKIP   │ -        │
└───┴──────────────────────┴────────┴──────────┘

ERRORS (first 10 lines per failure):
─────────────────────────────────────
#3 imports
  internal/handler/user.go
  internal/service/auth.go

VERDICT: NEEDS_FIX

Verdict Rules

Condition Verdict
All commands pass (or SKIP for unavailable targets) MERGE_READY
Any command fails NEEDS_FIX
Target not available (no Makefile target / tool not installed) SKIP that check — does not count as failure

Error Display Rules

For each failed command:

  • Show the first 10 lines of stderr (or stdout if stderr is empty)
  • If goimports -l or gofmt -l failed, the output IS the list of files to fix
  • If make generate-docs changed files, list which files were modified

Stack Awareness

This skill is Go-primary but designed to be stack-aware:

Stack Support Level Notes
Go Full All 8 checks supported
TypeScript/Node Future Would use eslint, prettier, jest, etc.
Multi-stack Future Detect from project files, run appropriate checks

For non-Go projects, STOP and report: "ring:dev-verify-code currently supports Go projects only. Detected: [stack]."


Rules

MUST follow:

  • MUST measure duration for each command individually
  • MUST always show the full summary even if everything passes
  • MUST proceed to Phase 2 even if Phase 1 has failures
  • MUST continue E2E even if integration fails
  • MUST report, never fix

Anti-Rationalization

Rationalization Why It's WRONG Required Action
"Tests passed last time, skip verification" Code changed since then. Previous results are stale. Run all checks
"Only lint failed, that's cosmetic" Lint failures may hide real issues. Report everything. Report as NEEDS_FIX
"Integration tests are slow, skip them" Slow tests catch real bugs. Speed is not an excuse. Run all checks
"CI will run these anyway" Local verification catches issues earlier and cheaper. Run all checks
"Let me fix this one thing first" This skill reports only. Fixing is a separate step. Report, do not fix
"Makefile target probably doesn't exist" Check first, do not assume. SKIP only after verification. Check Makefile, then decide

Pressure Resistance

User Says Your Response
"Just run the tests, skip lint" "ring:dev-verify-code runs all checks. For a single command, run it directly."
"It's fine, just mark it as ready" "MUST run verification to determine verdict. Cannot mark ready without evidence."
"Skip integration tests, they're slow" "All checks run regardless of duration. SKIP only applies to unavailable targets."
"Fix the import issues while you're at it" "This skill only reports. Use the appropriate tool or agent to fix issues."
Related skills
Installs
1
GitHub Stars
180
First Seen
9 days ago