मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग7.8k · #13089

verify-directory-structure-parallel-audit

यह क्या करती है

यह स्किल जाँचती है कि फ़ोल्डर और फ़ाइलें मौजूद हैं और पढ़ी जा सकती हैं, फिर फ़ाइलों को समूहों में एक साथ पढ़ती है। यह उन लोगों के लिए है जो बड़े कोडबेस का ऑडिट तेज़ी से करवाना चाहते हैं।

कब इस्तेमाल करें

  • ✓जब फ़ाइल कार्रवाई फेल हो और पहले फ़ोल्डर जाँचना ज़रूरी हो।
  • ✓जब आपको एक ही चरण में बहुत सारी स्रोत फ़ाइलों का ऑडिट करना है।
  • ✓जब आप पूरे प्रोजेक्ट में TypeScript import पैटर्न जाँचना चाहते हैं।

Skill का लिंक

https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/verify-directory-structure-parallel-audit/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/verify-directory-structure-parallel-audit/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“क्या आप मेरे प्रोजेक्ट फ़ोल्डर जाँच सकते हैं और फिर सभी स्रोत फ़ाइलों के इंपोर्ट की समीक्षा कर सकते हैं?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट फ़ोल्डर सूचीबद्ध करता है, जाँची जाने वाली फ़ाइलों की सूची बनाता है, उन्हें समूहों में पढ़ता है, और फिर TypeScript import पैटर्न की समीक्षा करता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Verify Directory Structure — Parallel Audit

This 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.


Steps

Phase 1 — Directory Verification

  1. Identify Target Paths: Collect every file or directory path involved in the operation. Prefer absolute paths to eliminate ambiguity.

  2. 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.

  3. Verify Existence & Permissions: Confirm the directory exists and that the current user has read (and, if needed, write/execute) permissions. If a directory is missing, create it before proceeding. If permissions are insufficient, adjust them before retrying.

  4. 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.


Phase 2 — Parallel Batch File Reading

Why this matters: Reading files sequentially costs one iteration per file. Reading them in parallel batches collapses N files into ⌈N/batch_size⌉ iterations — a significant speedup when auditing dozens of files.

  1. 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/index files.

  2. 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.

    Batch 1 (parallel): read_file(src/components/A.tsx)
                         read_file(src/components/B.tsx)
                         read_file(src/components/C.tsx)
                         read_file(src/components/D.tsx)
                         read_file(src/components/E.tsx)
    
    Batch 2 (parallel): read_file(src/components/F.tsx)
                         ...
    
  3. 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.

  4. 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.


Phase 3 — TypeScript Import Validation

This phase targets a common class of structural bugs found when auditing TypeScript source trees.

  1. Identify Import Statements: For every .ts / .tsx file read in Phase 2, extract all import lines.

  2. Classify Import Kind — Value vs. Type:

    Pattern Correct usage
    import Foo from '...' Runtime value (class, function, object)
    import { Foo } from '...' Runtime value export
    import type Foo from '...' Type-only import (erased at compile time)
    import type { Foo } from '...' Type-only named import
    import { type Foo } from '...' Inline type modifier (TS 4.5+)
  3. 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 / isolatedModules compiler flags.

    // ❌ Before — value import used only as a type
    import { UserProfile } from './types';
    const handler = (u: UserProfile) => { ... };
    
    // ✅ After — type-only import
    import type { UserProfile } from './types';
    const handler = (u: UserProfile) => { ... };
    
  4. 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.

    // ❌ Duplicate
    import { A } from './utils';
    import { B } from './utils';
    
    // ✅ Merged
    import { A, B } from './utils';
    
  5. Verify Barrel / Index Exports: When

अक्सर पूछे जाने वाले सवाल

फ़ाइलें समूहों में क्यों पढ़ें?

कई फ़ाइलें एक साथ पढ़ने में एक-एक करके पढ़ने से कम चरण लगते हैं।

यह फ़ोल्डरों में क्या जाँचता है?

यह जाँचता है कि हर फ़ोल्डर मौजूद है और उपयोगकर्ता उसे पढ़ सकता है, और ज़रूरत पड़ने पर गायब फ़ोल्डर बनाता है।

क्या यह फ़ाइलें बदलता है?

ऑडिट चरण पहले फ़ाइलें पढ़ता है। कोई भी बदलाव एक अलग, स्पष्ट चरण है।

जानकारी

लेखक का मूल विवरण

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.

repo: HKUDS/AgentPilot

लोकप्रियता

GitHub स्टार
7.8k
रैंकिंग में स्थान
#13089
लाइसेंस
MIT
अपडेट की गई
1/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills