@nahisaho/shikigami 1.53.0 → 2.0.1

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.
@@ -47,7 +47,7 @@ Thinkフェーズで対立仮説や複数パスを検出したら、分岐探索
47
47
 
48
48
  ## ⭐ 検索結果の永続化(v1.26.0 必須)🆕
49
49
 
50
- **search/visit実行後、必ず `save_research` を呼び出す:**
50
+ **web_search/web_fetch実行後、必ず `save_research` を呼び出す:**
51
51
 
52
52
  ```json
53
53
  {"tool":"save_research","arguments":{
@@ -59,8 +59,8 @@ Thinkフェーズで対立仮説や複数パスを検出したら、分岐探索
59
59
 
60
60
  | アクション | save_research の source |
61
61
  |-----------|------------------------|
62
- | SEARCH後 | `"source": "search"` |
63
- | VISIT後 | `"source": "visit"` |
62
+ | web_search後 | `"source": "search"` |
63
+ | web_fetch後 | `"source": "visit"` |
64
64
  | 分析メモ | `"source": "manual"` |
65
65
 
66
66
  > ⚠️ 保存しないと research/ ディレクトリに記録が残りません
@@ -10,7 +10,7 @@ tools: ['shikigami-planner', 'shikigami-deep-research', 'shikigami-consulting-fr
10
10
 
11
11
  | WHEN | DO |
12
12
  |------|-----|
13
- | リサーチ依頼を受けた | Phase 0 を実行(**searchツール使用禁止**) |
13
+ | リサーチ依頼を受けた | Phase 0 を実行(**web_search使用禁止**) |
14
14
  | プロジェクト初期化完了 | Phase 1-5 を順次実行 |
15
15
  | 各Phase完了時 | 成果物を projects/ に保存 |
16
16
  | **フレームワーク分析時** | **PwCフレームワークを優先適用** |
@@ -19,7 +19,7 @@ tools: ['shikigami-planner', 'shikigami-deep-research', 'shikigami-consulting-fr
19
19
 
20
20
  ## ⛔ 最重要ルール
21
21
 
22
- > **searchツール使用前に `npx shikigami new <ProjectName>` 必須**
22
+ > **web_search使用前に `npx shikigami new <ProjectName>` 必須**
23
23
 
24
24
  ```
25
25
  1. プロジェクト名をユーザーに提案して確認
