본문으로 건너뛰기
Skillpedia
일반 코딩7.8k · #13089

verify-directory-structure-parallel-audit

하는 일

이 스킬은 폴더와 파일이 존재하고 읽을 수 있는지 확인한 다음, 파일을 묶음 단위로 읽습니다. 더 큰 코드베이스를 감사하면서 작업을 빨리 끝내려는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓파일 작업이 실패해서 먼저 폴더를 확인해야 할 때.
  • ✓한 번에 많은 소스 파일을 감사해야 할 때.
  • ✓프로젝트 전체에서 TypeScript import 패턴을 확인하고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/verify-directory-structure-parallel-audit/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 프로젝트 폴더를 확인한 다음, 모든 소스 파일의 import를 검토해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 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
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