[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75DBPNE1XBCTD5XPJDBQ6D4":3,"skill-same:01M75DBPNE1XBCTD5XPJDBQ6D4":43},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M75DBPNE1XBCTD5XPJDBQ6D4","swap-data-domain",null,"Use when replacing the demo accounts\u002FMRR data with your own domain — new entity types, seed data, KPIs, chart series, grid columns, or CRUD forms.","nathaniel-lyman\u002Fparts-bin","nathaniel-lyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F212639847?v=4","01M75DAXV0KPY2T75ERWJ6HW10","01M75DAXVND673PXPXAQ863WHJ",0,"MIT","https:\u002F\u002Fgithub.com\u002Fnathaniel-lyman\u002Fparts-bin\u002Fblob\u002Fmain\u002Fskills\u002Fswap-data-domain\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: swap-data-domain\ndescription: Use when replacing the demo accounts\u002FMRR data with your own domain — new entity types, seed data, KPIs, chart series, grid columns, or CRUD forms.\n---\n\n# Swap the Data Domain\n\n## Overview\n\nThe demo domain is SaaS accounts with MRR metrics. Everything derives from\none pipeline, so swap it **in dependency order** — types first, UI wiring\nlast — and the KPIs, charts, and grid all follow. Styling never changes\nduring a domain swap: components stay on token utilities (no raw colors;\n`npm run lint:theme` enforces it).\n\n```\ndata\u002Ftypes.ts → data\u002Faccounts.ts → hooks\u002FuseAccounts → selectors\u002Fmetrics\n                                        │\n                                        └→ grid columns → App.tsx wiring → forms\n```\n\n## The pipeline, step by step\n\n1. **`src\u002Fdata\u002Ftypes.ts`** — redefine the entity. Demo shape: `Account`\n   (`id`, `name`, `owner`, `segment`, `mrr`, `growth`, `status`, `arr`,\n   `since`) with `Segment` and `Status` unions. The chart point types\n   (`MonthlyPoint`, `MovementPoint`) live here too and have segment names\n   baked in — update them as well.\n2. **`src\u002Fdata\u002Faccounts.ts`** — replace the seed rows (`seedAccounts`, 8 of\n   them) and the chart series: `sparks` (four 12-month KPI sparkline arrays),\n   `monthlySeries`, `movementSeries`, `revenueWaterfallSeries`.\n3. **`src\u002Fhooks\u002FuseAccounts.ts`** — in-memory CRUD source of truth:\n   `{ accounts, create, update, remove }` and `NewAccount = Omit\u003CAccount,'id'>`.\n   Usually survives a swap with renames only.\n4. **`src\u002Fselectors\u002Fmetrics.ts`** — pure derive functions feeding the KPI\n   cards and donut. **The demo's status semantics are deliberate; choose\n   yours consciously:** `totalMrr` and `segmentShares` exclude `Churned`,\n   `activeCount` counts only `Active`, `atRiskCount` counts everything\n   non-`Active`, and `avgGrowth` includes `Churned` on purpose (demo\n   parity). Decide the equivalent rules for your statuses and pin them with\n   tests.\n5. **`src\u002Fcomponents\u002FaccountGridColumns.tsx`** — `buildAccountGridColumns()`\n   defines the 9 columns. Keep the `actions` column conventions (fixed\n   width, non-sortable, non-reorderable). Column ids are also hardcoded in\n   two DataGrid files that **must** change with them:\n   - `src\u002Fcomponents\u002FDataGrid\u002Fnormalize.ts` — `DEFAULT_COLUMN_ORDER` (the\n     canonical id list), `MOVABLE_COLUMN_IDS`, and `canonicalOrder()`.\n   - `src\u002Fcomponents\u002FDataGrid\u002Fstate.ts` — `DEFAULT_STATE.columnVisibility`\n     (demo hides `arr`\u002F`since` by default).\n   - `src\u002Fcomponents\u002FDataGrid\u002Fpersistence.ts` — `GRID_STORAGE_KEY` and the\n     legacy-key migration block reference account-domain ids; update or\n     delete the migration when those ids go away.\n6. **`src\u002FApp.tsx` → `DashboardPage`** — the wiring: four `KpiCard`s fed by\n   the selectors + `sparks`, `MrrShareDonut`, the charts, and the `DataGrid`\n   with `persistenceKey='ledger.accounts.grid'`. If the column set changes\n   meaningfully, bump the persistence key so stale saved layouts don't\n   resurrect old columns.\n7. **`src\u002Fcomponents\u002FAccountFormModal.tsx`** + **`ConfirmDialog.tsx`** — the\n   CRUD forms. Update fields and any derived values (demo: `arr = mrr * 12`,\n   `since` defaults to today).\n8. **Update the colocated tests as you touch each layer** — they pin the\n   semantics you chose in step 4: `src\u002Fselectors\u002Fmetrics.test.ts`,\n   `src\u002Fhooks\u002FuseAccounts.test.tsx`,\n   `src\u002Fcomponents\u002FaccountGridColumns.test.tsx`,\n   `src\u002Fcomponents\u002FAccountFormModal.test.tsx`, `src\u002FApp.test.tsx`.\n\nRenaming files\u002Fhooks (`useAccounts` → `useOrders`, …) is optional polish; the\nswap works with the original names. Global grid search matches name **and**\nowner (`accountGlobalFilter`) — re-point it at your domain's searchable fields.\n\n## Verify\n\nFollow `skills\u002Fverify-changes\u002FSKILL.md` — all gates. The build (`tsc -b`)\nwill surface every wiring point you missed after a type change; that's the\nfastest way to find stragglers.\n\n## Common mistakes\n\n| Mistake | Fix |\n|---|---|\n| Started in App.tsx, working backwards | Go types-first; `npm run build` then lists every downstream break |\n| Copied status-exclusion rules blindly | They're domain decisions (step 4) — choose and pin with tests |\n| New columns missing from the grid | Add ids to `DEFAULT_COLUMN_ORDER` (`normalize.ts`) and visibility (`state.ts`), not just the column defs |\n| Old grid layout reappears after swap | Bump the `persistenceKey` (stale localStorage view) |\n| Seed data changed, sparklines didn't | `sparks`\u002Fseries in `data\u002Faccounts.ts` are separate from the rows |\n","# Swap the Data Domain\n\n## Overview\n\nThe demo domain is SaaS accounts with MRR metrics. Everything derives from\none pipeline, so swap it **in dependency order** — types first, UI wiring\nlast — and the KPIs, charts, and grid all follow. Styling never changes\nduring a domain swap: components stay on token utilities (no raw colors;\n`npm run lint:theme` enforces it).\n\n```\ndata\u002Ftypes.ts → data\u002Faccounts.ts → hooks\u002FuseAccounts → selectors\u002Fmetrics\n                                        │\n                                        └→ grid columns → App.tsx wiring → forms\n```\n\n## The pipeline, step by step\n\n1. **`src\u002Fdata\u002Ftypes.ts`** — redefine the entity. Demo shape: `Account`\n   (`id`, `name`, `owner`, `segment`, `mrr`, `growth`, `status`, `arr`,\n   `since`) with `Segment` and `Status` unions. The chart point types\n   (`MonthlyPoint`, `MovementPoint`) live here too and have segment names\n   baked in — update them as well.\n2. **`src\u002Fdata\u002Faccounts.ts`** — replace the seed rows (`seedAccounts`, 8 of\n   them) and the chart series: `sparks` (four 12-month KPI sparkline arrays),\n   `monthlySeries`, `movementSeries`, `revenueWaterfallSeries`.\n3. **`src\u002Fhooks\u002FuseAccounts.ts`** — in-memory CRUD source of truth:\n   `{ accounts, create, update, remove }` and `NewAccount = Omit\u003CAccount,'id'>`.\n   Usually survives a swap with renames only.\n4. **`src\u002Fselectors\u002Fmetrics.ts`** — pure derive functions feeding the KPI\n   cards and donut. **The demo's status semantics are deliberate; choose\n   yours consciously:** `totalMrr` and `segmentShares` exclude `Churned`,\n   `activeCount` counts only `Active`, `atRiskCount` counts everything\n   non-`Active`, and `avgGrowth` includes `Churned` on purpose (demo\n   parity). Decide the equivalent rules for your statuses and pin them with\n   tests.\n5. **`src\u002Fcomponents\u002FaccountGridColumns.tsx`** — `buildAccountGridColumns()`\n   defines the 9 columns. Keep the `actions` column conventions (fixed\n   width, non-sortable, non-reorderable). Column ids are also hardcoded in\n   two DataGrid files that **must** change with them:\n   - `src\u002Fcomponents\u002FDataGrid\u002Fnormalize.ts` — `DEFAULT_COLUMN_ORDER` (the\n     canonical id list), `MOVABLE_COLUMN_IDS`, and `canonicalOrder()`.\n   - `src\u002Fcomponents\u002FDataGrid\u002Fstate.ts` — `DEFAULT_STATE.columnVisibility`\n     (demo hides `arr`\u002F`since` by default).\n   - `src\u002Fcomponents\u002FDataGrid\u002Fpersistence.ts` — `GRID_STORAGE_KEY` and the\n     legacy-key migration block reference account-domain ids; update or\n     delete the migration when those ids go away.\n6. **`src\u002FApp.tsx` → `DashboardPage`** — the wiring: four `KpiCard`s fed by\n   the selectors + `sparks`, `MrrShareDonut`, the charts, and the `DataGrid`\n   with `persistenceKey='ledger.accounts.grid'`. If the column set changes\n   meaningfully, bump the persistence key so stale saved layouts don't\n   resurrect old columns.\n7. **`src\u002Fcomponents\u002FAccountFormModal.tsx`** + **`ConfirmDialog.tsx`** — the\n   CRUD forms. Update fields and any derived values (demo: `arr = mrr * 12`,\n   `since` defaults to today).\n8. **Update the colocated tests as you touch each layer** — they pin the\n   semantics you chose in step 4: `src\u002Fselectors\u002Fmetrics.test.ts`,\n   `src\u002Fhooks\u002FuseAccounts.test.tsx`,\n   `src\u002Fcomponents\u002FaccountGridColumns.test.tsx`,\n   `src\u002Fcomponents\u002FAccountFormModal.test.tsx`, `src\u002FApp.test.tsx`.\n\nRenaming files\u002Fhooks (`useAccounts` → `useOrders`, …) is optional polish; the\nswap works with the original names. Global grid search matches name **and**\nowner (`accountGlobalFilter`) — re-point it at your domain's searchable fields.\n\n## Verify\n\nFollow `skills\u002Fverify-changes\u002FSKILL.md` — all gates. The build (`tsc -b`)\nwill surface every wiring point you missed after a type change; that's the\nfastest way to find stragglers.\n\n## Common mistakes\n\n| Mistake | Fix |\n|---|---|\n| Started in App.tsx, working backwards | Go types-first; `npm run build` then lists every downstream break |\n| Copied status-exclusion rules blindly | They're domain decisions (step 4) — choose and pin with tests |\n| New columns missing from the grid | Add ids to `DEFAULT_COLUMN_ORDER` (`normalize.ts`) and visibility (`state.ts`), not just the column defs |\n| Old grid layout reappears after swap | Bump the `persistenceKey` (stale localStorage view) |\n| Seed data changed, sparklines didn't | `sparks`\u002Fseries in `data\u002Faccounts.ts` are separate from the rows |\n",{"name":5,"description":7},"main","5dd5fff030a1246374fe1c4b57210cfc13732f9e","skills\u002Fswap-data-domain","https:\u002F\u002Fgithub.com\u002Fnathaniel-lyman\u002Fparts-bin","https:\u002F\u002Fgithub.com\u002Fnathaniel-lyman","2026-10-29 18:49:15",{"source":8,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add nathaniel-lyman\u002Fparts-bin --skill swap-data-domain",{"tool":35,"command":36},"bunx","bunx skills add nathaniel-lyman\u002Fparts-bin --skill swap-data-domain",{"tool":38,"command":39},"pnpm","pnpm dlx skills add nathaniel-lyman\u002Fparts-bin --skill swap-data-domain","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnathaniel-lyman\u002Fparts-bin\u002Fblob\u002Fmain\u002Fskills\u002Fswap-data-domain\u002FSKILL.md",true,[],[44,51,58,65,70,75],{"skillNo":45,"name":46,"nameZh":6,"description":47,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":48,"categories":49,"keywords":50,"publishedAt":18},"01M75DBRTKD0EWS59Z2QY9Z19M","verify-changes","Use before claiming any change to this repo is done, fixed, or passing — and when a build fails after tests passed, a color sneaks past lint, or a localStorage test misbehaves.","https:\u002F\u002Fgithub.com\u002Fnathaniel-lyman\u002Fparts-bin\u002Fblob\u002Fmain\u002Fskills\u002Fverify-changes\u002FSKILL.md",[],[],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M75DBKPNENC9H1MYXN2Y7PBT","retheme","Use when re-skinning this dashboard to a new brand or palette — changing colors, accent, dark mode, radii, fonts, or chart colors, or when asked to \"make it match my brand\".","https:\u002F\u002Fgithub.com\u002Fnathaniel-lyman\u002Fparts-bin\u002Fblob\u002Fmain\u002Fskills\u002Fretheme\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M75DBHFVBX7ZM9JFPY4KYAB8","add-component","Use when adding or substantially modifying any UI component in this repo — before writing the first line of JSX.","https:\u002F\u002Fgithub.com\u002Fnathaniel-lyman\u002Fparts-bin\u002Fblob\u002Fmain\u002Fskills\u002Fadd-component\u002FSKILL.md",[],[],{"skillNo":66,"name":46,"nameZh":6,"description":47,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M75DBEKJRMF50NX8GB4494S6","https:\u002F\u002Fgithub.com\u002Fnathaniel-lyman\u002Fparts-bin\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fverify-changes\u002FSKILL.md",[],[],{"skillNo":71,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M75DBBYPQ61R4R337F30FCZ9","https:\u002F\u002Fgithub.com\u002Fnathaniel-lyman\u002Fparts-bin\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fswap-data-domain\u002FSKILL.md",[],[],{"skillNo":76,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M75DBA6DGYN01RTY28K712BN","https:\u002F\u002Fgithub.com\u002Fnathaniel-lyman\u002Fparts-bin\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fretheme\u002FSKILL.md",[],[]]