validation-add-constraint

Add validation constraints to the Go validation library with tests and translations.

18|Updated Nov 8, 2020
One-click install
npx skills add https://github.com/muonsoft/validation --skill validation-add-constraint
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: validation-add-constraint
Source: https://github.com/muonsoft/validation/tree/main/.cursor/skills/validation-add-constraint
Command: npx skills add https://github.com/muonsoft/validation --skill validation-add-constraint

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides developers on how to add new validation constraints to the Go validation library, covering workflow, messaging, translations, tests, and examples.

Core Features & Use Cases

  • Supports creating a new constraint in the it package with proper messaging, tests, and docs.
  • Provides guidance for translations (english/russian), and optional validate/is helpers, plus examples and godoc.
  • Applies across large codebases that rely on the muonsoft/validation framework to extend or customize validation rules.

Quick Start

Follow this workflow to add a new constraint to the validation library, including message, translations, tests, and examples.

Frequently Asked Questions about validation-add-constraint

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

FAQPage Schema
How do I add a new validation constraint to a Go validation library?

To add a new validation constraint in Go, follow a standardized workflow that creates the constraint logic, defines message constants, adds translation keys, writes tests, and provides examples across the it/validate/is package directories.

What is the standard workflow for extending Go validation rules with custom constraints?

The standard workflow for extending Go validation rules involves implementing the constraint logic, defining message constants, adding English and Russian translations, writing tests, and generating godoc examples within the library structure.

Do I need to add translations when creating a custom validation constraint in Go?

Yes, adding translations is required when creating a custom validation constraint in Go, as the workflow enforces defining translation keys and providing English and Russian message translations alongside the core logic.

Can I add optional helper functions for Go validation constraints?

Yes, you can add optional validate/is helper functions when extending the Go validation library, allowing you to provide convenient shortcuts for applying the new constraint alongside the required tests and examples.

What are the limitations when extending the muonsoft/validation framework with new rules?

The main limitation when extending the muonsoft/validation framework is that it enforces a strict workflow, requiring you to implement message constants, translation keys, tests, and examples across specific directories before a constraint is considered complete.

Does adding a new constraint to the Go validation library require writing tests and examples?

Yes, adding a new constraint to the Go validation library requires writing tests and generating godoc examples, as the enforced workflow ensures all new validation rules remain documented and functionally verified.