[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KKKTH41ZNA3FHSSD4MFC7G":3,"skill-same:01M6KKKTH41ZNA3FHSSD4MFC7G":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},"01M6KKKTH41ZNA3FHSSD4MFC7G","verify-directory-structure-parallel-audit",null,"Diagnose and resolve file access issues by verifying directory structure, then reading multiple files in parallel batches for efficient auditing, with built-in guidance for validating TypeScript import 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\u002Fverify-directory-structure-parallel-audit\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"verify directory structure","verify directory structure parallel audit","audit","verify","parallel","directory","structure","files","for","batches","reading","with","import","guidance","access","file","issues","diagnose","typescript","file access","2026-11-10 10:12:30",false,"---\nname: verify-directory-structure-parallel-audit\ndescription: Diagnose and resolve file access issues by verifying directory structure, then reading multiple files in parallel batches for efficient auditing, with built-in guidance for validating TypeScript import patterns.\n---\n\n# Verify Directory Structure — Parallel Audit\n\nThis skill provides a systematic approach to diagnosing file access issues and auditing source trees efficiently. It extends basic directory verification with **parallel batch file reading** (dramatically reducing iteration count when many files must be inspected) and a dedicated **TypeScript import validation** phase that catches a common class of structural bugs.\n\n---\n\n## Steps\n\n### Phase 1 — Directory Verification\n\n1. **Identify Target Paths**: Collect every file or directory path involved in the operation. Prefer absolute paths to eliminate ambiguity.\n\n2. **Enumerate with `list_dir`**: Call `list_dir` on each relevant directory. Record all file names, sizes, and modification dates. This is your ground truth before touching any file.\n\n3. **Verify Existence & Permissions**: Confirm the directory exists and that the current user has read (and, if needed, write\u002Fexecute) permissions. If a directory is missing, create it before proceeding. If permissions are insufficient, adjust them before retrying.\n\n4. **Build a File Manifest**: From the `list_dir` output, compile the complete list of files to be audited. Group them logically (e.g., by subdirectory or file type) so they can be read in parallel batches.\n\n---\n\n### Phase 2 — Parallel Batch File Reading\n\n> **Why this matters**: Reading files sequentially costs one iteration per file. Reading them in parallel batches collapses N files into ⌈N\u002Fbatch_size⌉ iterations — a significant speedup when auditing dozens of files.\n\n5. **Determine Batch Size**: Default to reading **5–10 files per batch**. Reduce the batch size if individual files are very large; increase it for small config\u002Findex files.\n\n6. **Issue Parallel `read_file` Calls**: Within each batch, invoke `read_file` for all files simultaneously (a single iteration). Do not wait for one file before requesting the next within the same batch.\n\n   ```\n   Batch 1 (parallel): read_file(src\u002Fcomponents\u002FA.tsx)\n                        read_file(src\u002Fcomponents\u002FB.tsx)\n                        read_file(src\u002Fcomponents\u002FC.tsx)\n                        read_file(src\u002Fcomponents\u002FD.tsx)\n                        read_file(src\u002Fcomponents\u002FE.tsx)\n\n   Batch 2 (parallel): read_file(src\u002Fcomponents\u002FF.tsx)\n                        ...\n   ```\n\n7. **Collect & Triage Results**: After each batch completes, scan results for errors (file-not-found, permission denied) and flag them immediately. Do not abort the remaining batches; continue and aggregate all findings.\n\n8. **Re-verify Missing Files**: For any file reported as missing, re-run `list_dir` on its parent directory to confirm whether the file truly does not exist or whether the path was wrong. Correct the path and retry the single file if necessary.\n\n---\n\n### Phase 3 — TypeScript Import Validation\n\n> This phase targets a common class of structural bugs found when auditing TypeScript source trees.\n\n9. **Identify Import Statements**: For every `.ts` \u002F `.tsx` file read in Phase 2, extract all `import` lines.\n\n10. **Classify Import Kind — Value vs. Type**:\n\n    | Pattern | Correct usage |\n    |---|---|\n    | `import Foo from '...'` | Runtime value (class, function, object) |\n    | `import { Foo } from '...'` | Runtime value export |\n    | `import type Foo from '...'` | Type-only import (erased at compile time) |\n    | `import type { Foo } from '...'` | Type-only named import |\n    | `import { type Foo } from '...'` | Inline type modifier (TS 4.5+) |\n\n11. **Flag Value Imports Used Only as Types**: If an identifier imported without `type` is used **only** in type positions (`: Foo`, `as Foo`, `implements Foo`, generic parameters), it should be converted to `import type`. This prevents accidental runtime dependencies and satisfies `verbatimModuleSyntax` \u002F `isolatedModules` compiler flags.\n\n    ```typescript\n    \u002F\u002F ❌ Before — value import used only as a type\n    import { UserProfile } from '.\u002Ftypes';\n    const handler = (u: UserProfile) => { ... };\n\n    \u002F\u002F ✅ After — type-only import\n    import type { UserProfile } from '.\u002Ftypes';\n    const handler = (u: UserProfile) => { ... };\n    ```\n\n12. **Flag Duplicate Imports**: Detect cases where the same module is imported more than once in a file (often from copy-paste). Merge them into a single import statement.\n\n    ```typescript\n    \u002F\u002F ❌ Duplicate\n    import { A } from '.\u002Futils';\n    import { B } from '.\u002Futils';\n\n    \u002F\u002F ✅ Merged\n    import { A, B } from '.\u002Futils';\n    ```\n\n13. **Verify Barrel \u002F Index Exports**: When a directory contains an `index.ts` (barrel file), confirm that every component or module expected to be publicly accessible is re-exported. Cross-reference against the file manifest from Phase 1.\n\n14. **Apply Fixes & Re-audit**: Apply all import corrections as a single write pass per file. After writing, re-read the affected files (parallel batch) to confirm the fixes took effect.\n\n---\n\n### Phase 4 — Final Validation & Report\n\n15. **Retry the Original Operation**: With the directory structure confirmed and import issues resolved, retry the operation that originally failed.\n\n16. **Log an Audit Report**: Produce a concise summary covering:\n    - Total files enumerated and read\n    - Number of batches used (highlight the iteration savings vs. sequential)\n    - Import issues found and fixed (value→type conversions, duplicate merges, missing barrel exports)\n    - Any remaining unresolved issues with recommended next steps\n\n---\n\n## Quick Reference: Batch Reading Pattern\n\n```\n# Sequential (slow) — N iterations for N files\nread_file(file1) → wait → read_file(file2) → wait → ...\n\n# Parallel batch (fast) — ⌈N\u002FB⌉ iterations for N files, batch size B\n[read_file(file1), read_file(file2), ..., read_file(fileB)]  ← 1 iteration\n[read_file(fileB+1), ...]                                     ← 1 iteration\n```\n\n---\n\n## Best Practices\n\n- **Always enumerate before reading**: `list_dir` first, then batch-read. Never guess file names.\n- **Use absolute paths** throughout to avoid working-directory ambiguity.\n- **Batch by locality**: Group files from the same directory in the same batch to keep context coherent.\n- **Type imports are zero-cost at runtime**: Prefer `import type` for any symbol used exclusively as a TypeScript type. This is especially important in projects with `isolatedModules: true`.\n- **Barrel files are contracts**: Treat `index.ts` exports as the public API of a module. Missing exports are bugs even if the underlying file is correct.\n- **Log intermediate findings**: If issues persist after Phase 3, dump the full audit log for offline debugging.\n\n---\n\n## Common Fix Categories (Checklist)\n\n- [ ] Directory missing → create with `mkdir -p`\n- [ ] Permissions insufficient → `chmod`\u002F`chown` or escalate\n- [ ] Path typo → re-enumerate with `list_dir`, correct path\n- [ ] Value import used as type → add `import type`\n- [ ] Duplicate imports → merge into single statement\n- [ ] Missing barrel export → add re-export to `index.ts`\n- [ ] Circular import → restructure module boundaries\n","# Verify Directory Structure — Parallel Audit\n\nThis skill provides a systematic approach to diagnosing file access issues and auditing source trees efficiently. It extends basic directory verification with **parallel batch file reading** (dramatically reducing iteration count when many files must be inspected) and a dedicated **TypeScript import validation** phase that catches a common class of structural bugs.\n\n---\n\n## Steps\n\n### Phase 1 — Directory Verification\n\n1. **Identify Target Paths**: Collect every file or directory path involved in the operation. Prefer absolute paths to eliminate ambiguity.\n\n2. **Enumerate with `list_dir`**: Call `list_dir` on each relevant directory. Record all file names, sizes, and modification dates. This is your ground truth before touching any file.\n\n3. **Verify Existence & Permissions**: Confirm the directory exists and that the current user has read (and, if needed, write\u002Fexecute) permissions. If a directory is missing, create it before proceeding. If permissions are insufficient, adjust them before retrying.\n\n4. **Build a File Manifest**: From the `list_dir` output, compile the complete list of files to be audited. Group them logically (e.g., by subdirectory or file type) so they can be read in parallel batches.\n\n---\n\n### Phase 2 — Parallel Batch File Reading\n\n> **Why this matters**: Reading files sequentially costs one iteration per file. Reading them in parallel batches collapses N files into ⌈N\u002Fbatch_size⌉ iterations — a significant speedup when auditing dozens of files.\n\n5. **Determine Batch Size**: Default to reading **5–10 files per batch**. Reduce the batch size if individual files are very large; increase it for small config\u002Findex files.\n\n6. **Issue Parallel `read_file` Calls**: Within each batch, invoke `read_file` for all files simultaneously (a single iteration). Do not wait for one file before requesting the next within the same batch.\n\n   ```\n   Batch 1 (parallel): read_file(src\u002Fcomponents\u002FA.tsx)\n                        read_file(src\u002Fcomponents\u002FB.tsx)\n                        read_file(src\u002Fcomponents\u002FC.tsx)\n                        read_file(src\u002Fcomponents\u002FD.tsx)\n                        read_file(src\u002Fcomponents\u002FE.tsx)\n\n   Batch 2 (parallel): read_file(src\u002Fcomponents\u002FF.tsx)\n                        ...\n   ```\n\n7. **Collect & Triage Results**: After each batch completes, scan results for errors (file-not-found, permission denied) and flag them immediately. Do not abort the remaining batches; continue and aggregate all findings.\n\n8. **Re-verify Missing Files**: For any file reported as missing, re-run `list_dir` on its parent directory to confirm whether the file truly does not exist or whether the path was wrong. Correct the path and retry the single file if necessary.\n\n---\n\n### Phase 3 — TypeScript Import Validation\n\n> This phase targets a common class of structural bugs found when auditing TypeScript source trees.\n\n9. **Identify Import Statements**: For every `.ts` \u002F `.tsx` file read in Phase 2, extract all `import` lines.\n\n10. **Classify Import Kind — Value vs. Type**:\n\n    | Pattern | Correct usage |\n    |---|---|\n    | `import Foo from '...'` | Runtime value (class, function, object) |\n    | `import { Foo } from '...'` | Runtime value export |\n    | `import type Foo from '...'` | Type-only import (erased at compile time) |\n    | `import type { Foo } from '...'` | Type-only named import |\n    | `import { type Foo } from '...'` | Inline type modifier (TS 4.5+) |\n\n11. **Flag Value Imports Used Only as Types**: If an identifier imported without `type` is used **only** in type positions (`: Foo`, `as Foo`, `implements Foo`, generic parameters), it should be converted to `import type`. This prevents accidental runtime dependencies and satisfies `verbatimModuleSyntax` \u002F `isolatedModules` compiler flags.\n\n    ```typescript\n    \u002F\u002F ❌ Before — value import used only as a type\n    import { UserProfile } from '.\u002Ftypes';\n    const handler = (u: UserProfile) => { ... };\n\n    \u002F\u002F ✅ After — type-only import\n    import type { UserProfile } from '.\u002Ftypes';\n    const handler = (u: UserProfile) => { ... };\n    ```\n\n12. **Flag Duplicate Imports**: Detect cases where the same module is imported more than once in a file (often from copy-paste). Merge them into a single import statement.\n\n    ```typescript\n    \u002F\u002F ❌ Duplicate\n    import { A } from '.\u002Futils';\n    import { B } from '.\u002Futils';\n\n    \u002F\u002F ✅ Merged\n    import { A, B } from '.\u002Futils';\n    ```\n\n13. **Verify Barrel \u002F Index Exports**: When a directory contains an `index.ts` (barrel file), confirm that every component or module expected to be publicly accessible is re-exported. Cross-reference against the file manifest from Phase 1.\n\n14. **Apply Fixes & Re-audit**: Apply all import corrections as a single write pass per file. After writing, re-read the affected files (parallel batch) to confirm the fixes took effect.\n\n---\n\n### Phase 4 — Final Validation & Report\n\n15. **Retry the Original Operation**: With the directory structure confirmed and import issues resolved, retry the operation that originally failed.\n\n16. **Log an Audit Report**: Produce a concise summary covering:\n    - Total files enumerated and read\n    - Number of batches used (highlight the iteration savings vs. sequential)\n    - Import issues found and fixed (value→type conversions, duplicate merges, missing barrel exports)\n    - Any remaining unresolved issues with recommended next steps\n\n---\n\n## Quick Reference: Batch Reading Pattern\n\n```\n# Sequential (slow) — N iterations for N files\nread_file(file1) → wait → read_file(file2) → wait → ...\n\n# Parallel batch (fast) — ⌈N\u002FB⌉ iterations for N files, batch size B\n[read_file(file1), read_file(file2), ..., read_file(fileB)]  ← 1 iteration\n[read_file(fileB+1), ...]                                     ← 1 iteration\n```\n\n---\n\n## Best Practices\n\n- **Always enumerate before reading**: `list_dir` first, then batch-read. Never guess file names.\n- **Use absolute paths** throughout to avoid working-directory ambiguity.\n- **Batch by locality**: Group files from the same directory in the same batch to keep context coherent.\n- **Type imports are zero-cost at runtime**: Prefer `import type` for any symbol used exclusively as a TypeScript type. This is especially important in projects with `isolatedModules: true`.\n- **Barrel files are contracts**: Treat `index.ts` exports as the public API of a module. Missing exports are bugs even if the underlying file is correct.\n- **Log intermediate findings**: If issues persist after Phase 3, dump the full audit log for offline debugging.\n\n---\n\n## Common Fix Categories (Checklist)\n\n- [ ] Directory missing → create with `mkdir -p`\n- [ ] Permissions insufficient → `chmod`\u002F`chown` or escalate\n- [ ] Path typo → re-enumerate with `list_dir`, correct path\n- [ ] Value import used as type → add `import type`\n- [ ] Duplicate imports → merge into single statement\n- [ ] Missing barrel export → add re-export to `index.ts`\n- [ ] Circular import → restructure module boundaries\n",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","showcase\u002Fskills\u002Fverify-directory-structure-parallel-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 about 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 verify-directory-structure-parallel-audit",{"tool":56,"command":57},"bunx","bunx skills add AG064\u002FOpenSpace --skill verify-directory-structure-parallel-audit",{"tool":59,"command":60},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill verify-directory-structure-parallel-audit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure-parallel-audit\u002FSKILL.md",true,[64],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},".skill_id","OTHER","其他",49,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure-parallel-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,26,84,85,86,87,25,88,89,33,90,36],"write special chars ts check","check","write","filters","Existing","type-checking","errors","script","output","type","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,33,90,102,103,104,105,106,26,85,29],"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,26,104,89,115,33,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,36,132,133,134,135,136,26,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,26,157,29,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",[],[23,21,24,18,32,169,33,34,35,37],"first"]