musubix 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,132 @@
1
+ # GitHub Actions npm Publish Setup Guide
2
+
3
+ このドキュメントでは、GitHub Actionsを使用してMUSUBIXパッケージをnpmに自動公開する設定方法を説明します。
4
+
5
+ ## 1. NPM_TOKEN シークレットの設定
6
+
7
+ ### 1.1 npmアクセストークンの作成
8
+
9
+ 1. [npmjs.com](https://www.npmjs.com) にログイン
10
+ 2. 右上のアバター → **Access Tokens** をクリック
11
+ 3. **Generate New Token** → **Classic Token** を選択
12
+ 4. トークン名を入力(例: `MUSUBIX_GITHUB_ACTIONS`)
13
+ 5. タイプは **Automation** を選択(CIでの使用に最適)
14
+ 6. **Generate Token** をクリック
15
+ 7. 表示されたトークンをコピー(このトークンは一度しか表示されません)
16
+
17
+ ### 1.2 GitHubシークレットへの登録
18
+
19
+ 1. GitHub リポジトリ(https://github.com/nahisaho/MUSUBIX)を開く
20
+ 2. **Settings** タブをクリック
21
+ 3. 左メニューの **Secrets and variables** → **Actions** を選択
22
+ 4. **New repository secret** をクリック
23
+ 5. 以下を入力:
24
+ - **Name**: `NPM_TOKEN`
25
+ - **Secret**: (コピーしたnpmトークン)
26
+ 6. **Add secret** をクリック
27
+
28
+ ## 2. ワークフローの説明
29
+
30
+ ### 2.1 CI ワークフロー (`.github/workflows/ci.yml`)
31
+
32
+ プルリクエストとmainブランチへのプッシュ時に自動実行:
33
+
34
+ - ✅ Node.js 20, 22 でのビルドテスト
35
+ - ✅ TypeScriptコンパイル
36
+ - ✅ Lintチェック
37
+ - ✅ ユニットテスト
38
+ - ✅ CLI動作確認
39
+ - ✅ モジュールインポート確認
40
+
41
+ ### 2.2 Publish ワークフロー (`.github/workflows/publish.yml`)
42
+
43
+ 以下のタイミングで実行:
44
+
45
+ 1. **リリース作成時**: GitHubでリリースを作成すると自動的にnpmへ公開
46
+ 2. **手動実行**: Actions タブから手動でトリガー可能(ドライランオプション付き)
47
+
48
+ ## 3. 使用方法
49
+
50
+ ### 3.1 リリース作成による自動公開
51
+
52
+ ```bash
53
+ # 1. バージョンを更新
54
+ npm version patch # または minor, major
55
+
56
+ # 2. 変更をプッシュ
57
+ git push origin main --tags
58
+
59
+ # 3. GitHubでリリースを作成
60
+ # - https://github.com/nahisaho/MUSUBIX/releases/new
61
+ # - タグを選択(例: v1.0.1)
62
+ # - リリースノートを記入
63
+ # - "Publish release" をクリック
64
+ ```
65
+
66
+ リリースが公開されると、GitHub Actionsが自動的にnpmへパッケージを公開します。
67
+
68
+ ### 3.2 手動実行
69
+
70
+ 1. https://github.com/nahisaho/MUSUBIX/actions を開く
71
+ 2. 左メニューから **Publish to npm** を選択
72
+ 3. **Run workflow** をクリック
73
+ 4. オプション:
74
+ - **Dry run**: `true` にすると実際の公開をスキップ(テスト用)
75
+ 5. **Run workflow** をクリック
76
+
77
+ ## 4. トラブルシューティング
78
+
79
+ ### 4.1 認証エラー
80
+
81
+ ```
82
+ npm ERR! code E401
83
+ npm ERR! 401 Unauthorized
84
+ ```
85
+
86
+ **解決策**:
87
+ - NPM_TOKEN シークレットが正しく設定されているか確認
88
+ - トークンの有効期限が切れていないか確認
89
+ - トークンのタイプが "Automation" または "Publish" であるか確認
90
+
91
+ ### 4.2 パッケージ名の競合
92
+
93
+ ```
94
+ npm ERR! code E403
95
+ npm ERR! 403 Forbidden - Package name too similar to existing packages
96
+ ```
97
+
98
+ **解決策**:
99
+ - パッケージ名がnpmで利用可能か確認
100
+ - スコープ付きパッケージ名(@nahisaho/musubix-xxx)を使用
101
+
102
+ ### 4.3 バージョンの重複
103
+
104
+ ```
105
+ npm ERR! code E403
106
+ npm ERR! 403 Forbidden - You cannot publish over the previously published version
107
+ ```
108
+
109
+ **解決策**:
110
+ - `package.json` のバージョンを更新
111
+ - `npm version patch/minor/major` でバージョンを上げる
112
+
113
+ ## 5. セキュリティのベストプラクティス
114
+
115
+ 1. **トークンの管理**:
116
+ - トークンは定期的にローテーション
117
+ - Automationタイプを使用(2FA不要)
118
+ - 最小権限の原則に従う
119
+
120
+ 2. **Provenance(来歴)**:
121
+ - `--provenance` フラグでnpmパッケージの来歴を証明
122
+ - GitHubとnpmアカウントの紐付けを確認可能
123
+
124
+ 3. **ブランチ保護**:
125
+ - mainブランチへの直接プッシュを制限
126
+ - プルリクエストでのレビューを必須化
127
+
128
+ ## 6. 関連リンク
129
+
130
+ - [npm Access Tokens Documentation](https://docs.npmjs.com/about-access-tokens)
131
+ - [GitHub Actions Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets)
132
+ - [npm Provenance](https://docs.npmjs.com/generating-provenance-statements)
@@ -0,0 +1,442 @@
1
+ # MUSUBIX インストールガイド
2
+
3
+ **文書ID**: INSTALL-GUIDE
4
+ **バージョン**: 1.0.0
5
+ **最終更新**: 2026-01-02
6
+
7
+ ---
8
+
9
+ ## 目次
10
+
11
+ 1. [概要](#概要)
12
+ 2. [システム要件](#システム要件)
13
+ 3. [インストール方法](#インストール方法)
14
+ 4. [YATA のインストール](#yata-のインストール)
15
+ 5. [AI プラットフォームとの連携](#ai-プラットフォームとの連携)
16
+ 6. [動作確認](#動作確認)
17
+ 7. [トラブルシューティング](#トラブルシューティング)
18
+
19
+ ---
20
+
21
+ ## 概要
22
+
23
+ MUSUBIX は以下の2つのコンポーネントで構成されています:
24
+
25
+ ```mermaid
26
+ flowchart LR
27
+ subgraph MUSUBIX["MUSUBIX(Node.js)"]
28
+ Core["@nahisaho/musubix-core"]
29
+ MCP["@nahisaho/musubix-mcp-server"]
30
+ Client["@nahisaho/musubix-yata-client"]
31
+ end
32
+
33
+ subgraph YATA["YATA(Python)"]
34
+ Server["YATA MCP Server"]
35
+ KG["Knowledge Graph"]
36
+ end
37
+
38
+ Client <-->|MCP| Server
39
+ ```
40
+
41
+ | コンポーネント | 言語 | 役割 | 必須 |
42
+ |--------------|------|------|------|
43
+ | **MUSUBIX** | Node.js | ニューロシンボリックAIコーディングシステム | ✅ |
44
+ | **YATA** | Python | 知識グラフMCPサーバー | オプション |
45
+
46
+ ### 利用パターン
47
+
48
+ | パターン | インストール対象 | 利用可能機能 |
49
+ |---------|-----------------|-------------|
50
+ | **基本** | MUSUBIXのみ | EARS要件分析、C4設計生成、コード生成 |
51
+ | **フル** | MUSUBIX + YATA | 上記 + 知識グラフ連携、形式的検証、説明生成 |
52
+
53
+ ---
54
+
55
+ ## システム要件
56
+
57
+ ### MUSUBIX(必須)
58
+
59
+ | 項目 | 要件 |
60
+ |------|------|
61
+ | **OS** | Windows 10+, macOS 12+, Linux (Ubuntu 20.04+) |
62
+ | **Node.js** | >= 20.0.0 |
63
+ | **npm** | >= 10.0.0 |
64
+ | **TypeScript** | >= 5.3(開発時) |
65
+ | **ディスク容量** | 約 100MB |
66
+
67
+ ### YATA(オプション)
68
+
69
+ | 項目 | 要件 |
70
+ |------|------|
71
+ | **Python** | >= 3.11 |
72
+ | **uv** | 最新版(推奨)または pip |
73
+ | **ディスク容量** | 約 500MB(フレームワーク知識含む) |
74
+
75
+ ---
76
+
77
+ ## インストール方法
78
+
79
+ ### 方法1: npm/npx(推奨)
80
+
81
+ ```bash
82
+ # グローバルインストール
83
+ npm install -g musubix
84
+
85
+ # バージョン確認
86
+ musubix --version
87
+ musubix-mcp --version
88
+ ```
89
+
90
+ ### 方法2: npx で直接実行
91
+
92
+ ```bash
93
+ # インストールなしで実行
94
+ npx musubix --help
95
+ npx musubix init
96
+
97
+ # MCP サーバー起動
98
+ npx @nahisaho/musubix-mcp-server
99
+ npx musubix-mcp --transport stdio
100
+ ```
101
+
102
+ ### 方法3: プロジェクトへのインストール
103
+
104
+ ```bash
105
+ # 統合パッケージ(推奨)
106
+ npm install musubix
107
+
108
+ # または個別パッケージのインストール
109
+ npm install @nahisaho/musubix-core
110
+ npm install @nahisaho/musubix-mcp-server
111
+ npm install @nahisaho/musubix-yata-client # YATA連携用
112
+ ```
113
+
114
+ #### パッケージ比較
115
+
116
+ | パッケージ | 説明 | 用途 |
117
+ |-----------|------|------|
118
+ | `musubix` | 統合パッケージ | 全機能、簡単セットアップ |
119
+ | `@nahisaho/musubix-core` | コアライブラリのみ | 最小限のインストール |
120
+ | `@nahisaho/musubix-mcp-server` | MCPサーバーのみ | AIプラットフォーム連携 |
121
+ | `@nahisaho/musubix-yata-client` | YATAクライアントのみ | 知識グラフ機能 |
122
+
123
+ ### 方法4: ソースからビルド
124
+
125
+ ```bash
126
+ # リポジトリをクローン
127
+ git clone https://github.com/nahisaho/MUSUBIX.git
128
+ cd MUSUBIX
129
+
130
+ # 依存関係をインストール
131
+ npm install
132
+
133
+ # ビルド
134
+ npm run build
135
+
136
+ # CLIをリンク(開発用)
137
+ npm link
138
+ ```
139
+
140
+ ---
141
+
142
+ ## YATA のインストール
143
+
144
+ YATA はニューロシンボリック機能(知識グラフ連携、形式的検証、説明生成)を使用する場合に必要です。
145
+
146
+ ### 前提条件
147
+
148
+ ```bash
149
+ # Python 3.11+ の確認
150
+ python --version # Python 3.11.x 以上
151
+
152
+ # uv のインストール(推奨)
153
+ curl -LsSf https://astral.sh/uv/install.sh | sh
154
+ ```
155
+
156
+ ### YATA のインストール
157
+
158
+ ```bash
159
+ # リポジトリをクローン
160
+ git clone https://github.com/nahisaho/YATA.git
161
+ cd YATA
162
+
163
+ # uv で依存関係をインストール
164
+ uv sync --all-packages
165
+
166
+ # インストール確認
167
+ uv run yata --version
168
+ uv run yata info
169
+ ```
170
+
171
+ ### YATA サーバーの起動
172
+
173
+ ```bash
174
+ # stdio モード(MCP標準)
175
+ uv run yata serve
176
+
177
+ # SSE モード(HTTP経由)
178
+ uv run yata serve --transport sse --port 8080
179
+ ```
180
+
181
+ ### YATA の基本操作
182
+
183
+ ```bash
184
+ # ソースコードを解析して知識グラフを構築
185
+ uv run yata parse ./src --pattern "**/*.ts" --output graph.json
186
+
187
+ # エンティティを検索
188
+ uv run yata query "function" --type function
189
+
190
+ # 統計情報を表示
191
+ uv run yata stats --graph graph.json
192
+
193
+ # グラフの整合性を検証
194
+ uv run yata validate --graph graph.json --repair
195
+ ```
196
+
197
+ ---
198
+
199
+ ## AI プラットフォームとの連携
200
+
201
+ ### GitHub Copilot (VS Code)
202
+
203
+ `.vscode/mcp.json` を作成:
204
+
205
+ ```json
206
+ {
207
+ "mcpServers": {
208
+ "musubix": {
209
+ "command": "npx",
210
+ "args": ["@nahisaho/musubix-mcp-server"]
211
+ },
212
+ "yata": {
213
+ "command": "uv",
214
+ "args": ["run", "yata", "serve"],
215
+ "cwd": "/path/to/YATA"
216
+ }
217
+ }
218
+ }
219
+ ```
220
+
221
+ ### Claude Desktop
222
+
223
+ 設定ファイルの場所:
224
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
225
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
226
+ - **Linux**: `~/.config/Claude/claude_desktop_config.json`
227
+
228
+ ```json
229
+ {
230
+ "mcpServers": {
231
+ "musubix": {
232
+ "command": "npx",
233
+ "args": ["@nahisaho/musubix-mcp-server"]
234
+ },
235
+ "yata": {
236
+ "command": "uv",
237
+ "args": ["run", "yata", "serve"],
238
+ "cwd": "/path/to/YATA"
239
+ }
240
+ }
241
+ }
242
+ ```
243
+
244
+ ### Claude Code(CLI)
245
+
246
+ プロジェクトルートに `.mcp.json` を作成:
247
+
248
+ ```json
249
+ {
250
+ "mcpServers": {
251
+ "musubix": {
252
+ "command": "npx",
253
+ "args": ["@nahisaho/musubix-mcp-server"]
254
+ },
255
+ "yata": {
256
+ "command": "uv",
257
+ "args": ["run", "yata", "serve"],
258
+ "cwd": "/path/to/YATA"
259
+ }
260
+ }
261
+ }
262
+ ```
263
+
264
+ または `claude mcp add` コマンドで設定:
265
+
266
+ ```bash
267
+ # MUSUBIX MCP サーバーを追加
268
+ claude mcp add musubix -- npx @nahisaho/musubix-mcp-server
269
+
270
+ # YATA MCP サーバーを追加(オプション)
271
+ claude mcp add yata -- uv run yata serve
272
+
273
+ # 設定確認
274
+ claude mcp list
275
+ ```
276
+
277
+ ### Cursor IDE
278
+
279
+ `.cursor/mcp.json` を作成:
280
+
281
+ ```json
282
+ {
283
+ "mcpServers": {
284
+ "musubix": {
285
+ "command": "npx",
286
+ "args": ["@nahisaho/musubix-mcp-server"]
287
+ },
288
+ "yata": {
289
+ "command": "uv",
290
+ "args": ["run", "yata", "serve"],
291
+ "cwd": "/path/to/YATA"
292
+ }
293
+ }
294
+ }
295
+ ```
296
+
297
+ ---
298
+
299
+ ## 動作確認
300
+
301
+ ### MUSUBIX の確認
302
+
303
+ ```bash
304
+ # CLI ヘルプ表示
305
+ musubix --help
306
+
307
+ # プロジェクト初期化
308
+ musubix init my-project
309
+
310
+ # MCP サーバー起動テスト
311
+ musubix-mcp --help
312
+ ```
313
+
314
+ ### YATA の確認
315
+
316
+ ```bash
317
+ # サーバー情報表示
318
+ uv run yata info
319
+
320
+ # サンプルコードを解析
321
+ uv run yata parse ./sample --pattern "**/*.py"
322
+ ```
323
+
324
+ ### 統合テスト
325
+
326
+ ```bash
327
+ # YATA サーバーを起動(別ターミナル)
328
+ cd /path/to/YATA
329
+ uv run yata serve
330
+
331
+ # MUSUBIX から YATA に接続確認
332
+ # (@nahisaho/musubix-yata-client を使用したアプリケーションで確認)
333
+ ```
334
+
335
+ ---
336
+
337
+ ## トラブルシューティング
338
+
339
+ ### Node.js のバージョンエラー
340
+
341
+ ```
342
+ Error: MUSUBIX requires Node.js >= 20.0.0
343
+ ```
344
+
345
+ **解決策**:
346
+ ```bash
347
+ # nvm でバージョン切り替え
348
+ nvm install 20
349
+ nvm use 20
350
+
351
+ # または直接インストール
352
+ # https://nodejs.org/ から LTS 版をダウンロード
353
+ ```
354
+
355
+ ### Python のバージョンエラー
356
+
357
+ ```
358
+ Error: Python 3.11+ is required
359
+ ```
360
+
361
+ **解決策**:
362
+ ```bash
363
+ # pyenv でバージョン切り替え
364
+ pyenv install 3.11
365
+ pyenv local 3.11
366
+
367
+ # または直接インストール
368
+ # https://www.python.org/ からダウンロード
369
+ ```
370
+
371
+ ### uv が見つからない
372
+
373
+ ```
374
+ command not found: uv
375
+ ```
376
+
377
+ **解決策**:
378
+ ```bash
379
+ # uv をインストール
380
+ curl -LsSf https://astral.sh/uv/install.sh | sh
381
+
382
+ # PATH を更新
383
+ source ~/.bashrc # または ~/.zshrc
384
+ ```
385
+
386
+ ### MCP サーバー接続エラー
387
+
388
+ ```
389
+ Error: Failed to connect to MCP server
390
+ ```
391
+
392
+ **解決策**:
393
+ 1. サーバーが起動しているか確認
394
+ 2. ポートが使用中でないか確認
395
+ 3. ファイアウォール設定を確認
396
+
397
+ ```bash
398
+ # ポート確認
399
+ lsof -i :3000
400
+
401
+ # プロセス確認
402
+ ps aux | grep musubix
403
+ ps aux | grep yata
404
+ ```
405
+
406
+ ### npm パッケージの権限エラー
407
+
408
+ ```
409
+ EACCES: permission denied
410
+ ```
411
+
412
+ **解決策**:
413
+ ```bash
414
+ # npm のグローバルディレクトリを変更
415
+ mkdir ~/.npm-global
416
+ npm config set prefix '~/.npm-global'
417
+ echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
418
+ source ~/.bashrc
419
+ ```
420
+
421
+ ---
422
+
423
+ ## 次のステップ
424
+
425
+ インストールが完了したら、以下のドキュメントを参照してください:
426
+
427
+ | ドキュメント | 説明 |
428
+ |-------------|------|
429
+ | [USER-GUIDE.ja.md](USER-GUIDE.ja.md) | ユーザーガイド |
430
+ | [API-REFERENCE.md](API-REFERENCE.md) | API リファレンス |
431
+ | [evolution-from-musubi-to-musubix.md](evolution-from-musubi-to-musubix.md) | MUSUBI から MUSUBIX への進化 |
432
+
433
+ ---
434
+
435
+ ## 参考リンク
436
+
437
+ - [MUSUBIX GitHub](https://github.com/nahisaho/MUSUBIX)
438
+ - [YATA GitHub](https://github.com/nahisaho/YATA)
439
+ - [Node.js 公式サイト](https://nodejs.org/)
440
+ - [Python 公式サイト](https://www.python.org/)
441
+ - [uv 公式ドキュメント](https://docs.astral.sh/uv/)
442
+ - [MCP 仕様](https://modelcontextprotocol.io/)