@moon791017/neo-skills 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GEMINI.md +115 -0
- package/README.md +155 -0
- package/bin/install-claude-skills.js +72 -0
- package/commands/neo/cd-app-service.toml +20 -0
- package/commands/neo/cd-iis.toml +20 -0
- package/commands/neo/ci-dotnet.toml +21 -0
- package/commands/neo/clarification.toml +48 -0
- package/commands/neo/code-review.toml +33 -0
- package/commands/neo/dotnet-gen-interface.toml +31 -0
- package/commands/neo/explain.toml +44 -0
- package/commands/neo/git-commit.toml +49 -0
- package/dist/hooks/secret-guard.js +2 -0
- package/dist/server.js +220 -0
- package/gemini-extension.json +15 -0
- package/package.json +39 -0
- package/skills/azure-pipelines/SKILL.md +45 -0
- package/skills/azure-pipelines/templates/build/build-dotnet.yml +92 -0
- package/skills/azure-pipelines/templates/deploy/deploy-app-service.yml +71 -0
- package/skills/azure-pipelines/templates/deploy/deploy-iis.yml +189 -0
- package/skills/azure-pipelines/templates/util/clean-artifact.yml +40 -0
- package/skills/azure-pipelines/templates/util/extract-artifact.yml +57 -0
- package/skills/azure-pipelines/templates/util/iis/iis-backup.yml +92 -0
- package/skills/azure-pipelines/templates/util/iis/iis-deploy-files.yml +112 -0
- package/skills/azure-pipelines/templates/util/iis/iis-manage-website.yml +112 -0
- package/skills/azure-pipelines/templates/util/iis/iis-rollback.yml +98 -0
- package/skills/azure-pipelines/templates/util/iis/iis-start-website.yml +89 -0
- package/skills/azure-pipelines/templates/util/iis/iis-stop-website.yml +80 -0
- package/skills/azure-pipelines/templates/util/iis/iis-task.yml +157 -0
- package/skills/azure-pipelines/templates/util/set-aspnetcore-env.yml +77 -0
- package/skills/clarification/SKILL.md +22 -0
- package/skills/code-review/SKILL.md +72 -0
- package/skills/csharp/SKILL.md +87 -0
- package/skills/csharp/reference/anti-patterns.md +142 -0
- package/skills/csharp/reference/coding-style.md +86 -0
- package/skills/csharp/reference/patterns.md +142 -0
- package/skills/csharp-interface-generator/SKILL.md +40 -0
- package/skills/dotnet/SKILL.md +41 -0
- package/skills/dotnet-ef-core/SKILL.md +78 -0
- package/skills/dotnet-ef-core/reference/anti-patterns.md +51 -0
- package/skills/dotnet-ef-core/reference/coding-style.md +42 -0
- package/skills/dotnet-ef-core/reference/patterns.md +53 -0
- package/skills/dotnet-minimal-apis/SKILL.md +78 -0
- package/skills/dotnet-minimal-apis/reference/anti-patterns.md +59 -0
- package/skills/dotnet-minimal-apis/reference/coding-style.md +54 -0
- package/skills/dotnet-minimal-apis/reference/patterns.md +68 -0
- package/skills/dotnet-mvc/SKILL.md +78 -0
- package/skills/dotnet-mvc/reference/anti-patterns.md +49 -0
- package/skills/dotnet-mvc/reference/coding-style.md +43 -0
- package/skills/dotnet-mvc/reference/patterns.md +56 -0
- package/skills/dotnet-webapi/SKILL.md +78 -0
- package/skills/dotnet-webapi/reference/anti-patterns.md +48 -0
- package/skills/dotnet-webapi/reference/coding-style.md +47 -0
- package/skills/dotnet-webapi/reference/patterns.md +52 -0
- package/skills/explain/SKILL.md +27 -0
- package/skills/git-commit/SKILL.md +84 -0
- package/skills/python/SKILL.md +61 -0
- package/skills/python/reference/anti-patterns.md +177 -0
- package/skills/python/reference/coding-style.md +92 -0
- package/skills/python/reference/patterns.md +112 -0
- package/skills/python-manager/SKILL.md +61 -0
- package/skills/start-plan/SKILL.md +29 -0
- package/skills/swift/SKILL.md +78 -0
- package/skills/swift/reference/anti-patterns.md +75 -0
- package/skills/swift/reference/coding-style.md +56 -0
- package/skills/swift/reference/patterns.md +94 -0
- package/skills/swift-ui/SKILL.md +76 -0
- package/skills/swift-ui/reference/anti-patterns.md +52 -0
- package/skills/swift-ui/reference/coding-style.md +46 -0
- package/skills/swift-ui/reference/patterns.md +87 -0
package/GEMINI.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
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") and automated execution protocols ("Commands"). 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 command definitions (`.toml`).
|
|
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
|
+
* Registers **Prompts** (e.g., `neo:git_commit`) which are dynamic templates that inject context and instructions into the chat session.
|
|
27
|
+
|
|
28
|
+
### 2. The Knowledge Base (`skills/`)
|
|
29
|
+
Each subdirectory represents a "Skill Module" containing expert knowledge.
|
|
30
|
+
* **Structure:**
|
|
31
|
+
* `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.
|
|
32
|
+
* `templates/`: The "Hands". A library of reusable assets that the agent should use instead of writing code from scratch.
|
|
33
|
+
* **Example:** `skills/azure-pipelines/` contains logic for designing CI/CD pipelines and templates for .NET builds, IIS deployments, etc.
|
|
34
|
+
|
|
35
|
+
### 3. The Action Registry (`commands/`)
|
|
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/`)
|
|
41
|
+
Mechanisms to ensure operational safety and data privacy.
|
|
42
|
+
* **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
|
+
|
|
44
|
+
## 🛠 Building and Running
|
|
45
|
+
|
|
46
|
+
This project uses **Bun** for development and building, and **Node.js** for the runtime environment.
|
|
47
|
+
|
|
48
|
+
### Prerequisites
|
|
49
|
+
* Node.js (v18+)
|
|
50
|
+
* Bun
|
|
51
|
+
|
|
52
|
+
### Commands
|
|
53
|
+
|
|
54
|
+
* **Install Dependencies:**
|
|
55
|
+
```bash
|
|
56
|
+
npm install
|
|
57
|
+
```
|
|
58
|
+
* **Build Project:**
|
|
59
|
+
```bash
|
|
60
|
+
bun run build
|
|
61
|
+
```
|
|
62
|
+
*This cleans the `dist` folder and bundles `src/server.ts` into `dist/server.js`.*
|
|
63
|
+
* **Development Mode:**
|
|
64
|
+
```bash
|
|
65
|
+
bun src/server.ts
|
|
66
|
+
```
|
|
67
|
+
* **Type Check:**
|
|
68
|
+
```bash
|
|
69
|
+
bun run typecheck
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 🧩 Extension Configuration
|
|
73
|
+
|
|
74
|
+
The extension is defined in `gemini-extension.json`:
|
|
75
|
+
* **Name:** `neo-skills`
|
|
76
|
+
* **Entry Point:** `dist/server.js`
|
|
77
|
+
* **Context File:** `GEMINI.md` (This file)
|
|
78
|
+
|
|
79
|
+
## 💡 Usage Philosophy
|
|
80
|
+
|
|
81
|
+
When interacting with this codebase or using the extension, the agent follows the **Perceive-Reason-Act** protocol:
|
|
82
|
+
|
|
83
|
+
1. **Perceive:** Analyze the user's project context (languages, frameworks, existing config).
|
|
84
|
+
2. **Reason:** Consult the internal knowledge base (`SKILL.md`) to formulate a strategy.
|
|
85
|
+
3. **Act:** Execute the workflow, prioritizing the use of existing templates in `skills/**/templates/` over generating new code.
|
|
86
|
+
|
|
87
|
+
### Available Capabilities (Current Built-in Skills)
|
|
88
|
+
|
|
89
|
+
* **Web Scraper:** 從指定的 URL 獲取網頁 HTML 內容,支援 CSS 選擇器 (`fetch_web_content`)。
|
|
90
|
+
|
|
91
|
+
* **Git Automation:** Automatically generate Conventional Commit messages in English and ask for confirmation before committing (`neo:git_commit`).
|
|
92
|
+
|
|
93
|
+
* **CI Protocols:** 自動配置 .NET 專案的 Azure Pipelines CI 建置流程 (`neo:ci-dotnet`)。
|
|
94
|
+
|
|
95
|
+
* **CD Protocols:** 為專案自動配置 Azure App Service (`neo:cd-app-service`) 與地端 IIS (`neo:cd-iis`) 的部署流程 (CD)。
|
|
96
|
+
|
|
97
|
+
* **Requirement Clarification:** 系統化引導用戶釐清模糊需求,並將其轉化為結構化的規格文件 (`neo:clarification`)。
|
|
98
|
+
|
|
99
|
+
* **Code Explanation:** 分析原始碼或專案結構,提供技術解析與架構洞察 (`neo:explain`)。
|
|
100
|
+
|
|
101
|
+
* **Code Review:** 對當前變更或指定檔案進行全方位的程式碼審查 (`neo:code-review`)。
|
|
102
|
+
|
|
103
|
+
* **C# 現代語法專家:** 跨版本 C# 專家 (10-14+),專注於現代化語法、強型別與高效能開發模式。
|
|
104
|
+
|
|
105
|
+
* **.NET 開發專家群:** 包含核心環境路由,以及針對 Minimal APIs、Web API、MVC 與 EF Core 的深度技術指引與開發規範。
|
|
106
|
+
|
|
107
|
+
* **C# Interface Generation:** 針對指定的 C# 類別生成對應的 Interface,並提供智慧覆蓋功能 (`neo:dotnet-gen-interface`)。
|
|
108
|
+
|
|
109
|
+
* **Python 3.10+ 現代開發專家:** 專注於 Python 3.10 至 3.14 的現代語法特性、型別安全與非同步開發。
|
|
110
|
+
|
|
111
|
+
* **Python 環境管理專家:** 智慧偵測並管理 Python 專案的虛擬環境與相依套件工具(支援 uv, Poetry, venv/pip)。
|
|
112
|
+
|
|
113
|
+
* **Swift 專家:** 支援 Swift 5.0 至 6.0+ 的現代開發模式,涵蓋 SwiftUI、Structured Concurrency 與記憶體安全。
|
|
114
|
+
|
|
115
|
+
* **SwiftUI 專家:** 支援 iOS 16.0+ 與 Swift 5.0+ 的現代開發模式,專注於 NavigationStack、Observation 框架、資料流架構及高效能視圖設計。
|
package/README.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Neo Skills
|
|
2
|
+
|
|
3
|
+
**Neo Skills** 是專為現代 **AI Agent** 設計的**全方位能力擴充套件**。本專案透過標準化的通訊架構,為 AI 代理安裝可插拔的「技能模組 (Skills)」,使其不僅僅是一個聊天機器人,而是能轉化為具備「感知-推理-行動」能力的**多領域專家**。
|
|
4
|
+
|
|
5
|
+
無論是 DevOps 自動化、軟體架構設計,或是未來的資料分析與專案管理,Neo Skills 都能透過掛載不同的知識庫與工具,讓 AI 成為您最強大的全能助手。
|
|
6
|
+
|
|
7
|
+
## 🚀 核心願景
|
|
8
|
+
|
|
9
|
+
本專案作為 AI Agent 的「大腦皮層 (Cortex)」,旨在打造一個**全能型 Agent 框架**,透過以下機制提升 AI 的專業度:
|
|
10
|
+
|
|
11
|
+
1. **領域專精 (Skills)**:可擴充的專家知識庫 (`SKILL.md`)。目前已內建 DevOps 模組,未來將持續擴增更多領域。
|
|
12
|
+
2. **標準化執行 (Commands)**:提供預先驗證的自動化腳本與模板,確保產出的一致性與可靠性。
|
|
13
|
+
3. **架構思維**:強制執行「感知 (Perceive) -> 推理 (Reason) -> 行動 (Act)」的決策迴圈,避免 AI 產生幻覺,確保解決方案的精準度。
|
|
14
|
+
|
|
15
|
+
## ✨ 目前內建技能 (Built-in Skills)
|
|
16
|
+
|
|
17
|
+
### 1. Azure Pipelines 架構師
|
|
18
|
+
自動化設計與生成符合微軟最佳實踐的 CI/CD 流程。
|
|
19
|
+
* **CI 自動化 (`neo:ci-dotnet`)**:針對 .NET 專案生成建置管線,整合單元測試與構件發佈。
|
|
20
|
+
* **CD 自動化**:
|
|
21
|
+
* **Azure App Service (`neo:cd-app-service`)**:部署至Azure App Service。
|
|
22
|
+
* **IIS On-Premises (`neo:cd-iis`)**:部署至地端 IIS 伺服器,包含備份與復原機制。
|
|
23
|
+
|
|
24
|
+
### 2. 智慧 Git 助手
|
|
25
|
+
* **Smart Commit (`neo:git_commit`)**:根據 `git diff` 暫存區內容,自動生成符合 Conventional Commits 規範的提交訊息。
|
|
26
|
+
|
|
27
|
+
### 3. Code Review 專家
|
|
28
|
+
* **智能審查 (`neo:code-review`)**:針對程式碼變更進行多面向 (正確性、安全性、效能、可讀性) 的深度審查。
|
|
29
|
+
|
|
30
|
+
### 4. 程式碼解釋助手
|
|
31
|
+
* **技術解析 (`neo:explain`)**:深入分析原始碼或專案結構,提供高階用途摘要、邏輯流程分解以及核心元件說明。
|
|
32
|
+
|
|
33
|
+
### 5. .NET / C# 開發專家
|
|
34
|
+
* **C# 現代語法專家 (`skills/csharp`)**:跨版本 C# 專家 (10-14+),專注於現代化語法、強型別與高效能開發模式。
|
|
35
|
+
* **.NET 核心路由 (`skills/dotnet`)**:環境偵測與統一入口,自動將任務委派給最合適的子領域專家。
|
|
36
|
+
* **.NET Minimal APIs 專家 (`skills/dotnet-minimal-apis`)**:專注於高效能微服務、路由群組與 Typed Results。
|
|
37
|
+
* **.NET Web API 專家 (`skills/dotnet-webapi`)**:提供控制器模式下的架構設計、Problem Details 與異常處理指引。
|
|
38
|
+
* **.NET MVC 專家 (`skills/dotnet-mvc`)**:處理伺服器端渲染 (SSR)、視圖模型與標籤協助程式的最佳實踐。
|
|
39
|
+
* **EF Core 專家 (`skills/dotnet-ef-core`)**:專注於資料庫建模、移轉管理與 Linq 查詢優化。
|
|
40
|
+
* **Interface 生成器 (`neo:dotnet-gen-interface`)**:針對 C# Class 自動生成符合規範的 Interface,並支援智慧檔案覆蓋功能。
|
|
41
|
+
|
|
42
|
+
### 6. Python 開發與環境管理專家
|
|
43
|
+
* **Python 3.10+ 專家 (`skills/python`)**:專注於 Python 3.10 至 3.14 的現代語法特性、型別安全與非同步開發。
|
|
44
|
+
* **環境管理專家 (`skills/python-manager`)**:智慧偵測與管理 Python 專案環境,支援 uv, Poetry, venv/pip 並提供自動化安裝建議。
|
|
45
|
+
|
|
46
|
+
### 7. Swift 開發專家
|
|
47
|
+
* **Swift 5.0+ 專家 (`skills/swift`)**:支援從基礎語法到 Swift 6 的現代開發模式,涵蓋 SwiftUI、Structured Concurrency、記憶體安全以及高效能 App 開發指引。
|
|
48
|
+
* **SwiftUI 專家 (`skills/swift-ui`)**:支援 iOS 16.0+ 與 Swift 5.0+ 的現代開發模式,專注於 NavigationStack、Observation 框架、資料流架構及高效能視圖設計。
|
|
49
|
+
|
|
50
|
+
### 8. 需求釐清助手
|
|
51
|
+
* **需求釐清 (`neo:clarification`)**:系統化引導用戶釐清模糊需求,並將其轉化為結構化的規格文件(背景、功能、約束、驗收標準)。
|
|
52
|
+
|
|
53
|
+
### 9. 安全守衛 (Security Guard)
|
|
54
|
+
* **主動防護 (`secret-guard.ts`)**:作為 CLI 的中介軟體 (Hook),自動攔截並掃描所有工具執行的參數。若偵測到敏感資訊(如環境設定檔、私鑰、雲端憑證等)將強制阻擋執行,防止機密外洩。
|
|
55
|
+
|
|
56
|
+
## 📂 系統架構
|
|
57
|
+
|
|
58
|
+
本專案由三個核心層次組成,支援無限擴充:
|
|
59
|
+
|
|
60
|
+
| 層次 | 目錄 | 描述 |
|
|
61
|
+
| :--- | :--- | :--- |
|
|
62
|
+
| **Server** | `src/server.ts` | 擴充套件的進入點,負責註冊 Tool 與 Prompt,處理與 AI Agent CLI 的通訊。 |
|
|
63
|
+
| **Knowledge Base** | `skills/` | **"大腦"**。包含各領域知識 (`SKILL.md`) 與可重用的模板 (`templates/`)。 |
|
|
64
|
+
| **Action Registry** | `commands/` | **"指令集"**。定義了使用者可呼叫的具體指令 (TOML 格式),將請求映射至特定的 Skill。 |
|
|
65
|
+
| **Security Layer** | `src/hooks/` | **"安全守衛"**。攔截並掃描工具執行參數,防止敏感資訊外洩。 |
|
|
66
|
+
|
|
67
|
+
## 📦 安裝與使用
|
|
68
|
+
|
|
69
|
+
本套件目前支援多種 AI Agent CLI 環境。
|
|
70
|
+
|
|
71
|
+
### 1. Claude Code (或其餘 Agent)
|
|
72
|
+
|
|
73
|
+
#### 方案 A:透過 Claude Code CLI 安裝
|
|
74
|
+
這是最簡單的方式,直接讓 Claude Code 管理擴充:
|
|
75
|
+
```bash
|
|
76
|
+
claude plugin add https://github.com/Benknightdark/neo-skills
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### 方案 B:透過 git clone 後手動安裝
|
|
80
|
+
```bash
|
|
81
|
+
# 使用 npx 直接執行安裝指令
|
|
82
|
+
git clone https://github.com/Benknightdark/neo-skills.git
|
|
83
|
+
cd neo-skills
|
|
84
|
+
npm install
|
|
85
|
+
node ./bin/install-claude-skills.js
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 2. Gemini CLI 安裝方式 (需安裝 Bun)
|
|
89
|
+
此方式會執行 MCP Server,因此需要先建置專案:
|
|
90
|
+
```bash
|
|
91
|
+
gemini extension install https://github.com/Benknightdark/neo-skills --auto-update
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
或在配置檔案中手動進行本地路徑配置:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"name": "neo-skills",
|
|
99
|
+
"mcpServers": {
|
|
100
|
+
"neo-skills": {
|
|
101
|
+
"command": "node",
|
|
102
|
+
"args": ["${extensionPath}/dist/server.js"]
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## 💡 常用指令範例
|
|
109
|
+
|
|
110
|
+
您可以直接對 AI 代理下達以下指令:
|
|
111
|
+
|
|
112
|
+
* **生成 Commit Message**:
|
|
113
|
+
> "幫我 commit 這些變更" 或 `/neo:git-commit`
|
|
114
|
+
* **設定 .NET CI Pipeline**:
|
|
115
|
+
> "幫這個專案設定 CI 流程" 或 `/neo:ci-dotnet`
|
|
116
|
+
* **部署至 IIS**:
|
|
117
|
+
> "我要部署到 IIS,站台名稱是 MySite" 或 `/neo:cd-iis`
|
|
118
|
+
* **釐清模糊需求**:
|
|
119
|
+
> "我想做一個電商網站" 或 `/neo:clarification`
|
|
120
|
+
* **程式碼審查**:
|
|
121
|
+
> "幫我 code review 剛才的修改" 或 `/neo:code-review`
|
|
122
|
+
* **生成 C# Interface**:
|
|
123
|
+
> "幫我針對這個 class 產生介面" 或 `/neo:dotnet-gen-interface`
|
|
124
|
+
|
|
125
|
+
## 🛠 開發指南
|
|
126
|
+
|
|
127
|
+
本專案使用 **Bun** 進行開發與建置。
|
|
128
|
+
|
|
129
|
+
### 前置需求
|
|
130
|
+
* **[Node.js](https://nodejs.org/) (v18+)**:基本執行環境。
|
|
131
|
+
* **[Bun](https://bun.sh/)**:僅在**開發**、**建置**或執行 **Gemini MCP Server** 時需要。
|
|
132
|
+
|
|
133
|
+
### 快速開始
|
|
134
|
+
|
|
135
|
+
1. **安裝依賴**
|
|
136
|
+
```bash
|
|
137
|
+
npm install
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
2. **開發模式 (Watch Mode)**
|
|
141
|
+
直接執行原始碼進行測試:
|
|
142
|
+
```bash
|
|
143
|
+
bun src/server.ts
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
3. **建置專案**
|
|
147
|
+
將 TypeScript 編譯並打包至 `dist/` 目錄:
|
|
148
|
+
```bash
|
|
149
|
+
bun run build
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
4. **類型檢查**
|
|
153
|
+
```bash
|
|
154
|
+
bun run typecheck
|
|
155
|
+
```
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { cp, mkdir, access } from 'node:fs/promises';
|
|
3
|
+
import { join, resolve, dirname } from 'node:path';
|
|
4
|
+
import { homedir } from 'node:os';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
// 立即輸出日誌以確認腳本已啟動
|
|
8
|
+
console.log('🏁 [Debug] 腳本已啟動...');
|
|
9
|
+
|
|
10
|
+
// 捕捉全域錯誤
|
|
11
|
+
process.on('uncaughtException', (err) => {
|
|
12
|
+
console.error('💥 [Fatal Error]:', err);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
process.on('unhandledRejection', (reason, promise) => {
|
|
17
|
+
console.error('💥 [Unhandled Rejection]:', reason);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// 取得當前檔案路徑
|
|
22
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
23
|
+
const __dirname = dirname(__filename);
|
|
24
|
+
|
|
25
|
+
async function installClaudeSkills() {
|
|
26
|
+
try {
|
|
27
|
+
// 1. 定義來源目錄: 腳本所在目錄的上一層的 skills 資料夾
|
|
28
|
+
// 當透過 npx 執行時,它會指向臨時下載的 package 內容
|
|
29
|
+
const packageRoot = resolve(__dirname, '..');
|
|
30
|
+
const sourceDir = join(packageRoot, 'skills');
|
|
31
|
+
|
|
32
|
+
// 2. 定義目標目錄: ~/.claude/skills (跨平台自動處理)
|
|
33
|
+
const targetBaseDir = join(homedir(), '.claude');
|
|
34
|
+
const targetSkillsDir = join(targetBaseDir, 'skills');
|
|
35
|
+
|
|
36
|
+
console.log('🚀 [Claude] 開始同步 Neo Skills...');
|
|
37
|
+
|
|
38
|
+
// 檢查來源是否存在
|
|
39
|
+
try {
|
|
40
|
+
await access(sourceDir);
|
|
41
|
+
} catch {
|
|
42
|
+
console.error(`❌ 錯誤: 在 ${sourceDir} 找不到來源技能目錄。`);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
console.log(`📁 來源路徑: ${sourceDir}`);
|
|
47
|
+
console.log(`🎯 目標路徑: ${targetSkillsDir}`);
|
|
48
|
+
|
|
49
|
+
// 3. 確保目標目錄存在 (recursive: true 會自動建立多層目錄)
|
|
50
|
+
await mkdir(targetSkillsDir, { recursive: true });
|
|
51
|
+
|
|
52
|
+
// 4. 執行複製
|
|
53
|
+
await cp(sourceDir, targetSkillsDir, {
|
|
54
|
+
recursive: true,
|
|
55
|
+
force: true,
|
|
56
|
+
// 過濾掉不必要的開發檔案
|
|
57
|
+
filter: (src) => {
|
|
58
|
+
const isIgnored = src.includes('node_modules') || src.includes('.git');
|
|
59
|
+
return !isIgnored;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
console.log('✅ [Claude] 安裝成功!技能已同步至 .claude/skills');
|
|
64
|
+
console.log('💡 提示: 請確保您的 Claude Desktop 或相關插件已指向此目錄。');
|
|
65
|
+
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.error('❌ [Claude] 安裝失敗:', error.message || error);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
installClaudeSkills();
|
|
@@ -0,0 +1,20 @@
|
|
|
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/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/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
|
+
"""
|
|
@@ -0,0 +1,20 @@
|
|
|
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/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/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
|
+
"""
|
|
@@ -0,0 +1,21 @@
|
|
|
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/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/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/azure-pipelines/templates/build/build-dotnet.yml` and `skills/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
|
+
"""
|
|
@@ -0,0 +1,48 @@
|
|
|
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/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/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
|
+
"""
|
|
@@ -0,0 +1,33 @@
|
|
|
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/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/code-review/SKILL.md`.
|
|
30
|
+
|
|
31
|
+
## Input Data
|
|
32
|
+
User Arguments: {{args}}
|
|
33
|
+
"""
|
|
@@ -0,0 +1,31 @@
|
|
|
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/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
|
+
"""
|
|
@@ -0,0 +1,44 @@
|
|
|
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/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/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
|
+
"""
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
"""
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var b=(g)=>new RegExp(g,"i"),Q=[b("\\.env"),b("\\.pem\\b"),b("\\.key\\b"),b("\\.git[/\\\\]"),b("\\bid_rsa"),b("credentials\\.json"),b("launchSettings\\.json"),b("\\bsecrets?[/\\\\]")];async function U(){try{let z=(await new Promise((q,K)=>{let D=[];process.stdin.on("data",(M)=>D.push(M)),process.stdin.on("end",()=>q(Buffer.concat(D))),process.stdin.on("error",K)})).toString("utf-8").trim();if(!z)throw Error("No input received from Gemini CLI.");for(let q of Q)if(q.test(z))process.stdout.write(JSON.stringify({decision:"deny",reason:"Security Alert: Access to sensitive file matching pattern is blocked by Neo Skills Secret Guard.",systemMessage:"\uD83D\uDD12 Security Alert: Sensitive data access blocked."})),process.exit(0);process.stdout.write(JSON.stringify({decision:"allow"})),process.exit(0)}catch(g){console.error(`[Fail-safe] Secret Guard Internal Error: ${g?.message||g}`),process.exit(2)}}U();
|