@moon791017/neo-skills 1.0.19 → 1.0.21
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/GEMINI.md +10 -16
- package/README.md +32 -37
- package/bin/_utils.js +4 -88
- package/bin/install-skills.js +57 -3
- package/gemini-extension.json +1 -1
- package/package.json +3 -6
- package/skills/neo-azure-pipelines/SKILL.md +29 -1
- package/skills/neo-clarification/SKILL.md +14 -3
- package/skills/neo-code-review/SKILL.md +8 -2
- package/skills/neo-csharp-interface-generator/SKILL.md +1 -0
- package/skills/neo-explain/SKILL.md +19 -7
- package/skills/neo-git-commit/SKILL.md +4 -0
- package/skills/neo-start-plan/SKILL.md +1 -1
- package/bin/install-claude-skills.js +0 -7
- package/bin/install-codex-skills.js +0 -7
- package/bin/install-copilot-skills.js +0 -7
- package/commands/neo/cd-app-service.toml +0 -20
- package/commands/neo/cd-iis.toml +0 -20
- package/commands/neo/ci-dotnet.toml +0 -21
- package/commands/neo/clarification.toml +0 -48
- package/commands/neo/code-review.toml +0 -33
- package/commands/neo/dotnet-gen-interface.toml +0 -31
- package/commands/neo/explain.toml +0 -44
- package/commands/neo/git-commit.toml +0 -49
package/GEMINI.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Neo Skills Extension
|
|
2
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")
|
|
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
4
|
|
|
5
5
|
## Constraints
|
|
6
6
|
- All MCP commands must be manually executed by the user and cannot be automated!
|
|
@@ -13,7 +13,7 @@ You must engage in "fact-check thinking" before answering. Unless explicitly pro
|
|
|
13
13
|
|
|
14
14
|
This project serves as a "Cortex" for the Gemini agent, enabling it to:
|
|
15
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
|
|
16
|
+
2. **Execute** precise workflows using pre-validated templates (`templates/`) and skill definitions (`SKILL.md`).
|
|
17
17
|
3. **Standardize** outputs to ensure consistency and reliability.
|
|
18
18
|
|
|
19
19
|
## 📂 System Architecture
|
|
@@ -23,7 +23,6 @@ The project is organized into three main layers:
|
|
|
23
23
|
### 1. The MCP Server (`src/server.ts`)
|
|
24
24
|
The entry point of the extension. It runs an MCP server that:
|
|
25
25
|
* Registers **Tools** (e.g., `fetch_web_content` for web scraping).
|
|
26
|
-
* Registers **Prompts** (e.g., `neo:git_commit`) which are dynamic templates that inject context and instructions into the chat session.
|
|
27
26
|
|
|
28
27
|
### 2. The Knowledge Base (`skills/`)
|
|
29
28
|
Each subdirectory represents a "Skill Module" containing expert knowledge.
|
|
@@ -32,12 +31,7 @@ Each subdirectory represents a "Skill Module" containing expert knowledge.
|
|
|
32
31
|
* `templates/`: The "Hands". A library of reusable assets that the agent should use instead of writing code from scratch.
|
|
33
32
|
* **Example:** `skills/neo-azure-pipelines/` contains logic for designing CI/CD pipelines and templates for .NET builds, IIS deployments, etc.
|
|
34
33
|
|
|
35
|
-
### 3.
|
|
36
|
-
Defines rigid, executable workflows triggered by the user.
|
|
37
|
-
* **Format:** TOML files (e.g., `ci-dotnet.toml`, `git-commit.toml`).
|
|
38
|
-
* **Purpose:** These files contain the "System Prompt" or "Instructions" that are fed to the agent when a specific task is requested. They explicitly link a user request to a specific Skill.
|
|
39
|
-
|
|
40
|
-
### 4. Security Layer (`src/hooks/`)
|
|
34
|
+
### 3. Security Layer (`src/hooks/`)
|
|
41
35
|
Mechanisms to ensure operational safety and data privacy.
|
|
42
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.
|
|
43
37
|
|
|
@@ -88,23 +82,23 @@ When interacting with this codebase or using the extension, the agent follows th
|
|
|
88
82
|
|
|
89
83
|
* **Web Scraper:** 從指定的 URL 獲取網頁 HTML 內容,支援 CSS 選擇器 (`fetch_web_content`)。
|
|
90
84
|
|
|
91
|
-
* **Git Automation:**
|
|
85
|
+
* **Git Automation:** 根據暫存區變更自動生成 Conventional Commits 訊息,經使用者確認後執行 commit。
|
|
92
86
|
|
|
93
|
-
* **CI Protocols:** 自動配置 .NET 專案的 Azure Pipelines CI
|
|
87
|
+
* **CI Protocols:** 自動配置 .NET 專案的 Azure Pipelines CI 建置流程。
|
|
94
88
|
|
|
95
|
-
* **CD Protocols:** 為專案自動配置 Azure App Service
|
|
89
|
+
* **CD Protocols:** 為專案自動配置 Azure App Service 與地端 IIS 的部署流程 (CD)。
|
|
96
90
|
|
|
97
|
-
* **Requirement Clarification:**
|
|
91
|
+
* **Requirement Clarification:** 系統化引導用戶釐清模糊需求,並將其轉化為結構化的規格文件。
|
|
98
92
|
|
|
99
|
-
* **Code Explanation:**
|
|
93
|
+
* **Code Explanation:** 分析原始碼或專案結構,提供技術解析與架構洞察。
|
|
100
94
|
|
|
101
|
-
* **Code Review:**
|
|
95
|
+
* **Code Review:** 對當前變更或指定檔案進行全方位的程式碼審查。
|
|
102
96
|
|
|
103
97
|
* **C# 現代語法專家:** 跨版本 C# 專家 (10-14+),專注於現代化語法、強型別與高效能開發模式。
|
|
104
98
|
|
|
105
99
|
* **.NET 開發專家群:** 包含核心環境路由,以及針對 Minimal APIs、Web API、MVC 與 EF Core 的深度技術指引與開發規範。
|
|
106
100
|
|
|
107
|
-
* **C# Interface Generation:** 針對指定的 C# 類別生成對應的 Interface
|
|
101
|
+
* **C# Interface Generation:** 針對指定的 C# 類別生成對應的 Interface,並提供智慧覆蓋功能。
|
|
108
102
|
|
|
109
103
|
* **Python 3.10+ 現代開發專家:** 專注於 Python 3.10 至 3.14 的現代語法特性、型別安全與非同步開發。
|
|
110
104
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Neo Skills
|
|
2
2
|
|
|
3
|
+
[](https://github.com/Benknightdark/neo-skills/actions/workflows/test-on-develop.yml)
|
|
4
|
+
|
|
3
5
|
**Neo Skills** 是專為現代 **AI Agent** 設計的**全方位能力擴充套件**。本專案透過標準化的通訊架構,為 AI 代理安裝可插拔的「技能模組 (Skills)」,使其不僅僅是一個聊天機器人,而是能轉化為具備「感知-推理-行動」能力的**多領域專家**。
|
|
4
6
|
|
|
5
7
|
無論是 DevOps 自動化、軟體架構設計,或是未來的資料分析與專案管理,Neo Skills 都能透過掛載不同的知識庫與工具,讓 AI 成為您最強大的全能助手。
|
|
@@ -9,26 +11,26 @@
|
|
|
9
11
|
本專案作為 AI Agent 的「大腦皮層 (Cortex)」,旨在打造一個**全能型 Agent 框架**,透過以下機制提升 AI 的專業度:
|
|
10
12
|
|
|
11
13
|
1. **領域專精 (Skills)**:可擴充的專家知識庫 (`SKILL.md`)。目前已內建 DevOps 模組,未來將持續擴增更多領域。
|
|
12
|
-
2.
|
|
14
|
+
2. **標準化範本 (Templates)**:提供預先驗證的自動化腳本與模板,確保產出的一致性與可靠性。
|
|
13
15
|
3. **架構思維**:強制執行「感知 (Perceive) -> 推理 (Reason) -> 行動 (Act)」的決策迴圈,避免 AI 產生幻覺,確保解決方案的精準度。
|
|
14
16
|
|
|
15
17
|
## ✨ 目前內建技能 (Built-in Skills)
|
|
16
18
|
|
|
17
19
|
### 1. Azure Pipelines 架構師
|
|
18
20
|
自動化設計與生成符合微軟最佳實踐的 CI/CD 流程。
|
|
19
|
-
* **CI
|
|
21
|
+
* **CI 自動化**:針對 .NET 專案生成建置管線,整合單元測試與構件發佈。
|
|
20
22
|
* **CD 自動化**:
|
|
21
|
-
* **Azure App Service
|
|
22
|
-
* **IIS On-Premises
|
|
23
|
+
* **Azure App Service**:部署至Azure App Service。
|
|
24
|
+
* **IIS On-Premises**:部署至地端 IIS 伺服器,包含備份與復原機制。
|
|
23
25
|
|
|
24
26
|
### 2. 智慧 Git 助手
|
|
25
|
-
* **Smart Commit
|
|
27
|
+
* **Smart Commit**:根據 `git diff` 暫存區內容,自動生成符合 Conventional Commits 規範的提交訊息。
|
|
26
28
|
|
|
27
29
|
### 3. Code Review 專家
|
|
28
|
-
*
|
|
30
|
+
* **智能審查**:針對程式碼變更進行多面向 (正確性、安全性、效能、可讀性) 的深度審查。
|
|
29
31
|
|
|
30
32
|
### 4. 程式碼解釋助手
|
|
31
|
-
*
|
|
33
|
+
* **技術解析**:深入分析原始碼或專案結構,提供高階用途摘要、邏輯流程分解以及核心元件說明。
|
|
32
34
|
|
|
33
35
|
### 5. .NET / C# 開發專家
|
|
34
36
|
* **C# 現代語法專家 (`skills/neo-csharp`)**:跨版本 C# 專家 (10-14+),專注於現代化語法、強型別與高效能開發模式。
|
|
@@ -37,7 +39,7 @@
|
|
|
37
39
|
* **.NET Web API 專家 (`skills/neo-dotnet-webapi`)**:提供控制器模式下的架構設計、Problem Details 與異常處理指引。
|
|
38
40
|
* **.NET MVC 專家 (`skills/neo-dotnet-mvc`)**:處理伺服器端渲染 (SSR)、視圖模型與標籤協助程式的最佳實踐。
|
|
39
41
|
* **EF Core 專家 (`skills/neo-dotnet-ef-core`)**:專注於資料庫建模、移轉管理與 Linq 查詢優化。
|
|
40
|
-
* **Interface
|
|
42
|
+
* **Interface 生成器**:針對 C# Class 自動生成符合規範的 Interface,並支援智慧檔案覆蓋功能。
|
|
41
43
|
|
|
42
44
|
### 6. Python 開發與環境管理專家
|
|
43
45
|
* **Python 3.10+ 專家 (`skills/neo-python`)**:專注於 Python 3.10 至 3.14 的現代語法特性、型別安全與非同步開發。
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
* **SwiftUI 專家 (`skills/neo-swift-ui`)**:支援 iOS 16.0+ 與 Swift 5.0+ 的現代開發模式,專注於 NavigationStack、Observation 框架、資料流架構及高效能視圖設計。
|
|
49
51
|
|
|
50
52
|
### 8. 需求釐清助手
|
|
51
|
-
*
|
|
53
|
+
* **需求釐清**:系統化引導用戶釐清模糊需求,並將其轉化為結構化的規格文件(背景、功能、約束、驗收標準)。
|
|
52
54
|
|
|
53
55
|
### 9. 安全守衛 (Security Guard)
|
|
54
56
|
* **主動防護 (`secret-guard.ts`)**:作為 CLI 的中介軟體 (Hook),自動攔截並掃描所有工具執行的參數。若偵測到敏感資訊(如環境設定檔、私鑰、雲端憑證等)將強制阻擋執行,防止機密外洩。
|
|
@@ -59,9 +61,8 @@
|
|
|
59
61
|
|
|
60
62
|
| 層次 | 目錄 | 描述 |
|
|
61
63
|
| :--- | :--- | :--- |
|
|
62
|
-
| **Server** | `src/server.ts` | 擴充套件的進入點,負責註冊 Tool
|
|
64
|
+
| **Server** | `src/server.ts` | 擴充套件的進入點,負責註冊 Tool,處理與 AI Agent CLI 的通訊。 |
|
|
63
65
|
| **Knowledge Base** | `skills/` | **"大腦"**。包含各領域知識 (`SKILL.md`) 與可重用的模板 (`templates/`)。 |
|
|
64
|
-
| **Action Registry** | `commands/` | **"指令集"**。定義了使用者可呼叫的具體指令 (TOML 格式),將請求映射至特定的 Skill。 |
|
|
65
66
|
| **Security Layer** | `src/hooks/` | **"安全守衛"**。攔截並掃描工具執行參數,防止敏感資訊外洩。 |
|
|
66
67
|
|
|
67
68
|
## 📦 安裝與使用
|
|
@@ -74,42 +75,36 @@
|
|
|
74
75
|
gemini extension install https://github.com/Benknightdark/neo-skills --auto-update
|
|
75
76
|
```
|
|
76
77
|
|
|
77
|
-
###
|
|
78
|
+
### 安裝指定 AI Agent 技能
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
npx -p @moon791017/neo-skills install-claude-skills
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Copilot CLI
|
|
80
|
+
使用 `--ai-agent` 指定要安裝的 agent(可用值:`claude`、`copilot`、`codex`):
|
|
84
81
|
|
|
85
82
|
```bash
|
|
86
|
-
npx -p @moon791017/neo-skills install-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
### Codex CLI
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
npx -p @moon791017/neo-skills install-codex-skills
|
|
83
|
+
npx -p @moon791017/neo-skills install-skills --ai-agent claude
|
|
84
|
+
npx -p @moon791017/neo-skills install-skills --ai-agent copilot
|
|
85
|
+
npx -p @moon791017/neo-skills install-skills --ai-agent codex
|
|
93
86
|
```
|
|
94
87
|
|
|
95
88
|
### 安裝至指定專案
|
|
96
89
|
|
|
97
|
-
|
|
90
|
+
搭配 `--project-path` 可將技能安裝至指定專案目錄(技能子目錄會自動附加):
|
|
98
91
|
|
|
99
92
|
```bash
|
|
100
93
|
# 安裝至 /my/project/.claude/skills
|
|
101
|
-
npx -p @moon791017/neo-skills install-
|
|
94
|
+
npx -p @moon791017/neo-skills install-skills --ai-agent claude --project-path /my/project
|
|
102
95
|
|
|
103
96
|
# 安裝至 /my/project/.github/skills
|
|
104
|
-
npx -p @moon791017/neo-skills install-
|
|
97
|
+
npx -p @moon791017/neo-skills install-skills --ai-agent copilot --project-path /my/project
|
|
105
98
|
|
|
106
99
|
# 安裝至 /my/project/.codex/skills
|
|
107
|
-
npx -p @moon791017/neo-skills install-
|
|
100
|
+
npx -p @moon791017/neo-skills install-skills --ai-agent codex --project-path /my/project
|
|
108
101
|
```
|
|
109
102
|
|
|
110
103
|
若未指定 `--project-path`,則安裝至全域路徑(`~/.claude/skills`、`~/.copilot/skills`、`~/.codex/skills`)。
|
|
111
104
|
|
|
112
|
-
### 安裝全部AI Agent技能
|
|
105
|
+
### 安裝全部 AI Agent 技能
|
|
106
|
+
|
|
107
|
+
不帶 `--ai-agent` 即可一次安裝全部:
|
|
113
108
|
|
|
114
109
|
```bash
|
|
115
110
|
npx -p @moon791017/neo-skills install-skills
|
|
@@ -119,15 +114,15 @@ npx -p @moon791017/neo-skills install-skills
|
|
|
119
114
|
|
|
120
115
|
您可以直接對 AI 代理下達以下指令或在對話中描述需求:
|
|
121
116
|
|
|
122
|
-
| 需求場景 |
|
|
117
|
+
| 需求場景 | 推薦咒語範例 |
|
|
123
118
|
| :--- | :--- |
|
|
124
|
-
| **生成 Commit Message** | `幫我 commit 變更`
|
|
125
|
-
| **設定 .NET CI Pipeline** | `幫這個專案設定 CI 流程`
|
|
126
|
-
| **部署至 IIS** | `部署到 IIS,站台名稱為 MySite`
|
|
127
|
-
| **需求釐清與規格化** | `我想做一個電商網站`
|
|
128
|
-
| **全方位程式碼審查** | `幫我 code review 剛才的修改`
|
|
129
|
-
| **生成 C# Interface** | `幫我針對這個 class 產生介面`
|
|
130
|
-
| **技術解析與架構洞察** | `分析這個專案的架構`
|
|
119
|
+
| **生成 Commit Message** | `幫我 commit 變更` |
|
|
120
|
+
| **設定 .NET CI Pipeline** | `幫這個專案設定 CI 流程` |
|
|
121
|
+
| **部署至 IIS** | `部署到 IIS,站台名稱為 MySite` |
|
|
122
|
+
| **需求釐清與規格化** | `我想做一個電商網站` |
|
|
123
|
+
| **全方位程式碼審查** | `幫我 code review 剛才的修改` |
|
|
124
|
+
| **生成 C# Interface** | `幫我針對這個 class 產生介面` |
|
|
125
|
+
| **技術解析與架構洞察** | `分析這個專案的架構` |
|
|
131
126
|
|
|
132
127
|
## 🛠 開發指南
|
|
133
128
|
|
package/bin/_utils.js
CHANGED
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared utilities for agent skill installers.
|
|
3
|
-
*
|
|
4
|
-
* 新增 AI agent 只需兩步:
|
|
5
|
-
* 1. 在 AGENTS 加入設定
|
|
6
|
-
* 2. 建立 bin/install-{key}-skills.js(複製任一現有檔案,改 named export 即可)
|
|
7
3
|
*/
|
|
8
|
-
import { realpathSync } from 'node:fs';
|
|
9
4
|
import { cp, mkdir, access } from 'node:fs/promises';
|
|
10
|
-
import { join, resolve, dirname
|
|
5
|
+
import { join, resolve, dirname } from 'node:path';
|
|
11
6
|
import { homedir } from 'node:os';
|
|
12
7
|
import { fileURLToPath } from 'node:url';
|
|
13
8
|
|
|
14
|
-
const
|
|
15
|
-
const __dirname = dirname(__filename);
|
|
9
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
16
10
|
const packageRoot = resolve(__dirname, '..');
|
|
17
11
|
const sourceDir = join(packageRoot, 'skills');
|
|
18
12
|
|
|
19
13
|
/**
|
|
20
14
|
* Agent 設定中心 — 所有 agent 的安裝參數集中管理於此。
|
|
21
|
-
* key 須與檔名 install-{key}-skills.js 一致。
|
|
22
15
|
*
|
|
23
16
|
* 各欄位說明:
|
|
24
17
|
* name — 顯示用名稱,用於 CLI 輸出的 log 標籤。
|
|
@@ -45,33 +38,8 @@ export const AGENTS = {
|
|
|
45
38
|
homePath: '.codex/skills',
|
|
46
39
|
hint: '請確保您的 Codex CLI 已指向此目錄。',
|
|
47
40
|
},
|
|
48
|
-
// gemini: {
|
|
49
|
-
// name: 'Gemini',
|
|
50
|
-
// homePath: '.gemini/skills/neo-skills',
|
|
51
|
-
// hint: '請確保您的 Gemini CLI 已指向此目錄。',
|
|
52
|
-
// },
|
|
53
41
|
};
|
|
54
42
|
|
|
55
|
-
/**
|
|
56
|
-
* 從 CLI 參數解析 --project-path 值
|
|
57
|
-
* @returns {string | undefined}
|
|
58
|
-
*/
|
|
59
|
-
function parseProjectPath() {
|
|
60
|
-
const idx = process.argv.indexOf('--project-path');
|
|
61
|
-
if (idx === -1 || idx + 1 >= process.argv.length) return undefined;
|
|
62
|
-
return process.argv[idx + 1];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* 從檔名解析 agent key: install-{key}-skills.js → key
|
|
67
|
-
*/
|
|
68
|
-
function extractAgentKey(importMetaUrl) {
|
|
69
|
-
const filename = basename(fileURLToPath(importMetaUrl), '.js');
|
|
70
|
-
const match = filename.match(/^install-(.+)-skills$/);
|
|
71
|
-
if (!match) throw new Error(`無法從檔名 "${filename}" 解析 agent key`);
|
|
72
|
-
return match[1];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
43
|
/**
|
|
76
44
|
* 根據 agent config 建立 installer 函式。
|
|
77
45
|
*
|
|
@@ -85,8 +53,8 @@ function extractAgentKey(importMetaUrl) {
|
|
|
85
53
|
* 3. 最終安裝路徑 = baseDir + subDir
|
|
86
54
|
*
|
|
87
55
|
* 範例(以 Copilot 為例):
|
|
88
|
-
* 預設:
|
|
89
|
-
* --project-path /my/project:
|
|
56
|
+
* 預設: ~/.copilot/skills (homedir + homePath)
|
|
57
|
+
* --project-path /my/project: /my/project/.github/skills (projectPath + projectPath)
|
|
90
58
|
*
|
|
91
59
|
* @param {object} config - AGENTS 中的 agent 設定物件
|
|
92
60
|
* @param {string} [targetPath] - 使用者透過 --project-path 指定的自訂根目錄
|
|
@@ -138,55 +106,3 @@ export function createInstaller({ name: agentName, homePath, projectPath, hint }
|
|
|
138
106
|
return { success: true, message: msg };
|
|
139
107
|
};
|
|
140
108
|
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* 從呼叫端的檔名自動解析 agent,建立對應的 installer。
|
|
144
|
-
* @param {string} importMetaUrl - 呼叫端的 import.meta.url
|
|
145
|
-
* @param {string} [targetPath] - 使用者透過 --project-path 指定的自訂路徑
|
|
146
|
-
*/
|
|
147
|
-
export function createInstallerFromFile(importMetaUrl, targetPath) {
|
|
148
|
-
const key = extractAgentKey(importMetaUrl);
|
|
149
|
-
const config = AGENTS[key];
|
|
150
|
-
if (!config) throw new Error(`未知的 agent: "${key}"。請在 _utils.js 的 AGENTS 中註冊。`);
|
|
151
|
-
return createInstaller(config, targetPath);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* 當腳本被直接執行時(非 import),自動呼叫 installer。
|
|
156
|
-
* Agent 名稱從檔名自動推導。
|
|
157
|
-
* @param {() => Promise<{ success: boolean, message: string }>} installFn
|
|
158
|
-
* @param {string} callerUrl - 呼叫端的 import.meta.url
|
|
159
|
-
*/
|
|
160
|
-
export function runAsMain(installFn, callerUrl) {
|
|
161
|
-
const callerPath = fileURLToPath(callerUrl);
|
|
162
|
-
const argvPath = process.argv[1];
|
|
163
|
-
const isMain = Boolean(argvPath) && (
|
|
164
|
-
resolve(argvPath) === resolve(callerPath) ||
|
|
165
|
-
realpathSync.native(resolve(argvPath)) === realpathSync.native(resolve(callerPath))
|
|
166
|
-
);
|
|
167
|
-
if (!isMain) return;
|
|
168
|
-
|
|
169
|
-
const key = extractAgentKey(callerUrl);
|
|
170
|
-
const agentName = AGENTS[key]?.name || key;
|
|
171
|
-
|
|
172
|
-
process.on('uncaughtException', (err) => {
|
|
173
|
-
console.error('💥 [Fatal Error]:', err);
|
|
174
|
-
process.exit(1);
|
|
175
|
-
});
|
|
176
|
-
process.on('unhandledRejection', (reason) => {
|
|
177
|
-
console.error('💥 [Unhandled Rejection]:', reason);
|
|
178
|
-
process.exit(1);
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
const targetPath = parseProjectPath();
|
|
182
|
-
const actualInstallFn = targetPath
|
|
183
|
-
? createInstallerFromFile(callerUrl, targetPath)
|
|
184
|
-
: installFn;
|
|
185
|
-
|
|
186
|
-
actualInstallFn().then((result) => {
|
|
187
|
-
if (!result.success) process.exit(1);
|
|
188
|
-
}).catch((error) => {
|
|
189
|
-
console.error(`❌ [${agentName}] 安裝失敗:`, error.message || error);
|
|
190
|
-
process.exit(1);
|
|
191
|
-
});
|
|
192
|
-
}
|
package/bin/install-skills.js
CHANGED
|
@@ -1,17 +1,67 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Neo Skills 統一安裝程式
|
|
4
|
+
*
|
|
5
|
+
* 用法:
|
|
6
|
+
* install-skills 安裝全部 AI Agent 技能至 $HOME
|
|
7
|
+
* install-skills --ai-agent claude 只安裝 Claude 技能至 $HOME
|
|
8
|
+
* install-skills --ai-agent copilot --project-path . 安裝 Copilot 技能至指定專案
|
|
9
|
+
*
|
|
10
|
+
* 參數:
|
|
11
|
+
* --ai-agent <name> 指定要安裝的 agent(可用值見 _utils.js 的 AGENTS)。
|
|
12
|
+
* 省略時安裝全部 agent。
|
|
13
|
+
* --project-path <path> 指定專案根目錄作為安裝基底(取代 $HOME)。
|
|
14
|
+
* 省略時安裝至全域路徑。
|
|
15
|
+
*/
|
|
2
16
|
import { AGENTS, createInstaller } from './_utils.js';
|
|
3
17
|
|
|
18
|
+
/**
|
|
19
|
+
* 從 process.argv 解析指定 flag 的值。
|
|
20
|
+
* 例如 parseArg('--ai-agent') 在 argv 含 ['--ai-agent', 'claude'] 時回傳 'claude'。
|
|
21
|
+
* @param {string} flag
|
|
22
|
+
* @returns {string | undefined}
|
|
23
|
+
*/
|
|
24
|
+
function parseArg(flag) {
|
|
25
|
+
const idx = process.argv.indexOf(flag);
|
|
26
|
+
if (idx === -1 || idx + 1 >= process.argv.length) return undefined;
|
|
27
|
+
return process.argv[idx + 1];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 全域錯誤攔截,確保非預期錯誤不會靜默失敗
|
|
4
31
|
process.on('uncaughtException', (err) => {
|
|
5
32
|
console.error('💥 [Fatal Error]:', err);
|
|
6
33
|
process.exit(1);
|
|
7
34
|
});
|
|
8
|
-
|
|
9
35
|
process.on('unhandledRejection', (reason) => {
|
|
10
36
|
console.error('💥 [Unhandled Rejection]:', reason);
|
|
11
37
|
process.exit(1);
|
|
12
38
|
});
|
|
13
39
|
|
|
14
40
|
async function main() {
|
|
41
|
+
// 先統一解析 CLI 參數,後續分支都使用同一份輸入來源,
|
|
42
|
+
// 避免在不同模式中重複讀取 process.argv。
|
|
43
|
+
const agentKey = parseArg('--ai-agent');
|
|
44
|
+
const projectPath = parseArg('--project-path');
|
|
45
|
+
|
|
46
|
+
// ── 模式一:指定單一 agent ──
|
|
47
|
+
if (agentKey) {
|
|
48
|
+
// 以 AGENTS 作為唯一白名單來源,避免使用者輸入未支援的 agent 名稱。
|
|
49
|
+
const config = AGENTS[agentKey];
|
|
50
|
+
if (!config) {
|
|
51
|
+
const valid = Object.keys(AGENTS).join(', ');
|
|
52
|
+
console.error(`❌ 未知的 agent: "${agentKey}"。可用選項: ${valid}`);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// createInstaller 會根據 agent 設定與 projectPath
|
|
57
|
+
// 回傳對應的安裝函式,這裡只需執行一次即可完成單一 agent 安裝。
|
|
58
|
+
const installFn = createInstaller(config, projectPath);
|
|
59
|
+
const result = await installFn();
|
|
60
|
+
if (!result.success) process.exit(1);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ── 模式二:安裝全部 agent ──
|
|
15
65
|
console.log('╔══════════════════════════════════════════╗');
|
|
16
66
|
console.log('║ 🧠 Neo Skills — 統一安裝程式 ║');
|
|
17
67
|
console.log('╚══════════════════════════════════════════╝');
|
|
@@ -19,10 +69,12 @@ async function main() {
|
|
|
19
69
|
|
|
20
70
|
const results = [];
|
|
21
71
|
|
|
22
|
-
|
|
72
|
+
// 未指定 --ai-agent 時,逐一嘗試安裝所有已註冊 agent。
|
|
73
|
+
// 每個 agent 的錯誤都獨立處理,確保單一失敗不會中斷整體彙總流程。
|
|
74
|
+
for (const [, config] of Object.entries(AGENTS)) {
|
|
23
75
|
console.log(`━━━ 正在安裝: ${config.name} ━━━`);
|
|
24
76
|
try {
|
|
25
|
-
const installFn = createInstaller(config);
|
|
77
|
+
const installFn = createInstaller(config, projectPath);
|
|
26
78
|
const result = await installFn();
|
|
27
79
|
results.push({ name: config.name, ...result });
|
|
28
80
|
} catch (error) {
|
|
@@ -37,6 +89,7 @@ async function main() {
|
|
|
37
89
|
console.log('📊 安裝結果彙總:');
|
|
38
90
|
const failed = results.filter(r => !r.success);
|
|
39
91
|
|
|
92
|
+
// 統一列出每個 agent 的最終結果,讓使用者能快速判斷成功與失敗原因。
|
|
40
93
|
for (const r of results) {
|
|
41
94
|
console.log(` ${r.success ? '✅' : '❌'} ${r.name}: ${r.message}`);
|
|
42
95
|
}
|
|
@@ -52,4 +105,5 @@ async function main() {
|
|
|
52
105
|
console.log('🎉 全部安裝完成!');
|
|
53
106
|
}
|
|
54
107
|
|
|
108
|
+
// 以單一入口啟動 CLI,讓所有例外都集中經過上方的全域錯誤處理。
|
|
55
109
|
main();
|
package/gemini-extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moon791017/neo-skills",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Neo Skills: A Universal Expert Agent Extension",
|
|
6
6
|
"homepage": "https://neo-blog-iota.vercel.app/",
|
|
@@ -12,10 +12,7 @@
|
|
|
12
12
|
],
|
|
13
13
|
"bin": {
|
|
14
14
|
"neo-skills": "./bin/install-skills.js",
|
|
15
|
-
"install-skills": "./bin/install-skills.js"
|
|
16
|
-
"install-claude-skills": "./bin/install-claude-skills.js",
|
|
17
|
-
"install-copilot-skills": "./bin/install-copilot-skills.js",
|
|
18
|
-
"install-codex-skills": "./bin/install-codex-skills.js"
|
|
15
|
+
"install-skills": "./bin/install-skills.js"
|
|
19
16
|
},
|
|
20
17
|
"files": [
|
|
21
18
|
"dist",
|
|
@@ -38,7 +35,7 @@
|
|
|
38
35
|
"start": "node dist/server.js",
|
|
39
36
|
"dev": "bun src/server.ts",
|
|
40
37
|
"typecheck": "tsc --noEmit",
|
|
41
|
-
"test": "
|
|
38
|
+
"test": "node --test"
|
|
42
39
|
},
|
|
43
40
|
"devDependencies": {
|
|
44
41
|
"@types/bun": "latest",
|
|
@@ -32,6 +32,8 @@ compatibility: "Supports .NET 6.0 up to .NET 10.0."
|
|
|
32
32
|
* If artifact manipulation is required, prioritize using `util/extract-artifact.yml`.
|
|
33
33
|
|
|
34
34
|
## Act
|
|
35
|
+
|
|
36
|
+
### General Output Standards
|
|
35
37
|
1. Output global YAML configuration scripts that comply with the latest Azure DevOps Schema standards.
|
|
36
38
|
2. Provide comprehensive parameter definitions to increase the flexibility and reusability of Pipeline execution.
|
|
37
39
|
3. Generate configuration recommendations for Environments and Approvals and Checks.
|
|
@@ -42,4 +44,30 @@ compatibility: "Supports .NET 6.0 up to .NET 10.0."
|
|
|
42
44
|
- template: skills/neo-azure-pipelines/templates/build/build-dotnet.yml
|
|
43
45
|
parameters:
|
|
44
46
|
buildConfiguration: 'Release'
|
|
45
|
-
```
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### CI Workflow: .NET Build Pipeline
|
|
50
|
+
When configuring a CI process for a .NET project:
|
|
51
|
+
1. Scan the project directory to identify the .NET version (e.g., .NET 6/8), project name, and solution file (`.sln`).
|
|
52
|
+
2. Check for any existing pipeline configurations.
|
|
53
|
+
3. Create the `.pipelines/templates/build/` and `.pipelines/templates/util/` directories.
|
|
54
|
+
4. Copy `build/build-dotnet.yml` and `util/clean-artifact.yml` templates to their respective locations.
|
|
55
|
+
5. Generate `azure-pipelines-ci.yml` in the project root, ensuring the structure uses proper `template` syntax with correct parameters.
|
|
56
|
+
|
|
57
|
+
### CD Workflow: Azure App Service Deployment
|
|
58
|
+
When configuring a CD process for Azure App Service:
|
|
59
|
+
1. Confirm the Azure App Service name, environment name (e.g., Production/Staging), and Service Connection name with the user or from the project context.
|
|
60
|
+
2. Identify the Build Artifact name.
|
|
61
|
+
3. Copy `deploy/deploy-app-service.yml` to the project's `.pipelines/templates/deploy/` directory.
|
|
62
|
+
4. Generate the deployment pipeline file (e.g., `azure-pipelines-cd-appservice.yml`) in the project root.
|
|
63
|
+
5. Ensure the YAML correctly configures `environment`, `strategy: runOnce`, and template calls.
|
|
64
|
+
6. Advise the user on setting up corresponding Environments and Approvals in Azure DevOps.
|
|
65
|
+
|
|
66
|
+
### CD Workflow: On-Premises IIS Deployment
|
|
67
|
+
When configuring a CD process for on-premises IIS:
|
|
68
|
+
1. Confirm IIS parameters: Website Name, Physical Path, Deployment Group name, and target environment.
|
|
69
|
+
2. Verify if the project requires specific ASP.NET Core environment settings.
|
|
70
|
+
3. Copy the entire `util/iis/` directory and the `deploy/deploy-iis.yml` template to the project's `.pipelines/templates/` directory.
|
|
71
|
+
4. Generate the deployment script (e.g., `azure-pipelines-cd-iis.yml`) in the project root, referencing `deploy-iis.yml` with parameters like `websiteName` and `physicalPath`.
|
|
72
|
+
5. Ensure the script integrates `iis-backup.yml` and `iis-rollback.yml` logic.
|
|
73
|
+
6. Explain the requirements for Service Connection permissions and Deployment Group configuration.
|
|
@@ -17,6 +17,17 @@ description: 系統化引導使用者釐清模糊需求,並將其轉換為結
|
|
|
17
17
|
4. Prioritize questions, focusing first on high-weight questions that affect the architecture and core objectives.
|
|
18
18
|
|
|
19
19
|
## Act
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
|
|
21
|
+
### Output Language
|
|
22
|
+
All output must be in **Traditional Chinese (Taiwan)**.
|
|
23
|
+
|
|
24
|
+
### Phase 1 — Clarification
|
|
25
|
+
When key information is missing, output a maximum of **3 structured questions**. Provide example options for each to reduce the user's cognitive load.
|
|
26
|
+
|
|
27
|
+
### Phase 2 — Convergence
|
|
28
|
+
When information is sufficient, consolidate confirmed information and output a standardized requirement specification document. The document must strictly include the following four dimensions:
|
|
29
|
+
|
|
30
|
+
1. **背景與目的 (Background & Purpose)**
|
|
31
|
+
2. **核心功能 (Core Features)**
|
|
32
|
+
3. **約束條件 (Constraints)**
|
|
33
|
+
4. **驗收標準 (Acceptance Criteria)**
|
|
@@ -6,12 +6,18 @@ description: 分析程式碼變更,從安全性、效能與風格等多個面
|
|
|
6
6
|
# Code Review Specifications
|
|
7
7
|
|
|
8
8
|
## Perceive (Analysis Phase)
|
|
9
|
-
1. **
|
|
9
|
+
1. **Input Handling**:
|
|
10
|
+
- If no specific files or code content is provided, execute `git diff HEAD` to retrieve all staged and unstaged changes.
|
|
11
|
+
- If `git diff` returns empty, inform the user: "No changes detected." and stop.
|
|
12
|
+
- If specific file paths are provided, read those files.
|
|
13
|
+
- If raw code content is provided, use it directly.
|
|
14
|
+
|
|
15
|
+
2. **Scope Identification**:
|
|
10
16
|
- Analyze the provided code diffs or file contents.
|
|
11
17
|
- Identify the languages and frameworks involved (e.g., TypeScript, C#, Python, React).
|
|
12
18
|
- Determine the nature of the change (e.g., Feature, Bugfix, Refactor, Config).
|
|
13
19
|
|
|
14
|
-
|
|
20
|
+
3. **Context Gathering**:
|
|
15
21
|
- Look for surrounding code to understand the impact of changes.
|
|
16
22
|
- Check for relevant configuration files (e.g., `tsconfig.json`, `.eslintrc`, security policies) if available in the provided context.
|
|
17
23
|
|
|
@@ -38,3 +38,4 @@ compatibility: "Supports C# 12/13 and .NET 10.0."
|
|
|
38
38
|
3. **Execution Write**:
|
|
39
39
|
- Based on the user's response, perform `read_file` (if the file exists) -> logical replacement -> `write_file`.
|
|
40
40
|
- Inform the user of the result (created, appended, or overwritten).
|
|
41
|
+
4. **Output Language**: The final output to the user must be in **Traditional Chinese (Taiwan)**.
|
|
@@ -18,10 +18,22 @@ description: 分析原始碼或專案結構,提供技術解析與架構洞察
|
|
|
18
18
|
4. Documentation Alignment: Compare the implementation against common design patterns to explain "why" the code is structured in its current form.
|
|
19
19
|
|
|
20
20
|
## Act
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
|
|
22
|
+
### Output Language
|
|
23
|
+
All output must be in **Traditional Chinese (Taiwan)**.
|
|
24
|
+
|
|
25
|
+
### Output Format
|
|
26
|
+
Structure the response using the following hierarchy:
|
|
27
|
+
|
|
28
|
+
#### 📝 Summary
|
|
29
|
+
High-level purpose and core objectives of the code.
|
|
30
|
+
|
|
31
|
+
#### ⚙️ Logic Flow
|
|
32
|
+
Step-by-step breakdown of execution, explaining data flow or control flow.
|
|
33
|
+
|
|
34
|
+
#### 🧩 Key Components
|
|
35
|
+
Definitions of primary symbols, classes, or functions and their roles.
|
|
36
|
+
|
|
37
|
+
### Additional Rules
|
|
38
|
+
1. Apply syntax highlighting to any code blocks included within the explanation.
|
|
39
|
+
2. If the target file is missing or the content exceeds the model's context window, inform the user accordingly.
|
|
@@ -11,6 +11,7 @@ disable-model-invocation: true
|
|
|
11
11
|
- **Absolute prohibition**: Never execute `git commit` in the same turn you generate the commit message.
|
|
12
12
|
- **Wait for confirmation**: Output the proposed message, then stop immediately and ask the user to confirm.
|
|
13
13
|
- **User-triggered only**: Only execute the commit in the next turn if the user explicitly replies with "yes", "ok", "是", or "commit".
|
|
14
|
+
- **No commit trailers**: Do **not** generate or append any commit trailer lines such as `Co-authored-by:`, `Signed-off-by:`, `Reviewed-by:`, or similar metadata unless the user explicitly requests them.
|
|
14
15
|
|
|
15
16
|
---
|
|
16
17
|
|
|
@@ -66,6 +67,7 @@ Output strictly in the following format:
|
|
|
66
67
|
- For new files, describe their purpose.
|
|
67
68
|
- **Language**: Both Subject and Body must be written in **Traditional Chinese (Taiwan)**.
|
|
68
69
|
- **Tone**: Professional and concise — avoid filler phrases like "This change is for...".
|
|
70
|
+
- **Forbidden content**: Do **not** include `Co-authored-by`, `Signed-off-by`, or any other trailer/footer metadata in the generated commit message.
|
|
69
71
|
|
|
70
72
|
### Step 2: Ask for confirmation
|
|
71
73
|
|
|
@@ -81,4 +83,6 @@ Run:
|
|
|
81
83
|
git commit -m "<subject>" -m "<body>"
|
|
82
84
|
```
|
|
83
85
|
|
|
86
|
+
Do not append any extra trailer/footer metadata unless the user explicitly requests it.
|
|
87
|
+
|
|
84
88
|
After execution, run `git log --oneline -1` and display the result to confirm the commit was created successfully.
|
|
@@ -12,7 +12,7 @@ description: 分析需求與專案現況,並生成詳細的開發執行計畫
|
|
|
12
12
|
|
|
13
13
|
## Reason
|
|
14
14
|
1. **Gap Analysis**: Clearly define the delta between the current codebase state and the user's desired state.
|
|
15
|
-
2. **Architectural Fit**: Ensure the proposed solution aligns with the established architecture (e.g., separating logic into `skills
|
|
15
|
+
2. **Architectural Fit**: Ensure the proposed solution aligns with the established architecture (e.g., separating logic into `skills/`).
|
|
16
16
|
3. **Risk Assessment**: Identify potential breaking changes, ambiguous requirements, or side effects.
|
|
17
17
|
4. **Dependency Chain**: Determine the strictly logical order of operations (e.g., "Create directory before creating file").
|
|
18
18
|
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
description = "為專案自動配置 Azure App Service 的部署流程 (CD)"
|
|
2
|
-
|
|
3
|
-
prompt = """
|
|
4
|
-
Act as a **Senior DevOps Architect** to configure the Continuous Deployment (CD) process for Azure App Service:
|
|
5
|
-
|
|
6
|
-
1. **Perceive**:
|
|
7
|
-
- Read `skills/neo-azure-pipelines/SKILL.md` to load design specifications.
|
|
8
|
-
- Confirm the Azure App Service name, environment name (e.g., Production/Staging), and Service Connection name with the user or from the project context.
|
|
9
|
-
- Identify the Build Artifact name.
|
|
10
|
-
|
|
11
|
-
2. **Reason**:
|
|
12
|
-
- Plan to copy `skills/neo-azure-pipelines/templates/deploy/deploy-app-service.yml` to the project's `.pipelines/templates/deploy/` directory.
|
|
13
|
-
- Design the YAML script referencing the deployment template according to `SKILL.md` standards.
|
|
14
|
-
|
|
15
|
-
3. **Act**:
|
|
16
|
-
- Create directories and copy the deployment templates to the project.
|
|
17
|
-
- Generate the deployment pipeline file (e.g., `azure-pipelines-cd-appservice.yml`) in the project root.
|
|
18
|
-
- Ensure the YAML correctly configures `environment`, `strategy: runOnce`, and template calls.
|
|
19
|
-
- Advise the user on setting up corresponding Environments and Approvals in Azure DevOps.
|
|
20
|
-
"""
|
package/commands/neo/cd-iis.toml
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
description = "為專案自動配置地端 IIS 的部署流程 (CD)"
|
|
2
|
-
|
|
3
|
-
prompt = """
|
|
4
|
-
Act as a **Senior DevOps Architect** to configure the Continuous Deployment (CD) process for On-Premises IIS:
|
|
5
|
-
|
|
6
|
-
1. **Perceive**:
|
|
7
|
-
- Read `skills/neo-azure-pipelines/SKILL.md` to load design specifications.
|
|
8
|
-
- Confirm IIS parameters: Website Name, Physical Path, Deployment Group name, and target environment.
|
|
9
|
-
- Verify if the project requires specific ASP.NET Core environment settings.
|
|
10
|
-
|
|
11
|
-
2. **Reason**:
|
|
12
|
-
- Plan to copy the entire `skills/neo-azure-pipelines/templates/util/iis/` directory and the `deploy/deploy-iis.yml` template.
|
|
13
|
-
- Design a pipeline with staged tasks including backup and rollback logic as required by `SKILL.md`.
|
|
14
|
-
|
|
15
|
-
3. **Act**:
|
|
16
|
-
- Copy all necessary IIS deployment templates to the project's `.pipelines/templates/` directory.
|
|
17
|
-
- Generate the deployment script (e.g., `azure-pipelines-cd-iis.yml`) in the project root, referencing `deploy-iis.yml` with parameters like `websiteName` and `physicalPath`.
|
|
18
|
-
- Ensure the script integrates `iis-backup.yml` and `iis-rollback.yml` logic.
|
|
19
|
-
- Explain the requirements for Service Connection permissions and Deployment Group configuration.
|
|
20
|
-
"""
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
description = "自動配置 .NET 專案的 Azure Pipelines CI 建置流程"
|
|
2
|
-
|
|
3
|
-
prompt = """
|
|
4
|
-
Act as a **Senior DevOps Architect** to configure the Azure Pipelines CI process for this .NET project:
|
|
5
|
-
|
|
6
|
-
1. **Perceive**:
|
|
7
|
-
- Read `skills/neo-azure-pipelines/SKILL.md` to load design specifications.
|
|
8
|
-
- Scan the project directory to identify the .NET version (e.g., .NET 6/8), project name, and solution file (.sln).
|
|
9
|
-
- Check for any existing pipeline configurations.
|
|
10
|
-
|
|
11
|
-
2. **Reason**:
|
|
12
|
-
- Determine the build strategy based on `SKILL.md` guidelines.
|
|
13
|
-
- Plan to copy `skills/neo-azure-pipelines/templates/build/build-dotnet.yml` and relevant `util` templates to the `.pipelines/templates/` directory within the project.
|
|
14
|
-
- Design the main pipeline file (e.g., `azure-pipelines-ci.yml`) to reference these templates with the correct parameters.
|
|
15
|
-
|
|
16
|
-
3. **Act**:
|
|
17
|
-
- Create the `.pipelines/templates/build/` and `.pipelines/templates/util/` directories.
|
|
18
|
-
- Copy `skills/neo-azure-pipelines/templates/build/build-dotnet.yml` and `skills/neo-azure-pipelines/templates/util/clean-artifact.yml` to their respective locations.
|
|
19
|
-
- Generate `azure-pipelines-ci.yml` in the project root, ensuring the structure complies with `SKILL.md` and uses proper `template` syntax.
|
|
20
|
-
- Provide a brief explanation of the configuration and how to use it.
|
|
21
|
-
"""
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
description = "系統化引導用戶釐清模糊需求,並將其轉化為結構化的規格文件。"
|
|
2
|
-
|
|
3
|
-
prompt = """
|
|
4
|
-
# Role: Requirement Clarification Assistant
|
|
5
|
-
|
|
6
|
-
You are an expert Requirement Clarification Assistant. Your goal is to systematically guide users to clarify vague requirements and convert them into structured specification documents.
|
|
7
|
-
|
|
8
|
-
## Mission Context
|
|
9
|
-
The user has provided a requirement or task description:
|
|
10
|
-
> {{args}}
|
|
11
|
-
|
|
12
|
-
You must analyze this input and decide whether to ask clarifying questions or generate a formal specification.
|
|
13
|
-
|
|
14
|
-
## Operational Protocol (Perceive-Reason-Act)
|
|
15
|
-
|
|
16
|
-
1. **Perceive (Context Awareness)**:
|
|
17
|
-
- **Read and internalize the guidelines in `skills/neo-clarification/SKILL.md`.**
|
|
18
|
-
- Identify the professional domain context.
|
|
19
|
-
- Extract confirmed objectives, constraints, and stakeholder information.
|
|
20
|
-
|
|
21
|
-
2. **Reason (Gap Analysis)**:
|
|
22
|
-
- Map information against 5W1H or SMART criteria as defined in the Skill.
|
|
23
|
-
- Identify missing key information, logical conflicts, and undefined boundary conditions.
|
|
24
|
-
- Determine the current phase:
|
|
25
|
-
- **Phase 1 (Clarification)**: If key information is missing.
|
|
26
|
-
- **Phase 2 (Convergence)**: If information is sufficient for a specification.
|
|
27
|
-
|
|
28
|
-
3. **Act (Execution Phase)**:
|
|
29
|
-
- Follow the execution phase rules and formatting defined in `skills/neo-clarification/SKILL.md`.
|
|
30
|
-
- **If Phase 1**: Output a maximum of 3 structured questions. Provide example options for each to reduce the user's cognitive load.
|
|
31
|
-
- **If Phase 2**: Consolidate information and output a standardized requirement specification document.
|
|
32
|
-
|
|
33
|
-
## Strict Output Rules (Traditional Chinese)
|
|
34
|
-
|
|
35
|
-
Please output in **Traditional Chinese (Taiwan)**.
|
|
36
|
-
|
|
37
|
-
### Specification Document Format (Only for Phase 2)
|
|
38
|
-
The specification document must strictly include the four dimensions defined in the Skill:
|
|
39
|
-
- **背景與目的 (Background & Purpose)**
|
|
40
|
-
- **核心功能 (Core Features)**
|
|
41
|
-
- **約束條件 (Constraints)**
|
|
42
|
-
- **驗收標準 (Acceptance Criteria)**
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## User Input
|
|
47
|
-
{{args}}
|
|
48
|
-
"""
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
description = "對當前變更或指定檔案進行全方位的程式碼審查"
|
|
2
|
-
prompt = """
|
|
3
|
-
# Role: Senior Code Reviewer
|
|
4
|
-
|
|
5
|
-
You are an expert Senior Software Engineer and Architect. Your task is to perform a thorough code review based on the provided code changes.
|
|
6
|
-
|
|
7
|
-
## Mission Context
|
|
8
|
-
The user has requested a code review. You will receive the code changes (usually from `git diff` or file contents). You must analyze these changes strictly following the expert guidelines.
|
|
9
|
-
|
|
10
|
-
## Process
|
|
11
|
-
1. **Perceive**: Read and internalize the guidelines in `skills/neo-code-review/SKILL.md`.
|
|
12
|
-
2. **Analyze**: Examine the input code changes in `{{args}}`.
|
|
13
|
-
- If `{{args}}` is empty or generic, assume the input is the current staged and unstaged changes (you may need to ask the user to provide them or run `git diff` yourself if the context isn't automatically provided, but typically the tool wrapper handles this. *Self-correction*: As a prompt for an agent, I should treat `{{args}}` as the text to review. If it's empty, I should instruct the agent to *find* the changes using tools like `run_shell_command("git diff")`.)
|
|
14
|
-
3. **Reason**: Evaluate the code against the dimensions defined in the Skill (Logic, Security, Performance, Maintainability).
|
|
15
|
-
4. **Act**: Output a structured Code Review Report in **Traditional Chinese (Taiwan)**.
|
|
16
|
-
|
|
17
|
-
## Execution Steps for Agent
|
|
18
|
-
If `{{args}}` is empty:
|
|
19
|
-
1. Execute `git diff HEAD` to get all changes (staged and unstaged).
|
|
20
|
-
2. If `git diff` is empty, inform the user "No changes detected."
|
|
21
|
-
3. If changes exist, proceed with the review.
|
|
22
|
-
|
|
23
|
-
If `{{args}}` is NOT empty:
|
|
24
|
-
1. Treat `{{args}}` as the specific file paths or the raw code content to review.
|
|
25
|
-
2. If they are file paths, read them.
|
|
26
|
-
3. Proceed with the review.
|
|
27
|
-
|
|
28
|
-
## Output Format
|
|
29
|
-
Strictly follow the "Act (Reporting Phase)" section in `skills/neo-code-review/SKILL.md`.
|
|
30
|
-
|
|
31
|
-
## Input Data
|
|
32
|
-
User Arguments: {{args}}
|
|
33
|
-
"""
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
description = "針對指定的 C# 類別生成對應的 Interface,並提供智慧覆蓋功能"
|
|
2
|
-
|
|
3
|
-
prompt = """
|
|
4
|
-
# Role: Senior .NET Software Engineer
|
|
5
|
-
|
|
6
|
-
You are a senior engineer proficient in .NET architecture. Your task is to assist users in converting C# Classes to Interfaces, ensuring code quality and project cleanliness.
|
|
7
|
-
|
|
8
|
-
## Mission Context
|
|
9
|
-
The user has provided a C# Class, and you need to generate an Interface for it.
|
|
10
|
-
Target Content: {{args}}
|
|
11
|
-
|
|
12
|
-
## Step 1: Perceive & Reason (Generation Phase)
|
|
13
|
-
1. Refer to the specifications in `skills/neo-csharp-interface-generator/SKILL.md`.
|
|
14
|
-
2. **Strict Filtering**:
|
|
15
|
-
- Extract only `public` properties.
|
|
16
|
-
- **Absolutely no** `virtual` properties.
|
|
17
|
-
- **Getter Only**: All properties must only have `{ get; }`. **Strictly forbid** `{ get; set; }` or any `set`/`init` accessors.
|
|
18
|
-
- The name must be the Class name prefixed with `I`.
|
|
19
|
-
3. Generate the complete Interface code block.
|
|
20
|
-
|
|
21
|
-
## Step 2: Act (Response Phase)
|
|
22
|
-
1. Output the generated Interface code.
|
|
23
|
-
2. **Must explicitly ask**: "In which file should this Interface be stored? (e.g., Interfaces/IUser.cs)".
|
|
24
|
-
|
|
25
|
-
## Step 3: Handle Subsequent Saving (Smart Overwrite)
|
|
26
|
-
When the user provides a path, perform the following:
|
|
27
|
-
1. Check if the file exists.
|
|
28
|
-
2. If it exists, check if it already contains an `interface` with the same name.
|
|
29
|
-
3. If it does, precisely replace that block; otherwise, append or create it.
|
|
30
|
-
4. **The final output to the user MUST be in Traditional Chinese (Taiwan).**
|
|
31
|
-
"""
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
description = "分析原始碼或專案結構,提供技術解析與架構洞察"
|
|
2
|
-
|
|
3
|
-
prompt = """
|
|
4
|
-
# Role: Senior Technical Lead & Architect
|
|
5
|
-
|
|
6
|
-
You are an expert software architect. Your task is to analyze source code or project structures to provide clear, deep technical explanations and architectural insights.
|
|
7
|
-
|
|
8
|
-
## Mission Context
|
|
9
|
-
The user has requested an explanation for:
|
|
10
|
-
> {{args}}
|
|
11
|
-
|
|
12
|
-
## Process
|
|
13
|
-
1. **Perceive**:
|
|
14
|
-
- Read and internalize the guidelines in `skills/neo-explain/SKILL.md`.
|
|
15
|
-
- Identify the target files, directories, or code segments from `{{args}}`.
|
|
16
|
-
- If `{{args}}` is empty, analyze the current active file or project structure as context.
|
|
17
|
-
|
|
18
|
-
2. **Reason**:
|
|
19
|
-
- **Structural Parsing**: Map relationships between variables, functions, and classes in the context.
|
|
20
|
-
- **Logic Synthesis**: Consolidate fragmented code segments into a coherent operational flow.
|
|
21
|
-
- **Contextual Inference**: Evaluate how the specific code block interacts with standard libraries or identified project dependencies.
|
|
22
|
-
- **Design Alignment**: Explain the implementation motivation from the perspective of design patterns.
|
|
23
|
-
|
|
24
|
-
3. **Act**:
|
|
25
|
-
- Provide a structured explanation according to the guidelines in `skills/neo-explain/SKILL.md`.
|
|
26
|
-
- **The output MUST be in Traditional Chinese (Taiwan).**
|
|
27
|
-
|
|
28
|
-
## Output Format
|
|
29
|
-
Please follow this structure:
|
|
30
|
-
|
|
31
|
-
### 📝 Summary
|
|
32
|
-
(Explain the high-level purpose and core objectives of the code)
|
|
33
|
-
|
|
34
|
-
### ⚙️ Logic Flow
|
|
35
|
-
(Step-by-step breakdown of execution, explaining data flow or control flow)
|
|
36
|
-
|
|
37
|
-
### 🧩 Key Components
|
|
38
|
-
(Define primary symbols, classes, or functions and their roles)
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## User Request
|
|
43
|
-
{{args}}
|
|
44
|
-
"""
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
description = "Automatically generate a Conventional Commit message based on staged changes."
|
|
2
|
-
prompt = """
|
|
3
|
-
# Role: Senior Git Commit Message Generator
|
|
4
|
-
|
|
5
|
-
You are a senior software architect with extremely high standards for code quality. Your expertise lies in precisely distilling the core intent of changes from messy code modifications.
|
|
6
|
-
|
|
7
|
-
# CRITICAL SAFETY PROTOCOL
|
|
8
|
-
- **ABSOLUTE PROHIBITION**: You are STRICTLY FORBIDDEN from executing the `git commit` command in the same turn that you generate the commit message.
|
|
9
|
-
- **WAIT FOR CONFIRMATION**: You MUST output the proposed commit message and then STOP. You must explicitly ask the user for confirmation (e.g., "Do you want to execute this commit?").
|
|
10
|
-
- **USER TRIGGER ONLY**: The `run_shell_command` to execute `git commit` can ONLY be triggered in the *next* turn, and ONLY if the user explicitly replies with "yes", "ok", or "commit".
|
|
11
|
-
|
|
12
|
-
## Mission Context
|
|
13
|
-
The command `git add .` has been automatically executed, staging all changes (including new files, modifications, and deletions) in the working directory.
|
|
14
|
-
You will receive the full output of `git diff --staged`. Please analyze these code changes and write a perfectly structured, semantically clear Commit Message.
|
|
15
|
-
|
|
16
|
-
## Analysis Steps
|
|
17
|
-
1. **Holistic Scan**: Identify which files have been added, deleted, or modified.
|
|
18
|
-
2. **Find Correlations**: Determine if these changes serve a single goal (e.g., adding a Model and updating a Service indicates a feature implementation).
|
|
19
|
-
3. **Filter Noise**: Ignore formatting tweaks (like whitespace) and focus on logical changes.
|
|
20
|
-
4. **Define Type**: Choose the type (feat, fix, refactor, etc.) based on the "primary purpose" of the changes.
|
|
21
|
-
|
|
22
|
-
## Strict Output Rules
|
|
23
|
-
1. **Follow Conventional Commits Format**:
|
|
24
|
-
`<type>(<scope>): <subject>`
|
|
25
|
-
|
|
26
|
-
`<body>`
|
|
27
|
-
2. **Language Requirements**:
|
|
28
|
-
- The **Subject** and **Body** MUST be in **Traditional Chinese (Taiwan)**.
|
|
29
|
-
- Use a professional, concise tone; avoid filler words (e.g., "This change is for...").
|
|
30
|
-
3. **Content Requirements**:
|
|
31
|
-
- **Type**: Select the most accurate one from [feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert].
|
|
32
|
-
- **Scope**: (Optional) The module or layer affected (e.g., `auth`, `repo`, `ui`).
|
|
33
|
-
- **Subject**: Maximum 50 characters, use imperative mood (e.g., "新增...", "修復...").
|
|
34
|
-
- **Body**:
|
|
35
|
-
- For complex changes, use bullet points (`-`) to explain specific details.
|
|
36
|
-
- For simple documentation or minor fixes, the Body may be omitted.
|
|
37
|
-
- **For new files**, explain their purpose.
|
|
38
|
-
4. **Output & Confirmation**:
|
|
39
|
-
- **Output** the generated Commit Message in a code block.
|
|
40
|
-
- **STOP IMMEDIATELY**. Do not assume consent.
|
|
41
|
-
- **Ask** the user: "請問是否要執行此 commit?" (Do you want to execute this commit?)
|
|
42
|
-
|
|
43
|
-
5. **Context Isolation**:
|
|
44
|
-
- This workflow is **EXCLUSIVE** to the current `/neo:git-commit` command invocation.
|
|
45
|
-
- In future conversation turns, strictly revert to the standard assistant persona.
|
|
46
|
-
|
|
47
|
-
## Input Data
|
|
48
|
-
{{args}}
|
|
49
|
-
"""
|