neo-skill 0.1.18 → 0.1.19

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
@@ -85,7 +85,10 @@ omni-skill init --ai all # 初始化所有支持的 AI 助手
85
85
 
86
86
  这会:
87
87
  - 从 npm 包同步 skills/ 和 .shared/ 到当前目录
88
- - 为所有 skills 生成 AI 助手的输出文件(.windsurf, .claude, .cursor, .github)
88
+ - 为所有 skills 生成**指定 AI 助手**的输出文件
89
+ - `--ai windsurf` → 只生成 `.windsurf/workflows/`
90
+ - `--ai claude` → 只生成 `.claude/skills/`
91
+ - `--ai all` → 生成所有目标
89
92
  - 保存初始化状态到 .neo-skill.json
90
93
 
91
94
  **2. 使用 skill-creator 创建新 skill**
@@ -103,7 +106,9 @@ omni-skill install ./skills
103
106
 
104
107
  这会:
105
108
  - 复制 skill 到当前目录的 skills/ 文件夹
106
- - 为该 skill 生成所有 AI 助手的输出文件
109
+ - 为该 skill 生成**所有 AI 助手**的输出文件(.windsurf, .claude, .cursor, .github)
110
+
111
+ **注意**:与 `init` 不同,`install` 命令总是生成所有 AI 目标的输出,以确保最大兼容性。
107
112
 
108
113
  **4. 更新 npm 包**
109
114
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo-skill",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "A multi-assistant skill generator (Claude/Windsurf/Cursor/GitHub Skills) driven by a canonical SkillSpec.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -25,10 +25,15 @@ omni-skill init --ai all
25
25
 
26
26
  **What it does:**
27
27
  1. Syncs skills/ and .shared/ from npm package to current directory
28
- 2. Installs all skills (generates outputs for all AI targets)
28
+ 2. Installs all skills (generates outputs for **specified AI targets only**)
29
29
  3. Writes VERSION files for each AI target
30
30
  4. Saves init state to .neo-skill.json
31
31
 
32
+ **Example:**
33
+ - `omni-skill init --ai windsurf` → Only generates `.windsurf/workflows/`
34
+ - `omni-skill init --ai claude` → Only generates `.claude/skills/`
35
+ - `omni-skill init --ai all` → Generates all targets (.windsurf, .claude, .cursor, .github)
36
+
32
37
  ### `omni-skill install <path>`
33
38
  Install skill(s) from a local directory.
34
39
 
@@ -43,7 +48,9 @@ omni-skill install ./skills
43
48
 
44
49
  **What it does:**
45
50
  1. Copies skill(s) to current directory's skills/ folder
46
- 2. Generates outputs for all AI targets (.windsurf, .claude, .cursor, .github)
51
+ 2. Generates outputs for **all AI targets** (.windsurf, .claude, .cursor, .github)
52
+
53
+ **Note:** Unlike `init`, the `install` command always generates outputs for all AI targets to ensure maximum compatibility.
47
54
 
48
55
  ### `omni-skill update`
49
56
  Update npm package and re-initialize skills.
@@ -4,7 +4,7 @@ import argparse
4
4
  import json
5
5
  import shutil
6
6
  from pathlib import Path
7
- from typing import Dict, List, Set
7
+ from typing import Dict, List, Optional, Set
8
8
 
9
9
  from skill_creator.cli import cmd_generate
10
10
 
@@ -192,10 +192,15 @@ def _generate_outputs_best_effort(pkg_root: Path, cwd: Path) -> None:
192
192
  print(f" Skipping generator for {rel} (exit {e.code})")
193
193
 
194
194
 
195
- def _install_skills_from_dir(skills_dir: Path, cwd: Path) -> int:
195
+ def _install_skills_from_dir(skills_dir: Path, cwd: Path, selected_ais: Optional[List[str]] = None) -> int:
196
196
  """
197
197
  Install skills from a directory (either from npm package or local path).
198
- Generates outputs for all AI targets.
198
+ Generates outputs for specified AI targets.
199
+
200
+ Args:
201
+ skills_dir: Directory containing skills
202
+ cwd: Current working directory
203
+ selected_ais: List of AI targets to generate for. If None, generates for all targets.
199
204
  """
200
205
  if not skills_dir.exists():
201
206
  print(f"Skills directory not found: {skills_dir}")
@@ -206,6 +211,37 @@ def _install_skills_from_dir(skills_dir: Path, cwd: Path) -> int:
206
211
  print(f"No skillspec.json found in: {skills_dir}")
207
212
  return 1
208
213
 
