[{"data":1,"prerenderedAt":620},["ShallowReactive",2],{"navigation_docs":3,"-ai-integration-workflow-and-commands":127,"-ai-integration-workflow-and-commands-surround":615},[4,19,53,71,95],{"title":5,"icon":6,"redirect":7,"path":8,"stem":9,"children":10,"page":18},"Introduction","i-lucide-rocket","\u002Fintroduction\u002Fabout-ts-runtypes","\u002Fintroduction","1.introduction",[11,14],{"title":12,"path":7,"stem":13},"About RunTypes","1.introduction\u002F1.about-ts-runtypes",{"title":15,"path":16,"stem":17},"Quick Start","\u002Fintroduction\u002Fquick-start","1.introduction\u002F2.quick-start",false,{"title":20,"icon":21,"redirect":22,"path":23,"stem":24,"children":25,"page":18},"Guide","i-lucide-book-open","\u002Fguide\u002Ftypes-vs-schemas","\u002Fguide","2.guide",[26,29,33,37,41,45,49],{"title":27,"path":22,"stem":28},"Types vs Schemas","2.guide\u002F1.types-vs-schemas",{"title":30,"path":31,"stem":32},"Type Formats","\u002Fguide\u002Ftype-formats","2.guide\u002F2.type-formats",{"title":34,"path":35,"stem":36},"Serialization","\u002Fguide\u002Fserialization","2.guide\u002F3.serialization",{"title":38,"path":39,"stem":40},"Mock Data","\u002Fguide\u002Fmocking","2.guide\u002F4.mocking",{"title":42,"path":43,"stem":44},"Validation","\u002Fguide\u002Fvalidation","2.guide\u002F5.validation",{"title":46,"path":47,"stem":48},"Reflection","\u002Fguide\u002Fmarkers-and-reflection","2.guide\u002F6.markers-and-reflection",{"title":50,"path":51,"stem":52},"Pure Functions","\u002Fguide\u002Fpure-functions","2.guide\u002F7.pure-functions",{"title":54,"icon":55,"redirect":56,"path":57,"stem":58,"children":59,"page":18},"AI Integration","i-lucide-sparkles","\u002Fai-integration\u002Fworkflow-and-commands","\u002Fai-integration","3.ai-integration",[60,63,67],{"title":61,"path":56,"stem":62},"AI Workflow","3.ai-integration\u002F1.workflow-and-commands",{"title":64,"path":65,"stem":66},"FriendlyType","\u002Fai-integration\u002Ffriendly-type","3.ai-integration\u002F2.friendly-type",{"title":68,"path":69,"stem":70},"MockData","\u002Fai-integration\u002Fmock-data","3.ai-integration\u002F3.mock-data",{"title":72,"icon":73,"redirect":74,"path":75,"stem":76,"children":77,"page":18},"Test Suites","i-lucide-terminal","\u002Fsuites\u002Fvalidation","\u002Fsuites","6.suites",[78,80,83,87,91],{"title":42,"path":74,"stem":79},"6.suites\u002F1.validation",{"title":34,"path":81,"stem":82},"\u002Fsuites\u002Fserialization","6.suites\u002F2.serialization",{"title":84,"path":85,"stem":86},"Formats Validation","\u002Fsuites\u002Fformat-validation","6.suites\u002F3.format-validation",{"title":88,"path":89,"stem":90},"Formats Serialization","\u002Fsuites\u002Fformat-serialization","6.suites\u002F4.format-serialization",{"title":92,"path":93,"stem":94},"Fuzzing","\u002Fsuites\u002Ffuzzing","6.suites\u002F5.fuzzing",{"title":96,"icon":97,"redirect":98,"path":99,"stem":100,"children":101,"page":18},"Benchmarks","i-lucide-gauge","\u002Fbenchmarks\u002Fvalidation","\u002Fbenchmarks","7.benchmarks",[102,104,108,112,116,119,123],{"title":42,"path":98,"stem":103},"7.benchmarks\u002F1.validation",{"title":105,"path":106,"stem":107},"Validation Formats","\u002Fbenchmarks\u002Fvalidation-formats","7.benchmarks\u002F2.validation-formats",{"title":109,"path":110,"stem":111},"Validation Errors","\u002Fbenchmarks\u002Fgetvalidationerrors","7.benchmarks\u002F3.getvalidationerrors",{"title":113,"path":114,"stem":115},"Validation Error Formats","\u002Fbenchmarks\u002Fgetvalidationerrors-formats","7.benchmarks\u002F4.getvalidationerrors-formats",{"title":34,"path":117,"stem":118},"\u002Fbenchmarks\u002Fserialization","7.benchmarks\u002F5.serialization",{"title":120,"path":121,"stem":122},"Serialization Formats","\u002Fbenchmarks\u002Fserialization-formats","7.benchmarks\u002F6.serialization-formats",{"title":124,"path":125,"stem":126},"Compile Time","\u002Fbenchmarks\u002Fcompiletime","7.benchmarks\u002F7.compiletime",{"id":128,"title":61,"body":129,"description":608,"extension":609,"links":610,"meta":611,"navigation":612,"path":56,"seo":613,"stem":62,"__hash__":614},"docs\u002F3.ai-integration\u002F1.workflow-and-commands.md",{"type":130,"value":131},"minimark",[132,141,149,154,157,230,233,237,273,276,319,341,344,348,353,483,486,490,493,563,570,590,593,604],[133,134,135,136,140],"p",{},"A few things the compiler can't generate on its own: a clear field label, a friendly error message, a believable sample name. Those have to be ",[137,138,139],"em",{},"written",", by a person or these days an AI agent.",[133,142,143,144,148],{},"So RunTypes splits the work cleanly. ",[145,146,147],"strong",{},"The compiler writes the code; the agent fills in the blanks."," From your type, the compiler generates a real, committed source file. Every field is already in place and correctly typed, with the spots that need a human touch left blank and marked. The agent just fills those blanks. It can't get the shape wrong, because the compiler built it.",[150,151,153],"h2",{"id":152},"how-it-works","How it works",[133,155,156],{},"Three steps, and the compiler does two of them:",[158,159,162,191,214],"div",{"className":160},[161],"ai-steps",[158,163,166,179],{"className":164},[165],"ai-step",[133,167,168,174],{},[169,170,173],"span",{"className":171},[172],"ai-step-num","1",[169,175,178],{"className":176},[177],"ai-step-title","The compiler scaffolds",[133,180,181,182,186,187,190],{},"From your type, ",[183,184,185],"code",{},"gen"," writes a real source file: one entry per field, correctly typed, with each blank marked ",[183,188,189],{},"@todo",". The structure is correct by construction.",[158,192,194,204],{"className":193},[165],[133,195,196,200],{},[169,197,199],{"className":198},[172],"2",[169,201,203],{"className":202},[177],"The agent fills the blanks",[133,205,206,207,210,211,213],{},"It can ",[183,208,209],{},"describe"," any type for context, then writes the labels, messages and sample values into the blanks, clearing each ",[183,212,189],{}," as it goes.",[158,215,217,227],{"className":216},[165],[133,218,219,223],{},[169,220,222],{"className":221},[172],"3",[169,224,226],{"className":225},[177],"The compiler checks & keeps in sync",[133,228,229],{},"It validates every value against the type, and as the type changes it updates the scaffold: new fields get new blanks, removed ones are flagged, and your edits are preserved.",[133,231,232],{},"The compiler never calls an AI model during a build, so builds stay fast and predictable. Filling the blanks is a separate, opt-in step the agent runs on its own. The result is always a reviewable, committed diff you approve like any other change.",[150,234,236],{"id":235},"enrich-skill","Enrich Skill",[133,238,239,240,243,244,247,248,247,251,247,254,257,258,260,261,247,263,247,266,257,269,272],{},"There's a ready-made ",[145,241,242],{},"agent skill"," that teaches an AI agent the whole enrichment workflow plus the JSDoc tags it relies on (",[183,245,246],{},"@rtType",", ",[183,249,250],{},"@rtIds",[183,252,253],{},"@rtOrphan",[183,255,256],{},"@rtOrphanChild"," and ",[183,259,189],{},"), so it can drive ",[183,262,185],{},[183,264,265],{},"check",[183,267,268],{},"update",[183,270,271],{},"prune"," correctly.",[133,274,275],{},"Install it into your project's skills folder with a single command:",[277,278,279,304],"code-group",{},[280,281,287],"pre",{"className":282,"code":283,"filename":284,"language":285,"meta":286,"style":286},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npx ts-runtypes-skills --claude\n","Claude","bash","",[183,288,289],{"__ignoreMap":286},[169,290,293,297,301],{"class":291,"line":292},"line",1,[169,294,296],{"class":295},"sBMFI","npx",[169,298,300],{"class":299},"sfazB"," ts-runtypes-skills",[169,302,303],{"class":299}," --claude\n",[280,305,308],{"className":282,"code":306,"filename":307,"language":285,"meta":286,"style":286},"npx ts-runtypes-skills --agent\n","Agent",[183,309,310],{"__ignoreMap":286},[169,311,312,314,316],{"class":291,"line":292},[169,313,296],{"class":295},[169,315,300],{"class":299},[169,317,318],{"class":299}," --agent\n",[133,320,321,324,325,328,329,332,333,336,337,340],{},[183,322,323],{},"--claude"," writes the skill into ",[183,326,327],{},".claude\u002Fskills\u002F","; ",[183,330,331],{},"--agent"," writes it into ",[183,334,335],{},".agent\u002Fskills\u002F",". Use ",[183,338,339],{},"--dir \u003Cpath>"," to install into a custom folder instead.",[133,342,343],{},"Once installed, the agent picks the skill up automatically whenever it works on an enrichment task. No extra prompting needed.",[150,345,347],{"id":346},"what-the-compiler-generates","What the compiler generates",[133,349,350,352],{},[183,351,185],{}," produces an ordinary TypeScript file, committed next to your code and safe to hand-edit. Every field is already there and fully typed. The blanks are marked, so the agent (or you) knows exactly what's left to fill:",[280,354,358],{"className":355,"code":356,"language":357,"meta":286,"style":286},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F generated by the compiler, the @todo marks what's left to fill in\n\u002F\u002F @todo: add realistic sample data\nexport const userMock: MockData\u003CUser> = {\n  name: { pool: [] },   \u002F\u002F ← believable names go here\n  age: { pool: [] },    \u002F\u002F ← a realistic range\n  email: { pool: [] },  \u002F\u002F ← real-looking addresses\n};\n","ts",[183,359,360,366,372,409,435,456,477],{"__ignoreMap":286},[169,361,362],{"class":291,"line":292},[169,363,365],{"class":364},"sHwdD","\u002F\u002F generated by the compiler, the @todo marks what's left to fill in\n",[169,367,369],{"class":291,"line":368},2,[169,370,371],{"class":364},"\u002F\u002F @todo: add realistic sample data\n",[169,373,375,379,383,387,391,394,397,400,403,406],{"class":291,"line":374},3,[169,376,378],{"class":377},"s7zQu","export",[169,380,382],{"class":381},"spNyl"," const",[169,384,386],{"class":385},"sTEyZ"," userMock",[169,388,390],{"class":389},"sMK4o",":",[169,392,393],{"class":295}," MockData",[169,395,396],{"class":389},"\u003C",[169,398,399],{"class":295},"User",[169,401,402],{"class":389},">",[169,404,405],{"class":389}," =",[169,407,408],{"class":389}," {\n",[169,410,412,416,418,421,424,426,429,432],{"class":291,"line":411},4,[169,413,415],{"class":414},"swJcz","  name",[169,417,390],{"class":389},[169,419,420],{"class":389}," {",[169,422,423],{"class":414}," pool",[169,425,390],{"class":389},[169,427,428],{"class":385}," [] ",[169,430,431],{"class":389},"},",[169,433,434],{"class":364},"   \u002F\u002F ← believable names go here\n",[169,436,438,441,443,445,447,449,451,453],{"class":291,"line":437},5,[169,439,440],{"class":414},"  age",[169,442,390],{"class":389},[169,444,420],{"class":389},[169,446,423],{"class":414},[169,448,390],{"class":389},[169,450,428],{"class":385},[169,452,431],{"class":389},[169,454,455],{"class":364},"    \u002F\u002F ← a realistic range\n",[169,457,459,462,464,466,468,470,472,474],{"class":291,"line":458},6,[169,460,461],{"class":414},"  email",[169,463,390],{"class":389},[169,465,420],{"class":389},[169,467,423],{"class":414},[169,469,390],{"class":389},[169,471,428],{"class":385},[169,473,431],{"class":389},[169,475,476],{"class":364},"  \u002F\u002F ← real-looking addresses\n",[169,478,480],{"class":291,"line":479},7,[169,481,482],{"class":389},"};\n",[133,484,485],{},"The agent fills the empty pools; the type annotation keeps it honest. When your type gains a field, the compiler adds a new blank for it. When a field changes type, it flags the old value as stale. When a field is removed, it tidies up. You never regenerate by hand, and your filled-in values are never clobbered.",[150,487,489],{"id":488},"commands","Commands",[133,491,492],{},"A small CLI drives the loop, for an agent or for your CI. The same checks also run during your normal build.",[494,495,496,509],"table",{},[497,498,499],"thead",{},[500,501,502,506],"tr",{},[503,504,505],"th",{},"Command",[503,507,508],{},"What it does",[510,511,512,523,533,543,553],"tbody",{},[500,513,514,520],{},[515,516,517],"td",{},[183,518,519],{},"describe \u003Cfile> \u003CType>",[515,521,522],{},"Print a type's shape as context for the agent.",[500,524,525,530],{},[515,526,527],{},[183,528,529],{},"gen \u003Cfile> \u003CType>",[515,531,532],{},"Scaffold the source file with the blanks the agent fills.",[500,534,535,540],{},[515,536,537],{},[183,538,539],{},"gen … --update",[515,541,542],{},"Re-sync the file after a type change, keeping your filled-in values.",[500,544,545,550],{},[515,546,547],{},[183,548,549],{},"gen … --prune",[515,551,552],{},"Clean up entries left behind by deleted types or fields.",[500,554,555,560],{},[515,556,557],{},[183,558,559],{},"check [files]",[515,561,562],{},"Validate the filled-in data against your types. Good for CI and pre-commit.",[133,564,565,566,569],{},"These map cleanly onto ",[145,567,568],{},"MCP tools",", so any agent (Claude Code, Cursor, your own) can drive the whole thing.",[571,572,573,574,577,578,581,582,585,586,589],"note",{},"Shipped today: the ",[183,575,576],{},"FriendlyType\u003CT>"," \u002F ",[183,579,580],{},"MockData\u003CT>"," types (checked against your type by your own TypeScript compiler), the ",[183,583,584],{},"createFriendly"," renderer, and the ",[183,587,588],{},"createMockType({ data })"," integration. The CLI and the always-on build diagnostics described here are in active development.",[591,592],"hr",{},[133,594,595,596,257,600,603],{},"Next, the two kinds of data themselves: ",[597,598,599],"a",{"href":65},"human-readable labels & errors",[597,601,602],{"href":69},"real-world mock data",".",[605,606,607],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}","How AI agents and the compiler work together to enrich your types.","md",null,{"toc":18},true,{"title":61,"description":608},"cQkLp3nUSaPAj0putZDGiTv4mkaiTZnOItDRrDO0-4c",[616,618],{"title":50,"path":51,"stem":52,"description":617,"children":-1},"Extend RunTypes with pure inline helpers and your own formats and mock generators.",{"title":64,"path":65,"stem":66,"description":619,"children":-1},"Human-readable labels and error messages for a type.",1781995977193]