[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F52A30PRF3CKWR02SPJ5V9":3,"skill-same:01M7F52A30PRF3CKWR02SPJ5V9":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7F52A30PRF3CKWR02SPJ5V9","data-model",null,"The craft of a data change: for each entity, the migration, the existing rows, the indexes, the queries, the backfill, the rollback and the order of shipping. Use when a plan adds or changes a table, a field, an index or a migration.","lamtran8401\u002Fnook","lamtran8401","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F91517229?v=4","01M7F5172CY814PXRBJG6TWAAC","Trần Vũ Lam","01M7F5173D7DJEW5XS3V04KC1V",0,"MIT","https:\u002F\u002Fgithub.com\u002Flamtran8401\u002Fnook\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fdata-model\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: data-model\ndescription: \"The craft of a data change: for each entity, the migration, the existing rows, the indexes, the queries, the backfill, the rollback and the order of shipping. Use when a plan adds or changes a table, a field, an index or a migration.\"\nuser-invocable: false\n---\n\nGoal: the cost, the order and the way back of a data change, visible before the owner approves the plan.\nData changes are the hardest to undo. Think about the existing rows first.\nWork from the code and the migration files of the areas. Never connect to a database, and never run a migration.\n\n## Order\n1. List the entities, tables and fields that change, each with the file and line where it is defined today: the entity, the schema file or the migration.\n2. For each change:\n   - the migration: what it does, and whether it locks or rewrites a large table;\n   - the existing rows: nulls, defaults, constraints that old rows break;\n   - the indexes: which the new queries need, and what an index build costs;\n   - the queries and the code that read the table.\n3. The backfill, when old rows need new values: how, in which batches, who runs it.\n4. The rollback: how to undo the change, and what data the undo loses. Say plainly when a step cannot be undone.\n5. The order of the migrations and the code: expand, deploy the code, then contract.\n6. What you could not check: the size of the tables, the settings of production.\n\n```\nShipment (bff src\u002Fentities\u002Fshipment.ts:12, table shipments)\n- Change: index on status. Migration: additive; the build locks writes on a large table unless it runs concurrently.\n- Existing rows: unchanged. Queries: list.ts:51 filters on status and uses the index.\n- Backfill: none. Rollback: drop the index; loses nothing.\nRisks: the index build at peak. Order: the index, then the bff, then the frontend. Hard to undo: none.\nNot checked: the size of shipments in production; whether the migration tool runs concurrent index builds.\n```\n\n## Gotchas\n- A migration that is safe on an empty table can lock a large one. Say what you do not know about the size.\n- Prefer expand, then contract: add the new form, move the code, then remove the old form.\n- A step that cannot be undone is the owner's to time. Say so.\n- Do not guess a table size or a production setting. Put it under Not checked.\n- A new query with no index is a gap, also when the plan does not name the index.\n","Goal: the cost, the order and the way back of a data change, visible before the owner approves the plan.\nData changes are the hardest to undo. Think about the existing rows first.\nWork from the code and the migration files of the areas. Never connect to a database, and never run a migration.\n\n## Order\n1. List the entities, tables and fields that change, each with the file and line where it is defined today: the entity, the schema file or the migration.\n2. For each change:\n   - the migration: what it does, and whether it locks or rewrites a large table;\n   - the existing rows: nulls, defaults, constraints that old rows break;\n   - the indexes: which the new queries need, and what an index build costs;\n   - the queries and the code that read the table.\n3. The backfill, when old rows need new values: how, in which batches, who runs it.\n4. The rollback: how to undo the change, and what data the undo loses. Say plainly when a step cannot be undone.\n5. The order of the migrations and the code: expand, deploy the code, then contract.\n6. What you could not check: the size of the tables, the settings of production.\n\n```\nShipment (bff src\u002Fentities\u002Fshipment.ts:12, table shipments)\n- Change: index on status. Migration: additive; the build locks writes on a large table unless it runs concurrently.\n- Existing rows: unchanged. Queries: list.ts:51 filters on status and uses the index.\n- Backfill: none. Rollback: drop the index; loses nothing.\nRisks: the index build at peak. Order: the index, then the bff, then the frontend. Hard to undo: none.\nNot checked: the size of shipments in production; whether the migration tool runs concurrent index builds.\n```\n\n## Gotchas\n- A migration that is safe on an empty table can lock a large one. Say what you do not know about the size.\n- Prefer expand, then contract: add the new form, move the code, then remove the old form.\n- A step that cannot be undone is the owner's to time. Say so.\n- Do not guess a table size or a production setting. Put it under Not checked.\n- A new query with no index is a gap, also when the plan does not name the index.\n",{"name":5,"description":7,"user-invocable":20},"main","0b3b58696520a442b4b4f87c1c5a5ac760c03120","plugin\u002Fskills\u002Fdata-model","https:\u002F\u002Fgithub.com\u002Flamtran8401\u002Fnook","https:\u002F\u002Fgithub.com\u002Flamtran8401","2026-10-27 20:01:54",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add lamtran8401\u002Fnook --skill data-model",{"tool":36,"command":37},"bunx","bunx skills add lamtran8401\u002Fnook --skill data-model",{"tool":39,"command":40},"pnpm","pnpm dlx skills add lamtran8401\u002Fnook --skill data-model","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flamtran8401\u002Fnook\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fdata-model\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M7F55NA9ZJEBZ27S3PN5ZN0J","yolo","Run an item alone from its state to the owner's accept: the lead runs the phases, records each guess, passes the plan gate with proceed, and stops at a stop rule. Use when the owner types \u002Fyolo with an id, a prompt, or nothing.","https:\u002F\u002Fgithub.com\u002Flamtran8401\u002Fnook\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fyolo\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7F55GE7WPQCSP3K44BEY0TE","write-walkthrough","Write walkthrough.md, the explanation of finished work: what works now in plain words, the changed files, where to start reading, the key code, the met criteria, how to try it, the risks. It is the source of the Walkthrough tab of the web app. Use after \u002Fqa, or for a question about the code.","https:\u002F\u002Fgithub.com\u002Flamtran8401\u002Fnook\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fwrite-walkthrough\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7F55A7M9W0D5340Y4A8YFB7","wiki-tidy","Find what is wrong in the wiki: broken links, pages with no index line, lines too near the code, stale epic pages, topics with no source, two pages on one topic, adjectives with no example. Fix the mechanical part after one yes; list the rest. Use when the owner says tidy the wiki, or after many pages changed.","https:\u002F\u002Fgithub.com\u002Flamtran8401\u002Fnook\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fwiki-tidy\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7F555A8JJHX4Q61Q06B6DBS","wiki-merge","Merge related wiki pages into one complete page: the pages of the features of one process or epic become one page with the flow from end to end. The old pages move to the archive after the owner's yes, and their links point at the new page. Use when the owner says merge these pages, or when wiki-tidy finds pages on one topic.","https:\u002F\u002Fgithub.com\u002Flamtran8401\u002Fnook\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fwiki-merge\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7F551S3NHQ0JVT0KGM36WPQ","wiki-ask","Answer a question from the wiki: the index first, then only the pages whose line matches, an answer in a few lines with a link to each page. Use when the owner asks what the wiki says, or asks why or how about a known topic. Not to add a page: wiki-add.","https:\u002F\u002Fgithub.com\u002Flamtran8401\u002Fnook\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fwiki-ask\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7F54XC5YQK6KVXJVPZ6NDM4","wiki-add","Keep the lesson of a source in the wiki: a page in the shelf business\u002F or tech\u002F with its main points, a real example for each, the gotchas and the link of the source; written after the owner's yes. Use when the owner says add this to the wiki, keep this, or gives a PRD, a ticket, notes or an article to keep.","https:\u002F\u002Fgithub.com\u002Flamtran8401\u002Fnook\u002Fblob\u002Fmain\u002Fplugin\u002Fskills\u002Fwiki-add\u002FSKILL.md",[],[]]