/harness-claude:nestjs-dto-validationfrom harness-claude
Validates request payloads in NestJS using class-validator and class-transformer DTO patterns. Covers nested validation, whitelisting, and Swagger integration.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /harness-claude:nestjs-dto-validation still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Validate request payloads with class-validator, class-transformer, and DTO patterns
npm install class-validator class-transformer
import {
IsEmail,
IsString,
MinLength,
IsOptional,
IsEnum,
ValidateNested,
Type,
} from 'class-validator';
export enum UserRole {
ADMIN = 'admin',
USER = 'user',
}
export class CreateUserDto {
@IsEmail()
email: string;
@IsString()
@MinLength(8, { message: 'Password must be at least 8 characters' })
password: string;
@IsOptional()
@IsString()
displayName?: string;
@IsEnum(UserRole)
role: UserRole = UserRole.USER;
}
@ValidateNested() + @Type():export class AddressDto {
@IsString() street: string;
@IsString() city: string;
@IsPostalCode('US') zip: string;
}
export class CreateOrderDto {
@ValidateNested()
@Type(() => AddressDto)
shippingAddress: AddressDto;
@IsArray()
@ValidateNested({ each: true })
@Type(() => LineItemDto)
items: LineItemDto[];
}
PartialType from @nestjs/mapped-types:import { PartialType } from '@nestjs/mapped-types';
export class UpdateUserDto extends PartialType(CreateUserDto) {}
@ApiProperty alongside validators:@ApiProperty({ example: '[email protected]' })
@IsEmail()
email: string;
Or use @nestjs/swagger's @ApiProperty auto-generation via PickType, OmitType, IntersectionType.
ValidationPipe globally with whitelist: true and transform: true (see nestjs-pipes-pattern).DTOs (Data Transfer Objects) define the shape of data flowing into your API. They serve three purposes simultaneously: validation, transformation, and documentation.
Common class-validator decorators:
@IsString(), @IsNumber(), @IsBoolean(), @IsDate()@IsEmail(), @IsUrl(), @IsUUID(), @IsPostalCode()@IsEnum(MyEnum), @IsIn(['a', 'b', 'c'])@Min(n), @Max(n), @MinLength(n), @MaxLength(n)@IsArray(), @ArrayMinSize(n), @ArrayMaxSize(n)@IsOptional() — skips validation if the field is absent or undefined@IsDefined() — fails if the field is undefined (stricter than @IsNotEmpty())whitelist: true and forbidNonWhitelisted: true: With whitelist enabled, any property without a decorator is silently removed. With forbidNonWhitelisted, a 400 is thrown instead. Both protect against mass-assignment vulnerabilities.
@Expose() and @Exclude() (class-transformer): When using ClassSerializerInterceptor, decorate response entity fields with @Exclude() to hide sensitive data (passwords, internal IDs). The @Expose() decorator marks which fields to include when excludeExtraneousValues: true is set.
Validation groups: class-validator supports groups for conditional validation. Rarely needed — prefer creating separate DTOs (CreateUserDto vs UpdateUserDto) over validation groups.
https://docs.nestjs.com/techniques/validation
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeRead when SKILL.md points to them.
793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job