@vincent119/go-copilot-rules 1.1.0 → 1.1.3
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/.agent_agy/README.md +23 -0
- package/cli/install.js +72 -25
- package/package.json +1 -1
package/.agent_agy/README.md
CHANGED
|
@@ -24,6 +24,29 @@ npx @vincent119/go-copilot-rules --skills "go-ddd,go-grpc,go-testing-advanced"
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
+
## 🔗 與其他 Skills 套件整合
|
|
28
|
+
|
|
29
|
+
### 搭配 antigravity-awesome-skills 使用
|
|
30
|
+
|
|
31
|
+
如果你也在使用 [antigravity-awesome-skills](https://github.com/sickn33/antigravity-awesome-skills)(涵蓋 1,300+ 通用 Skills),可以組合安裝:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# 先安裝通用 Skills
|
|
35
|
+
npx antigravity-awesome-skills
|
|
36
|
+
|
|
37
|
+
# 再安裝 Go 專用 Skills
|
|
38
|
+
npx @vincent119/go-copilot-rules
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**優勢**:
|
|
42
|
+
- **copilot-rules-kit**:專注於 Go 開發(DDD、gRPC、Testing 等深度規範)
|
|
43
|
+
- **antigravity**:廣泛覆蓋(Python、JavaScript、DevOps、Security 等 1,300+ Skills)
|
|
44
|
+
- **兩者互補**:antigravity 提供廣度,copilot-rules-kit 提供 Go 生態的深度
|
|
45
|
+
|
|
46
|
+
📖 詳細比較與組合策略請見 [INSTALLATION.md#與其他方案比較](INSTALLATION.md#與其他方案比較)
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
27
50
|
## 概述
|
|
28
51
|
|
|
29
52
|
本目錄包含 **Go 開發規範的模組化拆分版本**,將原本的三個大型指南檔案(總計 ~7,500 tokens)拆分為:
|
package/cli/install.js
CHANGED
|
@@ -24,24 +24,28 @@ function detectIDE() {
|
|
|
24
24
|
|
|
25
25
|
// 檢查是否在專案目錄中
|
|
26
26
|
if (fs.existsSync(path.join(cwd, '.kiro'))) {
|
|
27
|
-
return { name: 'kiro', defaultPath: '.kiro
|
|
27
|
+
return { name: 'kiro', defaultPath: '.kiro' };
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
if (fs.existsSync(path.join(cwd, '.cursor'))) {
|
|
31
|
-
return { name: 'cursor', defaultPath: '.cursor
|
|
31
|
+
return { name: 'cursor', defaultPath: '.cursor' };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (fs.existsSync(path.join(cwd, '.agent'))) {
|
|
35
|
+
return { name: 'antigravity', defaultPath: '.agent' };
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
if (fs.existsSync(path.join(cwd, '.vscode'))) {
|
|
35
|
-
return { name: 'vscode', defaultPath: '.
|
|
39
|
+
return { name: 'vscode', defaultPath: '.github' };
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
// 檢查是否有全域 Kiro 配置
|
|
39
43
|
if (fs.existsSync(path.join(homeDir, '.kiro'))) {
|
|
40
|
-
return { name: 'kiro-global', defaultPath: path.join(homeDir, '.kiro
|
|
44
|
+
return { name: 'kiro-global', defaultPath: path.join(homeDir, '.kiro') };
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
// 預設為 VS Code
|
|
44
|
-
return { name: 'vscode', defaultPath: '.
|
|
48
|
+
return { name: 'vscode', defaultPath: '.github' };
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
function parseArgs() {
|
|
@@ -68,20 +72,24 @@ function parseArgs() {
|
|
|
68
72
|
break;
|
|
69
73
|
case '--vscode':
|
|
70
74
|
options.ide = 'vscode';
|
|
71
|
-
options.path = '.
|
|
75
|
+
options.path = '.github';
|
|
72
76
|
break;
|
|
73
77
|
case '--cursor':
|
|
74
78
|
options.ide = 'cursor';
|
|
75
|
-
options.path = '.cursor
|
|
79
|
+
options.path = '.cursor';
|
|
80
|
+
break;
|
|
81
|
+
case '--antigravity':
|
|
82
|
+
options.ide = 'antigravity';
|
|
83
|
+
options.path = '.agent';
|
|
76
84
|
break;
|
|
77
85
|
case '--kiro':
|
|
78
86
|
options.ide = 'kiro';
|
|
79
|
-
options.path = '.kiro
|
|
87
|
+
options.path = '.kiro';
|
|
80
88
|
break;
|
|
81
89
|
case '--kiro-global':
|
|
82
90
|
options.ide = 'kiro-global';
|
|
83
91
|
const homeDir = require('os').homedir();
|
|
84
|
-
options.path = path.join(homeDir, '.kiro
|
|
92
|
+
options.path = path.join(homeDir, '.kiro');
|
|
85
93
|
break;
|
|
86
94
|
case '--path':
|
|
87
95
|
options.path = args[++i];
|
|
@@ -112,10 +120,11 @@ ${colors.yellow}用法:${colors.reset}
|
|
|
112
120
|
npx @vincent119/go-copilot-rules [選項]
|
|
113
121
|
|
|
114
122
|
${colors.yellow}選項:${colors.reset}
|
|
115
|
-
--vscode 安裝到 VS Code 預設位置 (.
|
|
116
|
-
--cursor 安裝到 Cursor 預設位置 (.cursor/
|
|
117
|
-
--
|
|
118
|
-
--kiro
|
|
123
|
+
--vscode 安裝到 VS Code 預設位置 (.github/)
|
|
124
|
+
--cursor 安裝到 Cursor 預設位置 (.cursor/)
|
|
125
|
+
--antigravity 安裝到 Antigravity 預設位置 (.agent/)
|
|
126
|
+
--kiro 安裝到 Kiro 專案位置 (.kiro/)
|
|
127
|
+
--kiro-global 安裝到 Kiro 全域位置 (~/.kiro/)
|
|
119
128
|
--path <dir> 安裝到自訂路徑
|
|
120
129
|
--core-only 只安裝核心規範(不包含 Skills)
|
|
121
130
|
--skills-only 只安裝 Skills(不包含核心規範)
|
|
@@ -133,6 +142,9 @@ ${colors.yellow}範例:${colors.reset}
|
|
|
133
142
|
# 安裝到 Cursor
|
|
134
143
|
npx @vincent119/go-copilot-rules --cursor
|
|
135
144
|
|
|
145
|
+
# 安裝到 Antigravity
|
|
146
|
+
npx @vincent119/go-copilot-rules --antigravity
|
|
147
|
+
|
|
136
148
|
# 安裝到 Kiro (專案)
|
|
137
149
|
npx @vincent119/go-copilot-rules --kiro
|
|
138
150
|
|
|
@@ -243,8 +255,9 @@ function install(options) {
|
|
|
243
255
|
log('🔧 解決方案:', 'cyan');
|
|
244
256
|
log(' 使用手動安裝方式:', 'reset');
|
|
245
257
|
log(' git clone https://github.com/vincent119/copilot-rules-kit.git /tmp/copilot-rules-kit', 'blue');
|
|
246
|
-
log(' mkdir -p .kiro
|
|
247
|
-
log(' cp -r /tmp/copilot-rules-kit/.agent_agy/skills
|
|
258
|
+
log(' mkdir -p .kiro', 'blue');
|
|
259
|
+
log(' cp -r /tmp/copilot-rules-kit/.agent_agy/skills .kiro/', 'blue');
|
|
260
|
+
log(' cp -r /tmp/copilot-rules-kit/.agent_agy/rules .kiro/', 'blue');
|
|
248
261
|
log('', 'reset');
|
|
249
262
|
log('📖 完整安裝指南:', 'cyan');
|
|
250
263
|
log(' https://github.com/vincent119/copilot-rules-kit/blob/main/.agent_agy/INSTALLATION.md', 'blue');
|
|
@@ -291,15 +304,40 @@ function install(options) {
|
|
|
291
304
|
switch (options.mode) {
|
|
292
305
|
case 'full':
|
|
293
306
|
log(' 複製完整規範(核心 + 所有 Skills)', 'cyan');
|
|
294
|
-
copyRecursive(sourceDir, targetDir);
|
|
295
|
-
break;
|
|
296
307
|
|
|
297
|
-
|
|
298
|
-
|
|
308
|
+
// 複製文件檔案
|
|
309
|
+
['README.md', 'INSTALLATION.md', 'QUICK_START.md', 'SKILLS_INDEX.md'].forEach(file => {
|
|
310
|
+
const fileSrc = path.join(sourceDir, file);
|
|
311
|
+
if (fs.existsSync(fileSrc)) {
|
|
312
|
+
fs.copyFileSync(fileSrc, path.join(targetDir, file));
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
// 複製 rules 目錄
|
|
299
317
|
const rulesDir = path.join(targetDir, 'rules');
|
|
300
318
|
fs.mkdirSync(rulesDir, { recursive: true });
|
|
301
319
|
copyRecursive(path.join(sourceDir, 'rules'), rulesDir);
|
|
302
320
|
|
|
321
|
+
// 複製 skills 目錄(保留 skills/ 這一層)
|
|
322
|
+
const skillsDestDir = path.join(targetDir, 'skills');
|
|
323
|
+
fs.mkdirSync(skillsDestDir, { recursive: true });
|
|
324
|
+
const skillsSrcDir = path.join(sourceDir, 'skills');
|
|
325
|
+
if (fs.existsSync(skillsSrcDir)) {
|
|
326
|
+
fs.readdirSync(skillsSrcDir).forEach(skillName => {
|
|
327
|
+
const skillSrc = path.join(skillsSrcDir, skillName);
|
|
328
|
+
if (fs.statSync(skillSrc).isDirectory()) {
|
|
329
|
+
copyRecursive(skillSrc, path.join(skillsDestDir, skillName));
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
break;
|
|
334
|
+
|
|
335
|
+
case 'core-only':
|
|
336
|
+
log(' 複製核心規範', 'cyan');
|
|
337
|
+
const coreRulesDir = path.join(targetDir, 'rules');
|
|
338
|
+
fs.mkdirSync(coreRulesDir, { recursive: true });
|
|
339
|
+
copyRecursive(path.join(sourceDir, 'rules'), coreRulesDir);
|
|
340
|
+
|
|
303
341
|
// 複製 README
|
|
304
342
|
const readmeSrc = path.join(sourceDir, 'README.md');
|
|
305
343
|
if (fs.existsSync(readmeSrc)) {
|
|
@@ -309,23 +347,32 @@ function install(options) {
|
|
|
309
347
|
|
|
310
348
|
case 'skills-only':
|
|
311
349
|
log(' 複製所有 Skills', 'cyan');
|
|
312
|
-
const
|
|
313
|
-
fs.mkdirSync(
|
|
314
|
-
|
|
350
|
+
const skillsOnlyDestDir = path.join(targetDir, 'skills');
|
|
351
|
+
fs.mkdirSync(skillsOnlyDestDir, { recursive: true });
|
|
352
|
+
const skillsOnlySrcDir = path.join(sourceDir, 'skills');
|
|
353
|
+
if (fs.existsSync(skillsOnlySrcDir)) {
|
|
354
|
+
fs.readdirSync(skillsOnlySrcDir).forEach(skillName => {
|
|
355
|
+
const skillSrc = path.join(skillsOnlySrcDir, skillName);
|
|
356
|
+
if (fs.statSync(skillSrc).isDirectory()) {
|
|
357
|
+
copyRecursive(skillSrc, path.join(skillsOnlyDestDir, skillName));
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
}
|
|
315
361
|
break;
|
|
316
362
|
}
|
|
317
363
|
|
|
318
364
|
// 如果指定了特定 Skills
|
|
319
365
|
if (options.skills) {
|
|
320
366
|
log('📋 複製選定的 Skills...', 'blue');
|
|
321
|
-
|
|
322
|
-
|
|
367
|
+
|
|
368
|
+
const skillsTargetDir = path.join(targetDir, 'skills');
|
|
369
|
+
fs.mkdirSync(skillsTargetDir, { recursive: true });
|
|
323
370
|
|
|
324
371
|
const skillList = options.skills.split(',').map(s => s.trim());
|
|
325
372
|
skillList.forEach(skill => {
|
|
326
373
|
const skillSrc = path.join(sourceDir, 'skills', skill);
|
|
327
374
|
if (fs.existsSync(skillSrc)) {
|
|
328
|
-
const skillDest = path.join(
|
|
375
|
+
const skillDest = path.join(skillsTargetDir, skill);
|
|
329
376
|
copyRecursive(skillSrc, skillDest);
|
|
330
377
|
log(` • ${skill}`, 'green');
|
|
331
378
|
} else {
|
package/package.json
CHANGED