@@ -58,7 +58,7 @@ tools: ['shikigami-planner', 'shikigami-deep-research', 'shikigami-consulting-fr
58
58
  ### ⭐ Phase 2 検索結果の保存(v1.25.0 必須)🆕
59
59
 
60
60
  ```
61
- search/visit実行後、必ず以下を実行:
61
+ web_search/web_fetch実行後、必ず以下を実行:
62
62
 
63
63
  {"tool":"save_research","arguments":{
64
64
  "content":"検索結果やページ内容",
@@ -68,14 +68,14 @@ search/visit実行後、必ず以下を実行:
68
68
  ```
69
69
 
70
70
  **保存タイミング**:
71
- - SEARCH後 → `save_research` (source: "search")
72
- - VISIT後 → `save_research` (source: "visit")
71
+ - web_search後 → `save_research` (source: "search")
72
+ - web_fetch後 → `save_research` (source: "visit")
73
73
  - 分析メモ → `save_research` (source: "manual")
74
74
 
75
75
  ```
76
76
  Phase 0 → Phase 1 → Phase 2 → Phase 3 → Phase 4 → Phase 5
77
77
  ↑ ↑ ↑
78
- search禁止 search解禁 思考フロー出力(v1.20.0)
78
+ search禁止 web_search解禁 思考フロー出力(v1.20.0)
79
79
  ```
80
80
 
81
81
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  mode: agent
3
3
  description: "複数エンティティ間のマッチング分析を自動生成するプロンプト"
4
- tools: ["shikigami_visit", "shikigami_search", "shikigami_file_parser", "read_file"]
4
+ tools: ["shikigami-deep-research", "read_file"]
5
5
  version: "1.12.0"
6
6
  requirements: ["REQ-MATCH-001"]
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  mode: agent
3
3
  description: "Deep Research結果からSWOT分析を自動生成するプロンプト"
4
- tools: ["shikigami_visit", "shikigami_search", "shikigami_file_parser", "read_file"]
4
+ tools: ["shikigami-consulting-framework", "read_file"]
5
5
  version: "1.12.0"
6
6
  requirements: ["REQ-FW-001-02"]
7
7
  ---
@@ -11,7 +11,7 @@ version: "1.25.0"
11
11
  # 検索結果の永続化ルール(v1.25.0 NEW!)
12
12
  # ========================================
13
13
  research_persistence:
14
- description: "search/visit実行後の結果をresearch/ディレクトリに自動保存"
14
+ description: "web_search/web_fetch実行後の結果をresearch/ディレクトリに自動保存"
15
15
  enabled: true
16
16
 
17
17
  # 必須前提条件
@@ -22,7 +22,7 @@ research_persistence:
22
22
  # 保存トリガー
23
23
  triggers:
24
24
  - type: "after_tool_call"
25
- tool: "search"
25
+ tool: "web_search"
26
26
  action:
27
27
  tool: "save_research"
28
28
  arguments:
@@ -31,7 +31,7 @@ research_persistence:
31
31
  source: "search"
32
32
 
33
33
  - type: "after_tool_call"
34
- tool: "visit"
34
+ tool: "web_fetch"
35
35
  action:
36
36
  tool: "save_research"
37
37
  arguments:
@@ -11,38 +11,38 @@ license: MIT
11
11
  | 起動条件 | アクション |
12
12
  |---------|-----------|
13
13
  | リサーチ依頼時 | Think→Report→Action→完了の反復実行 |
14
- | 情報収集が必要な時 | MCPツール(search/visit)で検索・訪問 |
14
+ | 情報収集が必要な時 | `web_search` で検索、`web_fetch` でページ取得 |
15
15
  | 品質検証が必要な時 | 交差検証・ソース批評を実行 |
16
16
 
17
- ## MCPツール
17
+ ## ツール
18
18
 
19
- ### 検索・訪問ツール
19
+ ### 検索・訪問(Copilot CLI 組込み)
20
20
 
21
- | ツール | 用途 | 呼び出し例 |
22
- |--------|------|-----------|
23
- | `search` | Web検索 | `{"tool":"search","arguments":{"query":["日本語","English"],"maxResults":10}}` |
24
- | `visit` | ページ取得 | `{"tool":"visit","arguments":{"url":"URL","goal":"抽出目的"}}` |
21
+ | ツール | 用途 | 説明 |
22
+ |--------|------|------|
23
+ | `web_search` | Web検索 | Copilot CLI 組込み。日本語・英語の両方で検索 |
24
+ | `web_fetch` | ページ取得 | Copilot CLI 組込み。URLのコンテンツを取得 |
25
25
 
26
- ### 永続化ツール(v1.25.0)🆕
26
+ ### 永続化ツール(SHIKIGAMI MCP)
27
27
 
28
28
  | ツール | 用途 | 呼び出し例 |
29
29
  |--------|------|-----------|
30
30
  | `set_project` | プロジェクト設定 | `{"tool":"set_project","arguments":{"autoDetect":true}}` |
31
31
  | `save_research` | 検索結果保存 | `{"tool":"save_research","arguments":{"content":"...","query":"検索クエリ","source":"search"}}` |
32
32
 
33
- ### ⚠️ 必須フロー(v1.25.0)
33
+ ### ⚠️ 必須フロー
34
34
 
35
35
  ```
36
36
  1. Phase 0完了後、set_projectでプロジェクトを設定
37
- 2. search/visit実行後、必ずsave_researchで結果を保存
37
+ 2. web_search/web_fetch実行後、必ずsave_researchで結果を保存
38
38
  3. 保存先: projects/pjXXXXX_Name_YYYYMMDD/research/
39
39
  ```
40
40
 
41
41
  **保存タイミング**:
42
42
  | アクション | 保存内容 | source値 |
43
43
  |------------|----------|------------|
44
- | SEARCH後 | 検索結果一覧 | `"search"` |
45
- | VISIT後 | ページ内容抽出 | `"visit"` |
44
+ | web_search後 | 検索結果一覧 | `"search"` |
45
+ | web_fetch後 | ページ内容抽出 | `"visit"` |
46
46
  | 手動メモ | 分析メモ | `"manual"` |
47
47
 
48
48
  ---
@@ -98,7 +98,7 @@ Thinkの出力で以下のシグナルを検知したら `branch_detect` を呼
98
98
  ### Think (Branch [label], Round 1)
99
99
  ...
100
100
  ### Action: SEARCH
101
- {"tool":"search","arguments":{"query":["...", "..."]}}
101
+ {"tool":"web_search","arguments":{"query":"..."}}
102
102
  {"tool":"save_research","arguments":{"content":"...","query":"...","source":"search","metadata":{"branchId":"[ID]"}}}
103
103
  ```
104
104
 
@@ -242,7 +242,7 @@ manifest.yaml `personas[].domain_knowledge.level` で調整:
242
242
  ## Gotchas
243
243
 
244
244
  1. **set_project 未実行で検索開始** — Phase 0 で `set_project` を実行しないと `save_research` が保存先を特定できない。必ずプロジェクト設定後にリサーチ開始
245
- 2. **save_research の呼び忘れ** — search/visit 実行後に `save_research` を呼ばないとリサーチ結果が揮発する。Think→Report→Action 各サイクル完了時に即保存
245
+ 2. **save_research の呼び忘れ** — web_search/web_fetch 実行後に `save_research` を呼ばないとリサーチ結果が揮発する。Think→Report→Action 各サイクル完了時に即保存
246
246
  3. **信頼度 6.0 未満で次フェーズ移行** — Gate 2→3 は confidence_score ≥ 0.6 が必須。低信頼ソースのみでは通過不可、追加ソース検索が必要
247
247
  4. **単一ソースでの結論** — 交差検証率を維持するため最低3ソースが必要。1ソースのみの主張は「未検証」マーク付与
248
248
  5. **日付の古いソースへの依存** — 3年超のソースは低信頼(0.5以下)。最新データの追加検索を優先
package/AGENTS.md CHANGED
@@ -1,4 +1,4 @@
1
- # SHIKIGAMI - Deep Research Agent Skills v1.35.0
1
+ # SHIKIGAMI - Deep Research Agent Skills v2.0.0
2
2
 
3
3
  > Knowledge for AI Coding Agents — Triggers and Actions defined with WHEN/DO syntax
4
4
 
@@ -34,7 +34,7 @@ VIOLATION = WORKFLOW FAILURE
34
34
  |------|-------|
35
35
  | Version | 1.42.0 |
36
36
  | Agent Skills | 4 |
37
- | MCP Tools | 11 |
37
+ | MCP Tools | 7 |
38
38
  | Frameworks | 53 |
39
39
  | Report Templates | 33 |
40
40
 
@@ -144,20 +144,20 @@ THEN: Call set_project(autoDetect: true) to activate the project
144
144
  FORBIDDEN: Web search, using search tools, or gathering information before project activation
145
145
  ```
146
146
 
147
- ### Prohibition 3: save_research Required After search/visit
147
+ ### Prohibition 3: save_research Required After web_search/web_fetch
148
148
 
149
- **🚨🚨🚨 EVERY search/visit MUST be followed by save_research 🚨🚨🚨**
149
+ **🚨🚨🚨 EVERY web_search/web_fetch MUST be followed by save_research 🚨🚨🚨**
150
150
 
151
151
  ```
152
- WHEN: Executed search or visit MCP tool
152
+ WHEN: Executed web_search or web_fetch Copilot CLI tool
153
153
  DO: IMMEDIATELY call save_research MCP tool (within the SAME response, not later)
154
154
 
155
155
  MANDATORY PATTERN - NO EXCEPTIONS:
156
- search(...) → save_research(...) → next action
157
- visit(...) → save_research(...) → next action
156
+ web_search(...) → save_research(...) → next action
157
+ web_fetch(...) → save_research(...) → next action
158
158
 
159
159
  EXAMPLE 1 (Search):
160
- 1. search(query: ["AI市場動向", "AI market trends"])
160
+ 1. web_search(query: "AI市場動向")
161
161
  2. save_research(
162
162
  content: "<検索結果の全文をここに>",
163
163
  source: "search",
@@ -165,7 +165,7 @@ EXAMPLE 1 (Search):
165
165
  )
166
166
 
167
167
  EXAMPLE 2 (Visit):
168
- 1. visit(url: "https://example.com/article")
168
+ 1. web_fetch(url: "https://example.com/article")
169
169
  2. save_research(
170
170
  content: "<ページ内容の全文をここに>",
171
171
  source: "visit",
@@ -173,8 +173,8 @@ EXAMPLE 2 (Visit):
173
173
  )
174
174
 
175
175
  FORBIDDEN (IMMEDIATE VIOLATION):
176
- - Calling search then another search without save_research in between
177
- - Calling visit then summarizing without save_research first
176
+ - Calling web_search then another web_search without save_research in between
177
+ - Calling web_fetch then summarizing without save_research first
178
178
  - Proceeding to analysis without saving raw data
179
179
  - "I'll save it later" - NO! Save IMMEDIATELY
180
180
 
@@ -183,7 +183,7 @@ CONSEQUENCE: Research data will be lost, workflow corrupted, unable to cite sour
183
183
 
184
184
  **CORRECT FLOW**:
185
185
  ```
186
- Agent: search(query: [...])
186
+ Agent: web_search(query: "...")
187
187
  → [結果を受信]
188
188
  → save_research(content: <全結果>, source: "search", query: <query>)
189
189
  → "検索結果を保存しました。次に..."
@@ -191,7 +191,7 @@ Agent: search(query: [...])
191
191
 
192
192
  **INCORRECT FLOW (VIOLATION)**:
193
193
  ```
194
- Agent: search(query: [...])
194
+ Agent: web_search(query: "...")
195
195
  → "検索結果によると..." ← ❌ save_research を呼んでいない!
196
196
  ```
197
197
 
@@ -241,7 +241,7 @@ CONSEQUENCE: PDF content will be unreadable or lost
241
241
 
242
242
  Every search/visit operation MUST follow this pattern:
243
243
  ```
244
- 1. search(query: [...]) or visit(url: [...])
244
+ 1. web_search(query: "...") or web_fetch(url: "...")
245
245
  2. save_research(content: <results>, source: "search"|"visit", query: <query>)
246
246
  ```
247
247
 
@@ -567,10 +567,10 @@ WHEN: Phase 2 completed, true purpose confirmed
567
567
  DO:
568
568
  LOOP:
569
569
  1. Think: Analyze knowledge gaps
570
- 2. Search: search(query: ["Japanese query", "English query"])
570
+ 2. Search: web_search(query: "Japanese query") + web_search(query: "English query")
571
571
  3. 🚨 IMMEDIATELY: save_research(content: <FULL search_results>, source: "search", query: <query>)
572
572
  → Do NOT proceed without this step!
573
- 4. Visit: visit(url: <target_url>)
573
+ 4. Visit: web_fetch(url: <target_url>)
574
574
  5. 🚨 IMMEDIATELY: save_research(content: <FULL page_content>, source: "visit", query: <url>)
575
575
  → Do NOT proceed without this step!
576
576
  6. Report: Organize collected information
@@ -578,19 +578,19 @@ DO:
578
578
  OUTPUT: Collected information summary, source list (URL + credibility)
579
579
  ```
580
580
 
581
- **🚨 CRITICAL - save_research is MANDATORY after EVERY search/visit**:
581
+ **🚨 CRITICAL - save_research is MANDATORY after EVERY web_search/web_fetch**:
582
582
  - Steps 3 and 5 are NOT optional
583
- - You MUST call save_research IMMEDIATELY after each search/visit
583
+ - You MUST call save_research IMMEDIATELY after each web_search/web_fetch
584
584
  - Do NOT analyze or summarize before saving raw data
585
585
  - Do NOT call multiple searches without saving each one
586
586
 
587
587
  **CORRECT Phase 3 Flow**:
588
588
  ```
589
- search(query: [...])
589
+ web_search(query: "...")
590
590
 
591
591
  save_research(content: <全結果>, source: "search", ...) ← 必須!
592
592
 
593
- visit(url: ...)
593
+ web_fetch(url: ...)
594
594
 
595
595
  save_research(content: <全内容>, source: "visit", ...) ← 必須!
596
596
 
@@ -598,7 +598,7 @@ save_research(content: <全内容>, source: "visit", ...) ← 必須!
598
598
  ```
599
599
 
600
600
  **Search Rules**:
601
- - Parallel JP/EN search required: `["Japanese query", "English query"]`
601
+ - Parallel JP/EN search required: web_search("Japanese query") + web_search("English query")
602
602
  - For academic searches: `.ac.jp`, `.edu`, `.gov` domains auto-prioritized
603
603
  - On 404/5xx: Wayback Machine → Archive.today fallback
604
604
 
@@ -744,16 +744,18 @@ DO:
744
744
  |------|---------|-----------------|
745
745
  | `set_project` | Set project context | Once after Phase 0 completion |
746
746
  | `save_prompt` | Save prompts to prompts/ | Every time user input received |
747
- | `save_research` | Save research results to research/ | Every time after search/visit |
748
- | `search` | Web search | Phase 3 |
749
- | `visit` | Extract page content | Phase 3 |
750
- | `parse_file` | Parse local files | As needed |
751
- | `parse_directory` | Recursively parse directories | As needed |
747
+ | `save_research` | Save research results to research/ | Every time after web_search/web_fetch |
752
748
  | `embed` | Generate text embedding vectors | For semantic search |
753
749
  | `similarity` | Calculate text similarity | For relevance determination |
754
750
  | `semantic_search` | Semantic search | For context retrieval |
755
751
  | `get_project` | Check current project | For debugging |
756
752
 
753
+ **v2.0.0 で削除されたツール(Copilot CLI に委譲):**
754
+ | ~~`search`~~ | → Copilot CLI `web_search` |
755
+ | ~~`visit`~~ | → Copilot CLI `web_fetch` |
756
+ | ~~`parse_file`~~ | → Copilot CLI `view` |
757
+ | ~~`parse_directory`~~ | → Copilot CLI `glob` + `view` |
758
+
757
759
  ### save_prompt type Parameter
758
760
 
759
761
  | type | Purpose |
@@ -769,8 +771,8 @@ DO:
769
771
 
770
772
  | source | Purpose | Filename Example |
771
773
  |--------|---------|------------------|
772
- | `search` | Search results | `search_query_YYYYMMDD_HHMMSS.md` |
773
- | `visit` | Page visit results | `visit_domain_YYYYMMDD_HHMMSS.md` |
774
+ | `search` | Web search results (via Copilot CLI web_search) | `search_query_YYYYMMDD_HHMMSS.md` |
775
+ | `visit` | Page visit results (via Copilot CLI web_fetch) | `visit_domain_YYYYMMDD_HHMMSS.md` |
774
776
  | `manual` | Analysis notes | `manual_topic_YYYYMMDD_HHMMSS.md` |
775
777
 
776
778
  ---
@@ -1099,7 +1101,7 @@ DO: Auto-prioritize .ac.jp, .edu, .gov domains
1099
1101
  ### On 404/5xx Errors
1100
1102
 
1101
1103
  ```
1102
- WHEN: HTTP error occurs on visit
1104
+ WHEN: HTTP error occurs on web_fetch
1103
1105
  DO:
1104
1106
  1. Attempt retrieval from Wayback Machine (archive.org)
1105
1107
  2. On failure, attempt retrieval from Archive.today
@@ -1128,5 +1130,5 @@ DO: Auto-detect Shift_JIS/EUC-JP/ISO-2022-JP and convert to UTF-8
1128
1130
 
1129
1131
  ---
1130
1132
 
1131
- **Last Updated**: 2026-01-28
1132
- **Version**: 1.48.0
1133
+ **Last Updated**: 2026-05-18
1134
+ **Version**: 2.0.0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,26 @@ All notable changes to SHIKIGAMI will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.0.0] - 2026-05-18
9
+
10
+ ### Breaking Changes
11
+
12
+ - **Copilot CLI 重複機能の削除**: GitHub Copilot CLI の組み込み機能と重複する SHIKIGAMI 機能を削除
13
+ - MCP Tools: `search`(→ `web_search`)、`visit`(→ `web_fetch`)、`parse_file`(→ `view`)、`parse_directory`(→ `glob` + `view`)を削除
14
+ - Agent Skills: `session-manager`(→ `/session`)、`context-optimizer`(→ `/context`)、`learning-hooks`(→ `store_memory`)、`codemap`(→ explore agent)、`refactor-cleaner`(→ CLI + bash)を削除
15
+
16
+ ### Changed
17
+
18
+ - **AGENTS.md ワークフロー更新**: リサーチワークフロー内の `search` → `web_search`、`visit` → `web_fetch` に全面移行
19
+ - **MCP Server**: 14ツール → 10ツールに整理(`set_project`, `get_project`, `save_prompt`, `save_research`, `embed`, `similarity`, `semantic_search`, `branch_detect`, `branch_evaluate`, `branch_select`)
20
+ - **Agent Skills**: 20スキル → 15スキルに整理(リサーチ4 + 品質検証5 + MUSUBIX SDD 6)
21
+ - **README.md**: v2.0.0 アーキテクチャ図・スキル一覧・MCP一覧を更新、Copilot CLI 連携設計を明記
22
+
23
+ ### Removed
24
+
25
+ - **MCP Tools(4ツール)**: `search`, `visit`, `parse_file`, `parse_directory`
26
+ - **Agent Skills(5スキル)**: `session-manager`, `context-optimizer`, `learning-hooks`, `codemap`, `refactor-cleaner`
27
+
8
28
  ## [1.53.0] - 2026-04-07
