neo-skill 0.1.11 → 0.1.13

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,16 +2,48 @@
2
2
 
3
3
  一个确定性的 **skill-creator** 仓库。
4
4
 
5
- **GitHub**: https://github.com/liuminxin45/neo-skill
5
+ **GitHub**: https://github.com/liuminxin45/neo-skill
6
+ **npm**: https://www.npmjs.com/package/neo-skill
6
7
 
7
8
  ## 安装
8
9
 
9
10
  ```bash
10
- # 全局安装
11
+ # 通过 npm 安装(推荐)
11
12
  npm install -g neo-skill
13
+
14
+ # 或通过 pip 安装
15
+ pip install neo-skill
12
16
  ```
13
17
 
14
- **前置依赖**:需要安装 Python 3.8+(命令行执行依赖 Python)
18
+ **前置依赖**:需要安装 Python 3.8+
19
+
20
+ ## 使用方式
21
+
22
+ ### 命令行工具(安装后)
23
+
24
+ ```bash
25
+ # 初始化技能
26
+ omni-skill init --ai claude
27
+
28
+ # 生成技能输出
29
+ skill-creator generate skills/skill-name/skillspec.json
30
+
31
+ # 验证技能
32
+ skill-creator validate skills/skill-name/skillspec.json
33
+ ```
34
+
35
+ ### 直接运行 Python 模块(开发模式)
36
+
37
+ ```bash
38
+ # 初始化技能
39
+ python -m omni_skill.cli init --ai claude
40
+
41
+ # 生成技能输出
42
+ python -m skill_creator.cli generate skills/skill-name/skillspec.json
43
+
44
+ # 验证技能
45
+ python -m skill_creator.cli validate skills/skill-name/skillspec.json
46
+ ```
15
47
 
16
48
  ## 功能说明
17
49
  - 使用 canonical `skills/<skill>/skillspec.json` 作为单一真源(single source of truth)
@@ -38,64 +70,35 @@ npm install -g neo-skill
38
70
 
39
71
  ### 典型使用场景
40
72
 
41
- **场景 1:在 neo-skill 仓库内开发/维护 skill**
73
+ ### 使用场景
74
+
75
+ **初始化技能文件**
42
76
  ```bash
43
- # 从仓库根目录执行,初始化指定 AI 助手的技能文件
77
+ # 初始化指定 AI 助手的技能文件
44
78
  omni-skill init --ai claude
45
79
  omni-skill init --ai windsurf
46
80
  omni-skill init --ai all # 初始化所有支持的 AI 助手
47
- ```
48
81
 
49
- **场景 2:在 neo-skill 仓库内更新并重新生成所有 IDE 入口文件**
50
- 在 neo-skill 仓库根目录执行:
51
-
52
- ```bash
82
+ # 更新(基于上次 init 的配置)
53
83
  omni-skill update
54
84
  ```
55
85
 
56
- 行为说明:
57
- - 根据上次 init 时保存的 AI 目标,重新同步/生成所有入口文件
58
-
59
- **场景 3:在其他项目中使用 neo-skill 的 skill**
60
- 将 neo-skill 仓库克隆到你的项目中(例如 `vendor/neo-skill/`),然后根据你使用的 IDE,复制对应的入口文件到项目根目录:
61
- - **Windsurf**:复制 `.windsurf/workflows/<skill>.md` 和 `.windsurf/workflows/data/`
62
- - **Cursor**:复制 `.cursor/commands/<skill>.md`
63
- - **Claude Desktop**:复制 `.claude/skills/<skill>/`
64
- - **GitHub / VS Code Skills**:复制 `.github/skills/<skill>/`
65
-
66
- ### 推荐用法
67
-
86
+ **生成和验证技能**
68
87
  ```bash
69
- # 初始化指定 AI 助手
70
- omni-skill init --ai claude
71
- omni-skill init --ai windsurf --ai cursor # 可指定多个
88
+ # 生成技能输出
89
+ skill-creator generate skills/skill-name/skillspec.json
72
90
 
73
- # 初始化所有支持的 AI 助手
74
- omni-skill init --ai all
91
+ # 验证技能
92
+ skill-creator validate skills/skill-name/skillspec.json
75
93
 
76
- # 更新(基于上次 init 的配置)
77
- omni-skill update
94
+ # 打包 Claude 技能
95
+ skill-creator package --target claude --skill skill-name
78
96
  ```
79
97
 
