Skip to content

MCP Prompts / Skills ​

Prompts (also called skills) are guided AI workflows built on top of the MCP tools. Instead of calling individual tools manually, a skill orchestrates a sequence of tool calls, enforces gates, and drives the AI through a complete task — given just a few inputs from you.

These public skills help you convert interfaces, debug models, build form schemas, migrate legacy code, review security, and more. If you are a QuickModel contributor, see Internal Skills → for TDD, lint/typecheck, SOLID, and documentation sync workflows.

When to use a skill vs a tool

Use a tool when you need a single, precise operation (e.g. simulate_transformation, check_integrity). Use a skill when you want the AI to handle a complete workflow end-to-end — reasoning, fixing, and verifying at each step automatically.


Public Skills ​

For developers using QuickModel in their applications.

Skill nameTitleDescription
quickmodel_from_typescriptConvert TypeScript Interface to QModelGenerate a QModel class from a TS interface
quickmodel_debugDebug a QuickModelDiagnose and fix validation or transformation issues
quickmodel_generate_test_dataGenerate Test Data for a QuickModelCreate realistic mock data verified through the pipeline
quickmodel_inspect_and_schemaInspect Model and Export SchemaInspect a model and export its schema in multiple formats
quickmodel_form_validationAdd Form Validation to a QuickModelGuided workflow to add @QField, @QRule, and @QGroup
quickmodel_full_pipelineWalk the Full QuickModel Pipelinecreate() → checkIntegrity() → checkRules() → serialize()
quickmodel_trace_modelSet Up Tracing & ObservabilityConfigure global / per-model / per-rule trace with the right verbosity and sink
quickmodel_mixinExtend a Base Class with QModel MixinQModel.extends(BaseClass) for TypeORM / NestJS entities
quickmodel_alias_computedUse @QAlias and @QComputedField name remapping and getter serialization
quickmodel_migrationMigrate Legacy Code to QuickModelConvert plain classes / legacy code to idiomatic QuickModel patterns
quickmodel_async_rules⚠️ Async Rules with checkRulesAsync()Async-only: DB lookups, API calls — NOT for sync predicates
quickmodel_add_qgroupAdd @QGroup to a ModelGroup fields and enable checkGroups() group-level validation
quickmodel_security_reviewSecurity ReviewMass assignment, DoS, prototype pollution, ReDoS audit
quickmodel_transformer_guideTransformer GuidePick the right transformer for a TS type and simulate it
quickmodel_form_dataFormData ↔ QModel Integration GuidefromFormData(), toFormData(), fileMode/fileSource, streaming
quickmodel_drizzleGenerate QuickModel DTO from Drizzle ORM schemaColumn-type mapping, unknownPropertyPolicy: 'strip', insert/repository patterns

Maintainer Skills (contributors only)

Skills for contributors working on the QuickModel codebase are in a separate section: Internal Skills →.


quickmodel_from_typescript ​

Convert a TypeScript interface into a fully annotated QuickModel class.

Guides the AI through parsing the interface, identifying transformable types (Date, BigInt, Set, Map, …), and generating a ready-to-use QModel class with the correct @Quick decorator. After generation, validate_usage is called automatically to verify correctness.

Arguments ​

ArgumentRequiredDescription
typescript✅ YesTypeScript interface or type definition to convert (e.g. interface IUser { id: number; createdAt: string; })
model_name✗ NoOptional name for the generated model class (defaults to the interface name without the I prefix)

Tools called internally ​

  1. interface_to_model — converts the interface into a QModel class with @Quick decorators
  2. validate_usage — checks the generated code for correctness and best practices

Example ​

User prompt: "Convert this interface to a QuickModel"
typescript: "interface IUser { id: number; createdAt: string; tags: string[]; }"

→ AI calls interface_to_model({ code: "..." })
→ AI calls validate_usage({ code: "..." })
→ Returns final QModel class + usage example

quickmodel_debug ​

Debug a QuickModel that is throwing validation errors or producing unexpected output.

The AI inspects the model structure, translates any thrown error into plain language, validates the class definition, and optionally simulates the transformation with your sample data to trace the exact failure path. It then returns a corrected version of the model.