9
29
 
10
30
  ### Fixed
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # SHIKIGAMI-McK
1
+ # SHIKIGAMI
2
2
 
3
3
  **GitHub Copilot Agent Skills for Deep Research & McKinsey Consulting**
4
4
 
5
- マッキンゼーのコンサルティング手法(仮説駆動、MECE、ピラミッド原則、7Sフレームワーク等)を活用した深層リサーチ自動化Agent Skillsパッケージです。
5
+ マッキンゼーのコンサルティング手法(仮説駆動、MECE、ピラミッド原則、7Sフレームワーク等)を活用した深層リサーチ自動化Agent Skillsパッケージです。GitHub Copilot CLI と連携し、Copilot CLI の組み込み機能を活用しつつ、SHIKIGAMI独自のリサーチ・コンサルティング機能を提供します。
6
6
 
7
7
  ## 🎯 できること
8
8
 
@@ -10,8 +10,9 @@
10
10
  - **Deep Research**: WebResearcherパラダイムに基づく反復的深層リサーチ
11
11
  - **マッキンゼー・フレームワーク分析**: 仮説駆動、イシューツリー、7S、ピラミッド原則等を適用
12
12
  - **高品質レポート生成**: ハルシネーション防止、ソース追跡、引用管理
13
- - **キャッシュシステム**: 検索・訪問結果のキャッシュによる効率化
14
- - **進捗管理**: 成果物トラッキング、ダッシュボード、整合性チェック
13
+ - **マルチポップ探索**: リサーチ中の分岐点を自動検出し、複数パスを同時探索
14
+ - **ベクトル検索**: 過去のリサーチ資産をセマンティック検索で再利用
15
+ - **品質検証ループ**: Build→Type→Lint→Test→Security→Diff の6フェーズ検証
15
16
 
