@moon791017/neo-skills 1.0.21 → 1.0.22

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
@@ -67,49 +67,126 @@
67
67
 
68
68
  ## 📦 安裝與使用
69
69
 
70
- 本套件支援多種 AI Agent 環境。請依據您的 CLI 工具執行對應指令:
70
+ ### 支援的 AI Agent
71
71
 
72
- ### Gemini CLI
72
+ | Agent | CLI 工具 | 技能目錄 | 指導檔 |
73
+ | :--- | :--- | :--- | :--- |
74
+ | **Gemini** | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | 透過擴充套件自動載入 | `GEMINI.md` |
75
+ | **Claude** | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | `.claude/skills/` | `CLAUDE.md` |
76
+ | **Copilot** | [GitHub Copilot CLI](https://docs.github.com/en/copilot) | `.copilot/skills/`(全域)<br>`.github/skills/`(專案) | `.copilot/copilot-instructions.md`(全域)<br>`.github/copilot-instructions.md`(專案) |
77
+ | **Codex** | [OpenAI Codex CLI](https://github.com/openai/codex) | `.codex/skills/` | `AGENTS.md` |
78
+
79
+ Neo Skills 提供兩個 CLI 工具,分別用於安裝**技能模組**與**系統提示詞**:
80
+
81
+ | 工具 | 用途 | 安裝目標 |
82
+ | :--- | :--- | :--- |
83
+ | `install-skills` | 將技能模組(`skills/`)複製到 Agent 的技能目錄 | 資料夾(如 `.claude/skills`) |
84
+ | `install-system-instructions` | 將系統提示詞寫入 Agent 的指導檔 | 單一檔案(如 `CLAUDE.md`) |
85
+
86
+ > 兩個工具皆支援 `--ai-agent` 與 `--project-path` 參數,邏輯一致。
87
+
88
+ ---
89
+
90
+ ### 一、Gemini CLI(擴充套件模式)
91
+
92
+ Gemini CLI 透過擴充套件機制直接安裝,**不需要**以下的 npx 指令:
73
93
 
74
94
  ```bash
75
95
  gemini extension install https://github.com/Benknightdark/neo-skills --auto-update
76
96
  ```
77
97
 
78
- ### 安裝指定 AI Agent 技能
98
+ ---
79
99
 
80
- 使用 `--ai-agent` 指定要安裝的 agent(可用值:`claude`、`copilot`、`codex`):
100
+ ### 二、安裝技能模組 (`install-skills`)
101
+
102
+ 將 `skills/` 目錄下的所有技能模組複製到目標 AI Agent 的技能資料夾。
103
+
104
+ **語法:**
81
105
 
82
- ```bash
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
86
106
  ```
107
+ install-skills [--ai-agent <name>] [--project-path <path>]
108
+ ```
109
+
110
+ **參數:**
87
111
 
88
- ### 安裝至指定專案
112
+ | 參數 | 必填 | 說明 |
113
+ | :--- | :---: | :--- |
114
+ | `--ai-agent <name>` | 否 | 指定目標 Agent(`claude` / `copilot` / `codex`)。省略時安裝全部。 |
115
+ | `--project-path <path>` | 否 | 指定專案根目錄。省略時安裝至 `$HOME` 全域路徑。 |
89
116
 
90
- 搭配 `--project-path` 可將技能安裝至指定專案目錄(技能子目錄會自動附加):
117
+ **安裝路徑對照:**
118
+
119
+ | Agent | 全域路徑 | 專案路徑 |
120
+ | :--- | :--- | :--- |
121
+ | Claude | `~/.claude/skills/` | `<project>/.claude/skills/` |
122
+ | Copilot | `~/.copilot/skills/` | `<project>/.github/skills/` |
123
+ | Codex | `~/.codex/skills/` | `<project>/.codex/skills/` |
124
+
125
+ **範例:**
91
126
 
92
127
  ```bash
93
- # 安裝至 /my/project/.claude/skills
94
- npx -p @moon791017/neo-skills install-skills --ai-agent claude --project-path /my/project
128
+ # 安裝指定 Agent 至全域
129
+ npx -p @moon791017/neo-skills install-skills --ai-agent claude -y
95
130
 
96
- # 安裝至 /my/project/.github/skills
97
- npx -p @moon791017/neo-skills install-skills --ai-agent copilot --project-path /my/project
131
+ # 安裝指定 Agent 至專案
132
+ npx -p @moon791017/neo-skills install-skills --ai-agent copilot --project-path /my/project -y
98
133
 
99
- # 安裝至 /my/project/.codex/skills
100
- npx -p @moon791017/neo-skills install-skills --ai-agent codex --project-path /my/project
134
+ # 一次安裝全部 Agent
135
+ npx -p @moon791017/neo-skills install-skills -y
101
136
  ```
102
137
 
103
- 若未指定 `--project-path`,則安裝至全域路徑(`~/.claude/skills`、`~/.copilot/skills`、`~/.codex/skills`)。
138
+ ---
139
+
140
+ ### 三、安裝系統提示詞 (`install-system-instructions`)
104
141
 
105
- ### 安裝全部 AI Agent 技能
142
+ 將預定義的系統提示詞寫入 AI Agent 的指導檔。若指導檔已存在,會附加至最下方;若不存在,則自動建立。
106
143
 
107
- 不帶 `--ai-agent` 即可一次安裝全部:
144
+ **語法:**
145
+
146
+ ```
147
+ install-system-instructions --ai-agent <name> --instructions <key> [--project-path <path>]
148
+ ```
149
+
150
+ **參數:**
151
+
152
+ | 參數 | 必填 | 說明 |
153
+ | :--- | :---: | :--- |
154
+ | `--ai-agent <name>` | ✅ | 指定目標 Agent(`claude` / `copilot` / `codex`)。 |
155
+ | `--instructions <key>` | ✅ | 指定要安裝的系統提示詞(見下方種類表)。 |
156
+ | `--project-path <path>` | 否 | 指定專案根目錄。省略時安裝至 `$HOME` 全域路徑。 |
157
+
158
+ **指導檔路徑對照:**
159
+
160
+ | Agent | 全域路徑 | 專案路徑 |
161
+ | :--- | :--- | :--- |
162
+ | Claude | `~/.claude/CLAUDE.md` | `<project>/CLAUDE.md` |
163
+ | Copilot | `~/.copilot/copilot-instructions.md` | `<project>/.github/copilot-instructions.md` |
164
+ | Codex | `~/.codex/AGENTS.md` | `<project>/AGENTS.md` |
165
+
166
+ **可用的系統提示詞種類:**
167
+
168
+ | Key | 名稱 | 說明 |
169
+ | :--- | :--- | :--- |
170
+ | `technical-co-founder` | Technical Co-Founder | 讓 AI 扮演技術共同創辦人,以 Discovery → Planning → Building → Polish → Handoff 五階段框架,協助您從零打造可上線的真實產品。 |
171
+
172
+ **範例:**
108
173
 
109
174
  ```bash
110
- npx -p @moon791017/neo-skills install-skills
175
+ # 安裝至專案的 CLAUDE.md
176
+ npx -p @moon791017/neo-skills install-system-instructions \
177
+ --ai-agent claude --instructions technical-co-founder --project-path /my/project -y
178
+
179
+ # 安裝至專案的 .github/copilot-instructions.md
180
+ npx -p @moon791017/neo-skills install-system-instructions \
181
+ --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
111
186
  ```
112
187
 
188
+ > **💡** 重複執行相同指令不會重複寫入,系統會自動偵測並跳過已安裝的提示詞。
189
+
113
190
  ## 💡 常用指令範例
114
191
 
115
192
  您可以直接對 AI 代理下達以下指令或在對話中描述需求:
@@ -0,0 +1,58 @@
1
+ export const technicalCoFounderInstructions = `Role:
2
+ 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
+ My Idea:
4
+ [Describe your product idea — what it does, who it's for, what problem it solves. Explain it like you'd tell a friend.]
5
+ How serious I am:
6
+ [Just exploring / I want to use this myself / I want to share it with others / I want to launch it publicly]
7
+ Project Framework:
8
+ 1. Phase 1: Discovery
9
+ • Ask questions to understand what I actually need (not just what I said)
10
+ • Challenge my assumptions if something doesn't make sense
11
+ • Help me separate "must have now" from "add later"
12
+ • Tell me if my idea is too big and suggest a smarter starting point
13
+ 2. Phase 2: Planning
14
+ • Propose exactly what we'll build in version 1
15
+ • Explain the technical approach in plain language
16
+ • Estimate complexity (simple, medium, ambitious)
17
+ • Identify anything I'll need (accounts, services, decisions)
18
+ • Show a rough outline of the finished product
19
+ 3. Phase 3: Building
20
+ • Build in stages I can see and react to
21
+ • Explain what you're doing as you go (I want to learn)
22
+ • Test everything before moving on
23
+ • Stop and check in at key decision points
24
+ • If you hit a problem, tell me the options instead of just picking one
25
+ 4. Phase 4: Polish
26
+ • Make it look professional, not like a hackathon project
27
+ • Handle edge cases and errors gracefully
28
+ • Make sure it's fast and works on different devices if relevant
29
+ • Add small details that make it feel "finished"
30
+ 5. Phase 5: Handoff
31
+ • Deploy it if I want it online
32
+ • Give clear instructions for how to use it, maintain it, and make changes
33
+ • Document everything so I'm not dependent on this conversation
34
+ • Tell me what I could add or improve in version 2
35
+ 6. How to Work with Me
36
+ • Treat me as the product owner. I make the decisions, you make them happen.
37
+ • Don't overwhelm me with technical jargon. Translate everything.
38
+ • Push back if I'm overcomplicating or going down a bad path.
39
+ • Be honest about limitations. I'd rather adjust expectations than be disappointed.
40
+ • Move fast, but not so fast that I can't follow what's happening.
41
+ Rules:
42
+ • I don't just want it to work—I want it to be something I'm proud to show people
43
+ • This is real. Not a mockup. Not a prototype. A working product.
44
+ • Keep me in control and in the loop at all times`;
45
+
46
+ /**
47
+ * 系統提示詞 Registry — 以 kebab-case 作為 key,供 CLI 選擇安裝。
48
+ *
49
+ * 新增提示詞時:
50
+ * 1. 在上方新增 named export(內容字串)
51
+ * 2. 在此 registry 加入對應 entry
52
+ */
53
+ export const INSTRUCTIONS = {
54
+ 'technical-co-founder': {
55
+ name: 'Technical Co-Founder',
56
+ content: technicalCoFounderInstructions,
57
+ },
58
+ };
package/bin/_utils.js CHANGED
@@ -25,17 +25,29 @@ export const AGENTS = {
25
25
  claude: {
26
26
  name: 'Claude',
27
27
  homePath: '.claude/skills',
28
+ instructionFile: {
29
+ homePath: '.claude/CLAUDE.md',
30
+ projectPath: 'CLAUDE.md',
31
+ },
28
32
  hint: '請確保您的 Claude Desktop 或相關插件已指向此目錄。',
29
33
  },
30
34
  copilot: {
31
35
  name: 'Copilot',
32
36
  homePath: '.copilot/skills',
33
37
  projectPath: '.github/skills',
38
+ instructionFile: {
39
+ homePath: '.copilot/copilot-instructions.md',
40
+ projectPath: '.github/copilot-instructions.md',
41
+ },
34
42
  hint: '請確保您的 GitHub Copilot CLI 已指向此目錄。',
35
43
  },
36
44
  codex: {
37
45
  name: 'Codex',
38
46
  homePath: '.codex/skills',
47
+ instructionFile: {
48
+ homePath: '.codex/AGENTS.md',
49
+ projectPath: 'AGENTS.md',
50
+ },
39
51
  hint: '請確保您的 Codex CLI 已指向此目錄。',
40
52
  },
41
53
  };
@@ -0,0 +1,152 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Neo Skills — 系統提示詞安裝程式
4
+ *
5
+ * 用法:
6
+ * install-system-instructions --ai-agent claude --instructions technical-co-founder
7
+ * install-system-instructions --ai-agent copilot --instructions technical-co-founder --project-path .
8
+ *
9
+ * 參數:
10
+ * --ai-agent <name> 指定目標 AI Agent(可用值見 _utils.js 的 AGENTS)。必填。
11
+ * --instructions <key> 指定要安裝的系統提示詞(可用值見 _system-instructions.js 的 INSTRUCTIONS)。必填。
12
+ * --project-path <path> 指定專案根目錄作為安裝基底(取代 $HOME)。省略時安裝至全域路徑。
13
+ */
14
+ import { readFile, writeFile, mkdir, access } from 'node:fs/promises';
15
+ import { join, resolve, dirname } from 'node:path';
16
+ import { homedir } from 'node:os';
17
+
18
+ import { AGENTS } from './_utils.js';
19
+ import { INSTRUCTIONS } from './_system-instructions.js';
20
+
21
+ /**
22
+ * 從 process.argv 解析指定 flag 的值。
23
+ * @param {string} flag
24
+ * @returns {string | undefined}
25
+ */
26
+ function parseArg(flag) {
27
+ const idx = process.argv.indexOf(flag);
28
+ if (idx === -1 || idx + 1 >= process.argv.length) return undefined;
29
+ return process.argv[idx + 1];
30
+ }
31
+
32
+ /**
33
+ * 產生提示詞的起始標記。
34
+ * @param {string} key
35
+ */
36
+ function startMarker(key) {
37
+ return `<!-- neo-skills:system-instructions:${key} -->`;
38
+ }
39
+
40
+ /**
41
+ * 產生提示詞的結束標記。
42
+ * @param {string} key
43
+ */
44
+ function endMarker(key) {
45
+ return `<!-- /neo-skills:system-instructions:${key} -->`;
46
+ }
47
+
48
+ /**
49
+ * 將提示詞包裹在起始/結束標記之間。
50
+ * @param {string} key
51
+ * @param {string} content
52
+ */
53
+ function wrapContent(key, content) {
54
+ return `${startMarker(key)}\n${content}\n${endMarker(key)}`;
55
+ }
56
+
57
+ // 全域錯誤攔截
58
+ process.on('uncaughtException', (err) => {
59
+ console.error('💥 [Fatal Error]:', err);
60
+ process.exit(1);
61
+ });
62
+ process.on('unhandledRejection', (reason) => {
63
+ console.error('💥 [Unhandled Rejection]:', reason);
64
+ process.exit(1);
65
+ });
66
+
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
+
86
+ if (!agentConfig.instructionFile) {
87
+ console.error(`❌ agent "${agentKey}" 未設定 instructionFile。`);
88
+ process.exit(1);
89
+ }
90
+
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
+ const { instructionFile } = agentConfig;
107
+ const baseDir = projectPath ? resolve(projectPath) : homedir();
108
+ const subPath = projectPath && instructionFile.projectPath
109
+ ? instructionFile.projectPath
110
+ : instructionFile.homePath;
111
+ const targetFile = join(baseDir, subPath);
112
+
113
+ console.log(`🚀 [${agentConfig.name}] 開始安裝系統提示詞: ${instruction.name}`);
114
+ console.log(`🎯 目標檔案: ${targetFile}`);
115
+
116
+ // ── 組裝標記包裹的提示詞內容 ──
117
+ const wrappedContent = wrapContent(instructionsKey, instruction.content);
118
+
119
+ // ── 檢查指導檔是否已存在 ──
120
+ let fileExists = false;
121
+ try {
122
+ await access(targetFile);
123
+ fileExists = true;
124
+ } catch {
125
+ // 檔案不存在,稍後建立
126
+ }
127
+
128
+ if (fileExists) {
129
+ // 讀取現有內容
130
+ const existing = await readFile(targetFile, 'utf8');
131
+
132
+ // 冪等性檢查:如果已包含相同提示詞的標記,則跳過
133
+ if (existing.includes(startMarker(instructionsKey))) {
134
+ console.log(`⏭️ 指導檔中已包含 "${instruction.name}" 提示詞,跳過安裝。`);
135
+ return;
136
+ }
137
+
138
+ // 附加至最下方
139
+ const newContent = existing.trimEnd() + '\n\n' + wrappedContent + '\n';
140
+ 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}" 提示詞。`);
149
+ }
150
+ }
151
+
152
+ main();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "neo-skills",
3
3
  "description": "A universal capability extension for Gemini CLI",
4
- "version": "0.47.4",
4
+ "version": "0.48.0",
5
5
  "mcpServers": {
6
6
  "neo-skills": {
7
7
  "command": "node",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moon791017/neo-skills",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "type": "module",
5
5
  "description": "Neo Skills: A Universal Expert Agent Extension",
6
6
  "homepage": "https://neo-blog-iota.vercel.app/",
@@ -8,11 +8,13 @@
8
8
  "gemini cli",
9
9
  "claude code",
10
10
  "copilot cli",
11
+ "openai codex cli",
11
12
  "ai agent skills"
12
13
  ],
13
14
  "bin": {
14
15
  "neo-skills": "./bin/install-skills.js",
15
- "install-skills": "./bin/install-skills.js"
16
+ "install-skills": "./bin/install-skills.js",
17
+ "install-system-instructions": "./bin/install-system-instructions.js"
16
18
  },
17
19
  "files": [
18
20
  "dist",