[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KKKA9CTCMQB9ZCYYRQ8G9P":3,"skill-same:01M6KKKA9CTCMQB9ZCYYRQ8G9P":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":13,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M6KKKA9CTCMQB9ZCYYRQ8G9P","typescript-import-audit",null,"Systematic workflow for auditing TypeScript codebases for import hygiene issues (value vs. type imports, duplicates), missing base class extensions, and incomplete barrel file re-exports, with actionable fix patterns.","AG064\u002FOpenSpace","AG064","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184930299?v=4","01M6KHVFG7TB73NHX3RDYSTMH2","01M6KHVFMM7XA2PZA9Z83PHS3V",0,"MIT","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Ftypescript-import-audit\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"typescript import audit","audit","typescript","import","missing","value","imports","for","extensions","re","with","actionable","hygiene","type","systematic","duplicates","fix","file","issues","workflow","2026-11-10 10:12:30",false,"---\nname: typescript-import-audit\ndescription: Systematic workflow for auditing TypeScript codebases for import hygiene issues (value vs. type imports, duplicates), missing base class extensions, and incomplete barrel file re-exports, with actionable fix patterns.\n---\n\n# TypeScript Import & Structure Audit\n\nA step-by-step workflow for auditing TypeScript projects for common structural and import hygiene problems, then applying targeted fixes.\n\n---\n\n## Overview\n\nThis skill covers four audit checks and their corresponding fixes:\n\n| # | Issue | Fix |\n|---|-------|-----|\n| 1 | Value imports used only as type annotations | Split with `import type` |\n| 2 | Duplicate imports from the same module | Consolidate into one import statement |\n| 3 | Classes missing expected base class extension | Add `extends BaseClass` |\n| 4 | Missing re-exports in barrel (`index.ts`) files | Add the missing `export` lines |\n\n---\n\n## Step 1 — Read All Relevant Files in Parallel\n\nBefore making any changes, read all files that need to be audited in a single parallel batch. This avoids slow sequential reads.\n\n```\nRead in parallel:\n  - src\u002Findex.ts           (barrel file)\n  - src\u002F**\u002F*.ts            (all source files)\n  - Any explicitly named files from the task spec\n```\n\nLook for:\n- All `import` statements at the top of each file\n- Class declarations (`class Foo`)\n- Export lists in barrel files\n\n---\n\n## Step 2 — Audit Check 1: Value Imports Used Only as Types\n\n### Detection\n\nFor every `import { A, B } from 'module'` statement, check whether each\nimported name is used **only** in type positions (`: TypeName`, `as TypeName`,\n`\u003CTypeName>` generics, `implements TypeName`). If a name never appears in a\nvalue position (instantiation, function call, assignment), it should be a\ntype-only import.\n\n```typescript\n\u002F\u002F ❌ Bad — Foo is only used as a type annotation\nimport { Foo, bar } from '.\u002Fmodule';\nconst x: Foo = bar();\n\n\u002F\u002F ✅ Good — split into value import + type import\nimport { bar } from '.\u002Fmodule';\nimport type { Foo } from '.\u002Fmodule';\n```\n\n### Fix Pattern\n\n1. Identify all names in the import that are type-only.\n2. Remove them from the value import (delete the value import entirely if all names are type-only).\n3. Add (or merge into an existing) `import type { ... } from 'module'` statement.\n\n---\n\n## Step 3 — Audit Check 2: Duplicate Imports from the Same Module\n\n### Detection\n\nScan for two or more `import` statements that reference the **same module path**:\n\n```typescript\n\u002F\u002F ❌ Bad — two imports from the same source\nimport { ComponentA } from '.\u002Fcomponents';\nimport { ComponentB } from '.\u002Fcomponents';\n```\n\n### Fix Pattern\n\nMerge all named imports from the same module into a single statement:\n\n```typescript\n\u002F\u002F ✅ Good\nimport { ComponentA, ComponentB } from '.\u002Fcomponents';\n```\n\nIf there is a mix of value and type imports from the same module, keep them as two separate lines (`import { ... }` and `import type { ... }`), but ensure there is at most one of each kind per module path.\n\n---\n\n## Step 4 — Audit Check 3: Classes That Should Extend a Base Class\n\n### Detection\n\nLook for class declarations that:\n- Implement an interface that implies a base class, OR\n- Are described in comments \u002F documentation as extending something, OR\n- Contain methods\u002Fproperties that are defined on a known base class\n\n```typescript\n\u002F\u002F ❌ Missing base class\nclass MyPanel implements PanelInterface {\n  render() { ... }\n}\n\n\u002F\u002F ✅ Correct\nclass MyPanel extends BasePanel implements PanelInterface {\n  render() { ... }\n}\n```\n\n### Fix Pattern\n\nAdd `extends BaseClass` between the class name and any `implements` clause:\n\n```typescript\nclass ClassName extends BaseClass implements InterfaceName { ... }\n```\n\nEnsure the base class is imported if it is not already.\n\n---\n\n## Step 5 — Audit Check 4: Missing Re-exports in Barrel Files\n\n### Detection\n\nA barrel file (`index.ts`) should re-export everything that is part of the\npublic API. Common gaps:\n\n- A new file was added but never added to `index.ts`\n- A named export inside a file is not forwarded by the barrel\n\n```typescript\n\u002F\u002F src\u002Fcomponents\u002FMyWidget.ts\nexport class MyWidget { ... }\nexport type MyWidgetProps = { ... }\n\n\u002F\u002F src\u002Fcomponents\u002Findex.ts — ❌ missing MyWidget\nexport { SomeOtherThing } from '.\u002FSomeOtherThing';\n```\n\n### Fix Pattern\n\nAdd the missing re-export line:\n\n```typescript\n\u002F\u002F src\u002Fcomponents\u002Findex.ts — ✅ fixed\nexport { SomeOtherThing } from '.\u002FSomeOtherThing';\nexport { MyWidget } from '.\u002FMyWidget';\nexport type { MyWidgetProps } from '.\u002FMyWidget';\n```\n\nUse `export type { ... }` for type-only exports to maintain strict type\u002Fvalue separation.\n\n---\n\n## Step 6 — Apply Fixes and Verify\n\n### Order of operations\n\n1. Fix **duplicate imports** first (consolidation may surface type-only candidates).\n2. Fix **value vs. type imports** (split imports).\n3. Fix **missing base class** extensions.\n4. Fix **barrel re-exports** last (they depend on the other files being correct).\n\n### Verification checklist\n\nAfter edits, confirm:\n\n- [ ] No two `import` statements reference the same module path (same kind).\n- [ ] All names used only as types are in `import type { ... }` statements.\n- [ ] Every class that should extend a base class does so.\n- [ ] Every public export in every source file appears in the barrel `index.ts`.\n- [ ] The project compiles without errors (`tsc --noEmit`).\n\n---\n\n## Quick Reference: Import Patterns\n\n```typescript\n\u002F\u002F Value import\nimport { foo, bar } from '.\u002Fmodule';\n\n\u002F\u002F Type-only import\nimport type { Foo, Bar } from '.\u002Fmodule';\n\n\u002F\u002F Mixed (value + type from same module — two lines)\nimport { foo } from '.\u002Fmodule';\nimport type { Foo } from '.\u002Fmodule';\n\n\u002F\u002F Re-export value\nexport { foo } from '.\u002Fmodule';\n\n\u002F\u002F Re-export type\nexport type { Foo } from '.\u002Fmodule';\n\n\u002F\u002F Re-export everything\nexport * from '.\u002Fmodule';\nexport type * from '.\u002Fmodule';  \u002F\u002F TypeScript 5.0+\n```\n\n---\n\n## Notes\n\n- Always prefer **explicit named exports** over `export *` in barrel files for better tree-shaking and discoverability.\n- If the project uses `verbatimModuleSyntax` or `isolatedModules` in `tsconfig.json`, `import type` is **required** for type-only imports — the compiler will error otherwise.\n- Run `tsc --noEmit` after each fix category to catch regressions early.","# TypeScript Import & Structure Audit\n\nA step-by-step workflow for auditing TypeScript projects for common structural and import hygiene problems, then applying targeted fixes.\n\n---\n\n## Overview\n\nThis skill covers four audit checks and their corresponding fixes:\n\n| # | Issue | Fix |\n|---|-------|-----|\n| 1 | Value imports used only as type annotations | Split with `import type` |\n| 2 | Duplicate imports from the same module | Consolidate into one import statement |\n| 3 | Classes missing expected base class extension | Add `extends BaseClass` |\n| 4 | Missing re-exports in barrel (`index.ts`) files | Add the missing `export` lines |\n\n---\n\n## Step 1 — Read All Relevant Files in Parallel\n\nBefore making any changes, read all files that need to be audited in a single parallel batch. This avoids slow sequential reads.\n\n```\nRead in parallel:\n  - src\u002Findex.ts           (barrel file)\n  - src\u002F**\u002F*.ts            (all source files)\n  - Any explicitly named files from the task spec\n```\n\nLook for:\n- All `import` statements at the top of each file\n- Class declarations (`class Foo`)\n- Export lists in barrel files\n\n---\n\n## Step 2 — Audit Check 1: Value Imports Used Only as Types\n\n### Detection\n\nFor every `import { A, B } from 'module'` statement, check whether each\nimported name is used **only** in type positions (`: TypeName`, `as TypeName`,\n`\u003CTypeName>` generics, `implements TypeName`). If a name never appears in a\nvalue position (instantiation, function call, assignment), it should be a\ntype-only import.\n\n```typescript\n\u002F\u002F ❌ Bad — Foo is only used as a type annotation\nimport { Foo, bar } from '.\u002Fmodule';\nconst x: Foo = bar();\n\n\u002F\u002F ✅ Good — split into value import + type import\nimport { bar } from '.\u002Fmodule';\nimport type { Foo } from '.\u002Fmodule';\n```\n\n### Fix Pattern\n\n1. Identify all names in the import that are type-only.\n2. Remove them from the value import (delete the value import entirely if all names are type-only).\n3. Add (or merge into an existing) `import type { ... } from 'module'` statement.\n\n---\n\n## Step 3 — Audit Check 2: Duplicate Imports from the Same Module\n\n### Detection\n\nScan for two or more `import` statements that reference the **same module path**:\n\n```typescript\n\u002F\u002F ❌ Bad — two imports from the same source\nimport { ComponentA } from '.\u002Fcomponents';\nimport { ComponentB } from '.\u002Fcomponents';\n```\n\n### Fix Pattern\n\nMerge all named imports from the same module into a single statement:\n\n```typescript\n\u002F\u002F ✅ Good\nimport { ComponentA, ComponentB } from '.\u002Fcomponents';\n```\n\nIf there is a mix of value and type imports from the same module, keep them as two separate lines (`import { ... }` and `import type { ... }`), but ensure there is at most one of each kind per module path.\n\n---\n\n## Step 4 — Audit Check 3: Classes That Should Extend a Base Class\n\n### Detection\n\nLook for class declarations that:\n- Implement an interface that implies a base class, OR\n- Are described in comments \u002F documentation as extending something, OR\n- Contain methods\u002Fproperties that are defined on a known base class\n\n```typescript\n\u002F\u002F ❌ Missing base class\nclass MyPanel implements PanelInterface {\n  render() { ... }\n}\n\n\u002F\u002F ✅ Correct\nclass MyPanel extends BasePanel implements PanelInterface {\n  render() { ... }\n}\n```\n\n### Fix Pattern\n\nAdd `extends BaseClass` between the class name and any `implements` clause:\n\n```typescript\nclass ClassName extends BaseClass implements InterfaceName { ... }\n```\n\nEnsure the base class is imported if it is not already.\n\n---\n\n## Step 5 — Audit Check 4: Missing Re-exports in Barrel Files\n\n### Detection\n\nA barrel file (`index.ts`) should re-export everything that is part of the\npublic API. Common gaps:\n\n- A new file was added but never added to `index.ts`\n- A named export inside a file is not forwarded by the barrel\n\n```typescript\n\u002F\u002F src\u002Fcomponents\u002FMyWidget.ts\nexport class MyWidget { ... }\nexport type MyWidgetProps = { ... }\n\n\u002F\u002F src\u002Fcomponents\u002Findex.ts — ❌ missing MyWidget\nexport { SomeOtherThing } from '.\u002FSomeOtherThing';\n```\n\n### Fix Pattern\n\nAdd the missing re-export line:\n\n```typescript\n\u002F\u002F src\u002Fcomponents\u002Findex.ts — ✅ fixed\nexport { SomeOtherThing } from '.\u002FSomeOtherThing';\nexport { MyWidget } from '.\u002FMyWidget';\nexport type { MyWidgetProps } from '.\u002FMyWidget';\n```\n\nUse `export type { ... }` for type-only exports to maintain strict type\u002Fvalue separation.\n\n---\n\n## Step 6 — Apply Fixes and Verify\n\n### Order of operations\n\n1. Fix **duplicate imports** first (consolidation may surface type-only candidates).\n2. Fix **value vs. type imports** (split imports).\n3. Fix **missing base class** extensions.\n4. Fix **barrel re-exports** last (they depend on the other files being correct).\n\n### Verification checklist\n\nAfter edits, confirm:\n\n- [ ] No two `import` statements reference the same module path (same kind).\n- [ ] All names used only as types are in `import type { ... }` statements.\n- [ ] Every class that should extend a base class does so.\n- [ ] Every public export in every source file appears in the barrel `index.ts`.\n- [ ] The project compiles without errors (`tsc --noEmit`).\n\n---\n\n## Quick Reference: Import Patterns\n\n```typescript\n\u002F\u002F Value import\nimport { foo, bar } from '.\u002Fmodule';\n\n\u002F\u002F Type-only import\nimport type { Foo, Bar } from '.\u002Fmodule';\n\n\u002F\u002F Mixed (value + type from same module — two lines)\nimport { foo } from '.\u002Fmodule';\nimport type { Foo } from '.\u002Fmodule';\n\n\u002F\u002F Re-export value\nexport { foo } from '.\u002Fmodule';\n\n\u002F\u002F Re-export type\nexport type { Foo } from '.\u002Fmodule';\n\n\u002F\u002F Re-export everything\nexport * from '.\u002Fmodule';\nexport type * from '.\u002Fmodule';  \u002F\u002F TypeScript 5.0+\n```\n\n---\n\n## Notes\n\n- Always prefer **explicit named exports** over `export *` in barrel files for better tree-shaking and discoverability.\n- If the project uses `verbatimModuleSyntax` or `isolatedModules` in `tsconfig.json`, `import type` is **required** for type-only imports — the compiler will error otherwise.\n- Run `tsc --noEmit` after each fix category to catch regressions early.",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","showcase\u002Fskills\u002Ftypescript-import-audit","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace","https:\u002F\u002Fgithub.com\u002FAG064","AG064, E.Mi.\r\n\r\nA person who thinks all the time, yet all they have to think is nothing. I want to improve the world and work on open source projects","2026-10-08 06:53:48",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add AG064\u002FOpenSpace --skill typescript-import-audit",{"tool":56,"command":57},"bunx","bunx skills add AG064\u002FOpenSpace --skill typescript-import-audit",{"tool":59,"command":60},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill typescript-import-audit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Ftypescript-import-audit\u002FSKILL.md",true,[64],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},".skill_id","OTHER","其他",37,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Ftypescript-import-audit\u002F.skill_id",[71,91,107,116,146,162],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":38},"01M6KKMPWA0B5SCCH766F8M5EA","write-special-chars-ts-check","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, plus a reliable TypeScript type-checking step that filters output to only the newly-written files to avoid being misled by pre-existing errors.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[78,79,80,81,82,83,25,84,85,86,31,87,88,89,35,90,20],"write special chars ts check","check","write","filters","Existing","type-checking","errors","script","output","files","only","template","python",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":38},"01M6KKMJXVBNVEY3TRK055F4A7","write-special-chars-readback","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, with mandatory post-write verification via read_file and cleanup of \u002Ftmp helper scripts.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[98,99,80,89,100,101,35,90,102,103,104,105,106,25,85,28],"readback","write special chars readback","cleanup","read","scripts","verification","via","post","helper",{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":38},"01M6KKMEGX9M9NC105J0W3Q5B9","write-special-chars-heredoc","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) by using a Python heredoc script executed via shell.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[80,114,90,25,104,89,115,35,85],"write special chars heredoc","shell",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":127,"publishedAt":38},"01M6KKM8EJ2AATVHZBNB916WT0","worldmonitor-reference","Curated architecture index of the WorldMonitor open-source dashboard. Reference for extracting patterns — vanilla TypeScript, Panel class hierarchy, service layer, CSS grid, API edge functions, refresh scheduler, and 60+ data source integrations.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[122],{"categoryNo":123,"categoryName":124,"taxonomyType":125,"taxonomyTypeDesc":126},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[128,129,130,131,20,132,133,134,135,136,25,137,138,139,140,141,142,143,144,145],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":38},"01M6KKM39PHYK627F19GE2B9XN","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[153,154,155,156,25,157,28,158,159,160,161],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":38},"01M6KKKY7T2P61Y0JH54CDEJKQ","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[169,170,171,172,173,174,35,36,175,176],"directory","verify","structure","verify directory structure","access","first","diagnose","file access"]