16
17
  ## 📦 インストール
17
18
 
@@ -22,45 +23,82 @@ npm install @nahisaho/shikigami-mck
22
23
  または、リポジトリをクローン:
23
24
 
24
25
  ```bash
25
- git clone https://github.com/nahisaho/SHIKIGAMI-McK.git
26
+ git clone https://github.com/nahisaho/SHIKIGAMI.git
26
27
  ```
27
28
 
28
- ## 🔧 Agent Skills
29
+ ## 🏗️ アーキテクチャ
29
30
 
30
- ### shikigami-planner
31
- 対話的目的探索・計画立案スキル。
31
+ SHIKIGAMI v2.0.0 は GitHub Copilot CLI の組み込み機能を最大限活用する設計に移行しました。
32
32
 
33
- - 5 Whys分析で根本的な動機を発見
34
- - JTBD(Jobs To Be Done)分析
35
- - リサーチ計画の自動立案
36
- - **成果物管理・進捗ダッシュボード**
37
- - **整合性チェック**
38
-
39
- ### shikigami-deep-research
40
- 反復的深層リサーチスキル。
41
-
42
- - Think→Report→Action サイクル
43
- - 複数情報源の統合
44
- - ソース追跡・交差検証
45
- - ハルシネーション防止
46
-
47
- ### shikigami-consulting-framework
48
- マッキンゼー・コンサルティングフレームワーク分析スキル。
49
-
50
- - **仮説駆動アプローチ** - 仮説を立て、検証し、結論を導く
51
- - **イシューツリー** - 問題をMECEに分解
52
- - **ピラミッド原則** - 結論先行の論理構造
53
- - **マッキンゼーの7S** - 組織の整合性分析
54
- - **3つの地平線** - 短期・中期・長期の成長管理
55
- - MECE・ロジック品質検証
56
-
57
- ### shikigami-writing
58
- レポート生成・品質保証スキル。
33
+ ```
34
+ ┌─────────────────────────────────────────────────┐
35
+ │ GitHub Copilot CLI │
36
+ │ web_search / web_fetch / store_memory / grep │
37
+ │ explore / research / rubber-duck agents │
38
+ │ /session / /context / /compact │
39
+ ├─────────────────────────────────────────────────┤
40
+ │ SHIKIGAMI v2.0.0 │
41
+ │ ┌──────────────┐ ┌───────────────────────┐ │
42
+ │ │ Agent Skills │ │ MCP Server (10 tools) │ │
43
+ │ │ (15 skills) │ │ embed / similarity │ │
44
+ │ │ │ │ semantic_search │ │
45
+ │ │ Research │ │ branch_detect/eval/ │ │
46
+ │ │ Consulting │ │ select │ │
47
+ │ │ Quality │ │ set/get_project │ │
48
+ │ │ MUSUBIX SDD │ │ save_prompt/research │ │
49
+ │ └──────────────┘ └───────────────────────┘ │
50
+ └─────────────────────────────────────────────────┘
51
+ ```
59
52
 
60
- - 調査レポート、Qiita記事テンプレート
61
- - ハルシネーション検出
62
- - 不確実性マーキング
63
- - 引用管理・Mermaidダイアグラム生成
53
+ ## 🔧 Agent Skills(15スキル)
54
+
55
+ ### リサーチ・コンサルティング
56
+
57
+ | スキル | 説明 |
58
+ |--------|------|
59
+ | `shikigami-planner` | 対話的目的探索・5 Whys・JTBD・リサーチ計画立案 |
60
+ | `shikigami-deep-research` | Think→Report→Actionサイクルの反復的深層リサーチ |
61
+ | `shikigami-consulting-framework` | マッキンゼー・フレームワーク分析(仮説駆動・7S・ピラミッド原則等) |
62
+ | `shikigami-writing` | レポート生成・ハルシネーション検出・引用管理 |
63
+
64
+ ### 品質・検証
65
+
66
+ | スキル | 説明 |
67
+ |--------|------|
68
+ | `build-fix` | ビルドエラーを分類・反復修正(TypeScript/ESLint/依存関係) |
69
+ | `checkpoint` | セーフポイントの作成・復元・比較(Git統合) |
70
+ | `e2e-runner` | Playwrightを使用したE2Eテスト生成・実行 |
71
+ | `eval-harness` | pass@kメトリクスでAIコード生成品質を評価 |
72
+ | `verification-loop` | Build→Type→Lint→Test→Security→Diff の6フェーズ検証 |
73
+
74
+ ### MUSUBIX SDD
75
+
76
+ | スキル | 説明 |
77
+ |--------|------|
78
+ | `musubix-sdd-workflow` | 10憲法条項に従った仕様駆動開発ガイド |
79
+ | `musubix-domain-inference` | 自動ドメイン検出・コンポーネント推論 |
80
+ | `musubix-code-generation` | 設計仕様からのコード生成 |
81
+ | `musubix-test-generation` | TDD/BDDによるテスト生成 |
82
+ | `musubix-adr-generation` | Architecture Decision Records作成 |
83
+ | `musubix-best-practices` | 学習済み17ベストプラクティスガイド |
84
+ | `musubix-c4-design` | C4モデル設計ドキュメント作成 |
85
+ | `musubix-technical-writing` | 技術ドキュメント作成 |
86
+ | `musubix-ears-validation` | EARS形式要件の検証・作成 |
87
+ | `musubix-traceability` | 要件・設計・コード・テスト間のトレーサビリティ管理 |
88
+
89
+ ## 🔌 MCP Server(10ツール)
90
+
91
+ | ツール | 説明 |
92
+ |--------|------|
93
+ | `set_project` / `get_project` | リサーチプロジェクトの設定・取得 |
94
+ | `save_prompt` | リサーチプロンプトの保存 |
95
+ | `save_research` | リサーチ結果の保存 |
96
+ | `embed` | テキストのベクトル埋め込み生成 |
97
+ | `similarity` | テキスト間の類似度計算 |
98
+ | `semantic_search` | 過去のリサーチ資産をセマンティック検索 |
99
+ | `branch_detect` | リサーチ中の分岐シグナル検出 |
100
+ | `branch_evaluate` | 分岐パスのスコアリング・評価 |
101
+ | `branch_select` | 最適な探索パスの選択 |
64
102
 
