dir-verify-parallel-shell-audit
できること
このスキルは、ファイルにアクセスできない理由を調べ、ソースツリーを効率よく監査するよう、AIエージェントに導きます。なじみのないプロジェクトのフォルダーで作業する開発者向けです。
使う場面
- ✓ファイルの操作が失敗し、フォルダーの構成が正しいかを確認する必要があるとき。
- ✓ソースツリーを監査し、多くのファイルを素早く読む必要があるとき。
- ✓余計な手順なしに、行数や先頭の内容などのファイルの詳細が必要なとき。
スキルのリンク
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/dir-verify-parallel-shell-audit/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このプロジェクトでファイルが見つかりません。フォルダーの構成と設定ファイルの先頭の行を、1回の確認でチェックしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、該当するディレクトリを一覧表示し、同じ手順で行数や先頭の内容のシェルチェックを実行します。その後、ファイルをまとめて読み、インポートのパターンを確認するので、必要な手順が減ります。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Verify Directory Structure — Parallel Audit with Shell Property Checks
This skill provides a systematic approach to diagnosing file access issues and auditing source trees efficiently. It extends the parallel batch reading approach with an integrated shell property check phase that combines head -N and wc -l into a single run_shell call, co-scheduled with directory listing in Phase 1. This eliminates a common extra iteration that would otherwise be required to check file properties such as line counts and leading content (e.g., CSS/config file headers).
Steps
Phase 1 — Directory Verification + Shell Property Checks (Combined)
Key optimization: Fire
list_dircalls andrun_shellproperty checks in the same iteration. This avoids a dedicated iteration later just to learn "how many lines does this file have?" or "what is the first line of this CSS file?".
Identify Target Paths: Collect every file or directory path involved in the operation. Prefer absolute paths to eliminate ambiguity. At this stage, also note any files whose properties (line count, header content) you already know you will need — typically CSS, config, or data files.
Issue Parallel
list_dir+run_shellCalls Simultaneously:- Call
list_diron each relevant directory. - In the same iteration, issue one or more
run_shellcalls that bundleheadandwc -lfor known target files using a single compound shell command.
Iteration 1 (parallel): list_dir(src/components) list_dir(src/styles) run_shell("head -5 src/styles/main.css && echo '---' && wc -l src/styles/main.css") run_shell("head -3 vite.config.ts && echo '---' && wc -l src/main.ts")Compound shell pattern (combine head + wc + any other checks for a file):
# Single run_shell call — multiple files, multiple checks, zero extra iterations head -10 path/to/file.css && echo "LINE_COUNT:" && wc -l path/to/file.css && \ echo "---" && head -5 path/to/config.ts && echo "LINE_COUNT:" && wc -l path/to/config.ts- Call
Verify Existence & Permissions: Confirm directories exist and that the current user has read (and, if needed, write/execute) permissions. If a directory is missing, create it before proceeding (
mkdir -p). If permissions are insufficient, adjust them before retrying.Build a File Manifest: From the
list_diroutput, 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 in Phase 2.Record Shell Check Results: Parse and store the
head/wc -loutput alongside the manifest. This data is immediately available for the final audit report without any additional iterations.
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.
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. Files whose content was partially previewed via
headin Phase 1 should still be fully read here if their complete content is needed.Issue Parallel
read_fileCalls: Within each batch, invokeread_filefor 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) ...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.
Re-verify Missing Files: For any file reported as missing, re-run
list_diron 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 co
よくある質問
時間を最も節約するのは何ですか?
ディレクトリの一覧表示とファイルの確認を同じ手順で行い、余分な往復を避けます。
TypeScriptのインポートも確認しますか?
はい。スキルは、TypeScriptのインポートパターンの検証を含みます。
絶対パスを使うべきですか?
はい。どこにファイルがあるか混乱しないように、スキルは絶対パスを推奨します。
詳細
作者による元の説明
Diagnose and resolve file access issues by verifying directory structure, reading multiple files in parallel batches, running combined shell property checks (head/wc-l) in the same iteration as directory listing, and validating TypeScript import patterns — all with built-in guidance to minimize total iteration count.
repo: HKUDS/AgentPilot
人気
- GitHubのスター
- 7.8k
- ランキング
- #13051
- ライセンス
- MIT
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
agentpilot
7.8kエージェントが、作業を準備し、変更案を提案してテストし、評価するAgentPilotのループを実行することで、プロジェクトを段階的に改善できるよう支援します。
openspace
7.8kエージェントが、スキルを保存し取り出すツールであるOpenSpaceをセットアップし、MCPを通じてAIアプリに接続できるよう支援します。
rsi-arena
7.8kエージェントが、AIMEやTerminal-Benchなどの標準的なAIベンチマークテストをセットアップして実行し、異なる改善方法を比較できるよう支援します。
experiment-guide
7.8kエージェントが、プログラムを改善する方法を調べる間に、小さな実験を計画し、その結果を読み、発見を記録できるよう支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。