File contents Procedure
Pattern A: 全体構造把握
新しいプロジェクトに入った直後、root の地形を 30 秒で掴む。
# ディレクトリ階層を 3 階層まで(深く掘らない)
find <project> -maxdepth 3 -type d \
-not -path '*/node_modules*' \
-not -path '*/.next*' \
-not -path '*/.git*' \
-not -path '*/dist*' | head -30
# root の files
ls -la <project>
# entry point / scripts を確認
cat <project>/package.json | jq '.scripts, .dependencies | keys'
# Python: cat pyproject.toml / Cargo.toml / go.mod も同様
Pattern B: 関数/シンボル探索
特定の関数や export を素早く見つける。
# シンボル名直撃(ripgrep 推奨)
rg -n "function_name" <project>/src --type ts
# fallback で grep
grep -rn "function_name" <project>/src --include='*.ts' \
--exclude-dir=node_modules --exclude-dir=dist
# export だけ列挙
rg -n "^export (function|const|class) \w+" src --type ts
Pattern C: import 依存追跡
どのモジュールが何を使っているか俯瞰。
# alias import (`@/...`) の使用箇所
rg -n "from ['\"]@/" src
# 特定ライブラリの import 全件
rg -n "import .* from ['\"]lodash" .
# 逆向き: 自作モジュールがどこから import されているか
rg -n "from .*/utils/format" src
Pattern D: 最近変更
直近の変更で何が動いているかを把握。
# 直近 7 日のコミット
git log --oneline --since='7 days ago' -- <path>
# 最近 5 commit の差分サマリ
git diff HEAD~5..HEAD --stat
# ファイルごとの最終更新
git log -1 --format='%ai %s' -- <file>
Pitfalls
node_modules / .next / dist / .git を除外しないと find/grep が遅く、ノイズが多い。--exclude-dir か find -not -path で必ず除く。
大規模 monorepo で find が秒単位かかるなら ripgrep (rg) に切り替える。rg は .gitignore を自動尊重する。
grep -r で --include='*.ts' を付けないと minified JS や lock file まで舐めて壊れる。
jq が無い環境では node -e "console.log(Object.keys(require('./package.json').scripts))" で代替。
Pattern A の find -maxdepth 3 は深い monorepo (packages/*/src/...) では浅すぎる。その時は 4-5 に上げる。
Verification
Pattern A の出力が 50 行未満で、root レイアウト・主要ディレクトリ・entry point が一目で分かる。
Pattern B/C で目的のシンボルが見つかる。export 数と import 数の整合(孤立した export は dead code 候補)。
Pattern D で直近の活発な領域 = 今コンテキストとして読むべき領域、と対応している。
全 Pattern を実行しても 30 秒以内に終わる。超えるなら除外フィルタかツール (rg) を見直す。
1 --- 2 name: project-exploration-patterns 3 description: Procedure 4 --- 5 6 ## Procedure 7 8 ### Pattern A: 全体構造把握 9 新しいプロジェクトに入った直後、root の地形を 30 秒で掴む。 10 11 ```bash 12 # ディレクトリ階層を 3 階層まで(深く掘らない) 13 find <project> -maxdepth 3 -type d \ 14 -not -path '*/node_modules*' \ 15 -not -path '*/.next*' \ 16 -not -path '*/.git*' \ 17 -not -path '*/dist*' | head -30 18 19 # root の files 20 ls -la <project> 21 22 # entry point / scripts を確認 23 cat <project>/package.json | jq '.scripts, .dependencies | keys' 24 # Python: cat pyproject.toml / Cargo.toml / go.mod も同様 25 ``` 26 27 ### Pattern B: 関数/シンボル探索 28 特定の関数や export を素早く見つける。 29 30 ```bash 31 # シンボル名直撃(ripgrep 推奨) 32 rg -n "function_name" <project>/src --type ts 33 34 # fallback で grep 35 grep -rn "function_name" <project>/src --include='*.ts' \ 36 --exclude-dir=node_modules --exclude-dir=dist 37 38 # export だけ列挙 39 rg -n "^export (function|const|class) \w+" src --type ts 40 ``` 41 42 ### Pattern C: import 依存追跡 43 どのモジュールが何を使っているか俯瞰。 44 45 ```bash 46 # alias import (`@/...`) の使用箇所 47 rg -n "from ['\"]@/" src 48 49 # 特定ライブラリの import 全件 50 rg -n "import .* from ['\"]lodash" . 51 52 # 逆向き: 自作モジュールがどこから import されているか 53 rg -n "from .*/utils/format" src 54 ``` 55 56 ### Pattern D: 最近変更 57 直近の変更で何が動いているかを把握。 58 59 ```bash 60 # 直近 7 日のコミット 61 git log --oneline --since='7 days ago' -- <path> 62 63 # 最近 5 commit の差分サマリ 64 git diff HEAD~5..HEAD --stat 65 66 # ファイルごとの最終更新 67 git log -1 --format='%ai %s' -- <file> 68 ``` 69 70 ## Pitfalls 71 72 - `node_modules` / `.next` / `dist` / `.git` を除外しないと find/grep が遅く、ノイズが多い。`--exclude-dir` か `find -not -path` で必ず除く。 73 - 大規模 monorepo で `find` が秒単位かかるなら ripgrep (`rg`) に切り替える。`rg` は `.gitignore` を自動尊重する。 74 - `grep -r` で `--include='*.ts'` を付けないと minified JS や lock file まで舐めて壊れる。 75 - `jq` が無い環境では `node -e "console.log(Object.keys(require('./package.json').scripts))"` で代替。 76 - Pattern A の `find -maxdepth 3` は深い monorepo (`packages/*/src/...`) では浅すぎる。その時は 4-5 に上げる。 77 78 ## Verification 79 80 - Pattern A の出力が 50 行未満で、root レイアウト・主要ディレクトリ・entry point が一目で分かる。 81 - Pattern B/C で目的のシンボルが見つかる。export 数と import 数の整合(孤立した export は dead code 候補)。 82 - Pattern D で直近の活発な領域 = 今コンテキストとして読むべき領域、と対応している。 83 - 全 Pattern を実行しても 30 秒以内に終わる。超えるなら除外フィルタかツール (`rg`) を見直す。
bokuwalily/claude-code-skills/tree/main/skills/project-exploration-patterns commit b2aa8f12a6
Frequently asked questions How do I install the Project Exploration Patterns skill? Run npx skillmds@latest add bokuwalily/project-exploration-patterns in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Project Exploration Patterns skill do? Procedure It is listed under Coding & Dev Tools on SkillMD.
Is Project Exploration Patterns safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Project Exploration Patterns? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Project Exploration Patterns free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Project Exploration Patterns? bokuwalily (@bokuwalily) published this skill. Their other Agent Skills are listed on their SkillMD profile.