65
103
  ## 📝 Prompts
66
104
 
@@ -138,9 +176,9 @@ flowchart TB
138
176
  ```
139
177
  ユーザー: 「新規事業の方向性を検討したい」
140
178
 
141
- SHIKIGAMI-McK:
179
+ SHIKIGAMI:
142
180
  1. [Planner] 「成長の目標は何ですか?」→ 真の目的を探索
143
- 2. [Deep Research] 市場情報を仮説駆動で収集
181
+ 2. [Deep Research] 市場情報を仮説駆動で収集(web_search / web_fetch 活用)
144
182
  3. [Framework] 3つの地平線、成長のグラニュラリティを適用
145
183
  4. [Writing] ピラミッド原則で構造化した提言レポートを生成
146
184
  ```
@@ -150,7 +188,7 @@ SHIKIGAMI-McK:
150
188
  ```
151
189
  ユーザー: 「組織の問題点を分析して」
152
190
 
153
- SHIKIGAMI-McK:
191
+ SHIKIGAMI:
154
192
  1. [Planner] 変革の目的・成功基準を確認
155
193
  2. [Deep Research] 組織情報を収集
156
194
  3. [Framework] マッキンゼーの7Sで整合性を分析
@@ -162,7 +200,7 @@ SHIKIGAMI-McK:
162
200
  ```
163
201
  ユーザー: 「間接費を削減したい」
164
202
 
165
- SHIKIGAMI-McK:
203
+ SHIKIGAMI:
166
204
  1. [Planner] 削減目標・制約を確認
167
205
  2. [Deep Research] 間接部門の機能・コストを調査
168
206
  3. [Framework] OVA(間接費価値分析)を適用
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nahisaho/shikigami-pwc-mcp-server",
3
- "version": "1.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "SHIKIGAMI-PwC MCP Server - Deep Research tools with PwC Consulting Frameworks",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -15,9 +15,7 @@ import {
15
15
  type Tool,
16
16
  } from '@modelcontextprotocol/sdk/types.js';
17
17
 
18
- import { searchDuckDuckGo, type SearchResult } from './tools/search.js';
19
- import { visitPage, type PageContent } from './tools/visit.js';
20
- import { parseFile, parseFiles, parseDirectory, type ParsedFile } from './tools/file-parser.js';
18
+ // search, visit, file-parser REMOVED in v2.0.0 (Copilot CLI に委譲)
21
19
  import {
22
20
  embed,
23
21
  embedBatch,
@@ -187,117 +185,11 @@ set_projectでプロジェクトを設定してから使用。`,
187
185
  required: ['content'],
188
186
  },
189
187
  },
190
- // Search & Visit Tools
191
- {
192
- name: 'search',
193
- description: `バッチWeb検索を実行(DuckDuckGo使用)。
194
- 複数クエリを配列で指定可。各クエリのTop10結果を返却。
195
- Deep Researchの情報収集フェーズで使用。`,
196
- inputSchema: {
197
- type: 'object',
198
- properties: {
199
- query: {
200
- oneOf: [
201
- { type: 'string', description: '単一の検索クエリ' },
202
- {
203
- type: 'array',
204
- items: { type: 'string' },
205
- minItems: 1,
206
- description: '検索クエリのリスト(バッチ検索)',
207
- },
208
- ],
209
- description: '検索クエリ(文字列または文字列配列)',
210
- },
211
- maxResults: {
212
- type: 'number',
213
- default: 10,
214
- description: '各クエリあたりの最大結果数(デフォルト: 10)',
215
- },
216
- },
217
- required: ['query'],
218
- },
219
- },
220
- {
221
- name: 'visit',
222
- description: `Webページを訪問し、内容のテキストを抽出(Jina AI Reader使用)。
223
- LLM用に最適化されたクリーンなテキストを返却。
224
- Deep Researchの詳細調査フェーズで使用。`,
225
- inputSchema: {
226
- type: 'object',
227
- properties: {
228
- url: {
229
- oneOf: [
230
- { type: 'string', description: '単一のURL' },
231
- {
232
- type: 'array',
233
- items: { type: 'string' },
234
- description: 'URLのリスト(バッチ訪問)',
235
- },
236
- ],
237
- description: '訪問するURL(文字列または文字列配列)',
238
- },
239
- goal: {
240
- type: 'string',
241
- description: 'このページ訪問の目的(抽出する情報の指針)',
242
- },
243
- },
244
- required: ['url'],
245
- },
246
- },
247
- {
248
- name: 'parse_file',
249
- description: `ローカルファイルを解析してテキストを抽出。
250
- 対応形式: テキスト(txt,md,json,yaml,csv)、コード(ts,js,py等)。
251
- ドキュメント調査やコード解析に使用。`,
252
- inputSchema: {
253
- type: 'object',
254
- properties: {
255
- path: {
256
- oneOf: [
257
- { type: 'string', description: '単一のファイルパス' },
258
- {
259
- type: 'array',
260
- items: { type: 'string' },
261
- description: 'ファイルパスのリスト(バッチ解析)',
262
- },
263
- ],
264
- description: '解析するファイルパス(文字列または文字列配列)',
265
- },
266
- },
267
- required: ['path'],
268
- },
269
- },
270
- {
271
- name: 'parse_directory',
272
- description: `ディレクトリ内のファイルを再帰的に解析。
273
- コードベース全体の理解や、プロジェクト構造の把握に使用。
274
- node_modules, .git等は自動除外。`,
275
- inputSchema: {
276
- type: 'object',
277
- properties: {
278
- path: {
279
- type: 'string',
280
- description: '解析するディレクトリパス',
281
- },
282
- extensions: {
283
- type: 'array',
284
- items: { type: 'string' },
285
- description: '解析する拡張子リスト(例: [".ts", ".js"])',
286
- },
287
- exclude: {
288
- type: 'array',
289
- items: { type: 'string' },
290
- description: '除外パターン(デフォルト: node_modules, .git, dist, build)',
291
- },
292
- maxFiles: {
293
- type: 'number',
294
- default: 100,
295
- description: '最大ファイル数(デフォルト: 100)',
296
- },
297
- },
298
- required: ['path'],
299
- },
300
- },
188
+ // Search & Visit Tools — REMOVED in v2.0.0
189
+ // search: Copilot CLI web_search に委譲
190
+ // visit: Copilot CLI web_fetch に委譲
191
+ // parse_file: Copilot CLI view に委譲
192
+ // parse_directory: Copilot CLI glob + view に委譲
301
193
  {
302
194
  name: 'embed',
303
195
  description: `テキストの埋め込みベクトルを生成(Ollama/OpenAI使用)。
@@ -624,87 +516,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request: CallToolRequest)
624
516
  };
