@nogataka/smart-edit 1.0.1 → 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.
- package/README.md +350 -48
- package/dist/smart-edit/agent.js +2 -1
- package/dist/smart-edit/resources/config/modes/careful-editor.yml +47 -0
- package/dist/smart-edit/resources/dashboard/dashboard.js +11 -11
- package/dist/smart-edit/resources/dashboard/favicon.ico +0 -0
- package/dist/smart-edit/resources/dashboard/index.css +1 -1
- package/dist/smart-edit/resources/dashboard/index.html +2 -0
- package/dist/smart-edit/resources/dashboard/logo.png +0 -0
- package/dist/smart-edit/tools/workflow_tools.d.ts +5 -1
- package/dist/smart-edit/tools/workflow_tools.js +76 -3
- package/dist/smart-edit/util/git.d.ts +30 -0
- package/dist/smart-edit/util/git.js +118 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,122 @@
|
|
|
1
1
|
# Smart Edit
|
|
2
2
|
|
|
3
|
-
Smart Edit
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Smart Edit は、TypeScript / Node.js 上で動作する MCP (Model Context Protocol) サーバーです。独自の言語サーバー管理システム「SmartLSP」と Smart-Edit 固有のツール群を TypeScript で実装しています。
|
|
6
|
+
|
|
7
|
+
## SmartLSP について
|
|
8
|
+
|
|
9
|
+
SmartLSP は、Smart Edit に組み込まれた言語サーバー管理システムです。AI コーディングツールが複数のプログラミング言語を扱う際に必要となる LSP (Language Server Protocol) サーバーの管理を自動化します。
|
|
10
|
+
|
|
11
|
+
### 主な特徴
|
|
12
|
+
|
|
13
|
+
| 特徴 | 説明 |
|
|
14
|
+
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| **23言語サポート** | Bash, C/C++, C#, Clojure, Dart, Erlang, Go, Java, Kotlin, Lua, Nix, PHP, Python (2種), R, Ruby (2種), Rust, Swift, Terraform, TypeScript/JavaScript, Vue, Zig |
|
|
16
|
+
| **オンデマンドダウンロード** | 言語サーバーは必要になったタイミングで自動的にダウンロード・インストールされます。起動時に全てをダウンロードする必要はありません |
|
|
17
|
+
| **クロスプラットフォーム** | macOS (Intel/Apple Silicon)、Linux (x64/ARM64)、Windows (x64) に対応。プラットフォームに応じた適切なバイナリを自動選択 |
|
|
18
|
+
| **統一API** | 異なる言語サーバーを同一のインターフェースで操作可能。初期化、診断取得、コード補完、定義ジャンプなどを共通の方法で呼び出せます |
|
|
19
|
+
| **依存関係の自動管理** | npm、pip、gem、go install など、各言語のパッケージマネージャーを通じた依存関係を自動的に解決 |
|
|
20
|
+
|
|
21
|
+
### 動作の流れ
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
1. プロジェクトの言語を検出(project.yml または自動検出)
|
|
25
|
+
↓
|
|
26
|
+
2. 該当する言語サーバーが未インストールの場合、自動ダウンロード
|
|
27
|
+
↓
|
|
28
|
+
3. 言語サーバーを起動し、LSP 通信を開始
|
|
29
|
+
↓
|
|
30
|
+
4. AI エージェントが LSP 機能(診断、補完、定義参照など)を利用
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
SmartLSP により、ユーザーは言語サーバーのインストールや設定を意識することなく、AI による高精度なコード支援を受けることができます。
|
|
34
|
+
|
|
35
|
+
## メモリ機能
|
|
36
|
+
|
|
37
|
+
Smart Edit は、AI エージェントがプロジェクトに関する情報を永続的に保存・参照できる「メモリ機能」を提供します。
|
|
38
|
+
|
|
39
|
+
### 主な特徴
|
|
40
|
+
|
|
41
|
+
| 特徴 | 説明 |
|
|
42
|
+
| -------------------- | ------------------------------------------------------------------------ |
|
|
43
|
+
| **永続化** | セッション間で完全に永続化され、IDE 再起動や PC 再起動後も保持されます |
|
|
44
|
+
| **プロジェクト独立** | メモリはプロジェクトごとに独立しており、他プロジェクトとは共有されません |
|
|
45
|
+
| **Markdown 形式** | 人間が読みやすい Markdown ファイルとして保存されます |
|
|
46
|
+
| **名前付き管理** | 「kickoff」「retro」「architecture」など、用途に応じた名前でメモリを管理 |
|
|
47
|
+
|
|
48
|
+
### 利用可能なツール
|
|
49
|
+
|
|
50
|
+
| ツール | 説明 |
|
|
51
|
+
| -------------- | -------------------------- |
|
|
52
|
+
| `WriteMemory` | 名前付きメモリを保存 |
|
|
53
|
+
| `ReadMemory` | メモリの内容を読み込み |
|
|
54
|
+
| `ListMemories` | 保存済みメモリの一覧を取得 |
|
|
55
|
+
| `DeleteMemory` | メモリを削除 |
|
|
56
|
+
|
|
57
|
+
保存場所: `{プロジェクトルート}/.smart-edit/memories/`
|
|
58
|
+
|
|
59
|
+
## プロンプト/モード/コンテキスト システム
|
|
60
|
+
|
|
61
|
+
Smart Edit は、AI の振る舞いをカスタマイズするための柔軟なテンプレートシステムを提供します。
|
|
62
|
+
|
|
63
|
+
### 構成要素
|
|
64
|
+
|
|
65
|
+
| 要素 | 説明 | 保存場所 |
|
|
66
|
+
| -------------------------- | ------------------------------------------------------------------ | --------------------------------- |
|
|
67
|
+
| **コンテキスト** | 接続先クライアント(Claude Code, Codex, Desktop など)に応じた設定 | `~/.smart-edit/contexts/` |
|
|
68
|
+
| **モード** | AI の動作モード(editor, reviewer, architect など)を定義 | `~/.smart-edit/modes/` |
|
|
69
|
+
| **プロンプトテンプレート** | 各ツールの出力形式やインストラクションを定義 | `~/.smart-edit/prompt_templates/` |
|
|
70
|
+
|
|
71
|
+
### カスタマイズの流れ
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
1. 内蔵テンプレートを確認
|
|
75
|
+
smart-edit mode list / smart-edit context list
|
|
76
|
+
↓
|
|
77
|
+
2. テンプレートをコピーして編集
|
|
78
|
+
smart-edit mode create --from-internal default-editor
|
|
79
|
+
↓
|
|
80
|
+
3. MCP サーバー起動時に指定
|
|
81
|
+
--context ide-assistant --mode default-editor
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Web ダッシュボード
|
|
85
|
+
|
|
86
|
+
リアルタイムでセッション情報を可視化する Web ベースのダッシュボードを提供します。
|
|
87
|
+
|
|
88
|
+
### 機能一覧
|
|
89
|
+
|
|
90
|
+
| タブ | 機能 |
|
|
91
|
+
| -------------- | ---------------------------------------------------------------------- |
|
|
92
|
+
| **Dashboard** | プロジェクト概要、リアルタイムメトリクス、最近のアクティビティ |
|
|
93
|
+
| **Logs** | ログ検索・フィルタ(レベル別、ツール名別)、リアルタイムストリーミング |
|
|
94
|
+
| **Statistics** | API 呼び出し統計、トークン使用量チャート、ライブカウンター |
|
|
95
|
+
| **Sessions** | セッション履歴、JSON エクスポート、過去セッション比較 |
|
|
96
|
+
|
|
97
|
+
- `--enable-web-dashboard` オプションで有効化
|
|
98
|
+
- ダークモード / ライトモード切替対応
|
|
99
|
+
- モバイルレスポンシブ対応
|
|
100
|
+
|
|
101
|
+
## ワークフローツール
|
|
102
|
+
|
|
103
|
+
AI エージェントの作業効率を高めるためのワークフロー支援ツールを提供します。
|
|
104
|
+
|
|
105
|
+
| ツール | 説明 |
|
|
106
|
+
| -------------------------- | ------------------------------------------------------ |
|
|
107
|
+
| `Onboarding` | プロジェクト初回参加時のオンボーディングプロセスを支援 |
|
|
108
|
+
| `CheckOnboardingPerformed` | オンボーディングが完了しているか確認 |
|
|
109
|
+
|
|
110
|
+
オンボーディングでは、プロジェクトの構造理解、コーディング規約の確認、既存メモリの参照などを AI エージェントに案内します。
|
|
4
111
|
|
|
5
112
|
## 主な構成
|
|
6
113
|
|
|
7
114
|
| ディレクトリ / ファイル | 概要 |
|
|
8
115
|
| -------------------------- | ----------------------------------------------------------- |
|
|
9
116
|
| `src/smart-edit` | エージェント本体、CLI、各種ツール・コンフィグ周りのロジック |
|
|
10
|
-
| `src/smart-lsp` | SmartLSP
|
|
117
|
+
| `src/smart-lsp` | SmartLSP 本体:23言語サーバーの自動管理・LSP通信実装 |
|
|
11
118
|
| `src/smart-edit/resources` | Smart-Edit が自動生成・参照する YAML テンプレート群 |
|
|
12
119
|
| `test/` | Vitest によるユニットテスト・スモークテスト |
|
|
13
|
-
| `docs/` | 言語サーバー対応状況などの資料 |
|
|
14
|
-
| `tsconfig*.json` | ビルド・テスト・Lint 用 TypeScript 設定 |
|
|
15
120
|
|
|
16
121
|
## 環境要件
|
|
17
122
|
|
|
@@ -186,58 +291,119 @@ Smart Edit はプロジェクト固有のメモリ機能を提供します。AI
|
|
|
186
291
|
|
|
187
292
|
以下の言語サーバーに対応しています:
|
|
188
293
|
|
|
189
|
-
| 言語 | サーバー | バージョン | ダウンロード元
|
|
190
|
-
| ----------------------- | -------------------------- | -------------------- |
|
|
191
|
-
| Bash | bash-language-server | 5.6.0 | npm
|
|
192
|
-
| C / C++ | clangd | 19.1.2 | GitHub Releases
|
|
193
|
-
| C# | csharp-language-server | 5.0.0-1.25329.6 | NuGet
|
|
194
|
-
| Clojure | clojure-lsp | latest | GitHub Releases
|
|
195
|
-
| Dart | Dart SDK | 3.10.4 | Google Storage
|
|
196
|
-
| Erlang | erlang_ls | (PATH 検出) | 外部インストール
|
|
197
|
-
| Go | gopls | latest | `go install`
|
|
198
|
-
| Java | Eclipse JDT.LS | 1.42.0 | GitHub (vscode-java)
|
|
199
|
-
| Kotlin | kotlin-language-server | 0.253.10629 | JetBrains CDN
|
|
200
|
-
| Lua | lua-language-server | 3.15.0 | GitHub Releases
|
|
201
|
-
| Nix | nixd | (PATH / nix profile) | 外部インストール
|
|
202
|
-
| PHP | Intelephense | 1.16.4 | npm
|
|
203
|
-
| Python | Jedi Language Server | (PyPI) | pip
|
|
204
|
-
| Python | Pyright | (PyPI) | pip
|
|
205
|
-
| R | R Language Server | (CRAN) | R package
|
|
206
|
-
| Ruby | Ruby LSP | (gem) | RubyGems
|
|
207
|
-
| Ruby | Solargraph | (gem) | RubyGems
|
|
208
|
-
| Rust | rust-analyzer | (rustup) | rustup component
|
|
209
|
-
| Swift | SourceKit-LSP | (PATH 検出) | Xcode / Swift Toolchain
|
|
210
|
-
| Terraform | terraform-ls | 0.38.3 | HashiCorp Releases
|
|
211
|
-
| TypeScript / JavaScript | typescript-language-server | 5.1.3 (TS 5.9.3) | npm
|
|
212
|
-
| Vue | VTS (Volar) | 0.3.0 | npm (@vtsls/language-server)
|
|
213
|
-
| Zig | zls | (PATH 検出) | 外部インストール
|
|
294
|
+
| 言語 | サーバー | バージョン | ダウンロード元 | 備考 |
|
|
295
|
+
| ----------------------- | -------------------------- | -------------------- | ---------------------------- | ---------------------------------- |
|
|
296
|
+
| Bash | bash-language-server | 5.6.0 | npm | Node.js 20 以上必須 |
|
|
297
|
+
| C / C++ | clangd | 19.1.2 | GitHub Releases | LLVM プロジェクト |
|
|
298
|
+
| C# | csharp-language-server | 5.0.0-1.25329.6 | NuGet | .NET ランタイム必要 |
|
|
299
|
+
| Clojure | clojure-lsp | latest | GitHub Releases | Clojure 開発環境 |
|
|
300
|
+
| Dart | Dart SDK | 3.10.4 | Google Storage | Flutter SDK に同梱 |
|
|
301
|
+
| Erlang | erlang_ls | (PATH 検出) | 外部インストール | Erlang/OTP ランタイム必要 |
|
|
302
|
+
| Go | gopls | latest | `go install` | 公式 Go チームによる実装 |
|
|
303
|
+
| Java | Eclipse JDT.LS | 1.42.0 | GitHub (vscode-java) | Java 21 以上必須 |
|
|
304
|
+
| Kotlin | kotlin-language-server | 0.253.10629 | JetBrains CDN | JVM ランタイム必要 |
|
|
305
|
+
| Lua | lua-language-server | 3.15.0 | GitHub Releases | Lua 5.1〜5.5、LuaJIT 対応 |
|
|
306
|
+
| Nix | nixd | (PATH / nix profile) | 外部インストール | Nix 式のサポート |
|
|
307
|
+
| PHP | Intelephense | 1.16.4 | npm | 高機能 PHP サーバー |
|
|
308
|
+
| Python | Jedi Language Server | (PyPI) | pip | 軽量・高速 |
|
|
309
|
+
| Python | Pyright | (PyPI) | pip | Microsoft 製・型チェック強化 |
|
|
310
|
+
| R | R Language Server | (CRAN) | R package | CRAN パッケージ |
|
|
311
|
+
| Ruby | Ruby LSP | (gem) | RubyGems | Shopify 製・高速 |
|
|
312
|
+
| Ruby | Solargraph | (gem) | RubyGems | 従来からの定番 |
|
|
313
|
+
| Rust | rust-analyzer | (rustup) | rustup component | 公式推奨 |
|
|
314
|
+
| Swift | SourceKit-LSP | (PATH 検出) | Xcode / Swift Toolchain | Apple 公式 |
|
|
315
|
+
| Terraform | terraform-ls | 0.38.3 | HashiCorp Releases | HashiCorp 公式、Actions block 対応 |
|
|
316
|
+
| TypeScript / JavaScript | typescript-language-server | 5.1.3 (TS 5.9.3) | npm | tsserver ラッパー |
|
|
317
|
+
| Vue | VTS (Volar) | 0.3.0 | npm (@vtsls/language-server) | Vue 3 対応、TS 必須 |
|
|
318
|
+
| Zig | zls | (PATH 検出) | 外部インストール | Zig 公式 |
|
|
214
319
|
|
|
215
320
|
**除外**: AL Language Server, elixir_tools, OmniSharp(TypeScript 版では対象外)
|
|
216
321
|
|
|
217
322
|
**バージョン更新日**: 2026-02-01
|
|
218
323
|
|
|
324
|
+
#### 実行方式の分類
|
|
325
|
+
|
|
326
|
+
言語サーバーは以下の方式で管理されます:
|
|
327
|
+
|
|
328
|
+
| 方式 | 説明 | 対象サーバー |
|
|
329
|
+
| -------------------------- | -------------------------------------------- | -------------------------------------------- |
|
|
330
|
+
| **バイナリDL型** | プラットフォーム別バイナリを自動ダウンロード | Clangd, Dart SDK, Lua, Zig, Terraform |
|
|
331
|
+
| **npm型** | npm でパッケージをインストール | TypeScript, Bash, PHP, Vue |
|
|
332
|
+
| **システム依存型** | システムにインストール済みのコマンドを使用 | Pyright, Jedi, gopls, SourceKit, Erlang, Nix |
|
|
333
|
+
| **システム依存型(半自動)** | 未検出時に自動インストール | rust-analyzer (rustup経由) |
|
|
334
|
+
| **言語パッケージ型** | 各言語のパッケージマネージャーでインストール | Ruby LSP, Solargraph (gem), R (CRAN) |
|
|
335
|
+
| **複合ダウンロード型** | 複数コンポーネントをダウンロード・展開 | Eclipse JDT (Java), Kotlin |
|
|
336
|
+
|
|
337
|
+
詳細は [LSPサーバー実行方式調査](docs/public/lsp_server_execution_methods.md) および [LSPサーバー実行方式一覧表](docs/public/lsp_servers_execution_type_table.md) を参照してください。
|
|
338
|
+
|
|
339
|
+
## MCP クライアント接続ガイド
|
|
340
|
+
|
|
341
|
+
Smart Edit は MCP (Model Context Protocol) サーバーとして動作し、様々な AI コーディングツールから利用できます。
|
|
342
|
+
|
|
343
|
+
### `--project` オプションについて
|
|
344
|
+
|
|
345
|
+
**`--project` は省略可能です。** MCP サーバー起動時にプロジェクトを指定しなくても、以下の方法でプロジェクトをアクティブ化できます:
|
|
346
|
+
|
|
347
|
+
1. **チャットから指示**: 「現在のディレクトリをプロジェクトとしてアクティブ化して」と依頼
|
|
348
|
+
2. **`activate_project` ツール**: MCP 経由で `activate_project` ツールを呼び出し
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
# --project なし(推奨: 柔軟に複数プロジェクトを切り替え可能)
|
|
352
|
+
npx @nogataka/smart-edit smart-edit start-mcp-server --transport stdio
|
|
353
|
+
|
|
354
|
+
# --project あり(特定プロジェクトに固定する場合)
|
|
355
|
+
npx @nogataka/smart-edit smart-edit start-mcp-server --project /path/to/project --transport stdio
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
以下の各クライアント設定例では `--project` を省略していますが、必要に応じて追加できます。
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
### 対応 MCP クライアント一覧
|
|
363
|
+
|
|
364
|
+
| クライアント | 開発元 | 対応状況 | 備考 |
|
|
365
|
+
| ------------------ | ---------------- | ---------- | ------------------------------------ |
|
|
366
|
+
| **Claude Code** | Anthropic | ✅ 完全対応 | CLI ベースのコーディングアシスタント |
|
|
367
|
+
| **Claude Desktop** | Anthropic | ✅ 完全対応 | デスクトップアプリ版 Claude |
|
|
368
|
+
| **Codex CLI** | OpenAI | ✅ 完全対応 | OpenAI の CLI コーディングツール |
|
|
369
|
+
| **Cursor** | Cursor Inc | ✅ 対応 | AI ファースト IDE |
|
|
370
|
+
| **Windsurf** | Codeium | ✅ 対応 | AI コードエディタ |
|
|
371
|
+
| **Continue** | Continue | ✅ 対応 | オープンソース AI アシスタント |
|
|
372
|
+
| **Cline** | Cline | ✅ 対応 | VS Code 拡張 (旧 Claude Dev) |
|
|
373
|
+
| **Zed** | Zed | ✅ 対応 | 高速 AI コードエディタ |
|
|
374
|
+
| **GitHub Copilot** | GitHub/Microsoft | ✅ 対応 | VS Code 1.102+, JetBrains で公式対応 |
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
219
378
|
### Claude Code への接続手順
|
|
220
379
|
|
|
221
|
-
Claude Code ではプロジェクトごとに MCP サーバーを追加します。
|
|
380
|
+
Claude Code ではプロジェクトごとに MCP サーバーを追加します。
|
|
222
381
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
382
|
+
```bash
|
|
383
|
+
# プロジェクトのルートディレクトリで実行
|
|
384
|
+
claude mcp add smart-edit -- npx -y @nogataka/smart-edit@latest smart-edit start-mcp-server --transport stdio
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
**オプション付きの例:**
|
|
388
|
+
```bash
|
|
389
|
+
# プロジェクトを指定する場合
|
|
390
|
+
claude mcp add smart-edit -- npx -y @nogataka/smart-edit@latest smart-edit start-mcp-server --project "$(pwd)" --transport stdio
|
|
231
391
|
|
|
232
|
-
|
|
392
|
+
# コンテキストを指定する場合
|
|
393
|
+
claude mcp add smart-edit -- npx -y @nogataka/smart-edit@latest smart-edit start-mcp-server --context ide-assistant --transport stdio
|
|
394
|
+
```
|
|
233
395
|
|
|
234
|
-
|
|
396
|
+
**管理コマンド:**
|
|
397
|
+
```bash
|
|
398
|
+
claude mcp list # 登録済みサーバー一覧
|
|
399
|
+
claude mcp remove smart-edit # サーバー削除
|
|
400
|
+
```
|
|
235
401
|
|
|
236
|
-
|
|
402
|
+
---
|
|
237
403
|
|
|
238
404
|
### Codex CLI への接続手順
|
|
239
405
|
|
|
240
|
-
|
|
406
|
+
`~/.codex/config.toml` に以下を追加します。
|
|
241
407
|
|
|
242
408
|
```toml
|
|
243
409
|
[mcp_servers.smart-edit]
|
|
@@ -245,12 +411,148 @@ command = "npx"
|
|
|
245
411
|
args = ["-y", "@nogataka/smart-edit@latest", "smart-edit", "start-mcp-server", "--context", "codex", "--transport", "stdio"]
|
|
246
412
|
```
|
|
247
413
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
414
|
+
**使用方法:**
|
|
415
|
+
1. Codex 起動後、チャット内で「smart-edit で現在のディレクトリをプロジェクトとしてアクティブ化して」と依頼
|
|
416
|
+
2. プロジェクトをアクティブ化するとツールが利用可能に
|
|
417
|
+
|
|
418
|
+
> **Note**:
|
|
419
|
+
> - `--project` を追加すれば起動時にプロジェクトを指定できます(上記「`--project` オプションについて」を参照)
|
|
420
|
+
> - Codex の UI でツール実行が `failed` と表示されても、実際には成功していることがあります。ログ (`~/.codex/log/codex-tui.log`) で確認してください。
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
### Cursor への接続手順
|
|
425
|
+
|
|
426
|
+
Cursor では `~/.cursor/mcp.json` (または Settings → MCP) で設定します。
|
|
427
|
+
|
|
428
|
+
```json
|
|
429
|
+
{
|
|
430
|
+
"mcpServers": {
|
|
431
|
+
"smart-edit": {
|
|
432
|
+
"command": "npx",
|
|
433
|
+
"args": ["-y", "@nogataka/smart-edit@latest", "smart-edit", "start-mcp-server", "--transport", "stdio"]
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
> `--project` を追加する場合: `args` に `"--project", "/path/to/project"` を追加
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
### Windsurf (Codeium) への接続手順
|
|
444
|
+
|
|
445
|
+
Windsurf では `~/.codeium/windsurf/mcp_config.json` で設定します。
|
|
446
|
+
|
|
447
|
+
```json
|
|
448
|
+
{
|
|
449
|
+
"mcpServers": {
|
|
450
|
+
"smart-edit": {
|
|
451
|
+
"command": "npx",
|
|
452
|
+
"args": ["-y", "@nogataka/smart-edit@latest", "smart-edit", "start-mcp-server", "--transport", "stdio"]
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
> `--project` を追加する場合: `args` に `"--project", "/path/to/project"` を追加
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
### Continue への接続手順
|
|
463
|
+
|
|
464
|
+
Continue では `~/.continue/config.json` の `experimental.modelContextProtocolServers` に追加します。
|
|
465
|
+
|
|
466
|
+
```json
|
|
467
|
+
{
|
|
468
|
+
"experimental": {
|
|
469
|
+
"modelContextProtocolServers": [
|
|
470
|
+
{
|
|
471
|
+
"transport": {
|
|
472
|
+
"type": "stdio",
|
|
473
|
+
"command": "npx",
|
|
474
|
+
"args": ["-y", "@nogataka/smart-edit@latest", "smart-edit", "start-mcp-server", "--transport", "stdio"]
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
]
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
> `--project` を追加する場合: `args` に `"--project", "/path/to/project"` を追加
|
|
483
|
+
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
### Cline (VS Code 拡張) への接続手順
|
|
487
|
+
|
|
488
|
+
Cline では VS Code の設定 (`settings.json`) または Cline の MCP 設定画面から追加します。
|
|
489
|
+
|
|
490
|
+
```json
|
|
491
|
+
{
|
|
492
|
+
"cline.mcpServers": {
|
|
493
|
+
"smart-edit": {
|
|
494
|
+
"command": "npx",
|
|
495
|
+
"args": ["-y", "@nogataka/smart-edit@latest", "smart-edit", "start-mcp-server", "--transport", "stdio"]
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
> `--project` を追加する場合: `args` に `"--project", "/path/to/project"` を追加
|
|
502
|
+
|
|
503
|
+
---
|
|
504
|
+
|
|
505
|
+
### Zed への接続手順
|
|
506
|
+
|
|
507
|
+
Zed では `~/.config/zed/settings.json` の `context_servers` に追加します。
|
|
508
|
+
|
|
509
|
+
```json
|
|
510
|
+
{
|
|
511
|
+
"context_servers": {
|
|
512
|
+
"smart-edit": {
|
|
513
|
+
"command": {
|
|
514
|
+
"path": "npx",
|
|
515
|
+
"args": ["-y", "@nogataka/smart-edit@latest", "smart-edit", "start-mcp-server", "--transport", "stdio"]
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
> `--project` を追加する場合: `args` に `"--project", "/path/to/project"` を追加
|
|
523
|
+
|
|
524
|
+
---
|
|
525
|
+
|
|
526
|
+
### GitHub Copilot への接続手順
|
|
527
|
+
|
|
528
|
+
GitHub Copilot は VS Code 1.102 以降で MCP を公式サポートしています。
|
|
529
|
+
|
|
530
|
+
#### VS Code での設定
|
|
531
|
+
|
|
532
|
+
`.vscode/mcp.json` または `settings.json` の `mcp.servers` に追加します。
|
|
533
|
+
|
|
534
|
+
```json
|
|
535
|
+
{
|
|
536
|
+
"servers": {
|
|
537
|
+
"smart-edit": {
|
|
538
|
+
"command": "npx",
|
|
539
|
+
"args": ["-y", "@nogataka/smart-edit@latest", "smart-edit", "start-mcp-server", "--transport", "stdio"]
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
> `--project` を追加する場合: `args` に `"--project", "/path/to/project"` を追加
|
|
546
|
+
|
|
547
|
+
#### JetBrains IDE での設定
|
|
548
|
+
|
|
549
|
+
JetBrains IDE(IntelliJ IDEA, WebStorm 等)でも MCP がサポートされています。設定は IDE の MCP 設定画面から追加できます。
|
|
550
|
+
|
|
551
|
+
**参考リンク:**
|
|
552
|
+
- [VS Code MCP Servers ドキュメント](https://code.visualstudio.com/docs/copilot/customization/mcp-servers)
|
|
553
|
+
- [GitHub Copilot MCP 概要](https://docs.github.com/en/copilot/concepts/context/mcp)
|
|
252
554
|
|
|
253
|
-
|
|
555
|
+
---
|
|
254
556
|
|
|
255
557
|
### Claude Desktop への接続手順
|
|
256
558
|
|
|
@@ -280,7 +582,7 @@ Claude Desktop (Windows/macOS) では `claude_desktop_config.json` に MCP サ
|
|
|
280
582
|
}
|
|
281
583
|
```
|
|
282
584
|
- `dist/cli.js` を呼び出す前に `pnpm build` を実行し、`dist/` に成果物を生成しておいてください。
|
|
283
|
-
- `--project`
|
|
585
|
+
- `--project` は省略可能です(上記「`--project` オプションについて」を参照)。
|
|
284
586
|
|
|
285
587
|
- **Docker イメージを使う場合(PoC)**
|
|
286
588
|
```json
|
package/dist/smart-edit/agent.js
CHANGED
|
@@ -20,7 +20,7 @@ import { ActivateProjectTool, GetCurrentConfigTool, RemoveProjectTool, SwitchMod
|
|
|
20
20
|
import { ReadFileTool, CreateTextFileTool, ListDirTool, FindFileTool, ReplaceRegexTool, DeleteLinesTool, ReplaceLinesTool, InsertAtLineTool, SearchForPatternTool } from './tools/file_tools.js';
|
|
21
21
|
import { WriteMemoryTool, ReadMemoryTool, ListMemoriesTool, DeleteMemoryTool } from './tools/memory_tools.js';
|
|
22
22
|
import { RestartLanguageServerTool, GetSymbolsOverviewTool, FindSymbolTool, FindReferencingSymbolsTool, ReplaceSymbolBodyTool, InsertAfterSymbolTool, InsertBeforeSymbolTool } from './tools/symbol_tools.js';
|
|
23
|
-
import { CheckOnboardingPerformedTool, OnboardingTool, ThinkAboutCollectedInformationTool, ThinkAboutTaskAdherenceTool, ThinkAboutWhetherYouAreDoneTool, SummarizeChangesTool, PrepareForNewConversationTool, InitialInstructionsTool } from './tools/workflow_tools.js';
|
|
23
|
+
import { CheckOnboardingPerformedTool, OnboardingTool, CollectProjectSymbolsTool, ThinkAboutCollectedInformationTool, ThinkAboutTaskAdherenceTool, ThinkAboutWhetherYouAreDoneTool, SummarizeChangesTool, PrepareForNewConversationTool, InitialInstructionsTool } from './tools/workflow_tools.js';
|
|
24
24
|
const { logger: log, memoryHandler: defaultMemoryHandler } = createSmartEditLogger({
|
|
25
25
|
name: 'smart-edit.agent',
|
|
26
26
|
emitToConsole: true,
|
|
@@ -62,6 +62,7 @@ const DEFAULT_TOOL_CLASSES = [
|
|
|
62
62
|
InsertBeforeSymbolTool,
|
|
63
63
|
CheckOnboardingPerformedTool,
|
|
64
64
|
OnboardingTool,
|
|
65
|
+
CollectProjectSymbolsTool,
|
|
65
66
|
ThinkAboutCollectedInformationTool,
|
|
66
67
|
ThinkAboutTaskAdherenceTool,
|
|
67
68
|
ThinkAboutWhetherYouAreDoneTool,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
description: Careful editing mode that respects existing code and prevents duplicate implementations
|
|
2
|
+
prompt: |
|
|
3
|
+
You are operating in careful-editor mode. This mode emphasizes avoiding duplicate implementations
|
|
4
|
+
and respecting existing code patterns in the project.
|
|
5
|
+
|
|
6
|
+
## Duplicate Prevention Rules
|
|
7
|
+
|
|
8
|
+
Before implementing anything, you MUST check for existing implementations:
|
|
9
|
+
|
|
10
|
+
1. **Read the "project-symbols" memory first**
|
|
11
|
+
- Check existing utility functions
|
|
12
|
+
- Check existing dependencies and their purposes
|
|
13
|
+
- Review common components and patterns
|
|
14
|
+
|
|
15
|
+
2. **Search for similar functionality**
|
|
16
|
+
- Before creating a new function, use `find_symbol` to search for similar names
|
|
17
|
+
- Before adding a new library, check package.json for existing dependencies
|
|
18
|
+
- Use `get_symbols_overview` to understand available utilities in relevant files
|
|
19
|
+
|
|
20
|
+
3. **Prefer existing code over new code**
|
|
21
|
+
- If an existing function can accomplish the task, use it instead of creating a new one
|
|
22
|
+
- If an existing library provides the functionality, use it instead of adding a new dependency
|
|
23
|
+
- If a similar pattern exists elsewhere in the codebase, follow that pattern
|
|
24
|
+
|
|
25
|
+
4. **Check onboarding status**
|
|
26
|
+
- If `check_onboarding_performed` returns `significantChanges: true`,
|
|
27
|
+
you should run onboarding again to refresh the project-symbols memory
|
|
28
|
+
|
|
29
|
+
## When Creating New Code
|
|
30
|
+
|
|
31
|
+
If you determine that new code is truly necessary:
|
|
32
|
+
|
|
33
|
+
1. Place it in the appropriate existing file when possible
|
|
34
|
+
2. Follow existing naming conventions in the project
|
|
35
|
+
3. Document why existing utilities couldn't be used (if applicable)
|
|
36
|
+
4. Consider whether this new code should be added to the project-symbols memory
|
|
37
|
+
|
|
38
|
+
## Examples of What to Avoid
|
|
39
|
+
|
|
40
|
+
- Creating `formatDate()` when the project already uses date-fns
|
|
41
|
+
- Adding lodash when the project already has similar utilities
|
|
42
|
+
- Creating a new `Button` component when one exists in `components/common/`
|
|
43
|
+
- Implementing custom validation when zod is already used
|
|
44
|
+
|
|
45
|
+
You have access to all editing tools, but use them thoughtfully.
|
|
46
|
+
excluded_tools: []
|
|
47
|
+
included_optional_tools: []
|