neo-skill 0.1.11 → 0.1.12

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
@@ -4,14 +4,22 @@
4
4
 
5
5
  **GitHub**: https://github.com/liuminxin45/neo-skill
6
6
 
7
- ## 安装
7
+ ## 使用方式
8
+
9
+ **前置依赖**:需要安装 Python 3.8+
10
+
11
+ ### 直接运行 Python 模块
8
12
 
9
13
  ```bash
10
- # 全局安装
11
- npm install -g neo-skill
12
- ```
14
+ # 初始化技能
15
+ python -m omni_skill.cli init --ai claude
13
16
 
14
- **前置依赖**:需要安装 Python 3.8+(命令行执行依赖 Python)
17
+ # 生成技能输出
18
+ python -m skill_creator.cli generate skills/skill-name/skillspec.json
19
+
20
+ # 验证技能
21
+ python -m skill_creator.cli validate skills/skill-name/skillspec.json
22
+ ```
15
23
 
16
24
  ## 功能说明
17
25
  - 使用 canonical `skills/<skill>/skillspec.json` 作为单一真源(single source of truth)
@@ -38,64 +46,35 @@ npm install -g neo-skill
38
46
 
39
47
  ### 典型使用场景
40
48
 
41
- **场景 1:在 neo-skill 仓库内开发/维护 skill**
42
- ```bash
43
- # 从仓库根目录执行,初始化指定 AI 助手的技能文件
44
- omni-skill init --ai claude
45
- omni-skill init --ai windsurf
46
- omni-skill init --ai all # 初始化所有支持的 AI 助手
47
- ```
48
-
49
- **场景 2:在 neo-skill 仓库内更新并重新生成所有 IDE 入口文件**
50
- 在 neo-skill 仓库根目录执行:
51
-
52
- ```bash
53
- omni-skill update
54
- ```
55
-
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
- ### 推荐用法
49
+ ### 使用场景
67
50
 
51
+ **初始化技能文件**
68
52
  ```bash
69
- # 初始化指定 AI 助手
70
- omni-skill init --ai claude
71
- omni-skill init --ai windsurf --ai cursor # 可指定多个
72
-
73
- # 初始化所有支持的 AI 助手
74
- omni-skill init --ai all
53
+ # 初始化指定 AI 助手的技能文件
54
+ python -m omni_skill.cli init --ai claude
55
+ python -m omni_skill.cli init --ai windsurf
56
+ python -m omni_skill.cli init --ai all # 初始化所有支持的 AI 助手
75
57
 
76
58
  # 更新(基于上次 init 的配置)
77
- omni-skill update
59
+ python -m omni_skill.cli update
78
60
  ```
79
61
 
80
- ### 关于 npm 安装后的 init 行为
81
-
82
- 当你通过 `npm install -g neo-skill` 安装后:
62
+ **生成和验证技能**
63
+ ```bash
64
+ # 生成技能输出
65
+ python -m skill_creator.cli generate skills/skill-name/skillspec.json
83
66
 
84
- - **命令来源**:`omni-skill` 和 `skill-creator` 命令来自全局 npm 包(内部调用 Python)
85
- - **同步内容**:`omni-skill init` 会把包内的技能/资源内容同步到当前项目目录(覆盖式同步):
86
- - `skills/`
87
- - `.shared/skill-creator/`
88
- - 以及指定 AI 对应的目录(如 `.claude/skills/`、`.windsurf/workflows/` 等)
67
+ # 验证技能
68
+ python -m skill_creator.cli validate skills/skill-name/skillspec.json
89
69
 
90
- **核心行为:**
91
- - 根据 `--ai` 参数生成对应 IDE 的入口文件
92
- - 不同 IDE 可以共存,切换 IDE 时无需重新生成
93
- - 生成的文件都是从 canonical `skills/<skill>/skillspec.json` 渲染而来
70
+ # 打包 Claude 技能
71
+ python -m skill_creator.cli package --target claude --skill skill-name
72
+ ```
94
73
 
95
- **参数说明:**
96
- - `init`:初始化技能文件
97
- - `update`:基于上次 init 保存的配置重新同步
98
- - `--ai <target>`:指定目标 AI 助手(可重复使用)
74
+ **在其他项目中使用**
75
+ 将 neo-skill 仓库克隆到你的项目中(例如 `vendor/neo-skill/`),然后:
76
+ 1. 设置 PYTHONPATH:`export PYTHONPATH=$PWD/vendor/neo-skill/src:$PYTHONPATH`
77
+ 2. 运行命令:`python -m omni_skill.cli init --ai claude`
99
78
 
100
79
  **支持的 AI 助手:**
101
80
  claude, cursor, windsurf, antigravity, copilot, kiro, codex, qoder, roocode, gemini, trae, opencode, continue, all
package/package.json CHANGED
@@ -1,14 +1,9 @@
1
1
  {
2
2
  "name": "neo-skill",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
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
- },
10
6
  "files": [
11
- "bin/**",
12
7
  "src/**",
13
8
  "skills/**",
14
9
  ".shared/**",
@@ -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();