Arguments ​

ArgumentRequiredDescription
model_code✅ YesThe QuickModel class code that has the issue
error✗ NoThe JSON string of the thrown error, or a plain-language description of the unexpected behaviour
sample_data✗ NoJSON sample data that triggers the issue (helps trace the exact transformation)

Tools called internally ​

  1. inspect_model — analyses model structure, decorators, and options
  2. explain_error (if error was provided) — translates the error into plain language
  3. validate_usage — checks the class for structural problems
  4. simulate_transformation (if sample_data was provided) — traces the exact transformation path

Example ​

model_code: "@Quick({ createdAt: Date }) class User extends QModel<IUser> { ... }"
error: '{ "error": "User.createdAt: Invalid Date string: undefined" }'
sample_data: '{ "id": 1 }'   ← createdAt is missing

→ AI calls inspect_model
→ AI calls explain_error → "createdAt is undefined because sample_data is missing the field"
→ AI calls validate_usage
→ AI calls simulate_transformation
→ Returns corrected model + explanation

quickmodel_generate_test_data ​

Generate realistic mock/test data for a QuickModel class.

The AI inspects the model to understand all property types and their transformer requirements, generates mock data (respecting format constraints like ISO strings for Date, digit strings for BigInt, arrays for Set/Map), and finally verifies the data survives the full transformation pipeline. The result is data you can drop directly into a unit test or fixture file.

Arguments ​

ArgumentRequiredDescription
model_code✅ YesThe QuickModel class code to generate test data for
count✗ NoNumber of mock instances to generate (default: "1")
context✗ NoDomain context to guide realistic data generation (e.g. "e-commerce user", "banking transaction")

Tools called internally ​

  1. inspect_model — understands all properties, their types, and transformer configuration
  2. generate_mock — produces type-aware mock data matching the schema
  3. simulate_transformation — verifies the mock data passes the full transformation pipeline

Example ​

model_code: "@Quick({ birth: Date, balance: BigInt }) class Account extends QModel ..."
count: "3"
context: "fintech savings account"

→ AI calls inspect_model
→ AI calls generate_mock({ schema: { birth: "date", balance: "bigint" }, count: 3 })
→ AI calls simulate_transformation to verify
→ Returns 3 verified mock objects ready for tests

quickmodel_inspect_and_schema ​

Inspect a QuickModel and export its schema in one or more formats.

The AI analyses the model structure (properties, types, decorators, options) and exports the schema in every requested format. It also provides integration examples showing how to use each exported schema with its respective library or tool.

Arguments ​

ArgumentRequiredDescription
model_code✅ YesThe QuickModel class code to inspect and export
formats✗ NoComma-separated list of schema formats (default: "json,openapi"). Available values: json, openapi, zod, mongo, typescript, graphql, ajv

Supported formats ​

Format valueOutput
jsonJSON Schema Draft-07
openapiOpenAPI 3.0 schema component
zodZod validator schema string
mongoMongoose / MongoDB SchemaTypes
typescriptTypeScript interface string
graphqlGraphQL SDL type definition
ajvAJV-compatible validator schema

Tools called internally ​

  1. inspect_model — full analysis of model structure
  2. export_json_schema — called once per requested format

Example ​

model_code: "@Quick({ createdAt: Date }) class User extends QModel<IUser> { ... }"
formats: "json,zod,openapi"

→ AI calls inspect_model
→ AI calls export_json_schema({ code: "...", format: "json" })
→ AI calls export_json_schema({ code: "...", format: "zod" })
→ AI calls export_json_schema({ code: "...", format: "openapi" })
→ Returns all 3 schemas + integration examples for each

quickmodel_form_validation ​

Add @QField, @QRule, and @QGroup to a QuickModel class with guided validation.

Walks the AI step-by-step through declaring field metadata with @QField, adding business-logic predicates with @QRule, grouping sections with @QGroup, verifying with validate_usage, and testing live with simulate_validation.

Arguments ​

ArgumentRequiredDescription
form_description✅ YesDescription of the form and its validation requirements
fields✗ NoComma-separated list of field names to include (e.g. "name, email, age")

