smithery/rzyfront

vendix-validation

Vendix validation patterns: global Nest ValidationPipe, DTO-first backend validation, class-validator/class-transformer usage, business-rule validation, and Angular reactive form validators. Trigger: When writing validation logic, DTOs, form validators, or request payload handling.

Installation

$ npx skills add smithery/rzyfront --skill vendix-validation

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/rzyfront · top by installs.

npx skills add smithery/rzyfront

Browse all from smithery/rzyfront

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Version2.0
LicenseMIT
More metadata
author
rzyfront
version
2.0
scope
["root"]
auto_invoke
Writing Validation Logic

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,283 B
  • docs SUMMARY.md 51 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Vendix Validation

Backend Default

Global validation is configured in apps/backend/src/main.ts with Nest ValidationPipe:

  • transform: true
  • whitelist: true
  • forbidNonWhitelisted: true
  • enableImplicitConversion: true

Design APIs assuming DTO validation runs before controller methods.

DTO Rules

  • Use class-validator decorators for shape, required fields, enums, lengths, arrays, and numeric bounds.
  • Use class-transformer for type conversion: @Type(() => Number), nested DTOs, arrays, and targeted @Transform().
  • Prefer DTO validation for request structure and simple constraints.
  • Keep business invariants in services after resource lookup and permission/context checks.
  • Avoid hypothetical shared helpers unless they exist in the codebase.

Example patterns used in Vendix:

@IsOptional()
@Type(() => Number)
@IsInt()
store_id?: number;

@ValidateNested({ each: true })
@Type(() => LineItemDto)
items: LineItemDto[];

Service Validation Order

Use early returns/throws, but do not duplicate DTO validation unnecessarily:

  1. Auth/tenant context and permissions.
  2. Resource existence and ownership.
  3. Business state transitions.
  4. Cross-record or monetary consistency.
  5. Execute mutation.

Use VendixHttpException and domain error codes where available.

Frontend Forms

  • Use Angular reactive forms.
  • Use typed controls/getters when templates need strict FormControl bindings.
  • Use built-in Validators for simple fields and custom validators for cross-field rules.
  • Product pricing has real cross-field validators in the product module; prefer existing validators over new ad-hoc checks.
  • On submit, mark controls touched and return early when invalid.

Related Skills

  • vendix-error-handling
  • vendix-angular-forms
  • vendix-backend-api