214
+ # Determine target mapping: AI assistant -> skill-creator target
215
+ ai_to_target = {
216
+ "windsurf": "windsurf",
217
+ "claude": "claude",
218
+ "cursor": "cursor",
219
+ "antigravity": "github",
220
+ "copilot": "github",
221
+ "kiro": "github",
222
+ "codex": "github",
223
+ "qoder": "github",
224
+ "roocode": "github",
225
+ "gemini": "github",
226
+ "trae": "github",
227
+ "opencode": "github",
228
+ "continue": "github",
229
+ }
230
+
231
+ # Determine which targets to generate
232
+ if selected_ais is None:
233
+ # Generate all targets
234
+ generate_all_targets = True
235
+ targets_list = None
236
+ else:
237
+ # Map AI assistants to skill-creator targets
238
+ targets_set = set()
239
+ for ai in selected_ais:
240
+ target = ai_to_target.get(ai, "windsurf")
241
+ targets_set.add(target)
242
+ targets_list = sorted(targets_set)
243
+ generate_all_targets = False
244
+
209
245
  print(f"\nInstalling {len(specs)} skill(s) from {skills_dir} ...")
210
246
  for spec_path in specs:
211
247
  skill_name = spec_path.parent.name
@@ -221,11 +257,18 @@ def _install_skills_from_dir(skills_dir: Path, cwd: Path) -> int:
221
257
  shutil.copytree(spec_path.parent, dest_skill_dir)
222
258
  print(f" Copied to: {dest_skill_dir}")
223
259
 
224
- # Generate outputs for all targets
260
+ # Generate outputs for specified targets
225
261
  try:
226
- ns = argparse.Namespace(repo_root=str(cwd), spec=str(cwd / "skills" / skill_name / "skillspec.json"), all=True)
227
- cmd_generate(ns)
228
- print(f" Generated outputs for all targets")
262
+ if generate_all_targets:
263
+ ns = argparse.Namespace(repo_root=str(cwd), spec=str(cwd / "skills" / skill_name / "skillspec.json"), all=True)
264
+ cmd_generate(ns)
265
+ print(f" Generated outputs for all targets")
266
+ else:
267
+ # Generate for each target separately
268
+ for target in targets_list:
269
+ ns = argparse.Namespace(repo_root=str(cwd), spec=str(cwd / "skills" / skill_name / "skillspec.json"), all=False, target=target)
270
+ cmd_generate(ns)
271
+ print(f" Generated outputs for: {', '.join(targets_list)}")
229
272
  except SystemExit as e:
230
273
  print(f" Warning: Generator failed (exit {e.code})")
231
274
 
@@ -242,10 +285,10 @@ def _handle_init(selected_ais: List[str], mode: str) -> int:
242
285
  print("Initializing skills in:", cwd)
243
286
  _perform_sync(pkg_root, cwd, sync_pairs)
244
287
 
245
- # Install all skills from npm package
288
+ # Install all skills from npm package with specified AI targets
246
289
  pkg_skills_dir = pkg_root / "skills"
247
290
  if pkg_skills_dir.exists():
248
- _install_skills_from_dir(pkg_skills_dir, cwd)
291
+ _install_skills_from_dir(pkg_skills_dir, cwd, selected_ais=selected_ais)
249
292
 
250
293
  _write_version_files(cwd, effective_ais, version)
251
294
  print("\nDone! neo-skill initialized.")
@@ -271,6 +314,8 @@ def _cmd_install(args: argparse.Namespace) -> int:
271
314
  """
272
315
  Install skill(s) from a local directory.
273
316
  Usage: omni-skill install <path-to-skill-or-skills-dir>
317
+
318
+ Note: install command always generates outputs for all AI targets.
274
319
  """
275
320
  cwd = Path.cwd().resolve()
276
321
  skill_path = Path(args.path).resolve()
@@ -280,13 +325,13 @@ def _cmd_install(args: argparse.Namespace) -> int:
280
325
 
281
326
  # Check if it's a single skill directory (contains skillspec.json)
282
327
  if (skill_path / "skillspec.json").exists():
283
- # Single skill
328
+ # Single skill - generate for all targets
284
329
  temp_skills_dir = skill_path.parent
285
- return _install_skills_from_dir(temp_skills_dir, cwd)
330
+ return _install_skills_from_dir(temp_skills_dir, cwd, selected_ais=None)
286
331
 
287
332
  # Check if it's a skills directory (contains subdirs with skillspec.json)
288
333
  elif skill_path.is_dir():
289
- return _install_skills_from_dir(skill_path, cwd)
334
+ return _install_skills_from_dir(skill_path, cwd, selected_ais=None)
290
335
 
291
336
  else:
292
337
  raise SystemExit(f"Invalid path: {skill_path}. Must be a skill directory or skills directory.")