go-validator

Generate Go validator components with port interfaces and implementation structs.

Updated Jan 4, 2026
One-click install
npx skills add https://github.com/cristiano-pacheco/ai-tools --skill go-validator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-validator
Source: https://github.com/cristiano-pacheco/ai-tools/tree/main/skills/go-validator
Command: npx skills add https://github.com/cristiano-pacheco/ai-tools --skill go-validator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation of robust validation logic in Go applications, ensuring data integrity and adherence to business rules through a standardized, two-file pattern and typed error handling.

Core Features & Use Cases

  • Standardized Validation: Generates port interfaces and implementation structs for validators following Go modular architecture conventions.
  • Typed Error Handling: Enforces the use of module-specific typed errors for clear error reporting.
  • Use Case: Automatically create validators for user registration inputs like email format, password strength, and username uniqueness, ensuring all data meets predefined criteria before processing.

Quick Start

Use the go-validator skill to generate a new password validator for the 'auth' module.

Frequently Asked Questions about go-validator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Go validators with typed errors for modular architecture?

Generate Go validators with typed errors by creating standardized port interfaces and implementation structs. This approach enforces module-specific typed error handling and adheres to Go modular architecture conventions for clear error reporting.

What is the best way to structure stateless and stateful validation logic in Go?

Structure stateless and stateful validation logic in Go using a standardized two-file pattern. This pattern separates port interfaces from implementation structs, supporting both validation types alongside multi-field validators with context propagation.

Does this Go validator generation approach support dependency injection frameworks like Fx?

Yes, the Go validator generation approach supports dependency injection frameworks like Fx. It generates modular validator components that facilitate integration with Fx and ensures comprehensive unit testing for the injected dependencies.

How do I handle context propagation for I/O operations during multi-field validation in Go?

Handle context propagation for I/O operations during multi-field validation in Go by generating validator components that explicitly pass context. This ensures that validation checks involving database or network calls respect timeouts and cancellations.

Why use typed errors for user registration validation in Go applications?

Use typed errors for user registration validation in Go to enforce clear, module-specific error reporting. This standardizes data integrity checks for inputs like email format and password strength, ensuring all data meets predefined criteria before processing.