80
- ### 关于 npm 安装后的 init 行为
81
-
82
- 当你通过 `npm install -g neo-skill` 安装后:
83
-
84
- - **命令来源**:`omni-skill` 和 `skill-creator` 命令来自全局 npm 包(内部调用 Python)
85
- - **同步内容**:`omni-skill init` 会把包内的技能/资源内容同步到当前项目目录(覆盖式同步):
86
- - `skills/`
87
- - `.shared/skill-creator/`
88
- - 以及指定 AI 对应的目录(如 `.claude/skills/`、`.windsurf/workflows/` 等)
89
-
90
- **核心行为:**
91
- - 根据 `--ai` 参数生成对应 IDE 的入口文件
92
- - 不同 IDE 可以共存,切换 IDE 时无需重新生成
93
- - 生成的文件都是从 canonical `skills/<skill>/skillspec.json` 渲染而来
94
-
95
- **参数说明:**
96
- - `init`:初始化技能文件
97
- - `update`:基于上次 init 保存的配置重新同步
98
- - `--ai <target>`:指定目标 AI 助手(可重复使用)
98
+ **在其他项目中使用**
99
+ 将 neo-skill 仓库克隆到你的项目中(例如 `vendor/neo-skill/`),然后:
100
+ 1. 设置 PYTHONPATH:`export PYTHONPATH=$PWD/vendor/neo-skill/src:$PYTHONPATH`
101
+ 2. 运行命令:`omni-skill init --ai claude`
99
102
 
100
103
  **支持的 AI 助手:**
101
104
  claude, cursor, windsurf, antigravity, copilot, kiro, codex, qoder, roocode, gemini, trae, opencode, continue, all