625
517
  }
626
518
 
627
- // Search & Visit Handlers
628
- case 'search': {
629
- const queryInput = args?.query as string | string[];
630
- const maxResults = (args?.maxResults as number) ?? 10;
631
-
632
- const queries = Array.isArray(queryInput) ? queryInput : [queryInput];
633
- const results: Record<string, SearchResult[]> = {};
634
-
635
- for (const query of queries) {
636
- results[query] = await searchDuckDuckGo(query, maxResults);
637
- }
638
-
639
- return {
640
- content: [
641
- {
642
- type: 'text',
643
- text: JSON.stringify(results, null, 2),
644
- },
645
- ],
646
- };
647
- }
648
-
649
- case 'visit': {
650
- const urlInput = args?.url as string | string[];
651
- const goal = (args?.goal as string) ?? '';
652
-
653
- const urls = Array.isArray(urlInput) ? urlInput : [urlInput];
654
- const results: PageContent[] = [];
655
-
656
- for (const url of urls) {
657
- const content = await visitPage(url, goal);
658
- results.push(content);
659
- }
660
-
661
- return {
662
- content: [
663
- {
664
- type: 'text',
665
- text: JSON.stringify(results, null, 2),
666
- },
667
- ],
668
- };
669
- }
670
-
671
- case 'parse_file': {
672
- const pathInput = args?.path as string | string[];
673
-
674
- const paths = Array.isArray(pathInput) ? pathInput : [pathInput];
675
- const results: ParsedFile[] = await parseFiles(paths);
676
-
677
- return {
678
- content: [
679
- {
680
- type: 'text',
681
- text: JSON.stringify(results, null, 2),
682
- },
683
- ],
684
- };
685
- }
686
-
687
- case 'parse_directory': {
688
- const dirPath = args?.path as string;
689
- const extensions = args?.extensions as string[] | undefined;
690
- const exclude = args?.exclude as string[] | undefined;
691
- const maxFiles = (args?.maxFiles as number) ?? 100;
692
-
693
- const results: ParsedFile[] = await parseDirectory(dirPath, {
694
- extensions,
695
- exclude,
696
- maxFiles,
697
- });
698
-
699
- return {
700
- content: [
701
- {
702
- type: 'text',
703
- text: JSON.stringify(results, null, 2),
704
- },
705
- ],
706
- };
707
- }
519
+ // search, visit, parse_file, parse_directory — REMOVED in v2.0.0
520
+ // Copilot CLI の web_search, web_fetch, view, glob に委譲
708
521
 
709
522
  case 'embed': {
710
523
  const textInput = args?.text as string | string[];
@@ -160,6 +160,12 @@ describe('VisitRecoveryManager', () => {
160
160
  });
161
161
 
162
162
  it('should return failure when all attempts fail', async () => {
163
+ const fastManager = new VisitRecoveryManager({
164
+ retryDelayMs: 10,
165
+ maxRetries: 1,
166
+ timeoutMs: 500,
167
+ });
168
+
163
169
  const mockFetchFn = vi.fn().mockResolvedValue({
164
170
  success: false,
165
171
  error: 'Page not found',
@@ -174,12 +180,12 @@ describe('VisitRecoveryManager', () => {
174
180
  }),
175
181
  });
176
182
 
177
- const result = await manager.recover('https://example.com', mockFetchFn);
183
+ const result = await fastManager.recover('https://example.com', mockFetchFn);
178
184
 
179
185
  expect(result.success).toBe(false);
180
186
  expect(result.error).toBeDefined();
181
187
  expect(result.attempts).toBeGreaterThan(0);
182
- });
188
+ }, 10000);
183
189
 