Workflow ​

  1. Explains @QField usage (widget, label, required, hint)
  2. Shows @QRule predicate syntax
  3. Demonstrates @QGroup grouping
  4. Calls validate_usage to verify the model code
  5. Calls simulate_validation with representative data to test predicates live
  6. Shows how to use getFormSchema(), getFormSchemaGrouped(), and checkRules() at runtime

Tools called internally ​

  1. validate_usage — checks the model code for structural errors and best-practice violations
  2. simulate_validation — tests predicates live with representative data

Example ​

form_description: "User registration form with name, email and password confirmation"
fields: "name, email, password, confirmPassword"

→ AI generates model with @QField and @QRule decorators
→ AI calls validate_usage to check for errors
→ AI calls simulate_validation with { name: "Jo", email: "not-valid", password: "abc", confirmPassword: "xyz" }
→ Returns validation report + final model code

quickmodel_full_pipeline ​

Walk the complete QuickModel data lifecycle end-to-end.

Guides the AI through every stage: raw data → create() → checkIntegrity() → checkRules() → serialize() / toJSON(). Uses check_integrity, simulate_validation, and simulate_transformation to verify each step with real data.

Arguments ​

ArgumentRequiredDescription
model_code✅ YesThe QuickModel class definition to walk through
sample_data✗ NoOptional JSON string with sample data to use at each step (e.g. '{"createdAt":"2024-01-01"}')

Workflow ​

  1. Stage 1 — Hydration: create() / new Model(data) — calls simulate_transformation
  2. Stage 2 — Integrity: checkIntegrity() — calls check_integrity
  3. Stage 3 — Rules: checkRules() — calls simulate_validation
  4. Stage 4 — Serialization: serialize() / toJSON()

Tools called internally ​

  1. simulate_transformation — verifies hydration and field-level transformers
  2. check_integrity — validates each field against its expected type constraints
  3. simulate_validation — runs @QRule predicates with the provided sample data

Example ​

model_code: "
  @Quick({ createdAt: Date, score: Number })
  class OrderModel extends QModel<OrderModel> {
    declare createdAt: Date;
    declare score: number;
  }
"
sample_data: '{"createdAt":"2024-06-15","score":"42"}'

→ AI calls simulate_transformation with sample data
→ AI calls check_integrity to verify Date is valid
→ AI calls simulate_validation for any @QRule predicates
→ Returns full pipeline report with serialized output

quickmodel_trace_model ​

Set up and interpret the QuickModel trace/observability system for a model.

Inspects the model, determines the right trace scope (global, per-model, or per-rule), proposes the correct verbosity level and event filter, and returns annotated code with trace settings in place. Optionally simulates rules or transformations to show what the trace output would look like.

Arguments ​

ArgumentRequiredDescription
model_code✅ YesThe QuickModel class code to add tracing to
goal✗ NoWhat you want to observe. Examples: "see all rule failures", "audit token validation to a security log", "debug a transformation pipeline", "silence a noisy rule"
sample_data✗ NoJSON string with sample data to run through the model after setup (optional)

Tools called internally ​

  1. inspect_model — analyzes fields, @QRule decorators, and @Quick options
  2. simulate_rules — (optional) runs predicates with sample data to show trace output
  3. simulate_transformation — (optional) traces the transformation pipeline per field

Example ​

model_code: "class OrderModel extends QModel<...> { @QRule(...) declare total: number; }"
goal: "route all rule failures to a security audit log"

→ AI calls inspect_model(...)
→ AI identifies the rule on `total`
→ AI generates: @QRule(predicate, message, { trace: { verbosity: 'warn', sink: auditLog.write } })
→ Returns annotated model code + explanation of trace entries

Resolution chain reminder ​

per-rule @QRule(p, m, { trace })  ← highest priority
  ↓
per-model @Quick({}, { trace })
  ↓
global QConfig.configure({ defaults: { trace } })
  ↓
default: 'silent'

📖 Tracing & Observability guide — full reference for all trace options and IQTraceEntry fields.


quickmodel_mixin ​

Extend any non-QModel base class with QuickModel capabilities.

