📚 Entity-Relation Based Documentation
Version: 2.0.0
Last Updated: 2025-11-22
Priority: ⭐⭐⭐ (P2 Level)
Purpose: Automatic document generation based on the Miyabi Entity-Relation model
📋 Overview
Provides document generation and Mermaid diagram creation based on Miyabi's 14-entity, 39-relation model.
🎯 P0: Invocation triggers
| Trigger |
Example |
| Documentation |
"document this feature" |
| Architecture |
"update the architecture docs" |
| Description |
"explain how X works" |
| After new features |
"after implementing new features" |
🔧 P1: Entity-Relation model
14 Entities
| Entity |
Description |
Number of relations |
| Issue |
GitHub Issue |
8 |
| Task |
Decomposed tasks |
6 |
| Agent |
Execution Agent |
7 |
| PR |
Pull Request |
4 |
| Label |
Label |
5 |
| QualityReport |
Quality report |
3 |
| Command |
CLI command |
2 |
| Escalation |
Escalation |
3 |
| Deployment |
Deployment |
3 |
| LDDLog |
Learning log |
2 |
| DAG |
Task graph |
4 |
| Worktree |
Git Worktree |
4 |
| DiscordCommunity |
Discord community |
4 |
| SubIssue |
Sub-issue |
3 |
39 Relations (by category)
| Category |
Relations |
Count |
| Issue processing |
R1-R4 |
4 |
| Agent execution |
R9-R15 |
7 |
| Label control |
R16-R18 |
3 |
| Quality management |
R19-R23 |
5 |
| Parallel execution |
R24-R27 |
4 |
| Community |
R28-R35 |
8 |
| Hierarchy |
R36-R39 |
4 |
| Other |
R5-R8 |
4 |
🚀 P2: Document patterns
Pattern 1: Feature documentation
# [機能名]
## 概要
[1-2文で説明]
## Entity関係
- 主要Entity: [Entity名]
- 関連Entity: [Entity1], [Entity2]
- 使用Relations: R1, R9, R16
## 実装ファイル
- `crates/miyabi-xxx/src/lib.rs`
- `crates/miyabi-xxx/src/feature.rs`
## 使用方法
[コード例]
## 関連ドキュメント
- [リンク1]
- [リンク2]
Pattern 2: Mermaid diagram
graph TD
Issue[Issue] -->|R1| Task[Task]
Task -->|R9| Agent[Agent]
Agent -->|R12| PR[PR]
Agent -->|R19| QualityReport[QualityReport]
Pattern 3: Architecture documentation
# [コンポーネント名] Architecture
## レイヤー構造
[ASCII diagram]
## データフロー
[Mermaid sequence diagram]
## 依存関係
[依存グラフ]
⚡ P3: Automatic generation workflow
Step 1: Entity identification
# コードからEntity参照を抽出
grep -r "Issue\|Task\|Agent" crates/
Step 2: Relation identification
# 関係性パターンを検出
# creates, updates, triggers, etc.
Step 3: Document generation
自動生成セクション:
- [ ] 概要
- [ ] Entity関係図
- [ ] ファイルマッピング
- [ ] API リファレンス
- [ ] 使用例
✅ Success criteria
| Check item |
Criteria |
| Entity identification |
All related Entities |
| Relation identification |
All used Relations |
| Diagram |
Mermaid generation |
| File mapping |
Implementation file linking |
| Illustration |
Includes code examples |
🔗 Related documents
| Document |
Purpose |
docs/ENTITY_RELATION_MODEL.md |
ER model details |
context/miyabi-definition.md |
Definition list |
docs/TEMPLATE_MASTER_INDEX.md |
Template |
📝 Related Skills
- Rust Development: Implementation code confirmation
- Issue Analysis: Issue analysis results
- Git Workflow: Change history reference