xddp-codemap
モジュールカタログを生成・更新する。リポジトリのモジュール構成・主要シンボル・依存関係を baseline_docs/{repo}/module-catalog.md に保存し、スペックアウトの BFS 優先度制御に活用する。 「コードマップを生成して」「モジュールカタログを作って」などで起動する。
- License 许可
- MIT
- 最近更新
- 2026-11-08
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- xddp-codemap
- description
- モジュールカタログを生成・更新する。リポジトリのモジュール構成・主要シンボル・依存関係を baseline_docs/{repo}/module-catalog.md に保存し、スペックアウトの BFS 優先度制御に活用する。 「コードマップを生成して」「モジュールカタログを作って」などで起動する。
- argument-hint
- [repo名 | all]
02 资源文件 1
- 参考文档templates/module-catalog-template.md1.2 KB
03 SKILL.md 正文
You are executing XDDP Codemap — Generate Module Catalog.
本スキルは CR 非依存のため CR 解決行(xddp-common の "## CR Resolution")は不要。
Arguments: $ARGUMENTS
- No args → all repos defined in REPOS:
{repo}→ specific repository (matches a REPOS: key)all→ all repositories
Step 0: Parse arguments, locate xddp.config.md
Read ~/.claude/skills/xddp-common/SKILL.md, apply "## Load Config"
→ let WORKSPACE_ROOT, DOCS_DIR, DOCS, REPOS_MAP, REPOS_KEYS,
EXCLUDE_PATTERNS, INCLUDE_EXTENSIONS(他の戻り値は本スキルでは未使用).
Resolve target repos:
- No args or
all→TARGET_REPOS= all REPOS_KEYS {repo}→ if matches a REPOS_KEY:TARGET_REPOS= [{repo}]. Else: report error and stop.crossis reserved and not a valid target (report error).
Step 1: For each repo in TARGET_REPOS — generate catalog
For each {repo} in TARGET_REPOS:
Let REPO_PATH = REPOS_MAP[repo].
Step 1a: Detect language and project structure
Check for the following files in {REPO_PATH}:
package.json→ Node.js / TypeScript / JavaScriptpyproject.tomlorrequirements.txtorsetup.py→ Pythongo.mod→ Gopom.xmlorbuild.gradle→ Java / KotlinCargo.toml→ RustCMakeLists.txtorMakefile→ C/C++ (or embedded)- Fallback → inspect directory structure for language hints
Let LANGUAGE = detected language (or "Unknown").
Let BUILD_FILE = path to detected build file (or empty).
Step 1b: Identify module directories
ツール選択(優先度順):
- Glob ツール(
{REPO_PATH}/**/*パターンでディレクトリ一覧を取得)を第一選択とする - Glob が使用できない場合: Bash で
find {REPO_PATH} -type d -maxdepth 3にフォールバック
取得したディレクトリ一覧から EXCLUDE_PATTERNS を後処理フィルタとして適用する (各ディレクトリパスが EXCLUDE_PATTERNS の任意エントリをサブストリングとして含む場合に除外)。
Apply heuristics to identify "module directories" (directories that contain source files at the detected extension):
- If INCLUDE_EXTENSIONS set: directories containing files with those extensions
- Otherwise: directories containing source files (
.py,.ts,.go,.java,.rs,.c,.cpp,.hetc.) - Directories that contain only other directories (no source files) are treated as namespace containers, not modules themselves
Let MODULE_DIRS = list of identified module directories.
Limit to at most 50 module directories per repo. If more found: record the first 50 by path depth
(shallow-first) and add the following note to CATALOG_FILE:
> ⚠️ このリポジトリには {N} 件のモジュールが見つかりましたが、上限(50件)のため最初の 50 件のみ記録しています。
> 残りのモジュールを追加する場合: このファイルの「## 2. モジュール一覧」に手動でエントリを追記してください。
Step 1c: For each module directory — extract symbols and imports
For each module_dir in MODULE_DIRS:
Detect entry point:
| Language | Entry point files to check |
|---|---|
| Python | __init__.py in module_dir |
| TypeScript/JavaScript | index.ts, index.js, index.tsx in module_dir |
| Go | All *.go files in module_dir (package-level) |
| Java/Kotlin | package-info.java if present; else first .java/.kt file |
| Rust | lib.rs, mod.rs, main.rs in module_dir |
| C/C++ | Top-level .h files in module_dir |
| Unknown | First 3 source files found |
Read the entry point file(s).
Extract exported/public symbols (top 10 per module):
- Python: top-level
def,class, entries in__all__if defined - TypeScript/JS:
export function,export class,export const,export type - Go: capitalized top-level
func,type,var,const - Java/Kotlin:
public class,public interface,public fun - Rust:
pub fn,pub struct,pub enum,pub trait - C/C++: non-static function declarations in
.hfiles - Limit to 10 symbols per module; if more found, record top 10 and note count
シンボル → モジュール逆引きテーブルの構築:
各モジュールのシンボルを記録する際、以下の形式で SYMBOL_TO_MODULE マップを構築する:
SYMBOL_TO_MODULE[symbol_name] = module_dir
このマップは specout エージェントの BFS 優先度計算(Wave 0 完了後)でシンボル→モジュール逆引きに使用する。
マップは module-catalog.md の「## 3. シンボル索引」セクションとして出力する。
Extract module-level imports (dependencies within the same repo):
Read the entry point file(s) and scan for import statements.
Filter to only internal imports (imports that reference another module within REPO_PATH).
Map import paths to module directory names.
Let DEPS[module_dir] = list of internal modules imported.
Step 1d: Build reverse dependency map
After processing all modules:
For each module M and each dep D in DEPS[M]:
Add M to RDEPS[D] (D is depended on by M).
Step 1e: Infer module roles
For each module_dir, infer a one-line role description using:
- Docstring / module-level comment in the entry point file
- README.md in the module directory (if present)
- Directory name heuristics (e.g.,
auth/→ "認証・認可",db/→ "データアクセス層") - If none available: "(役割未判定 — 手動記入推奨)"
Step 1f: Generate module-catalog.md from template
Read ~/.claude/skills/xddp-codemap/templates/module-catalog-template.md.
Fill in all placeholders with the collected data.
Generate Mermaid dependency graph from DEPS/RDEPS.
Let CATALOG_FILE = {DOCS}/{repo}/module-catalog.md.
Ensure {DOCS}/{repo}/ directory exists (mkdir -p via Bash).
Write CATALOG_FILE. (No human confirmation; overwrite if exists.)
Step 2: Report (in Japanese)
Tell the user:
モジュールカタログ生成完了
リポジトリ 出力ファイル モジュール数 {repo} {CATALOG_FILE}{N} 次のステップ:
- 内容を確認し、役割記述が不正確な場合は手動で修正してください
- スペックアウト(
/xddp-04-specout)実行時にカタログが自動参照されます- カタログを更新する場合:
/xddp-codemap {repo}を再実行してください(上書き再生成)
保守メモ: このファイルを変更した場合は、
README.md(スキル一覧テーブル)、CLAUDE.md(ステップ番号体系テーブル)も合わせて更新すること。
04 同仓库更多 Skills
demo.skill
暂无简介
demo.noname
暂无简介
demo.common
暂无简介
demo.badname
暂无简介
xddp-update-knowledge
任意のタイミングで baseline_docs/ の knowledge ディレクトリに知識を追加・更新する。CR 非依存。対話形式と引数形式に対応。「知識を登録して」「callgraph を記録して」「メモを保存して」などで起動する。
xddp-sync-design
コードから DSN を再生成してリビジョンとして記録し、AIレビュー→人承認を実施する。「設計を同期して」「DSN を更新して」などで起動する。