Explains the QModel.extends(BaseClass) mixin pattern used in Angular (TypeORM entities) and NestJS (DTOs). Covers IQImplements typing, the instanceof caveat, and uses validate_usage to verify correctness.

Arguments ​

ArgumentRequiredDescription
base_class✅ YesThe name of the base class to extend (e.g. "BaseEntity", "TypeORMUser")
model_fields✗ NoOptional comma-separated field declarations (e.g. "createdAt: Date, status: string, score: number")

Workflow ​

  1. Shows QModel.extends(BaseClass) wiring with @Quick
  2. Adds IQImplements<typeof MyModel> for strong static typing
  3. Explains the instanceof QModel caveat and isQModel() alternative
  4. Calls validate_usage to check the generated code for common mistakes

Tools called internally ​

  1. validate_usage — checks the mixin wiring for common mistakes and IQImplements usage

Example ​

base_class: "BaseEntity"
model_fields: "createdAt: Date, updatedAt: Date, status: string"

→ AI generates MyModel extends QModel.extends(BaseEntity)
→ AI calls validate_usage to verify the mixin is correct
→ Returns final model code with explanations for instanceof behaviour

quickmodel_alias_computed ​

Explain and apply @QAlias and @QComputed decorators.

Covers how to remap field names during serialization (snake_case ↔ camelCase) with @QAlias, and how to include computed getter values in serialize() / toJSON() output with @QComputed. Ends with a validate_usage call.

Arguments ​

ArgumentRequiredDescription
model_code✗ NoOptional QuickModel class code to analyze or enrich with @QAlias / @QComputed

Workflow ​

  1. Explains @QAlias — field rename on serialize() and create() key lookup
  2. Explains @QComputed — opts a getter into the serialized output
  3. Shows common mistakes (using @QComputed on a declare field instead of a getter)
  4. Calls validate_usage to confirm the model is correct

Tools called internally ​

  1. validate_usage — confirms @QAlias and @QComputed are applied correctly

Example ​

model_code: "@Quick({})\nclass User extends QModel<User> { declare firstName: string; }"

→ AI adds @QAlias("first_name") and @QComputed() fullName getter
→ AI calls validate_usage
→ Returns corrected model with explanation of serialize() / toJSON() output

quickmodel_migration ​

Migrate legacy TypeScript classes or old QuickModel code to idiomatic patterns.

Guides the AI through converting property assignments to declare fields, wrapping the class with @Quick({}), adding transformer types, removing manual constructors, and calling validate_usage to confirm correctness.

Arguments ​

ArgumentRequiredDescription
legacy_code✅ YesThe legacy TypeScript class or old QuickModel code to migrate

Workflow ​

  1. Identifies all fields that need declare prefix
  2. Determines which fields need transformer entries in @Quick({})
  3. Removes any manual constructors that assign fields
  4. Wraps class with @Quick({}) extending QModel<T>
  5. Calls validate_usage to verify the migrated code

Tools called internally ​

  1. validate_usage — confirms the migrated class uses declare, @Quick({}), and extends QModel<T> correctly

Example ​

legacy_code: "class User { name: string = ''; createdAt: Date = new Date(); }"

→ AI generates: @Quick({ createdAt: Date }) class User extends QModel<User> { declare name: string; declare createdAt: Date; }
→ AI calls validate_usage
→ Returns migrated code with per-change explanation

quickmodel_async_rules ​

⚠️ Async-only: Use this skill only when your @QRule predicates genuinely require asynchronous operations (database lookups, external API calls, async validators). For synchronous rules, use checkRules() — it is simpler and faster.

Guide usage of checkRulesAsync() for async business-logic predicates.

Covers the timeoutMs safety net, parallel vs serial execution mode, and NestJS / HTTP-request integration patterns.

Arguments ​

ArgumentRequiredDescription
model_code✅ YesThe QuickModel class with @QRule decorators to make async
context✗ NoOptional description of the async context (e.g. "NestJS service with TypeORM", "database uniqueness check")

Workflow ​

  1. Clearly warns that this is async-only (sync rules should use checkRules())
  2. Shows checkRulesAsync() with timeoutMs and parallel / serial mode
  3. Demonstrates NestJS / async context injection pattern
  4. Shows async (value) => Promise<boolean> predicate syntax
  5. Calls validate_usage to verify the model