package/package.json CHANGED
@@ -1,14 +1,10 @@
1
1
  {
2
2
  "name": "neo-skill",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "A multi-assistant skill generator (Claude/Windsurf/Cursor/GitHub Skills) driven by a canonical SkillSpec.",
5
5
  "license": "MIT",
6
- "bin": {
7
- "omni-skill": "bin/omni-skill.js",
8
- "skill-creator": "bin/skill-creator.js"
9
- },
6
+ "main": "src/skill_creator/__init__.py",
10
7
  "files": [
11
- "bin/**",
12
8
  "src/**",
13
9
  "skills/**",
14
10
  ".shared/**",
@@ -16,9 +12,12 @@
16
12
  ".windsurf/**",
17
13
  ".cursor/**",
18
14
  ".github/skills/**",
19
- "README.md"
15
+ "README.md",
16
+ "pyproject.toml"
20
17
  ],
21
- "scripts": {},
18
+ "scripts": {
19
+ "postinstall": "pip install -e . 2>/dev/null || python -m pip install -e . 2>/dev/null || echo 'Warning: Python package installation failed. Please run: pip install neo-skill'"
20
+ },
22
21
  "engines": {
23
22
  "node": ">=16"
24
23
  }
package/pyproject.toml ADDED
@@ -0,0 +1,25 @@
1
+ [build-system]
2
+ requires = ["setuptools>=56"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "neo-skill"
7
+ dynamic = ["version"]
8
+ description = "A multi-assistant skill generator (Claude/Windsurf/Cursor/GitHub Skills) driven by a canonical SkillSpec."
9
+ requires-python = ">=3.8"
10
+ license = {text = "MIT"}
11
+ authors = [{name = "skill-creator"}]
12
+
13
+ [project.scripts]
14
+ omni-skill = "omni_skill.cli:main"
15
+ skill-creator = "skill_creator.cli:main"
16
+
17
+ [tool.setuptools]
18
+ package-dir = {"" = "src"}
19
+
20
+ [tool.setuptools.packages.find]
21
+ where = ["src"]
22
+
23
+ [tool.setuptools.dynamic]
24
+ version = {attr = "skill_creator.__version__"}
25
+
@@ -2,8 +2,7 @@
2
2
  "version": 1,
3
3
  "name": "review-gate",
4
4
  "description": "为 TypeScript/JavaScript(React/Vue/Node)项目建立架构与工程化 Review 规范:明确分层职责边界、模块 API 设计、副作用隔离、复杂度与可读性、错误处理策略等,提供可执行的 PR Review Checklist,防止架构在长期演进中"慢慢写歪"。",
5
- "assistants": ["claude", "windsurf", "cursor", "github-skills"],
6
- "questions": [
5
+ "questions": [
7
6
  "你的仓库采用什么分层模型(type-first / feature-first / 其他),现有层级命名是什么?",
8
7
  "是否已有明确的架构/工程规范文档,或仅依靠口头约定?",
9
8
  "PR Review 流程是什么(必须至少 1 人 approve / 需要架构师 review / 其他)?",
@@ -1 +1,6 @@
1
- __version__ = "0.1.11"
1
+ import json
2
+ from pathlib import Path
3
+
4
+ # Read version from package.json (single source of truth)
5
+ _pkg_json = Path(__file__).parent.parent.parent / "package.json"
6
+ __version__ = json.loads(_pkg_json.read_text())["version"]
package/bin/omni-skill.js DELETED
@@ -1,55 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { spawnSync } = require("child_process");
4
- const path = require("path");
5
-
6
- function main() {
7
- const pkgRoot = path.resolve(__dirname, "..");
8
- const pySrc = path.join(pkgRoot, "src");
9
-
10
- const env = { ...process.env };
11
- env.PYTHONPATH = env.PYTHONPATH ? `${pySrc}${path.delimiter}${env.PYTHONPATH}` : pySrc;
12
-
13
- const baseArgs = ["-m", "omni_skill.cli", ...process.argv.slice(2)];
14
-
15
- const candidates = [];
16
- if (env.OMNI_SKILL_PYTHON) {
17
- candidates.push({ cmd: env.OMNI_SKILL_PYTHON, extraArgs: [] });
18
- }
19
- if (process.platform === "win32") {
20
- candidates.push({ cmd: "python", extraArgs: [] });
21
- candidates.push({ cmd: "python3", extraArgs: [] });
22
- candidates.push({ cmd: "py", extraArgs: ["-3"] });
23
- } else {
24
- candidates.push({ cmd: "python3", extraArgs: [] });
25
- candidates.push({ cmd: "python", extraArgs: [] });
26
- }
27
-
28
- let lastError = null;
29
- for (const c of candidates) {
30
- const r = spawnSync(c.cmd, [...c.extraArgs, ...baseArgs], { stdio: "inherit", env });
31
- if (r.error) {
32
- lastError = r.error;
33
- const msg = String(r.error.message || "").toLowerCase();
34
- if (msg.includes("enoent")) {
35
- continue;
36
- }
37
- console.error(r.error);
38
- process.exit(1);
39
- }
40
- if (typeof r.status === "number" && r.status === 9009) {
41
- continue;
42
- }
43
- process.exit(r.status == null ? 1 : r.status);
44
- }
45
-
46
- console.error(
47
- "Python not found. Please install Python 3 and ensure 'python' works, or set OMNI_SKILL_PYTHON to your interpreter path.",
48
- );
49
- if (lastError) {
50
- console.error(lastError);
51
- }
52
- process.exit(127);
53
- }
54
-
55
- main();
@@ -1,55 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { spawnSync } = require("child_process");
4
- const path = require("path");
5
-
6
- function main() {
7
- const pkgRoot = path.resolve(__dirname, "..");
8
- const pySrc = path.join(pkgRoot, "src");
9
-
10
- const env = { ...process.env };
11
- env.PYTHONPATH = env.PYTHONPATH ? `${pySrc}${path.delimiter}${env.PYTHONPATH}` : pySrc;
12
-
13
- const baseArgs = ["-m", "skill_creator.cli", ...process.argv.slice(2)];
14
-
15
- const candidates = [];
16
- if (env.OMNI_SKILL_PYTHON) {
17
- candidates.push({ cmd: env.OMNI_SKILL_PYTHON, extraArgs: [] });
18
- }
19
- if (process.platform === "win32") {
20
- candidates.push({ cmd: "python", extraArgs: [] });
21
- candidates.push({ cmd: "python3", extraArgs: [] });
22
- candidates.push({ cmd: "py", extraArgs: ["-3"] });
23
- } else {
24
- candidates.push({ cmd: "python3", extraArgs: [] });
25
- candidates.push({ cmd: "python", extraArgs: [] });
26
- }
27
-
28
- let lastError = null;
29
- for (const c of candidates) {
30
- const r = spawnSync(c.cmd, [...c.extraArgs, ...baseArgs], { stdio: "inherit", env });
31
- if (r.error) {
32
- lastError = r.error;
33
- const msg = String(r.error.message || "").toLowerCase();
34
- if (msg.includes("enoent")) {
35
- continue;
36
- }
37
- console.error(r.error);
38
- process.exit(1);
39
- }
40
- if (typeof r.status === "number" && r.status === 9009) {
41
- continue;
42
- }
43
- process.exit(r.status == null ? 1 : r.status);
44
- }
45
-
46
- console.error(
47
- "Python not found. Please install Python 3 and ensure 'python' works, or set OMNI_SKILL_PYTHON to your interpreter path.",
48
- );
49
- if (lastError) {
50
- console.error(lastError);
51
- }
52
- process.exit(127);
53
- }
54
-
55
- main();