skillpull 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/skillpull +33 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillpull",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Sync AI agent skills from Git repositories to Claude, Codex, Kiro, and Cursor",
5
5
  "bin": {
6
6
  "skillpull": "./skillpull"
package/skillpull CHANGED
@@ -1,34 +1,39 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
3
 
4
- VERSION="0.2.0"
4
+ VERSION="0.2.1"
5
5
  MANIFEST_FILE=".skillpull.json"
6
6
  TMPDIR_PREFIX="skillpull"
7
7
  CONFIG_DIR="$HOME/.config/skillpull"
8
8
  CONFIG_FILE="$CONFIG_DIR/config.json"
9
9
 
10
- # ── Agent targets ──
11
- # Format: PROJECT_DIR|GLOBAL_DIR|FORMAT
12
- # FORMAT: skill = SKILL.md folder, mdc = .cursor/rules/*.mdc
13
- declare -A AGENT_PROJECT AGENT_GLOBAL AGENT_FORMAT
14
- AGENT_PROJECT=(
15
- [claude]=".claude/skills"
16
- [codex]=".codex/skills"
17
- [kiro]=".kiro/skills"
18
- [cursor]=".cursor/rules"
19
- )
20
- AGENT_GLOBAL=(
21
- [claude]="$HOME/.claude/skills"
22
- [codex]="$HOME/.codex/skills"
23
- [kiro]="$HOME/.kiro/skills"
24
- [cursor]="" # Cursor has no global file-based rules
25
- )
26
- AGENT_FORMAT=(
27
- [claude]="skill"
28
- [codex]="skill"
29
- [kiro]="skill"
30
- [cursor]="mdc"
31
- )
10
+ # ── Agent targets (bash 3 compatible) ──
11
+ agent_project() {
12
+ case "$1" in
13
+ claude) echo ".claude/skills" ;;
14
+ codex) echo ".codex/skills" ;;
15
+ kiro) echo ".kiro/skills" ;;
16
+ cursor) echo ".cursor/rules" ;;
17
+ esac
18
+ }
19
+
20
+ agent_global() {
21
+ case "$1" in
22
+ claude) echo "$HOME/.claude/skills" ;;
23
+ codex) echo "$HOME/.codex/skills" ;;
24
+ kiro) echo "$HOME/.kiro/skills" ;;
25
+ cursor) echo "" ;;
26
+ esac
27
+ }
28
+
29
+ agent_format() {
30
+ case "$1" in
31
+ claude) echo "skill" ;;
32
+ codex) echo "skill" ;;
33
+ kiro) echo "skill" ;;
34
+ cursor) echo "mdc" ;;
35
+ esac
36
+ }
32
37
 
33
38
  DEFAULT_AGENT="claude"
34
39
 
@@ -223,14 +228,14 @@ resolve_target_dir() {
223
228
  return
224
229
  fi
225
230
  if [[ "$is_global" == "1" ]]; then
226
- local gdir="${AGENT_GLOBAL[$agent]:-}"
231
+ local gdir; gdir="$(agent_global "$agent")"
227
232
  if [[ -z "$gdir" ]]; then
228
233
  err "$agent does not support global rules (no file-based global path)"
229
234
  return 1
230
235
  fi
231
236
  echo "$gdir"
232
237
  else
233
- echo "${AGENT_PROJECT[$agent]}"
238
+ echo "$(agent_project "$agent")"
234
239
  fi
235
240
  }
236
241
 
@@ -323,7 +328,7 @@ get_branch() {
323
328
 
324
329
  cmd_pull() {
325
330
  local repo_url="$1" skill_filter="${2:-}" target_dir="$3" force="${4:-0}" dry_run="${5:-0}" agent="${6:-claude}"
326
- local fmt="${AGENT_FORMAT[$agent]:-skill}"
331
+ local fmt; fmt="$(agent_format "$agent")"
327
332
  make_tmp
328
333
  local tmpdir="$_TMPDIR"
329
334
 
@@ -487,7 +492,7 @@ cmd_installed() {
487
492
 
488
493
  cmd_remove() {
489
494
  local skill_name="$1" target_dir="$2" agent="${3:-claude}"
490
- local fmt="${AGENT_FORMAT[$agent]:-skill}"
495
+ local fmt; fmt="$(agent_format "$agent")"
491
496
 
492
497
  if [[ "$fmt" == "mdc" ]]; then
493
498
  local dest="$target_dir/${skill_name}.mdc"
@@ -576,7 +581,7 @@ cmd_update() {
576
581
 
577
582
  cmd_push() {
578
583
  local target_dir="$1" repo_url="$2" agent="$3"
579
- local fmt="${AGENT_FORMAT[$agent]:-skill}"
584
+ local fmt; fmt="$(agent_format "$agent")"
580
585
 
581
586
  if [[ ! -d "$target_dir" ]]; then
582
587
  err "No skills directory found at $target_dir"