Tools called internally ​

  1. validate_usage — verifies async @QRule predicates and checkRulesAsync() usage

Example ​

model_code: "@Quick({}) class User extends QModel<User> { @QRule(...) declare email: string; }"
context: "NestJS service with TypeORM repository"

→ AI warns: async-only, use checkRules() for sync predicates
→ AI shows: await instance.$qCheckRulesAsync({ timeoutMs: 5000, mode: "parallel" })
→ AI shows NestJS @Injectable() integration
→ Returns async-ready model with usage guidance

quickmodel_add_qgroup ​

Add @QGroup field grouping and enable group-level validation with checkGroups().

Explains how to annotate fields with @QGroup, how to stack multiple groups on a single field, how to call checkGroups() to validate a subset of fields, and the difference between checkGroups() and checkRules(). Calls validate_usage to verify the annotated model.

Arguments ​

ArgumentRequiredDescription
model_code✅ YesThe QuickModel class to annotate with @QGroup
group_name✗ NoOptional group name to use (e.g. "personal", "billing")

Workflow ​

  1. Shows the @QGroup("name") decorator above @QField / @QRule
  2. Demonstrates multi-group stacking: @QGroup("a") @QGroup("b") declare field
  3. Shows instance.checkGroups(["group"]) for group-level validation
  4. Calls validate_usage to verify the resulting model

Tools called internally ​

  1. validate_usage — confirms @QGroup annotations and checkGroups() usage are correct

Example ​

model_code: "@Quick({}) class User extends QModel<IUser> { declare name: string; declare email: string; }"
group_name: "contact"

→ AI annotates fields with @QGroup("contact")
→ AI explains checkGroups(["contact"]) vs checkRules()
→ AI calls validate_usage
→ Returns annotated model + usage examples

quickmodel_security_review ​

Audit a QuickModel class for common security vulnerabilities.

Orchestrates check_security to verify the full security test suite passes, then explains the four key areas: mass assignment hardening (unknownPropertyPolicy: 'strip'), DoS prevention with populationLimit, prototype pollution prevention, and ReDoS protection.

Arguments ​

ArgumentRequiredDescription
model_code✗ NoOptional model code for class-specific security review

Workflow ​

  1. Calls check_security to run the full security test suite
  2. Explains mass assignment: unknownPropertyPolicy: 'strip' in @Quick
  3. Explains DoS limits: populationLimit and array/string limits
  4. Explains prototype pollution: strict typing blocks __proto__, constructor
  5. Explains ReDoS: RegExp transformer limits and complexity checks
  6. If model_code provided, shows class-specific recommendations

Tools called internally ​

  1. check_security — runs the full security test suite (mass assignment, DoS, pollution, ReDoS)

Example ​

→ AI calls check_security
→ AI explains: set unknownPropertyPolicy: 'strip' to block mass assignment
→ AI explains: populationLimit default (5000), how to lower it
→ AI explains: __proto__ and constructor keys are blocked
→ Returns security summary + hardening checklist

quickmodel_transformer_guide ​

Pick the right transformer for a TypeScript type and validate it in real time.

Provides a quick type→transformer reference table, calls simulate_transformation with sample data, and explains common pitfalls per transformer type.

Arguments ​

ArgumentRequiredDescription
typescript_type✅ YesThe TypeScript type (e.g. Date, bigint, Map<string, number>, RegExp)
sample_data✗ NoOptional sample value to test the transformer (e.g. "2024-01-15T00:00:00.000Z")

Transformer Quick Reference ​

TypeScript typeEntry in @Quick
Date@Quick({ field: Date })
bigint@Quick({ field: BigInt })
Set<T>@Quick({ field: Set })
Map<K,V>@Quick({ field: Map })
RegExp@Quick({ field: RegExp })
Symbol@Quick({ field: Symbol })
ArrayBuffer@Quick({ field: ArrayBuffer })
WeakMap / WeakSet@Quick({ field: WeakMap }) / @Quick({ field: WeakSet })

