[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7921MAYG7PYYH59K3XKS3ME":3,"skill-same:01M7921MAYG7PYYH59K3XKS3ME":48},{"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":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7921MAYG7PYYH59K3XKS3ME","tidy-next-codebase",null,"Audit a Next.js codebase for stale\u002Fdead code and duplication, turn the findings into a fully deterministic cleanup plan, then execute it as a gated, sequential background workflow. Pure refactor — no behaviour\u002FUX regressions, no DB\u002Fschema changes. Use when the user wants to tidy, clean up, de-duplicate, consolidate, or refactor-audit a Next.js codebase (often after a large change), or invokes \u002Ftidy-next-codebase.","dotlas\u002Fskills","dotlas","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F88832003?v=4","01M791ZCS9BAQ40PZ8ADG8TCR1","Dotlas","01M791ZCT18PGXY969S8EZ1MVV",2,"MIT","https:\u002F\u002Fgithub.com\u002Fdotlas\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcustom\u002Fcoding\u002Ftidy-next-codebase\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tidy-next-codebase\ndescription: Audit a Next.js codebase for stale\u002Fdead code and duplication, turn the findings into a fully deterministic cleanup plan, then execute it as a gated, sequential background workflow. Pure refactor — no behaviour\u002FUX regressions, no DB\u002Fschema changes. Use when the user wants to tidy, clean up, de-duplicate, consolidate, or refactor-audit a Next.js codebase (often after a large change), or invokes \u002Ftidy-next-codebase.\n---\n# Tidy Next Codebase\n\nAudit → deterministic plan → gated execution.\nThe goal is a codebase with no dead weight and no duplicated definitions, reached\nwithout changing what the app does.\n\n## Invariants\n\n- **Pure refactor.** Preserve all runtime behaviour, UI, UX, and public API. Data-layer\n  rewrites must be result-identical (same columns\u002Ffilters\u002Forder).\n  The ONLY allowed behaviour change is one the user explicitly approves.\n- **No DB\u002Fschema changes.**\n- **Never commit or push** — leave changes in the working tree for review (unless the\n  user says otherwise).\n- **Preserve uncommitted WIP.** Read a file’s current content before editing; never\n  revert or clobber unrelated changes.\n- **Honour the repo’s own conventions.** Read `CLAUDE.md`\u002F`AGENTS.md`\u002F`.cursorrules` and\n  any `docs`\u002Finstruction files; match its component model, import boundaries, naming,\n  and lint rules. Don’t impose conventions it doesn’t use.\n- **Verify before acting.** A “duplicate” or “orphan” is a hypothesis until you read\n  both sides \u002F grep for importers.\n  Discard false positives.\n\n## Orient\n\n- Detect from `package.json` + `turbo.json`\u002Fmonorepo config: the package manager and the\n  **exact** typecheck \u002F lint \u002F test \u002F build commands (record them).\n  Detect the data layer (tRPC, REST handlers, server actions), ORM, state library, and\n  linter.\n- Establish a clean baseline: run the typecheck command and require it **green before\n  changing anything**. If it’s red, surface that and stop.\n- Map the app: routes & route groups, shared-component locations, data\u002Frouter files,\n  schema & type modules, stores, lib\u002Futils.\n\n## Investigate\n\nFan out independent read-only agents — one per dimension — each instructed to cite\n`file:line` evidence and rate severity + removal risk:\n\n1. **Dead\u002Fstale** — files with zero importers (exclude framework entrypoints:\n   `page`\u002F`layout`\u002F`route`\u002F`loading`\u002F`error`\u002F`middleware`\u002Fetc.), references to deleted\n   modules, unused exports\u002Froutes, mock or placeholder endpoints with no callers,\n   dormant-but-still-wired features, and names left misleading after a move\u002Frename.\n2. **Data layer** — duplicate or overlapping procedures\u002Froute-handlers\u002Fqueries; repeated\n   query\u002FSQL\u002Ffilter fragments; validation schemas declared inline that belong in the\n   shared schema layer.\n3. **UI components** — the same component re-implemented across pages (card\u002Fpanel\n   shells, avatars, toolbars, table wrappers, empty\u002Fskeleton states); inline\n   subcomponents repeated; hand-rolled equivalents of primitives that already exist.\n4. **Helpers \u002F constants \u002F types \u002F schemas** — duplicated formatting\u002Fconversion\u002Fdate\n   logic; repeated constants or enums; types that restate what TypeScript infers;\n   overlapping schemas.\n5. **State** — the same state defined in multiple stores, triplicated derivations,\n   shared-persist-key or scoping bugs.\n6. **Comments:**\n   - Commented-out code and edit-narration remnants (`”fixed…”`, `”now we…”`) → remove.\n   - A comment that hides a real caveat → rewrite as `NOTE:` or `TODO:`.\n   - Genuine WHY-comments → leave untouched.\n\nThen read the high-value\u002Fhigh-risk findings yourself to confirm them.\nDistinguish **exact** duplicates (extract as-is) from **variations** (need a\nparameterised shared module, not a naive merge).\n\n## Resolve scope with the user\n\nAsk, in one batch and with a recommended answer each, ONLY what you cannot decide from\nthe code:\n- **Depth** — which dimensions \u002F risk tiers to include.\n- **Behaviour-change tolerance** — fix a latent bug you found (slight behaviour change)\n  vs strictly no change.\n- **Feature-vs-debris calls only the user knows** — e.g. remove a dormant feature vs\n  keep it as scaffolding.\n\nDecide everything else (module naming, placement, sequencing) yourself.\n\n## Write the closed plan\n\nProduce a **fully deterministic checklist** and save it to\n`\u003Cplans-dir>\u002Ftidy-next-codebase\u002FPLAN.md` (reuse the repo’s existing plans location if it\nhas one). Rules:\n- Every step names the concrete file\u002Fsymbol and the exact change.\n  Banned: “TBD”, “as appropriate”, “handle edge cases”, “if needed”, “etc.”\n  — resolve the decision first, then write the step.\n- Order so each step’s precondition is produced by an earlier step: **deletions →\n  comment cleanup → renames\u002Fmoves → UI consolidation → data-layer consolidation →\n  helper\u002Fschema consolidation → state → docs → verification.**\n- Renames enumerate every import to rewrite.\n  Consolidations list every call site.\n  Each new shared module gets a path + signature.\n- End with a **Done-when** block: typecheck\u002Flint\u002Ftest\u002Fbuild green + zero-reference greps\n  for everything removed + manual parity notes.\n\n## Gate\n\nSummarise the plan (phases, change counts, risk tier, any approved behaviour change) and\nask for **one go-ahead** before executing.\n(If the user chose plan-only, stop here.)\n\n## Execute via a background workflow\n\nLaunch ONE workflow that runs the plan stage-by-stage:\n- **One agent per plan phase** (split oversized phases), run **strictly sequentially** —\n  the stages share one working tree and depend on each other, so parallel edits would\n  corrupt them. Do **not** use worktree isolation.\n- **Plug context into each agent**: a shared PREAMBLE (the invariants above + the exact\n  typecheck command + “do not commit” + “preserve WIP file X” + “return only the\n  structured status”) **plus** that stage’s specific brief (files + exact changes)\n  **plus** a pointer to its phase in `PLAN.md`. No agent reads another’s work — fresh\n  context each stage.\n- **Gate** each stage on the typecheck command staying green; **halt the whole\n  workflow** on the first stage that fails or reports `blocked`.\n- **Structured return** per stage:\n  `{ stage, filesChanged[], filesDeleted[], typecheckPassed, blocked, blockReason, notes }`.\n  Tell agents that conservative deviations (skipping a merge to stay result-identical)\n  are allowed and must be reported in `notes`.\n- **Final stage**: run lint\u002Ftest\u002Fbuild + the zero-reference greps and report; treat\n  unrelated\u002Fpre-existing failures as non-blocking but surface them.\n\nSkeleton:\n```js\nfor (const st of STAGES) {\n  phase(st.title)\n  const r = await agent(PREAMBLE + st.brief, { label: st.title, phase: st.title, schema: STATUS })\n  if (!r || r.blocked || r.typecheckPassed === false) { log('HALT at ' + st.title); return { halted: true, at: st.title, results } }\n  results.push(r)\n}\nreturn { halted: false, results }\n```\n\n## Report\n\nAfter the workflow completes, report:\n- Which stages completed and which halted (with reason).\n- Conservative deviations agents took (skipped merges to stay result-identical).\n- One-line caveats for any pre-existing failures surfaced but not fixed.\n- Confirmation that all changes are uncommitted and ready for review.\n","# Tidy Next Codebase\n\nAudit → deterministic plan → gated execution.\nThe goal is a codebase with no dead weight and no duplicated definitions, reached\nwithout changing what the app does.\n\n## Invariants\n\n- **Pure refactor.** Preserve all runtime behaviour, UI, UX, and public API. Data-layer\n  rewrites must be result-identical (same columns\u002Ffilters\u002Forder).\n  The ONLY allowed behaviour change is one the user explicitly approves.\n- **No DB\u002Fschema changes.**\n- **Never commit or push** — leave changes in the working tree for review (unless the\n  user says otherwise).\n- **Preserve uncommitted WIP.** Read a file’s current content before editing; never\n  revert or clobber unrelated changes.\n- **Honour the repo’s own conventions.** Read `CLAUDE.md`\u002F`AGENTS.md`\u002F`.cursorrules` and\n  any `docs`\u002Finstruction files; match its component model, import boundaries, naming,\n  and lint rules. Don’t impose conventions it doesn’t use.\n- **Verify before acting.** A “duplicate” or “orphan” is a hypothesis until you read\n  both sides \u002F grep for importers.\n  Discard false positives.\n\n## Orient\n\n- Detect from `package.json` + `turbo.json`\u002Fmonorepo config: the package manager and the\n  **exact** typecheck \u002F lint \u002F test \u002F build commands (record them).\n  Detect the data layer (tRPC, REST handlers, server actions), ORM, state library, and\n  linter.\n- Establish a clean baseline: run the typecheck command and require it **green before\n  changing anything**. If it’s red, surface that and stop.\n- Map the app: routes & route groups, shared-component locations, data\u002Frouter files,\n  schema & type modules, stores, lib\u002Futils.\n\n## Investigate\n\nFan out independent read-only agents — one per dimension — each instructed to cite\n`file:line` evidence and rate severity + removal risk:\n\n1. **Dead\u002Fstale** — files with zero importers (exclude framework entrypoints:\n   `page`\u002F`layout`\u002F`route`\u002F`loading`\u002F`error`\u002F`middleware`\u002Fetc.), references to deleted\n   modules, unused exports\u002Froutes, mock or placeholder endpoints with no callers,\n   dormant-but-still-wired features, and names left misleading after a move\u002Frename.\n2. **Data layer** — duplicate or overlapping procedures\u002Froute-handlers\u002Fqueries; repeated\n   query\u002FSQL\u002Ffilter fragments; validation schemas declared inline that belong in the\n   shared schema layer.\n3. **UI components** — the same component re-implemented across pages (card\u002Fpanel\n   shells, avatars, toolbars, table wrappers, empty\u002Fskeleton states); inline\n   subcomponents repeated; hand-rolled equivalents of primitives that already exist.\n4. **Helpers \u002F constants \u002F types \u002F schemas** — duplicated formatting\u002Fconversion\u002Fdate\n   logic; repeated constants or enums; types that restate what TypeScript infers;\n   overlapping schemas.\n5. **State** — the same state defined in multiple stores, triplicated derivations,\n   shared-persist-key or scoping bugs.\n6. **Comments:**\n   - Commented-out code and edit-narration remnants (`”fixed…”`, `”now we…”`) → remove.\n   - A comment that hides a real caveat → rewrite as `NOTE:` or `TODO:`.\n   - Genuine WHY-comments → leave untouched.\n\nThen read the high-value\u002Fhigh-risk findings yourself to confirm them.\nDistinguish **exact** duplicates (extract as-is) from **variations** (need a\nparameterised shared module, not a naive merge).\n\n## Resolve scope with the user\n\nAsk, in one batch and with a recommended answer each, ONLY what you cannot decide from\nthe code:\n- **Depth** — which dimensions \u002F risk tiers to include.\n- **Behaviour-change tolerance** — fix a latent bug you found (slight behaviour change)\n  vs strictly no change.\n- **Feature-vs-debris calls only the user knows** — e.g. remove a dormant feature vs\n  keep it as scaffolding.\n\nDecide everything else (module naming, placement, sequencing) yourself.\n\n## Write the closed plan\n\nProduce a **fully deterministic checklist** and save it to\n`\u003Cplans-dir>\u002Ftidy-next-codebase\u002FPLAN.md` (reuse the repo’s existing plans location if it\nhas one). Rules:\n- Every step names the concrete file\u002Fsymbol and the exact change.\n  Banned: “TBD”, “as appropriate”, “handle edge cases”, “if needed”, “etc.”\n  — resolve the decision first, then write the step.\n- Order so each step’s precondition is produced by an earlier step: **deletions →\n  comment cleanup → renames\u002Fmoves → UI consolidation → data-layer consolidation →\n  helper\u002Fschema consolidation → state → docs → verification.**\n- Renames enumerate every import to rewrite.\n  Consolidations list every call site.\n  Each new shared module gets a path + signature.\n- End with a **Done-when** block: typecheck\u002Flint\u002Ftest\u002Fbuild green + zero-reference greps\n  for everything removed + manual parity notes.\n\n## Gate\n\nSummarise the plan (phases, change counts, risk tier, any approved behaviour change) and\nask for **one go-ahead** before executing.\n(If the user chose plan-only, stop here.)\n\n## Execute via a background workflow\n\nLaunch ONE workflow that runs the plan stage-by-stage:\n- **One agent per plan phase** (split oversized phases), run **strictly sequentially** —\n  the stages share one working tree and depend on each other, so parallel edits would\n  corrupt them. Do **not** use worktree isolation.\n- **Plug context into each agent**: a shared PREAMBLE (the invariants above + the exact\n  typecheck command + “do not commit” + “preserve WIP file X” + “return only the\n  structured status”) **plus** that stage’s specific brief (files + exact changes)\n  **plus** a pointer to its phase in `PLAN.md`. No agent reads another’s work — fresh\n  context each stage.\n- **Gate** each stage on the typecheck command staying green; **halt the whole\n  workflow** on the first stage that fails or reports `blocked`.\n- **Structured return** per stage:\n  `{ stage, filesChanged[], filesDeleted[], typecheckPassed, blocked, blockReason, notes }`.\n  Tell agents that conservative deviations (skipping a merge to stay result-identical)\n  are allowed and must be reported in `notes`.\n- **Final stage**: run lint\u002Ftest\u002Fbuild + the zero-reference greps and report; treat\n  unrelated\u002Fpre-existing failures as non-blocking but surface them.\n\nSkeleton:\n```js\nfor (const st of STAGES) {\n  phase(st.title)\n  const r = await agent(PREAMBLE + st.brief, { label: st.title, phase: st.title, schema: STATUS })\n  if (!r || r.blocked || r.typecheckPassed === false) { log('HALT at ' + st.title); return { halted: true, at: st.title, results } }\n  results.push(r)\n}\nreturn { halted: false, results }\n```\n\n## Report\n\nAfter the workflow completes, report:\n- Which stages completed and which halted (with reason).\n- Conservative deviations agents took (skipped merges to stay result-identical).\n- One-line caveats for any pre-existing failures surfaced but not fixed.\n- Confirmation that all changes are uncommitted and ready for review.\n",{"name":5,"description":7},"main","44a7c5d185b1020f689d2129547d7470c3715e76","skills\u002Fcustom\u002Fcoding\u002Ftidy-next-codebase",0,"https:\u002F\u002Fgithub.com\u002Fdotlas\u002Fskills","https:\u002F\u002Fwww.skills.sh\u002Fdotlas\u002Fskills","https:\u002F\u002Fgithub.com\u002Fdotlas","www.dotlas.com","A platform to help companies make better city-level decisions and improve the bottom line of their retail footprint.","2026-10-27 22:40:58",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add dotlas\u002Fskills --skill tidy-next-codebase",{"tool":40,"command":41},"bunx","bunx skills add dotlas\u002Fskills --skill tidy-next-codebase",{"tool":43,"command":44},"pnpm","pnpm dlx skills add dotlas\u002Fskills --skill tidy-next-codebase","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdotlas\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcustom\u002Fcoding\u002Ftidy-next-codebase\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M792400972AXPY3XESVHRFRA","where-were-we","Provide the user with a refresher of existing chat turns. Useful when the user wants to understand where we stand in the conversation.","https:\u002F\u002Fgithub.com\u002Fdotlas\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcustom\u002Fcommon\u002Fwhere-were-we\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7923T58GM9G9TVAZB9TGTWE","update-global-dotlas-skills","Sync the globally-installed dotlas\u002Fskills catalog and prune stale remnants. Runs the documented global install command, then detects skills that were installed from dotlas\u002Fskills but no longer exist in the catalog and removes them (with confirmation). Use when the user wants to update, refresh, or clean up their global Dotlas skills, or invokes \u002Fupdate-global-dotlas-skills.","https:\u002F\u002Fgithub.com\u002Fdotlas\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcustom\u002Fcommon\u002Fupdate-global-dotlas-skills\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7923KGCMXT25Y7XVC6G1ERX","unpack","Explain an unfamiliar thing plainly and from first principles, structured so the reader sees why it is true. Use when someone is trying to understand something — a dense or jargon-heavy passage, a baffling error, an unfamiliar mechanism, a codebase, or a document — asks to break something down (\"walk me through this\", \"what does this actually mean\"), or wants their intent turned into a precise instruction for another agent. Trigger on confusion or a request to understand, not on difficulty alone; technical or long content is not itself a signal.","https:\u002F\u002Fgithub.com\u002Fdotlas\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcustom\u002Fcommon\u002Funpack\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7923HNVVHRKRVQ5M0P7TXZA","sum","Use when the previous response is too technical, complex, or jargon-heavy and needs a clear, plain-language explanation","https:\u002F\u002Fgithub.com\u002Fdotlas\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcustom\u002Fcommon\u002Fsum\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7923CY3FR71VPKBYRHZNNVH","slack","Compose a Slack message, or digest a Slack thread into compact context. Use when the user asks to reply to a person or channel, write a Slack post, or catch up on a thread without reading the whole transcript. This skill covers how to write well for Slack — both jobs share the same standard.","https:\u002F\u002Fgithub.com\u002Fdotlas\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcustom\u002Fcommon\u002Fslack\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M79234W72RKWYV2S38G2B0SY","plan-with-me","Collaborative, human-in-the-loop planning for something new that spans several parts and needs human judgement at each fork. A brainstorming partner that funnels — each fork opens up the real options, then narrows to a decision, surfacing caveats and breaking points, and co-authoring the plan instead of guessing alone. Fits any domain where you plan something new against existing context. Resolves one decision at a time, each with a recommendation, then emits a lightweight plan to hand off for implementation. Use when planning alone would make wrong assumptions, or the user wants to shape something new together.","https:\u002F\u002Fgithub.com\u002Fdotlas\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcustom\u002Fcommon\u002Fplan-with-me\u002FSKILL.md",[],[]]