.cursor/skills/golang-validation/SKILL.md
Валидация данных в Go с github.com/muonsoft/validation. Используй при проверке входных данных, доменных моделей.
npx skillsauth add strider2038/knowledge-db golang-validationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Пакет: github.com/muonsoft/validation.
Применяется:
Validate);validationtest.type Validatable interface {
Validate(ctx context.Context, v *validation.Validator) error
}
func (n Node) Validate(ctx context.Context, v *validation.Validator) error {
return v.Validate(ctx,
validation.StringProperty("path", n.Path),
validation.StringProperty("annotation", n.Annotation),
)
}
StringProperty, NumberProperty, BoolPropertyValidProperty — вложенный ValidatableValidSliceProperty — слайсif err := u.validator.ValidateIt(ctx, cmd); err != nil {
return err
}
if invalid {
return v.CreateViolation(ctx, ErrInvalidFormat, "message", validation.PropertyName("field"))
}
validationtest.Assert(t, err).
IsViolation().
WithError(validation.ErrIsBlank).
WithPropertyPath("path")
development
Knowledge base layout and node format for knowledge-db. Use when creating or editing KB markdown files. Root path placeholder {{DATA_PATH}}.
development
Frontend web/ (React, TypeScript, Vite). Используй при работе с web/src/**/*.tsx, web/src/**/*.ts.
tools
Регистрация фоновых процессов через pior/runnable. Используй при добавлении Telegram bot и других воркеров в kb-server.
testing
Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.