Workflow ​

  1. Shows the correct @Quick entry for the requested type
  2. Calls simulate_transformation with provided or generated sample data
  3. Highlights common pitfalls (e.g. Date requires ISO string, BigInt requires digit string)

Tools called internally ​

  1. simulate_transformation — validates the transformer with real data and traces the result

Example ​

typescript_type: "Date"
sample_data: "2024-06-01T10:00:00.000Z"

→ AI shows: @Quick({ createdAt: Date }) class Model extends QModel<...>
→ AI calls simulate_transformation({ data: { createdAt: "2024-06-01T..." }, ... })
→ AI warns: non-ISO strings may produce Invalid Date
→ Returns transformer guide + simulation result

quickmodel_form_data ​

Guided workflow for integrating browser/server FormData with a QModel.

Covers the full FormData ↔ QModel API: fromFormData(), toFormData(), fileMode/fileSource options (auto, binary, reference, base64), per-field overrides, and streaming for large files via toReadableStream(), fromStream(), and pipeStream(). Also explains the IQStreamProgress callback and when total/percent/eta are null.

Arguments ​

ArgumentRequiredDescription
scenario✅ YesDescribe your use case (e.g. "User uploads avatar and profile data from a browser form")
model_fields✗ NoOptional comma-separated list of relevant fields and types (e.g. "avatar: File, userId: number, description: string")
file_size✗ No"small" for files < 50 MB (in-memory API), "large" for files > 50 MB (streaming API), or omit to cover both paths

Quick decision tree ​

File < 50 MB? → fromFormData(fd) / toFormData()
File > 50 MB? → toReadableStream() / fromStream() / pipeStream()

In-memory API (< 50 MB) ​

Method / OptionPurpose
Model.fromFormData(fd)Parse FormData → typed model instance (auto-detect File/Blob)
dto.toFormData()Build FormData from model fields
fileSource: 'auto' (default)Runtime inspection: File→File, ArrayBuffer→Blob, data:→Blob
fileSource: 'binary'Preserve all as File/Blob
fileSource: 'reference'Treat strings as paths/URLs, no binary deserialisation
fileSource: 'base64'Decode data: URI → Blob
fileMode (same values)Output mode for toFormData()
fields: { avatar: 'binary' }Per-field override — highest precedence
@QType(File, { fileMode: 'reference' })Permanent field-level default in decorator

Precedence: @QType({ fileMode }) < global call option < per-field fields option

Streaming API (> 50 MB) ​

MethodPurpose
dto.toReadableStream({ field, chunkSize?, onChunk? })Emit model field as ReadableStream<Uint8Array> — no full file in RAM
dto.toReadableStream({ multipart: true, onChunk? })Emit all fields as a complete multipart/form-data stream
Model.fromStream(stream, { field, maxBytes?, onProgress? })Accumulate stream chunks into a model Blob field
Model.pipeStream(src, dst, { maxBytes?, onProgress? })Zero-memory pipe from source to destination (S3, WriteStream, …)

IQStreamProgress callback ​

typescript
interface IQStreamProgress {
	bytes: number; // always available
	total: number | null; // null if no Content-Length
	percent: number | null; // null if total is null
	chunks: number; // always available
	bytesPerSec: number; // always available
	elapsed: number; // ms since stream start
	eta: number | null; // null if total is null
}

total is null when receiving a stream without Content-Length. A File from a browser form always has .size, so total is always set in that case.

Workflow ​

  1. Identifies whether the scenario needs in-memory or streaming API based on file_size
  2. Generates the QModel class with correct @QType(File, { fileMode }) decorators for Blob/File fields
  3. Shows fromFormData() or fromStream() call with the right options
  4. Shows toFormData() or toReadableStream() for the output side
  5. If streaming, demonstrates the full IQStreamProgress callback
  6. Calls isValid() / validationReport() before any network operation

Tools called internally ​

This skill is fully self-contained — it uses the AI's reasoning over the documented API rather than calling individual tools.

Example ​

scenario: "User uploads avatar and profile data from a browser form"
model_fields: "avatar: File, userId: number, description: string"
file_size: "small"

