@moon791017/neo-skills 1.0.36 → 1.0.37
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/.antigravityignore +44 -0
- package/AGENTS.md +65 -0
- package/README.md +62 -40
- package/bin/_utils.js +30 -8
- package/package.json +5 -4
- package/GEMINI.md +0 -115
- package/gemini-extension.json +0 -15
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Dependency libraries (no need to pass to AI, it usually already knows the content of these libraries)
|
|
2
|
+
node_modules/
|
|
3
|
+
vendor/
|
|
4
|
+
packages/
|
|
5
|
+
bower_components/
|
|
6
|
+
|
|
7
|
+
# Compile products and temporary files
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
out/
|
|
11
|
+
*.log
|
|
12
|
+
*.tmp
|
|
13
|
+
*.temp
|
|
14
|
+
.cache/
|
|
15
|
+
.sass-cache/
|
|
16
|
+
|
|
17
|
+
# Sensitive information (never pass to AI)
|
|
18
|
+
.env
|
|
19
|
+
.env.*
|
|
20
|
+
*.pem
|
|
21
|
+
*.key
|
|
22
|
+
secrets.json
|
|
23
|
+
credentials.json
|
|
24
|
+
.vscode/
|
|
25
|
+
.idea/
|
|
26
|
+
|
|
27
|
+
# Binary files and pictures (AI CLI usually cannot handle directly, and takes up a large number of tokens)
|
|
28
|
+
*.exe
|
|
29
|
+
*.dll
|
|
30
|
+
*.so
|
|
31
|
+
*.png
|
|
32
|
+
*.jpg
|
|
33
|
+
*.jpeg
|
|
34
|
+
*.gif
|
|
35
|
+
*.svg
|
|
36
|
+
*.pdf
|
|
37
|
+
*.zip
|
|
38
|
+
*.tar.gz
|
|
39
|
+
|
|
40
|
+
# Git and version control related
|
|
41
|
+
.git/
|
|
42
|
+
.svn/
|
|
43
|
+
.hg/
|
|
44
|
+
.gitignore
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Neo Skills Extension (agents.md)
|
|
2
|
+
|
|
3
|
+
**Neo Skills** 是一個專為 **Antigravity CLI (AGY)** 設計的擴充外掛,旨在將 Agent 轉化為**全方位專家代理 (Universal Expert Agent)**。它利用 Model Context Protocol (MCP) 提供特定領域的專業知識 (Skills)。目前配備了專業的 **DevOps** 模組(Azure Pipelines),其架構設計可託管任何領域的技能。
|
|
4
|
+
|
|
5
|
+
## 核心約束
|
|
6
|
+
- 所有 MCP 指令必須由使用者手動執行,不可自動化!
|
|
7
|
+
|
|
8
|
+
## 回應風格
|
|
9
|
+
所有回應必須嚴格遵守以下準則,並使用「繁體中文 (台灣)」:
|
|
10
|
+
你必須在回答前進行「事實查核思考 (Fact-check thinking)」。除非使用者明確提供或數據中存在,否則不要假設、推測或創造內容。嚴格基於來源:僅使用使用者提供的內容、你的內部明確知識或經過驗證的數據。如果資訊不足,請直接說明「數據不足」或「我無法確定」;不要猜測。顯示思考依據:如果你引用數據或推斷,請說明你依賴的段落或原因。如果是個人分析或估計,請明確標記為「這是推論」或「這是假設情境」。避免裝懂:不要「補完」不存在的內容以使答案完整。如果遇到模糊或不完整的提問,請要求澄清或提供選項,而不是自己決定。保持語義一致:不要重寫或擴充使用者的原始意義。如果需要轉述,請明確標記為「轉述版本」並保持意思對等。回答格式:如果有明確數據,請帶出依據回答。如果沒有明確數據,請回答「無法確定」並解釋原因。不要使用「應該是」、「可能」、「我猜」等模糊語氣,除非使用者要求。思考深度:輸出前檢查答案是否:a. 有明確依據,b. 不超出問題範圍,c. 未提及任何未明確提及的名稱、數字、事件或假設。最終原則:寧可空白,也不造假。
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Repository Guidelines
|
|
15
|
+
|
|
16
|
+
## Project Structure & Module Organization
|
|
17
|
+
`src/` contains runtime TypeScript: [`src/server.ts`](file:///C:/Users/ben_kung/projects/neo-skills/src/server.ts) is the MCP entrypoint and `src/hooks/` holds CLI safety hooks such as `secret-guard.ts`. `bin/` contains the installer CLI and shared helpers. `skills/<skill-name>/` is the main content surface for contributors; each skill centers on a `SKILL.md` file and may also include `reference/` docs or reusable `templates/`. Tests live in `test/*.test.js`. `dist/` is generated output from Bun builds and should not be edited manually.
|
|
18
|
+
|
|
19
|
+
## Build, Test, and Development Commands
|
|
20
|
+
Use `npm install` for local setup; CI uses `npm ci`. Run `bun run dev` for quick local iteration against `src/server.ts`. Run `bun run build` to bundle the server and hooks into `dist/`, and `bun run typecheck` for strict TypeScript validation without emitting files. Use `npm test` to run the Node test suite (`node --test`). After a build, `npm start` smoke-tests the bundled server from `dist/server.js`.
|
|
21
|
+
|
|
22
|
+
## Coding Style & Naming Conventions
|
|
23
|
+
Use ESM modules, 2-space indentation, and keep code ASCII unless a file already uses localized text. Follow the existing style of the file you touch instead of reformatting unrelated lines; current JS utilities mostly use single quotes, while some TS sources use double quotes. Prefer `camelCase` for functions and variables, `UPPER_SNAKE_CASE` for shared constants, and `kebab-case` for skill directories and hook filenames (for example, `neo-python`, `secret-guard.ts`). Keep comments brief and only where intent is not obvious.
|
|
24
|
+
|
|
25
|
+
## Testing Guidelines
|
|
26
|
+
Add or update tests whenever you change installer behavior, filesystem layout, or hook logic. Place tests in `test/` and name them `*.test.js`. Mirror existing patterns: use temp directories, assert on exit codes, and verify real files were created. There is no published coverage threshold, but PR CI must pass both `npm test` and `bun run build`.
|
|
27
|
+
|
|
28
|
+
## Commit & Pull Request Guidelines
|
|
29
|
+
Follow the Conventional Commits pattern already used in history: `feat:`, `fix:`, `docs:`, `test(ci):`, `refactor(skills):`. Keep subjects short and imperative; add a scope when it clarifies impact. PRs against `develop` trigger the validation workflow, while merges to `main` feed the `release-please` release flow. In each PR, summarize behavior changes, list the commands you ran, and link the related issue when applicable.
|
|
30
|
+
|
|
31
|
+
## Security & Content Notes
|
|
32
|
+
Do not commit secrets, sample credentials, or unsafe prompts. If you change secret-detection behavior, review both `src/hooks/secret-guard.ts` and `hooks/hooks.json`. When updating a skill, keep its `SKILL.md`, references, and any user-facing docs aligned.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 📂 系統架構
|
|
37
|
+
|
|
38
|
+
專案組織為三個主要層次:
|
|
39
|
+
|
|
40
|
+
### 1. MCP 伺服器 (`src/server.ts`)
|
|
41
|
+
擴充套件的進入點。提供了一個 MCP 伺服器,負責:
|
|
42
|
+
* 註冊 **工具 (Tools)**(例如:`fetch_web_content` 用於網頁擷取)。
|
|
43
|
+
* *注意:若要在 AGY CLI 中使用此工具,需手動在 AGY 的 MCP 設定中配置此伺服器。*
|
|
44
|
+
|
|
45
|
+
### 2. 知識庫 (`skills/` & `.agents/skills`)
|
|
46
|
+
每個子目錄代表一個包含專家知識的「技能模組」。
|
|
47
|
+
* **結構:**
|
|
48
|
+
* `SKILL.md`:**大腦**。定義該領域的 **Perceive-Reason-Act** 迴圈。指引 Agent 如何分析環境並做出決策。
|
|
49
|
+
* `templates/`:**雙手**。Agent 應優先使用的可重用資產庫。
|
|
50
|
+
* **載入邏輯:**
|
|
51
|
+
* **全域技能**: 載入自 `~/.gemini/antigravity-cli/plugins/`。
|
|
52
|
+
* **專案專屬技能**: 載入自專案根目錄下的 `.agents/skills/`(遷移自舊有的 `.gemini/skills/`)。
|
|
53
|
+
* **範例:** `skills/neo-azure-pipelines/` 包含設計 CI/CD 管線的邏輯。
|
|
54
|
+
|
|
55
|
+
### 3. 安全層 (`src/hooks/`)
|
|
56
|
+
確保操作安全與數據隱私的機制。
|
|
57
|
+
* **安全守衛 (`secret-guard.ts`)**:一個即時分析工具執行參數的攔截掛鉤 (Hook)。它會阻斷涉及敏感檔案(如 `.env`, 私鑰, 憑證)的操作,以防止意外洩漏。
|
|
58
|
+
|
|
59
|
+
## 💡 使用哲學
|
|
60
|
+
|
|
61
|
+
在使用此程式碼庫或外掛程式時,Agent 遵循 **Perceive-Reason-Act** 協定:
|
|
62
|
+
|
|
63
|
+
1. **感知 (Perceive)**:分析使用者的專案上下文(語言、框架、現有設定)。
|
|
64
|
+
2. **推理 (Reason)**:諮詢內部知識庫 (`SKILL.md`) 以制定策略。
|
|
65
|
+
3. **行動 (Act)**:執行工作流程,優先使用 `skills/**/templates/` 中的現有範本。
|
package/README.md
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
[](https://github.com/Benknightdark/neo-skills/actions/workflows/test-on-develop.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/@moon791017/neo-skills)
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
<p align="center">
|
|
7
|
+
<img src="images/banner.png" alt="leak-hunter repository secret scanner banner" width="100%">
|
|
8
|
+
</p>
|
|
8
9
|
|
|
9
10
|
**Neo Skills** 是專為現代 **AI Agent** 設計的**全方位能力擴充套件**。本專案透過標準化的通訊架構,為 AI 代理安裝可插拔的「技能模組 (Skills)」,使其不僅僅是一個聊天機器人,而是能轉化為具備「感知-推理-行動」能力的**多領域專家**。
|
|
10
11
|
|
|
@@ -14,60 +15,73 @@
|
|
|
14
15
|
|
|
15
16
|
本專案作為 AI Agent 的「大腦皮層 (Cortex)」,旨在打造一個**全能型 Agent 框架**,透過以下機制提升 AI 的專業度:
|
|
16
17
|
|
|
17
|
-
1.
|
|
18
|
-
2.
|
|
19
|
-
3.
|
|
18
|
+
1. **領域專精 (Skills)**:可擴充的專家知識庫 (`SKILL.md`)。目前已內建 DevOps 模組,未來將持續擴增更多領域。
|
|
19
|
+
2. **標準化範本 (Templates)**:提供預先驗證的自動化腳本與模板,確保產出的一致性與可靠性。
|
|
20
|
+
3. **架構思維**:強制執行「感知 (Perceive) -> 推理 (Reason) -> 行動 (Act)」的決策迴圈,避免 AI 產生幻覺,確保解決方案的精準度。
|
|
20
21
|
|
|
21
22
|
## ✨ 目前內建技能 (Built-in Skills)
|
|
22
23
|
|
|
23
24
|
### 1. Azure Pipelines 架構師
|
|
25
|
+
|
|
24
26
|
自動化設計與生成符合微軟最佳實踐的 CI/CD 流程。
|
|
25
|
-
|
|
26
|
-
*
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
|
|
28
|
+
* **CI 自動化**:針對 .NET 專案生成建置管線,整合單元測試與構件發佈。
|
|
29
|
+
* **CD 自動化**:
|
|
30
|
+
* **Azure App Service**:部署至Azure App Service。
|
|
31
|
+
* **IIS On-Premises**:部署至地端 IIS 伺服器,包含備份與復原機制。
|
|
29
32
|
|
|
30
33
|
### 2. Code Review 專家
|
|
31
|
-
|
|
34
|
+
|
|
35
|
+
* **智能審查**:針對程式碼變更進行多面向 (正確性、安全性、效能、可讀性) 的深度審查。
|
|
32
36
|
|
|
33
37
|
### 4. 程式碼解釋助手
|
|
34
|
-
|
|
38
|
+
|
|
39
|
+
* **技術解析**:深入分析原始碼或專案結構,提供高階用途摘要、邏輯流程分解以及核心元件說明。
|
|
35
40
|
|
|
36
41
|
### 5. .NET / C# 開發專家
|
|
37
|
-
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
42
|
+
|
|
43
|
+
* **C# 現代語法專家 (`skills/neo-csharp`)**:跨版本 C# 專家 (10-14+),專注於現代化語法、強型別與高效能開發模式。
|
|
44
|
+
* **.NET 核心路由 (`skills/neo-dotnet`)**:環境偵測與統一入口,自動將任務委派給最合適的子領域專家。
|
|
45
|
+
* **.NET Minimal APIs 專家 (`skills/neo-dotnet-minimal-apis`)**:專注於高效能微服務、路由群組與 Typed Results。
|
|
46
|
+
* **.NET Web API 專家 (`skills/neo-dotnet-webapi`)**:提供控制器模式下的架構設計、Problem Details 與異常處理指引。
|
|
47
|
+
* **.NET MVC 專家 (`skills/neo-dotnet-mvc`)**:處理伺服器端渲染 (SSR)、視圖模型與標籤協助程式的最佳實踐。
|
|
48
|
+
* **EF Core 專家 (`skills/neo-dotnet-ef-core`)**:專注於資料庫建模、移轉管理與 Linq 查詢優化。
|
|
49
|
+
* **.NET Tag Helper 專家 (`skills/neo-dotnet-tag-helper`)**:開發 ASP.NET Core 自定義 Tag Helper 的專家指引,專注於純 C# 實作與異步渲染最佳實踐。
|
|
50
|
+
* **Interface 生成器**:針對 C# Class 自動生成符合規範的 Interface,並支援智慧檔案覆蓋功能。
|
|
45
51
|
|
|
46
52
|
### 6. Python 開發與環境管理專家
|
|
47
|
-
|
|
48
|
-
*
|
|
53
|
+
|
|
54
|
+
* **Python 3.10+ 專家 (`skills/neo-python`)**:專注於 Python 3.10 至 3.14 的現代語法特性、型別安全與非同步開發。
|
|
55
|
+
* **環境管理專家 (`skills/neo-python-manager`)**:智慧偵測與管理 Python 專案環境,支援 uv, Poetry, venv/pip 並提供自動化安裝建議。
|
|
49
56
|
|
|
50
57
|
### 7. Swift 開發專家
|
|
51
|
-
|
|
52
|
-
*
|
|
58
|
+
|
|
59
|
+
* **Swift 5.0+ 專家 (`skills/neo-swift`)**:支援從基礎語法到 Swift 6 的現代開發模式,涵蓋 SwiftUI、Structured Concurrency、記憶體安全以及高效能 App 開發指引。
|
|
60
|
+
* **SwiftUI 專家 (`skills/neo-swift-ui`)**:支援 iOS 16.0+ 與 Swift 5.0+ 的現代開發模式,專注於 NavigationStack、Observation 框架、資料流架構及高效能視圖設計。
|
|
53
61
|
|
|
54
62
|
### 8. JavaScript 開發專家
|
|
55
|
-
|
|
63
|
+
|
|
64
|
+
* **JavaScript 現代語法專家 (`skills/neo-javascript`)**:跨版本 JavaScript 專家 (ES6 - ES2025+),專注於現代化語法、模組系統與高效能開發模式。
|
|
56
65
|
|
|
57
66
|
### 9. Vue 開發專家
|
|
58
|
-
|
|
67
|
+
|
|
68
|
+
* **Vue 3 現代開發專家 (`skills/neo-vue`)**:專注於 Vue 3 Composition API (`<script setup>`)、Pinia 狀態管理與 Vue Router 4。嚴格遵循官方 Style Guide 與最佳實踐,並提供反模式 (Anti-Patterns) 的避坑指引。
|
|
59
69
|
|
|
60
70
|
### 10. Rust 開發專家
|
|
61
|
-
|
|
71
|
+
|
|
72
|
+
* **Rust 專家 (`skills/neo-rust`)**:用於開發、重構或審查 Rust 應用程式的專家技能,涵蓋 ownership、borrowing、Result/Option 與現代 Rust 設計模式。
|
|
62
73
|
|
|
63
74
|
### 11. 需求釐清助手
|
|
64
|
-
|
|
75
|
+
|
|
76
|
+
* **需求釐清**:系統化引導用戶釐清模糊需求,並將其轉化為結構化的規格文件(背景、功能、約束、驗收標準)。
|
|
65
77
|
|
|
66
78
|
### 12. AI 開發流程健檢
|
|
67
|
-
|
|
79
|
+
|
|
80
|
+
* **AI 助手開發治理 (`skills/neo-agent-harness`)**:檢查專案規則、測試、CI、審查流程與安全防護是否足夠清楚,協助 AI 助手更穩定、更安全地參與開發。
|
|
68
81
|
|
|
69
82
|
### 13. 安全守衛 (Security Guard)
|
|
70
|
-
|
|
83
|
+
|
|
84
|
+
* **主動防護 (`secret-guard.ts`)**:作為 CLI 的中介軟體 (Hook),自動攔截並掃描所有工具執行的參數。若偵測到敏感資訊(如環境設定檔、私鑰、雲端憑證等)將強制阻擋執行,防止機密外洩。
|
|
71
85
|
|
|
72
86
|
## 📂 系統架構
|
|
73
87
|
|
|
@@ -85,7 +99,7 @@
|
|
|
85
99
|
|
|
86
100
|
| Agent | CLI 工具 | 技能目錄 | 指導檔 |
|
|
87
101
|
| :--- | :--- | :--- | :--- |
|
|
88
|
-
| **
|
|
102
|
+
| **Antigravity** | [Antigravity CLI](https://antigravity.google) | 透過外掛程式自動載入 | `agents.md` |
|
|
89
103
|
| **Claude** | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | `.claude/skills/` | `CLAUDE.md` |
|
|
90
104
|
| **Copilot** | [GitHub Copilot CLI](https://docs.github.com/en/copilot) | `.copilot/skills/`(全域)<br>`.github/skills/`(專案) | `.copilot/copilot-instructions.md`(全域)<br>`.github/copilot-instructions.md`(專案) |
|
|
91
105
|
| **Codex** | [OpenAI Codex CLI](https://github.com/openai/codex) | `.codex/skills/` | `AGENTS.md` |
|
|
@@ -101,14 +115,17 @@ Neo Skills 提供兩個 CLI 工具,分別用於安裝**技能模組**與**系
|
|
|
101
115
|
|
|
102
116
|
---
|
|
103
117
|
|
|
104
|
-
### 一、
|
|
118
|
+
### 一、Antigravity CLI (AGY)
|
|
105
119
|
|
|
106
|
-
|
|
120
|
+
Antigravity CLI 現在支援透過標準的 `install-skills` 工具安裝技能模組。
|
|
107
121
|
|
|
108
122
|
```bash
|
|
109
|
-
|
|
123
|
+
# 安裝 Neo Skills 至 AGY 全域技能目錄
|
|
124
|
+
npx -p @moon791017/neo-skills install-skills --ai-agent agy -y
|
|
110
125
|
```
|
|
111
126
|
|
|
127
|
+
或者手動將專案連結至 `~/.gemini/antigravity-cli/plugins/neo-skills`。
|
|
128
|
+
|
|
112
129
|
---
|
|
113
130
|
|
|
114
131
|
### 二、安裝技能模組 (`install-skills`)
|
|
@@ -132,6 +149,7 @@ install-skills [--ai-agent <name>] [--project-path <path>]
|
|
|
132
149
|
|
|
133
150
|
| Agent | 全域路徑 | 專案路徑 |
|
|
134
151
|
| :--- | :--- | :--- |
|
|
152
|
+
| Antigravity | `~/.gemini/skills/` | `<project>/.agents/skills/` |
|
|
135
153
|
| Claude | `~/.claude/skills/` | `<project>/.claude/skills/` |
|
|
136
154
|
| Copilot | `~/.copilot/skills/` | `<project>/.github/skills/` |
|
|
137
155
|
| Codex | `~/.codex/skills/` | `<project>/.codex/skills/` |
|
|
@@ -212,7 +230,6 @@ npx -p @moon791017/neo-skills install-system-instructions \
|
|
|
212
230
|
|
|
213
231
|
| 需求場景 | 推薦咒語範例 |
|
|
214
232
|
| :--- | :--- |
|
|
215
|
-
| **生成 Commit Message** | `幫我 commit 變更` |
|
|
216
233
|
| **設定 .NET CI Pipeline** | `幫這個專案設定 CI 流程` |
|
|
217
234
|
| **部署至 IIS** | `部署到 IIS,站台名稱為 MySite` |
|
|
218
235
|
| **需求釐清與規格化** | `我想做一個電商網站` |
|
|
@@ -226,29 +243,34 @@ npx -p @moon791017/neo-skills install-system-instructions \
|
|
|
226
243
|
本專案使用 **Bun** 進行開發與建置。
|
|
227
244
|
|
|
228
245
|
### 前置需求
|
|
229
|
-
|
|
230
|
-
*
|
|
246
|
+
|
|
247
|
+
* **[Node.js](https://nodejs.org/) (v18+)**:基本執行環境。
|
|
248
|
+
* **[Bun](https://bun.sh/)**:僅在**開發**、**建置**或執行 **Gemini MCP Server** 時需要。
|
|
231
249
|
|
|
232
250
|
### 快速開始
|
|
233
251
|
|
|
234
|
-
1.
|
|
252
|
+
1. **安裝依賴**
|
|
253
|
+
|
|
235
254
|
```bash
|
|
236
255
|
npm install
|
|
237
256
|
```
|
|
238
257
|
|
|
239
|
-
2.
|
|
258
|
+
2. **開發模式 (Watch Mode)**
|
|
240
259
|
直接執行原始碼進行測試:
|
|
260
|
+
|
|
241
261
|
```bash
|
|
242
262
|
bun src/server.ts
|
|
243
263
|
```
|
|
244
264
|
|
|
245
|
-
3.
|
|
265
|
+
3. **建置專案**
|
|
246
266
|
將 TypeScript 編譯並打包至 `dist/` 目錄:
|
|
267
|
+
|
|
247
268
|
```bash
|
|
248
269
|
bun run build
|
|
249
270
|
```
|
|
250
271
|
|
|
251
|
-
4.
|
|
272
|
+
4. **類型檢查**
|
|
273
|
+
|
|
252
274
|
```bash
|
|
253
275
|
bun run typecheck
|
|
254
276
|
```
|
package/bin/_utils.js
CHANGED
|
@@ -50,6 +50,16 @@ export const AGENTS = {
|
|
|
50
50
|
},
|
|
51
51
|
hint: '請確保您的 Codex CLI 已指向此目錄。',
|
|
52
52
|
},
|
|
53
|
+
agy: {
|
|
54
|
+
name: 'Antigravity (AGY)',
|
|
55
|
+
homePath: '.gemini/skills',
|
|
56
|
+
projectPath: '.agents/skills',
|
|
57
|
+
instructionFile: {
|
|
58
|
+
homePath: '.gemini/antigravity-cli/instructions.md',
|
|
59
|
+
projectPath: 'agents.md',
|
|
60
|
+
},
|
|
61
|
+
hint: 'Neo Skills 已安裝。請確保 AGY 已載入 instructions.md 或 agents.md 作為上下文檔案。',
|
|
62
|
+
},
|
|
53
63
|
};
|
|
54
64
|
|
|
55
65
|
/**
|
|
@@ -71,14 +81,16 @@ export const AGENTS = {
|
|
|
71
81
|
* @param {object} config - AGENTS 中的 agent 設定物件
|
|
72
82
|
* @param {string} [targetPath] - 使用者透過 --project-path 指定的自訂根目錄
|
|
73
83
|
*/
|
|
74
|
-
export function createInstaller({ name: agentName, homePath, projectPath, hint }, cliBasePath) {
|
|
84
|
+
export function createInstaller({ name: agentName, homePath, projectPath, sourceDir: customSourceDir, hint }, cliBasePath) {
|
|
75
85
|
return async function install() {
|
|
76
86
|
console.log(`🚀 [${agentName}] 開始同步 Neo Skills...`);
|
|
77
87
|
|
|
88
|
+
const effectiveSourceDir = customSourceDir ? resolve(packageRoot, customSourceDir) : sourceDir;
|
|
89
|
+
|
|
78
90
|
try {
|
|
79
|
-
await access(
|
|
91
|
+
await access(effectiveSourceDir);
|
|
80
92
|
} catch {
|
|
81
|
-
const msg = `在 ${
|
|
93
|
+
const msg = `在 ${effectiveSourceDir} 找不到來源目錄。`;
|
|
82
94
|
console.error(`❌ 錯誤: ${msg}`);
|
|
83
95
|
return { success: false, message: msg };
|
|
84
96
|
}
|
|
@@ -89,19 +101,29 @@ export function createInstaller({ name: agentName, homePath, projectPath, hint }
|
|
|
89
101
|
const subDir = cliBasePath && projectPath ? projectPath : homePath;
|
|
90
102
|
const targetSkillsDir = join(baseDir, subDir);
|
|
91
103
|
|
|
92
|
-
console.log(`📁 來源路徑: ${
|
|
104
|
+
console.log(`📁 來源路徑: ${effectiveSourceDir}`);
|
|
93
105
|
console.log(`🎯 目標路徑: ${targetSkillsDir}`);
|
|
94
106
|
|
|
95
107
|
await mkdir(targetSkillsDir, { recursive: true });
|
|
96
108
|
|
|
97
109
|
let copyCount = 0;
|
|
98
|
-
await cp(
|
|
110
|
+
await cp(effectiveSourceDir, targetSkillsDir, {
|
|
99
111
|
recursive: true,
|
|
100
112
|
force: true,
|
|
101
113
|
filter: (src) => {
|
|
102
|
-
const relativePath = src.replace(
|
|
103
|
-
const isIgnored =
|
|
104
|
-
|
|
114
|
+
const relativePath = src.replace(effectiveSourceDir, '');
|
|
115
|
+
const isIgnored =
|
|
116
|
+
relativePath.includes('node_modules') ||
|
|
117
|
+
relativePath.includes('.git') ||
|
|
118
|
+
relativePath.includes('dist') ||
|
|
119
|
+
relativePath.includes('.antigravitycli') ||
|
|
120
|
+
relativePath.includes('.agents');
|
|
121
|
+
|
|
122
|
+
if (!isIgnored) {
|
|
123
|
+
// 只有當 src 不是目錄時才增加計數,或者簡化計數邏輯
|
|
124
|
+
copyCount++;
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
105
127
|
return false;
|
|
106
128
|
}
|
|
107
129
|
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moon791017/neo-skills",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.37",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Neo Skills: A Universal Expert Agent Extension",
|
|
6
6
|
"homepage": "https://neo-blog-iota.vercel.app/",
|
|
7
7
|
"keywords": [
|
|
8
|
-
"
|
|
8
|
+
"antigravity cli",
|
|
9
|
+
"agy cli",
|
|
9
10
|
"claude code",
|
|
10
11
|
"copilot cli",
|
|
11
12
|
"openai codex cli",
|
|
@@ -20,8 +21,8 @@
|
|
|
20
21
|
"dist",
|
|
21
22
|
"bin",
|
|
22
23
|
"skills",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
24
|
+
"AGENTS.md",
|
|
25
|
+
".antigravityignore"
|
|
25
26
|
],
|
|
26
27
|
"repository": {
|
|
27
28
|
"type": "git",
|
package/GEMINI.md
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
# Neo Skills Extension
|
|
2
|
-
|
|
3
|
-
**Neo Skills** is a Gemini CLI extension that transforms the agent into a **Universal Expert Agent**. It utilizes the Model Context Protocol (MCP) to provide domain-specific expertise ("Skills"). While currently equipped with specialized **DevOps** modules (Azure Pipelines, Git), its architecture is designed to host skills from any domain.
|
|
4
|
-
|
|
5
|
-
## Constraints
|
|
6
|
-
- All MCP commands must be manually executed by the user and cannot be automated!
|
|
7
|
-
|
|
8
|
-
## Response Style
|
|
9
|
-
All responses must strictly adhere to the following guidelines and in 「Traditional Taiwanese Chinese」:
|
|
10
|
-
You must engage in "fact-check thinking" before answering. Unless explicitly provided by the user or present in the data, do not assume, speculate, or create content. Strictly based on sources: Use only user-provided content, your internal explicit knowledge, or verified data. If information is insufficient, state "insufficient data" or "I cannot determine" directly; do not guess. Show basis for thinking: If you cite data or infer, explain the paragraph or reason you rely on. If it is personal analysis or estimation, clearly label it as "this is an inference" or "this is a hypothetical scenario". Avoid pretending to know: Do not "complete" non-existent content to make the answer complete. If you encounter vague or incomplete questions, ask for clarification or offer options instead of deciding yourself. Maintain semantic consistency: Do not rewrite or expand the user's original meaning. If you need to restate, explicitly label it as a "restated version" and keep the meaning equivalent. Answer format: If there is clear data, answer with the basis. If there is no clear data, answer "cannot determine" and explain the reason. Do not use vague tones like "should be", "probably", "I guess" unless requested by the user. Depth of thought: Before outputting, check if the answer: a. has a clear basis, b. does not exceed the scope of the question, c. does not mention any names, numbers, events, or assumptions not explicitly mentioned. Final principle: Better blank than fabricated.
|
|
11
|
-
|
|
12
|
-
## 🚀 Project Overview
|
|
13
|
-
|
|
14
|
-
This project serves as a "Cortex" for the Gemini agent, enabling it to:
|
|
15
|
-
1. **Understand** complex contexts across various domains via structured knowledge bases (`SKILL.md`).
|
|
16
|
-
2. **Execute** precise workflows using pre-validated templates (`templates/`) and skill definitions (`SKILL.md`).
|
|
17
|
-
3. **Standardize** outputs to ensure consistency and reliability.
|
|
18
|
-
|
|
19
|
-
## 📂 System Architecture
|
|
20
|
-
|
|
21
|
-
The project is organized into three main layers:
|
|
22
|
-
|
|
23
|
-
### 1. The MCP Server (`src/server.ts`)
|
|
24
|
-
The entry point of the extension. It runs an MCP server that:
|
|
25
|
-
* Registers **Tools** (e.g., `fetch_web_content` for web scraping).
|
|
26
|
-
|
|
27
|
-
### 2. The Knowledge Base (`skills/`)
|
|
28
|
-
Each subdirectory represents a "Skill Module" containing expert knowledge.
|
|
29
|
-
* **Structure:**
|
|
30
|
-
* `SKILL.md`: The "Brain". Defines the **Perceive-Reason-Act** loop for the domain. It instructs the agent on how to analyze the environment and make decisions.
|
|
31
|
-
* `templates/`: The "Hands". A library of reusable assets that the agent should use instead of writing code from scratch.
|
|
32
|
-
* **Example:** `skills/neo-azure-pipelines/` contains logic for designing CI/CD pipelines and templates for .NET builds, IIS deployments, etc.
|
|
33
|
-
|
|
34
|
-
### 3. Security Layer (`src/hooks/`)
|
|
35
|
-
Mechanisms to ensure operational safety and data privacy.
|
|
36
|
-
* **Secret Guard (`secret-guard.ts`)**: An interception hook that analyzes tool execution arguments in real-time. It blocks operations involving sensitive files (e.g., `.env`, private keys, credentials) to prevent accidental leakage.
|
|
37
|
-
|
|
38
|
-
## 🛠 Building and Running
|
|
39
|
-
|
|
40
|
-
This project uses **Bun** for development and building, and **Node.js** for the runtime environment.
|
|
41
|
-
|
|
42
|
-
### Prerequisites
|
|
43
|
-
* Node.js (v18+)
|
|
44
|
-
* Bun
|
|
45
|
-
|
|
46
|
-
### Commands
|
|
47
|
-
|
|
48
|
-
* **Install Dependencies:**
|
|
49
|
-
```bash
|
|
50
|
-
npm install
|
|
51
|
-
```
|
|
52
|
-
* **Build Project:**
|
|
53
|
-
```bash
|
|
54
|
-
bun run build
|
|
55
|
-
```
|
|
56
|
-
*This cleans the `dist` folder and bundles `src/server.ts` into `dist/server.js`.*
|
|
57
|
-
* **Development Mode:**
|
|
58
|
-
```bash
|
|
59
|
-
bun src/server.ts
|
|
60
|
-
```
|
|
61
|
-
* **Type Check:**
|
|
62
|
-
```bash
|
|
63
|
-
bun run typecheck
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## 🧩 Extension Configuration
|
|
67
|
-
|
|
68
|
-
The extension is defined in `gemini-extension.json`:
|
|
69
|
-
* **Name:** `neo-skills`
|
|
70
|
-
* **Entry Point:** `dist/server.js`
|
|
71
|
-
* **Context File:** `GEMINI.md` (This file)
|
|
72
|
-
|
|
73
|
-
## 💡 Usage Philosophy
|
|
74
|
-
|
|
75
|
-
When interacting with this codebase or using the extension, the agent follows the **Perceive-Reason-Act** protocol:
|
|
76
|
-
|
|
77
|
-
1. **Perceive:** Analyze the user's project context (languages, frameworks, existing config).
|
|
78
|
-
2. **Reason:** Consult the internal knowledge base (`SKILL.md`) to formulate a strategy.
|
|
79
|
-
3. **Act:** Execute the workflow, prioritizing the use of existing templates in `skills/**/templates/` over generating new code.
|
|
80
|
-
|
|
81
|
-
### Available Capabilities (Current Built-in Skills)
|
|
82
|
-
|
|
83
|
-
* **Web Scraper:** 從指定的 URL 獲取網頁 HTML 內容,支援 CSS 選擇器 (`fetch_web_content`)。
|
|
84
|
-
|
|
85
|
-
* **CI Protocols:** 自動配置 .NET 專案的 Azure Pipelines CI 建置流程。
|
|
86
|
-
|
|
87
|
-
* **CD Protocols:** 為專案自動配置 Azure App Service 與地端 IIS 的部署流程 (CD)。
|
|
88
|
-
|
|
89
|
-
* **Requirement Clarification:** 系統化引導用戶釐清模糊需求,並將其轉化為結構化的規格文件。
|
|
90
|
-
|
|
91
|
-
* **Code Explanation:** 分析原始碼或專案結構,提供技術解析與架構洞察。
|
|
92
|
-
|
|
93
|
-
* **Code Review:** 對當前變更或指定檔案進行全方位的程式碼審查。
|
|
94
|
-
|
|
95
|
-
* **C# 現代語法專家:** 跨版本 C# 專家 (10-14+),專注於現代化語法、強型別與高效能開發模式。
|
|
96
|
-
|
|
97
|
-
* **.NET 開發專家群:** 包含核心環境路由,以及針對 Minimal APIs、Web API、MVC 與 EF Core 的深度技術指引與開發規範。
|
|
98
|
-
|
|
99
|
-
* **C# Interface Generation:** 針對指定的 C# 類別生成對應的 Interface,並提供智慧覆蓋功能。
|
|
100
|
-
|
|
101
|
-
* **ASP.NET Core Tag Helper 開發專家:** 專注於純 C# 實作、強型別屬性與 `ProcessAsync` 異步渲染的最佳實踐。
|
|
102
|
-
|
|
103
|
-
* **Python 3.10+ 現代開發專家:** 專注於 Python 3.10 至 3.14 的現代語法特性、型別安全與非同步開發。
|
|
104
|
-
|
|
105
|
-
* **Python 環境管理專家:** 智慧偵測並管理 Python 專案的虛擬環境與相依套件工具(支援 uv, Poetry, venv/pip)。
|
|
106
|
-
|
|
107
|
-
* **Swift 專家:** 支援 Swift 5.0 至 6.0+ 的現代開發模式,涵蓋 SwiftUI、Structured Concurrency 與記憶體安全。
|
|
108
|
-
|
|
109
|
-
* **SwiftUI 專家:** 支援 iOS 16.0+ 與 Swift 5.0+ 的現代開發模式,專注於 NavigationStack、Observation 框架、資料流架構及高效能視圖設計。
|
|
110
|
-
|
|
111
|
-
* **JavaScript 現代語法專家:** 跨版本 JavaScript 專家 (ES6-ES2025+),專注於現代化語法、模組系統與高效能開發模式。
|
|
112
|
-
|
|
113
|
-
* **Vue 現代開發專家:** 專注於 Vue 3 Composition API (`<script setup>`)、Pinia 狀態管理與 Vue Router 4,嚴格遵循官方 Style Guide 與最佳實踐。
|
|
114
|
-
|
|
115
|
-
* **Rust 專家 (`skills/neo-rust`)**: 用於開發、重構或審查 Rust 應用程式的專家技能,涵蓋 ownership、borrowing、Result/Option 與現代 Rust 設計模式。
|
package/gemini-extension.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "neo-skills",
|
|
3
|
-
"description": "A universal capability extension for Gemini CLI",
|
|
4
|
-
"version": "0.60.0",
|
|
5
|
-
"mcpServers": {
|
|
6
|
-
"neo-skills": {
|
|
7
|
-
"command": "node",
|
|
8
|
-
"args": [
|
|
9
|
-
"${extensionPath}/dist/server.js"
|
|
10
|
-
]
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"hooks": "hooks/hooks.json",
|
|
14
|
-
"contextFileName": "GEMINI.md"
|
|
15
|
-
}
|