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 name | Title | Description |
|---|---|---|
quickmodel_from_typescript | Convert TypeScript Interface to QModel | Generate a QModel class from a TS interface |
quickmodel_debug | Debug a QuickModel | Diagnose and fix validation or transformation issues |
quickmodel_generate_test_data | Generate Test Data for a QuickModel | Create realistic mock data verified through the pipeline |
quickmodel_inspect_and_schema | Inspect Model and Export Schema | Inspect a model and export its schema in multiple formats |
quickmodel_form_validation | Add Form Validation to a QuickModel | Guided workflow to add @QField, @QRule, and @QGroup |
quickmodel_full_pipeline | Walk the Full QuickModel Pipeline | create() → checkIntegrity() → checkRules() → serialize() |
quickmodel_trace_model | Set Up Tracing & Observability | Configure global / per-model / per-rule trace with the right verbosity and sink |
quickmodel_mixin | Extend a Base Class with QModel Mixin | QModel.extends(BaseClass) for TypeORM / NestJS entities |
quickmodel_alias_computed | Use @QAlias and @QComputed | Field name remapping and getter serialization |
quickmodel_migration | Migrate Legacy Code to QuickModel | Convert 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_qgroup | Add @QGroup to a Model | Group fields and enable checkGroups() group-level validation |
quickmodel_security_review | Security Review | Mass assignment, DoS, prototype pollution, ReDoS audit |
quickmodel_transformer_guide | Transformer Guide | Pick the right transformer for a TS type and simulate it |
quickmodel_form_data | FormData ↔ QModel Integration Guide | fromFormData(), toFormData(), fileMode/fileSource, streaming |
quickmodel_drizzle | Generate QuickModel DTO from Drizzle ORM schema | Column-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
| Argument | Required | Description |
|---|---|---|
typescript | ✅ Yes | TypeScript interface or type definition to convert (e.g. interface IUser { id: number; createdAt: string; }) |
model_name | ✗ No | Optional name for the generated model class (defaults to the interface name without the I prefix) |
Tools called internally
interface_to_model— converts the interface into aQModelclass with@Quickdecoratorsvalidate_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 examplequickmodel_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
| Argument | Required | Description |
|---|---|---|
model_code | ✅ Yes | The QuickModel class code that has the issue |
error | ✗ No | The JSON string of the thrown error, or a plain-language description of the unexpected behaviour |
sample_data | ✗ No | JSON sample data that triggers the issue (helps trace the exact transformation) |
Tools called internally
inspect_model— analyses model structure, decorators, and optionsexplain_error(iferrorwas provided) — translates the error into plain languagevalidate_usage— checks the class for structural problemssimulate_transformation(ifsample_datawas 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 + explanationquickmodel_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
| Argument | Required | Description |
|---|---|---|
model_code | ✅ Yes | The QuickModel class code to generate test data for |
count | ✗ No | Number of mock instances to generate (default: "1") |
context | ✗ No | Domain context to guide realistic data generation (e.g. "e-commerce user", "banking transaction") |
Tools called internally
inspect_model— understands all properties, their types, and transformer configurationgenerate_mock— produces type-aware mock data matching the schemasimulate_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 testsquickmodel_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
| Argument | Required | Description |
|---|---|---|
model_code | ✅ Yes | The QuickModel class code to inspect and export |
formats | ✗ No | Comma-separated list of schema formats (default: "json,openapi"). Available values: json, openapi, zod, mongo, typescript, graphql, ajv |
Supported formats
| Format value | Output |
|---|---|
json | JSON Schema Draft-07 |
openapi | OpenAPI 3.0 schema component |
zod | Zod validator schema string |
mongo | Mongoose / MongoDB SchemaTypes |
typescript | TypeScript interface string |
graphql | GraphQL SDL type definition |
ajv | AJV-compatible validator schema |
Tools called internally
inspect_model— full analysis of model structureexport_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 eachquickmodel_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
| Argument | Required | Description |
|---|---|---|
form_description | ✅ Yes | Description of the form and its validation requirements |
fields | ✗ No | Comma-separated list of field names to include (e.g. "name, email, age") |
Workflow
- Explains
@QFieldusage (widget, label, required, hint) - Shows
@QRulepredicate syntax - Demonstrates
@QGroupgrouping - Calls
validate_usageto verify the model code - Calls
simulate_validationwith representative data to test predicates live - Shows how to use
getFormSchema(),getFormSchemaGrouped(), andcheckRules()at runtime
Tools called internally
validate_usage— checks the model code for structural errors and best-practice violationssimulate_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 codequickmodel_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
| Argument | Required | Description |
|---|---|---|
model_code | ✅ Yes | The QuickModel class definition to walk through |
sample_data | ✗ No | Optional JSON string with sample data to use at each step (e.g. '{"createdAt":"2024-01-01"}') |
Workflow
- Stage 1 — Hydration:
create()/new Model(data)— callssimulate_transformation - Stage 2 — Integrity:
checkIntegrity()— callscheck_integrity - Stage 3 — Rules:
checkRules()— callssimulate_validation - Stage 4 — Serialization:
serialize()/toJSON()
Tools called internally
simulate_transformation— verifies hydration and field-level transformerscheck_integrity— validates each field against its expected type constraintssimulate_validation— runs@QRulepredicates 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 outputquickmodel_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
| Argument | Required | Description |
|---|---|---|
model_code | ✅ Yes | The QuickModel class code to add tracing to |
goal | ✗ No | What 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 | ✗ No | JSON string with sample data to run through the model after setup (optional) |
Tools called internally
inspect_model— analyzes fields,@QRuledecorators, and@Quickoptionssimulate_rules— (optional) runs predicates with sample data to show trace outputsimulate_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 entriesResolution 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
IQTraceEntryfields.
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
| Argument | Required | Description |
|---|---|---|
base_class | ✅ Yes | The name of the base class to extend (e.g. "BaseEntity", "TypeORMUser") |
model_fields | ✗ No | Optional comma-separated field declarations (e.g. "createdAt: Date, status: string, score: number") |
Workflow
- Shows
QModel.extends(BaseClass)wiring with@Quick - Adds
IQImplements<typeof MyModel>for strong static typing - Explains the
instanceof QModelcaveat andisQModel()alternative - Calls
validate_usageto check the generated code for common mistakes
Tools called internally
validate_usage— checks the mixin wiring for common mistakes andIQImplementsusage
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 behaviourquickmodel_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
| Argument | Required | Description |
|---|---|---|
model_code | ✗ No | Optional QuickModel class code to analyze or enrich with @QAlias / @QComputed |
Workflow
- Explains
@QAlias— field rename onserialize()andcreate()key lookup - Explains
@QComputed— opts a getter into the serialized output - Shows common mistakes (using
@QComputedon adeclarefield instead of a getter) - Calls
validate_usageto confirm the model is correct
Tools called internally
validate_usage— confirms@QAliasand@QComputedare 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() outputquickmodel_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
| Argument | Required | Description |
|---|---|---|
legacy_code | ✅ Yes | The legacy TypeScript class or old QuickModel code to migrate |
Workflow
- Identifies all fields that need
declareprefix - Determines which fields need transformer entries in
@Quick({}) - Removes any manual constructors that assign fields
- Wraps class with
@Quick({})extendingQModel<T> - Calls
validate_usageto verify the migrated code
Tools called internally
validate_usage— confirms the migrated class usesdeclare,@Quick({}), and extendsQModel<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 explanationquickmodel_async_rules
⚠️ Async-only: Use this skill only when your
@QRulepredicates genuinely require asynchronous operations (database lookups, external API calls, async validators). For synchronous rules, usecheckRules()— 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
| Argument | Required | Description |
|---|---|---|
model_code | ✅ Yes | The QuickModel class with @QRule decorators to make async |
context | ✗ No | Optional description of the async context (e.g. "NestJS service with TypeORM", "database uniqueness check") |
Workflow
- Clearly warns that this is async-only (sync rules should use
checkRules()) - Shows
checkRulesAsync()withtimeoutMsandparallel/serialmode - Demonstrates NestJS / async context injection pattern
- Shows
async (value) => Promise<boolean>predicate syntax - Calls
validate_usageto verify the model
Tools called internally
validate_usage— verifies async@QRulepredicates andcheckRulesAsync()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 guidancequickmodel_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
| Argument | Required | Description |
|---|---|---|
model_code | ✅ Yes | The QuickModel class to annotate with @QGroup |
group_name | ✗ No | Optional group name to use (e.g. "personal", "billing") |
Workflow
- Shows the
@QGroup("name")decorator above@QField/@QRule - Demonstrates multi-group stacking:
@QGroup("a") @QGroup("b") declare field - Shows
instance.checkGroups(["group"])for group-level validation - Calls
validate_usageto verify the resulting model
Tools called internally
validate_usage— confirms@QGroupannotations andcheckGroups()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 examplesquickmodel_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
| Argument | Required | Description |
|---|---|---|
model_code | ✗ No | Optional model code for class-specific security review |
Workflow
- Calls
check_securityto run the full security test suite - Explains mass assignment:
unknownPropertyPolicy: 'strip'in@Quick - Explains DoS limits:
populationLimitand array/string limits - Explains prototype pollution: strict typing blocks
__proto__,constructor - Explains ReDoS: RegExp transformer limits and complexity checks
- If
model_codeprovided, shows class-specific recommendations
Tools called internally
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 checklistquickmodel_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
| Argument | Required | Description |
|---|---|---|
typescript_type | ✅ Yes | The TypeScript type (e.g. Date, bigint, Map<string, number>, RegExp) |
sample_data | ✗ No | Optional sample value to test the transformer (e.g. "2024-01-15T00:00:00.000Z") |
Transformer Quick Reference
| TypeScript type | Entry 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
- Shows the correct
@Quickentry for the requested type - Calls
simulate_transformationwith provided or generated sample data - Highlights common pitfalls (e.g.
Daterequires ISO string,BigIntrequires digit string)
Tools called internally
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 resultquickmodel_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
| Argument | Required | Description |
|---|---|---|
scenario | ✅ Yes | Describe your use case (e.g. "User uploads avatar and profile data from a browser form") |
model_fields | ✗ No | Optional 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 / Option | Purpose |
|---|---|
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)
| Method | Purpose |
|---|---|
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
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
}
totalisnullwhen receiving a stream withoutContent-Length. AFilefrom a browser form always has.size, sototalis always set in that case.
Workflow
- Identifies whether the scenario needs in-memory or streaming API based on
file_size - Generates the QModel class with correct
@QType(File, { fileMode })decorators for Blob/File fields - Shows
fromFormData()orfromStream()call with the right options - Shows
toFormData()ortoReadableStream()for the output side - If streaming, demonstrates the full
IQStreamProgresscallback - 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 scenarioquickmodel_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
| Argument | Required | Description |
|---|---|---|
drizzle_schema | ✅ Yes | Drizzle table schema definition (e.g. export const users = pgTable('users', { id: integer().primaryKey(), createdAt: timestamp().notNull() })) |
dto_name | ✗ No | Optional name for the generated select DTO class (defaults to the table name in PascalCase + Dto, e.g. UserDto) |
patterns | ✗ No | Comma-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() mapping | Notes |
|---|---|---|
timestamp() / date() | Date | Coerces 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 columnscoercionStrategy: 'loose'— handles raw query string-to-primitive coercion
Available patterns
| Pattern | What is generated |
|---|---|
select | Always generated — the main read DTO |
insert | Create[Name]Dto with @QRule validators for create operations |
repository | Drizzle[Name]Repository with insert(), findById(), findAll(), delete() |
copy | Partial update pattern: existing.$qCopy({ field: value }) → db.update().set() |
createMany | Bulk seed/import using [Name]Dto.createMany(seed) |
async-rules | DB-level uniqueness validation with qCheckRulesAsync() |
Workflow
- Analyze columns — map each Drizzle column to its QuickModel transformer type
- Apply config — always include
unknownPropertyPolicy: 'strip'andcoercionStrategy: 'loose' - Generate DTO — produce the
@Quick({...}) class [Name]Dto extends QModel<I[Name]Dto> validate_usage— verify the generated class for structural errorssimulate_transformation— run a sample row to confirm Date/number coercion- Optional patterns — generate insert DTO, repository, copy/update, seed, async rules as needed
Tools called internally
validate_usage— checks the generated class fordeclare,@Quick, andextends QModel<T>correctnesssimulate_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.