→ AI generates: @Quick({ avatar: 'binary' }) class UserProfileDto extends QModel<...>
→ AI shows: const dto = UserProfileDto.fromFormData(formData, { fileSource: 'binary' })
→ AI shows: dto.$qIsValid() check before sending
→ AI shows: const outFd = dto.$qToFormData({ fileMode: 'reference' })
→ Returns full integration guide for the scenario

quickmodel_drizzle ​

Generate a type-safe QuickModel DTO from a Drizzle ORM table schema.

Guides the AI through the full Drizzle → QuickModel workflow: parses the table schema, maps each Drizzle column type to the correct @Quick() transformer config, generates the DTO class (with optional @QRule / @QComputed / @QField decorators), calls validate_usage to verify correctness, and optionally calls simulate_transformation to confirm type coercion with a real sample row.

Arguments ​

ArgumentRequiredDescription
drizzle_schema✅ YesDrizzle table schema definition (e.g. export const users = pgTable('users', { id: integer().primaryKey(), createdAt: timestamp().notNull() }))
dto_name✗ NoOptional name for the generated select DTO class (defaults to the table name in PascalCase + Dto, e.g. UserDto)
patterns✗ NoComma-separated list of additional patterns: insert (CreateDto + @QRule), repository (DrizzleRepository class), copy (partial update), createMany (bulk seed), async-rules (DB checks)

Column type mapping ​

Drizzle column type@Quick() mappingNotes
timestamp() / date()DateCoerces ISO string → Date instance
integer() / serial() / bigint() / real()'number'Handles raw query string coercion
varchar() / text() / char()'string'No transformation needed
boolean()'boolean'Coerces 'true'/'false' strings
jsonb() / json()'string'JSON.stringify before insert, .parse after

Drizzle-specific defaults applied automatically ​

  • unknownPropertyPolicy: 'strip' — removes join artifacts, _count, relational fields, audit columns
  • coercionStrategy: 'loose' — handles raw query string-to-primitive coercion

Available patterns ​

PatternWhat is generated
selectAlways generated — the main read DTO
insertCreate[Name]Dto with @QRule validators for create operations
repositoryDrizzle[Name]Repository with insert(), findById(), findAll(), delete()
copyPartial update pattern: existing.$qCopy({ field: value }) → db.update().set()
createManyBulk seed/import using [Name]Dto.createMany(seed)
async-rulesDB-level uniqueness validation with qCheckRulesAsync()

Workflow ​

  1. Analyze columns — map each Drizzle column to its QuickModel transformer type
  2. Apply config — always include unknownPropertyPolicy: 'strip' and coercionStrategy: 'loose'
  3. Generate DTO — produce the @Quick({...}) class [Name]Dto extends QModel<I[Name]Dto>
  4. validate_usage — verify the generated class for structural errors
  5. simulate_transformation — run a sample row to confirm Date/number coercion
  6. Optional patterns — generate insert DTO, repository, copy/update, seed, async rules as needed

Tools called internally ​

  1. validate_usage — checks the generated class for declare, @Quick, and extends QModel<T> correctness
  2. simulate_transformation — verifies type coercion with a sample Drizzle row (ISO strings for timestamps, etc.)

Example ​

drizzle_schema: "export const users = pgTable('users', { id: integer().primaryKey(), name: varchar({ length: 255 }), createdAt: timestamp().notNull() })"
dto_name: "UserRowDto"
patterns: "insert,repository"

→ AI maps: id → number, name → string, createdAt → Date
→ AI generates:
    @Quick({ createdAt: Date }, { unknownPropertyPolicy: 'strip', coercionStrategy: 'loose' })
    class UserRowDto extends QModel<IUserRowDto> {
        declare id: number;
        declare name: string;
        declare createdAt: Date;
    }
→ AI calls validate_usage({ code: "..." })
→ AI calls simulate_transformation({ data: { id: 1, name: "Alice", createdAt: "2024-01-15T..." }, ... })
→ AI generates CreateUserRowDtoDto with @QRule validators
→ AI generates DrizzleUserRowDtoRepository
→ Returns complete DTO + patterns code

📖 Drizzle ORM Integration Guide — full reference for column mapping, repository patterns, and computed fields.