[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6JPM81ADWZSWNVPBHRGKGMR":3,"skill-same:01M6JPM81ADWZSWNVPBHRGKGMR":79},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":14,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M6JPM81ADWZSWNVPBHRGKGMR","data-modeling",null,"Design database schemas, relationships, indexes, and migration strategies — relational and document stores. Triggers: data model, schema design, ER diagram, database schema, table design, foreign key, index strategy, normalization, denormalization, migration plan, document model, partition key.","SWEStash\u002Fswe-workflow-skills","SWEStash","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F272895713?v=4","01M6JNRQ84JN5WFK9S1V5H4G46","SWE Stash","01M6JNRQCM45X8WPNHY30TSAB0",1,"MIT","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fml\u002Fskills\u002Fdata-modeling\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"data modeling","data","modeling","denormalization","design","database schema","triggers","strategies","document","er","schema design","schema","partition","strategy","model","table","plan","normalization","database","diagram","2026-11-10 10:12:30",false,"---\nname: data-modeling\ndescription: \"Design database schemas, relationships, indexes, and migration strategies — relational and document stores. Triggers: data model, schema design, ER diagram, database schema, table design, foreign key, index strategy, normalization, denormalization, migration plan, document model, partition key.\"\n---\n\n# Data Modeling\n\nGuide the user through designing data models that are normalized, consistent, and evolvable. Good data models make the right things easy and the wrong things hard.\n\n## Workflow\n\n### Step 0: Inventory What Already Exists\n\nIf any database exists, establish what it already holds before proposing a\nsingle new table, column, or index. Inspect the current schema **directly** —\ndon't infer it from the requirements, the ORM models, or memory. Dump it from\nthe live database where you can reach one, otherwise read the migration history\nend to end.\n\nCover both:\n\n- **Artifacts** — existing tables, columns, and indexes that hold, or could\n  hold, the fact in question. Grep for the concept by name and by synonym; the\n  right table is often named for a different concern than the one you're serving.\n- **Written decisions** — ADRs, schema conventions, and prior audit findings\n  that already constrain the shape.\n\n**Exit condition** — one line, then keep going in the same response:\n*\"`\u003Cexisting table>` already stores `\u003Cfact>`; it does \u002F does not serve this\nbecause `\u003Creason>`.\"*\n\n**This step is not a gate on delivering.** Greenfield — no database yet, or none\nyou can reach — closes it in one line: say so and go straight to Step 1. When\nyou can't inspect (no repo access, a conversational answer), name what you would\ncheck and continue under stated assumptions. Never answer a schema request with\ninventory and questions alone; produce the model in the same reply.\n\nThis constrains the input, not the choice. A new table is a fine outcome; an\nunexamined one isn't — and a second home for the same fact is duplication\nhowever well it's named.\n\n### Step 1: Understand the Domain\n\nBefore touching schemas, understand the business domain:\n\n- **What are the core entities?** (nouns in the requirements: User, Order, Product)\n- **What are the relationships?** (verbs: User *places* Order, Order *contains* Products)\n- **What are the cardinalities?** (one-to-one, one-to-many, many-to-many)\n- **What are the access patterns?** (how will the data be queried most often)\n- **What are the invariants?** (rules that must always hold: \"an order must have at least one item\")\n\nIf the user describes a feature rather than a domain, extract the entities from the feature description first.\n\n### Step 2: Design the Conceptual Model\n\nProduce an entity-relationship description listing:\n\n- Each entity with its key attributes\n- Relationships with cardinality (1:1, 1:N, M:N)\n- Business rules that constrain the model\n\nPresent this as a structured list or ASCII diagram. Don't jump to SQL yet — validate the conceptual model with the user first.\n\n### Step 3: Apply Normalization\n\nDesign tables following normalization principles:\n\n- **1NF**: No repeating groups; every column holds atomic values\n- **2NF**: Every non-key column depends on the whole primary key\n- **3NF**: No transitive dependencies (non-key → non-key)\n\nDenormalize only with explicit justification (specific read performance requirement with measured data). Document every denormalization decision and the access pattern it serves.\n\n### Step 4: Define the Physical Schema\n\nProduce SQL DDL or ORM model definitions. For each table include:\n\n- Primary key strategy (auto-increment, UUID, ULID — justify the choice)\n- Foreign keys with ON DELETE\u002FON UPDATE behavior\n- Indexes based on identified access patterns\n- Constraints (NOT NULL, UNIQUE, CHECK) that enforce business rules\n- Timestamps (created_at, updated_at) as appropriate\n\nUse [templates\u002Fschema.md](templates\u002Fschema.md) as a starting point for table DDL, index naming, enum patterns, and migration file structure.\n\n### Step 5: Plan the Migration\n\nIf modifying an existing schema:\n\n- **Backwards-compatible changes**: Add columns with defaults, add tables, add indexes\n- **Breaking changes**: Require a migration strategy (expand-contract pattern)\n- **Data backfills**: Script them, don't do them manually\n\nProduce migration files appropriate to the ORM\u002Fframework in use. Each migration should be independently reversible.\n\n### Step 6: Validate\n\nCross-check the schema against:\n\n- [ ] Every acceptance criterion from the feature plan can be served by the schema\n- [ ] Every identified access pattern has an appropriate index\n- [ ] Every business invariant is enforced by constraints\n- [ ] No data can be orphaned (foreign keys and cascades are correct)\n- [ ] The migration is reversible\n\n## Principles Applied\n\n- **DRY**: Single source of truth for each piece of data\n- **KISS**: Start normalized; denormalize only when measured performance demands it\n- **Functional Independence**: Each table represents one concept\n- **YAGNI**: Don't add columns or tables \"just in case\"\n","# Data Modeling\n\nGuide the user through designing data models that are normalized, consistent, and evolvable. Good data models make the right things easy and the wrong things hard.\n\n## Workflow\n\n### Step 0: Inventory What Already Exists\n\nIf any database exists, establish what it already holds before proposing a\nsingle new table, column, or index. Inspect the current schema **directly** —\ndon't infer it from the requirements, the ORM models, or memory. Dump it from\nthe live database where you can reach one, otherwise read the migration history\nend to end.\n\nCover both:\n\n- **Artifacts** — existing tables, columns, and indexes that hold, or could\n  hold, the fact in question. Grep for the concept by name and by synonym; the\n  right table is often named for a different concern than the one you're serving.\n- **Written decisions** — ADRs, schema conventions, and prior audit findings\n  that already constrain the shape.\n\n**Exit condition** — one line, then keep going in the same response:\n*\"`\u003Cexisting table>` already stores `\u003Cfact>`; it does \u002F does not serve this\nbecause `\u003Creason>`.\"*\n\n**This step is not a gate on delivering.** Greenfield — no database yet, or none\nyou can reach — closes it in one line: say so and go straight to Step 1. When\nyou can't inspect (no repo access, a conversational answer), name what you would\ncheck and continue under stated assumptions. Never answer a schema request with\ninventory and questions alone; produce the model in the same reply.\n\nThis constrains the input, not the choice. A new table is a fine outcome; an\nunexamined one isn't — and a second home for the same fact is duplication\nhowever well it's named.\n\n### Step 1: Understand the Domain\n\nBefore touching schemas, understand the business domain:\n\n- **What are the core entities?** (nouns in the requirements: User, Order, Product)\n- **What are the relationships?** (verbs: User *places* Order, Order *contains* Products)\n- **What are the cardinalities?** (one-to-one, one-to-many, many-to-many)\n- **What are the access patterns?** (how will the data be queried most often)\n- **What are the invariants?** (rules that must always hold: \"an order must have at least one item\")\n\nIf the user describes a feature rather than a domain, extract the entities from the feature description first.\n\n### Step 2: Design the Conceptual Model\n\nProduce an entity-relationship description listing:\n\n- Each entity with its key attributes\n- Relationships with cardinality (1:1, 1:N, M:N)\n- Business rules that constrain the model\n\nPresent this as a structured list or ASCII diagram. Don't jump to SQL yet — validate the conceptual model with the user first.\n\n### Step 3: Apply Normalization\n\nDesign tables following normalization principles:\n\n- **1NF**: No repeating groups; every column holds atomic values\n- **2NF**: Every non-key column depends on the whole primary key\n- **3NF**: No transitive dependencies (non-key → non-key)\n\nDenormalize only with explicit justification (specific read performance requirement with measured data). Document every denormalization decision and the access pattern it serves.\n\n### Step 4: Define the Physical Schema\n\nProduce SQL DDL or ORM model definitions. For each table include:\n\n- Primary key strategy (auto-increment, UUID, ULID — justify the choice)\n- Foreign keys with ON DELETE\u002FON UPDATE behavior\n- Indexes based on identified access patterns\n- Constraints (NOT NULL, UNIQUE, CHECK) that enforce business rules\n- Timestamps (created_at, updated_at) as appropriate\n\nUse [templates\u002Fschema.md](templates\u002Fschema.md) as a starting point for table DDL, index naming, enum patterns, and migration file structure.\n\n### Step 5: Plan the Migration\n\nIf modifying an existing schema:\n\n- **Backwards-compatible changes**: Add columns with defaults, add tables, add indexes\n- **Breaking changes**: Require a migration strategy (expand-contract pattern)\n- **Data backfills**: Script them, don't do them manually\n\nProduce migration files appropriate to the ORM\u002Fframework in use. Each migration should be independently reversible.\n\n### Step 6: Validate\n\nCross-check the schema against:\n\n- [ ] Every acceptance criterion from the feature plan can be served by the schema\n- [ ] Every identified access pattern has an appropriate index\n- [ ] Every business invariant is enforced by constraints\n- [ ] No data can be orphaned (foreign keys and cascades are correct)\n- [ ] The migration is reversible\n\n## Principles Applied\n\n- **DRY**: Single source of truth for each piece of data\n- **KISS**: Start normalized; denormalize only when measured performance demands it\n- **Functional Independence**: Each table represents one concept\n- **YAGNI**: Don't add columns or tables \"just in case\"\n",{"name":5,"description":7},"main","800dc9ad0ca2914d6ad15b8c5159d9b57bb104c2","plugins\u002Fml\u002Fskills\u002Fdata-modeling","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills","https:\u002F\u002Fgithub.com\u002FSWEStash","A stash of things we felt like building","2026-11-12 00:14:33",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add SWEStash\u002Fswe-workflow-skills --skill data-modeling",{"tool":57,"command":58},"bunx","bunx skills add SWEStash\u002Fswe-workflow-skills --skill data-modeling",{"tool":60,"command":61},"pnpm","pnpm dlx skills add SWEStash\u002Fswe-workflow-skills --skill data-modeling","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fml\u002Fskills\u002Fdata-modeling\u002FSKILL.md",true,[65,71,75],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"evals\u002Fevals.json","REFERENCE","参考文档",3322,"https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fml\u002Fskills\u002Fdata-modeling\u002Fevals\u002Fevals.json",{"path":72,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fconventions.md",2631,"https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fml\u002Fskills\u002Fdata-modeling\u002Freferences\u002Fconventions.md",{"path":76,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":77,"sourceHtmlUrl":78},"templates\u002Fschema.md",4252,"https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fml\u002Fskills\u002Fdata-modeling\u002Ftemplates\u002Fschema.md",[80,106,132,155,180,204],{"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":39},"01M6JQFADV3T1MS9V1BNZS1232","writing-skills","Use when authoring, editing, or reviewing a skill in this library — a new SKILL.md, one that under-triggers, or hardening an existing one. Covers description and listing-budget rules, frontmatter, progressive disclosure, the 3-eval rule, and pressure-testing against rationalizations.","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[87,88,89,90,91,92,93,94,95,96,97,98,25,99,100,101,102,103,104,105],"writing","writing skills","testing","eval","write","edit","Budget","authoring","new skill","library","frontmatter","editing","use","Existing","Rules","write a skill","when","listing","progressive disclosure",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":39},"01M6JQF5DGMXPMQQVZBP8DH9SY","working-agreement","Define and validate how a multi-session project is run — where plans, status and decisions live, session routines, new work, milestone close. README\u002FCONTRIBUTING → project-documentation.","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fskills\u002Fworking-agreement\u002FSKILL.md",[],[113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,25,131],"working agreement","project","definition of done","done","milestone","documentation","work","progress","how","contributing","close","run","sync","status","live","do","README","session","routines",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":39},"01M6JQF0SMRHN82RBSWMABC4J0","verification-before-completion","Evidence gate before any claim that work is done, fixed, passing, or deployed. Route here when a message declares the work finished or asks to commit, push, merge, ship, or close it out, including a brief sign-off, and before git-workflow or release-management act on it. Writing the commit message or PR text itself → git-workflow.","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[139,140,141,142,143,144,87,145,116,146,147,148,119,149,123,150,151,152,153,154],"verification","verification before completion","brief","ready","fix","claim","workflow","commit","text","route","message","merge","release","git","act","ship",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":39},"01M6JQEVGE9NJZ11DV60AE6VWC","ui-ux-design","Design user experiences from an engineer's perspective — user flows, wireframes, interaction patterns, responsive strategy, navigation, loading\u002Ferror\u002Fempty states. Triggers: design the UI, user flow, wireframe, how should this screen look, loading state, error state, empty state, responsive design, navigation, page layout, form design, mockup.","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fskills\u002Fui-ux-design\u002FSKILL.md",[],[23,162,163,164,165,166,167,168,169,170,171,172,121,173,174,175,176,177,178,179],"ux","ui","ui ux design","error","states","loading","flows","engineer","interaction","layout","responsive design","screen","flow","patterns","mockup","responsive","form","page",{"skillNo":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":186,"publishedAt":39},"01M6JQEN4HVFTZWQYWGTDS76K9","threat-modeling","Design-time security analysis of a system or feature before it's built — trust boundaries, attack surface, STRIDE per element, abuse cases, prioritized mitigations that become security requirements. Triggers: threat model, STRIDE, trust boundary, attack surface, what could go wrong security-wise, security design review, abuse case, secure this design, security requirements. Reviewing EXISTING code\u002Fconfig for vulnerabilities → security-audit; use this skill while the design is still on the whiteboard.","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fskills\u002Fthreat-modeling\u002FSKILL.md",[],[21,187,188,33,189,190,23,191,192,193,194,195,196,197,198,199,200,201,202,203],"threat modeling","threat","time","element","whiteboard","security analysis","analysis","code","review","threat model","audit","security-audit","secure","config","go","security","trust",{"skillNo":205,"name":206,"nameZh":6,"description":207,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":208,"categories":209,"keywords":210,"publishedAt":39},"01M6JQEFT7VT3FQM16170EG9FW","test-suite-design","Design comprehensive test suites for existing code — strategy across unit\u002Fintegration\u002Fe2e, fixtures, factories, helpers. Triggers: add tests, write tests for, increase coverage, test this module, testing strategy, test plan, what tests do I need, test infrastructure, test helpers, this has no tests. Not for TDD — use tdd-workflow.","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftest-suite-design\u002FSKILL.md",[],[23,211,212,213,214,215,89,216,217,145,194,218,35,91,219,220,128,221,222,25],"test suite","test","test suite design","coverage","unit","write tests","testing strategy","across","add","infrastructure","test plan","for"]