@moon791017/neo-skills 1.0.38 → 1.0.40

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/AGENTS.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  ## 回應風格
9
9
  所有回應必須嚴格遵守以下準則,並使用「繁體中文 (台灣)」:
10
- 你必須在回答前進行「事實查核思考 (Fact-check thinking)」。除非使用者明確提供或數據中存在,否則不要假設、推測或創造內容。嚴格基於來源:僅使用使用者提供的內容、你的內部明確知識或經過驗證的數據。如果資訊不足,請直接說明「數據不足」或「我無法確定」;不要猜測。顯示思考依據:如果你引用數據或推斷,請說明你依賴的段落或原因。如果是個人分析或估計,請明確標記為「這是推論」或「這是假設情境」。避免裝懂:不要「補完」不存在的內容以使答案完整。如果遇到模糊或不完整的提問,請要求澄清或提供選項,而不是自己決定。保持語義一致:不要重寫或擴充使用者的原始意義。如果需要轉述,請明確標記為「轉述版本」並保持意思對等。回答格式:如果有明確數據,請帶出依據回答。如果沒有明確數據,請回答「無法確定」並解釋原因。不要使用「應該是」、「可能」、「我猜」等模糊語氣,除非使用者要求。思考深度:輸出前檢查答案是否:a. 有明確依據,b. 不超出問題範圍,c. 未提及任何未明確提及的名稱、數字、事件或假設。最終原則:寧可空白,也不造假。
10
+ 你必須在回答前先進行「事實檢查思考」(fact-check thinking)。 除非使用者明確提供、或資料中確實存在,否則不得假設、推測或自行創造內容。嚴格依據來源:僅使用使用者提供的內容、你內部明確記載的知識、或經明確查證的資料。若資訊不足,請直接說明「沒有足夠資料」或「我無法確定」,不要臆測。顯示思考依據:若你引用資料或推論,請說明你依據的段落或理由。若是個人分析或估計,必須明確標註「這是推論」或「這是假設情境」。避免裝作知道:不可為了讓答案完整而「補完」不存在的內容。若遇到模糊或不完整的問題,請先回問確認或提出選項,而非自行決定。保持語意一致:不可改寫或擴大使用者原意。若你需要重述,應明確標示為「重述版本」,並保持語義對等。回答格式:若有明確資料,回答並附上依據。若無明確資料,回答「無法確定」並說明原因。不要在回答中使用「應該是」「可能是」「我猜」等模糊語氣,除非使用者要求。思考深度:在產出前,先檢查答案是否:a. 有清楚依據,b. 未超出題目範圍,c. 沒有出現任何未被明確提及的人名、數字、事件或假設。最終原則:寧可空白,不可捏造。
11
11
 
12
12
  ---
13
13
 
