xiaohongshu
xiaohongshu
build-graph
GraphDB構築エージェント - ユビキタス言語とコード解析結果からRyuGraphデータベースを構築。/build-graph [対象パス] で呼び出し。
Full skill instructions
既存のシステム分析結果とソースコードを解析し、RyuGraph GraphDBにユビキタス言語ベースのナレッジグラフを構築するエージェントです。
このエージェントは以下を実行します:
/analyze-system の出力(ユビキタス言語、ドメイン-コード対応表等)を収集pip install ryugraph)/analyze-system が実行済み(推奨、なくてもコードから構築可能)| テーブル | 説明 | プロパティ |
|---|---|---|
UbiquitousTerm | ユビキタス言語の用語 | name (PK), name_ja, definition, domain |
Domain | ビジネスドメイン | name (PK), type, description |
Entity | クラス/インターフェース | name (PK), file_path, type, line_number |
Method | メソッド/関数 | name (PK), signature, file_path, line_number |
File | ソースファイル | path (PK), language, module |
Actor | アクター(人/システム) | name (PK), type, description |
Role | ロール/権限 | name (PK), permissions |
| テーブル | FROM → TO | 説明 |
|---|---|---|
BELONGS_TO | Entity → Domain | ドメインへの所属 |
DEFINED_IN | Entity/Method → File | ファイルでの定義 |
REFERENCES | Entity/Method → Entity | 参照関係 |
CALLS | Method → Method | 呼び出し関係 |
IMPLEMENTS | Entity → Entity | 実装/継承関係 |
HAS_TERM | Entity/Method → UbiquitousTerm | 用語との関連 |
HAS_ROLE | Actor → Role | ロールの保持 |
あなたはGraphDBを構築する専門家エージェントです。以下の手順でRyuGraphデータベースを構築してください。
まず、対象ディレクトリと分析結果の有無を確認します。
# 引数から対象パスを取得
TARGET_PATH=$1 # 例: ./src
# 分析結果の存在確認
ls ${TARGET_PATH}/reports/01_analysis/
分析結果が存在する場合、以下のファイルを読み込みます:
reports/01_analysis/
├── ubiquitous_language.md # ユビキタス言語
├── domain_code_mapping.md # ドメイン-コード対応
├── actors_roles_permissions.md # アクター・ロール
└── current_system_overview.md # システム概要
重要: Markdownのテーブルをパースして構造化データに変換します。
Serenaツールを使用してコード構造を取得:
# シンボル概要を取得
mcp__serena__get_symbols_overview で主要ファイルを解析
# クラス/メソッドの詳細を取得
mcp__serena__find_symbol で重要なシンボルを検索
# 参照関係を取得
mcp__serena__find_referencing_symbols で依存関係を分析
収集した情報からグラフデータを生成します。
ノードデータ(CSVファイル):
# terms.csv
name,name_ja,definition,domain
Order,注文,顧客が商品を購入する単位,コアドメイン
Customer,顧客,システムの利用者,コアドメイン
# entities.csv
name,file_path,type,line_number
Order,src/domain/order.ts,class,10
Customer,src/domain/customer.ts,class,5
# methods.csv
name,signature,file_path,line_number
createOrder,createOrder(items: Item[]): Order,src/service/order.ts,25
リレーションデータ(CSVファイル):
# belongs_to.csv
entity,domain
Order,OrderManagement
Customer,CustomerManagement
# has_term.csv
entity,term
Order,Order
CustomerService,Customer
Pythonスクリプトを実行してグラフを構築:
python scripts/build_graph.py \
--data-dir ${TARGET_PATH}/reports/graph/data \
--db-path ${TARGET_PATH}/knowledge.ryugraph
構築したグラフの整合性を確認:
# ノード数の確認
MATCH (n) RETURN labels(n), count(*);
# リレーション数の確認
MATCH ()-[r]->() RETURN type(r), count(*);
# サンプルクエリ
MATCH (e:Entity)-[:HAS_TERM]->(t:UbiquitousTerm)
RETURN e.name, t.name_ja LIMIT 10;
<対象プロジェクト>/
├── knowledge.ryugraph/ # RyuGraphデータベース
└── reports/
└── graph/
├── data/ # 中間CSVファイル
│ ├── terms.csv
│ ├── domains.csv
│ ├── entities.csv
│ ├── methods.csv
│ ├── files.csv
│ ├── actors.csv
│ ├── roles.csv
│ ├── belongs_to.csv
│ ├── defined_in.csv
│ ├── references.csv
│ ├── calls.csv
│ ├── implements.csv
│ ├── has_term.csv
│ └── has_role.csv
├── schema.md # グラフスキーマ説明
└── statistics.md # グラフ統計情報
# GraphDB統計情報
## 生成日時
2024-XX-XX HH:MM:SS
## ノード統計
| ノードタイプ | 件数 |
|------------|------|
| UbiquitousTerm | 45 |
| Domain | 6 |
| Entity | 120 |
| Method | 350 |
| File | 80 |
| Actor | 5 |
| Role | 8 |
## リレーション統計
| リレーションタイプ | 件数 |
|------------------|------|
| BELONGS_TO | 120 |
| DEFINED_IN | 470 |
| REFERENCES | 890 |
| CALLS | 1200 |
| IMPLEMENTS | 45 |
| HAS_TERM | 280 |
| HAS_ROLE | 12 |
## データソース
- 分析結果: あり
- コード解析: あり
- 対象ファイル数: 80
pip install ryugraph を提案xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience