@pigcloud/skills 1.0.4 → 1.0.6
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/CHANGELOG.md +29 -28
- package/README.en.md +4 -3
- package/README.md +37 -35
- package/bin/cli.js +98 -71
- package/package.json +69 -69
- package/rules/coding/implementation.md +6 -5
- package/rules/product/project-context.md +6 -5
- package/rules/skill-profile-map.json +6 -5
- package/rules/skill-profile-map.md +6 -5
- package/scripts/ci-validator.sh +19 -19
- package/scripts/validate-skill-shapes.js +5 -4
- package/scripts/validate-skills.ps1 +6 -6
- package/scripts/validate-skills.sh +5 -5
- package/skills/{api-docs → api-contract-docs}/SKILL.md +5 -4
- package/skills/{extract-business-facts → business-fact-extraction}/SKILL.md +9 -8
- package/skills/{extract-business-facts → business-fact-extraction}/scripts/write-knowledge-base.js +4 -3
- package/skills/code-review/SKILL.md +7 -6
- package/skills/domain-modeling/SKILL.md +4 -3
- package/skills/feature-build/SKILL.md +10 -10
- package/skills/feature-build/references/comment-specification.md +1 -1
- package/skills/knowledge-capture/SKILL.md +1 -1
- package/skills/{performance-check → performance-audit}/SKILL.md +5 -4
- package/skills/project-bootstrap/SKILL.md +3 -2
- package/skills/references/business-fact-extraction.md +9 -8
- package/skills/references/engineering-delivery-method.md +4 -3
- package/skills/references/engineering-delivery-template.md +3 -2
- package/skills/references/golden-prompt-suite.js +44 -43
- package/skills/references/project-requirement-alignment.md +2 -1
- package/skills/references/rule-loading-map.md +4 -3
- package/skills/references/skill-authoring-standard.md +4 -3
- package/skills/references/skill-reference-matrix.md +15 -14
- package/skills/{security-review → security-audit}/SKILL.md +4 -2
- package/skills/{spec → spec-refinement}/SKILL.md +19 -18
- package/skills/technical-design/SKILL.md +11 -10
- package/skills/test-design/SKILL.md +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Pig Skills CHANGELOG
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> 鐗堟湰鍙樻洿璁板綍锛岄伒寰?Semantic Versioning
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,20 +8,20 @@
|
|
|
8
8
|
|
|
9
9
|
### Changed
|
|
10
10
|
- Made postinstall client-aware so it can auto-install into the detected client(s) from `INIT_CWD`.
|
|
11
|
-
- Kept Codex as the only client with a real command pack so `/spec` remains the executable entry instead of a fake alias.
|
|
11
|
+
- Kept Codex as the only client with a real command pack so `/spec-refinement` remains the executable entry instead of a fake alias.
|
|
12
12
|
- Extended `pig-skills auto` to install the matching client folders for Codex, Claude Code, Trae, Cursor, Copilot, and Windsurf.
|
|
13
|
-
- Clarified in the README and usage docs that only Codex gets `/spec`-style command files, while other clients receive skills and rules.
|
|
13
|
+
- Clarified in the README and usage docs that only Codex gets `/spec-refinement`-style command files, while other clients receive skills and rules.
|
|
14
14
|
- Unified the usage guides around the same client-detection and knowledge-capture model.
|
|
15
15
|
|
|
16
16
|
## [1.1.0] - 2026-06-18
|
|
17
17
|
|
|
18
18
|
### Changed
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
19
|
+
- 閲嶆瀯 skill 浣撶郴璇存槑锛屾寜褰撳墠 13 涓?skill 閲嶆柊姊崇悊 README 鍜屼娇鐢ㄦ柟寮?
|
|
20
|
+
- 琛ュ厖缁熶竴鏍¢獙鍏ュ彛 `validate-skills.js`锛屽苟澧炲姞 Windows / macOS / Linux 澹?
|
|
21
|
+
- 灏嗕究鎼?Python 绾冲叆浠撳簱鍐咃紝閬垮厤渚濊禆绯荤粺鐜
|
|
22
|
+
- 缁熶竴 `spec-refinement`銆乣knowledge-capture`銆乣workflow-router` 绛夐珮棰?skill 鐨勮瘑鍒笌闂ㄧ琛ㄨ揪
|
|
23
|
+
- 鏀剁缉 skill frontmatter锛屾寜瀹樻柟 validator 瑙勮寖淇濈暀鏈€灏忓瓧娈?
|
|
24
|
+
- 灏?`handover` 鍚堝苟杩?`knowledge-capture`锛屽垹闄ょ嫭绔嬩氦鎺?skill
|
|
25
25
|
|
|
26
26
|
### Added
|
|
27
27
|
- `validate-skills.js`
|
|
@@ -33,38 +33,39 @@
|
|
|
33
33
|
## [1.0.0] - 2024-01-20
|
|
34
34
|
|
|
35
35
|
### Added
|
|
36
|
-
-
|
|
37
|
-
- OpenSpec
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
- CLI
|
|
36
|
+
- 鍒濆鍙戝竷锛屽寘鍚?12 涓鏋剁粦瀹氭妧鑳?
|
|
37
|
+
- OpenSpec 鏍囧噯鍖栬鑼?
|
|
38
|
+
- 涓夊眰娓愯繘寮忓姞杞芥満鍒?
|
|
39
|
+
- 璺ㄥ伐鍏峰吋瀹规敮鎸侊紙Trae/Cursor/Claude Code/Copilot/Windsurf锛?
|
|
40
|
+
- CLI 宸ュ叿锛坧ig-skills 鍛戒护锛?
|
|
41
41
|
|
|
42
42
|
### Skills
|
|
43
43
|
- **Core**: workflow-router, technical-design, feature-build, code-review
|
|
44
|
-
- **Analysis**: spec, domain-modeling
|
|
45
|
-
- **Integration**: api-docs, test-design
|
|
44
|
+
- **Analysis**: spec-refinement, domain-modeling
|
|
45
|
+
- **Integration**: api-contract-docs, test-design
|
|
46
46
|
- **Collaboration**: knowledge-capture
|
|
47
47
|
- **Infrastructure**: project-bootstrap, environment-deploy
|
|
48
48
|
|
|
49
49
|
### Core Bindings
|
|
50
|
-
- Controller
|
|
51
|
-
- MpRealDelEntity / MpLogicDelEntity
|
|
52
|
-
- Result<T>
|
|
53
|
-
- BizException
|
|
54
|
-
- Lambda
|
|
50
|
+
- Controller 鈫?Service 鈫?Mapper 鍒嗗眰
|
|
51
|
+
- MpRealDelEntity / MpLogicDelEntity 鍩虹被
|
|
52
|
+
- Result<T> 缁熶竴杩斿洖
|
|
53
|
+
- BizException 寮傚父浣撶郴
|
|
54
|
+
- Lambda 鏌ヨ琛ㄨ揪寮?
|
|
55
55
|
|
|
56
56
|
---
|
|
57
57
|
|
|
58
|
-
##
|
|
58
|
+
## 璁″垝鏇存柊
|
|
59
59
|
|
|
60
60
|
### [1.2.0] - TBD
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
61
|
+
- 鎶€鑳芥ā鏉垮彲瑙嗗寲
|
|
62
|
+
- 鎶€鑳界粍鍚堢紪鎺掑櫒
|
|
63
|
+
- 鏇村妗嗘灦鐗瑰畾瑙勫垯
|
|
64
64
|
|
|
65
65
|
### [2.0.0] - TBD
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
66
|
+
- 鎶€鑳藉彂甯冨钩鍙?
|
|
67
|
+
- 鎶€鑳借闃呮満鍒?
|
|
68
|
+
- 澶氭鏋舵敮鎸?
|
|
69
|
+
|
|
69
70
|
|
|
70
71
|
|
package/README.en.md
CHANGED
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
|
|
19
19
|
## Common Entry Points
|
|
20
20
|
|
|
21
|
-
- Spec: `spec`
|
|
21
|
+
- Spec: `spec-refinement`
|
|
22
22
|
- Stage routing: `workflow-router`
|
|
23
23
|
- Design and implementation: `technical-design` / `feature-build`
|
|
24
|
-
- Review and validation: `code-review` / `security-
|
|
25
|
-
- Fact extraction: `
|
|
24
|
+
- Review and validation: `code-review` / `security-audit` / `performance-audit`
|
|
25
|
+
- Fact extraction: `business-fact-extraction`
|
|
26
26
|
- Knowledge capture: `knowledge-capture`
|
|
27
27
|
|
|
28
28
|
## Install
|
|
@@ -72,3 +72,4 @@ node self-test-skills.js
|
|
|
72
72
|
- [skills/references/skill-authoring-standard.md](skills/references/skill-authoring-standard.md)
|
|
73
73
|
- [skills/references/skill-reference-matrix.md](skills/references/skill-reference-matrix.md)
|
|
74
74
|
- [skills/references/rule-loading-map.md](skills/references/rule-loading-map.md)
|
|
75
|
+
|
package/README.md
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
# @pigcloud/skills
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> 涓€涓潰鍚戜骇鍝併€佺爺鍙戙€佹祴璇曞崗浣滅殑 AI 鎶€鑳藉寘銆俙skills/` 璐熻矗浠诲姟杈圭晫涓庝氦鎺ワ紝`rules/` 璐熻矗瑙勫垯绾︽潫涓庢牎楠岋紝`workflow-router` 璐熻矗闃舵璺敱锛宍CI / Test / Evidence` 璐熻矗浜や粯闂幆銆?
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 杩欏绯荤粺鍋氫粈涔?
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
7
|
+
- 鍏堣矾鐢憋紝鍐嶆墽琛?
|
|
8
|
+
- 鍏堢害鏉燂紝鍐嶇敓鎴?
|
|
9
|
+
- 鍏堝鐢紝鍐嶆敼鍐?
|
|
10
|
+
- 鍏堥獙璇侊紝鍐嶇粨璁?
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## 鏍稿績灞?
|
|
13
13
|
|
|
14
|
-
1. `workflow-router
|
|
15
|
-
2. `skills
|
|
16
|
-
3. `rules
|
|
17
|
-
4. `CI / Test / Evidence
|
|
14
|
+
1. `workflow-router`锛氳瘑鍒换鍔$被鍨嬪苟閫夋嫨涓嬩竴闃舵
|
|
15
|
+
2. `skills/`锛氬彲澶嶇敤鐨勮兘鍔涙ā鍧?
|
|
16
|
+
3. `rules/`锛氶」鐩害鏉熴€佽竟鐣屽拰纭牎楠?
|
|
17
|
+
4. `CI / Test / Evidence`锛氬彲楠岃瘉鐨勪氦浠橀棬绂?
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## 甯哥敤鍏ュ彛
|
|
20
20
|
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
21
|
+
- 瑙勬牸婢勬竻锛歚spec-refinement`
|
|
22
|
+
- 闃舵璺敱锛歚workflow-router`
|
|
23
|
+
- 璁捐涓庡疄鐜帮細`technical-design` / `feature-build`
|
|
24
|
+
- 瀹℃煡涓庨獙璇侊細`code-review` / `security-audit` / `performance-audit`
|
|
25
|
+
- 浜嬪疄鎶藉彇锛歚business-fact-extraction`
|
|
26
|
+
- 鐭ヨ瘑娌夋穩锛歚knowledge-capture`
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## 瀹夎
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
31
|
npm install -g @pigcloud/skills
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## 瀹㈡埛绔帴鍏?
|
|
35
35
|
|
|
36
|
-
- Codex
|
|
37
|
-
- Trae
|
|
38
|
-
- Claude Code
|
|
39
|
-
-
|
|
36
|
+
- Codex锛氳 [docs/CODEX-APP-GUIDE.md](docs/CODEX-APP-GUIDE.md)
|
|
37
|
+
- Trae锛氳 [docs/TRAE-GUIDE.md](docs/TRAE-GUIDE.md)
|
|
38
|
+
- Claude Code锛氳 [docs/CLAUDE-CODE-GUIDE.md](docs/CLAUDE-CODE-GUIDE.md)
|
|
39
|
+
- 缁熶竴瀹夎鎸囧崡锛氳 [docs/client-installation-guide.md](docs/client-installation-guide.md)
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## 娌荤悊姒傝
|
|
42
42
|
|
|
43
|
-
-
|
|
44
|
-
-
|
|
43
|
+
- 绯荤粺鎬昏锛氳 [docs/agent-governance-overview.md](docs/agent-governance-overview.md)
|
|
44
|
+
- 鎶€鑳芥墿灞曟寚鍗楋細瑙?[docs/skills-extension-guide.md](docs/skills-extension-guide.md)
|
|
45
45
|
|
|
46
|
-
##
|
|
46
|
+
## 鏍¢獙
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
49
|
node validate-skills.js
|
|
@@ -54,15 +54,15 @@ node scripts/validate-skill-replay-signals.js
|
|
|
54
54
|
node self-test-skills.js
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
##
|
|
57
|
+
## 鐩綍璇存槑
|
|
58
58
|
|
|
59
|
-
- `skills
|
|
60
|
-
- `skills/references
|
|
61
|
-
- `rules
|
|
62
|
-
- `docs
|
|
63
|
-
- `bin
|
|
59
|
+
- `skills/`锛氭妧鑳芥鏂?
|
|
60
|
+
- `skills/references/`锛氱紪鍐欐爣鍑嗐€佸弬鑰冪煩闃点€佸姞杞芥槧灏?
|
|
61
|
+
- `rules/`锛氳鍒欏叆鍙d笌瑙勫垯鍖?
|
|
62
|
+
- `docs/`锛氬畨瑁呫€佹不鐞嗗拰宸ヤ綔娴佽鏄?
|
|
63
|
+
- `bin/`锛欳LI銆佽嚜鍔ㄥ畨瑁呫€乸ostinstall
|
|
64
64
|
|
|
65
|
-
##
|
|
65
|
+
## 鍏ュ彛鏂囨。
|
|
66
66
|
|
|
67
67
|
- [AGENTS.md](AGENTS.md)
|
|
68
68
|
- [docs/README.md](docs/README.md)
|
|
@@ -72,3 +72,5 @@ node self-test-skills.js
|
|
|
72
72
|
- [skills/references/skill-authoring-standard.md](skills/references/skill-authoring-standard.md)
|
|
73
73
|
- [skills/references/skill-reference-matrix.md](skills/references/skill-reference-matrix.md)
|
|
74
74
|
- [skills/references/rule-loading-map.md](skills/references/rule-loading-map.md)
|
|
75
|
+
|
|
76
|
+
|
package/bin/cli.js
CHANGED
|
@@ -14,6 +14,8 @@ const CODEX_HOME = process.env.CODEX_HOME || path.join(os.homedir(), '.codex');
|
|
|
14
14
|
const COMMAND_PACK_NAME = 'codex-commands';
|
|
15
15
|
const COMMAND_PACK_SOURCE = path.join(PACKAGE_ROOT, COMMAND_PACK_NAME);
|
|
16
16
|
const CODEX_HOME_SKILLS_DIR = path.join(CODEX_HOME, 'skills');
|
|
17
|
+
const CODEX_HOME_SKILLS_NAMESPACE = 'pigcloud';
|
|
18
|
+
const CODEX_HOME_SKILLS_NAMESPACE_DIR = path.join(CODEX_HOME_SKILLS_DIR, CODEX_HOME_SKILLS_NAMESPACE);
|
|
17
19
|
const CODEX_PLUGINS_DIR = path.join(CODEX_HOME, 'plugins');
|
|
18
20
|
const CODEX_MARKETPLACE_FILE = path.join(CODEX_PLUGINS_DIR, 'marketplace.json');
|
|
19
21
|
const INSTALL_ROOT = path.resolve(process.env.INIT_CWD || process.cwd());
|
|
@@ -41,25 +43,25 @@ const chalk = {
|
|
|
41
43
|
};
|
|
42
44
|
|
|
43
45
|
const SKILLS = [
|
|
44
|
-
{ name: 'workflow-router', category: 'core', description: '
|
|
45
|
-
{ name: 'spec', category: 'analysis', description: '
|
|
46
|
-
{ name: 'technical-design', category: 'core', description: '
|
|
47
|
-
{ name: 'feature-build', category: 'core', description: '
|
|
48
|
-
{ name: 'code-review', category: 'core', description: '
|
|
49
|
-
{ name: 'domain-modeling', category: 'analysis', description: '
|
|
50
|
-
{ name: '
|
|
51
|
-
{ name: 'api-docs', category: 'integration', description: '
|
|
52
|
-
{ name: 'test-design', category: 'integration', description: '
|
|
53
|
-
{ name: 'security-
|
|
54
|
-
{ name: 'performance-
|
|
55
|
-
{ name: 'knowledge-capture', category: 'collaboration', description: '
|
|
56
|
-
{ name: 'project-bootstrap', category: 'infrastructure', description: '
|
|
57
|
-
{ name: 'environment-deploy', category: 'infrastructure', description: '
|
|
46
|
+
{ name: 'workflow-router', category: 'core', description: '路由工作阶段' },
|
|
47
|
+
{ name: 'spec-refinement', category: 'analysis', description: '将需求输入整理为可执行规格' },
|
|
48
|
+
{ name: 'technical-design', category: 'core', description: '梳理实现设计' },
|
|
49
|
+
{ name: 'feature-build', category: 'core', description: '安全实现功能变更' },
|
|
50
|
+
{ name: 'code-review', category: 'core', description: '审查代码变更' },
|
|
51
|
+
{ name: 'domain-modeling', category: 'analysis', description: '提炼领域知识' },
|
|
52
|
+
{ name: 'business-fact-extraction', category: 'analysis', description: '从代码中提取业务事实' },
|
|
53
|
+
{ name: 'api-contract-docs', category: 'integration', description: '整理 API 契约文档' },
|
|
54
|
+
{ name: 'test-design', category: 'integration', description: '设计测试覆盖' },
|
|
55
|
+
{ name: 'security-audit', category: 'review', description: '审查安全风险' },
|
|
56
|
+
{ name: 'performance-audit', category: 'review', description: '审查性能风险' },
|
|
57
|
+
{ name: 'knowledge-capture', category: 'collaboration', description: '沉淀可复用知识' },
|
|
58
|
+
{ name: 'project-bootstrap', category: 'infrastructure', description: '初始化项目骨架' },
|
|
59
|
+
{ name: 'environment-deploy', category: 'infrastructure', description: '部署支撑环境' }
|
|
58
60
|
];
|
|
59
61
|
|
|
60
62
|
const TOOL_CONFIGS = {
|
|
61
|
-
codex: { dir: '.codex/skills', rootFile: '.codex/AGENTS.md', markers: ['.codex/AGENTS.md', '.codex'] },
|
|
62
|
-
opencode: { dir: '.codex/skills', rootFile: '.codex/AGENTS.md', markers: ['.codex/AGENTS.md', '.codex'] },
|
|
63
|
+
codex: { dir: '.codex/skills/pigcloud', rootFile: '.codex/AGENTS.md', markers: ['.codex/AGENTS.md', '.codex'] },
|
|
64
|
+
opencode: { dir: '.codex/skills/pigcloud', rootFile: '.codex/AGENTS.md', markers: ['.codex/AGENTS.md', '.codex'] },
|
|
63
65
|
claude: { dir: '.claude/skills', rootFile: '.claude/CLAUDE.md', markers: ['.claude/CLAUDE.md', '.claude'] },
|
|
64
66
|
claude_code: { dir: '.claude/skills', rootFile: '.claude/CLAUDE.md', markers: ['.claude/CLAUDE.md', '.claude'] },
|
|
65
67
|
trae: { dir: '.trae/skills', rootFile: '.trae/AGENTS.md', markers: ['.trae/AGENTS.md', '.trae'] },
|
|
@@ -252,17 +254,29 @@ async function writeRootFile(tool, cwd = process.cwd()) {
|
|
|
252
254
|
}
|
|
253
255
|
}
|
|
254
256
|
|
|
255
|
-
async function copySkillToCodexHome(skillName) {
|
|
256
|
-
const skill = normalizeSkillName(skillName);
|
|
257
|
-
if (!getSkillInfo(skill)) {
|
|
258
|
-
throw new Error(`Unknown skill: ${skillName}`);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
const sourceDir = path.join(SKILLS_DIR, skill);
|
|
262
|
-
const destDir = path.join(
|
|
263
|
-
await
|
|
264
|
-
await
|
|
265
|
-
|
|
257
|
+
async function copySkillToCodexHome(skillName) {
|
|
258
|
+
const skill = normalizeSkillName(skillName);
|
|
259
|
+
if (!getSkillInfo(skill)) {
|
|
260
|
+
throw new Error(`Unknown skill: ${skillName}`);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const sourceDir = path.join(SKILLS_DIR, skill);
|
|
264
|
+
const destDir = path.join(CODEX_HOME_SKILLS_NAMESPACE_DIR, skill);
|
|
265
|
+
await removePath(path.join(CODEX_HOME_SKILLS_DIR, skill));
|
|
266
|
+
await removePath(destDir);
|
|
267
|
+
await ensureDir(CODEX_HOME_SKILLS_NAMESPACE_DIR);
|
|
268
|
+
await copyDirectory(sourceDir, destDir);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
async function clearCodexPersonalSkillsNamespace() {
|
|
272
|
+
await removePath(CODEX_HOME_SKILLS_NAMESPACE_DIR);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
async function clearCodexLegacyFlatSkills(skillNames) {
|
|
276
|
+
for (const skillName of skillNames) {
|
|
277
|
+
await removePath(path.join(CODEX_HOME_SKILLS_DIR, normalizeSkillName(skillName)));
|
|
278
|
+
}
|
|
279
|
+
}
|
|
266
280
|
|
|
267
281
|
function buildMarketplaceEntry(pluginName) {
|
|
268
282
|
return {
|
|
@@ -324,13 +338,18 @@ async function installSharedWorkspaceAssets(cwd = getInstallRoot()) {
|
|
|
324
338
|
}
|
|
325
339
|
}
|
|
326
340
|
|
|
327
|
-
async function installSkills(skills, tool, cwd = getInstallRoot()) {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
341
|
+
async function installSkills(skills, tool, cwd = getInstallRoot(), options = {}) {
|
|
342
|
+
const { resetCodexNamespace = false } = options;
|
|
343
|
+
await installSharedWorkspaceAssets(cwd);
|
|
344
|
+
if (tool === 'codex' && resetCodexNamespace) {
|
|
345
|
+
await clearCodexPersonalSkillsNamespace();
|
|
346
|
+
await clearCodexLegacyFlatSkills(skills);
|
|
347
|
+
}
|
|
348
|
+
for (const skill of skills) {
|
|
349
|
+
await copySkill(skill, tool, cwd);
|
|
350
|
+
}
|
|
351
|
+
await writeRootFile(tool, cwd);
|
|
352
|
+
if (tool === 'codex') {
|
|
334
353
|
for (const skill of skills) {
|
|
335
354
|
await copySkillToCodexHome(skill);
|
|
336
355
|
}
|
|
@@ -338,16 +357,16 @@ async function installSkills(skills, tool, cwd = getInstallRoot()) {
|
|
|
338
357
|
}
|
|
339
358
|
}
|
|
340
359
|
|
|
341
|
-
async function installSkillsForTools(skills, tools, cwd = getInstallRoot()) {
|
|
342
|
-
const uniqueTools = [...new Set(tools.filter(Boolean))];
|
|
343
|
-
if (uniqueTools.length === 0) {
|
|
344
|
-
throw new Error('Unable to resolve any install targets.');
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
for (const tool of uniqueTools) {
|
|
348
|
-
await installSkills(skills, tool, cwd);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
360
|
+
async function installSkillsForTools(skills, tools, cwd = getInstallRoot(), options = {}) {
|
|
361
|
+
const uniqueTools = [...new Set(tools.filter(Boolean))];
|
|
362
|
+
if (uniqueTools.length === 0) {
|
|
363
|
+
throw new Error('Unable to resolve any install targets.');
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
for (const tool of uniqueTools) {
|
|
367
|
+
await installSkills(skills, tool, cwd, options);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
351
370
|
|
|
352
371
|
function parseArgs(argv) {
|
|
353
372
|
const positionals = [];
|
|
@@ -464,10 +483,10 @@ async function run() {
|
|
|
464
483
|
if (command === 'init') {
|
|
465
484
|
const skills = getSelectedSkills(options.skills, options.all || !options.skills);
|
|
466
485
|
try {
|
|
467
|
-
await ensureRuntimeForInstall();
|
|
468
|
-
const tools = resolveRequestedTools(options.tool);
|
|
469
|
-
await installSkillsForTools(skills, tools);
|
|
470
|
-
console.log(chalk.green(`Installed ${skills.length} skills for ${tools.join(', ')}`));
|
|
486
|
+
await ensureRuntimeForInstall();
|
|
487
|
+
const tools = resolveRequestedTools(options.tool);
|
|
488
|
+
await installSkillsForTools(skills, tools, getInstallRoot(), { resetCodexNamespace: true });
|
|
489
|
+
console.log(chalk.green(`Installed ${skills.length} skills for ${tools.join(', ')}`));
|
|
471
490
|
} catch (error) {
|
|
472
491
|
console.error(chalk.red(error.message));
|
|
473
492
|
process.exitCode = 1;
|
|
@@ -478,10 +497,10 @@ async function run() {
|
|
|
478
497
|
if (command === 'auto') {
|
|
479
498
|
const skills = getSelectedSkills(options.skills, options.all || !options.skills);
|
|
480
499
|
try {
|
|
481
|
-
await ensureRuntimeForInstall();
|
|
482
|
-
const tools = resolveRequestedTools('auto');
|
|
483
|
-
await installSkillsForTools(skills, tools);
|
|
484
|
-
console.log(chalk.green(`Auto-installed ${skills.length} skills for ${tools.join(', ')}`));
|
|
500
|
+
await ensureRuntimeForInstall();
|
|
501
|
+
const tools = resolveRequestedTools('auto');
|
|
502
|
+
await installSkillsForTools(skills, tools, getInstallRoot(), { resetCodexNamespace: true });
|
|
503
|
+
console.log(chalk.green(`Auto-installed ${skills.length} skills for ${tools.join(', ')}`));
|
|
485
504
|
} catch (error) {
|
|
486
505
|
console.error(chalk.red(error.message));
|
|
487
506
|
process.exitCode = 1;
|
|
@@ -492,9 +511,9 @@ async function run() {
|
|
|
492
511
|
if (command === 'codex') {
|
|
493
512
|
const skills = getSelectedSkills(options.skills, options.all || !options.skills);
|
|
494
513
|
try {
|
|
495
|
-
await ensureRuntimeForInstall();
|
|
496
|
-
await installSkills(skills, 'codex');
|
|
497
|
-
console.log(chalk.green(`Synced ${skills.length} skills into Codex`));
|
|
514
|
+
await ensureRuntimeForInstall();
|
|
515
|
+
await installSkills(skills, 'codex', getInstallRoot(), { resetCodexNamespace: true });
|
|
516
|
+
console.log(chalk.green(`Synced ${skills.length} skills into Codex`));
|
|
498
517
|
console.log(chalk.green(`Installed Codex command pack: ${COMMAND_PACK_NAME}`));
|
|
499
518
|
} catch (error) {
|
|
500
519
|
console.error(chalk.red(error.message));
|
|
@@ -549,7 +568,7 @@ async function run() {
|
|
|
549
568
|
if (command === 'list') {
|
|
550
569
|
console.log(chalk.blue('Installed skills:'));
|
|
551
570
|
SKILLS.forEach(skill => {
|
|
552
|
-
console.log(chalk.green(`
|
|
571
|
+
console.log(chalk.green(` - ${skill.name}`) + chalk.gray(` - ${skill.description}`));
|
|
553
572
|
});
|
|
554
573
|
console.log(chalk.gray(`\nTotal: ${SKILLS.length} skills`));
|
|
555
574
|
return;
|
|
@@ -569,11 +588,11 @@ async function run() {
|
|
|
569
588
|
await installSharedWorkspaceAssets();
|
|
570
589
|
for (const tool of tools) {
|
|
571
590
|
await copySkill(skillName, tool);
|
|
572
|
-
await writeRootFile(tool);
|
|
573
|
-
if (tool === 'codex') {
|
|
574
|
-
await copySkillToCodexHome(skillName);
|
|
575
|
-
await installCodexCommandPack();
|
|
576
|
-
}
|
|
591
|
+
await writeRootFile(tool);
|
|
592
|
+
if (tool === 'codex') {
|
|
593
|
+
await copySkillToCodexHome(skillName);
|
|
594
|
+
await installCodexCommandPack();
|
|
595
|
+
}
|
|
577
596
|
}
|
|
578
597
|
console.log(chalk.green(`Installed: ${normalizeSkillName(skillName)} -> ${tools.join(', ')}`));
|
|
579
598
|
} catch (error) {
|
|
@@ -598,12 +617,19 @@ async function run() {
|
|
|
598
617
|
for (const tool of tools) {
|
|
599
618
|
const targetSkillDir = getTargetSkillDir(tool);
|
|
600
619
|
if (!targetSkillDir) continue;
|
|
601
|
-
const skillDir = path.join(targetSkillDir, normalizedSkill);
|
|
602
|
-
if (await pathExists(skillDir)) {
|
|
603
|
-
await removePath(skillDir);
|
|
604
|
-
removedAny = true;
|
|
605
|
-
}
|
|
606
|
-
|
|
620
|
+
const skillDir = path.join(targetSkillDir, normalizedSkill);
|
|
621
|
+
if (await pathExists(skillDir)) {
|
|
622
|
+
await removePath(skillDir);
|
|
623
|
+
removedAny = true;
|
|
624
|
+
}
|
|
625
|
+
if (tool === 'codex') {
|
|
626
|
+
const legacySkillDir = path.join(CODEX_HOME_SKILLS_DIR, normalizedSkill);
|
|
627
|
+
if (await pathExists(legacySkillDir)) {
|
|
628
|
+
await removePath(legacySkillDir);
|
|
629
|
+
removedAny = true;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
607
633
|
console.log(removedAny
|
|
608
634
|
? chalk.green(`Removed: ${normalizedSkill}`)
|
|
609
635
|
: chalk.yellow(`Skill not found: ${normalizedSkill}`));
|
|
@@ -639,10 +665,10 @@ async function run() {
|
|
|
639
665
|
|
|
640
666
|
if (command === 'update') {
|
|
641
667
|
try {
|
|
642
|
-
await ensureRuntimeForInstall();
|
|
643
|
-
const tools = resolveRequestedTools(options.tool);
|
|
644
|
-
await installSkillsForTools(SKILLS.map(skill => skill.name), tools);
|
|
645
|
-
console.log(chalk.green(`Updated ${SKILLS.length} skills for ${tools.join(', ')}`));
|
|
668
|
+
await ensureRuntimeForInstall();
|
|
669
|
+
const tools = resolveRequestedTools(options.tool);
|
|
670
|
+
await installSkillsForTools(SKILLS.map(skill => skill.name), tools, getInstallRoot(), { resetCodexNamespace: true });
|
|
671
|
+
console.log(chalk.green(`Updated ${SKILLS.length} skills for ${tools.join(', ')}`));
|
|
646
672
|
} catch (error) {
|
|
647
673
|
console.error(chalk.red(error.message));
|
|
648
674
|
process.exitCode = 1;
|
|
@@ -660,3 +686,4 @@ run().catch(error => {
|
|
|
660
686
|
process.exitCode = 1;
|
|
661
687
|
});
|
|
662
688
|
|
|
689
|
+
|
package/package.json
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
2
|
"name": "@pigcloud/skills",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"author": "Pig Skills Maintainers",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"ai",
|
|
9
|
-
"skills",
|
|
10
|
-
"openspec",
|
|
11
|
-
"pig-cloud",
|
|
12
|
-
"coding",
|
|
13
|
-
"distillation",
|
|
14
|
-
"agent",
|
|
15
|
-
"claude",
|
|
16
|
-
"cursor",
|
|
17
|
-
"copilot",
|
|
18
|
-
"trae"
|
|
19
|
-
],
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "https://gitee.com/rebys/pig-skills.git"
|
|
23
|
-
},
|
|
24
|
-
"bugs": {
|
|
25
|
-
"url": "https://gitee.com/rebys/pig-skills/issues"
|
|
26
|
-
},
|
|
27
|
-
"homepage": "https://gitee.com/rebys/pig-skills",
|
|
28
|
-
"bin": {
|
|
29
|
-
"pig-skills": "./bin/cli.js"
|
|
30
|
-
},
|
|
31
|
-
"main": "./index.js",
|
|
32
|
-
"files": [
|
|
33
|
-
"bin/",
|
|
34
|
-
"install.cmd",
|
|
35
|
-
"install.ps1",
|
|
36
|
-
"install.sh",
|
|
37
|
-
"pig-cloud-skills-commands/",
|
|
38
|
-
"rules/",
|
|
39
|
-
"skills/",
|
|
40
|
-
"scripts/",
|
|
41
|
-
"templates/",
|
|
42
|
-
"index.js",
|
|
43
|
-
"README.md",
|
|
44
|
-
"CHANGELOG.md"
|
|
45
|
-
],
|
|
46
|
-
"scripts": {
|
|
47
|
-
"test": "node validate-skills.js && node scripts/validate-skill-shapes.js && node scripts/validate-rules.js && node scripts/validate-skill-stop-rules.js && node scripts/validate-skill-replay-signals.js && node self-test-skills.js",
|
|
48
|
-
"test:self": "node self-test-skills.js",
|
|
49
|
-
"replay:golden": "node scripts/run-golden-replays.js",
|
|
50
|
-
"replay:golden:mock": "node scripts/run-golden-replays.js --provider mock",
|
|
51
|
-
"postinstall": "node bin/postinstall.js",
|
|
52
|
-
"validate:skills": "node validate-skills.js",
|
|
53
|
-
"validate:shapes": "node scripts/validate-skill-shapes.js",
|
|
54
|
-
"validate:rules": "node scripts/validate-rules.js",
|
|
55
|
-
"validate:stop-rules": "node scripts/validate-skill-stop-rules.js",
|
|
56
|
-
"validate:replay-signals": "node scripts/validate-skill-replay-signals.js"
|
|
57
|
-
},
|
|
58
|
-
"engines": {
|
|
59
|
-
"node": ">=14.0.0"
|
|
60
|
-
},
|
|
61
|
-
"dependencies": {
|
|
62
|
-
"commander": "^11.0.0",
|
|
63
|
-
"fs-extra": "^11.0.0",
|
|
64
|
-
"chalk": "^4.1.0",
|
|
65
|
-
"inquirer": "^8.0.0"
|
|
66
|
-
},
|
|
67
|
-
"devDependencies": {
|
|
68
|
-
"jest": "^29.0.0"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "面向 Codex、Trae 和 Claude Code 的 AI 技能包,提供共享技能、规则约束、工作流路由和 Pig Cloud 专属覆盖层。",
|
|
5
|
+
"author": "Pig Skills Maintainers",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"ai",
|
|
9
|
+
"skills",
|
|
10
|
+
"openspec",
|
|
11
|
+
"pig-cloud",
|
|
12
|
+
"coding",
|
|
13
|
+
"distillation",
|
|
14
|
+
"agent",
|
|
15
|
+
"claude",
|
|
16
|
+
"cursor",
|
|
17
|
+
"copilot",
|
|
18
|
+
"trae"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://gitee.com/rebys/pig-skills.git"
|
|
23
|
+
},
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://gitee.com/rebys/pig-skills/issues"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://gitee.com/rebys/pig-skills",
|
|
28
|
+
"bin": {
|
|
29
|
+
"pig-skills": "./bin/cli.js"
|
|
30
|
+
},
|
|
31
|
+
"main": "./index.js",
|
|
32
|
+
"files": [
|
|
33
|
+
"bin/",
|
|
34
|
+
"install.cmd",
|
|
35
|
+
"install.ps1",
|
|
36
|
+
"install.sh",
|
|
37
|
+
"pig-cloud-skills-commands/",
|
|
38
|
+
"rules/",
|
|
39
|
+
"skills/",
|
|
40
|
+
"scripts/",
|
|
41
|
+
"templates/",
|
|
42
|
+
"index.js",
|
|
43
|
+
"README.md",
|
|
44
|
+
"CHANGELOG.md"
|
|
45
|
+
],
|
|
46
|
+
"scripts": {
|
|
47
|
+
"test": "node validate-skills.js && node scripts/validate-skill-shapes.js && node scripts/validate-rules.js && node scripts/validate-skill-stop-rules.js && node scripts/validate-skill-replay-signals.js && node self-test-skills.js",
|
|
48
|
+
"test:self": "node self-test-skills.js",
|
|
49
|
+
"replay:golden": "node scripts/run-golden-replays.js",
|
|
50
|
+
"replay:golden:mock": "node scripts/run-golden-replays.js --provider mock",
|
|
51
|
+
"postinstall": "node bin/postinstall.js",
|
|
52
|
+
"validate:skills": "node validate-skills.js",
|
|
53
|
+
"validate:shapes": "node scripts/validate-skill-shapes.js",
|
|
54
|
+
"validate:rules": "node scripts/validate-rules.js",
|
|
55
|
+
"validate:stop-rules": "node scripts/validate-skill-stop-rules.js",
|
|
56
|
+
"validate:replay-signals": "node scripts/validate-skill-replay-signals.js"
|
|
57
|
+
},
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=14.0.0"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"commander": "^11.0.0",
|
|
63
|
+
"fs-extra": "^11.0.0",
|
|
64
|
+
"chalk": "^4.1.0",
|
|
65
|
+
"inquirer": "^8.0.0"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"jest": "^29.0.0"
|
|
69
|
+
}
|
|
70
|
+
}
|