package/README.md CHANGED
@@ -186,6 +186,7 @@ install-system-instructions --instructions <key> [--ai-agent <name>] [--project-
186
186
  | `--instructions <key>` | ✅ | 指定要安裝的系統提示詞(見下方種類表)。 |
187
187
  | `--ai-agent <name>` | 否 | 指定目標 Agent(`claude` / `copilot` / `codex`)。省略時安裝至全部。 |
188
188
  | `--project-path <path>` | 否 | 指定專案根目錄。省略時安裝至 `$HOME` 全域路徑。 |
189
+ | `--replace-all` | 否 | 若先前已安裝過該提示詞,則先將其移除後重裝。 |
189
190
 
190
191
  **指導檔路徑對照:**
191
192
 
@@ -201,6 +202,7 @@ install-system-instructions --instructions <key> [--ai-agent <name>] [--project-
201
202
  | :--- | :--- | :--- |
202
203
  | `technical-co-founder` | Technical Co-Founder | 讓 AI 扮演技術共同創辦人,以 Discovery → Planning → Building → Polish → Handoff 五階段框架,協助您從零打造可上線的真實產品。 |
203
204
  | `git-commit` | Git Commit Message Generator | 分析暫存區變更,自動生成符合 Conventional Commits 規範的提交訊息,經確認後執行。 |
205
+ | `fact-check` | Fact-Check Thinking | 強制 AI 在回答前先進行「事實檢查思考」,嚴格依據來源與事實回答,避免臆測與捏造內容。 |
204
206
 
205
207
  **範例:**
206
208
 
@@ -222,7 +224,7 @@ npx -p @moon791017/neo-skills install-system-instructions \
222
224
  --ai-agent copilot --instructions technical-co-founder --project-path /my/project -y
223
225
  ```
224
226
 
225
- > **💡** 重複執行相同指令不會重複寫入,系統會自動偵測並跳過已安裝的提示詞。
227
+ > **💡** 重複執行相同指令不會重複寫入,系統會自動偵測並跳過已安裝的提示詞。若您希望覆蓋或更新之前安裝的提示詞,可以加上 `--replace-all` 參數進行重裝。
226
228
 
227
229
  ## 💡 常用指令範例
228
230
 
package/bin/_cli-utils.js CHANGED
@@ -25,6 +25,7 @@ export function parseCliArgs() {
25
25
  'ai-agent': { type: 'string' },
26
26
  'project-path': { type: 'string' },
27
27
  'instructions': { type: 'string' },
28
+ 'replace-all': { type: 'boolean' },
28
29
  },
29
30
  strict: false // 允許未定義的參數,避免因為傳入未知的 flag 導致 crash
30
31
  });
@@ -84,6 +84,11 @@ BREAKING CHANGE: 當發現項目等於或高於閾值時,掃描現在會使 CI
84
84
  \`\`\`
85
85
  `;
86
86
 
87
+ export const factCheckInstructions = `
88
+ 你必須在回答前先進行「事實檢查思考」(fact-check thinking)。 除非使用者明確提供、或資料中確實存在,否則不得假設、推測或自行創造內容。嚴格依據來源:僅使用使用者提供的內容、你內部明確記載的知識、或經明確查證的資料。若資訊不足,請直接說明「沒有足夠資料」或「我無法確定」,不要臆測。顯示思考依據:若你引用資料或推論,請說明你依據的段落或理由。若是個人分析或估計,必須明確標註「這是推論」或「這是假設情境」。避免裝作知道:不可為了讓答案完整而「補完」不存在的內容。若遇到模糊或不完整的問題,請先回問確認或提出選項,而非自行決定。保持語意一致:不可改寫或擴大使用者原意。若你需要重述,應明確標示為「重述版本」,並保持語義對等。回答格式:若有明確資料,回答並附上依據。若無明確資料,回答「無法確定」並說明原因。不要在回答中使用「應該是」「可能是」「我猜」等模糊語氣,除非使用者要求。思考深度:在產出前,先檢查答案是否:a. 有清楚依據,b. 未超出題目範圍,c. 沒有出現任何未被明確提及的人名、數字、事件或假設。最終原則:寧可空白,不可捏造。
89
+
90
+ You must conduct "fact-check thinking" before answering. Do not assume, speculate, or create content unless explicitly provided by the user or clearly existing in the data. Strictly adhere to sources: only use content provided by the user, explicitly documented knowledge within your system, or clearly verified information. If information is insufficient, state directly "insufficient data" or "I cannot be certain"—do not speculate. Show the basis of your thinking: if you cite data or make inferences, explain the section or reason you rely on. If it is personal analysis or estimation, it must be explicitly labeled 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 encountering ambiguous or incomplete questions, ask for clarification or present options first rather than deciding on your own. Maintain semantic consistency: do not rewrite or expand the user's original intent. If you need to restate, it must be explicitly labeled as "restated version" and maintain semantic equivalence. Answer format: if there is clear data, answer and attach the basis. If there is no clear data, answer "cannot be certain" and explain why. Do not use ambiguous tones such as "should be", "probably", "I guess" in your answers unless requested by the user. Depth of thinking: before generating output, check whether the answer: a. has a clear basis, b. does not exceed the scope of the question, c. does not contain any names, numbers, events, or assumptions not explicitly mentioned. Ultimate principle: Better to leave it blank than to fabricate.`;
91
+
87
92
  /**
88
93
  * 系統提示詞 Registry — 以 kebab-case 作為 key,供 CLI 選擇安裝。
89
94
  *
@@ -100,4 +105,8 @@ export const INSTRUCTIONS = {
100
105
  name: 'Git Commit Message Generator',
101
106
  content: gitCommitInstructions,
102
107
  },
108
+ 'fact-check': {
109
+ name: 'Fact-Check Thinking',
110
+ content: factCheckInstructions,
111
+ },
103
112
  };
@@ -4,6 +4,7 @@
4
4
  *
5
5
  * 用法:
6
6
  * install-system-instructions --instructions technical-co-founder
7
+ * install-system-instructions --instructions technical-co-founder --replace-all
7
8
  * install-system-instructions --ai-agent claude --instructions technical-co-founder
8
9
  * install-system-instructions --ai-agent copilot --instructions technical-co-founder --project-path .
9
10
  *
@@ -12,6 +13,7 @@
12
13
  * 省略時安裝至全部已註冊 agent。
13
14
  * --instructions <key> 指定要安裝的系統提示詞(可用值見 _system-instructions.js 的 INSTRUCTIONS)。必填。
14
15
  * --project-path <path> 指定專案根目錄作為安裝基底(取代 $HOME)。省略時安裝至全域路徑。
16
+ * --replace-all 如果指定此參數,若先前已安裝過該提示詞,則會將其移除後重裝。
15
17
  */
16
18
  import { readFile, writeFile, mkdir, access } from 'node:fs/promises';
17
19
  import { join, resolve, dirname } from 'node:path';
@@ -58,7 +60,7 @@ function wrapContent(key, content) {
58
60
  * @param {string | undefined} projectPath - 使用者指定的專案路徑
59
61
  * @returns {Promise<{success: boolean, message: string}>}
60
62
  */
61
- async function installForAgent(agentKey, agentConfig, instructionsKey, instruction, projectPath) {
63
+ async function installForAgent(agentKey, agentConfig, instructionsKey, instruction, projectPath, replaceAll) {
62
64
  if (!agentConfig.instructionFile) {
63
65
  const msg = `agent "${agentKey}" 未設定 instructionFile,跳過。`;
64
66
  console.warn(`⚠️ ${msg}`);
@@ -86,17 +88,26 @@ async function installForAgent(agentKey, agentConfig, instructionsKey, instructi
86
88
  }
87
89
 
88
90
  if (fileExists) {
89
- const existing = await readFile(targetFile, 'utf8');
90
-
91
- if (existing.includes(startMarker(instructionsKey))) {
91
+ let existing = await readFile(targetFile, 'utf8');
92
+ const hadInstructions = existing.includes(startMarker(instructionsKey));
93
+
94
+ if (replaceAll) {
95
+ const regex = new RegExp(`\\s*${startMarker(instructionsKey)}[\\s\\S]*?${endMarker(instructionsKey)}\\s*`, 'g');
96
+ if (hadInstructions) {
97
+ existing = existing.replace(regex, '').trimEnd();
98
+ console.log(`🧹 [${agentConfig.name}] 已移除舊的 "${instruction.name}" 提示詞。`);
99
+ }
100
+ } else if (hadInstructions) {
92
101
  const msg = `指導檔中已包含 "${instruction.name}" 提示詞,跳過安裝。`;
93
102
  console.log(`⏭️ ${msg}`);
94
103
  return { success: true, message: msg };
95
104
  }
96
105
 
97
- const newContent = existing.trimEnd() + '\n\n' + wrappedContent + '\n';
106
+ const newContent = existing.trimEnd() ? existing.trimEnd() + '\n\n' + wrappedContent + '\n' : wrappedContent + '\n';
98
107
  await writeFile(targetFile, newContent, 'utf8');
99
- const msg = `已將 "${instruction.name}" 附加至既有指導檔。`;
108
+ const msg = replaceAll && hadInstructions
109
+ ? `已重裝 "${instruction.name}" 系統提示詞。`
110
+ : `已將 "${instruction.name}" 附加至既有指導檔。`;
100
111
  console.log(`✅ [${agentConfig.name}] ${msg}`);
101
112
  return { success: true, message: msg };
102
113
  }
@@ -113,6 +124,7 @@ async function main() {
113
124
  const agentKey = args['ai-agent'];
114
125
  const projectPath = args['project-path'];
115
126
  const instructionsKey = args['instructions'];
127
+ const replaceAll = args['replace-all'];
116
128
 
117
129
  // ── 驗證 --instructions(兩種模式皆需要)──
118
130
  if (!instructionsKey) {
@@ -142,7 +154,7 @@ async function main() {
142
154
  process.exit(1);
143
155
  }
144
156
 
145
- const result = await installForAgent(agentKey, agentConfig, instructionsKey, instruction, projectPath);
157
+ const result = await installForAgent(agentKey, agentConfig, instructionsKey, instruction, projectPath, replaceAll);
146
158
  if (!result.success) process.exit(1);
147
159
  return;
148
160
  }
@@ -158,7 +170,7 @@ async function main() {
158
170
  for (const [key, config] of Object.entries(AGENTS)) {
159
171
  console.log(`━━━ 正在安裝: ${config.name} ━━━`);
160
172
  try {
161
- const result = await installForAgent(key, config, instructionsKey, instruction, projectPath);
173
+ const result = await installForAgent(key, config, instructionsKey, instruction, projectPath, replaceAll);
162
174
  results.push({ name: config.name, ...result });
163
175
  } catch (error) {
164
176
  console.error(`❌ [${config.name}] 安裝失敗:`, error.message || error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moon791017/neo-skills",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "type": "module",
5
5
  "description": "Neo Skills: A Universal Expert Agent Extension",
6
6
  "homepage": "https://neo-blog-iota.vercel.app/",