@moon791017/neo-skills 1.0.22 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  [![test-on-develop](https://github.com/Benknightdark/neo-skills/actions/workflows/test-on-develop.yml/badge.svg)](https://github.com/Benknightdark/neo-skills/actions/workflows/test-on-develop.yml)
4
4
 
5
+ ![Neo Skills banner](https://raw.githubusercontent.com/Benknightdark/neo-skills/refs/heads/develop/images/banner.png)
6
+
7
+
5
8
  **Neo Skills** 是專為現代 **AI Agent** 設計的**全方位能力擴充套件**。本專案透過標準化的通訊架構,為 AI 代理安裝可插拔的「技能模組 (Skills)」,使其不僅僅是一個聊天機器人,而是能轉化為具備「感知-推理-行動」能力的**多領域專家**。
6
9
 
7
10
  無論是 DevOps 自動化、軟體架構設計,或是未來的資料分析與專案管理,Neo Skills 都能透過掛載不同的知識庫與工具,讓 AI 成為您最強大的全能助手。
@@ -144,15 +147,15 @@ npx -p @moon791017/neo-skills install-skills -y
144
147
  **語法:**
145
148
 
146
149
  ```
147
- install-system-instructions --ai-agent <name> --instructions <key> [--project-path <path>]
150
+ install-system-instructions --instructions <key> [--ai-agent <name>] [--project-path <path>]
148
151
  ```
149
152
 
150
153
  **參數:**
151
154
 
152
155
  | 參數 | 必填 | 說明 |
153
156
  | :--- | :---: | :--- |
154
- | `--ai-agent <name>` | ✅ | 指定目標 Agent(`claude` / `copilot` / `codex`)。 |
155
157
  | `--instructions <key>` | ✅ | 指定要安裝的系統提示詞(見下方種類表)。 |
158
+ | `--ai-agent <name>` | 否 | 指定目標 Agent(`claude` / `copilot` / `codex`)。省略時安裝至全部。 |
156
159
  | `--project-path <path>` | 否 | 指定專案根目錄。省略時安裝至 `$HOME` 全域路徑。 |
157
160
 
158
161
  **指導檔路徑對照:**
@@ -172,6 +175,14 @@ install-system-instructions --ai-agent <name> --instructions <key> [--project-pa
172
175
  **範例:**
173
176
 
174
177
  ```bash
178
+ # 一次安裝至全部 Agent 的全域指導檔
179
+ npx -p @moon791017/neo-skills install-system-instructions \
180
+ --instructions technical-co-founder -y
181
+
182
+ # 安裝至指定 Agent 的全域指導檔 (~/.claude/CLAUDE.md)
183
+ npx -p @moon791017/neo-skills install-system-instructions \
184
+ --ai-agent claude --instructions technical-co-founder -y
185
+
175
186
  # 安裝至專案的 CLAUDE.md
176
187
  npx -p @moon791017/neo-skills install-system-instructions \
177
188
  --ai-agent claude --instructions technical-co-founder --project-path /my/project -y
@@ -179,10 +190,6 @@ npx -p @moon791017/neo-skills install-system-instructions \
179
190
  # 安裝至專案的 .github/copilot-instructions.md
180
191
  npx -p @moon791017/neo-skills install-system-instructions \
181
192
  --ai-agent copilot --instructions technical-co-founder --project-path /my/project -y
182
-
183
- # 安裝至全域 (~/.claude/CLAUDE.md)
184
- npx -p @moon791017/neo-skills install-system-instructions \
185
- --ai-agent claude --instructions technical-co-founder -y
186
193
  ```
187
194
 
188
195
  > **💡** 重複執行相同指令不會重複寫入,系統會自動偵測並跳過已安裝的提示詞。
@@ -1,4 +1,7 @@
1
- export const technicalCoFounderInstructions = `Role:
1
+ export const technicalCoFounderInstructions = `
2
+ When generating commit messages, do not include 'Co-authored-by' or any AI attribution trailers.
3
+
4
+ Role:
2
5
  You are now my Technical Co-Founder. Your job is to help me build a real product I can use, share, or launch. Handle all the building, but keep me in the loop and in control.
3
6
  My Idea:
4
7
  [Describe your product idea — what it does, who it's for, what problem it solves. Explain it like you'd tell a friend.]
@@ -3,11 +3,13 @@
3
3
  * Neo Skills — 系統提示詞安裝程式
4
4
  *
5
5
  * 用法:
6
+ * install-system-instructions --instructions technical-co-founder
6
7
  * install-system-instructions --ai-agent claude --instructions technical-co-founder
7
8
  * install-system-instructions --ai-agent copilot --instructions technical-co-founder --project-path .
8
9
  *
9
10
  * 參數:
10
- * --ai-agent <name> 指定目標 AI Agent(可用值見 _utils.js 的 AGENTS)。必填。
11
+ * --ai-agent <name> 指定目標 AI Agent(可用值見 _utils.js 的 AGENTS)。
12
+ * 省略時安裝至全部已註冊 agent。
11
13
  * --instructions <key> 指定要安裝的系統提示詞(可用值見 _system-instructions.js 的 INSTRUCTIONS)。必填。
12
14
  * --project-path <path> 指定專案根目錄作為安裝基底(取代 $HOME)。省略時安裝至全域路徑。
13
15
  */
@@ -64,45 +66,23 @@ process.on('unhandledRejection', (reason) => {
64
66
  process.exit(1);
65
67
  });
66
68
 
67
- async function main() {
68
- const agentKey = parseArg('--ai-agent');
69
- const projectPath = parseArg('--project-path');
70
- const instructionsKey = parseArg('--instructions');
71
-
72
- // ── 驗證 --ai-agent ──
73
- if (!agentKey) {
74
- const valid = Object.keys(AGENTS).join(', ');
75
- console.error(`❌ 缺少必填參數 --ai-agent。可用選項: ${valid}`);
76
- process.exit(1);
77
- }
78
-
79
- const agentConfig = AGENTS[agentKey];
80
- if (!agentConfig) {
81
- const valid = Object.keys(AGENTS).join(', ');
82
- console.error(`❌ 未知的 agent: "${agentKey}"。可用選項: ${valid}`);
83
- process.exit(1);
84
- }
85
-
69
+ /**
70
+ * 對單一 agent 執行系統提示詞安裝。
71
+ *
72
+ * @param {string} agentKey - AGENTS 中的 key
73
+ * @param {object} agentConfig - AGENTS[agentKey]
74
+ * @param {string} instructionsKey - INSTRUCTIONS 中的 key
75
+ * @param {object} instruction - INSTRUCTIONS[instructionsKey]
76
+ * @param {string | undefined} projectPath - 使用者指定的專案路徑
77
+ * @returns {Promise<{success: boolean, message: string}>}
78
+ */
79
+ async function installForAgent(agentKey, agentConfig, instructionsKey, instruction, projectPath) {
86
80
  if (!agentConfig.instructionFile) {
87
- console.error(`❌ agent "${agentKey}" 未設定 instructionFile。`);
88
- process.exit(1);
81
+ const msg = `agent "${agentKey}" 未設定 instructionFile,跳過。`;
82
+ console.warn(`⚠️ ${msg}`);
83
+ return { success: true, message: msg };
89
84
  }
90
85
 
91
- // ── 驗證 --instructions ──
92
- if (!instructionsKey) {
93
- const valid = Object.keys(INSTRUCTIONS).join(', ');
94
- console.error(`❌ 缺少必填參數 --instructions。可用選項: ${valid}`);
95
- process.exit(1);
96
- }
97
-
98
- const instruction = INSTRUCTIONS[instructionsKey];
99
- if (!instruction) {
100
- const valid = Object.keys(INSTRUCTIONS).join(', ');
101
- console.error(`❌ 未知的 instructions: "${instructionsKey}"。可用選項: ${valid}`);
102
- process.exit(1);
103
- }
104
-
105
- // ── 決定指導檔路徑 ──
106
86
  const { instructionFile } = agentConfig;
107
87
  const baseDir = projectPath ? resolve(projectPath) : homedir();
108
88
  const subPath = projectPath && instructionFile.projectPath
@@ -113,10 +93,8 @@ async function main() {
113
93
  console.log(`🚀 [${agentConfig.name}] 開始安裝系統提示詞: ${instruction.name}`);
114
94
  console.log(`🎯 目標檔案: ${targetFile}`);
115
95
 
116
- // ── 組裝標記包裹的提示詞內容 ──
117
96
  const wrappedContent = wrapContent(instructionsKey, instruction.content);
118
97
 
119
- // ── 檢查指導檔是否已存在 ──
120
98
  let fileExists = false;
121
99
  try {
122
100
  await access(targetFile);
@@ -126,27 +104,104 @@ async function main() {
126
104
  }
127
105
 
128
106
  if (fileExists) {
129
- // 讀取現有內容
130
107
  const existing = await readFile(targetFile, 'utf8');
131
108
 
132
- // 冪等性檢查:如果已包含相同提示詞的標記,則跳過
133
109
  if (existing.includes(startMarker(instructionsKey))) {
134
- console.log(`⏭️ 指導檔中已包含 "${instruction.name}" 提示詞,跳過安裝。`);
135
- return;
110
+ const msg = `指導檔中已包含 "${instruction.name}" 提示詞,跳過安裝。`;
111
+ console.log(`⏭️ ${msg}`);
112
+ return { success: true, message: msg };
136
113
  }
137
114
 
138
- // 附加至最下方
139
115
  const newContent = existing.trimEnd() + '\n\n' + wrappedContent + '\n';
140
116
  await writeFile(targetFile, newContent, 'utf8');
141
- console.log(`✅ [${agentConfig.name}] 已將 "${instruction.name}" 附加至既有指導檔。`);
142
- } else {
143
- // 建立目錄結構
144
- await mkdir(dirname(targetFile), { recursive: true });
145
-
146
- // 建立新檔案並寫入
147
- await writeFile(targetFile, wrappedContent + '\n', 'utf8');
148
- console.log(`✅ [${agentConfig.name}] 已建立指導檔並寫入 "${instruction.name}" 提示詞。`);
117
+ const msg = `已將 "${instruction.name}" 附加至既有指導檔。`;
118
+ console.log(`✅ [${agentConfig.name}] ${msg}`);
119
+ return { success: true, message: msg };
149
120
  }
121
+
122
+ await mkdir(dirname(targetFile), { recursive: true });
123
+ await writeFile(targetFile, wrappedContent + '\n', 'utf8');
124
+ const msg = `已建立指導檔並寫入 "${instruction.name}" 提示詞。`;
125
+ console.log(`✅ [${agentConfig.name}] ${msg}`);
126
+ return { success: true, message: msg };
127
+ }
128
+
129
+ async function main() {
130
+ const agentKey = parseArg('--ai-agent');
131
+ const projectPath = parseArg('--project-path');
132
+ const instructionsKey = parseArg('--instructions');
133
+
134
+ // ── 驗證 --instructions(兩種模式皆需要)──
135
+ if (!instructionsKey) {
136
+ const valid = Object.keys(INSTRUCTIONS).join(', ');
137
+ console.error(`❌ 缺少必填參數 --instructions。可用選項: ${valid}`);
138
+ process.exit(1);
139
+ }
140
+
141
+ const instruction = INSTRUCTIONS[instructionsKey];
142
+ if (!instruction) {
143
+ const valid = Object.keys(INSTRUCTIONS).join(', ');
144
+ console.error(`❌ 未知的 instructions: "${instructionsKey}"。可用選項: ${valid}`);
145
+ process.exit(1);
146
+ }
147
+
148
+ // ── 模式一:指定單一 agent ──
149
+ if (agentKey) {
150
+ const agentConfig = AGENTS[agentKey];
151
+ if (!agentConfig) {
152
+ const valid = Object.keys(AGENTS).join(', ');
153
+ console.error(`❌ 未知的 agent: "${agentKey}"。可用選項: ${valid}`);
154
+ process.exit(1);
155
+ }
156
+
157
+ if (!agentConfig.instructionFile) {
158
+ console.error(`❌ agent "${agentKey}" 未設定 instructionFile。`);
159
+ process.exit(1);
160
+ }
161
+
162
+ const result = await installForAgent(agentKey, agentConfig, instructionsKey, instruction, projectPath);
163
+ if (!result.success) process.exit(1);
164
+ return;
165
+ }
166
+
167
+ // ── 模式二:安裝至全部 agent ──
168
+ console.log('╔══════════════════════════════════════════╗');
169
+ console.log('║ 🧠 Neo Skills — 系統提示詞安裝程式 ║');
170
+ console.log('╚══════════════════════════════════════════╝');
171
+ console.log('');
172
+
173
+ const results = [];
174
+
175
+ for (const [key, config] of Object.entries(AGENTS)) {
176
+ console.log(`━━━ 正在安裝: ${config.name} ━━━`);
177
+ try {
178
+ const result = await installForAgent(key, config, instructionsKey, instruction, projectPath);
179
+ results.push({ name: config.name, ...result });
180
+ } catch (error) {
181
+ console.error(`❌ [${config.name}] 安裝失敗:`, error.message || error);
182
+ results.push({ name: config.name, success: false, message: error.message || String(error) });
183
+ }
184
+ console.log('');
185
+ }
186
+
187
+ // 彙總報告
188
+ console.log('══════════════════════════════════════════');
189
+ console.log('📊 安裝結果彙總:');
190
+ const failed = results.filter(r => !r.success);
191
+
192
+ for (const r of results) {
193
+ console.log(` ${r.success ? '✅' : '❌'} ${r.name}: ${r.message}`);
194
+ }
195
+
196
+ console.log('');
197
+ console.log(`成功: ${results.length - failed.length} / ${results.length}`);
198
+
199
+ if (failed.length > 0) {
200
+ console.log(`失敗: ${failed.length} — ${failed.map(r => r.name).join(', ')}`);
201
+ process.exit(1);
202
+ }
203
+
204
+ console.log('🎉 全部安裝完成!');
150
205
  }
151
206
 
152
207
  main();