184
190
  it('should handle fetch function throwing errors', async () => {
185
191
  const mockFetchFn = vi.fn().mockRejectedValue(new Error('Network error'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nahisaho/shikigami",
3
- "version": "1.53.0",
3
+ "version": "2.0.1",
4
4
  "description": "GitHub Copilot Agent Skills for Deep Research & Consulting - AI-Powered Research Assistant with 50+ Consulting Frameworks",
5
5
  "keywords": [
6
6
  "github-copilot",
package/scripts/cli.js CHANGED
@@ -32,6 +32,7 @@ Usage: npx shikigami [command] [options]
32
32
  Commands:
33
33
  init Initialize SHIKIGAMI files in current directory
34
34
  upgrade, update Upgrade SHIKIGAMI files (same as init --force) (v1.23.0)
35
+ cowork [options] Set up Microsoft Copilot Cowork MCP (v2.0.0)
35
36
  new [name] Create a new research project
36
37
  find-related [keyword] Find related projects by keywords (v1.7.0)
37
38
  inherit [options] Prepare knowledge inheritance from past reports (v1.8.0)
@@ -41,6 +42,8 @@ Commands:
41
42
  Examples:
42
43
  npx shikigami init # Initialize SHIKIGAMI
43
44
  npx shikigami upgrade # Upgrade to latest version
45
+ npx shikigami cowork # Set up Copilot Cowork MCP (v2.0.0)
46
+ npx shikigami cowork --status # Check Cowork installation status
44
47
  npx shikigami new my-research # Create new project "my-research"
45
48
  npx shikigami new # Create new project with auto-numbered name
46
49
  npx shikigami find-related レアアース # Find projects related to "レアアース"
@@ -68,6 +71,13 @@ if (command === 'upgrade' || command === 'update') {
68
71
  process.exit(0);
69
72
  }
70
73
 
74
+ // Cowork command (v2.0.0)
75
+ if (command === 'cowork') {
76
+ const { setup } = require('./setup-cowork.js');
77
+ setup();
78
+ process.exit(0);
79
+ }
80
+
71
81
  // New project command
72
82
  if (command === 'new') {
73
83
  const projectName = args[1];
@@ -89,7 +99,7 @@ if (command === 'inherit') {
89
99
  }
90
100
 
91
101
  // Unknown command
92
- if (command !== 'find-related' && command !== 'inherit' && command !== 'upgrade' && command !== 'update') {
102
+ if (command !== 'find-related' && command !== 'inherit' && command !== 'upgrade' && command !== 'update' && command !== 'cowork') {
93
103
  console.error(`Unknown command: ${command}`);
94
104
  console.log('Run "npx shikigami --help" for usage information.');
95
105
  process.exit(1);
package/scripts/init.js CHANGED
@@ -166,6 +166,23 @@ function init() {
166
166
  console.log('');
167
167
  console.log(`📊 Summary: ${copiedCount} copied, ${overwrittenCount} overwritten, ${skippedCount} skipped`);
168
168
  console.log('');
169
+
170
+ // Check Cowork MCP status
171
+ try {
172
+ const { isInstalled, isMcpConfigured } = require('./setup-cowork.js');
173
+ if (!isInstalled() || !isMcpConfigured()) {
174
+ console.log('🤝 Copilot Cowork MCP (M365連携):');
175
+ console.log(' メール・カレンダー・Teams・OneDrive にCopilot CLIからアクセス可能に');
176
+ console.log(' セットアップ: npx shikigami cowork');
177
+ console.log('');
178
+ } else {
179
+ console.log('🤝 Copilot Cowork MCP: ✅ Configured');
180
+ console.log('');
181
+ }
182
+ } catch {
183
+ // Ignore errors from cowork check
184
+ }
185
+
169
186
  console.log('📝 Next steps:');
170
187
  console.log(' 1. cd mcp-server && npm install && npm run build');
171
188
  console.log(' 2. Restart VS Code to activate Agent Skills');
@@ -0,0 +1,367 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * SHIKIGAMI - Copilot Cowork MCP Setup
4
+ * Usage: npx shikigami cowork [options]
5
+ *
6
+ * Sets up Microsoft Copilot Cowork as an MCP server for GitHub Copilot CLI.
7
+ * Enables access to M365 data (Mail, Calendar, Teams, Files) from Copilot CLI.
8
+ *
9
+ * v2.0.0: Initial release
10
+ */
11
+
12
+ const fs = require('fs');
13
+ const path = require('path');
14
+ const { execSync } = require('child_process');
15
+
16
+ const COWORK_REPO = 'https://github.com/msartem/copilot_cowork_mcp.git';
17
+ const COPILOT_DIR = path.join(require('os').homedir(), '.copilot');
18
+ const PLUGINS_DIR = path.join(COPILOT_DIR, 'installed-plugins');
19
+ const COWORK_DIR = path.join(PLUGINS_DIR, 'copilot_cowork_mcp');
20
+ const MCP_CONFIG = path.join(COPILOT_DIR, '.mcp.json');
21
+
22
+ function parseArgs() {
23
+ const args = process.argv.slice(2).filter(a => a !== 'cowork');
24
+ return {
25
+ uninstall: args.includes('--uninstall'),
26
+ status: args.includes('--status'),
27
+ help: args.includes('--help') || args.includes('-h'),
28
+ };
29
+ }
30
+
31
+ function showHelp() {
32
+ console.log(`
33
+ 🤝 SHIKIGAMI - Copilot Cowork Setup
34
+
35
+ Usage: npx shikigami cowork [options]
36
+
37
+ Options:
38
+ --status Check installation status
39
+ --uninstall Remove Cowork MCP configuration
40
+ -h, --help Show this help message
41
+
42
+ What is Copilot Cowork?
43
+ Microsoft Copilot Cowork MCP enables GitHub Copilot CLI to access
44
+ your M365 data: Mail, Calendar, Teams messages, and OneDrive files.
45
+
46
+ Requirements:
47
+ - Python 3.10+
48
+ - Microsoft 365 account
49
+ - First run requires browser sign-in (Edge/Chromium)
50
+
51
+ After setup:
52
+ 1. Restart Copilot CLI (or start a new session)
53
+ 2. First use will open a browser for M365 authentication
54
+ 3. After sign-in, tokens are cached for ~90 days
55
+ `);
56
+ }
57
+
58
+ function checkPython() {
59
+ try {
60
+ const version = execSync('python3 --version 2>&1', { encoding: 'utf-8' }).trim();
61
+ const match = version.match(/Python (\d+)\.(\d+)/);
62
+ if (match && (parseInt(match[1]) > 3 || (parseInt(match[1]) === 3 && parseInt(match[2]) >= 10))) {
63
+ return { ok: true, version };
64
+ }
65
+ return { ok: false, version, error: 'Python 3.10+ required' };
66
+ } catch {
67
+ return { ok: false, version: null, error: 'Python 3 not found' };
68
+ }
69
+ }
70
+
71
+ function checkGit() {
72
+ try {
73
+ execSync('git --version', { encoding: 'utf-8' });
74
+ return true;
75
+ } catch {
76
+ return false;
77
+ }
78
+ }
79
+
80
+ function isInstalled() {
81
+ return fs.existsSync(path.join(COWORK_DIR, 'server.py'));
82
+ }
83
+
84
+ function isMcpConfigured() {
85
+ if (!fs.existsSync(MCP_CONFIG)) return false;
86
+ try {
87
+ const config = JSON.parse(fs.readFileSync(MCP_CONFIG, 'utf-8'));
88
+ return !!(config.mcpServers && config.mcpServers.cowork);
89
+ } catch {
90
+ return false;
91
+ }
92
+ }
93
+
94
+ function checkDependencies() {
95
+ const deps = ['fastmcp', 'requests', 'playwright'];
96
+ const results = {};
97
+ for (const dep of deps) {
98
+ try {
99
+ execSync(`python3 -c "import ${dep}" 2>&1`, { encoding: 'utf-8' });
100
+ results[dep] = true;
101
+ } catch {
102
+ results[dep] = false;
103
+ }
104
+ }
105
+ return results;
106
+ }
107
+
108
+ function showStatus() {
109
+ console.log('');
110
+ console.log('🤝 Copilot Cowork MCP Status');
111
+ console.log('════════════════════════════');
112
+ console.log('');
113
+
114
+ const python = checkPython();
115
+ console.log(` Python: ${python.ok ? `✅ ${python.version}` : `❌ ${python.error}`}`);
116
+
117
+ const installed = isInstalled();
118
+ console.log(` Plugin: ${installed ? '✅ Installed' : '❌ Not installed'}`);
119
+
120
+ if (installed) {
121
+ const deps = checkDependencies();
122
+ for (const [dep, ok] of Object.entries(deps)) {
123
+ console.log(` ${dep.padEnd(14)} ${ok ? '✅' : '❌ Missing'}`);
124
+ }
125
+ }
126
+
127
+ const configured = isMcpConfigured();
128
+ console.log(` MCP Config: ${configured ? '✅ Configured' : '❌ Not configured'}`);
129
+ console.log(` Config Path: ${MCP_CONFIG}`);
130
+ console.log('');
131
+
132
+ if (installed && configured) {
133
+ console.log(' ✨ Ready to use! Restart Copilot CLI to activate.');
134
+ } else {
135
+ console.log(' Run "npx shikigami cowork" to set up.');
136
+ }
137
+ console.log('');
138
+ }
139
+
140
+ function installDependencies() {
141
+ const deps = checkDependencies();
142
+ const missing = Object.entries(deps).filter(([, ok]) => !ok).map(([dep]) => dep);
143
+
144
+ if (missing.length === 0) {
145
+ console.log(' ✅ All Python dependencies already installed');
146
+ return true;
147
+ }
148
+
149
+ console.log(` 📦 Installing: ${missing.join(', ')}...`);
150
+ try {
151
+ // Try with --break-system-packages first (Ubuntu/Debian), fallback to without
152
+ try {
153
+ execSync(`pip install --break-system-packages ${missing.join(' ')} 2>&1`, {
154
+ encoding: 'utf-8',
155
+ stdio: 'pipe',
156
+ });
157
+ } catch {
158
+ execSync(`pip install ${missing.join(' ')} 2>&1`, {
159
+ encoding: 'utf-8',
160
+ stdio: 'pipe',
161
+ });
162
+ }
163
+
164
+ // Install Playwright browser if playwright was just installed
165
+ if (missing.includes('playwright')) {
166
+ console.log(' 🌐 Installing Playwright browser (chromium)...');
167
+ execSync('python3 -m playwright install chromium 2>&1', {
168
+ encoding: 'utf-8',
169
+ stdio: 'pipe',
170
+ });
171
+ }
172
+
173
+ console.log(' ✅ Dependencies installed');
174
+ return true;
175
+ } catch (err) {
176
+ console.error(` ❌ Failed to install dependencies: ${err.message}`);
177
+ console.log(' 💡 Try manually: pip install fastmcp requests playwright');
178
+ return false;
179
+ }
180
+ }
181
+
182
+ function clonePlugin() {
183
+ if (isInstalled()) {
184
+ console.log(' ✅ Plugin already installed');
185
+ // Pull latest
186
+ try {
187
+ execSync(`git -C "${COWORK_DIR}" pull --quiet 2>&1`, {
188
+ encoding: 'utf-8',
189
+ stdio: 'pipe',
190
+ });
191
+ console.log(' 🔄 Updated to latest version');
192
+ } catch {
193
+ // Ignore pull errors
194
+ }
195
+ return true;
196
+ }
197
+
198
+ console.log(' 📥 Cloning Copilot Cowork MCP...');
199
+ try {
200
+ fs.mkdirSync(PLUGINS_DIR, { recursive: true });
201
+ execSync(`git clone "${COWORK_REPO}" "${COWORK_DIR}" 2>&1`, {
202
+ encoding: 'utf-8',
203
+ stdio: 'pipe',
204
+ });
205
+ console.log(' ✅ Plugin cloned');
206
+ return true;
207
+ } catch (err) {
208
+ console.error(` ❌ Failed to clone: ${err.message}`);
209
+ return false;
210
+ }
211
+ }
212
+
213
+ function configureMcp() {
214
+ if (isMcpConfigured()) {
215
+ console.log(' ✅ MCP already configured');
216
+ return true;
217
+ }
218
+
219
+ console.log(' ⚙️ Configuring MCP server...');
220
+ try {
221
+ fs.mkdirSync(COPILOT_DIR, { recursive: true });
222
+
223
+ let config = { mcpServers: {} };
224
+ if (fs.existsSync(MCP_CONFIG)) {
225
+ try {
226
+ config = JSON.parse(fs.readFileSync(MCP_CONFIG, 'utf-8'));
227
+ if (!config.mcpServers) config.mcpServers = {};
228
+ } catch {
229
+ // Corrupted config, start fresh but keep backup
230
+ const backup = `${MCP_CONFIG}.bak`;
231
+ fs.copyFileSync(MCP_CONFIG, backup);
232
+ console.log(` ⚠️ Backed up corrupted config to ${backup}`);
233
+ }
234
+ }
235
+
236
+ config.mcpServers.cowork = {
237
+ type: 'stdio',
238
+ command: 'python3',
239
+ args: [path.join(COWORK_DIR, 'server.py')],
240
+ env: {
241
+ COWORK_SHOW_THINKING: 'false',
242
+ },
243
+ };
244
+
245
+ fs.writeFileSync(MCP_CONFIG, JSON.stringify(config, null, 2) + '\n');
246
+ console.log(' ✅ MCP configured');
247
+ return true;
248
+ } catch (err) {
249
+ console.error(` ❌ Failed to configure MCP: ${err.message}`);
250
+ return false;
251
+ }
252
+ }
253
+
254
+ function uninstall() {
255
+ console.log('');
256
+ console.log('🤝 Uninstalling Copilot Cowork MCP...');
257
+ console.log('');
258
+
259
+ // Remove from MCP config
260
+ if (fs.existsSync(MCP_CONFIG)) {
261
+ try {
262
+ const config = JSON.parse(fs.readFileSync(MCP_CONFIG, 'utf-8'));
263
+ if (config.mcpServers && config.mcpServers.cowork) {
264
+ delete config.mcpServers.cowork;
265
+ fs.writeFileSync(MCP_CONFIG, JSON.stringify(config, null, 2) + '\n');
266
+ console.log(' ✅ Removed from MCP config');
267
+ } else {
268
+ console.log(' ⏭️ Not in MCP config');
269
+ }
270
+ } catch {
271
+ console.log(' ⚠️ Could not parse MCP config');
272
+ }
273
+ }
274
+
275
+ // Remove plugin directory
276
+ if (fs.existsSync(COWORK_DIR)) {
277
+ fs.rmSync(COWORK_DIR, { recursive: true, force: true });
278
+ console.log(' ✅ Removed plugin files');
279
+ } else {
280
+ console.log(' ⏭️ Plugin not installed');
281
+ }
282
+
283
+ console.log('');
284
+ console.log(' ✨ Uninstall complete. Restart Copilot CLI to apply.');
285
+ console.log('');
286
+ }
287
+
288
+ function setup() {
289
+ const { uninstall: doUninstall, status, help } = parseArgs();
290
+
291
+ if (help) {
292
+ showHelp();
293
+ return;
294
+ }
295
+
296
+ if (status) {
297
+ showStatus();
298
+ return;
299
+ }
300
+
301
+ if (doUninstall) {
302
+ uninstall();
303
+ return;
304
+ }
305
+
306
+ console.log('');
307
+ console.log('🤝 Setting up Copilot Cowork MCP');
308
+ console.log('═════════════════════════════════');
309
+ console.log('');
310
+
311
+ // Step 1: Check prerequisites
312
+ console.log('Step 1/4: Checking prerequisites...');
313
+ const python = checkPython();
314
+ if (!python.ok) {
315
+ console.error(` ❌ ${python.error}`);
316
+ console.log(' 💡 Install Python 3.10+: https://www.python.org/downloads/');
317
+ process.exit(1);
318
+ }
319
+ console.log(` ✅ ${python.version}`);
320
+
321
+ if (!checkGit()) {
322
+ console.error(' ❌ Git not found');
323
+ process.exit(1);
324
+ }
325
+ console.log(' ✅ Git available');
326
+ console.log('');
327
+
328
+ // Step 2: Clone plugin
329
+ console.log('Step 2/4: Installing plugin...');
330
+ if (!clonePlugin()) process.exit(1);
331
+ console.log('');
332
+
333
+ // Step 3: Install dependencies
334
+ console.log('Step 3/4: Installing dependencies...');
335
+ if (!installDependencies()) process.exit(1);
336
+ console.log('');
337
+
338
+ // Step 4: Configure MCP
339
+ console.log('Step 4/4: Configuring MCP...');
340
+ if (!configureMcp()) process.exit(1);
341
+ console.log('');
342
+
343
+ // Done
344
+ console.log('═════════════════════════════════');
345
+ console.log('✨ Copilot Cowork MCP setup complete!');
346
+ console.log('');
347
+ console.log('📝 Next steps:');
348
+ console.log(' 1. Restart Copilot CLI (or start a new session)');
349
+ console.log(' 2. First use will open a browser for M365 sign-in');
350
+ console.log(' 3. After sign-in, tokens are cached for ~90 days');
351
+ console.log('');
352
+ console.log('💡 Usage examples:');
353
+ console.log(' "メールの未読を要約して"');
354
+ console.log(' "明日の会議は?"');
355
+ console.log(' "Teamsで自分にhelloとメッセージ送って"');
356
+ console.log('');
357
+ console.log('🔧 Commands:');
358
+ console.log(' npx shikigami cowork --status # Check status');
359
+ console.log(' npx shikigami cowork --uninstall # Remove');
360
+ console.log('');
361
+ }
362
+
363
+ module.exports = { setup, showStatus, isInstalled, isMcpConfigured };
364
+
365
+ if (require.main === module) {
366
+ setup();
367
+ }