@softspark/ai-toolkit 4.3.2 → 4.4.0

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.
@@ -54,11 +54,11 @@ def install_ai_tools(target_dir: Path, rules_dir: Path,
54
54
  # in the requested set, install it unconditionally.
55
55
 
56
56
  if "windsurf" in eds:
57
- windsurf_file = target_dir / ".codeium" / "windsurf" / "memories" / "global_rules.md"
58
57
  if dry_run:
59
58
  print(" Would inject: ~/.codeium/windsurf/memories/global_rules.md")
59
+ print(" Would generate: ~/.codeium/windsurf/skills/ai-toolkit-skill-catalogue/SKILL.md")
60
60
  else:
61
- inject_with_rules("generate-windsurf.sh", windsurf_file, rules_dir)
61
+ _install_windsurf_global(target_dir, rules_dir)
62
62
  installed.append("windsurf")
63
63
 
64
64
  if "gemini" in eds:
@@ -79,7 +79,8 @@ def install_ai_tools(target_dir: Path, rules_dir: Path,
79
79
 
80
80
  if "cline" in eds:
81
81
  if dry_run:
82
- print(" Would generate: ~/Documents/Cline/Rules/ai-toolkit-*.md")
82
+ print(" Would generate: ~/.cline/rules/ai-toolkit-*.md")
83
+ print(" Would generate: ~/.cline/skills/ai-toolkit-skill-catalogue/SKILL.md")
83
84
  else:
84
85
  _install_cline_global(target_dir, rules_dir)
85
86
  installed.append("cline")
@@ -149,11 +150,23 @@ def _install_codex_global(target_dir: Path, rules_dir: Path) -> None:
149
150
  _install_codex_skills(target_dir)
150
151
 
151
152
 
153
+ def _install_windsurf_global(target_dir: Path, rules_dir: Path) -> None:
154
+ """Install Windsurf global rules plus an Agent Skills catalogue pointer."""
155
+ windsurf_file = target_dir / ".codeium" / "windsurf" / "memories" / "global_rules.md"
156
+ inject_with_rules("generate-windsurf.sh", windsurf_file, rules_dir)
157
+
158
+ from generate_windsurf_skills import generate as gen_windsurf_skills
159
+ gen_windsurf_skills(
160
+ target_dir,
161
+ skill_root=".codeium/windsurf/skills",
162
+ )
163
+
164
+
152
165
  def _install_cline_global(target_dir: Path, rules_dir: Path) -> None:
153
- """Install Cline global rules in the documented user rules directory."""
166
+ """Install Cline global rules in the documented ~/.cline directory."""
154
167
  from generate_cline_rules import generate as gen_cline_rules
155
168
 
156
- rules_root = target_dir / "Documents" / "Cline" / "Rules"
169
+ rules_root = target_dir / ".cline" / "rules"
157
170
  gen_cline_rules(
158
171
  target_dir,
159
172
  rules_dir=rules_dir,
@@ -161,7 +174,10 @@ def _install_cline_global(target_dir: Path, rules_dir: Path) -> None:
161
174
  emit_workflows=False,
162
175
  managed_scopes=("standard", "custom"),
163
176
  )
164
- print(" Created: ~/Documents/Cline/Rules/ai-toolkit-*.md")
177
+ print(" Created: ~/.cline/rules/ai-toolkit-*.md")
178
+
179
+ from generate_cline_skills import generate as gen_cline_skills
180
+ gen_cline_skills(target_dir)
165
181
 
166
182
 
167
183
  def _install_roo_global(target_dir: Path, rules_dir: Path) -> None:
@@ -693,9 +709,11 @@ def _install_local_dry_run(reset: bool, editors: list[str] | None = None,
693
709
  print(" Would generate: .gemini/settings.json hooks (profile >= standard)")
694
710
  if add_native_surfaces:
695
711
  if "cursor" in eds:
696
- print(" Would generate: .cursor/hooks.json + .cursor/agents/ (profile=full)")
712
+ print(" Would generate: .cursor/hooks.json + .cursor/agents/ + .cursor/skills/ (profile=full)")
697
713
  if "windsurf" in eds:
698
- print(" Would generate: .windsurf/hooks.json (profile=full)")
714
+ print(" Would generate: .windsurf/hooks.json + .windsurf/skills/ (profile=full)")
715
+ if "cline" in eds:
716
+ print(" Would generate: .cline/skills/ (profile=full)")
699
717
  if "augment" in eds:
700
718
  print(" Would generate: .augment/agents/ + .augment/commands/ + "
701
719
  "$HOME/.augment/settings.json + .augment/skills/ (profile=full)")
@@ -907,6 +925,7 @@ def _create_local_ai_tool_configs(cwd: Path, rules_dir: Path,
907
925
  if add_native_surfaces:
908
926
  _try_generator("generate_cursor_hooks", cwd)
909
927
  _try_generator("generate_cursor_agents", cwd)
928
+ _try_generator("generate_cursor_skills", cwd)
910
929
 
911
930
  if "windsurf" in eds:
912
931
  inject_with_rules(
@@ -919,6 +938,7 @@ def _create_local_ai_tool_configs(cwd: Path, rules_dir: Path,
919
938
  rules_dir=rules_dir)
920
939
  if add_native_surfaces:
921
940
  _try_generator("generate_windsurf_hooks", cwd)
941
+ _try_generator("generate_windsurf_skills", cwd)
922
942
 
923
943
  if "cline" in eds:
924
944
  # Migrate: remove legacy .clinerules single file (replaced by directory)
@@ -933,6 +953,8 @@ def _create_local_ai_tool_configs(cwd: Path, rules_dir: Path,
933
953
  rules_dir=rules_dir,
934
954
  managed_scopes=("standard", "lang", "custom"),
935
955
  )
956
+ if add_native_surfaces:
957
+ _try_generator("generate_cline_skills", cwd)
936
958
 
937
959
  if "roo" in eds:
938
960
  roo_output = run_script("generate-roo-modes.sh", capture=True)
@@ -0,0 +1,49 @@
1
+ """Shared generator for editor-native ai-toolkit skill catalogue pointers."""
2
+ from __future__ import annotations
3
+
4
+ from pathlib import Path
5
+
6
+ from emission import emit_skills_bullets
7
+
8
+
9
+ POINTER_SKILL_NAME = "ai-toolkit-skill-catalogue"
10
+
11
+
12
+ def build_pointer_skill(editor_name: str) -> str:
13
+ """Build a SKILL.md pointer to the canonical ai-toolkit skill catalogue."""
14
+ body = (
15
+ "# AI Toolkit Skill Catalogue\n\n"
16
+ f"This workspace uses ai-toolkit with {editor_name}. Real skills are "
17
+ "installed alongside Claude Code at `.claude/skills/` (project "
18
+ "install) or `~/.claude/skills/` (global install). If those paths are "
19
+ "not present, use the catalogue below to identify the matching "
20
+ "ai-toolkit skill before recreating its workflow manually.\n\n"
21
+ "## When to use this skill\n\n"
22
+ "- The user's request maps to one of the catalogued skills below.\n"
23
+ "- You need to discover which ai-toolkit skill should guide the task.\n\n"
24
+ "## How to use a catalogue entry\n\n"
25
+ "1. Match the user's task to a skill name in the catalogue.\n"
26
+ "2. Read the skill's SKILL.md from `.claude/skills/<name>/SKILL.md` "
27
+ "or `~/.claude/skills/<name>/SKILL.md` when available.\n"
28
+ "3. Follow that skill's workflow, rules, gotchas, and exclusions.\n\n"
29
+ "## Catalogue\n\n"
30
+ f"{emit_skills_bullets()}\n"
31
+ )
32
+ return (
33
+ "---\n"
34
+ f"name: {POINTER_SKILL_NAME}\n"
35
+ "description: Index of ai-toolkit skills installed at .claude/skills/"
36
+ " or ~/.claude/skills/. Read this first when the user's request "
37
+ "matches a named skill.\n"
38
+ "---\n"
39
+ f"{body}"
40
+ )
41
+
42
+
43
+ def write_pointer_skill(target_dir: Path, skill_root: str, editor_name: str) -> Path:
44
+ """Write a pointer skill under ``skill_root/<pointer>/SKILL.md``."""
45
+ skill_dir = target_dir / skill_root / POINTER_SKILL_NAME
46
+ skill_dir.mkdir(parents=True, exist_ok=True)
47
+ skill_file = skill_dir / "SKILL.md"
48
+ skill_file.write_text(build_pointer_skill(editor_name), encoding="utf-8")
49
+ return skill_file